Class AbstractTransactionModel<GeneratedTxModel>
java.lang.Object
com.kryptokrauts.aeternity.sdk.service.transaction.type.model.AbstractTransactionModel<GeneratedTxModel>
- Type Parameters:
GeneratedTxModel
-
- Direct Known Subclasses:
ChannelCloseMutualTransactionModel
,ChannelCloseSoloTransactionModel
,ChannelCreateTransactionModel
,ChannelDepositTransactionModel
,ChannelSettleTransactionModel
,ChannelSlashTransactionModel
,ChannelSnapshotSoloTransactionModel
,ChannelWithdrawTransactionModel
,ContractCallTransactionModel
,ContractCreateTransactionModel
,GeneralizedAccountsAttachTransactionModel
,GeneralizedAccountsMetaTransactionModel
,NameClaimTransactionModel
,NamePreclaimTransactionModel
,NameRevokeTransactionModel
,NameTransferTransactionModel
,NameUpdateTransactionModel
,OracleExtendTransactionModel
,OracleQueryTransactionModel
,OracleRegisterTransactionModel
,OracleRespondTransactionModel
,PayingForTransactionModel
,SpendTransactionModel
public abstract class AbstractTransactionModel<GeneratedTxModel>
extends java.lang.Object
This abstract class defines the behaviour of all specific transaction models and is tied to the
relating generated endpoint model. The specific model classes are used to encapsulate the
transaction type specific parameters in a convienent way.
-
Field Summary
Fields Modifier and Type Field Description protected java.math.BigInteger
fee
the fee is automatically calculated but can also be set manually -
Constructor Summary
Constructors Constructor Description AbstractTransactionModel()
-
Method Summary
Modifier and Type Method Description abstract AbstractTransaction<?>
buildTransaction(ExternalApi externalApi, InternalApi internalApi)
builds the necessary transaction objectjava.lang.String
checkMandatoryFields()
validate, that all mandatory fields are set - if not we throw anInvalidParameterException
boolean
doSign()
indicates, if the transaction needs to be signedabstract java.util.function.Function<Tx,?>
getApiToModelFunction()
remap the given genericTx to a modelAbstractTransactionModel<?>
getInnerTxModel()
returns the inner transaction model if definedboolean
hasInnerTx()
indicates, if the transaction has inner tx (GATx, PayforTx)abstract GeneratedTxModel
toApiModel()
this method needs to be implemented for testing purposes (non native mode) and returns the generated tx model from the transaction fieldsabstract void
validateInput()
this method can be used to perform transaction specific validations that willMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
fee
protected java.math.BigInteger feethe fee is automatically calculated but can also be set manually
-
-
Constructor Details
-
AbstractTransactionModel
public AbstractTransactionModel()
-
-
Method Details
-
toApiModel
this method needs to be implemented for testing purposes (non native mode) and returns the generated tx model from the transaction fields- Returns:
- one of
com.kryptokrauts.aeternity.sdk.service.transaction.type.model
-
checkMandatoryFields
public java.lang.String checkMandatoryFields()validate, that all mandatory fields are set - if not we throw anInvalidParameterException
- Returns:
- null if all fields are set OR
the name of the field which value is missing
-
validateInput
public abstract void validateInput()this method can be used to perform transaction specific validations that will -
buildTransaction
public abstract AbstractTransaction<?> buildTransaction(ExternalApi externalApi, InternalApi internalApi)builds the necessary transaction object- Parameters:
externalApi
- the node api instanceinternalApi
- the node api instance- Returns:
- the instance of a specific transaction class that extends
AbstractTransaction
-
getApiToModelFunction
remap the given genericTx to a model- Returns:
- a function that maps the generated Api class into our SDK model class
-
doSign
public boolean doSign()indicates, if the transaction needs to be signed- Returns:
-
hasInnerTx
public boolean hasInnerTx()indicates, if the transaction has inner tx (GATx, PayforTx)- Returns:
-
getInnerTxModel
returns the inner transaction model if defined- Returns:
-