Class TransactionClient
- Namespace
- Aptos
- Assembly
- Aptos.dll
public class TransactionClient
- Inheritance
-
TransactionClient
- Inherited Members
Constructors
TransactionClient(AptosClient)
public TransactionClient(AptosClient client)
Parameters
clientAptosClient
Methods
Build(Account, GenerateEntryFunctionPayloadData, bool, GenerateTransactionOptions?)
public Task<SimpleTransaction> Build(Account sender, GenerateEntryFunctionPayloadData data, bool withFeePayer = false, TransactionBuilder.GenerateTransactionOptions? options = null)
Parameters
senderAccountdataGenerateEntryFunctionPayloadDatawithFeePayerbooloptionsTransactionBuilder.GenerateTransactionOptions
Returns
Build(AccountAddress, GenerateEntryFunctionPayloadData, bool, GenerateTransactionOptions?)
public Task<SimpleTransaction> Build(AccountAddress sender, GenerateEntryFunctionPayloadData data, bool withFeePayer = false, TransactionBuilder.GenerateTransactionOptions? options = null)
Parameters
senderAccountAddressdataGenerateEntryFunctionPayloadDatawithFeePayerbooloptionsTransactionBuilder.GenerateTransactionOptions
Returns
Build(AccountAddress, GenerateEntryFunctionPayloadData, List<AccountAddress>, bool, GenerateTransactionOptions?)
public Task<MultiAgentTransaction> Build(AccountAddress sender, GenerateEntryFunctionPayloadData data, List<AccountAddress> secondarySignerAddresses, bool withFeePayer = false, TransactionBuilder.GenerateTransactionOptions? options = null)
Parameters
senderAccountAddressdataGenerateEntryFunctionPayloadDatasecondarySignerAddressesList<AccountAddress>withFeePayerbooloptionsTransactionBuilder.GenerateTransactionOptions
Returns
Build(AccountAddress, GenerateScriptPayloadData, bool, GenerateTransactionOptions?)
public Task<SimpleTransaction> Build(AccountAddress sender, GenerateScriptPayloadData data, bool withFeePayer = false, TransactionBuilder.GenerateTransactionOptions? options = null)
Parameters
senderAccountAddressdataGenerateScriptPayloadDatawithFeePayerbooloptionsTransactionBuilder.GenerateTransactionOptions
Returns
Build(string, GenerateEntryFunctionPayloadData, bool, GenerateTransactionOptions?)
public Task<SimpleTransaction> Build(string sender, GenerateEntryFunctionPayloadData data, bool withFeePayer = false, TransactionBuilder.GenerateTransactionOptions? options = null)
Parameters
senderstringdataGenerateEntryFunctionPayloadDatawithFeePayerbooloptionsTransactionBuilder.GenerateTransactionOptions
Returns
GetTransactionByHash(string)
Gets a transaction data by hash.
public Task<TransactionResponse> GetTransactionByHash(string hash)
Parameters
hashstringThe hash of the transaction.
Returns
- Task<TransactionResponse>
The transaction data.
GetTransactionByVersion(string)
Gets a transaction data by version.
public Task<TransactionResponse> GetTransactionByVersion(string version)
Parameters
versionstringThe version of the transaction.
Returns
- Task<TransactionResponse>
The transaction data.
GetTransactions(int?, int?)
Gets a paginated list of transactions.
public Task<TransactionResponse[]> GetTransactions(int? start = null, int? limit = null)
Parameters
startint?The start index of the transactions to return.
limitint?The limit of the transactions to return.
Returns
- Task<TransactionResponse[]>
A list of transactions.
LongWaitForTransaction(string)
Waits for a transaction to be committed. Its recommended to use WaitForTransaction(PendingTransactionResponse, WaitForTransactionOptions?) instead.
public Task<TransactionResponse> LongWaitForTransaction(string hash)
Parameters
hashstringThe hash of the transaction to wait for.
Returns
- Task<TransactionResponse>
The transaction response.
SignAndSubmitTransaction(Account, AnyRawTransaction, AccountAuthenticator?, List<AccountAuthenticator>?)
Signs and submits a transaction to the blockchain. You can build a transaction payload by using the Build(AccountAddress, GenerateEntryFunctionPayloadData, bool, GenerateTransactionOptions?) method.
public Task<PendingTransactionResponse> SignAndSubmitTransaction(Account signer, AnyRawTransaction transaction, AccountAuthenticator? feePayerAuthenticator = null, List<AccountAuthenticator>? additionalSignersAuthenticators = null)
Parameters
signerAccountThe account to sign the transaction with.
transactionAnyRawTransactionThe transaction to sign and submit.
feePayerAuthenticatorAccountAuthenticatorIf the transaction has a fee payer, you can provide an authenticator for it here.
additionalSignersAuthenticatorsList<AccountAuthenticator>If the transaction has additional signers, you can provide authenticators for them here.
Returns
- Task<PendingTransactionResponse>
The pending transaction response.
SignAsFeePayer(Account, AnyRawTransaction)
Helper method to sign a transaction as a FeePayer with an account. The FeePayerAddress will be set to the signer's address.
public AccountAuthenticator SignAsFeePayer(Account signer, AnyRawTransaction transaction)
Parameters
signerAccountThe fee payer account to sign the transaction with.
transactionAnyRawTransactionThe transaction to sign.
Returns
- AccountAuthenticator
The authenticator with the signed transaction and public key.
Exceptions
- ArgumentException
If the transaction is not a FeePayer transaction.
SignTransaction(Account, AnyRawTransaction)
Helper method to sign a transaction with an account.
public AccountAuthenticator SignTransaction(Account signer, AnyRawTransaction transaction)
Parameters
signerAccountThe account to sign the transaction with.
transactionAnyRawTransactionThe transaction to sign.
Returns
- AccountAuthenticator
The authenticator with the signed transaction and public key.
Simulate(SimulateTransactionData)
Simulates a transaction without submitting it to the blockchain.
public Task<List<PendingTransactionResponse>> Simulate(SimulateTransactionData data)
Parameters
dataSimulateTransactionDataThe transaction data to simulate.
Returns
- Task<List<PendingTransactionResponse>>
The simulated transaction responses.
SubmitTransaction(SubmitTransactionData)
Submits a transaction to the blockchain.
public Task<PendingTransactionResponse> SubmitTransaction(SubmitTransactionData data)
Parameters
dataSubmitTransactionDataThe transaction data to submit.
Returns
- Task<PendingTransactionResponse>
The pending transaction response.
WaitForIndexer(long?, string)
public void WaitForIndexer(long? minimumLedgerVersion, string processorType)
Parameters
WaitForTransaction(Hex, WaitForTransactionOptions?)
public Task<CommittedTransactionResponse> WaitForTransaction(Hex hash, TransactionClient.WaitForTransactionOptions? options = null)
Parameters
hashHexoptionsTransactionClient.WaitForTransactionOptions
Returns
WaitForTransaction(PendingTransactionResponse, WaitForTransactionOptions?)
Waits for a transaction to be committed using polling.
public Task<CommittedTransactionResponse> WaitForTransaction(PendingTransactionResponse pendingTransaction, TransactionClient.WaitForTransactionOptions? options = null)
Parameters
pendingTransactionPendingTransactionResponseThe pending transaction to wait for.
optionsTransactionClient.WaitForTransactionOptionsThe options for waiting for the transaction.
Returns
- Task<CommittedTransactionResponse>
The transaction response.
WaitForTransaction(string, WaitForTransactionOptions?)
public Task<CommittedTransactionResponse> WaitForTransaction(string hash, TransactionClient.WaitForTransactionOptions? options = null)
Parameters
hashstringoptionsTransactionClient.WaitForTransactionOptions