Transaction

class Transaction(val config: AptosConfig) : Transaction

Transaction API namespace. This class provides functionality to reading and writing transaction information.

Constructors

Link copied to clipboard
constructor(config: AptosConfig)

Properties

Link copied to clipboard
open override val buildTransaction: Build

Builds a transaction to be submitted to the chain

Link copied to clipboard

AptosConfig object for configuration

Link copied to clipboard
open override val simulateTransaction: Simulate

Simulate transaction before signing

Link copied to clipboard
open override val submitTransaction: Submit

Submits a transaction to the chain

Functions

Link copied to clipboard
open suspend override fun getGasPriceEstimation(): GasEstimation

Gives an estimate of the gas unit price required to get a transaction on chain in a reasonable amount of time. For more information {@link https://api.mainnet.aptoslabs.com/v1/spec#/operations/estimate_gas_price}

Link copied to clipboard
open suspend override fun getTransactionByHash(transactionHash: String): Option<TransactionResponse>

Queries on-chain transaction by transaction hash. This function will return pending transactions.

Link copied to clipboard
open suspend override fun getTransactionByVersion(ledgerVersion: Long): Option<TransactionResponse>

Queries on-chain transaction by version. This function will not return pending transactions.

Link copied to clipboard
open suspend override fun isPendingTransaction(transactionHash: HexInput): Boolean

Defines if specified transaction is currently in pending state

Link copied to clipboard
open suspend override fun publishPackageTransaction(account: AccountAddressInput, metadataBytes: HexInput, moduleBytecode: List<HexInput>, options: InputGenerateTransactionOptions): SimpleTransaction

Generates a transaction to publish a move package to chain.

Link copied to clipboard
open override fun sign(signer: Account, transaction: AnyRawTransaction): AccountAuthenticator

Sign a transaction that can later be submitted to chain

Link copied to clipboard
open suspend override fun signAndSubmitTransaction(signer: Account, transaction: AnyRawTransaction): Option<PendingTransactionResponse>

Sign and submit a single signer transaction to chain

Link copied to clipboard
open suspend override fun waitForTransaction(transactionHash: HexInput, options: WaitForTransactionOptions): Option<TransactionResponse>