public class TransactionApiImpl extends java.lang.Object implements TransactionApi, ClientInjectable
Modifier and Type | Field and Description |
---|---|
protected @NonNull AergoClient |
client |
protected ExceptionConverter<WalletException> |
converter |
protected Signer |
signer |
protected Trier |
trier |
Constructor and Description |
---|
TransactionApiImpl(TryCountAndInterval tryCountAndInterval,
Signer signer)
TransactionApiImpl constructor.
|
Modifier and Type | Method and Description |
---|---|
TxHash |
commit(RawTransaction rawTransaction)
Sign and commit transaction.
|
TxHash |
commit(Transaction signedTransaction)
Commit a signed transaction.
|
TxHash |
createName(java.lang.String name)
Create name info of a current account.
|
ContractTxHash |
deploy(ContractDefinition contractDefinition,
Fee fee)
Deploy smart contract.
|
ContractTxHash |
execute(ContractInvocation contractInvocation,
Fee fee)
Execute a smart contract function.
|
protected AergoClient |
getClient() |
protected Signer |
getSigner() |
ContractTxHash |
redeploy(ContractAddress existingContract,
ContractDefinition contractDefinition,
Fee fee)
Re-deploy a deployed smart smart contract.
|
TxHash |
send(AccountAddress recipient,
Aer amount,
Fee fee)
Send aer with
fee . |
TxHash |
send(AccountAddress recipient,
Aer amount,
Fee fee,
BytesValue payload)
Send aer with
fee and payload . |
TxHash |
send(java.lang.String recipient,
Aer amount,
Fee fee)
Send aer with
fee . |
TxHash |
send(java.lang.String recipient,
Aer amount,
Fee fee,
BytesValue payload)
Send aer with
fee and payload . |
TxHash |
stake(Aer amount)
Staking an account with amount of a current account.
|
TxHash |
unstake(Aer amount)
Unstaking an account with amount of a current account.
|
TxHash |
updateName(java.lang.String name,
AccountAddress newOwner)
Update name info of to an new owner.
|
TxHash |
vote(java.lang.String voteId,
java.util.List<java.lang.String> candidates)
Vote to
candidates with voteId . |
TxHash |
voteBp(java.util.List<java.lang.String> candidates)
Vote to bp
candidates . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setClient
protected final Trier trier
protected final Signer signer
@NonNull protected @NonNull AergoClient client
protected final ExceptionConverter<WalletException> converter
public TransactionApiImpl(TryCountAndInterval tryCountAndInterval, Signer signer)
tryCountAndInterval
- a tryCountAndIntervalsigner
- a signepublic TxHash createName(java.lang.String name)
TransactionApi
createName
in interface TransactionApi
name
- an new namepublic TxHash updateName(java.lang.String name, AccountAddress newOwner)
TransactionApi
updateName
in interface TransactionApi
name
- an already binded namenewOwner
- an new owner of namepublic TxHash stake(Aer amount)
TransactionApi
stake
in interface TransactionApi
amount
- an amount to stakepublic TxHash unstake(Aer amount)
TransactionApi
unstake
in interface TransactionApi
amount
- an amount to stakepublic TxHash voteBp(java.util.List<java.lang.String> candidates)
TransactionApi
candidates
.voteBp
in interface TransactionApi
candidates
- a candidates to votepublic TxHash vote(java.lang.String voteId, java.util.List<java.lang.String> candidates)
TransactionApi
candidates
with voteId
.vote
in interface TransactionApi
voteId
- a vote idcandidates
- a candidates to votepublic TxHash send(java.lang.String recipient, Aer amount, Fee fee)
TransactionApi
fee
.send
in interface TransactionApi
recipient
- a recipient nameamount
- an amountfee
- a feepublic TxHash send(java.lang.String recipient, Aer amount, Fee fee, BytesValue payload)
TransactionApi
fee
and payload
.send
in interface TransactionApi
recipient
- a recipient nameamount
- an amountfee
- a feepayload
- a payloadpublic TxHash send(AccountAddress recipient, Aer amount, Fee fee)
TransactionApi
fee
.send
in interface TransactionApi
recipient
- a recipientamount
- an amountfee
- a feepublic TxHash send(AccountAddress recipient, Aer amount, Fee fee, BytesValue payload)
TransactionApi
fee
and payload
.send
in interface TransactionApi
recipient
- a recipientamount
- an amountfee
- a feepayload
- a payloadpublic TxHash commit(RawTransaction rawTransaction)
TransactionApi
commit
in interface TransactionApi
rawTransaction
- a raw transactionpublic TxHash commit(Transaction signedTransaction)
TransactionApi
commit
in interface TransactionApi
signedTransaction
- a signed transactionpublic ContractTxHash deploy(ContractDefinition contractDefinition, Fee fee)
TransactionApi
deploy
in interface TransactionApi
contractDefinition
- a contract definitionfee
- a feepublic ContractTxHash redeploy(ContractAddress existingContract, ContractDefinition contractDefinition, Fee fee)
TransactionApi
redeploy
in interface TransactionApi
existingContract
- an existing contract addresscontractDefinition
- a contract definition to re-deployfee
- a feepublic ContractTxHash execute(ContractInvocation contractInvocation, Fee fee)
TransactionApi
execute
in interface TransactionApi
contractInvocation
- a contract invocationfee
- a feeprotected Signer getSigner()
protected AergoClient getClient()