@ApiAudience.Private @ApiStability.Unstable public class TransactionTemplate extends java.lang.Object implements TransactionOperation, ChannelInjectable, ContextProviderInjectable
Modifier and Type | Field and Description |
---|---|
protected ContextProvider |
contextProvider |
protected ExceptionConverter<RpcException> |
exceptionConverter |
protected TransactionBaseTemplate |
transactionBaseTemplate |
Constructor and Description |
---|
TransactionTemplate() |
Modifier and Type | Method and Description |
---|---|
TxHash |
commit(Transaction transaction)
Commit transaction.
|
Transaction |
getTransaction(TxHash txHash)
Get transaction.
|
TxHash |
send(AccountAddress sender,
AccountAddress recipient,
Aer amount)
Send transaction.
|
void |
setChannel(io.grpc.ManagedChannel channel) |
void |
setContextProvider(ContextProvider contextProvider) |
protected final ExceptionConverter<RpcException> exceptionConverter
protected TransactionBaseTemplate transactionBaseTemplate
protected ContextProvider contextProvider
public void setChannel(io.grpc.ManagedChannel channel)
setChannel
in interface ChannelInjectable
public void setContextProvider(ContextProvider contextProvider)
setContextProvider
in interface ContextProviderInjectable
public Transaction getTransaction(TxHash txHash)
TransactionOperation
getTransaction
in interface TransactionOperation
txHash
- transaction's hashpublic TxHash commit(Transaction transaction)
TransactionOperation
commit
in interface TransactionOperation
transaction
- transaction to commitpublic TxHash send(AccountAddress sender, AccountAddress recipient, Aer amount)
TransactionOperation
sender
is unlocked.send
in interface TransactionOperation
sender
- aergo senderrecipient
- aergo recipientamount
- aergo amount