Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added javadoc, removed unused exceptions #217

Merged
merged 6 commits into from
Jan 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
import java.util.LinkedList;
import java.util.List;

/**
* List of <a
* href=https://github.com/aeternity/protocol/blob/master/node/api/api_encoding.md#encoding-scheme-for-api-identifiers-and-byte-arrays>encoding
* identifiers </a>
*/
public interface ApiIdentifiers {

// API identifiers
// https://github.com/aeternity/protocol/blob/master/node/api/api_encoding.md#encoding-scheme-for-api-identifiers-and-byte-arrays

// base58
String ACCOUNT_PUBKEY = "ak"; // base58 Account pubkey

Expand Down Expand Up @@ -40,7 +42,7 @@ public interface ApiIdentifiers {

String TRANSACTION_HASH = "th"; // base58 Transaction hash

// Base 64
// base 64
String CONTRACT_BYTE_ARRAY = "cb"; // base64 Contract byte array

String ORACLE_RESPONSE = "or"; // base64 Oracle response
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.kryptokrauts.aeternity.sdk.constants;

/**
* needed for transaction-signature
* https://github.com/aeternity/protocol/blob/master/consensus/consensus.md#transaction-signature
* List of available networks - needed for transaction-signature <a href=
* https://github.com/aeternity/protocol/blob/master/consensus/consensus.md#transaction-signature>transaction-signature</a>
*/
public enum Network {
DEVNET("ae_devnet"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import org.slf4j.LoggerFactory;

/**
* This class encapsules the generated result objects to keep the SDK stable in terms of changes
* within the underlying AE protocol
* This class encapsules the mapping of generated result objects and takes care of error handling.
* This is done to keep the SDK stable in terms of changes within the underlying AE protocol
*
* @param <T> the generated ae result object class
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
import lombok.experimental.SuperBuilder;

/**
* this object result wrapper introduces the error handling when returning simple string from node
* calls
*
* @author mitch
* This object result wrapper introduces the error handling when returning object from node calls
*/
@Getter
@SuperBuilder(toBuilder = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import lombok.experimental.SuperBuilder;

/**
* this string result wrapper introduces the error handling when returning simple string from node
* This string result wrapper introduces the error handling when returning simple string from node
* calls
*
* @author mitch
*/
@Getter
@SuperBuilder(toBuilder = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
import java.util.stream.Collectors;
import lombok.Getter;

/**
* Data structure to hold the deterministic key hierarchy tree, based on the given master keypair
* {@link HdKeyPair}
*/
@Getter
public class DeterministicHierarchy {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

/** Data structure to hold a deterministic hierarchy entry */
@Getter
@NoArgsConstructor
public class DeterministicHierarchyEntry {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.EqualsAndHashCode;
import lombok.ToString;

/** Data structure to hold one derived key from the tree of hierarchic keys */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import lombok.Getter;

/**
* this class wrapps a mnemonic additionally to the master rawKeyPair it contains the list of
* This class wrapps a mnemonic additionally to the master rawKeyPair it contains the list of
* mnemonic seed words, the generated {@link KeyPair} and the {@link DeterministicHierarchy} which
* build the base for generating a hierarchical deterministic wallet.
*
* <p>The deterministicHierarchy object can either be created from the root (master) or a derived
* key according to the tree structure stated in <a
* <p>The {@link DeterministicHierarchy} object can either be created from the root (master) or a
* derived key according to the tree structure stated in <a
* href=https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Master_key_generation>BIP32</a>
*/
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
import lombok.ToString;
import org.bouncycastle.util.encoders.Hex;

/**
* Basic keypair holding the public and private key as raw byte array as well as human readable
* representation for encoded private key and address
*/
@Data
@NoArgsConstructor
public class KeyPair {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
package com.kryptokrauts.aeternity.sdk.exception;

public class AENSException extends AException {}
public class AENSException extends AException {

private static final long serialVersionUID = 1L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

public class AException extends RuntimeException {

private static final long serialVersionUID = 1L;

public AException() {}

public AException(String message) {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

public class DebugModeNotEnabledException extends AException {

private static final long serialVersionUID = 1L;

public DebugModeNotEnabledException(String msg) {
super(msg);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

public class EncodingNotSupportedException extends RuntimeException {

private static final long serialVersionUID = 1L;

public EncodingNotSupportedException() {}

public EncodingNotSupportedException(String message) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.kryptokrauts.aeternity.sdk.exception;

public class InvalidParameterException extends RuntimeException {

private static final long serialVersionUID = 1L;

public InvalidParameterException(String msg) {
super(msg);
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.kryptokrauts.aeternity.sdk.exception;

public class NoSuchOracleTTLTypeException extends RuntimeException {

private static final long serialVersionUID = 1L;

public NoSuchOracleTTLTypeException(String msg) {
super(msg);
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

public class TransactionCreateException extends RuntimeException {

private static final long serialVersionUID = 1L;

public TransactionCreateException(String message, Throwable e) {
super(message, e);
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

public class TransactionWaitTimeoutExpiredException extends AException {

private static final long serialVersionUID = 1L;

public TransactionWaitTimeoutExpiredException(String message) {
super(message);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
import java.util.Map;

/**
* This abstract factory defines the process of retrieving service implementations of different
* versions in a uniform way by default it returns the current version
*
* <p>versions should only be increased when new methods are added to the service interface or
* existing methods are changed that do not depend on domain object changes
* This abstract factory defines the uniform process of retrieving service implementations.
*
* @param <T> the service interface to be retrieved
* @param <C> a pojo containing a set of service parameters with defaults, also see {@link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
import org.slf4j.LoggerFactory;

/**
* a lomboked class with service parameters should extend this configuration class like
* The SDKs basic configuration class.
*
* <p>Other configuration classes with service parameters should extend this configuration class
* like
*
* <pre>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,37 @@

public interface MiddlewareService {

/**
* synchronously returns the middleware status
*
* @return result of {@link StatusResult}
*/
StatusResult blockingGetStatus();

/**
* synchronously returns the result object of a name auction
*
* @return result of {@link NameAuctionResult}
*/
NameAuctionResult blockingGetNameAuction(String name);

/**
* synchronously returns the result object of all name auctions
*
* @return result of {@link NameAuctionsResult}
*/
NameAuctionsResult blockingGetNameAuctions();

/**
* synchronously returns the result object of all name auctions filtered and paginated by the
* given criteria
*
* @param sortBy sort by criteria
* @param sortDirection the direction of sorting
* @param page number of page to return
* @param limit number of results to return
* @return result of {@link NameAuctionsResult}
*/
NameAuctionsResult blockingGetNameAuctions(
AuctionSortBy sortBy, SortDirection sortDirection, BigInteger page, BigInteger limit);
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.kryptokrauts.aeternity.sdk.service.oracle.domain;
import java.math.BigInteger;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.Getter;
@Builder
@Getter
public class QueryParams {
/** Last query id in previous page */
@Default private String from = null;
/** Max number of oracle queries to receive */
@Default private BigInteger limit = BigInteger.valueOf(50);
/** The type of a query: open, closed or all */
@Default private QueryType queryType = QueryType.OPEN;
}
package com.kryptokrauts.aeternity.sdk.service.oracle.domain;

import java.math.BigInteger;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.Getter;

@Builder
@Getter
public class QueryParams {
/** Last query id in previous page */
@Default private String from = null;
/** Max number of oracle queries to receive */
@Default private BigInteger limit = BigInteger.valueOf(50);
/** The type of a query: open, closed or all */
@Default private QueryType queryType = QueryType.OPEN;
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ DryRunTransactionResult blockingDryRunContractTx(
/**
* convenience method to deploy a contract and return the tx-hash along with the decoded result
* and other useful information related to the tx. performs following steps under the hood: 1.
* generate bytecode via compiler, 2. encode calldata via compiler, 3. sign & broadcast the
* generate bytecode via compiler, 2. encode calldata via compiler, 3. sign and broadcast the
* ContractCreateTx with the keyPair configured in the {@link
* com.kryptokrauts.aeternity.sdk.service.ServiceConfiguration}, 4. wait for the tx to be included
* in a microblock, 5. fetch the tx-info from node, 6. decode result calldata via compiler, 7.
Expand All @@ -104,7 +104,7 @@ DryRunTransactionResult blockingDryRunContractTx(
/**
* convenience method to deploy a contract and return the tx-hash along with the decoded result
* and other useful information related to the tx. performs following steps under the hood: 1.
* generate bytecode via compiler, 2. encode calldata via compiler, 3. sign & broadcast the
* generate bytecode via compiler, 2. encode calldata via compiler, 3. sign and broadcast the
* ContractCreateTx with the keyPair configured in the {@link
* com.kryptokrauts.aeternity.sdk.service.ServiceConfiguration}, 4. wait for the tx to be included
* in a microblock, 5. fetch the tx-info from node, 6. decode result calldata via compiler, 7.
Expand Down Expand Up @@ -146,7 +146,7 @@ Object blockingReadOnlyContractCall(
/**
* convenience method to perform a stateful contract call and return the tx-hash along with the
* decoded result and other useful information related to the tx. performs following steps under
* the hood: 1. encode calldata via compiler, 2. sign & broadcast the ContractCallTx with the
* the hood: 1. encode calldata via compiler, 2. sign and broadcast the ContractCallTx with the
* keyPair configured in the {@link com.kryptokrauts.aeternity.sdk.service.ServiceConfiguration},
* 3. wait for the tx to be included in a microblock, 4. fetch the tx-info from node, 5. decode
* result calldata via compiler, 6. return the {@link ContractTxResult}
Expand All @@ -164,7 +164,7 @@ ContractTxResult blockingStatefulContractCall(
/**
* convenience method to perform a stateful contract call and return the tx-hash along with the
* decoded result and other useful information related to the tx. performs following steps under
* the hood: 1. encode calldata via compiler, 2. sign & broadcast the ContractCallTx with the
* the hood: 1. encode calldata via compiler, 2. sign and broadcast the ContractCallTx with the
* keyPair configured in the {@link com.kryptokrauts.aeternity.sdk.service.ServiceConfiguration},
* 3. wait for the tx to be included in a microblock, 4. fetch the tx-info from node, 5. decode
* result calldata via compiler, 6. return the {@link ContractTxResult}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public class BaseFeeCalculationModel implements FeeCalculationModel {

/**
* the fee is calculated according to the following formula
* The fee is calculated according to the following formula
*
* <p>(BASE_GAS + (byte_size * GAS_PER_BYTE)) * MINIMAL_GAS_PRICE
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public class ChannelForceProgressFeeCalculationModel implements FeeCalculationModel {

/**
* the fee is calculated according to the following formula
* The fee is calculated according to the following formula
*
* <p>(BASE_GAS * 30 + (byte_size * GAS_PER_BYTE)) * MINIMAL_GAS_PRICE
*/
Expand Down
Loading