aptos library
Aptos Dart SDK — a Dart client library for the Aptos blockchain.
Classes
- AbstractedAccount
- Signer implementation for the Account Abstraction (AA) authentication scheme, where transactions are authenticated by an on-chain Move function instead of a cryptographic key pair.
- AbstractKeylessAccount
- Account implementation for the Keyless authentication scheme. This abstract class is used for standard Keyless Accounts and Federated Keyless Accounts.
- AbstractMultiKey
-
An abstract base for multi-key public keys (
MultiKeyand the legacyMultiEd25519PublicKey). - AbstractPublicKey
- A placeholder public key for Account Abstraction accounts; it simply wraps the account address (AA accounts have no real public key).
- AbstractSignature
- An opaque signature wrapper produced by an Account Abstraction signer function.
- Account
- Base type for all Aptos accounts.
- AccountAbstraction
- A class to handle all account abstraction (AA) operations on Aptos.
- AccountAbstractionMessage
- Represents an account abstraction message that contains the original signing message and the function info.
- AccountAddress
- NOTE: Only use this class for account addresses. For other hex data, e.g. transaction hashes, use the Hex class.
- AccountApi
-
A class to query all
Accountrelated queries on Aptos. - AccountAuthenticator
- Represents an account authenticator that can handle multiple authentication variants.
- AccountAuthenticatorAbstraction
- Represents an account authenticator that supports abstract authentication.
- AccountAuthenticatorEd25519
- Represents an Ed25519 transaction authenticator for multi-signer transactions.
- AccountAuthenticatorMultiEd25519
- Represents a transaction authenticator for Multi Ed25519, designed for multi-signer transactions.
- AccountAuthenticatorMultiKey
- Represents an account authenticator that supports multiple keys and signatures for multi-signature scenarios.
- AccountAuthenticatorNoAccountAuthenticator
- AccountAuthenticatorNoAccountAuthenticator for no account authenticator.
- AccountAuthenticatorSingleKey
- Represents an account authenticator that utilizes a single key for signing.
- AccountCollectionWithOwnedTokens
-
A collection ownership row of the
GetAccountCollectionsWithOwnedTokensquery (current_collection_ownership_v2_view). - AccountData
- The data associated with an account, including its sequence number.
- AccountInfo
-
Information about an account associated with a public key, as returned by
getAccountsForPublicKey. - AccountPublicKey
- An abstract representation of an account public key.
- AccountSequenceNumber
- Represents an account's sequence number management for transaction handling on the Aptos blockchain. This class provides methods to retrieve the next available sequence number, synchronize with the on-chain sequence number, and manage local sequence numbers while ensuring async-concurrency safety.
- AccountSignature
- The union of all single account signatures, including Ed25519, Secp256k1, and MultiEd25519 signatures.
- AccountUtils
- Utility functions for working with accounts.
- Ans
-
A class to handle all
ANS(Aptos Name Service) operations. - AnsName
- A sanitized ANS name, with expiration timestamps normalized and derived expiration status fields populated.
- AnyPublicKey
- Represents any public key supported by Aptos.
- AnyRawTransaction
-
A unified type for the return types generated when building different
transaction types: a
SimpleTransactionor aMultiAgentTransaction. - AnySignature
-
Represents a signature that utilizes the SingleKey authentication scheme.
This class is designed to encapsulate various types of signatures, which
can only be generated by a
SingleKeySignerdue to the shared authentication mechanism. - Aptos
- The main entry point for interacting with the Aptos APIs, providing access to various functionalities organized into distinct namespaces.
- AptosConfig
- Represents the configuration settings for an Aptos SDK client instance. This class allows customization of various endpoints and client settings.
- AptosObject
-
A class to query all
Objectrelated queries on Aptos. - AptosRequest
- The API request type.
- AptosRequestOverrides
- Per-request overrides, merging the client, fullnode, indexer, and faucet configuration options.
-
AptosResponse<
Res> - The API response type.
-
AsyncQueue<
T> - The AsyncQueue class is an async-aware data structure that provides a queue-like behavior for managing asynchronous tasks or operations. It allows to enqueue items and dequeue them asynchronously. This is not thread-safe, but it is async concurrency safe, and it does not guarantee ordering for those that call into and await on enqueue.
- AuthenticationFunctionInfo
- A dispatchable authentication function registered for an account, identified by module address, module name, and function name.
- AuthenticationKey
- Represents an authentication key used for account management. Each account stores an authentication key that enables account owners to rotate their private key(s) without changing the address that hosts their account. The authentication key is a SHA3-256 hash of data and is always 32 bytes in length.
- AuthKeyAccountAddress
-
An auth-key/account-address association row of the
GetAccountAddressesForAuthKeyquery. - AuthKeyAddressPair
- An auth-key/account-address pair resolved from the indexer, used internally when deriving accounts.
- BIBECiphertext
- BIBE (identity-based) ciphertext.
- Block
- A block returned by the fullnode API.
- BlockEndInfo
- Describes the gas state of the block, indicating whether the block gas limit has been reached.
- BlockEpilogueTransactionResponse
- A transaction executed at the end of a block that tracks data from the entire block.
- BlockMetadataTransactionResponse
- The structure representing a blockchain block with its height.
- Bool
-
Represents a Move
boolvalue that can be serialized and deserialized. - ChainId
- Represents a ChainId that can be serialized and deserialized.
- ChainTopUserTransaction
-
A user transaction row of the
GetChainTopUserTransactionsquery. - Ciphertext
- A batch-encryption ciphertext.
- ClaimedEntryFunction
-
Optional claim about the entry function inside an encrypted payload
(
claimed_entry_funin aptos-core). Lets fee payers and multisig co-signers see the module and optionally the function name without decrypting. - ClaimedEntryFunctionResponse
-
Claimed entry function metadata on encrypted transaction payloads (the
REST API uses
namefor the optional function identifier). - Client
- Represents a client for making HTTP requests to a service provider.
- ClientConfig
- A configuration object for requests to the server, including API key and extra headers.
- ClientHeadersType
- A configuration object with headers for sending requests.
- ClientRequest
- The request type sent to a Client implementation.
-
ClientResponse<
Res> - The response type returned by a Client implementation.
- Coin
-
A class to handle all
Coinoperations. - CollectionData
-
Data for a collection (a
current_collections_v2row; also the nestedcurrent_collectionobject of token data). - CommittedTransactionResponse
- The response for a committed transaction, which can be one of several transaction types. Contains the fields shared by all committed transactions.
- CurrentFungibleAssetBalance
- A current fungible asset balance of an owner address.
- CursorPaginationArgs
- Defines the parameters for paginating query results with a cursor, including the starting position and maximum number of items to return.
- DecodedTableData
- The decoded data for a table, including its key in JSON format.
- DecryptedEncryptedTransactionPayloadResponse
-
Encrypted payload response after the node has successfully decrypted it.
Narrow on
encryptedState == 'decrypted'to access decryptedPayload. - DecryptedPlaintext
-
BCS-serializable
DecryptedPlaintext. Built client-side before encrypting; its BCS hash becomespayload_hash. Matches Rust:DecryptedPlaintext { executable, decryption_nonce: [u8; 16] }. - DelegatedStakingActivity
- A delegated staking activity row.
- DeletedTableData
- Data for a deleted table entry.
- DerivableAbstractedAccount
- Signer implementation for the Derivable Account Abstraction (DAA) authentication scheme, where the account address is derived from the authentication function and an abstract public key.
- DerivedKeys
- Contains a derived cryptographic key and chain code.
- Deserializer
- A class that provides methods for deserializing various data types from a byte buffer. It supports deserialization of primitive types, strings, and complex objects using a BCS (Binary Canonical Serialization) layout.
- DigitalAsset
- A class for managing digital assets (Token v2), providing methods for querying, transferring, and mutating digital assets and collections.
- DioClient
-
The default Client implementation, backed by
package:dio. - DirectWriteSet
- The set of direct write operations, identified by a type string.
- Ed25519Account
- An account backed by an Ed25519 key pair, providing message and transaction signing.
- Ed25519PrivateKey
- Represents the private key of an Ed25519 key pair.
- Ed25519PublicKey
- Represents the public key of an Ed25519 key pair.
- Ed25519Signature
- Represents a signature of a message signed using an Ed25519 private key.
- EncryptedEncryptedTransactionPayloadResponse
- Encrypted payload response when the node has not yet decrypted it, or decryption failed. Narrow on encryptedState to distinguish from DecryptedEncryptedTransactionPayloadResponse.
- EncryptedTransactionPayloadResponse
-
Encrypted transaction payload as returned by the API. Discriminate on
encrypted_state: - EncryptionKey
- The node's per-epoch batch-encryption public key.
- EntryFunction
- Represents an entry function that can be serialized and deserialized. This class encapsulates the details required to invoke a function within a module, including the module name, function name, type arguments, and function arguments.
- EntryFunctionABI
- An Entry function's ABI, enabling type checking and input conversion for ABI-based transaction submissions.
- EntryFunctionArgument
- Represents an argument for entry functions, providing methods to serialize the argument to BCS-serialized bytes and convert it to different formats.
- EntryFunctionBytes
- This class exists solely to represent a sequence of fixed bytes as a serialized entry function, because serializing an entry function appends a prefix that's only used for entry function arguments.
- EntryFunctionPayloadResponse
- The response payload for an entry function, containing the type of the entry.
- EphemeralCertificate
- Represents an ephemeral certificate containing a signature, specifically a ZeroKnowledgeSig. This class can be extended to support additional signature types, such as OpenIdSignature.
- EphemeralKeyPair
- Represents an ephemeral key pair used for signing transactions via the Keyless authentication scheme. This key pair is temporary and includes an expiration time. For more details on how this class is used, refer to the documentation: https://aptos.dev/guides/keyless-accounts/#1-present-the-user-with-a-sign-in-with-idp-button-on-the-ui
- EphemeralPublicKey
- Represents ephemeral public keys for Aptos Keyless accounts.
- EphemeralSignature
- Represents ephemeral signatures used in Aptos Keyless accounts.
- Event
- An event emitted by a transaction, identified by a unique GUID.
- EventGuid
- The structure for an event's unique identifier, including its creation number.
- ExecutionFinishEventData
- The payload for when the worker has finished its job.
- FailureEventData
- The payload for a failure event.
- Faucet
-
A class to query all
Faucetrelated queries on Aptos. - FaucetConfig
- A configuration object for a faucet, including optional authentication and headers for requests.
- FederatedKeylessAccount
- Account implementation for the FederatedKeyless authentication scheme.
- FederatedKeylessPublicKey
- Represents the FederatedKeylessPublicKey public key
- FeePayerRawTransaction
- Represents a Fee Payer Transaction that can be serialized and deserialized.
- FixedBytes
- Represents a contiguous sequence of already serialized BCS bytes.
- Fp12
-
Element of the degree-12 extension field Fp12,
c0 + c1·w. - Fp2
-
Element of the quadratic extension field Fp2,
c0 + c1·uwith u² = -1. - Fp6
-
Element of the sextic extension field Fp6,
c0 + c1·v + c2·v². - FullNodeConfig
- A configuration object for a fullnode, with additional headers for requests.
- FunctionABI
- Data needed for a generic function ABI, applicable to both view and entry functions.
- FungibleAsset
- A class for querying and managing fungible asset-related operations on the Aptos blockchain.
- FungibleAssetActivity
- An activity associated with a fungible asset.
- FungibleAssetMetadata
- Metadata for a fungible asset.
- G1Bytes
- Represents a fixed-size byte array of 32 bytes, extending the Serializable class. This class is used for handling and serializing G1 bytes in cryptographic operations.
- G1Point
-
Affine point on the BN254 G1 curve.
(0, 0)encodes the point at infinity (Ethereum convention, noble'sallowInfinityPoint). - G2Bytes
- Represents a 64-byte G2 element in a cryptographic context. This class provides methods for serialization and deserialization of G2 bytes.
- G2Point
-
Affine point on the BN254 G2 twist curve.
((0,0), (0,0))encodes the point at infinity. - GasEstimation
- The output of the estimate gas API, including the deprioritized estimate for the gas unit price.
- General
- A class to query various Aptos-related information and perform operations on the Aptos blockchain.
- GenesisPayload
- The payload for the genesis block containing the type of the payload.
- GenesisTransactionResponse
- The response for a genesis transaction, indicating the type of transaction.
- GraphqlQuery
-
The GraphQL query to pass into the
queryIndexerfunction. - Groth16ProofAndStatement
- Represents a Groth16 proof and statement, consisting of a Groth16 proof and a public inputs hash. This is used to generate the signing message for the training wheels signature.
- Groth16VerificationKey
- Represents the verification key stored on-chain used to verify Groth16 proofs.
- Groth16VerificationKeyResponse
-
The response containing the on-chain Groth16 verification key
(
0x1::keyless_account::Groth16VerificationKey). - Groth16Zkp
- Represents a Groth16 zero-knowledge proof, consisting of three proof points in compressed serialization format. The points are the compressed serialization of affine representation of the proof.
- Hex
-
NOTE: Do not use this class when working with account addresses; use
AccountAddressinstead. - I128
- Represents a signed 128-bit integer (I128) value.
- I16
- Represents a signed 16-bit integer (I16) value.
- I256
- Represents a signed 256-bit integer (I256) value.
- I32
- Represents a signed 32-bit integer (I32) value.
- I64
- Represents a signed 64-bit integer (I64) value.
- I8
- Represents a signed 8-bit integer (I8) value.
- Identifier
- Represents an Identifier that can be serialized and deserialized. This class is used to denote the module "name" in "ModuleId" and the "function name" in "EntryFunction".
- IndexerConfig
- An indexer configuration object for sending requests with additional headers.
- IndexerQueryArgs
-
Combined optional arguments for indexer GraphQL queries: pagination,
filtering (
where), ordering (order_by) and token standard. - InputClaimedEntryFunction
-
A lightweight description of the entry function claimed by an encrypted
payload: the fully-qualified
module(e.g.0x1::coin) and optionally thefunctionName. Resolved into a ClaimedEntryFunction by the builder. - InputEntryFunctionData
- The data needed to generate an Entry Function payload.
- InputGenerateMultiAgentRawTransactionData
- Holds user data input for generating a multi-agent transaction.
- InputGenerateSingleSignerRawTransactionData
- Holds user input data for generating a single signer transaction.
- InputGenerateTransactionData
- Unified type holding the user data input for generating a transaction: either an InputGenerateSingleSignerRawTransactionData or an InputGenerateMultiAgentRawTransactionData.
- InputGenerateTransactionOptions
- Optional options to set when generating a transaction.
- InputGenerateTransactionPayloadData
- The data needed to generate a transaction payload: an InputEntryFunctionData, InputScriptData, InputMultiSigData, or InputMultiSigScriptData.
- InputMultiSigData
- The data needed to generate a Multi Sig payload wrapping an entry function, including the multisig address.
- InputMultiSigScriptData
- The data needed to generate a Multi Sig payload wrapping a Script.
- InputScriptData
- The data needed to generate a Script payload.
- InputSimulateTransactionData
-
The data required to simulate a transaction, typically generated by
buildTransaction(). - InputSimulateTransactionOptions
- Options for simulating a transaction.
- InputSubmitTransactionData
- Holds user data input for submitting a transaction.
- InputViewFunctionData
- The data needed to generate a View Function payload.
- InputViewFunctionJsonData
- The data needed to generate a View Function payload in JSON format (without ABI checking or BCS encoding of the arguments).
- IssuerJWKS
- A set of JWKs belonging to a single issuer.
- JwtHeader
- A parsed JWT header.
- Keyless
-
A class to query all
Keylessrelated queries on Aptos. - KeylessAccount
- Account implementation for the Keyless authentication scheme.
- KeylessConfiguration
- Represents the on-chain configuration for how Keyless accounts operate.
- KeylessConfigurationResponse
-
The response for the on-chain keyless configuration resource
(
0x1::keyless_account::Configuration). - KeylessPublicKey
- Represents a Keyless Public Key used for authentication.
- KeylessSignature
- Represents a signature of a message signed via a Keyless Account, utilizing proofs or a JWT token for authentication.
- KeylessSigner
- An interface which defines if an Account utilizes Keyless signing.
- LedgerInfo
- Information about the current blockchain ledger, including its chain ID.
- LedgerVersionArg
- The ledger version of transactions, defaulting to the latest version if not specified.
- ModuleAbiBundle
- Represents a bundle of a module ABI along with all struct ABIs it references. This allows for offline struct/enum encoding without additional network calls.
- ModuleId
- Represents a ModuleId that can be serialized and deserialized. A ModuleId consists of a module address (e.g., "0x1") and a module name (e.g., "coin").
- MoveAnyStruct
-
A Move
any::Anystruct variant containing BCS-serialized data and the Move type name of that data. - MoveEnumArgument
- Represents a BCS-serializable enum argument. Encodes variant tag (ULEB128) followed by variant fields.
- MoveFunction
- A Move function.
- MoveFunctionGenericTypeParam
- Move abilities associated with the generic type parameter of a function.
- MoveJWK
-
A JSON Web Key (JWK) as represented on chain
(
0x1::jwks::RSA_JWK), used to verify the OIDC provider signature over the JWT during keyless verification. Serializes to and from the on-chain BCS layout and exposes the RSAkid/n/efields. - MoveModule
- A Move module.
- MoveModuleBytecode
- A Move module containing its bytecode and, optionally, its ABI.
-
MoveOption<
T extends Serializable> -
Represents a Move
std::option::Option<T>value. - MoveResource
- A Move resource as returned by the fullnode API, containing its type and JSON data.
- MoveScriptBytecode
- The bytecode for a Move script and, optionally, its ABI.
- MoveString
-
Represents a Move
std::string::Stringvalue that can be serialized and deserialized. - MoveStruct
- A Move struct.
- MoveStructArgument
- Represents a BCS-serializable struct argument. Encodes struct fields in declaration order.
- MoveStructField
- A field in a Move struct, identified by its name.
-
MoveVector<
T extends Serializable> -
This class is the Aptos Dart SDK representation of a Move
vector<T>, whereTrepresents either a primitive type (bool,u8,u64, ...) or a BCS-serializable struct itself. - MultiAgentRawTransaction
- Represents a multi-agent transaction that can be serialized and deserialized.
- MultiAgentTransaction
- Represents a multi-agent transaction that can be serialized and deserialized.
- MultiEd25519Account
- Signer implementation for the Multi-Ed25519 authentication scheme.
- MultiEd25519PublicKey
- Represents the public key of a K-of-N Ed25519 multi-sig transaction.
- MultiEd25519Signature
- Represents the signature of a K-of-N Ed25519 multi-sig transaction.
- MultiKey
- Represents a multi-key authentication scheme for accounts, allowing multiple public keys to be associated with a single account. This class enforces a minimum number of valid signatures required to authorize actions, ensuring enhanced security for multi-agent accounts.
- MultiKeyAccount
- Signer implementation for the MultiKey authentication scheme.
- MultiKeySignature
- Represents a multi-signature transaction using multiple signature types. This class allows for the creation and management of a K-of-N multi-signature scheme, where a specified number of signatures are required to authorize a transaction.
- MultiSig
- Represents a MultiSig account that can be serialized and deserialized.
- MultisigPayloadResponse
- The response payload for a multisig transaction, containing the type of the transaction.
- MultiSigTransactionPayload
- Represents a multi-signature transaction payload that can be serialized and deserialized.
- NumberOfDelegators
- The number of active delegators for a pool.
- ObjectData
-
An object row of the
GetObjectDataquery (current_objects). - PaginationArgs
- Defines the parameters for paginating query results, including the starting position and maximum number of items to return.
-
ParsingResult<
T> - Whereas ParsingError is thrown when parsing fails, e.g. in a fromString function, this type is returned from "defensive" functions like isValid.
- PatchedJWKsResponse
-
The response containing the patched JWKs resource (
0x1::jwks::PatchedJWKsor0x1::jwks::FederatedJWKs). - PayloadAssociatedData
-
AAD for batch-encrypted transaction payloads. BCS matches Rust
PayloadAssociatedData::V1: uleb128 variant |sender|Vec<(AccountAddress, AuthenticationKey)>. - PendingTransactionResponse
- The response for a pending transaction, indicating that the transaction is still being processed.
- PepperFetchRequest
- The request payload for fetching a pepper, containing a base64 encoded JWT.
- PepperFetchResponse
- The response object containing the fetched pepper string.
- PluginSettings
- Settings for plugins. This can be used to override certain client behavior.
- PrivateKey
- Represents a private key used for signing messages and deriving the associated public key.
- ProcessorStatus
-
A processor status row of the
GetProcessorStatusquery. - Proof
- An abstract representation of a cryptographic proof associated with specific zero-knowledge proof schemes, such as Groth16 and PLONK.
- ProofFetchStatus
-
The result of a proof fetch: either
SuccessorFailed(with an error message). - ProverRequest
- The payload for a prover request, containing a Base64-encoded JWT.
- ProverResponse
- The response from the prover containing the proof data.
- PublicKey
- Represents an abstract public key.
- PublicKeyAuthKey
-
A public-key/auth-key association row of the
GetAuthKeysForPublicKeyquery. - RawAnsName
-
A raw ANS name row as returned by the indexer's
GetNamesquery (theAnsTokenFragmentfragment ofcurrent_aptos_names). - RawTransaction
- Represents a raw transaction that can be serialized and deserialized. Raw transactions contain the metadata and payloads that can be submitted to the Aptos chain for execution. They must be signed before the Aptos chain can execute them.
- RawTransactionWithData
- Represents a raw transaction with associated data that can be serialized and deserialized.
- RegisterNameExpiration
- The expiration policy for registering an ANS name.
- RotationProofChallenge
- Represents a challenge required for the account owner to sign in order to rotate the authentication key.
- Script
- Represents a Script that can be serialized and deserialized. Scripts contain the Move bytecode payload that can be submitted to the Aptos chain for execution.
- ScriptFunctionArgument
- Represents an argument for script functions, providing methods to serialize and convert to bytes.
- ScriptPayloadResponse
- The payload for a script response, containing the type of the script.
- ScriptWriteSet
- The set of properties for writing scripts, including the type of script.
- Secp256k1PrivateKey
- Represents a Secp256k1 ECDSA private key, providing functionality to create, sign messages, derive public keys, and serialize/deserialize the key.
- Secp256k1PublicKey
- Represents a Secp256k1 ECDSA public key.
- Secp256k1Signature
- Represents a signature of a message signed using a Secp256k1 ECDSA private key.
- Secp256r1PrivateKey
- Represents a Secp256r1 ECDSA private key, providing functionality to create, sign messages, derive public keys, and serialize/deserialize the key.
- Secp256r1PublicKey
- Represents a Secp256r1 ECDSA public key.
- Secp256r1Signature
- Represents a signature of a message signed using a Secp256r1 ECDSA private key.
- Serializable
- This class serves as a base class for all serializable types. It facilitates composable serialization of complex types and enables the serialization of instances to their BCS (Binary Canonical Serialization) representation.
- Serialized
- Represents a serialized data structure that encapsulates a byte array.
- Serializer
- A class for serializing various data types into a binary format. It provides methods to serialize strings, bytes, numbers, and other serializable objects using the Binary Canonical Serialization (BCS) layout. The serialized data can be retrieved as a Uint8List.
- Signature
- An abstract representation of a crypto signature, associated with a specific signature scheme, e.g., Ed25519 or Secp256k1.
- SignatureFetchResponse
-
The response from the pepper service
signatureendpoint, containing the VUF signature — i.e. the 48-bytepepper_base(compressed BLS12-381 G1 point) from which the final pepper is derived. - SignedTransaction
- Represents a signed transaction that includes a raw transaction and an authenticator.
- SignerAuthKeyPair
-
One
(AccountAddress, AuthenticationKey)entry inPayloadAssociatedData::V1.signer_auth_keys(aptos-core). - SimpleTransaction
- Represents a simple transaction type that can be submitted to the Aptos chain for execution.
- SingleKeyAccount
- Signer implementation for the SingleKey authentication scheme, backed by a single private key. The supported signature schemes are Ed25519 and Secp256k1.
- SingleKeySigner
- An interface which defines if an Account utilizes SingleKey signing.
- Staking
-
A class to query all
Stakingrelated queries on Aptos. - StateCheckpointTransactionResponse
- The response for a state checkpoint transaction, indicating the type of transaction.
- StructEnumArgumentParser
- Parser for struct and enum transaction arguments.
- StructTag
- Represents a structured tag that includes an address, module name, name, and type arguments. This class is used to define and manage structured data types within the SDK.
- SuccessEventData
- The payload for a success event.
- Table
-
A class to query all
TableAptos related queries. - TableItemData
-
A table item row of the
GetTableItemsDataquery. - TableItemRequest
- The request payload for the GetTableItem API.
- TableMetadata
-
A table metadata row of the
GetTableItemsMetadataquery. - TokenActivity
-
A token activity row (the
TokenActivitiesFieldsfragment oftoken_activities_v2). - TokenData
-
Data for a token/digital asset (a
current_token_datas_v2row; also the nestedcurrent_token_dataobject of token ownerships). - TokenOwnership
-
A current token ownership row (the
CurrentTokenOwnershipFieldsfragment ofcurrent_token_ownerships_v2). - Transaction
- Represents a transaction in the Aptos blockchain, providing methods to build, simulate, submit, and manage transactions. This class encapsulates functionalities for querying transaction details, estimating gas prices, signing transactions, and handling transaction states.
- TransactionAndProof
- A container class to hold a transaction and a proof. It implements CryptoHashable which is used to create the signing message for Keyless transactions. We sign over the proof to ensure non-malleability.
- TransactionArgument
- An argument that can be used in both entry functions and script functions.
- TransactionAuthenticator
- Represents an abstract base class for transaction authenticators.
- TransactionAuthenticatorEd25519
- Represents a transaction authenticator using Ed25519 for a single signer transaction.
- TransactionAuthenticatorFeePayer
- Represents a transaction authenticator specifically for fee payer transactions.
- TransactionAuthenticatorMultiAgent
- Represents a transaction authenticator for a multi-agent transaction.
- TransactionAuthenticatorMultiEd25519
- Represents a transaction authenticator for multi-signature transactions using Ed25519.
- TransactionAuthenticatorSingleSender
- Represents a single sender authenticator for transactions that require a single signer.
- TransactionBuild
-
A class to handle all
Buildtransaction operations. - TransactionEd25519Signature
- The signature for a transaction using the Ed25519 algorithm.
- TransactionExecutable
- Represents an executable inside an orderless transaction payload.
- TransactionExecutableEmpty
- An empty executable for an orderless transaction payload.
- TransactionExecutableEncrypted
- Server-side sentinel variant the fullnode places in a decrypted transaction. The SDK never constructs this; it exists only for deserialization completeness.
- TransactionExecutableEntryFunction
- An entry function executable for an orderless transaction payload.
- TransactionExecutableScript
- A script executable for an orderless transaction payload.
- TransactionExtraConfig
- Represents the extra configuration of an orderless transaction payload.
- TransactionExtraConfigV1
- The V1 variant of the transaction extra configuration, holding an optional multisig address and an optional replay protection nonce.
- TransactionFeePayerSignature
- The signature of the fee payer in a transaction.
- TransactionGenerationConfig
- Optional transaction generation configurations.
- TransactionInnerPayload
- Represents any transaction payload that can be submitted to the Aptos chain for execution.
- TransactionInnerPayloadV1
- The V1 variant of the transaction inner payload, holding an executable and extra configuration.
- TransactionManagement
- A class for managing batch transaction submission for a single account via a background TransactionWorker.
- TransactionMultiAgentSignature
- The structure for a multi-agent signature in a transaction.
- TransactionMultiEd25519Signature
- The structure for a multi-signature transaction using Ed25519.
- TransactionPayload
- Represents a supported Transaction Payload that can be serialized and deserialized.
- TransactionPayloadEncryptedPayload
-
EncryptedPayload::Encryptedas aTransactionPayload. BCS: variant tag (5) | inner tag (0) | Ciphertext | TransactionExtraConfig | 32-byte payload_hash | u64 epoch | Option<ClaimedEntryFunction>. - TransactionPayloadEntryFunction
- Represents a transaction payload entry function that can be serialized and deserialized.
- TransactionPayloadMultiSig
- Represents a multi-signature transaction payload that can be serialized and deserialized.
- TransactionPayloadResponse
- The payload for a transaction response, which can be an entry function, script, multisig, or encrypted payload.
- TransactionPayloadScript
- Represents a transaction payload script that can be serialized and deserialized.
- TransactionResponse
- The response for a transaction, which can be either pending or committed.
- TransactionSecp256k1Signature
- The structure for a Secp256k1 signature in a transaction.
- TransactionSignature
- JSON representations of transaction signatures returned from the node API.
- TransactionSimulate
-
A class to handle all
Simulatetransaction operations. - TransactionSingleSenderSignature
- The structure for a single sender signature in a transaction.
- TransactionSubmit
-
A class to handle all
Submittransaction operations. - TransactionSubmitter
- Implement this interface to override the default transaction submission behavior, for example to submit transactions via a gas station.
- TransactionWorker
- TransactionWorker provides a simple framework for receiving payloads to be processed.
- TransactionWorkerEvent
- A single event emitted by the TransactionWorker: the event name and its payload (SuccessEventData, FailureEventData, or ExecutionFinishEventData).
- TransactionWorkerEventData
- The base payload for transaction worker events.
- TypedValue
-
A
{ type, value }pair used by single sender signatures for the public key and signature fields. - TypeTag
- Represents a type tag in the serialization framework, serving as a base class for various specific type tags. This class provides methods for serialization and deserialization of type tags, as well as type checking methods to determine the specific type of the tag at runtime.
- TypeTagAddress
- Represents a type tag for an address in the system.
- TypeTagBool
- Represents a boolean type tag in the type system.
- TypeTagGeneric
- Represents a generic type tag used for type parameters in entry functions. Generics are not serialized into a real type, so they cannot be used as a type directly.
- TypeTagI128
- Represents a type tag for the i128 data type.
- TypeTagI16
- Represents a type tag for signed 16-bit integers (i16).
- TypeTagI256
- Represents a type tag for the I256 data type.
- TypeTagI32
- Represents a type tag for a 32-bit signed integer (i32).
- TypeTagI64
- Represents a type tag for 64-bit signed integers (i64).
- TypeTagI8
- Represents a type tag for an 8-bit signed integer (i8).
- TypeTagReference
- Represents a reference to a type tag in the type system.
- TypeTagSigner
- Represents a type tag for a signer in the system.
- TypeTagStruct
- Represents a structured type tag in the system, extending the base TypeTag class. This class encapsulates information about a specific structure, including its address, module name, and type arguments, and provides methods for serialization and type checking.
- TypeTagU128
- Represents a type tag for the u128 data type.
- TypeTagU16
- Represents a type tag for unsigned 16-bit integers (u16).
- TypeTagU256
- Represents a type tag for the U256 data type.
- TypeTagU32
- Represents a type tag for a 32-bit unsigned integer (u32).
- TypeTagU64
- Represents a type tag for 64-bit unsigned integers (u64).
- TypeTagU8
- Represents a type tag for an 8-bit unsigned integer (u8).
- TypeTagVector
- Represents a vector type tag, which encapsulates a single type tag value.
- U128
- Represents an unsigned 128-bit integer (U128) value.
- U16
- Represents an unsigned 16-bit integer (U16) value.
- U256
- Represents an unsigned 256-bit integer (U256) value.
- U32
- Represents an unsigned 32-bit integer (U32) value.
- U64
- Represents an unsigned 64-bit integer (U64) value.
- U8
- Represents an unsigned 8-bit integer (U8) value.
- UserTransactionResponse
- The response structure for a user transaction.
- ValidatorTransactionResponse
- The response for a validator transaction, indicating the type of transaction.
- VerifySignatureAsyncOptions
-
Options accepted by
verifySignatureAsyncimplementations ({ throwErrorWithReason?: boolean }). - ViewFunctionABI
- A view function's ABI, providing type checking and input conversion for ABI-based view requests.
- ViewFunctionJsonPayload
- The payload sent to the fullnode for a JSON view request.
- WaitForTransactionOptions
- Options for configuring the behavior of the waitForTransaction() function.
- WebAuthnSignature
- A signature produced by a WebAuthn authenticator (e.g. a passkey), which wraps a Secp256r1 signature together with the authenticator data and client data JSON.
- WriteSet
- A write set, which can be either a script or a direct write set.
- WriteSetChange
- A change in a write set, which can be a module, resource, or table item write or deletion.
- WriteSetChangeDeleteModule
- The structure for a module deletion change in a write set.
- WriteSetChangeDeleteResource
- The payload for a resource deletion in a write set change.
- WriteSetChangeDeleteTableItem
- The payload for a write set change that deletes a table item.
- WriteSetChangeWriteModule
- The structure for a write module change in a write set.
- WriteSetChangeWriteResource
- The resource associated with a write set change, identified by its type.
- WriteSetChangeWriteTableItem
- The structure for a write operation on a table in a write set change.
- ZeroKnowledgeSig
- Represents a zero-knowledge signature, encapsulating the proof and its associated metadata.
- ZkProof
- Represents a container for different types of zero-knowledge proofs.
Enums
- AASigningDataVariant
- The variant for the AASigningData enum.
- AbstractAuthenticationDataVariant
- The variant for the AbstractAuthenticationData enum.
- AccountAuthenticatorVariant
- Variants of account authenticators used in transactions.
- AddressInvalidReason
- Provides reasons for an address was invalid.
- AnyPublicKeyVariant
- Variants of public keys used in cryptographic operations.
- AnySignatureVariant
- Variants of signature types used for cryptographic operations.
- AptosApiType
- Types of API endpoints used for routing requests in the Aptos network.
- DeriveScheme
- Specifies the schemes for deriving account addresses from various data sources.
- EphemeralCertificateVariant
- Variants of ephemeral certificates used in secure transactions.
- EphemeralPublicKeyVariant
- Variants of ephemeral public keys used in cryptographic operations.
- EphemeralSignatureVariant
- Variants of ephemeral signatures used for secure communication.
- ExpirationStatus
- The status of an ANS name's expiration.
- HexInvalidReason
- Provides reasons for parsing failures related to hexadecimal values.
- KeyType
- Supported key types and their associated seeds.
- MimeType
- MIME types used by the Aptos REST API.
- MoveAbility
- Move abilities.
- MoveFunctionVisibility
- Move function visibility.
- MultiSigTransactionPayloadVariants
- Variants of multisig transaction payloads used in the system.
- Network
- Different network environments for connecting to services, ranging from production to development setups.
- OrderByValue
- Specifies the order direction for sorting, including options for handling null values.
- PrivateKeyVariants
- Variants of private keys that can comply with the AIP-80 standard. See https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md
- ProcessorType
- Supported processor types for the indexer API, sourced from the processor_status table in the indexer database.
- PropertyType
- A property type for digital asset property maps, mapping the user input to the Move type Move expects.
- RoleType
- The role of a node.
- ScriptTransactionArgumentVariants
- Variants of script transaction arguments used in Rust. See https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs
- SigningScheme
- Different schemes for signing keys used in cryptographic operations.
- SigningSchemeInput
- Specifies the signing schemes available for cryptographic operations.
- SubdomainExpirationPolicy
- Policy for determining how subdomains expire in relation to their parent domain.
- TokenStandard
-
The token standard to query for, which can be either version
v1orv2. - TransactionAuthenticatorVariant
- Variants of transaction authenticators used in the system. See https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs
- TransactionExecutableVariants
- Variants of transaction executables.
- TransactionExtraConfigVariants
- Variants of transaction extra configuration.
- TransactionInnerPayloadVariants
- Variants of the transaction inner payload (used by orderless transactions).
- TransactionPayloadVariants
- The payload for various transaction types in the system. See https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs
- TransactionResponseType
- The type of a transaction response.
- TransactionVariants
- Variants of raw transactions with data used in the system.
- TransactionWorkerEventsEnum
- Events emitted by the transaction worker during its operation, allowing the dapp to respond to various transaction states.
- TypeTagParserErrorType
- Error types related to parsing type tags, indicating various issues encountered during the parsing process.
- TypeTagVariants
- Variants of type tags used in the Rust implementation.
- ZkpVariant
- Variants of zero-knowledge proofs used in cryptographic operations.
Constants
- accountAbstractionSigningDataSalt → const String
- aptosCoin → const String
- The default gas currency for the network.
- aptosFa → const String
- The address of the APT fungible asset metadata object.
- decryptionNonceLength → const int
-
16-byte decryption nonce for encrypted payloads (aptos-core
DecryptionNonce). - defaultMaxGasAmount → const int
- The default max gas amount when none is given.
- defaultTxnExpSecFromNow → const int
- The default transaction expiration seconds from now.
- defaultTxnTimeoutSec → const int
- The default number of seconds to wait for a transaction to be processed.
- epkHorizonSecs → const int
- hardenedOffset → const int
- maxAudValBytes → const int
- maxCommitedEpkBytes → const int
- maxExtraFieldBytes → const int
- maxI16Number → const int
- maxI32Number → const int
- maxI8Number → const int
- maxIssValBytes → const int
- maxJwtHeaderB64Bytes → const int
- maxU16Number → const int
- maxU32Number → const int
- maxU8Number → const int
- maxUidKeyBytes → const int
- maxUidValBytes → const int
- minEncryptedTxnGasUnitPrice → const int
-
Minimum gas unit price (Octas per gas unit) for encrypted transactions.
Encrypted transactions require 2× the network base minimum (100) because
validators bear the decryption compute cost (aptos-core
encrypted_txn_min_price_per_gas_unit, RELEASE_V1_45+). The node rejects encrypted submissions below this price. - minI16Number → const int
- minI32Number → const int
- minI8Number → const int
- minMaxGasAmount → const int
- The minimum max gas amount that the SDK will allow for a transaction.
-
networkToChainId
→ const Map<
Network, int> -
networkToFaucetApi
→ const Map<
Network, String> -
networkToIndexerApi
→ const Map<
Network, String> -
networkToNodeApi
→ const Map<
Network, String> -
networkToPepperApi
→ const Map<
Network, String> -
networkToProverApi
→ const Map<
Network, String> - promiseFulfilledStatus → const String
- The status string recorded for successfully settled submissions.
- rawTransactionSalt → const String
- rawTransactionWithDataSalt → const String
Properties
- aptosBip44Regex → RegExp
-
final
- aptosHardenedRegex → RegExp
-
Aptos derive path is 637.
final
- bn254P → BigInt
-
BN254 base field modulus p.
final
- bn254R → BigInt
-
BN254 curve (subgroup) order r.
final
- firebaseAuthIssPattern → RegExp
-
Regular expression pattern for Firebase Auth issuer URLs.
Matches URLs in the format: https://securetoken.google.com/[project-id]
where project-id can contain letters, numbers, hyphens, and underscores.
final
- maxI128BigInt → BigInt
-
final
- maxI256BigInt → BigInt
-
final
- maxI64BigInt → BigInt
-
final
- maxU128BigInt → BigInt
-
final
- maxU256BigInt → BigInt
-
final
- maxU64BigInt → BigInt
-
final
- minI128BigInt → BigInt
-
final
- minI256BigInt → BigInt
-
final
- minI64BigInt → BigInt
-
final
Functions
-
accountPublicKeyToBaseAccountPublicKey(
AccountPublicKey publicKey) → AccountPublicKey - Returns the "base" form of an account public key — one of the types that can be used to derive an account's address by appending the signing scheme byte to the public key bytes and hashing (Ed25519PublicKey, AnyPublicKey, MultiEd25519PublicKey or MultiKey).
-
accountPublicKeyToSigningScheme(
AccountPublicKey publicKey) → SigningScheme -
Returns the SigningScheme used when deriving an authentication key from
publicKey. -
aptosCoinStructTag(
) → StructTag - Retrieves the StructTag for the AptosCoin, which represents the Aptos Coin in the Aptos blockchain.
-
base64UrlDecode(
String base64Url) → String - Decodes a base64 URL-encoded string into its original UTF-8 form.
-
base64UrlEncode(
Object input) → String - Encode a string or byte array as a base64url string (RFC 4648 §5) with no padding. String input is interpreted as UTF-8.
-
base64UrlToBytes(
String base64UrlStr) → Uint8List - Decodes a base64url string (with or without padding) into bytes.
-
bigIntToBytesLE(
Object value, int length) → Uint8List - Converts a BigInt or int value into a little-endian byte array of a specified length.
-
bip32DerivePrivateKey(
Uint8List seed, String path) → Uint8List -
Derives a secp256k1 private key from a master
seedfollowing BIP32, using a derivationpathsuch asm/44'/637'/0'/0/0. -
bn254Pairing(
G1Point p, G2Point q, {bool withFinalExponent = true}) → Fp12 -
Computes the optimal-ate pairing
e(p, q)on BN254. -
bn254PairingBatch(
List< ({G1Point g1, G2Point g2})> pairs, {bool withFinalExponent = true}) → Fp12 -
Computes the product of pairings
∏ e(g1ᵢ, g2ᵢ). -
buildEncryptedPayload(
{required AptosConfig aptosConfig, required AccountAddressInput sender, required AnyTransactionPayloadInstance payload, required InputGenerateTransactionOptions options, AccountAddressInput? feePayerAddress, List< AccountAddressInput> ? secondarySignerAddresses, BigInt? replayProtectionNonce}) → Future<TransactionPayloadEncryptedPayload> -
Encrypts an entry-function/script/inner
payloadusing the node's per-epoch batch-encryption key, producing a TransactionPayloadEncryptedPayload. -
buildTransaction(
{required AptosConfig aptosConfig, required AccountAddressInput sender, required AnyTransactionPayloadInstance payload, InputGenerateTransactionOptions? options, List< AccountAddressInput> ? secondarySignerAddresses, AccountAddressInput? feePayerAddress, bool withFeePayer = false}) → Future<AnyRawTransaction> - Generates a transaction based on the provided arguments. This function can create both simple and multi-agent transactions, allowing for flexible transaction handling.
-
bytesToBigIntLE(
Uint8List bytes) → BigInt - Converts a little-endian byte array into a BigInt.
-
checkOrConvertArgument(
Object? arg, TypeTag param, int position, List< TypeTag> genericTypeParams, {MoveModule? moduleAbi, bool allowUnknownStructs = false}) → EntryFunctionArgument - Checks if the provided argument is BCS encoded and converts it if necessary, ensuring type compatibility with the ABI. This is the synchronous version that works offline with pre-fetched ABIs. Does NOT support plain-object struct/enum arguments - use checkOrConvertArgumentWithABI for those.
-
checkOrConvertArgumentWithABI(
Object? arg, TypeTag param, int position, List< TypeTag> genericTypeParams, AptosConfig aptosConfig, {MoveModule? moduleAbi, bool allowUnknownStructs = false}) → Future<EntryFunctionArgument> - Checks if the provided argument is BCS encoded and converts it if necessary, with support for struct/enum arguments. This is the asynchronous version that fetches module ABIs from the network as needed.
-
ckdPriv(
DerivedKeys parent, int index) → DerivedKeys - Derive a child key from the private key (SLIP-0010 hardened derivation).
-
clearMemoizeCache(
) → void - Clears all entries from the memoization cache. Useful for testing or when you need to force fresh data.
-
convertAmountFromHumanReadableToOnChain(
num value, int decimal) → num - Amount is represented in the smallest unit format on chain, this function converts a human-readable amount format to the smallest unit format.
-
convertAmountFromOnChainToHumanReadable(
num value, int decimal) → num - Amount is represented in the smallest unit format on chain, this function converts the smallest unit format to a human-readable amount format.
-
convertArgument(
String functionName, Object functionAbiOrModuleAbi, Object? arg, int position, List< TypeTag> genericTypeParams, {bool allowUnknownStructs = false}) → EntryFunctionArgument - Converts a non-BCS encoded argument into BCS encoded, if necessary. This is the synchronous version that works offline with pre-fetched ABIs. Does NOT support plain-object struct/enum arguments - use convertArgumentWithABI for those.
-
convertArgumentWithABI(
String functionName, Object functionAbiOrModuleAbi, Object? arg, int position, List< TypeTag> genericTypeParams, AptosConfig aptosConfig, {bool allowUnknownStructs = false}) → Future<EntryFunctionArgument> - Converts a non-BCS encoded argument into BCS encoded, with support for struct/enum arguments. This is the asynchronous version that fetches module ABIs from the network as needed.
-
convertNumber(
Object? arg) → int? -
Converts a number or a string representation of a number into an
int. Returnsnullif the input cannot be converted. -
convertPayloadToInnerPayload(
AnyTransactionPayloadInstance payload, [BigInt? replayProtectionNonce]) → TransactionInnerPayload -
Converts a standard transaction payload into an inner payload
(
TransactionInnerPayloadV1), optionally carrying a replay protection nonce for orderless transactions. -
convertSigningMessage(
HexInput message) → HexInput -
Normalizes a sign/verify message into a HexInput that downstream callers
can pass to
Hex.fromHexInput(). -
createObjectAddress(
AccountAddress creatorAddress, Object seed) → AccountAddress - Creates an object address from creator address and seed.
-
createResourceAddress(
AccountAddress creatorAddress, Object seed) → AccountAddress - Creates a resource address from creator address and seed.
-
createTokenAddress(
AccountAddress creatorAddress, String collectionName, String tokenName) → AccountAddress - Creates a token object address from creator address, collection name and token name.
-
createUserDerivedObjectAddress(
AccountAddress sourceAddress, AccountAddress deriveFromAddress) → AccountAddress - Creates a user derived object address from source address and derive_from address.
-
deriveKey(
Object hashSeed, Object data) → DerivedKeys -
Derives a key and chain code from a hash seed and data using HMAC-SHA512.
hashSeedanddatamay each be a UTF-8 String or a Uint8List. -
deriveTransactionType(
AnyRawTransaction transaction) → Serializable - Derives the appropriate raw transaction instance based on the provided transaction details. This function helps in identifying whether the transaction is a FeePayerRawTransaction, MultiAgentRawTransaction, or a standard RawTransaction.
-
deserializeFromScriptArgument(
Deserializer deserializer) → TransactionArgument - Deserializes a Script Transaction Argument.
-
deserializeSchemeAndAddress(
Deserializer deserializer) → ({AccountAddress address, SigningScheme signingScheme}) -
Deserializes the signing scheme variant and account address that prefix
every serialized
Account. -
detectAnyPublicKeyVariant(
PublicKey key) → AnyPublicKeyVariant? -
Detects the
AnyPublicKeyvariant forkeyusing the registered detectors. Returnsnullif no detector matches. -
detectAnySignatureVariant(
Signature signature) → AnySignatureVariant? -
Detects the
AnySignaturevariant forsignatureusing the registered detectors. Returnsnullif no detector matches. -
fetchEntryFunctionAbi(
String moduleAddress, String moduleName, String functionName, AptosConfig aptosConfig) → Future< EntryFunctionABI> - Fetches the ABI for an entry function from the specified module address. This function validates if the ABI corresponds to an entry function and retrieves its parameters (with leading signer arguments removed).
-
fetchFunctionAbi(
String moduleAddress, String moduleName, String functionName, AptosConfig aptosConfig) → Future< MoveFunction?> - Fetches the ABI of a specified function from the on-chain module ABI. This function allows you to access the details of a specific function within a module.
-
fetchModuleAbi(
String moduleAddress, String moduleName, AptosConfig aptosConfig) → Future< MoveModule?> - Fetches the ABI of a specified module from the on-chain module ABI. Results are cached for 5 minutes to reduce redundant network calls.
-
fetchModuleAbiWithStructs(
String moduleAddress, String moduleName, AptosConfig aptosConfig) → Future< ModuleAbiBundle> - Fetches a module ABI along with all struct ABIs it references. This optimization minimizes nested network calls when encoding struct/enum arguments.
-
fetchMoveFunctionAbi(
String moduleAddress, String moduleName, String functionName, AptosConfig aptosConfig) → Future< FunctionABI> - Fetches a function's generic ABI (all parameters, including signers).
-
fetchViewFunctionAbi(
String moduleAddress, String moduleName, String functionName, AptosConfig aptosConfig) → Future< ViewFunctionABI> - Fetches the ABI for a view function from the specified module address. This function ensures that the ABI is valid and retrieves the type parameters, parameters, and return types for the view function.
-
findFirstNonSignerArg(
MoveFunction functionAbi) → int - Finds the index of the first non-signer argument in the function ABI parameters.
-
floorToWholeHour(
int timestampInSeconds) → int - Floors the given timestamp to the nearest whole hour. This function is useful for normalizing timestamps to hourly intervals.
-
generateRawTransaction(
{required AptosConfig aptosConfig, required AccountAddressInput sender, required AnyTransactionPayloadInstance payload, InputGenerateTransactionOptions? options, AccountAddressInput? feePayerAddress, List< AccountAddressInput> ? secondarySignerAddresses}) → Future<RawTransaction> - Generates a raw transaction that can be sent to the Aptos network.
-
generateSignedTransaction(
InputSubmitTransactionData args) → Uint8List - Generates a signed transaction ready for submission to the blockchain. This function prepares the transaction by authenticating the sender and any additional signers based on the provided arguments.
-
generateSignedTransactionForSimulation(
InputSimulateTransactionData args) → Future< Uint8List> - Generates a signed transaction for simulation before submitting it to the chain. This function helps in preparing a transaction that can be simulated, allowing users to verify its validity and expected behavior.
-
generateSigningMessage(
Uint8List bytes, String domainSeparator) → Uint8List - Generates the 'signing message' form of a message to be signed. This function combines a domain separator with the byte representation of the message to create a signing message.
-
generateSigningMessageForSerializable(
Serializable serializable) → Uint8List - Generates the 'signing message' form of a serializable value by serializing it and using the runtime type name as the domain separator.
-
generateSigningMessageForTransaction(
AnyRawTransaction transaction) → Uint8List - Generates the 'signing message' form of a transaction by deriving the type of transaction and applying the appropriate domain separator based on the presence of a fee payer or secondary signers.
-
generateTransactionPayload(
InputGenerateTransactionPayloadData data, [AptosConfig? aptosConfig]) → Future< AnyTransactionPayloadInstance> -
Builds a transaction payload based on the provided input data and returns
a transaction payload: a
TransactionPayloadScript,TransactionPayloadMultiSig, orTransactionPayloadEntryFunction. -
generateTransactionPayloadWithABI(
InputEntryFunctionData data) → AnyTransactionPayloadInstance - Generates a transaction payload using the provided ABI and function details. This function is synchronous and works offline with pre-fetched ABIs (no network calls).
-
generateUserTransactionHash(
InputSubmitTransactionData args) → String - Generates a user transaction hash for the provided transaction payload, which must already have an authenticator. This function helps ensure the integrity and uniqueness of the transaction by producing a hash based on the signed transaction data.
-
generateViewFunctionPayload(
InputViewFunctionData data, AptosConfig aptosConfig) → Future< EntryFunction> - Generates the payload for a view function call using the provided input. Uses the Remote ABI when InputViewFunctionData.abi is not provided.
-
generateViewFunctionPayloadWithABI(
InputViewFunctionData data) → EntryFunction - Generates a payload for a view function call using the provided ABI and arguments. This function is synchronous and works offline with pre-fetched ABIs (no network calls). Does NOT support plain-object struct/enum arguments.
-
getAnyPublicKeyDeserializer(
int variantIndex) → PublicKeyDeserializer? - Looks up a registered public key deserializer by variant index.
-
getAnySignatureDeserializer(
int variantIndex) → SignatureDeserializer? - Looks up a registered signature deserializer by variant index.
-
getAuthenticatorForSimulation(
PublicKey? publicKey) → Future< AccountAuthenticator> -
Derives an AccountAuthenticator to use for simulating a transaction
with the given public key (or a no-account authenticator when
publicKeyisnull, which skips the auth key check during simulation). -
getErrorMessage(
Object? error) → String - Get the error message from an unknown error.
-
getFunctionParts(
String functionArg) → ({String functionName, String moduleAddress, String moduleName}) - Splits a function identifier in the format "moduleAddress::moduleName::functionName" into its constituent parts.
-
getIssAudAndUidVal(
{required String jwt, String uidKey = 'sub'}) → ({String aud, String iss, String uidVal}) - Parses a JWT and returns the 'iss', 'aud', and 'uid' values.
-
getMemoizeCacheSize(
) → int - Returns the current size of the memoization cache. Useful for monitoring and debugging.
-
getPublicInputsHash(
{required PublicKey publicKey, required KeylessSignature signature, required MoveJWK jwk, required KeylessConfiguration keylessConfig}) → BigInt - Get the public inputs hash for the keyless signature.
-
hashStrToField(
String str, int maxSizeBytes) → BigInt - Hashes a string to a field element via Poseidon hashing. This function is useful for converting a string into a fixed-size hash that can be used in cryptographic applications.
-
hashValues(
List< Object> input) → Uint8List - Hashes the set of values using a SHA3-256 hash algorithm.
-
hexToAsciiString(
String hex) → String - Decodes a hex string (with or without the 0x prefix) into its ASCII string representation.
-
isBcsAddress(
Object? arg) → bool - Determines if the provided argument is an instance of AccountAddress.
-
isBcsBool(
Object? arg) → bool - Determines if the provided argument is an instance of Bool.
-
isBcsFixedBytes(
Object? arg) → bool - Determines if the provided argument is an instance of FixedBytes.
-
isBcsI128(
Object? arg) → bool - Determines if the provided argument is an instance of I128.
-
isBcsI16(
Object? arg) → bool - Determines if the provided argument is an instance of I16.
-
isBcsI256(
Object? arg) → bool - Determines if the provided argument is an instance of I256.
-
isBcsI32(
Object? arg) → bool - Determines if the provided argument is an instance of I32.
-
isBcsI64(
Object? arg) → bool - Determines if the provided argument is an instance of I64.
-
isBcsI8(
Object? arg) → bool - Determines if the provided argument is an instance of I8.
-
isBcsString(
Object? arg) → bool - Determines if the provided argument is an instance of MoveString.
-
isBcsU128(
Object? arg) → bool - Determines if the provided argument is an instance of U128.
-
isBcsU16(
Object? arg) → bool - Determines if the provided argument is an instance of U16.
-
isBcsU256(
Object? arg) → bool - Determines if the provided argument is an instance of U256.
-
isBcsU32(
Object? arg) → bool - Determines if the provided argument is an instance of U32.
-
isBcsU64(
Object? arg) → bool - Determines if the provided argument is an instance of U64.
-
isBcsU8(
Object? arg) → bool - Determines if the provided argument is an instance of U8.
-
isBool(
Object? arg) → bool - Determines if the provided argument is of type boolean.
-
isCanonicalEd25519Signature(
Signature signature) → bool - Checks if an ED25519 signature is non-canonical. This function helps determine the validity of a signature by verifying its canonical form.
-
isEmptyOption(
Object? arg) → bool -
Checks if the provided argument is empty (i.e.
null), meaning "no value" for an option. -
isEncodedEntryFunctionArgument(
Object? arg) → bool - Determines if the provided argument is a valid, already BCS-encoded entry function argument type.
-
isEncodedStruct(
Object? structObj) → bool - Determines whether the given object is an encoded struct type with account_address, module_name, and struct_name string properties.
-
isKeylessSigner(
Object? obj) → bool - Determines whether the provided object is a KeylessSigner.
-
isLargeNumber(
Object? arg) → bool -
Determines if the provided argument is a large number: an
int, a BigInt, or a string representation of a number. -
isNumber(
Object? arg) → bool - Determines if the provided argument is of type number.
-
isScriptDataInput(
InputGenerateTransactionPayloadData data) → bool - Determines if the provided payload data is script data input.
-
isSingleKeySigner(
Object? obj) → bool - Determines whether the provided object is a SingleKeySigner.
-
isValidBIP44Path(
String path) → bool - Validate a BIP-44 derivation path string to ensure it meets the required format. This function checks if the provided path adheres to the BIP-44 standard for Secp256k1, in form m/44'/637'/{account_index}'/{change_index}/{address_index}.
-
isValidFunctionInfo(
String functionInfo) → bool - Validates the provided function information.
-
isValidHardenedPath(
String path) → bool - Aptos derive path is 637.
-
memoize<
T> (T func(), String key, {Duration? ttl}) → T Function() - Caches the result of a function call to improve performance on subsequent calls with the same key.
-
memoizeAsync<
T> (Future< T> func(), String key, {Duration? ttl}) → Future<T> Function() - A memoize higher-order function to cache the response of an async function. This helps to improve performance by avoiding repeated calls to the same async function with the same key within a specified time-to-live.
-
mnemonicToSeed(
String mnemonic) → Uint8List - Normalizes the mnemonic by removing extra whitespace and making it lowercase, then derives the BIP-39 seed.
-
nowInSeconds(
) → int - The current Unix timestamp in whole seconds.
-
objectStructTag(
TypeTag typeArg) → StructTag - Creates a new StructTag for the Object type with the specified type argument.
-
optionStructTag(
TypeTag typeArg) → StructTag - Creates a new StructTag for the Option type with the specified type argument.
-
orderByToJson(
OrderBy? orderBy) → Object? - Converts an OrderBy argument into a JSON-encodable structure (OrderByValue entries are replaced by their wire string).
-
outOfRangeErrorMessage(
Object value, Object min, Object max) → String -
padAndPackBytesWithLen(
Uint8List bytes, int maxSizeBytes) → List< BigInt> - Pads and packs the given byte array to a specified maximum size and appends its length.
-
pairedFaMetadataAddress(
String coinType) → AccountAddress - Calculates the paired FA metadata address for a given coin type. This function is tolerant of various address formats in the coin type string, including complex nested types.
-
parseEncodedStruct(
Map< String, dynamic> structObj) → String - Convert an encoded struct to a Move struct id string.
-
parseJwtHeader(
String jwtHeader) → JwtHeader - Safely parses the JWT header.
-
parseTypeTag(
String typeStr, {bool allowGenerics = false}) → TypeTag - Parses a type string into a structured representation of type tags, accommodating various formats including generics and nested types.
-
poseidonHash(
List< Object> inputs) → BigInt - Hashes up to 16 scalar elements via the Poseidon hashing algorithm. Each element must be a scalar field element of the BN254 elliptic curve group.
-
registerAnyPublicKeyVariant(
AnyPublicKeyVariant variant, PublicKeyDeserializer deserializer, PublicKeyVariantDetector detector) → void -
Registers a deserializer and a variant detector for an
AnyPublicKeyvariant. -
registerAnySignatureVariant(
AnySignatureVariant variant, SignatureDeserializer deserializer, SignatureVariantDetector detector) → void -
Registers a deserializer and a variant detector for an
AnySignaturevariant. -
registerKeylessCrypto(
) → void -
Idempotently registers the Keyless and FederatedKeyless variants for
AnyPublicKeyand the Keyless variant forAnySignature. -
sleep(
int timeMs) → Future< void> - Sleep for the specified amount of time in milliseconds.
-
splitPath(
String path) → List< String> - Splits a derive path into segments, removing apostrophes.
-
standardizeTypeTags(
List< TypeArgument> ? typeArguments) → List<TypeTag> - Convert type arguments to only type tags, allowing for string representations of type tags.
-
stringStructTag(
) → StructTag - Returns a new StructTag representing a string type.
-
throwTypeMismatch(
String expectedType, int position) → Never - Throws an ArgumentError indicating a type mismatch for a specified argument position.
-
truncateAddress(
String address, {int start = 6, int end = 5}) → String - Truncates the provided wallet address at the middle with an ellipsis.
-
u64ToIntSafe(
BigInt value, String fieldName) → int - Narrows a u64 (BigInt) into an int with an explicit safety check.
-
validateBigIntInRange(
BigInt value, BigInt minValue, BigInt maxValue) → void - Validates that a given BigInt is within a specified range, throwing an error if the value is outside the defined minimum and maximum bounds.
-
validateNumberInRange(
int value, int minValue, int maxValue) → void - Validates that a given int is within a specified range, throwing an error if the value is outside the defined minimum and maximum bounds.
-
verifyKeylessSignature(
{required PublicKey publicKey, required AptosConfig? aptosConfig, required HexInput message, required Signature signature, KeylessConfiguration? keylessConfig, MoveJWK? jwk, Object? options}) → Future< bool> -
Verifies a keyless
signatureformessage, fetching the on-chain keyless configuration and the relevant JWK from the network when they are not supplied viakeylessConfig/jwk. -
verifyKeylessSignatureWithJwkAndConfig(
{required PublicKey publicKey, required HexInput message, required Signature signature, required KeylessConfiguration keylessConfig, required MoveJWK jwk}) → void - Synchronously verifies a keyless signature for a given message. You need to provide the keyless configuration and the JWK to use for verification.
-
waitForIndexer(
{required AptosConfig aptosConfig, required AnyNumber minimumLedgerVersion, ProcessorType? processorType}) → Future< void> - Waits for the indexer to sync up to the specified ledger version. The timeout is 3 seconds.
-
waitForIndexerOnVersion(
{required AptosConfig config, AnyNumber? minimumLedgerVersion, required ProcessorType processorType}) → Future< void> -
Waits for the indexer to reach a specified ledger version, allowing for
synchronization with the blockchain. If
minimumLedgerVersionis null, this function does not wait. -
warnIfDevelopment(
String message) → void - Logs a warning message only in development environments (when assertions are enabled). This helps reduce information leakage in production while maintaining helpful warnings during development.
Typedefs
- AccountAddressInput = Object
- The input for an account address, which can be a hex String, a Uint8List, or an AccountAddress.
-
AnsNamesResult
= ({List<
AnsName> names, int total}) - The result of an ANS names query: the sanitized names plus the total count of matching names.
- AnsTransactionResult = ({InputEntryFunctionData data, SimpleTransaction transaction})
- The result of an ANS transaction builder: the built transaction plus the entry function input data it was built from.
- AnyNumber = Object
- A number or a BigInt value.
- AnyTransactionPayloadInstance = TransactionPayload
-
The transaction payload type generated by the
generateTransactionPayload()function: aTransactionPayloadEntryFunction,TransactionPayloadScript,TransactionPayloadMultiSig,TransactionInnerPayloadorTransactionPayloadEncryptedPayload. - AuthenticationKeyScheme = Object
- The scheme used when deriving an authentication key. This can be a SigningScheme or a DeriveScheme.
-
Deserializable<
T> = T Function(Deserializer deserializer) -
A function that deserializes a byte buffer into a type
T, typically a tear-off of a staticdeserializemethod, e.g.AccountAddress.deserialize. - EntryFunctionArgumentTypes = EntryFunctionArgument
-
Entry function arguments for building a raw transaction using
BCS-serialized arguments (
Bool,U8..U256,I8..I256,AccountAddress,MoveVector,MoveOption,MoveString,MoveStructArgument,MoveEnumArgument,FixedBytes). - HexInput = Object
-
A hex input, which can be a hex String (with or without the
0xprefix) or a Uint8List of raw bytes. - MoveAddressType = String
- A string representing a Move address.
- MoveFunctionId = MoveStructId
-
The Move function identifier, formatted as
address::module_name::function_name. Same as MoveStructId since it reads weird to take a StructId for a Function. - MoveInt128Type = String
- A string representing a 128-bit signed integer in the Move programming language.
- MoveInt16Type = int
- A 16-bit signed integer used in the Move programming language.
- MoveInt256Type = String
- A string representation of a 256-bit signed integer used in Move programming.
- MoveInt32Type = int
- A 32-bit signed integer type used in Move programming.
- MoveInt64Type = String
- A string representation of a 64-bit signed integer used in Move programming.
- MoveInt8Type = int
- A number representing a Move int8 type.
- MoveModuleId = String
-
A string representation of a Move module, formatted as
address::module_name. Module names are case-sensitive. - MoveObjectType = String
- The type for identifying objects to be moved within the system.
- MoveOptionType = Object?
- The type for Move options, which can be a MoveType or null.
- MoveStructId = String
-
A structure representing a Move struct identifier, formatted as
address::module_name::struct_name. - MoveStructType = Object
- A Move struct value in its JSON representation.
- MoveType = Object
- A union type that encompasses various data types used in Move, including primitive types, address types, object types, and arrays of MoveType.
- MoveUint128Type = String
- A string representing a 128-bit unsigned integer in the Move programming language.
- MoveUint16Type = int
- A 16-bit unsigned integer used in the Move programming language.
- MoveUint256Type = String
- A string representation of a 256-bit unsigned integer used in Move programming.
- MoveUint32Type = int
- A 32-bit unsigned integer type used in Move programming.
- MoveUint64Type = String
- A string representation of a 64-bit unsigned integer used in Move programming.
- MoveUint8Type = int
- A number representing a Move uint8 type.
- MoveValue = Object?
- Possible Move values acceptable by Move functions (entry, view).
-
OrderBy
= List<
Map< String, Object> > -
A generic order-by argument: a list of
{column: OrderByValue}maps (values may also be nested maps for ordering by nested relations). - PrivateKeyInput = Object
-
A private key that can be used with the SingleKey authentication scheme:
Ed25519PrivateKeyorSecp256k1PrivateKey. -
ProofFetchCallback
= Future<
void> Function(ProofFetchStatus status) - A callback invoked when an asynchronous proof fetch finishes.
- PropertyValue = Object
-
Accepted property value types for user input:
bool,int,BigInt,String,AccountAddress, orUint8List. - PublicKeyDeserializer = PublicKey Function(Deserializer deserializer)
-
A function that deserializes the inner public key of an
AnyPublicKeyvariant (the variant index has already been consumed). - PublicKeyVariantDetector = AnyPublicKeyVariant? Function(PublicKey key)
-
Returns the AnyPublicKeyVariant for
keyif the detector recognizes it, ornullotherwise. - ScriptFunctionArgumentTypes = ScriptFunctionArgument
- Script function arguments for building raw transactions using BCS-serialized arguments.
- SignatureDeserializer = Signature Function(Deserializer deserializer)
-
A function that deserializes the inner signature of an
AnySignaturevariant (the variant index has already been consumed). - SignatureVariantDetector = AnySignatureVariant? Function(Signature signature)
-
Returns the AnySignatureVariant for
signatureif the detector recognizes it, ornullotherwise. - SimpleEntryFunctionArgumentTypes = Object
-
Entry function arguments for building a raw transaction using remote ABI:
raw values such as
bool,int,BigInt,String,null(to support empty options),Uint8List,ByteBuffer, or aListof those (possibly mixed with already-encoded EntryFunctionArgumentTypes values). - SingleKeySignerOrLegacyEd25519Account = Account
- A signer that is either a SingleKeySigner or a legacy Ed25519Account.
- TransactionHistoryEntry = (String, BigInt, Object?)
- A history entry for a sent or executed transaction: the transaction hash (or settle status when the submission was rejected), the sequence number it was sent with, and the error (if any).
- TypeArgument = Object
- Inputs for type arguments of entry functions, view functions and scripts.
Exceptions / Errors
- AptosApiError
- Represents an error returned from the Aptos API. This class encapsulates the details of the error, including the request URL, response status, and additional data.
- AsyncQueueCancelledError
- Represents an error that occurs when an asynchronous queue operation is cancelled. This error provides additional context for cancellation events.
- FailedTransactionError
-
Represents an error that occurs when a transaction fails.
This error is thrown by the
waitForTransactionfunction when thecheckSuccessparameter is set to true. -
ParsingError<
T> - This error is used to explain why parsing failed.
- TypeTagParserError
- Represents an error that occurs during the parsing of a type tag. This error provides additional context regarding the specific type tag that failed to parse and the reason for the failure.
- WaitForTransactionError
-
Represents an error that occurs when waiting for a transaction to
complete. This error is thrown by the
waitForTransactionfunction when a transaction times out or when the transaction response is undefined.