AbstractReadonlyaccountAccount address associated with the account
+ReadonlyaudThe value of the 'aud' claim on the JWT, also known as client ID. This is the identifier for the dApp's +OIDC registration with the identity provider.
+ReadonlyephemeralThe EphemeralKeyPair used to generate sign.
+ReadonlyjwtThe JWT token used to derive the account
+ReadonlypepperA value contains 31 bytes of entropy that preserves privacy of the account. Typically fetched from a pepper provider.
+The zero knowledge signature (if ready) which contains the proof used to validate the EphemeralKeyPair.
+ReadonlyproofThe proof of the EphemeralKeyPair or a promise that provides the proof. This is used to allow for awaiting on +fetching the proof.
+ReadonlypublicThe KeylessPublicKey associated with the account
+ReadonlysigningSigning scheme used to sign transactions
+ReadonlyuidThe claim on the JWT to identify a user. This is typically 'sub' or 'email'.
+ReadonlyuidThe value of the uidKey claim on the JWT. This intended to be a stable user identifier.
+This initializes the asynchronous proof fetch
+Emits whether the proof succeeds or fails, but has no return.
+Checks if the proof is expired. If so the account must be re-derived with a new EphemeralKeyPair +and JWT token.
+boolean
+Sign the given message using Keyless.
+in HexInput format
+Signature
+Sign the given transaction with Keyless. +Signs the transaction and proof to guard against proof malleability.
+the transaction to be signed
+KeylessSignature
+Sign a transaction using Keyless.
+the raw transaction
+the AccountAuthenticator containing the signature of the transaction, together with the account's public key
+Sign a message using Keyless.
+the message to sign, as binary input
+the AccountAuthenticator containing the signature, together with the account's public key
+Note - This function is currently incomplete and should only be used to verify ownership of the KeylessAccount
+Verifies a signature given the message.
+the message that was signed.
+the KeylessSignature to verify
+boolean
+Verify the given message and signature with the public key. It fetches any on chain state if needed for verification.
+The arguments for verifying the signature.
+The configuration object for connecting to the Aptos network
+Raw message data in HexInput format.
+Optionaloptions?: { throwErrorWithReason?: boolean }Signed message signature.
+A boolean indicating whether the signature is valid.
+Waits for asynchronous proof fetching to finish.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Validates that the Keyless Account can be used to sign transactions.
+Serializes the jwt data into a format suitable for transmission or storage. +This function ensures that both the jwt data and the proof are properly serialized.
+The serializer instance used to convert the jwt data into bytes.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticfetchFetches the JWK from the issuer's well-known JWKS endpoint.
+The kid of the JWK to fetch
+The keyless public key to query
+A JWK matching the kid in the JWT header.
StaticpartialAbstractAn abstract representation of an account public key.
+Provides a common interface for deriving an authentication key.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+AbstractauthGet the authentication key associated with this public key
+Create a bitmap that holds the mapping from the original public keys +to the signatures passed in
+array of the index mapping to the matching public keys
+Uint8array bit map
+Get the index of the provided public key.
+This function retrieves the index of a specified public key within the MultiKey. +If the public key does not exist, it throws an error.
+The public key to find the index for.
+The corresponding index of the public key, if it exists.
+Get the public key as a hex string with a 0x prefix.
+The public key in hex format.
+Get the raw public key bytes
+AbstractverifyVerifies that the private key associated with this public key signed the message with the given signature.
+Represents the arguments required to verify a digital signature.
+Verifies signature with the public key and makes any network calls required to get state required to verify the signature.
+AbstractgetAbstractserializeReturns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
An abstract representation of an account public key.
+Provides a common interface for deriving an authentication key.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Get the authentication key associated with this public key
+Get the public key as a hex string with a 0x prefix.
+The public key in hex format.
+Get the raw public key bytes
+Verifies that the private key associated with this public key signed the message with the given signature.
+Represents the arguments required to verify a digital signature.
+Verifies signature with the public key and makes any network calls required to get state required to verify the signature.
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
An abstract representation of a crypto signature, +associated with a specific signature scheme, e.g., Ed25519 or Secp256k1.
+This class represents the product of signing a message directly from a +PrivateKey and can be verified against a CryptoPublicKey.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Get the signature as a hex string with a 0x prefix e.g. 0x123456...
+The hex string representation of the signature.
+Get the raw signature bytes
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeAbstract class representing a generic Aptos account.
+This class serves as a single entry point for account generation, allowing accounts to be created
+either through Account.generate() or Account.fromDerivationPath. Although it is defined as an
+abstract class, it should be treated as an interface and enforced using the implements keyword.
Note: Generating an account instance does not create the account on-chain.
+ReadonlyaccountAccount address associated with the account
+ReadonlypublicPublic key associated with the account
+Sign the given message using the available signing capabilities.
+in HexInput format
+Signature
+ReadonlysigningSigning scheme used to sign transactions
+Sign the given transaction using the available signing capabilities.
+the transaction to be signed
+Signature
+Sign a transaction using the available signing capabilities.
+the raw transaction
+the AccountAuthenticator containing the signature of the transaction, together with the account's public key
+Sign a message using the available signing capabilities.
+the signing message, as binary input
+the AccountAuthenticator containing the signature, together with the account's public key
+Verify the given message and signature with the public key. +This function helps ensure the integrity and authenticity of a message by validating its signature.
+The arguments for verifying the signature.
+Represents the arguments required to verify a digital signature.
+A boolean indicating whether the signature is valid.
+Verify the given message and signature with the public key. It fetches any on chain state if needed for verification.
+The arguments for verifying the signature.
+The configuration object for connecting to the Aptos network
+Raw message data in HexInput format.
+Signed message signature.
+A boolean indicating whether the signature is valid.
+StaticauthRetrieve the authentication key for the associated account using the provided public key. +This key enables account owners to rotate their private key(s) associated with the account without changing the address that +hosts their account. +See here for more info: https://aptos.dev/concepts/accounts#single-signer-authentication
+The arguments for retrieving the authentication key.
+The public key of the account.
+The authentication key for the associated account.
+StaticfromGenerates an account from a specified derivation path and mnemonic. +This function allows you to create an account using different signing schemes based on the provided arguments.
+The arguments for generating the account.
+Arguments for generating an Ed25519 account, specifying the signing scheme and legacy option.
+Optionallegacy?: trueOptionalscheme?: Ed25519Arguments for deriving a private key using a mnemonic phrase and a specified BIP44 path.
+Generates an account from a specified derivation path and mnemonic. +This function allows you to create an account using different signing schemes based on the provided arguments.
+The arguments for generating the account.
+Arguments for generating a SingleKeyAccount with an underlying Ed25519PrivateKey.
+The legacy argument must be set to false to ensure an Ed25519SingleKeyAccount is returned.
Optionalscheme?: Ed25519Arguments for deriving a private key using a mnemonic phrase and a specified BIP44 path.
+Generates an account from a specified derivation path and mnemonic. +This function allows you to create an account using different signing schemes based on the provided arguments.
+The arguments for generating the account.
+Arguments for generating a SingleKeyAccount using a supported private key other than Ed25519PrivateKey.
+The legacy argument is optional and defaults to false, and cannot be set to true.
Optionallegacy?: falseArguments for deriving a private key using a mnemonic phrase and a specified BIP44 path.
+Generates an account from a specified derivation path and mnemonic. +This function allows you to create an account using different signing schemes based on the provided arguments.
+The arguments for generating the account.
+Arguments for generating an opaque Account when the input signature scheme is unknown at compile time.
Optionallegacy?: booleanOptionalscheme?: SigningSchemeInputArguments for deriving a private key using a mnemonic phrase and a specified BIP44 path.
+StaticfromCreates an account from a given private key and address. +This function allows you to instantiate an account based on the provided private key, +and it can differentiate between legacy and non-legacy accounts.
+The arguments for creating the account.
+Arguments for creating an Ed25519Account from an Ed25519PrivateKey.
+To use the SingleKey authentication scheme, set legacy to false.
Optionaladdress?: AccountAddressInputOptionallegacy?: trueAn instance of either Ed25519Account or SingleKeyAccount based on the provided private key.
+Creates an account from a given private key and address. +This function allows you to instantiate an account based on the provided private key, +and it can differentiate between legacy and non-legacy accounts.
+The arguments for creating the account.
+Arguments for creating a SingleKeyAccount from a supported private key, excluding Ed25519PrivateKey.
+The legacy argument is always false and cannot be set to true.
Optionaladdress?: AccountAddressInputOptionallegacy?: falseAn instance of either Ed25519Account or SingleKeyAccount based on the provided private key.
+Creates an account from a given private key and address. +This function allows you to instantiate an account based on the provided private key, +and it can differentiate between legacy and non-legacy accounts.
+The arguments for creating the account.
+Arguments for creating an Account from a private key when the key type is unknown at compile time.
Optionaladdress?: AccountAddressInputOptionallegacy?: booleanAn instance of either Ed25519Account or SingleKeyAccount based on the provided private key.
+StaticfromThe arguments required to create an account from a private key.
+Arguments for creating an Account from a private key when the key type is unknown at compile time.
Optionaladdress?: AccountAddressInputOptionallegacy?: booleanAccount
+StaticgenerateGenerates a new account based on the specified signing scheme and legacy option. +This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.
+Optionalargs: GenerateEd25519AccountArgsThe arguments for generating the account.
+Arguments for generating an Ed25519 account, specifying the signing scheme and legacy option.
+Optionallegacy?: trueOptionalscheme?: Ed25519Generates a new account based on the specified signing scheme and legacy option. +This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.
+The arguments for generating the account.
+Arguments for generating a SingleKeyAccount with an underlying Ed25519PrivateKey.
+The legacy argument must be set to false to ensure an Ed25519SingleKeyAccount is returned.
Optionalscheme?: Ed25519Generates a new account based on the specified signing scheme and legacy option. +This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.
+The arguments for generating the account.
+Arguments for generating a SingleKeyAccount using a supported private key other than Ed25519PrivateKey.
+The legacy argument is optional and defaults to false, and cannot be set to true.
Optionallegacy?: falseGenerates a new account based on the specified signing scheme and legacy option. +This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.
+The arguments for generating the account.
+Arguments for generating an opaque Account when the input signature scheme is unknown at compile time.
Optionallegacy?: booleanOptionalscheme?: SigningSchemeInputStaticfromCreates an AbstractedAccount from an Ed25519Account that has a permissioned signer function and
+using the 0x1::permissioned_delegation::authenticate function to verify the signature.
The Ed25519Account that can be used to sign permissioned transactions.
The AbstractedAccount
StaticgenerateAbstractAbstract class representing a generic Aptos account.
+This class serves as a single entry point for account generation, allowing accounts to be created
+either through Account.generate() or Account.fromDerivationPath. Although it is defined as an
+abstract class, it should be treated as an interface and enforced using the implements keyword.
Note: Generating an account instance does not create the account on-chain.
+Abstract ReadonlyaccountAccount address associated with the account
+Abstract ReadonlypublicPublic key associated with the account
+AbstractsigningSigning scheme used to sign transactions
+AbstractsignAbstractsignSign the given transaction using the available signing capabilities.
+the transaction to be signed
+Signature
+AbstractsignSign a transaction using the available signing capabilities.
+the raw transaction
+the AccountAuthenticator containing the signature of the transaction, together with the account's public key
+AbstractsignSign a message using the available signing capabilities.
+the signing message, as binary input
+the AccountAuthenticator containing the signature, together with the account's public key
+Verify the given message and signature with the public key. +This function helps ensure the integrity and authenticity of a message by validating its signature.
+The arguments for verifying the signature.
+Represents the arguments required to verify a digital signature.
+A boolean indicating whether the signature is valid.
+Verify the given message and signature with the public key. It fetches any on chain state if needed for verification.
+The arguments for verifying the signature.
+The configuration object for connecting to the Aptos network
+Raw message data in HexInput format.
+Signed message signature.
+A boolean indicating whether the signature is valid.
+StaticauthRetrieve the authentication key for the associated account using the provided public key. +This key enables account owners to rotate their private key(s) associated with the account without changing the address that +hosts their account. +See here for more info: https://aptos.dev/concepts/accounts#single-signer-authentication
+The arguments for retrieving the authentication key.
+The public key of the account.
+The authentication key for the associated account.
+StaticfromGenerates an account from a specified derivation path and mnemonic. +This function allows you to create an account using different signing schemes based on the provided arguments.
+The arguments for generating the account.
+Arguments for generating an Ed25519 account, specifying the signing scheme and legacy option.
+Optionallegacy?: trueOptionalscheme?: Ed25519Arguments for deriving a private key using a mnemonic phrase and a specified BIP44 path.
+Generates an account from a specified derivation path and mnemonic. +This function allows you to create an account using different signing schemes based on the provided arguments.
+The arguments for generating the account.
+Arguments for generating a SingleKeyAccount with an underlying Ed25519PrivateKey.
+The legacy argument must be set to false to ensure an Ed25519SingleKeyAccount is returned.
Optionalscheme?: Ed25519Arguments for deriving a private key using a mnemonic phrase and a specified BIP44 path.
+Generates an account from a specified derivation path and mnemonic. +This function allows you to create an account using different signing schemes based on the provided arguments.
+The arguments for generating the account.
+Arguments for generating a SingleKeyAccount using a supported private key other than Ed25519PrivateKey.
+The legacy argument is optional and defaults to false, and cannot be set to true.
Optionallegacy?: falseArguments for deriving a private key using a mnemonic phrase and a specified BIP44 path.
+Generates an account from a specified derivation path and mnemonic. +This function allows you to create an account using different signing schemes based on the provided arguments.
+The arguments for generating the account.
+Arguments for generating an opaque Account when the input signature scheme is unknown at compile time.
Optionallegacy?: booleanOptionalscheme?: SigningSchemeInputArguments for deriving a private key using a mnemonic phrase and a specified BIP44 path.
+StaticfromCreates an account from a given private key and address. +This function allows you to instantiate an account based on the provided private key, +and it can differentiate between legacy and non-legacy accounts.
+The arguments for creating the account.
+Arguments for creating an Ed25519Account from an Ed25519PrivateKey.
+To use the SingleKey authentication scheme, set legacy to false.
Optionaladdress?: AccountAddressInputOptionallegacy?: trueAn instance of either Ed25519Account or SingleKeyAccount based on the provided private key.
+Creates an account from a given private key and address. +This function allows you to instantiate an account based on the provided private key, +and it can differentiate between legacy and non-legacy accounts.
+The arguments for creating the account.
+Arguments for creating a SingleKeyAccount from a supported private key, excluding Ed25519PrivateKey.
+The legacy argument is always false and cannot be set to true.
Optionaladdress?: AccountAddressInputOptionallegacy?: falseAn instance of either Ed25519Account or SingleKeyAccount based on the provided private key.
+Creates an account from a given private key and address. +This function allows you to instantiate an account based on the provided private key, +and it can differentiate between legacy and non-legacy accounts.
+The arguments for creating the account.
+Arguments for creating an Account from a private key when the key type is unknown at compile time.
Optionaladdress?: AccountAddressInputOptionallegacy?: booleanAn instance of either Ed25519Account or SingleKeyAccount based on the provided private key.
+StaticfromThe arguments required to create an account from a private key.
+Arguments for creating an Account from a private key when the key type is unknown at compile time.
Optionaladdress?: AccountAddressInputOptionallegacy?: booleanAccount
+StaticgenerateGenerates a new account based on the specified signing scheme and legacy option. +This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.
+Optionalargs: GenerateEd25519AccountArgsThe arguments for generating the account.
+Arguments for generating an Ed25519 account, specifying the signing scheme and legacy option.
+Optionallegacy?: trueOptionalscheme?: Ed25519Generates a new account based on the specified signing scheme and legacy option. +This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.
+The arguments for generating the account.
+Arguments for generating a SingleKeyAccount with an underlying Ed25519PrivateKey.
+The legacy argument must be set to false to ensure an Ed25519SingleKeyAccount is returned.
Optionalscheme?: Ed25519Generates a new account based on the specified signing scheme and legacy option. +This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.
+The arguments for generating the account.
+Arguments for generating a SingleKeyAccount using a supported private key other than Ed25519PrivateKey.
+The legacy argument is optional and defaults to false, and cannot be set to true.
Optionallegacy?: falseGenerates a new account based on the specified signing scheme and legacy option. +This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.
+The arguments for generating the account.
+Arguments for generating an opaque Account when the input signature scheme is unknown at compile time.
Optionallegacy?: booleanOptionalscheme?: SigningSchemeInputRepresents an account abstraction message that contains the original signing message and the function info.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeNOTE: Only use this class for account addresses. For other hex data, e.g. transaction +hashes, use the Hex class.
+AccountAddress is used for working with account addresses. Account addresses, when +represented as a string, generally look like these examples:
+Proper formatting and parsing of account addresses is defined by AIP-40. +To learn more about the standard, read the AIP here: +https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
+The comments in this class make frequent reference to the LONG and SHORT formats, +as well as "special" addresses. To learn what these refer to see AIP-40.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Creates an instance of AccountAddress from a Uint8Array.
+This function ensures that the input data is exactly 32 bytes long, which is required for a valid account address.
+A Uint8Array representing an account address.
+ReadonlydataThis is the internal representation of an account address.
+Static ReadonlyLENGTHThe number of bytes that make up an account address.
+Static ReadonlyLONG_The length of an address string in LONG form without a leading 0x.
+Determine if two AccountAddresses are equal based on their underlying byte data.
+The AccountAddress to compare to.
+true if the AccountAddresses are equal, false if not.
+Determines if the address is classified as special, which is defined as 0x0 to 0xf inclusive. +In other words, the last byte of the address must be < 0b10000 (16) +and every other byte must be zero.
+For more information on how special addresses are defined, see AIP-40: +https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
+true if the address is special, false otherwise.
+Serialize the AccountAddress to a Serializer instance's data buffer.
+The serializer to serialize the AccountAddress to.
+void
+Serializes the current instance into a byte sequence suitable for entry functions. +This allows for the proper encoding of data when interacting with entry functions in the blockchain. +Uses the optimized serializeAsBytes method to reduce allocations.
+The serializer instance used to convert the data into bytes.
+Serializes the current instance for use in a script function by encoding it into a byte sequence. +This process involves serializing the variant index and the instance data, making it suitable for transmission.
+The serializer instance used to perform the serialization.
+Return the AccountAddress as a string as per AIP-40. +https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md. +This representation returns special addresses in SHORT form (0xf) +and other addresses in LONG form (0x + 64 characters).
+AccountAddress as a string conforming to AIP-40.
+Convert the account address to a string in LONG format, which is always 0x followed by 64 hex characters.
+NOTE: Prefer to use toString where possible, as it formats special addresses using the SHORT form (no leading 0s).
AccountAddress as a string in LONG form.
+Returns the account address as a string in LONG form without a leading 0x. +This function will include leading zeroes and will produce a string of 64 hex characters.
+NOTE: Prefer to use toString where possible, as it formats special addresses using the SHORT form (no leading 0s).
The account address in LONG form.
+Convert the account address to a string in SHORT format, which is 0x followed by the shortest +possible representation (no leading zeros).
+AccountAddress as a string in SHORT form.
+Returns a lossless short string representation of the address by trimming leading zeros. +If the address consists of all zeros, returns "0".
+A string representation of the address without leading zeros
+Return the AccountAddress as a string conforming to AIP-40 but without the leading 0x.
+NOTE: Prefer to use toString where possible.
AccountAddress as a string without the leading 0x.
+Get the inner data as a Uint8Array. +The inner data is already a Uint8Array, so no conversion takes place.
+Hex data as Uint8Array
+StaticdeserializeDeserialize an AccountAddress from the byte buffer in a Deserializer instance. +This function allows you to convert a byte representation of an AccountAddress into an instance of AccountAddress.
+The deserializer to deserialize the AccountAddress from.
+An instance of AccountAddress.
+StaticfromConvenience method for creating an AccountAddress from various input types. +This function accepts a string, Uint8Array, or an existing AccountAddress instance and returns the corresponding +AccountAddress.
+The input to convert into an AccountAddress. This can be a string representation of an address, a Uint8Array, +or an existing AccountAddress.
+StaticfromCreate an AccountAddress from various input types, including strings, Uint8Array, and AccountAddress instances.
+The input to convert into an AccountAddress, which can be a string, a Uint8Array, or an AccountAddress.
+StaticfromNOTE: This function has relaxed parsing behavior. For strict behavior, please use
+the fromStringStrict function. Where possible use fromStringStrict rather than this
+function, fromString.
Creates an instance of AccountAddress from a hex string.
+This function allows all formats defined by AIP-40. In short this means the +following formats are accepted:
+Where:
+maxMissingChars before it is padded.Learn more about the different address formats by reading AIP-40: +https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
+A hex string representing an account address.
+An instance of AccountAddress.
+StaticfromNOTE: This function has strict parsing behavior. For relaxed behavior, please use
+the fromString function.
Creates an instance of AccountAddress from a hex string.
+This function allows only the strictest formats defined by AIP-40. In short this +means only the following formats are accepted:
+Where:
+This means the following are not accepted:
+A hex string representing an account address.
+An instance of AccountAddress.
+This function has strict parsing behavior. For relaxed behavior, please use the fromString function.
AIP-40 documentation for more details on address formats: +https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
+StaticisCheck if the provided input is a valid AccountAddress.
+The arguments for validation.
+A hex string representing an account address.
+Optionalstrict?: booleanIf true, use strict parsing behavior; if false, use relaxed parsing behavior.
+An object indicating whether the address is valid. If valid, valid = true; if not, valid = false with additional details. +If the address is invalid, invalidReason will explain why it is invalid, and invalidReasonMessage will provide the error message.
+AbstractRepresents an account authenticator that can handle multiple authentication variants. +This class serves as a base for different types of account authenticators, allowing for serialization +and deserialization of various authenticator types.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Determines if the current instance is an Ed25519 account authenticator.
+True if the instance is of type AccountAuthenticatorEd25519, otherwise false.
+Determines if the current instance is of type AccountAuthenticatorMultiEd25519.
+True if the instance is a multi-signature Ed25519 account authenticator, otherwise false.
+Determine if the current instance is of type AccountAuthenticatorMultiKey.
+Returns true if the instance is an AccountAuthenticatorMultiKey, otherwise false.
+Determines if the current instance is of the type AccountAuthenticatorSingleKey.
+True if the instance is an AccountAuthenticatorSingleKey, otherwise false.
+StaticdeserializeDeserializes an AccountAuthenticator from the provided deserializer. +This function helps in reconstructing the AccountAuthenticator object based on the variant index.
+The deserializer instance used to read the serialized data.
+AbstractserializeReturns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Represents an account authenticator that supports abstract authentication.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Determines if the current instance is an Ed25519 account authenticator.
+True if the instance is of type AccountAuthenticatorEd25519, otherwise false.
+Determines if the current instance is of type AccountAuthenticatorMultiEd25519.
+True if the instance is a multi-signature Ed25519 account authenticator, otherwise false.
+Determine if the current instance is of type AccountAuthenticatorMultiKey.
+Returns true if the instance is an AccountAuthenticatorMultiKey, otherwise false.
+Determines if the current instance is of the type AccountAuthenticatorSingleKey.
+True if the instance is an AccountAuthenticatorSingleKey, otherwise false.
+StaticdeserializeDeserializes an AccountAuthenticator from the provided deserializer. +This function helps in reconstructing the AccountAuthenticator object based on the variant index.
+The deserializer instance used to read the serialized data.
+OptionalaccountIdentity: Uint8Array<ArrayBufferLike>Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticloadRepresents an Ed25519 transaction authenticator for multi-signer transactions. +This class encapsulates the account's Ed25519 public key and signature.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Creates an instance of the class with the specified public keys and signatures.
+The public key used for verification.
+The signatures corresponding to the public keys.
+Determines if the current instance is an Ed25519 account authenticator.
+True if the instance is of type AccountAuthenticatorEd25519, otherwise false.
+Determines if the current instance is of type AccountAuthenticatorMultiEd25519.
+True if the instance is a multi-signature Ed25519 account authenticator, otherwise false.
+Determine if the current instance is of type AccountAuthenticatorMultiKey.
+Returns true if the instance is an AccountAuthenticatorMultiKey, otherwise false.
+Determines if the current instance is of the type AccountAuthenticatorSingleKey.
+True if the instance is an AccountAuthenticatorSingleKey, otherwise false.
+Serializes the account authenticator data into the provided serializer. +This function captures the multi-key variant, public keys, and signatures for serialization.
+The serializer instance used to perform the serialization.
+StaticdeserializeDeserializes an AccountAuthenticator from the provided deserializer. +This function helps in reconstructing the AccountAuthenticator object based on the variant index.
+The deserializer instance used to read the serialized data.
+StaticloadLoads an instance of AccountAuthenticatorMultiKey from the provided deserializer. +This function helps in reconstructing the authenticator object using the deserialized public keys and signatures.
+The deserializer used to extract the necessary data for loading the authenticator.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Represents a transaction authenticator for Multi Ed25519, designed for multi-signer transactions.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Determines if the current instance is an Ed25519 account authenticator.
+True if the instance is of type AccountAuthenticatorEd25519, otherwise false.
+Determines if the current instance is of type AccountAuthenticatorMultiEd25519.
+True if the instance is a multi-signature Ed25519 account authenticator, otherwise false.
+Determine if the current instance is of type AccountAuthenticatorMultiKey.
+Returns true if the instance is an AccountAuthenticatorMultiKey, otherwise false.
+Determines if the current instance is of the type AccountAuthenticatorSingleKey.
+True if the instance is an AccountAuthenticatorSingleKey, otherwise false.
+StaticdeserializeDeserializes an AccountAuthenticator from the provided deserializer. +This function helps in reconstructing the AccountAuthenticator object based on the variant index.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticloadRepresents an account authenticator that supports multiple keys and signatures for multi-signature scenarios.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Determines if the current instance is an Ed25519 account authenticator.
+True if the instance is of type AccountAuthenticatorEd25519, otherwise false.
+Determines if the current instance is of type AccountAuthenticatorMultiEd25519.
+True if the instance is a multi-signature Ed25519 account authenticator, otherwise false.
+Determine if the current instance is of type AccountAuthenticatorMultiKey.
+Returns true if the instance is an AccountAuthenticatorMultiKey, otherwise false.
+Determines if the current instance is of the type AccountAuthenticatorSingleKey.
+True if the instance is an AccountAuthenticatorSingleKey, otherwise false.
+StaticdeserializeDeserializes an AccountAuthenticator from the provided deserializer. +This function helps in reconstructing the AccountAuthenticator object based on the variant index.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticloadAccountAuthenticatorNoAccountAuthenticator for no account authenticator +It represents the absence of a public key for transaction simulation. +It allows skipping the public/auth key check during the simulation.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Determines if the current instance is an Ed25519 account authenticator.
+True if the instance is of type AccountAuthenticatorEd25519, otherwise false.
+Determines if the current instance is of type AccountAuthenticatorMultiEd25519.
+True if the instance is a multi-signature Ed25519 account authenticator, otherwise false.
+Determine if the current instance is of type AccountAuthenticatorMultiKey.
+Returns true if the instance is an AccountAuthenticatorMultiKey, otherwise false.
+Determines if the current instance is of the type AccountAuthenticatorSingleKey.
+True if the instance is an AccountAuthenticatorSingleKey, otherwise false.
+StaticdeserializeDeserializes an AccountAuthenticator from the provided deserializer. +This function helps in reconstructing the AccountAuthenticator object based on the variant index.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticloadRepresents an account authenticator that utilizes a single key for signing. +This class is designed to handle authentication using a public key and its corresponding signature.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Determines if the current instance is an Ed25519 account authenticator.
+True if the instance is of type AccountAuthenticatorEd25519, otherwise false.
+Determines if the current instance is of type AccountAuthenticatorMultiEd25519.
+True if the instance is a multi-signature Ed25519 account authenticator, otherwise false.
+Determine if the current instance is of type AccountAuthenticatorMultiKey.
+Returns true if the instance is an AccountAuthenticatorMultiKey, otherwise false.
+Determines if the current instance is of the type AccountAuthenticatorSingleKey.
+True if the instance is an AccountAuthenticatorSingleKey, otherwise false.
+StaticdeserializeDeserializes an AccountAuthenticator from the provided deserializer. +This function helps in reconstructing the AccountAuthenticator object based on the variant index.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticloadAbstractAn abstract representation of an account public key.
+Provides a common interface for deriving an authentication key.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+AbstractauthGet the authentication key associated with this public key
+Get the public key as a hex string with a 0x prefix.
+The public key in hex format.
+Get the raw public key bytes
+AbstractverifyVerifies that the private key associated with this public key signed the message with the given signature.
+Represents the arguments required to verify a digital signature.
+Verifies signature with the public key and makes any network calls required to get state required to verify the signature.
+AbstractserializeReturns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
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 thread safety.
+Creates an instance of the class with the specified configuration and account details. +This constructor initializes the necessary parameters for managing Aptos transactions.
+The configuration settings for Aptos.
+The account associated with the Aptos transactions.
+The maximum time to wait for a transaction to be processed, in milliseconds.
+The maximum number of transactions that can be in flight at the same time.
+The time to sleep between transaction checks, in milliseconds.
+We want to guarantee that we preserve ordering of workers to requests.
+lock is used to try to prevent multiple coroutines from accessing a shared resource at the same time,
+which can result in race conditions and data inconsistency.
+This code actually doesn't do it though, since we aren't giving out a slot, it is still somewhat a race condition.
The ideal solution is likely that each thread grabs the next number from an incremental integer.
+When they complete, they increment that number and that entity is able to enter the lock.
+That would guarantee ordering.
Returns the next available sequence number for this account. +This function ensures that the sequence number is updated and synchronized, handling potential delays in transaction commits.
+The next available sequence number.
+Synchronizes the local sequence number with the sequence number on-chain for the specified account. +This function polls the network until all submitted transactions have either been committed or until the maximum wait time has elapsed.
+Updates this account's sequence number with the one on-chain.
+The on-chain sequence number for this account.
+Represents any public key supported by Aptos.
+Since AIP-55 Aptos supports
+Legacy and Unified authentication keys.
Any unified authentication key is represented in the SDK as AnyPublicKey.
Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Creates an instance of the signature class based on the provided signature type. +This allows for the handling of different signature variants such as Ed25519, Secp256k1, and Keyless.
+The publicKey object which determines the variant to be used.
+ReadonlypublicReference to the inner public key
+ReadonlyvariantIndex of the underlying enum variant
+Generates an authentication key from the current instance's byte representation. +This function is essential for creating a unique identifier for authentication purposes.
+The generated authentication key.
+Serializes the current object using the provided serializer. +This function helps in converting the object into a format suitable for transmission or storage.
+The serializer instance used to perform the serialization.
+Get the public key as a hex string with a 0x prefix.
+The public key in hex format.
+Get the signature in bytes (Uint8Array).
+This function is a warning that it will soon return the underlying signature bytes directly. +Use AnySignature.bcsToBytes() instead.
+Uint8Array representation of the signature.
+Verifies the provided signature against the given message. +This function helps ensure the integrity and authenticity of the message by confirming that the signature is valid.
+The arguments for signature verification.
+The message that was signed.
+The signature to verify, which must be an instance of AnySignature.
+A boolean indicating whether the signature is valid for the given message.
+Verifies the provided signature against the given message. +This function helps ensure the integrity and authenticity of the message by confirming that the signature is valid.
+The arguments for signature verification.
+The configuration object for connecting to the Aptos network
+The message that was signed.
+Optionaloptions?: { throwErrorWithReason?: boolean }The signature to verify, which must be an instance of AnySignature.
+A boolean indicating whether the signature is valid for the given message.
+StaticdeserializeDeserializes an AnySignature from the provided deserializer. +This function helps in reconstructing the AnySignature object from its serialized form, allowing for further processing or validation.
+The deserializer instance used to read the serialized data.
+StaticisDetermines if the provided publicKey is an instance of a valid PublicKey object.
+The publicKey to be checked for validity.
+True if the signature is a valid instance; otherwise, false.
+StaticisDetermines if the provided public key is an instance of AnyPublicKey.
+The public key to check.
+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 SingleKeySigner due to the shared authentication mechanism.
Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Get the signature as a hex string with a 0x prefix e.g. 0x123456...
+The hex string representation of the signature.
+Get the raw signature bytes
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticisThe main entry point for interacting with the Aptos APIs, +providing access to various functionalities organized into +distinct namespaces.
+To utilize the SDK, instantiate a new Aptos object to gain +access to the complete range of SDK features.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a configuration for connecting to the Aptos testnet
const config = new AptosConfig({ network: Network.TESTNET });
// Initialize the Aptos client with the configuration
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+Initializes a new instance of the Aptos client with the provided configuration settings. +This allows you to interact with various Aptos functionalities such as accounts, transactions, and events.
+Optionalconfig: AptosConfigimport { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a new Aptos client with default settings
const config = new AptosConfig({ network: Network.TESTNET }); // Specify your own settings if needed
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+Clears the target address of a domain or subdomain name, removing the address association. +After clearing, the name will no longer resolve to a specific address.
+The arguments for clearing the target address.
+A string representing the domain or subdomain name (e.g., "test.aptos").
+Optionaloptions?: InputGenerateTransactionOptionsOptional settings for generating the transaction.
+The account initiating the transaction.
+An object containing the transaction and the InputEntryFunctionData
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Clearing the target address for a domain name
const sender = Account.generate(); // replace with a real account
const { transaction, data } = await aptos.clearTargetAddress({
sender,
name: "test.aptos",
});
const targetAddress = await aptos.getTargetAddress({ name: "test.aptos" });
console.log(targetAddress); // Should log undefined after clearing
}
runExample().catch(console.error);
+
+
+Fetches all top-level domain names for a specified account.
+The arguments for retrieving account domains.
+Arguments for retrieving the domains associated with a specific account.
+Optionaloptions?: PaginationArgs & OrderByArg<AnsName> & WhereArg<CurrentAptosNamesBoolExp>A promise of an array of ANSName.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching all top-level domain names for a specific account
const domains = await aptos.getAccountDomains({
accountAddress: "0x1", // replace with a real account address
options: {
limit: 10, // specify the number of names to fetch
offset: 0, // specify the offset for pagination
orderBy: "created_at", // specify the order by which to sort the names
where: {
// additional filters can be specified here
},
},
});
console.log(domains);
}
runExample().catch(console.error);
+
+
+Fetches all names for an account, including both top-level domains and subdomains.
+The arguments for fetching account names.
+Arguments for retrieving account names based on the specified account address.
+Optionaloptions?: PaginationArgs & OrderByArg<AnsName> & WhereArg<CurrentAptosNamesBoolExp>A promise of an array of ANSName.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetch account names for a specific address
const accountNames = await aptos.getAccountNames({
accountAddress: "0x1", // replace with a real account address
options: {
limit: 10, // specify how many names to fetch
orderBy: "name", // specify the order by which to sort the names
},
});
console.log(accountNames);
}
runExample().catch(console.error);
+
+
+Fetches all subdomain names for a specified account.
+The arguments for retrieving subdomains.
+Arguments for retrieving subdomains associated with a specific account.
+Optionaloptions?: PaginationArgs & OrderByArg<AnsName> & WhereArg<CurrentAptosNamesBoolExp>A promise of an array of ANSName.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching subdomain names for a specific account
const subdomains = await aptos.getAccountSubdomains({
accountAddress: "0x1", // replace with a real account address
options: {
limit: 10, // specify the number of subdomains to fetch
offset: 0, // specify the offset for pagination
orderBy: "name", // specify the order by which to sort the names
},
});
console.log(subdomains);
}
runExample().catch(console.error);
+
+
+Fetches all subdomain names for a given domain, excluding the domain itself.
+The arguments for fetching subdomains.
+Arguments for retrieving subdomains associated with a specific domain.
+Optionaloptions?: PaginationArgs & OrderByArg<AnsName> & WhereArg<CurrentAptosNamesBoolExp>A promise that resolves to an array of ANSName.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching subdomains for a specific domain
const subdomains = await aptos.getDomainSubdomains({
domain: "test", // replace with your domain
options: {
limit: 10, // specify the number of subdomains to fetch
offset: 0, // specify the starting point for fetching
orderBy: "name", // specify the order by which to sort the results
},
});
console.log(subdomains);
}
runExample().catch(console.error);
+
+
+Retrieve the expiration time of a domain name or subdomain name from the contract.
+The arguments for retrieving the expiration.
+A string of the name to retrieve.
+number as a unix timestamp in milliseconds.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the expiration time for the domain "test.aptos"
const exp = await aptos.getExpiration({ name: "test.aptos" });
// Log the expiration date
console.log(new Date(exp)); // Outputs the expiration date
}
runExample().catch(console.error);
+
+
+Fetches a single name from the indexer based on the provided name argument.
+The arguments for retrieving the name.
+A string of the name to retrieve, e.g. "test.aptos.apt" or "test.apt" or "test". +Can be inclusive or exclusive of the .apt suffix and can be a subdomain.
+A promise of an ANSName or undefined if the name is not active.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching a name from the indexer
const name = await aptos.getName({ name: "test.aptos" }); // replace with a real name
console.log(name);
}
runExample().catch(console.error);
+
+
+Retrieve the owner address of a specified domain name or subdomain name from the contract.
+The arguments for retrieving the owner address.
+A string representing the name of the domain or subdomain to retrieve the owner address for.
+AccountAddress if the name is owned, undefined otherwise.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve the owner address of "test.aptos"
const owner = await aptos.getOwnerAddress({ name: "test.aptos" });
console.log(owner); // Logs the owner address or undefined if not owned
}
runExample().catch(console.error);
+
+
+Retrieve the primary name for an account. An account can have multiple names, but only one primary name, which may not exist.
+The arguments for retrieving the primary name.
+An AccountAddressInput (address) of the account.
+A string if the account has a primary name, undefined otherwise.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve the primary name for the specified account address
const name = await aptos.getPrimaryName({ address: "0x1" }); // replace with a real account address
console.log(name);
}
runExample().catch(console.error);
+
+
+Retrieve the target address of a domain or subdomain name, which indicates the address the name points to for use on-chain. +Note that the target address can point to addresses that do not own the name.
+The arguments for retrieving the target address.
+A string representing the name, which can be a primary name, a subdomain, or a combination (e.g., +"primary", "primary.apt", "secondary.primary", "secondary.primary.apt").
+AccountAddress if the name has a target, undefined otherwise.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve the target address for the specified domain name
const targetAddr = await aptos.getTargetAddress({ name: "test.aptos" });
console.log(targetAddr); // Logs the target address, e.g., 0x123...
}
runExample().catch(console.error);
+
+
+Registers a new name.
+This function allows you to register a domain or subdomain name with specific expiration policies and options.
+An object containing the transaction and the InputEntryFunctionData
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Registering a subdomain name assuming def.apt is already registered and belongs to the sender alice.
const { transaction, data } = await aptos.registerName({
sender: "0x1", // replace with a real sender account
name: "test.aptos.apt",
expiration: {
policy: "subdomain:independent",
expirationDate: Date.now() + 30 * 24 * 60 * 60 * 1000, // expires in 30 days
},
});
console.log("Transaction:", transaction);
}
runExample().catch(console.error);
+
+
+Renews a domain name for one year. +If a domain name was minted with V1 of the contract, it will automatically be upgraded to V2 via this transaction.
+The arguments for renewing the domain.
+A string representing the domain to renew. Subdomains cannot be renewed.
+Optionaloptions?: InputGenerateTransactionOptionsOptional transaction options.
+The sender account, which must be the domain owner.
+Optionalyears?: 1The number of years to renew the name. Currently, only one year is permitted.
+An object containing the transaction and the InputEntryFunctionData
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Renew the domain "test" for one year
const { transaction, data } = await aptos.renewDomain({
sender: Account.generate(), // replace with a real account
name: "test"
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Sets the primary name for the sender account, allowing them to designate a single primary name among potentially multiple +names. An account may not have a primary name.
+The arguments for setting the primary name.
+Optionalname?: stringA string representing the name to set as primary (e.g., "test.aptos").
+Optionaloptions?: InputGenerateTransactionOptionsOptional transaction options.
+The sender account.
+An object containing the transaction and the InputEntryFunctionData
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Set the primary name for the sender account
const sender = Account.generate(); // replace with a real account
const { transaction, data } = await aptos.setPrimaryName({ sender, name: "test.aptos" });
const primaryName = await aptos.getPrimaryName({ address: sender.accountAddress });
console.log("Primary Name:", primaryName); // Should log: "Primary Name: test.aptos"
}
runExample().catch(console.error);
+
+
+Sets the target address of a domain or subdomain name, pointing it to a specified address for use on-chain. +The target address can be different from the owner of the name.
+The arguments for setting the target address.
+The AccountAddressInput of the address to set the domain or subdomain to.
+A string representing the domain or subdomain name (e.g., "test.aptos").
+Optionaloptions?: InputGenerateTransactionOptionsOptional settings for generating the transaction.
+The account initiating the transaction.
+An object containing the transaction and the InputEntryFunctionData
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Setting the target address for a domain name
const sender = Account.generate(); // replace with a real account
const address = "0x1"; // replace with a real account address
const { transaction, data } = await aptos.setTargetAddress({
sender,
name: "test.aptos",
address,
});
const targetAddress = await aptos.getTargetAddress({ name: "test.aptos" });
console.log(targetAddress); // Should log the address set for "test.aptos"
}
runExample().catch(console.error);
+
+
+Derives an account by providing a private key. This function resolves the provided private key type and derives the public +key from it.
+If the privateKey is a Secp256k1 type, it derives the account using the derived public key and auth key using the SingleKey +scheme locally. +If the privateKey is an ED25519 type, it looks up the authentication key on chain to determine whether it is a Legacy ED25519 +key or a Unified ED25519 key, and then derives the account based on that.
+The arguments for deriving the account.
+OptionalminimumLedgerVersion?: AnyNumberOptionaloptions?: { throwIfNoAccountFound?: boolean }An account private key.
+The derived Account type.
+import { Aptos, AptosConfig, Network, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Deriving an account from a private key
const account = await aptos.deriveAccountFromPrivateKey({
privateKey: new Ed25519PrivateKey("0x123") // replace with a real private key
});
console.log(account);
}
runExample().catch(console.error);
+
+
+Derives all accounts owned by a signer. This function takes a signer (either an Account or PrivateKey) +and returns all accounts that can be derived from it, ordered by the most recently used account first.
+Note, this function will not return accounts that require more than one signer to be used.
+The arguments for deriving owned accounts
+OptionalminimumLedgerVersion?: AnyNumberThe minimum ledger version to wait for before querying
+Optionaloptions?: { includeUnverified?: boolean; noMultiKey?: boolean }OptionalincludeUnverified?: booleanWhether to include unverified accounts in the results. Unverified accounts +are accounts that can be authenticated with the signer, but there is no history of the signer using the account. +Default is false.
+OptionalnoMultiKey?: booleanIf true, do not include multi-key accounts in the results. Default is false.
+The signer to derive accounts from (Account or PrivateKey)
+Promise resolving to an array of derived Account objects
+import { Aptos, AptosConfig, Network, Ed25519Account } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function getOwnedAccounts() {
const signer = Ed25519Account.generate();
const accounts = await aptos.deriveOwnedAccountsFromSigner({
signer
});
const account = accounts[0];
console.log(account);
}
+
+
+Retrieves the current amount of APT for a specified account. If the account does not exist, it will return 0.
+The arguments for the account query.
+The account address for which to retrieve the APT amount.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+The current amount of APT for the specified account.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the APT amount for a specific account
const accountAPTAmount = await aptos.getAccountAPTAmount({ accountAddress: "0x1" }); // replace with a real account address
console.log("Account APT Amount:", accountAPTAmount);
}
runExample().catch(console.error);
+
+
+Queries the current amount of a specified coin held by an account.
+The parameters for querying the account's coin amount.
+The account address to query for the coin amount.
+OptionalcoinType?: `${string}::${string}::${string}`The coin type to query. Note: If not provided, it may be automatically populated if faMetadataAddress
+is specified.
OptionalfaMetadataAddress?: AccountAddressInputThe fungible asset metadata address to query. Note: If not provided, it may be automatically
+populated if coinType is specified.
The current amount of the specified coin held by the account.
+Use getBalance({ accountAddress, asset }) instead.
+This method is slated for removal in a future release.
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Prefer the new API
const amount = await aptos.getBalance({ accountAddress: "0x1", asset: "0x1::aptos_coin::AptosCoin" });
console.log(`Balance: ${amount}`);
}
runExample().catch(console.error);
+
+
+Retrieves the current count of an account's coins aggregated across all types.
+The parameters for the account coins count query.
+The account address we want to get the total count for.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+The current count of the aggregated coins for the specified account.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Getting the account coins count for a specific account
const accountCoinsCount = await aptos.getAccountCoinsCount({ accountAddress: "0x1" }); // replace with a real account address
console.log("Account Coins Count:", accountCoinsCount);
}
runExample().catch(console.error);
+
+
+Retrieves the coins data for a specified account.
+The account address for which to retrieve the coin's data.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: PaginationArgs & OrderByArg<An array containing the coins data for the specified account.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching coins data for a specific account
const accountCoinsData = await aptos.getAccountCoinsData({
accountAddress: "0x1", // replace with a real account address
options: {
limit: 10, // specify the number of results to return
orderBy: { asset_type: "asc" }, // specify the order of results
},
});
console.log(accountCoinsData);
}
runExample().catch(console.error);
+
+
+Queries for all collections that an account currently has tokens for, including NFTs, fungible tokens, and soulbound tokens. +If you want to filter by a specific token standard, you can pass an optional tokenStandard parameter.
+The account address we want to get the collections for.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: TokenStandardArg & PaginationArgs & OrderByArg<Collections array with the collections data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get account collections with owned tokens for a specific account
const accountCollectionsWithOwnedTokens = await aptos.getAccountCollectionsWithOwnedTokens({
accountAddress: "0x1", // replace with a real account address
options: {
tokenStandard: "NFT", // specify the token standard if needed
limit: 10, // specify the number of results to return
},
});
console.log(accountCollectionsWithOwnedTokens);
}
runExample().catch(console.error);
+
+
+Queries the current state for an Aptos account given its account address.
+The arguments for retrieving account information.
+The Aptos account address to query.
+The account data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve account information for a specific address
const accountInfo = await aptos.getAccountInfo({ accountAddress: "0x1" }); // replace with a real account address
console.log(accountInfo);
}
runExample().catch(console.error);
+
+
+Queries for a specific account module given an account address and module name.
+The Aptos account address.
+The name of the module.
+Optionaloptions?: LedgerVersionArgThe account module associated with the specified account address and module name.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the account module for a specific account address and module name
const module = await aptos.getAccountModule({
accountAddress: "0x1", // replace with a real account address
moduleName: "MyModule" // specify the module name
});
console.log(module);
}
runExample().catch(console.error);
+
+
+Queries for all modules in an account given an account address. +This function may call the API multiple times to auto paginate through results.
+The Aptos account address to query modules for.
+Optionaloptions?: { limit?: number } & LedgerVersionArgimport { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching account modules for a specific account
const accountModules = await aptos.getAccountModules({
accountAddress: "0x1", // replace with a real account address
options: {
limit: 10, // limiting to 10 modules
},
});
console.log(accountModules);
}
runExample().catch(console.error);
+
+
+Queries for a page of modules in an account given an account address.
+The Aptos account address to query modules for.
+Optionaloptions?: CursorPaginationArgs & LedgerVersionArgimport { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching account modules for a specific account
const {modules, cursor} = await aptos.getAccountModulesPage({
accountAddress: "0x1", // replace with a real account address
options: {
cursor: undefined, // starting from the first module
limit: 10, // limiting to 10 modules
},
});
console.log(modules);
console.log(`More to fetch: ${cursor !== undefined}`);
}
runExample().catch(console.error);
+
+
+Queries an account's owned objects.
+The account address we want to get the objects for.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: PaginationArgs & OrderByArg<Objects array with the object data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the objects owned by the specified account
const accountOwnedObjects = await aptos.getAccountOwnedObjects({
accountAddress: "0x1", // replace with a real account address
minimumLedgerVersion: 1, // optional, specify if needed
options: {
offset: 0, // optional, specify if needed
limit: 10, // optional, specify if needed
orderBy: "created_at", // optional, specify if needed
},
});
console.log(accountOwnedObjects);
}
runExample().catch(console.error);
+
+
+Queries the tokens currently owned by a specified account, including NFTs and fungible tokens. +If desired, you can filter the results by a specific token standard.
+The account address for which to retrieve owned tokens.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: TokenStandardArg & PaginationArgs & OrderByArg<An array of tokens with their respective data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the tokens owned by a specific account
const accountOwnedTokens = await aptos.getAccountOwnedTokens({
accountAddress: "0x1", // replace with a real account address
options: {
limit: 10, // specify how many tokens to return
orderBy: "created_at", // specify the order of the results
},
});
console.log(accountOwnedTokens);
}
runExample().catch(console.error);
+
+
+Queries all current tokens of a specific collection that an account owns by the collection address. +This query returns all tokens (v1 and v2 standards) an account owns, including NFTs, fungible, soulbound, etc. +If you want to get only the token from a specific standard, you can pass an optional tokenStandard parameter.
+The account address we want to get the tokens for.
+The address of the collection being queried.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to, before querying.
+Optionaloptions?: TokenStandardArg & PaginationArgs & OrderByArg<Tokens array with the token data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get tokens owned by a specific account in a specific collection
const accountOwnedTokens = await aptos.getAccountOwnedTokensFromCollectionAddress({
accountAddress: "0x1", // replace with a real account address
collectionAddress: "0x2", // replace with a real collection address
});
console.log(accountOwnedTokens);
}
runExample().catch(console.error);
+
+
+Queries a specific account resource given an account address and resource type.
+The typed output of the resource.
+The Aptos account address to query.
+Optionaloptions?: LedgerVersionArgThe string representation of an on-chain Move struct type, e.g., "0x1::aptos_coin::AptosCoin".
+The account resource of the specified type.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the account resource for a specific account address and resource type
const resource = await aptos.getAccountResource({
accountAddress: "0x1", // replace with a real account address
resourceType: "0x1::aptos_coin::AptosCoin"
});
console.log(resource);
}
runExample().catch(console.error);
+
+
+Queries all account resources given an account address. +This function may call the API multiple times to auto paginate through results.
+The Aptos account address to query resources for.
+Optionaloptions?: PaginationArgs & LedgerVersionArgAccount resources.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching account resources for a specific account address
const resources = await aptos.getAccountResources({ accountAddress: "0x1" }); // replace with a real account address
console.log(resources);
}
runExample().catch(console.error);
+
+
+Queries a page of account resources given an account address.
+The Aptos account address to query resources for.
+Optionaloptions?: CursorPaginationArgs & LedgerVersionArgAccount resources.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching account resources for a specific account address
const resources = await aptos.getAccountResourcesPage({
accountAddress: "0x1", // replace with a real account address
options: {
cursor: undefined, // starting from the first resource
limit: 10, // limiting to 10 resources
},
});
console.log(resources);
console.log(`More to fetch: ${resources.cursor !== undefined}`);
}
runExample().catch(console.error);
+
+
+Gets all account info (address, account public key, last transaction version) that have are associated with a public key and related public keys
+For a given public key, it will query all multikeys that the public key is part of. Then for the provided public key and +any multikeys found in the previous step, it will query for any accounts that have an auth key that matches any of the +public keys.
+Note: If an Ed25519PublicKey or an AnyPublicKey that wraps Ed25519PublicKey is passed in, it will query for both legacy and single singer cases.
+The arguments for getting accounts for a public key
+OptionalminimumLedgerVersion?: AnyNumberThe minimum ledger version to wait for before querying
+Optionaloptions?: { includeUnverified?: boolean; noMultiKey?: boolean }OptionalincludeUnverified?: booleanWhether to include unverified accounts in the results. Unverified accounts +are accounts that can be authenticated with the signer, but there is no history of the signer using the account. Default +is false.
+OptionalnoMultiKey?: booleanWhether to exclude multi-key accounts in the results. Default is false.
+The public key to look up accounts for
+Promise resolving to an array of account addresses and their associated public keys
+import { Aptos, AptosConfig, Network, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function getAccounts() {
const privateKey = Ed25519PrivateKey.generate();
const publicKey = privateKey.publicKey();
const accounts = await aptos.getAccountsForPublicKey({
publicKey
});
console.log(accounts);
}
+
+
+Queries the current count of tokens owned by a specified account.
+The parameters for the query.
+The account address to query the token count for.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+The current count of tokens owned by the account.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the count of tokens owned by the account
const tokensCount = await aptos.getAccountTokensCount({ accountAddress: "0x1" }); // replace with a real account address
console.log(`Tokens Count: ${tokensCount}`);
}
runExample().catch(console.error);
+
+
+Queries account transactions given an account address. +This function may call the API multiple times to auto paginate and retrieve all account transactions.
+The Aptos account address to query transactions for.
+Optionaloptions?: PaginationArgsOptional pagination arguments.
+The account transactions.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetch transactions for a specific account
const transactions = await aptos.getAccountTransactions({
accountAddress: "0x1", // replace with a real account address
options: {
offset: 0, // starting from the first transaction
limit: 10, // limiting to 10 transactions
},
});
console.log(transactions);
}
runExample().catch(console.error);
+
+
+Queries the current count of transactions submitted by an account.
+The parameters for the query.
+The account address we want to get the total count for.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Current count of transactions made by an account.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the count of transactions for a specific account
const accountTransactionsCount = await aptos.getAccountTransactionsCount({
accountAddress: "0x1", // replace with a real account address
minimumLedgerVersion: 1, // specify your own minimum ledger version if needed
});
console.log(accountTransactionsCount);
}
runExample().catch(console.error);
+
+
+Retrieves the balance for an account and asset.
+The parameters for the balance query.
+The account address to query.
+The asset to query: Move struct ID (e.g., 0x1::aptos_coin::AptosCoin) or FA metadata address.
The balance as a number.
+Looks up the account address for a given authentication key, handling both rotated and non-rotated keys.
+The authentication key for which to look up the account address.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: LedgerVersionArgPromise
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Look up the original account address for a given authentication key
const accountAddress = await aptos.lookupOriginalAccountAddress({
authenticationKey: "0x1", // replace with a real authentication key
});
console.log("Original Account Address:", accountAddress);
}
runExample().catch(console.error);
+
+
+Generate a transfer coin transaction that can be simulated, signed, and submitted. +This function helps you create a transaction to transfer a specified amount of coins +from one account to another within the Aptos network.
+The arguments for the transfer transaction.
+The amount of coins to transfer.
+OptionalcoinType?: `${string}::${string}::${string}`Optional. The coin struct type to transfer. Defaults to 0x1::aptos_coin::AptosCoin.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+The recipient account address.
+The sender account address.
+SimpleTransaction
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Generate a transfer coin transaction
const transaction = await aptos.transferCoinTransaction({
sender: "0x1", // replace with a real sender account address
recipient: "0x2", // replace with a real recipient account address
amount: 10,
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Add a digital asset property to the blockchain. +This function allows you to specify a new property for a digital asset, including its key, type, and value.
+The arguments for adding a digital asset property.
+The account that mints the digital asset.
+The digital asset address.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`(Optional) The type of the digital asset.
+Optionaloptions?: InputGenerateTransactionOptions(Optional) Options for generating the transaction.
+The property key for storing on-chain properties.
+The type of property value.
+The property value to be stored on-chain.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Add a digital asset property
const transaction = await aptos.addDigitalAssetPropertyTransaction({
creator: Account.generate(), // Replace with a real account
propertyKey: "newKey",
propertyType: "BOOLEAN",
propertyValue: true,
digitalAssetAddress: "0x123", // Replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Add a typed digital asset property to the blockchain. +This function allows you to define and store a specific property for a digital asset, enabling better categorization and +management of digital assets.
+The parameters for adding the typed property.
+The account that mints the digital asset.
+The digital asset address.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`The optional type of the digital asset.
+Optionaloptions?: InputGenerateTransactionOptionsOptional transaction generation options.
+The property key for storing on-chain properties.
+The type of property value.
+The property value to be stored on-chain.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Adding a typed digital asset property
const transaction = await aptos.addDigitalAssetTypedPropertyTransaction({
creator: Account.generate(), // replace with a real account
propertyKey: "typedKey",
propertyType: "STRING",
propertyValue: "hello",
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Burn a digital asset by its creator, allowing for the removal of a specified digital asset from the blockchain.
+The arguments for burning the digital asset.
+The creator account that is burning the digital asset.
+The address of the digital asset to be burned.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset being burned.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network, Account } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const creator = Account.generate(); // Replace with a real creator account
const transaction = await aptos.burnDigitalAssetTransaction({
creator: creator,
digitalAssetAddress: "0x123", // Replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Creates a new collection within the specified account.
+The account of the collection's creator.
+The description of the collection.
+The name of the collection.
+Optionaloptions?: InputGenerateTransactionOptionsOptional parameters for generating the transaction.
+The parameters below are optional:
+The URI to additional info about the collection.
+Options for creating a collection, allowing customization of various attributes such as supply limits, mutability of metadata, +and royalty settings.
+OptionalmaxSupply?: AnyNumberOptionalmutableDescription?: booleanOptionalmutableRoyalty?: booleanOptionalmutableTokenDescription?: booleanOptionalmutableTokenName?: booleanOptionalmutableTokenProperties?: booleanOptionalmutableTokenURI?: booleanOptionalmutableURI?: booleanOptionalroyaltyDenominator?: numberOptionalroyaltyNumerator?: numberOptionaltokensBurnableByCreator?: booleanOptionaltokensFreezableByCreator?: booleanA SimpleTransaction that when submitted will create the collection.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Creating a new collection transaction
const transaction = await aptos.createCollectionTransaction({
creator: Account.generate(), // Replace with a real account
description: "A unique collection of digital assets.",
name: "My Digital Collection",
uri: "https://mycollection.com",
});
console.log("Transaction created:", transaction);
}
runExample().catch(console.error);
+
+
+Freeze the ability to transfer a specified digital asset. +This function allows the creator to restrict the transfer capability of a digital asset.
+The arguments for freezing the digital asset transfer.
+The creator account initiating the freeze.
+The address of the digital asset to be frozen.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset being frozen.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Freeze the digital asset transfer
const transaction = await aptos.freezeDigitalAssetTransaferTransaction({
creator: Account.generate(), // Replace with a real account if needed
digitalAssetAddress: "0x123", // Replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Queries data of a specific collection by the collection creator address and the collection name.
+This function is deprecated; use getCollectionDataByCreatorAddressAndCollectionName instead.
If a creator account has two collections with the same name in v1 and v2, you can pass an optional tokenStandard parameter
+to query a specific standard.
The arguments for querying the collection data.
+The name of the collection.
+The address of the collection's creator.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: TokenStandardArgOptional parameters for the query.
+GetCollectionDataResponse - The response type containing the collection data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Querying collection data by creator address and collection name
const collection = await aptos.getCollectionData({
creatorAddress: "0x1", // replace with a real creator address
collectionName: "myCollection", // specify your collection name
});
console.log(collection);
}
runExample().catch(console.error);
+
+
+Queries data of a specific collection by the collection ID.
+The ID of the collection, which is the same as the address of the collection object.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: TokenStandardArg & PaginationArgsOptional parameters for token standard and pagination.
+GetCollectionDataResponse - The response type containing the collection data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching collection data by collection ID
const collection = await aptos.getCollectionDataByCollectionId({
collectionId: "0x123", // replace with a real collection ID
});
console.log(collection);
}
runExample().catch(console.error);
+
+
+Retrieves data for a specific collection created by a given creator address. +This function allows you to query collection data while optionally specifying a minimum ledger version and pagination options.
+The address of the collection's creator.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: TokenStandardArg & PaginationArgsGetCollectionDataResponse - The response type containing collection data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve collection data by creator address
const collectionData = await aptos.getCollectionDataByCreatorAddress({
creatorAddress: "0x1", // replace with a real creator address
minimumLedgerVersion: 1, // specify the minimum ledger version if needed
options: {
tokenStandard: "v2", // specify the token standard if needed
pagination: { limit: 10, offset: 0 } // specify pagination options if needed
}
});
console.log(collectionData);
}
runExample().catch(console.error);
+
+
+Queries data of a specific collection by the collection creator address and the collection name.
+If a creator account has multiple collections with the same name across different versions,
+specify the tokenStandard parameter to query a specific standard.
The name of the collection.
+The address of the collection's creator.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: TokenStandardArg & PaginationArgsGetCollectionDataResponse - The response type containing collection data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching collection data by creator address and collection name
const collection = await aptos.getCollectionDataByCreatorAddressAndCollectionName({
creatorAddress: "0x1", // replace with a real creator address
collectionName: "myCollection",
minimumLedgerVersion: 1, // optional, specify if needed
options: { tokenStandard: "v2" } // optional, specify if needed
});
console.log(collection);
}
runExample().catch(console.error);
+
+
+Queries the ID of a specified collection. +This ID corresponds to the collection's object address in V2, while V1 does not utilize objects and lacks an address.
+The name of the collection.
+The address of the collection's creator.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: TokenStandardArgThe collection ID.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching the collection ID for a specific creator and collection name
const collectionId = await aptos.getCollectionId({
creatorAddress: "0x1", // replace with a real creator address
collectionName: "myCollection"
});
console.log("Collection ID:", collectionId);
}
runExample().catch(console.error);
+
+
+Retrieves the current ownership data of a specified digital asset using its address.
+The parameters for the request.
+The address of the digital asset.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+GetCurrentTokenOwnershipResponse containing relevant ownership data of the digital asset.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Getting the current ownership of a digital asset
const digitalAssetOwner = await aptos.getCurrentDigitalAssetOwnership({
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(digitalAssetOwner);
}
runExample().catch(console.error);
+
+
+Retrieves the activity data for a specified digital asset using its address.
+The parameters for the request.
+The address of the digital asset.
+OptionalminimumLedgerVersion?: AnyNumberOptional minimum ledger version to sync up to before querying.
+Optionaloptions?: PaginationArgs & OrderByArg<Optional pagination and ordering parameters.
+A promise that resolves to the activity data related to the digital asset.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the activity data for a digital asset
const digitalAssetActivity = await aptos.getDigitalAssetActivity({
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(digitalAssetActivity);
}
runExample().catch(console.error);
+
+
+Retrieves digital asset data using the address of a digital asset.
+The parameters for the request.
+The address of the digital asset.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+GetTokenDataResponse containing relevant data for the digital asset.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching digital asset data for a specific address
const digitalAsset = await aptos.getDigitalAssetData({
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(digitalAsset);
}
runExample().catch(console.error);
+
+
+Retrieves the digital assets owned by a specified address.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: PaginationArgs & OrderByArg<Optional pagination and ordering parameters for the response.
+The address of the owner.
+GetOwnedTokensResponse containing ownership data of the digital assets belonging to the ownerAddress.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching the digital assets owned by the specified address
const digitalAssets = await aptos.getOwnedDigitalAssets({
ownerAddress: "0x1", // replace with a real account address
});
console.log(digitalAssets);
}
runExample().catch(console.error);
+
+
+Create a transaction to mint a digital asset into the creator's account within an existing collection. +This function helps you generate a transaction that can be simulated or submitted to the blockchain for minting a digital asset.
+The name of the collection the digital asset belongs to.
+The creator of the collection.
+The description of the digital asset.
+The name of the digital asset.
+Optionaloptions?: InputGenerateTransactionOptionsOptional transaction generation options.
+OptionalpropertyKeys?: string[]Optional array of property keys for the digital asset.
+OptionalpropertyTypes?: (Optional array of property types for the digital asset.
+OptionalpropertyValues?: PropertyValue[]Optional array of property values for the digital asset.
+The URI to additional info about the digital asset.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Creating a transaction to mint a digital asset
const transaction = await aptos.mintDigitalAssetTransaction({
creator: Account.generate(), // replace with a real account
collection: "MyCollection",
description: "This is a digital asset.",
name: "MyDigitalAsset",
uri: "https://example.com/my-digital-asset",
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Mint a soul bound digital asset into a recipient's account. +This function allows you to create a unique digital asset that is bound to a specific account.
+The arguments for minting the soul bound transaction.
+The account that mints the digital asset.
+The collection name that the digital asset belongs to.
+The digital asset description.
+The digital asset name.
+Optionaloptions?: InputGenerateTransactionOptionsAdditional options for generating the transaction.
+OptionalpropertyKeys?: string[]The property keys for storing on-chain properties.
+OptionalpropertyTypes?: (The type of property values.
+OptionalpropertyValues?: PropertyValue[]The property values to be stored on-chain.
+The account address where the digital asset will be created.
+The digital asset URL.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Mint a soul bound digital asset
const transaction = await aptos.mintSoulBoundTransaction({
account: Account.generate(), // Replace with a real account
collection: "collectionName",
description: "collectionDescription",
name: "digitalAssetName",
uri: "digital-asset-uri.com",
recipient: "0x123" // Replace with a real recipient account address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Remove a digital asset property from the blockchain. +This function allows you to delete an existing property associated with a digital asset.
+The parameters required to remove the digital asset property.
+The account that mints the digital asset.
+The digital asset address.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+The property key for storing on-chain properties.
+The type of property value.
+The property value to be stored on-chain.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Remove a digital asset property
const transaction = await aptos.removeDigitalAssetPropertyTransaction({
creator: Account.generate(), // replace with a real account
propertyKey: "newKey",
propertyType: "BOOLEAN",
propertyValue: true,
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Set the digital asset description to provide additional context or information about the asset.
+The parameters for setting the digital asset description.
+The creator account responsible for the digital asset.
+The digital asset description to be set.
+The address of the digital asset.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Set the digital asset description
const transaction = await aptos.setDigitalAssetDescriptionTransaction({
creator: Account.generate(), // replace with a real account
description: "This is a digital asset description.",
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Set the digital asset name, allowing you to define a name for a specific digital asset on the blockchain.
+The parameters for setting the digital asset name.
+The creator account responsible for the transaction.
+The address of the digital asset.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset, represented as a Move struct ID.
+The desired name for the digital asset.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+A SimpleTransaction that can be simulated or submitted to the blockchain.
+import { Aptos, AptosConfig, Network, Account } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const creator = Account.generate(); // Generate a new account for the creator
const digitalAssetAddress = "0x123"; // replace with a real digital asset address
// Set the digital asset name
const transaction = await aptos.setDigitalAssetNameTransaction({
creator: creator,
name: "digitalAssetName",
digitalAssetAddress: digitalAssetAddress,
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Set the URI for a digital asset, allowing you to associate a unique identifier with the asset.
+The parameters for the transaction.
+The creator account initiating the transaction.
+The address of the digital asset.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+The digital asset URI to be set.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Set the URI for a digital asset
const transaction = await aptos.setDigitalAssetURITransaction({
creator: Account.generate(), // Replace with a real creator account
uri: "digital-asset-uri.com",
digitalAssetAddress: "0x123", // Replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Transfer ownership of a non-fungible digital asset. +This function allows you to transfer a digital asset only if it is not frozen, meaning the ownership transfer is not disabled.
+The arguments for transferring the digital asset.
+The address of the digital asset being transferred.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset, defaults to "0x4::token::Token".
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+The account address of the recipient.
+The sender account of the current digital asset owner.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Transfer a digital asset
const transaction = await aptos.transferDigitalAssetTransaction({
sender: Account.generate(), // replace with a real sender account
digitalAssetAddress: "0x123", // replace with a real digital asset address
recipient: "0x456", // replace with a real recipient account address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Unfreeze the ability to transfer a digital asset. +This function allows the specified creator account to unfreeze the transfer of a digital asset identified by its address.
+The parameters for unfreezing the digital asset transfer.
+The creator account that is unfreezing the digital asset transfer.
+The address of the digital asset to unfreeze.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset being unfrozen.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Unfreeze the ability to transfer a digital asset
const transaction = await aptos.unfreezeDigitalAssetTransaferTransaction({
creator: Account.generate(), // replace with a real creator account
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Update a digital asset property on-chain.
+The parameters for updating the digital asset property.
+The account that mints the digital asset.
+The address of the digital asset.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+The property key for storing on-chain properties.
+The type of property value.
+The property value to be stored on-chain.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Update a digital asset property
const transaction = await aptos.updateDigitalAssetPropertyTransaction({
creator: Account.generate(), // replace with a real account
propertyKey: "newKey",
propertyType: "BOOLEAN",
propertyValue: false,
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Update a typed digital asset property on-chain. +This function allows you to modify the properties of a digital asset, enabling dynamic updates to its attributes.
+The arguments for updating the digital asset property.
+The account that mints the digital asset.
+The digital asset address.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`(Optional) The type of the digital asset.
+Optionaloptions?: InputGenerateTransactionOptions(Optional) Additional options for generating the transaction.
+The property key for storing on-chain properties.
+The type of property value.
+The property value to be stored on-chain.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Update a typed digital asset property
const transaction = await aptos.updateDigitalAssetTypedPropertyTransaction({
creator: Account.generate(), // replace with a real account
propertyKey: "typedKey",
propertyType: "U8",
propertyValue: 2,
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+This function creates an account if it does not exist and mints the specified amount of coins into that account.
+Note that only devnet has a publicly accessible faucet. For testnet, you must use +the minting page at https://aptos.dev/network/faucet.
+The arguments for funding the account.
+The address of the account to fund.
+The amount of tokens to fund the account with.
+Optionaloptions?: WaitForTransactionOptionsConfiguration options for waiting for the transaction.
+Transaction hash of the transaction that funded the account.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.DEVNET });
const aptos = new Aptos(config);
async function runExample() {
// Fund an account with a specified amount of tokens
const transaction = await aptos.fundAccount({
accountAddress: "0x1", // replace with your account address
amount: 100,
});
console.log("Transaction hash:", transaction.hash);
}
runExample().catch(console.error);
+
+
+Queries all fungible asset balances.
+Optionalargs: {Optional parameters for the query.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to, before querying.
+Optionaloptions?: PaginationArgs & WhereArg<CurrentFungibleAssetBalancesBoolExp>Optional configuration for pagination and filtering.
+A list of fungible asset metadata.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching current fungible asset balances
const fungibleAssetBalances = await aptos.getCurrentFungibleAssetBalances();
console.log(fungibleAssetBalances);
}
runExample().catch(console.error);
+
+
+Queries all fungible asset activities and returns a list of their metadata.
+Optionalargs: {Optional parameters for the query.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to, before querying.
+Optionaloptions?: PaginationArgs & WhereArg<FungibleAssetActivitiesBoolExp>Optional configuration for pagination and filtering.
+A list of fungible asset metadata.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching fungible asset activities
const fungibleAssetActivities = await aptos.getFungibleAssetActivities();
console.log(fungibleAssetActivities);
}
runExample().catch(console.error);
+
+
+Queries all fungible asset metadata.
+Optionalargs: {Optional parameters for the query.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: PaginationArgs & WhereArg<FungibleAssetMetadataBoolExp>Optional configuration for pagination and filtering.
+A list of fungible asset metadata.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching fungible asset metadata
const fungibleAssets = await aptos.getFungibleAssetMetadata();
console.log(fungibleAssets);
}
runExample().catch(console.error);
+
+
+Queries the fungible asset metadata for a specific asset type. +This function helps retrieve detailed information about a fungible asset based on its type.
+A fungible asset metadata item.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve fungible asset metadata by asset type
const fungibleAsset = await aptos.getFungibleAssetMetadataByAssetType({
assetType: "0x1::aptos_coin::AptosCoin" // replace with your asset type
});
console.log(fungibleAsset);
}
runExample().catch(console.error);
+
+
+Retrieves fungible asset metadata based on the creator address.
+This function allows you to query metadata for a specific fungible asset created by a given address.
+The parameters for the query.
+The creator address of the fungible asset.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+A fungible asset metadata item.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve fungible asset metadata by creator address
const fungibleAsset = await aptos.getFungibleAssetMetadataByCreatorAddress({
creatorAddress: "0x123", // replace with a real creator address
});
console.log(fungibleAsset);
}
runExample().catch(console.error);
+
+
+Transfer a specified amount of fungible asset from the sender's primary store to the recipient's primary store. +This method allows you to transfer any fungible asset, including fungible tokens.
+The arguments for the transfer operation.
+The number of assets to transfer.
+The fungible asset account address. For example, if you're transferring USDT, +this would be the USDT address.
+Optionaloptions?: InputGenerateTransactionOptionsOptional parameters for generating the transaction.
+The recipient account address.
+The sender account.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Transfer fungible asset from sender to recipient
const transaction = await aptos.transferFungibleAsset({
sender: Account.generate(), // replace with a real sender account
fungibleAssetMetadataAddress: "0x123", // replace with a real fungible asset address
recipient: "0x456", // replace with a real recipient account
amount: 5
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Transfer a specified amount of fungible asset from the sender's any (primary or secondary) fungible store to any (primary or secondary) fungible store. +This method allows you to transfer any fungible asset, including fungible tokens.
+The arguments for the transfer operation.
+The number of assets to transfer. Must be a positive number.
+The fungible store address initiating the transfer.
+Optionaloptions?: InputGenerateTransactionOptionsOptional parameters for generating the transaction.
+The sender account initiating the transfer.
+The fungible store address receiving the asset.
+A SimpleTransaction that can be simulated or submitted to the chain.
+Error if:
+import { Aptos, AptosConfig, Network, Account } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function transferAssets() {
// Transfer 100 units of the asset from senderStore to recipientStore
const transaction = await aptos.transferFungibleAssetBetweenStores({
sender: Account.generate(), // replace with a real sender account
fromStore: "0x123", // replace with a real fungible store address
toStore: "0x456", // replace with a real fungible store address
amount: 100
});
console.log(transaction);
}
transferAssets().catch(console.error);
+
+
+Retrieve a block by its height, allowing for the inclusion of transactions if specified.
+The parameters for the block retrieval.
+The block height to look up, starting at 0.
+Optionaloptions?: { withTransactions?: boolean }Optional settings for the retrieval.
+OptionalwithTransactions?: booleanIf set to true, includes all transactions in the block.
+The block with optional transactions included.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve the block at height 5, including transactions
const block = await aptos.getBlockByHeight({ blockHeight: 5, options: { withTransactions: true } });
console.log(block);
}
runExample().catch(console.error);
+
+
+Retrieves block information by the specified ledger version.
+The arguments for retrieving the block.
+The ledger version to lookup block information for.
+Optionaloptions?: { withTransactions?: boolean }Optional parameters for the request.
+OptionalwithTransactions?: booleanIf set to true, include all transactions in the block.
+Block information with optional transactions.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve block information for a specific ledger version
const block = await aptos.getBlockByVersion({ ledgerVersion: 5 });
console.log(block);
}
runExample().catch(console.error);
+
+
+Retrieves the chain ID of the Aptos blockchain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching the chain ID
const chainId = await aptos.getChainId();
console.log("Chain ID:", chainId);
}
runExample().catch(console.error);
@returns The chain ID of the Aptos blockchain.
+
+
+Queries the top user transactions based on the specified limit.
+The arguments for querying top user transactions.
+The number of transactions to return.
+GetChainTopUserTransactionsResponse
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetch the top user transactions with a limit of 5
const topUserTransactions = await aptos.getChainTopUserTransactions({ limit: 5 });
console.log(topUserTransactions);
}
runExample().catch(console.error);
+
+
+Queries for the last successful indexer version, providing insight into the ledger version the indexer is updated to, which +may lag behind the full nodes.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the last successful indexer version
const version = await aptos.getIndexerLastSuccessVersion();
console.log(`Last successful indexer version: ${version}`);
}
runExample().catch(console.error);
+
+
+Queries for the Aptos ledger information.
+The Aptos Ledger Info, which includes details such as chain ID, epoch, and ledger version.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching the ledger information
const ledgerInfo = await aptos.getLedgerInfo();
console.log(ledgerInfo);
}
runExample().catch(console.error);
+
+
+Query the processor status for a specific processor type.
+The processor type to query.
+The status of the specified processor type.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the processor status for the account transactions processor
const status = await aptos.getProcessorStatus("account_transactions_processor");
console.log(status);
}
runExample().catch(console.error);
+
+
+Retrieves data from the Aptos Indexer using a GraphQL query. +This function allows you to execute complex queries to fetch specific data from the Aptos blockchain.
+The provided T type.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Querying the Aptos Indexer for ledger information
const topUserTransactions = await aptos.queryIndexer({
query: { query: `query MyQuery {
ledger_infos {
chain_id
}
}`}
});
console.log(topUserTransactions);
}
runExample().catch(console.error);
+
+
+Queries for a Move view function
+Optionaloptions?: LedgerVersionArgPayload for the view function
+an array of Move values
+Queries for a Move view function with JSON, this provides compatability with the old aptos package
Optionaloptions?: LedgerVersionArgPayload for the view function
+an array of Move values
+Fetches the pepper from the Aptos pepper service API.
+The arguments for fetching the pepper.
+OptionalderivationPath?: stringA derivation path used for creating multiple accounts per user via the BIP-44 standard. Defaults +to "m/44'/637'/0'/0'/0".
+The EphemeralKeyPair used to generate the nonce in the JWT token.
+JWT token.
+The pepper which is a Uint8Array of length 31.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const ephemeralKeyPair = new EphemeralKeyPair(); // create a new ephemeral key pair
const jwt = "your_jwt_token"; // replace with a real JWT token
// Fetching the pepper using the provided JWT and ephemeral key pair
const pepper = await aptos.getPepper({
jwt,
ephemeralKeyPair,
// derivationPath: "m/44'/637'/0'/0'/0" // specify your own if needed
});
console.log("Fetched pepper:", pepper);
}
runExample().catch(console.error);
+
+
+Fetches a proof from the Aptos prover service API.
+The arguments for fetching the proof.
+The EphemeralKeyPair used to generate the nonce in the JWT token.
+JWT token.
+Optionalpepper?: HexInputThe pepper used for the account. If not provided, it will be fetched from the Aptos pepper service.
+OptionaluidKey?: stringA key in the JWT token to use to set the uidVal in the IdCommitment.
+The proof which is represented by a ZeroKnowledgeSig.
+import { Aptos, AptosConfig, Network, EphemeralKeyPair, getPepper } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const jwt = "your_jwt_token"; // replace with a real JWT token
const ephemeralKeyPair = new EphemeralKeyPair(); // create a new ephemeral key pair
// Fetch the proof using the getProof function
const proof = await aptos.getProof({
jwt,
ephemeralKeyPair,
pepper: await getPepper({}), // fetch the pepper if not provided
uidKey: "sub", // specify the uid key
});
console.log("Fetched proof:", proof);
}
runExample().catch(console.error);
+
+
+This installs a set of FederatedJWKs at an address for a given iss.
+It will fetch the JSON Web Keyset (JWK) set from the well-known endpoint and update the FederatedJWKs at the sender's address +to reflect it.
+the iss claim of the federated OIDC provider.
+OptionaljwksUrl?: stringthe URL to find the corresponding JWKs. For supported IDP providers this parameter in not necessary.
+Optionaloptions?: InputGenerateTransactionOptionsThe account that will install the JWKs
+The pending transaction that results from submission.
+Fetches the object data based on the specified object address.
+OptionalminimumLedgerVersion?: AnyNumberOptional minimum ledger version to wait for.
+The object address to retrieve data for.
+Optionaloptions?: PaginationArgs & OrderByArg<Optional configuration options for pagination and ordering.
+The object data corresponding to the provided address.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching object data by object address
const objectData = await aptos.getObjectDataByObjectAddress({
objectAddress: "0x1", // replace with a real object address
});
console.log(objectData);
}
runExample().catch(console.error);
+
+
+ReadonlyaccountReadonlyansReadonlycoinReadonlyconfigThe configuration settings for the Aptos client.
+ReadonlydigitalReadonlyfaucetReadonlyfungibleReadonlygeneralReadonlykeylessReadonlyobjectReadonlystakingReadonlytableReadonlytransactionQueries delegated staking activities for a specific delegator and pool.
+The arguments for querying delegated staking activities.
+The address of the delegator.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+The address of the staking pool.
+The response containing delegated staking activities.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get delegated staking activities for a specific delegator and pool
const activities = await aptos.getDelegatedStakingActivities({
delegatorAddress: "0x1", // replace with a real delegator address
poolAddress: "0x2", // replace with a real pool address
minimumLedgerVersion: 1, // specify your own if needed
});
console.log(activities);
}
runExample().catch(console.error);
+
+
+Queries the current number of delegators in a specified pool. Throws an error if the pool is not found.
+The parameters for the query.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+The address of the pool to query.
+The number of delegators for the given pool.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the number of delegators for a specific pool
const delegators = await aptos.getNumberOfDelegators({ poolAddress: "0x1" }); // replace with a real pool address
console.log(`Number of delegators: ${delegators}`);
}
runExample().catch(console.error);
+
+
+Retrieves the current number of delegators across all pools.
+Optionalargs: {Optional parameters for the query.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: OrderByArg<{ num_active_delegator?: any; pool_address?: string | null }>Optional ordering options for the response.
+GetNumberOfDelegatorsForAllPoolsResponse response type containing the number of delegators per pool.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve the number of delegators for all pools
const delegators = await aptos.getNumberOfDelegatorsForAllPools();
console.log(delegators);
}
runExample().catch(console.error);
+
+
+Queries for a specific item in a table identified by the handle and the key for the item. +This function allows you to retrieve structured data from a table in the Aptos blockchain.
+Object that describes the table item, including key and value types.
+A pointer to where that table is stored.
+Optionaloptions?: LedgerVersionArgTable item value rendered in JSON.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve a table item from the Aptos blockchain
const tableItem = await aptos.getTableItem({
handle: "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca",
data: {
key_type: "address", // Move type of table key
value_type: "u128", // Move type of table value
key: "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935" // Value of table key
},
});
console.log(tableItem);
}
runExample().catch(console.error);
+
+
+Queries for table items data with optional filtering and pagination. +This function allows you to retrieve specific data from a table based on provided criteria.
+The arguments for querying table items data.
+OptionalminimumLedgerVersion?: AnyNumberOptional minimum ledger version to wait for before querying.
+Optionaloptions?: PaginationArgs & WhereArg<TableItemsBoolExp> & OrderByArg<Optional parameters for pagination and filtering.
+GetTableItemsDataResponse
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve table items data with specific filtering options
const data = await aptos.getTableItemsData({
minimumLedgerVersion: 1, // specify your own minimum ledger version if needed
options: {
where: {
table_handle: { _eq: "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca" },
transaction_version: { _eq: "0" }
},
limit: 10, // specify your own limit if needed
},
});
console.log(data);
}
runExample().catch(console.error);
+
+
+Queries for the metadata of table items, allowing for filtering and pagination.
+The parameters for the query.
+OptionalminimumLedgerVersion?: AnyNumberOptional minimum ledger version to wait for before querying.
+Optionaloptions?: PaginationArgs & WhereArg<TableMetadatasBoolExp> & OrderByArg<Optional parameters for pagination and filtering.
+GetTableItemsMetadataResponse
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching table items metadata with a filter condition
const data = await aptos.getTableItemsMetadata({
minimumLedgerVersion: 1, // specify your own minimum ledger version if needed
options: {
where: { handle: { _eq: "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca" } },
limit: 10, // specify your own limit if needed
},
});
console.log(data);
}
runExample().catch(console.error);
+
+
+The arguments for batching transactions.
+An array of transaction payloads to be processed.
+Optionaloptions?: Omit<InputGenerateTransactionOptions, "accountSequenceNumber">Optional. Transaction generation configurations (excluding accountSequenceNumber).
+The sender account to sign and submit the transactions.
+Prefer to use aptos.transaction.batch.forSingleAccount()
Batch transactions for a single account by submitting multiple transaction payloads. +This function is useful for efficiently processing and submitting transactions that do not depend on each other, such as +batch funding or batch token minting.
+import { Aptos, AptosConfig, Network, Account } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
const sender = Account.generate(); // Generate a new account for sending transactions
async function runExample() {
const transactions = [
{ }, // Build your first transaction payload
{ }, // Build your second transaction payload
];
// Batch transactions for the single account
await aptos.batchTransactionsForSingleAccount({
sender,
data: transactions,
});
console.log("Batch transactions submitted successfully.");
}
runExample().catch(console.error);
+
+
+Estimates the gas unit price required to process a transaction on the Aptos blockchain in a timely manner. +This helps users to understand the cost associated with their transactions. +https://api.mainnet.aptoslabs.com/v1/spec#/operations/estimate_gas_price
+An object containing the estimated gas price.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET }); // Specify your network
const aptos = new Aptos(config);
async function runExample() {
// Getting the gas price estimation
const gasPriceEstimation = await aptos.getGasPriceEstimation();
console.log("Estimated Gas Price:", gasPriceEstimation);
}
runExample().catch(console.error);
+
+
+Returns a signing message for a transaction, allowing a user to sign it using their preferred method before submission to the network.
+The arguments for obtaining the signing message.
+A raw transaction for signing elsewhere.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const transaction = await aptos.transaction.build.simple({
sender: "0x1", // replace with a real sender address
data: {
function: "0x1::aptos_account::transfer",
functionArguments: ["0x2", 100], // replace with a real destination address
},
});
const message = await aptos.getSigningMessage({ transaction });
console.log(message);
}
runExample().catch(console.error);
+
+
+Queries on-chain transactions by their transaction hash, returning both pending and committed transactions.
+The transaction from the mempool (pending) or the on-chain (committed) transaction.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetch a transaction by its hash
const transaction = await aptos.getTransactionByHash({ transactionHash: "0x123" }); // replace with a real transaction hash
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Queries on-chain transaction by version. This function will not return pending transactions.
+On-chain transaction. Only on-chain transactions have versions, so this +function cannot be used to query pending transactions.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching a transaction by its version
const transaction = await aptos.getTransactionByVersion({ ledgerVersion: 1 }); // replace 1 with a real version
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Queries on-chain transactions, excluding pending transactions. +Use this function to retrieve historical transactions from the blockchain.
+Optionalargs: { options?: PaginationArgs }Optional parameters for pagination.
+Optionaloptions?: PaginationArgsOptional pagination options.
+An array of on-chain transactions.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetch transactions with pagination
const transactions = await aptos.getTransactions({
options: {
offset: 0, // Start from the first transaction
limit: 10, // Limit to 10 results
},
});
console.log(transactions);
}
runExample().catch(console.error);
+
+
+Defines if the specified transaction is currently in a pending state. +This function helps you determine the status of a transaction using its hash.
+true if the transaction is in a pending state and false otherwise.
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Check if the transaction is pending using its hash
const isPendingTransaction = await aptos.isPendingTransaction({ transactionHash: "0x123" }); // replace with a real transaction hash
console.log("Is the transaction pending?", isPendingTransaction);
}
runExample().catch(console.error);
+
+
+Generates a transaction to publish a Move package to the blockchain. +This function helps you create a transaction that can be simulated or submitted to the chain for publishing a package.
+To get the metadataBytes and byteCode, can compile using Aptos CLI with command
+aptos move compile --save-metadata ...,
https://aptos.dev/tutorials/your-first-dapp/#step-4-publish-a-move-module
+The arguments for publishing the package.
+The publisher account.
+The package metadata bytes.
+An array of the bytecode of each module in the package in compiler output order.
+Optionaloptions?: InputGenerateTransactionOptionsOptional settings for generating the transaction.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Replace with a real account address
const account = "0x1";
const metadataBytes = "0x..."; // replace with real metadata bytes
const byteCode = "0x..."; // replace with real module bytecode
const transaction = await aptos.publishPackageTransaction({
account,
metadataBytes,
moduleBytecode: [byteCode],
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Rotates the authentication key for a given account. Once an account is rotated, only the new private key +or keyless signing scheme can be used to sign transactions for the account.
+The arguments for rotating the authentication key.
+The account from which the authentication key will be rotated.
+Optionaloptions?: InputGenerateTransactionOptions | undefined(Optional) The target account to rotate to. Required if not using toNewPrivateKey.
+(Optional) The new private key to rotate to. Required if not using toAccount.
+SimpleTransaction that can be submitted to rotate the auth key
+This function supports three modes of rotation:
+For Ed25519 accounts, the function will use a challenge-based rotation that requires signatures from both the old and new keys. +For multi-key accounts like MultiEd25519Account, the function will use a challenge-based rotation that requires signatures from both keys. +For other account types, the function will use an unverified rotation that only requires the new public key.
+Rotates the authentication key for a given account without verifying the new key.
+Accounts with their auth key rotated via this function will be derivable via the getAccountsForPublicKey and
+deriveOwnedAccountsFromSigner functions however the public key will be unverified (no proof of ownership). Thus
+includeUnverified must be set to true to derive the account until the public key is verified via signing a transaction.
The arguments for rotating the authentication key.
+The account from which the authentication key will be rotated.
+Optionaloptions?: InputGenerateTransactionOptionsThe new public key to rotate to.
+A simple transaction object that can be submitted to the network.
+Sign a transaction that can later be submitted to the chain. +This function is essential for ensuring the authenticity of the transaction by using the provided account's signing capabilities.
+The arguments for signing the transaction.
+The account that will sign the transaction.
+A raw transaction to sign.
+AccountAuthenticator - The authenticator for the signed transaction.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const sender = Account.generate(); // Generate a new account for signing
const transaction = await aptos.transaction.build.simple({
sender: sender.accountAddress,
data: {
function: "0x1::aptos_account::transfer",
functionArguments: [ "0x1", 100 ], // replace with a real account address and amount
},
});
const signedTransaction = await aptos.transaction.sign({
signer: sender,
transaction,
}); // Sign the transaction
console.log("Signed Transaction:", signedTransaction);
}
runExample().catch(console.error);
+
+
+Sign and submit a single signer transaction as the fee payer to chain given an authenticator by the sender of the transaction.
+The fee payer account to sign the transaction
+The AccountAuthenticator signed by the sender of the transaction
+An instance of a RawTransaction, plus optional secondary/fee payer addresses
+PendingTransactionResponse
+const transaction = await aptos.transaction.build.simple({sender: alice.accountAddress, feePayer: true ...})
const senderAuthenticator = alice.signTransactionWithAuthenticator(transaction)
const pendingTransaction = await aptos.signAndSubmitAsFeePayer({
senderAuthenticator,
feePayer: bob,
transaction,
})
+
+
+Sign and submit a single signer transaction to the blockchain. +This function allows you to execute a transaction after signing it with the specified account.
+The arguments for signing and submitting the transaction.
+The signer account to sign the transaction.
+An instance of a RawTransaction, plus optional secondary/fee payer addresses.
+PendingTransactionResponse
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const sender = Account.generate(); // Generate a new account for sending the transaction
const transaction = await aptos.transaction.build.simple({
sender: sender.accountAddress,
data: {
function: "0x1::aptos_account::transfer",
functionArguments: [ "0x1", 100 ], // replace with a real account address
},
});
// Sign and submit the transaction
const pendingTransaction = await aptos.signAndSubmitTransaction({
signer: sender,
transaction,
});
console.log(pendingTransaction);
}
runExample().catch(console.error);
+
+
+Sign a transaction as a fee payer that can later be submitted to the chain. +This function ensures that the transaction is marked with the fee payer's address, allowing it to be processed correctly.
+The arguments for signing the transaction.
+The fee payer signer account.
+A raw transaction to sign on. This transaction must include a feePayerAddress property.
AccountAuthenticator - The authenticator for the signed transaction.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const sender = Account.generate(); // Generate a new account for the fee payer
const transaction = await aptos.transaction.build.simple({
// All transactions on Aptos are implemented via smart contracts.
function: "0x1::aptos_account::transfer",
functionArguments: [sender.accountAddress, 100],
feePayerAddress: sender.accountAddress, // Set the fee payer address
});
const signedTransaction = await aptos.transaction.signAsFeePayer({
signer: sender,
transaction,
});
console.log("Signed transaction as fee payer:", signedTransaction);
}
runExample().catch(console.error);
+
+
+Waits for a transaction to move past the pending state and provides the transaction response. +There are 4 cases.
+checkSuccess is true, the function will throw a FailedTransactionError
+If checkSuccess is false, the function will resolve with the transaction response where the success field is false.args.options.timeoutSecs seconds.
+Optionaloptions?: WaitForTransactionOptionsOptional parameters for waiting behavior.
+The hash of a transaction previously submitted to the blockchain.
+The transaction on-chain response.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Wait for a transaction to complete using its hash
const transactionHash = "0x123"; // replace with a real transaction hash
const transactionResponse = await aptos.waitForTransaction({
transactionHash,
options: {
timeoutSecs: 30, // specify your own timeout if needed
checkSuccess: true,
},
});
console.log(transactionResponse);
}
runExample().catch(console.error);
+
+
+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.
+StaticcaptureCreates a .stack property on targetObject, which when accessed returns
+a string representing the location in the code at which
+Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
+
+
+The first line of the trace will be prefixed with
+${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
+above constructorOpt, including constructorOpt, will be omitted from the
+generated stack trace.
The constructorOpt argument is useful for hiding implementation
+details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
+
+
+OptionalconstructorOpt: FunctionStaticprepareOptionalcauseReadonlydataReadonlyrequestOptionalstackReadonlystatusReadonlystatusReadonlyurlStaticstackThe Error.stackTraceLimit property specifies the number of stack frames
+collected by a stack trace (whether generated by new Error().stack or
+Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
+will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.
+Represents the configuration settings for an Aptos SDK client instance. +This class allows customization of various endpoints and client settings.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a configuration for connecting to the Aptos testnet
const config = new AptosConfig({ network: Network.TESTNET });
// Initialize the Aptos client with the configuration
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+Initializes an instance of the Aptos client with the specified settings. +This allows users to configure various aspects of the client, such as network and endpoints.
+Optionalsettings: AptosSettingsOptional configuration settings for the Aptos client.
+Configuration options for initializing the SDK, allowing customization of its behavior and interaction with the Aptos network.
+Optional Readonlyclient?: ClientOptional ReadonlyclientConfig?: ClientConfigOptional Readonlyfaucet?: stringOptional ReadonlyfaucetConfig?: FaucetConfigOptional Readonlyfullnode?: stringOptional ReadonlyfullnodeConfig?: FullNodeConfigOptional Readonlyindexer?: stringOptional ReadonlyindexerConfig?: IndexerConfigOptional Readonlynetwork?: NetworkOptional Readonlypepper?: stringOptional ReadonlypluginSettings?: PluginSettingsOptional Readonlyprover?: stringOptional ReadonlytransactionGenerationConfig?: TransactionGenerationConfigimport { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a new Aptos client with default settings
const config = new AptosConfig({ network: Network.TESTNET }); // Specify the network
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+ReadonlyclientThe client instance the SDK uses. Defaults to `@aptos-labs/aptos-client
+Optional ReadonlyclientOptional client configurations
+Optional ReadonlyfaucetThe optional hardcoded faucet URL to send requests to instead of using the network
+Optional ReadonlyfaucetOptional specific Faucet configurations
+Optional ReadonlyfullnodeThe optional hardcoded fullnode URL to send requests to instead of using the network
+Optional ReadonlyfullnodeOptional specific Fullnode configurations
+Optional ReadonlyindexerThe optional hardcoded indexer URL to send requests to instead of using the network
+Optional ReadonlyindexerOptional specific Indexer configurations
+ReadonlynetworkThe Network that this SDK is associated with. Defaults to DEVNET
+Optional ReadonlypepperThe optional hardcoded pepper service URL to send requests to instead of using the network
+Optional ReadonlyproverThe optional hardcoded prover service URL to send requests to instead of using the network
+Optional ReadonlytransactionOptional specific Transaction Generation configurations
+Returns the URL endpoint to send the request to based on the specified API type. +If a custom URL was provided in the configuration, that URL is returned. Otherwise, the URL endpoint is derived from the network.
+The type of Aptos API to get the URL for. This can be one of the following: FULLNODE, FAUCET, INDEXER, PEPPER, PROVER.
+import { Aptos, AptosConfig, Network, AptosApiType } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Getting the request URL for the FULLNODE API
const url = config.getRequestUrl(AptosApiType.FULLNODE);
console.log("Request URL for FULLNODE:", url);
}
runExample().catch(console.error);
+
+
+Checks if the provided URL is a known pepper service endpoint.
+The URL to check against the known pepper service endpoints.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const url = "https://example.pepper.service"; // replace with a real pepper service URL
// Check if the URL is a known pepper service endpoint
const isPepperService = config.isPepperServiceRequest(url);
console.log(`Is the URL a known pepper service? ${isPepperService}`);
}
runExample().catch(console.error);
+
+
+Checks if the provided URL is a known prover service endpoint.
+The URL to check against known prover service endpoints.
+A boolean indicating whether the URL is a known prover service endpoint.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
// Check if the URL is a known prover service endpoint
const url = "https://prover.testnet.aptos.dev"; // replace with a real URL if needed
const isProver = config.isProverServiceRequest(url);
console.log(`Is the URL a known prover service? ${isProver}`);
+
+
+If a custom transaction submitter has been specified in the PluginConfig and +IGNORE_TRANSACTION_SUBMITTER is false, this will return a transaction submitter +that should be used instead of the default transaction submission behavior.
+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.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Creates an instance of the AuthenticationKey using the provided hex input. +This ensures that the hex input is valid and conforms to the required length for an Authentication Key.
+ReadonlydataThe raw bytes of the authentication key.
+Static ReadonlyLENGTHAn authentication key is always a SHA3-256 hash of data, and is always 32 bytes.
+The data to hash depends on the underlying public key type and the derivation scheme.
+Derives an account address from an AuthenticationKey by translating the AuthenticationKey bytes directly to an AccountAddress.
+AccountAddress - The derived account address.
+Serializes the fixed bytes data into a format suitable for transmission or storage.
+The serializer instance used to perform the serialization.
+Convert the internal data representation to a Uint8Array.
+This function is useful for obtaining a byte representation of the data, which can be utilized for serialization or transmission.
+Uint8Array representation of the internal data.
+StaticdeserializeDeserialize an AuthenticationKey from the byte buffer in a Deserializer instance.
+The deserializer to deserialize the AuthenticationKey from.
+An instance of AuthenticationKey.
+StaticfromConverts a PublicKey to an AuthenticationKey using the derivation scheme inferred from the provided PublicKey instance.
+The arguments for the function.
+The PublicKey to be converted.
+AuthenticationKey - The derived AuthenticationKey.
+StaticfromDerives an AuthenticationKey from the provided public key using a specified derivation scheme.
+The arguments for deriving the authentication key.
+The public key used for the derivation.
+The scheme to use for deriving the authentication key.
+StaticfromGenerates an AuthenticationKey from the specified scheme and input bytes. +This function is essential for creating a valid authentication key based on a given scheme.
+The arguments for generating the AuthenticationKey.
+The input data in hexadecimal format to derive the key.
+The authentication key scheme to use.
+An instance of AuthenticationKey containing the generated key data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Represents a boolean value that can be serialized and deserialized. +This class extends the Serializable class and provides methods to serialize +the boolean value for different contexts, such as entry functions and script functions.
+Constructs a new instance with a specified value. +This ensures that the value is validated to be within the acceptable range.
+The number to be validated and assigned, which must be between 0 and MAX_U256_BIG_INT.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a U256 value from the provided deserializer.
+The deserializer instance used to read the U256 data.
+Serializes the value using the provided serializer. +This function is essential for converting the value into a format suitable for transmission or storage.
+The serializer instance used to perform the serialization.
+Serializes the current instance for use in an entry function by converting it to a byte sequence. +This allows the instance to be properly formatted for serialization in transactions. +Uses the optimized serializeAsBytes method to reduce allocations.
+The serializer instance used to serialize the byte sequence.
+Serializes the current instance for use in a script function. +This allows for the conversion of the instance into a format suitable for transmission or storage.
+The serializer used to perform the serialization.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a ChainId that can be serialized and deserialized.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Initializes a new instance of the class with the specified chain ID.
+The ID of the blockchain network to be used.
+Serializes the current object using the provided serializer. +This function helps in converting the object into a format suitable for transmission or storage.
+The serializer instance used to perform the serialization.
+StaticdeserializeDeserializes a ChainId from the provided deserializer. +This function allows you to reconstruct a ChainId object from serialized data.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Abstract class representing a generic Aptos account.
+This class serves as a single entry point for account generation, allowing accounts to be created
+either through Account.generate() or Account.fromDerivationPath. Although it is defined as an
+abstract class, it should be treated as an interface and enforced using the implements keyword.
Note: Generating an account instance does not create the account on-chain.
+ReadonlyaccountAccount address associated with the account
+ReadonlypublicPublic key associated with the account
+Sign the given message using the available signing capabilities.
+in HexInput format
+Signature
+ReadonlysigningSigning scheme used to sign transactions
+Sign the given transaction using the available signing capabilities.
+the transaction to be signed
+Signature
+Sign a transaction using the available signing capabilities.
+the raw transaction
+the AccountAuthenticator containing the signature of the transaction, together with the account's public key
+Sign a message using the available signing capabilities.
+the signing message, as binary input
+the AccountAuthenticator containing the signature, together with the account's public key
+Verify the given message and signature with the public key. +This function helps ensure the integrity and authenticity of a message by validating its signature.
+The arguments for verifying the signature.
+Represents the arguments required to verify a digital signature.
+A boolean indicating whether the signature is valid.
+Verify the given message and signature with the public key. It fetches any on chain state if needed for verification.
+The arguments for verifying the signature.
+The configuration object for connecting to the Aptos network
+Raw message data in HexInput format.
+Signed message signature.
+A boolean indicating whether the signature is valid.
+StaticauthRetrieve the authentication key for the associated account using the provided public key. +This key enables account owners to rotate their private key(s) associated with the account without changing the address that +hosts their account. +See here for more info: https://aptos.dev/concepts/accounts#single-signer-authentication
+The arguments for retrieving the authentication key.
+The public key of the account.
+The authentication key for the associated account.
+StaticfromGenerates an account from a specified derivation path and mnemonic. +This function allows you to create an account using different signing schemes based on the provided arguments.
+The arguments for generating the account.
+Arguments for generating an Ed25519 account, specifying the signing scheme and legacy option.
+Optionallegacy?: trueOptionalscheme?: Ed25519Arguments for deriving a private key using a mnemonic phrase and a specified BIP44 path.
+Generates an account from a specified derivation path and mnemonic. +This function allows you to create an account using different signing schemes based on the provided arguments.
+The arguments for generating the account.
+Arguments for generating a SingleKeyAccount with an underlying Ed25519PrivateKey.
+The legacy argument must be set to false to ensure an Ed25519SingleKeyAccount is returned.
Optionalscheme?: Ed25519Arguments for deriving a private key using a mnemonic phrase and a specified BIP44 path.
+Generates an account from a specified derivation path and mnemonic. +This function allows you to create an account using different signing schemes based on the provided arguments.
+The arguments for generating the account.
+Arguments for generating a SingleKeyAccount using a supported private key other than Ed25519PrivateKey.
+The legacy argument is optional and defaults to false, and cannot be set to true.
Optionallegacy?: falseArguments for deriving a private key using a mnemonic phrase and a specified BIP44 path.
+Generates an account from a specified derivation path and mnemonic. +This function allows you to create an account using different signing schemes based on the provided arguments.
+The arguments for generating the account.
+Arguments for generating an opaque Account when the input signature scheme is unknown at compile time.
Optionallegacy?: booleanOptionalscheme?: SigningSchemeInputArguments for deriving a private key using a mnemonic phrase and a specified BIP44 path.
+StaticfromCreates an account from a given private key and address. +This function allows you to instantiate an account based on the provided private key, +and it can differentiate between legacy and non-legacy accounts.
+The arguments for creating the account.
+Arguments for creating an Ed25519Account from an Ed25519PrivateKey.
+To use the SingleKey authentication scheme, set legacy to false.
Optionaladdress?: AccountAddressInputOptionallegacy?: trueAn instance of either Ed25519Account or SingleKeyAccount based on the provided private key.
+Creates an account from a given private key and address. +This function allows you to instantiate an account based on the provided private key, +and it can differentiate between legacy and non-legacy accounts.
+The arguments for creating the account.
+Arguments for creating a SingleKeyAccount from a supported private key, excluding Ed25519PrivateKey.
+The legacy argument is always false and cannot be set to true.
Optionaladdress?: AccountAddressInputOptionallegacy?: falseAn instance of either Ed25519Account or SingleKeyAccount based on the provided private key.
+Creates an account from a given private key and address. +This function allows you to instantiate an account based on the provided private key, +and it can differentiate between legacy and non-legacy accounts.
+The arguments for creating the account.
+Arguments for creating an Account from a private key when the key type is unknown at compile time.
Optionaladdress?: AccountAddressInputOptionallegacy?: booleanAn instance of either Ed25519Account or SingleKeyAccount based on the provided private key.
+StaticfromThe arguments required to create an account from a private key.
+Arguments for creating an Account from a private key when the key type is unknown at compile time.
Optionaladdress?: AccountAddressInputOptionallegacy?: booleanAccount
+StaticgenerateGenerates a new account based on the specified signing scheme and legacy option. +This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.
+Optionalargs: GenerateEd25519AccountArgsThe arguments for generating the account.
+Arguments for generating an Ed25519 account, specifying the signing scheme and legacy option.
+Optionallegacy?: trueOptionalscheme?: Ed25519Generates a new account based on the specified signing scheme and legacy option. +This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.
+The arguments for generating the account.
+Arguments for generating a SingleKeyAccount with an underlying Ed25519PrivateKey.
+The legacy argument must be set to false to ensure an Ed25519SingleKeyAccount is returned.
Optionalscheme?: Ed25519Generates a new account based on the specified signing scheme and legacy option. +This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.
+The arguments for generating the account.
+Arguments for generating a SingleKeyAccount using a supported private key other than Ed25519PrivateKey.
+The legacy argument is optional and defaults to false, and cannot be set to true.
Optionallegacy?: falseGenerates a new account based on the specified signing scheme and legacy option. +This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.
+The arguments for generating the account.
+Arguments for generating an opaque Account when the input signature scheme is unknown at compile time.
Optionallegacy?: booleanOptionalscheme?: SigningSchemeInputStaticcomputeCompute the account address of the DAA +The DAA account address is computed by hashing the function info and the account identity +and appending the domain separator (5)
+The authentication function
+The account identity
+The account address
+StaticfromCreates an AbstractedAccount from an Ed25519Account that has a permissioned signer function and
+using the 0x1::permissioned_delegation::authenticate function to verify the signature.
The Ed25519Account that can be used to sign permissioned transactions.
The AbstractedAccount
StaticgenerateReadonlyabstractThe abstract public key that is used to identify the account. +Depends on the use cases, most of the time it is the public key of the source wallet
+ReadonlyauthenticationStatic ReadonlyADDRESS_The domain separator used to calculate the DAA account address.
+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 Common Serialization) layout.
+Creates a new instance of the class with a copy of the provided data buffer. +This prevents outside mutation of the buffer.
+The data to be copied into the internal buffer as a Uint8Array.
+Helper function that primarily exists to support alternative syntax for deserialization.
+That is, if we have a const deserializer: new Deserializer(...), instead of having to use
+MyClass.deserialize(deserializer), we can call deserializer.deserialize(MyClass).
The BCS-deserializable class to deserialize the buffered bytes into.
+the deserialized value of class type T
+Deserializes a boolean value from a byte stream.
+The BCS layout for a boolean uses one byte, where "0x01" represents true and "0x00" represents false. +An error is thrown if the byte value is not valid.
+The deserialized boolean value.
+Deserializes an array of bytes.
+The BCS layout for "bytes" consists of a bytes_length followed by the bytes themselves, where bytes_length is a u32 integer +encoded as a uleb128 integer, indicating the length of the bytes array.
+The deserialized array of bytes (a copy, safe to modify).
+Deserializes an array of bytes of a specified length.
+The number of bytes to read from the source.
+The deserialized array of bytes (a copy, safe to modify).
+Deserializes a 128-bit signed integer from its binary representation. +This function combines two 64-bit values to return a single int128 value in little-endian format.
+The deserialized int128 number.
+Deserializes a 16-bit signed integer from a binary format in little-endian representation. +BCS layout for "int16": Two bytes.
+The deserialized int16 number.
+Deserializes a 256-bit signed integer from its binary representation. +BCS layout for "int256": Thirty-two bytes in little-endian format.
+The deserialized int256 number.
+Deserializes a 32-bit signed integer from a binary format in little-endian representation. +BCS layout for "int32": Four bytes.
+The deserialized int32 number.
+Deserializes a 64-bit signed integer. +This function combines two 32-bit values to return a 64-bit signed integer in little-endian representation.
+The deserialized int64 number.
+Deserializes an 8-bit signed integer from the binary data. +BCS layout for "int8": One byte. Binary format in little-endian representation.
+The deserialized int8 number.
+Deserializes an optional value from the buffer.
+The BCS layout for Optional
Either a Deserializable class or one of the string literals: "string", "bytes", or "fixedBytes"
+The deserialized value if present, undefined otherwise
+// Deserialize an optional string
const deserializer = new Deserializer(new Uint8Array([1, 3, 97, 98, 99]));
const optStr = deserializer.deserializeOption("string");
// optStr === "abc"
// Deserialize an optional custom type
const deserializer = new Deserializer(new Uint8Array([0]));
const optValue = deserializer.deserializeOption(MyClass);
// optValue === undefined
// Deserialize optional bytes
const deserializer = new Deserializer(new Uint8Array([1, 3, 1, 2, 3]));
const optBytes = deserializer.deserializeOption("bytes");
// optBytes === Uint8Array[1, 2, 3]
// Deserialize optional fixed bytes
const deserializer = new Deserializer(new Uint8Array([1, 1, 2, 3, 4]));
const optBytes = deserializer.deserializeOption("fixedBytes", 4);
// optBytes === Uint8Array[1, 2, 3, 4]
+
+
+Deserializes an optional value from the buffer.
+The BCS layout for Optional
Either a Deserializable class or one of the string literals: "string", "bytes", or "fixedBytes"
+The deserialized value if present, undefined otherwise
+// Deserialize an optional string
const deserializer = new Deserializer(new Uint8Array([1, 3, 97, 98, 99]));
const optStr = deserializer.deserializeOption("string");
// optStr === "abc"
// Deserialize an optional custom type
const deserializer = new Deserializer(new Uint8Array([0]));
const optValue = deserializer.deserializeOption(MyClass);
// optValue === undefined
// Deserialize optional bytes
const deserializer = new Deserializer(new Uint8Array([1, 3, 1, 2, 3]));
const optBytes = deserializer.deserializeOption("bytes");
// optBytes === Uint8Array[1, 2, 3]
// Deserialize optional fixed bytes
const deserializer = new Deserializer(new Uint8Array([1, 1, 2, 3, 4]));
const optBytes = deserializer.deserializeOption("fixedBytes", 4);
// optBytes === Uint8Array[1, 2, 3, 4]
+
+
+Deserializes an optional value from the buffer.
+The BCS layout for Optional
Either a Deserializable class or one of the string literals: "string", "bytes", or "fixedBytes"
+Required length when type is "fixedBytes", ignored otherwise
+The deserialized value if present, undefined otherwise
+// Deserialize an optional string
const deserializer = new Deserializer(new Uint8Array([1, 3, 97, 98, 99]));
const optStr = deserializer.deserializeOption("string");
// optStr === "abc"
// Deserialize an optional custom type
const deserializer = new Deserializer(new Uint8Array([0]));
const optValue = deserializer.deserializeOption(MyClass);
// optValue === undefined
// Deserialize optional bytes
const deserializer = new Deserializer(new Uint8Array([1, 3, 1, 2, 3]));
const optBytes = deserializer.deserializeOption("bytes");
// optBytes === Uint8Array[1, 2, 3]
// Deserialize optional fixed bytes
const deserializer = new Deserializer(new Uint8Array([1, 1, 2, 3, 4]));
const optBytes = deserializer.deserializeOption("fixedBytes", 4);
// optBytes === Uint8Array[1, 2, 3, 4]
+
+
+Deserializes an optional value from the buffer.
+The BCS layout for Optional
The type of the value to deserialize
+Either a Deserializable class or one of the string literals: "string", "bytes", or "fixedBytes"
+The deserialized value if present, undefined otherwise
+// Deserialize an optional string
const deserializer = new Deserializer(new Uint8Array([1, 3, 97, 98, 99]));
const optStr = deserializer.deserializeOption("string");
// optStr === "abc"
// Deserialize an optional custom type
const deserializer = new Deserializer(new Uint8Array([0]));
const optValue = deserializer.deserializeOption(MyClass);
// optValue === undefined
// Deserialize optional bytes
const deserializer = new Deserializer(new Uint8Array([1, 3, 1, 2, 3]));
const optBytes = deserializer.deserializeOption("bytes");
// optBytes === Uint8Array[1, 2, 3]
// Deserialize optional fixed bytes
const deserializer = new Deserializer(new Uint8Array([1, 1, 2, 3, 4]));
const optBytes = deserializer.deserializeOption("fixedBytes", 4);
// optBytes === Uint8Array[1, 2, 3, 4]
+
+
+Deserializes a UTF-8 encoded string from a byte array. It first reads the length of the string in bytes, +followed by the actual byte content, and decodes it into a string.
+BCS layout for "string": string_length | string_content +where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
+Deserializes a uint128 number from its binary representation. +This function combines two 64-bit values to return a single uint128 value in little-endian format.
+The deserialized uint128 number.
+Deserializes a uint256 number from its binary representation.
+The BCS layout for "uint256" consists of thirty-two bytes in little-endian format.
+The deserialized uint256 number.
+Deserializes a uint64 number.
+This function combines two 32-bit values to return a 64-bit unsigned integer in little-endian representation.
+Deserializes a uint8 number from the binary data.
+BCS layout for "uint8": One byte. Binary format in little-endian representation.
+The deserialized uint8 number.
+Deserializes a uleb128 encoded uint32 number.
+This function is used for interpreting lengths of variable-length sequences and tags of enum values in BCS encoding.
+The deserialized uint32 value.
+Deserializes an array of BCS Deserializable values given an existing Deserializer instance with a loaded byte buffer.
+The BCS-deserializable class to deserialize the buffered bytes into.
+An array of deserialized values of type T.
+// serialize a vector of addresses
const addresses = new Array<AccountAddress>(
AccountAddress.from("0x1"),
AccountAddress.from("0x2"),
AccountAddress.from("0xa"),
AccountAddress.from("0xb"),
);
const serializer = new Serializer();
serializer.serializeVector(addresses);
const serializedBytes = serializer.toUint8Array();
// deserialize the bytes into an array of addresses
const deserializer = new Deserializer(serializedBytes);
const deserializedAddresses = deserializer.deserializeVector(AccountAddress);
// deserializedAddresses is now an array of AccountAddress instances
+
+
+Returns the number of bytes remaining in the buffer.
+This information is useful to determine if there's more data to be read.
+The number of bytes remaining in the buffer.
+StaticfromRepresents an Ed25519 account that provides signing capabilities through an Ed25519 private key. +This class allows for the creation of accounts, signing messages and transactions, and verifying signatures.
+Note: Generating an instance of this class does not create the account on-chain.
+Creates an instance of the Ed25519Signer with the specified parameters. +This constructor initializes the private key, public key, and account address for the signer.
+The constructor arguments for the Ed25519Signer.
+Arguments required to create an instance of an Ed25519 signer.
+Optionaladdress?: AccountAddressInputReadonlyaccountAccount address associated with the account
+ReadonlyprivatePrivate key associated with the account
+ReadonlypublicPublic key associated with the account
+ReadonlysigningSigning scheme used to sign transactions
+Sign the given message using the account's Ed25519 private key.
+The message to be signed in HexInput format.
+Signature - The resulting signature of the signed message.
+Sign the given transaction using the available signing capabilities. +This function helps ensure that the transaction is properly authenticated before submission.
+The transaction to be signed.
+Signature - The resulting signature for the transaction.
+Sign a transaction using the account's Ed25519 private key. +This function returns an AccountAuthenticator that contains the signature of the transaction along with the account's public key.
+The raw transaction to be signed.
+An AccountAuthenticator containing the signature and the public key.
+Sign a message using the account's Ed25519 private key. +This function returns an AccountAuthenticator containing the signature along with the account's public key.
+The signing message, represented as hexadecimal input.
+An AccountAuthenticator containing the signature and the account's public key.
+Verify the given message and signature with the public key.
+The arguments for verifying the signature.
+Arguments required to verify an Ed25519 signature against a given message.
+A boolean indicating whether the signature is valid.
+Verify the given message and signature with the public key.
+Ed25519 signatures do not depend on chain state, so this function is equivalent to the synchronous verifySignature method.
+The arguments for verifying the signature.
+The configuration object for connecting to the Aptos network
+Raw message data in HexInput format.
+Signed message signature.
+A boolean indicating whether the signature is valid.
+StaticfromDerives an Ed25519 account using a specified BIP44 path and mnemonic seed phrase.
+The arguments for deriving the account.
+Arguments for creating an Ed25519 signer from a derivation path.
+StaticgenerateGenerates a new Ed25519 account using a randomly generated private key. +This function is useful for creating a signer that can be used for cryptographic operations.
+The newly generated Ed25519 account.
+Represents the private key of an Ed25519 key pair.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Create a new PrivateKey instance from a Uint8Array or String.
+ +HexInput (string or Uint8Array)
+Optionalstrict: booleanIf true, private key must AIP-80 compliant.
+Static ReadonlyLENGTHLength of an Ed25519 private key
+Static ReadonlySLIP_The Ed25519 key seed to use for BIP-32 compatibility +See more https://github.com/satoshilabs/slips/blob/master/slip-0010.md
+Clears the private key from memory by overwriting it with random bytes. +After calling this method, the private key can no longer be used for signing or deriving public keys.
+Note: Due to JavaScript's memory management, this cannot guarantee complete removal of +sensitive data from memory, but it significantly reduces the window of exposure.
+Returns whether the private key has been cleared from memory.
+true if the key has been cleared, false otherwise
+Derive the Ed25519PublicKey for this private key.
+Ed25519PublicKey - The derived public key corresponding to the private key.
+Sign the given message with the private key. +This function generates a digital signature for the specified message, ensuring its authenticity and integrity.
+A message as a string or Uint8Array in HexInput format.
+A digital signature for the provided message.
+StaticfromDerives a private key from a mnemonic seed phrase using a specified BIP44 path. +To derive multiple keys from the same phrase, change the path
+IMPORTANT: Ed25519 supports hardened derivation only, as it lacks a key homomorphism, making non-hardened derivation impossible.
+The BIP44 path used for key derivation.
+The mnemonic seed phrase from which the key will be derived.
+StaticgenerateGenerate a new random private key.
+Ed25519PrivateKey A newly generated Ed25519 private key.
+StaticisDetermines if the provided private key is an instance of Ed25519PrivateKey.
+The private key to check.
+A boolean indicating whether the private key is an Ed25519PrivateKey.
+Get the private key as a AIP-80 compliant hex string.
+ +AIP-80 compliant string representation of the private key.
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents the public key of an Ed25519 key pair.
+Since AIP-55 Aptos supports
+Legacy and Unified authentication keys.
Ed25519 scheme is represented in the SDK as Legacy authentication key and also
+as AnyPublicKey that represents any Unified authentication key.
Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Creates an instance of the Ed25519Signature class from a hex input. +This constructor validates the length of the signature to ensure it meets the required specifications.
+The hex input representing the Ed25519 signature.
+Static ReadonlyLENGTHLength of an Ed25519 public key
+Generates an authentication key from the public key using the Ed25519 scheme. +This function is essential for creating a secure authentication key that can be used for further cryptographic operations.
+The generated authentication key.
+Serializes the data into a byte array using the provided serializer. +This allows for the conversion of data into a format suitable for transmission or storage.
+The serializer instance used to perform the serialization.
+Get the public key as a hex string with a 0x prefix.
+The public key in hex format.
+Convert the internal data representation to a Uint8Array.
+Uint8Array representation of the data.
+Verifies a signed message using a public key.
+The arguments for verification.
+Represents the arguments required to verify a digital signature.
+Note: Ed25519Signatures can be verified syncronously.
+Verifies the provided signature against the given message. +This function helps ensure the integrity and authenticity of the message by confirming that the signature is valid.
+The arguments for signature verification.
+A boolean indicating whether the signature is valid for the given message.
+StaticdeserializeDeserialize bytes into an Ed25519Signature object. +This function is used to convert serialized byte data into a usable Ed25519Signature instance.
+The deserializer instance used to read the byte data.
+StaticisDetermines if the provided public key is a valid Ed25519 public key. +This function checks for the presence of the "key" property and verifies that its data length matches the expected length +for Ed25519 public keys.
+The public key to validate.
+A boolean indicating whether the public key is a valid Ed25519 public key.
+StaticisDetermine if the provided public key is an instance of Ed25519PublicKey.
+The public key to check.
+True if the public key is an instance of Ed25519PublicKey, otherwise false.
+Represents a signature of a message signed using an Ed25519 private key.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Static ReadonlyLENGTHLength of an Ed25519 signature, which is 64 bytes.
+Get the signature as a hex string with a 0x prefix e.g. 0x123456...
+The hex string representation of the signature.
+Get the raw signature bytes
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents 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.
+Contains the payload to run a function within a module.
+Fully qualified module name in format "account_address::module_name" e.g. "0x1::coin"
+The function name. e.g "transfer"
+Type arguments that move function requires.
+arguments to the move function.
+StaticbuildBuild an EntryFunction payload from raw primitive values.
+Fully qualified module name in the format "AccountAddress::module_id", e.g., "0x1::coin".
+The name of the function to be called.
+Type arguments that the Move function requires.
+Arguments to the Move function.
+EntryFunction
+A coin transfer function has one type argument "CoinType".
+public(script) fun transfer<CoinType>(from: &signer, to: address, amount: u64)
+
+
+A coin transfer function has three arguments "from", "to", and "amount".
+public(script) fun transfer<CoinType>(from: &signer, to: address, amount: u64)
+
+
+StaticdeserializeDeserializes an entry function payload with the arguments represented as EntryFunctionBytes instances.
+A deserialized EntryFunction payload for a transaction.
+EntryFunctionBytes
+NOTE: When you deserialize an EntryFunction payload with this method, the entry function +arguments are populated into the deserialized instance as type-agnostic, raw fixed bytes +in the form of the EntryFunctionBytes class.
+In order to correctly deserialize these arguments as their actual type representations, you +must know the types of the arguments beforehand and deserialize them yourself individually.
+One way you could achieve this is by using the ABIs for an entry function and deserializing each +argument as its given, corresponding type.
+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.
+NOTE: Using this class for serialized script functions will lead to erroneous and unexpected behavior.
+If you wish to convert this class back to a TransactionArgument, you must know the type +of the argument beforehand, and use the appropriate class to deserialize the bytes within +an instance of this class.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Serializes the value using the provided serializer. +This function is essential for accurately representing a sequence of bytes that are already BCS-serialized as a type.
+Note that to see the Move, BCS-serialized representation of the underlying fixed byte vector, +we must not serialize the length prefix.
+The serializer instance used to perform the serialization.
+Serializes the current instance for use as an entry function argument by converting the underlying fixed byte vector to a +type-agnostic byte vector. +This process includes serializing the length prefix of the byte vector.
+The serializer instance used to perform the serialization.
+StaticdeserializeThe only way to create an instance of this class is to use this static method. +This function should only be used when deserializing a sequence of EntryFunctionPayload arguments.
+The deserializer instance with the buffered bytes.
+The length of the bytes to deserialize.
+An instance of this class, which will now only be usable as an EntryFunctionArgument.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Represents an ephemeral certificate containing a signature, specifically a ZeroKnowledgeSig. +This class can be extended to support additional signature types, such as OpenIdSignature.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+ReadonlyvariantIndex of the underlying enum variant
+Get the signature as a hex string with a 0x prefix e.g. 0x123456...
+The hex string representation of the signature.
+Get the public key in bytes (Uint8Array).
+Uint8Array representation of the public key
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents 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
+Creates an instance of the class with a specified private key, optional expiry date, and optional blinder. +This constructor initializes the public key, sets the expiry date to a default value if not provided, +generates a blinder if not supplied, and calculates the nonce based on the public key, expiry date, and blinder.
+The parameters for constructing the instance.
+Optionalblinder?: HexInputOptional blinder value. If not provided, a new blinder will be generated.
+OptionalexpiryDateSecs?: numberOptional expiry date in seconds from the current time. Defaults to two weeks from now.
+The private key used for creating the instance.
+ReadonlyblinderA byte array of length BLINDER_LENGTH used to obfuscate the public key from the IdP. +Used in calculating the nonce passed to the IdP and as a secret witness in proof generation.
+ReadonlyexpiryA timestamp in seconds indicating when the ephemeral key pair is expired. After expiry, a new +EphemeralKeyPair must be generated and a new JWT needs to be created.
+ReadonlynonceThe value passed to the IdP when the user authenticates. It consists of a hash of the +ephemeral public key, expiry date, and blinder.
+Clears the ephemeral private key from memory by overwriting it with random bytes. +After calling this method, the ephemeral key pair can no longer be used for signing.
+Note: Due to JavaScript's memory management, this cannot guarantee complete removal of +sensitive data from memory, but it significantly reduces the window of exposure.
+Returns whether the ephemeral key pair has been cleared from memory.
+true if the key pair has been cleared, false otherwise
+Checks if the current time has surpassed the expiry date of the key pair.
+boolean - Returns true if the key pair is expired, otherwise false.
+Serializes the object's properties into a format suitable for transmission or storage. +This function is essential for preparing the object data for serialization processes.
+The serializer instance used to serialize the object's properties.
+Sign the given data using the private key, returning an ephemeral signature. +This function is essential for creating a secure signature that can be used for authentication or verification purposes.
+The data to be signed, provided in HexInput format.
+EphemeralSignature - The resulting ephemeral signature.
+StaticdeserializeDeserializes an ephemeral key pair from the provided deserializer. +This function helps in reconstructing an ephemeral key pair, which is essential for cryptographic operations.
+The deserializer instance used to read the serialized data.
+StaticfromDeserialize a byte array into an EphemeralKeyPair object. +This function allows you to reconstruct an EphemeralKeyPair from its serialized byte representation.
+The byte array representing the serialized EphemeralKeyPair.
+StaticgenerateGenerates a new ephemeral key pair with an optional expiry date. +This function allows you to create a temporary key pair for secure operations.
+An instance of EphemeralKeyPair containing the generated private key and expiry date.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Represents ephemeral public keys for Aptos Keyless accounts.
+These keys are used only temporarily within Keyless accounts and are not utilized as public keys for account identification.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Creates an instance of EphemeralPublicKey using the provided public key. +This constructor ensures that only supported signature types are accepted.
+The public key to be used for the ephemeral public key.
+ReadonlypublicThe public key itself
+ReadonlyvariantAn enum indicating the scheme of the ephemeral public key
+Serializes the current instance, specifically handling the Ed25519 signature type. +This function ensures that the signature is properly serialized using the provided serializer.
+The serializer instance used to serialize the signature.
+Get the public key as a hex string with a 0x prefix.
+The public key in hex format.
+Get the raw public key bytes
+Verifies a signed message using the ephemeral public key.
+The arguments for the verification.
+The message that was signed.
+The signature that was signed by the private key of the ephemeral public key.
+true if the signature is valid, otherwise false.
+Verifies signature with the public key and makes any network calls required to get state required to verify the signature.
+The Aptos configuration
+The message that was signed
+The signature to verify
+StaticdeserializeDeserializes an EphemeralSignature from the provided deserializer. +This function allows you to retrieve an EphemeralSignature based on the deserialized data.
+The deserializer instance used to read the serialized data.
+StaticisDetermines if the provided public key is an instance of EphemeralPublicKey.
The public key to check.
+A boolean indicating whether the public key is an ephemeral type.
+Represents ephemeral signatures used in Aptos Keyless accounts.
+These signatures are utilized within the KeylessSignature framework.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+ReadonlysignatureThe signature signed by the private key of an EphemeralKeyPair
+Get the signature as a hex string with a 0x prefix e.g. 0x123456...
+The hex string representation of the signature.
+Get the raw signature bytes
+StaticfromDeserializes an ephemeral signature from a hexadecimal input. +This function allows you to convert a hexadecimal representation of an ephemeral signature into its deserialized form for +further processing.
+The hexadecimal input representing the ephemeral signature.
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeAccount implementation for the FederatedKeyless authentication scheme.
+Used to represent a FederatedKeyless based account and sign transactions with it.
+Use FederatedKeylessAccount.create() to instantiate a KeylessAccount with a JSON Web Token (JWT), proof, EphemeralKeyPair and the
+address the JSON Web Key Set (JWKS) are installed that will be used to verify the JWT.
When the proof expires or the JWT becomes invalid, the KeylessAccount must be instantiated again with a new JWT, +EphemeralKeyPair, and corresponding proof.
+ReadonlyaccountAccount address associated with the account
+ReadonlyaudThe value of the 'aud' claim on the JWT, also known as client ID. This is the identifier for the dApp's +OIDC registration with the identity provider.
+ReadonlyephemeralThe EphemeralKeyPair used to generate sign.
+ReadonlyjwtThe JWT token used to derive the account
+ReadonlypepperA value contains 31 bytes of entropy that preserves privacy of the account. Typically fetched from a pepper provider.
+The zero knowledge signature (if ready) which contains the proof used to validate the EphemeralKeyPair.
+ReadonlyproofThe proof of the EphemeralKeyPair or a promise that provides the proof. This is used to allow for awaiting on +fetching the proof.
+ReadonlypublicThe FederatedKeylessPublicKey associated with the account
+ReadonlysigningSigning scheme used to sign transactions
+ReadonlyuidThe claim on the JWT to identify a user. This is typically 'sub' or 'email'.
+ReadonlyuidThe value of the uidKey claim on the JWT. This intended to be a stable user identifier.
+This initializes the asynchronous proof fetch
+Emits whether the proof succeeds or fails, but has no return.
+Checks if the proof is expired. If so the account must be re-derived with a new EphemeralKeyPair +and JWT token.
+boolean
+Sign the given message using Keyless.
+in HexInput format
+Signature
+Sign the given transaction with Keyless. +Signs the transaction and proof to guard against proof malleability.
+the transaction to be signed
+KeylessSignature
+Sign a transaction using Keyless.
+the raw transaction
+the AccountAuthenticator containing the signature of the transaction, together with the account's public key
+Sign a message using Keyless.
+the message to sign, as binary input
+the AccountAuthenticator containing the signature, together with the account's public key
+Note - This function is currently incomplete and should only be used to verify ownership of the KeylessAccount
+Verifies a signature given the message.
+the message that was signed.
+the KeylessSignature to verify
+boolean
+Verify the given message and signature with the public key. It fetches any on chain state if needed for verification.
+The arguments for verifying the signature.
+The configuration object for connecting to the Aptos network
+Raw message data in HexInput format.
+Optionaloptions?: { throwErrorWithReason?: boolean }Signed message signature.
+A boolean indicating whether the signature is valid.
+Waits for asynchronous proof fetching to finish.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Use the static generator FederatedKeylessAccount.create(...) instead.
+Creates a KeylessAccount instance using the provided parameters.
+This function allows you to set up a KeylessAccount with specific attributes such as address, proof, and JWT.
The parameters for creating a KeylessAccount.
+Optionaladdress?: AccountAddressOptional account address associated with the KeylessAccount.
+Optionalaudless?: booleanThe ephemeral key pair used in the account creation.
+The address which stores the JSON Web Key Set (JWKS) used to verify the JWT.
+A JSON Web Token used for authentication.
+A Zero Knowledge Signature or a promise that resolves to one.
+OptionalproofFetchCallback?: ProofFetchCallbackOptional callback function for fetching proof.
+Optional key for user identification, defaults to "sub".
+OptionalverificationKeyHash?: HexInputValidates that the Keyless Account can be used to sign transactions.
+Serializes the transaction data into a format suitable for transmission or storage. +This function ensures that both the transaction bytes and the proof are properly serialized.
+The serializer instance used to convert the transaction data into bytes.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticcreateCreates a KeylessAccount instance using the provided parameters. +This function allows you to set up a KeylessAccount with specific attributes such as address, proof, and JWT. +This is used instead of the KeylessAccount constructor.
+The parameters for creating a KeylessAccount.
+Optionaladdress?: AccountAddressOptional account address associated with the KeylessAccount.
+The ephemeral key pair used in the account creation.
+The address which stores the JSON Web Key Set (JWKS) used to verify the JWT.
+A JSON Web Token used for authentication.
+A Zero Knowledge Signature or a promise that resolves to one.
+OptionalproofFetchCallback?: ProofFetchCallbackOptional callback function for fetching proof.
+OptionaluidKey?: stringOptional key for user identification, defaults to "sub".
+OptionalverificationKey?: Groth16VerificationKeyOptionalverificationKeyHash?: Uint8Array<ArrayBufferLike>StaticdeserializeDeserializes the provided deserializer to create a KeylessAccount instance. +This function extracts necessary components such as the JWT, UID key, pepper, ephemeral key pair, and proof from the deserializer.
+The deserializer instance used to retrieve the serialized data.
+A KeylessAccount instance created from the deserialized data.
+StaticfetchFetches the JWK from the issuer's well-known JWKS endpoint.
+The kid of the JWK to fetch
+The keyless public key to query
+A JWK matching the kid in the JWT header.
StaticfromDeserialize bytes using this account's information.
+The bytes being interpreted.
+StaticpartialRepresents the FederatedKeylessPublicKey public key
+These keys use an on-chain address as a source of truth for the JWK used to verify signatures.
+FederatedKeylessPublicKey authentication key is represented in the SDK as AnyPublicKey.
Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+ReadonlyjwkThe address that contains the JWK set to be used for verification.
+ReadonlykeylessThe inner public key which contains the standard Keyless public key.
+Get the authentication key for the federated keyless public key
+AuthenticationKey
+Get the public key as a hex string with a 0x prefix.
+The public key in hex format.
+Get the raw public key bytes
+Verifies a signed data with a public key
+The JWK to use for verification.
+The keyless configuration to use for verification.
+message
+The signature
+true if the signature is valid
+StaticcreateCreates a FederatedKeylessPublicKey from the JWT components plus pepper
+the client ID of the application
+the iss of the identity
+The pepper used to maintain privacy of the account
+the key to use to get the uidVal in the JWT token
+the value of the uidKey in the JWT token
+FederatedKeylessPublicKey
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Verifies a keyless signature for a given message. It will fetch the keyless configuration and the JWK to +use for verification from the appropriate network as defined by the aptosConfig.
+The aptos config to use for fetching the keyless configuration.
+The message to verify the signature against.
+Optionaloptions?: { throwErrorWithReason?: boolean }OptionalthrowErrorWithReason?: booleanWhether to throw an error with the reason for the failure instead of returning false.
+The signature to verify.
+true if the signature is valid
+StaticdeserializeStaticfromStaticisStaticisRepresents a Fee Payer Transaction that can be serialized and deserialized.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Readonlyfee_The fee payer account address
+Readonlyraw_The raw transaction
+Readonlysecondary_The secondary signers on this transaction - optional and can be empty
+StaticdeserializeDeserialize a Raw Transaction With Data
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticloadRepresents a contiguous sequence of already serialized BCS bytes.
+This class differs from most other Serializable classes in that its internal byte buffer is serialized to BCS
+bytes exactly as-is, without prepending the length of the bytes. It is ideal for scenarios where custom serialization
+is required, such as passing serialized bytes as transaction arguments. Additionally, it serves as a representation
+of type-agnostic BCS bytes, akin to a vector
An example use case includes handling bytes resulting from entry function arguments that have been serialized +for an entry function.
+const yourCustomSerializedBytes = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]);
const fixedBytes = new FixedBytes(yourCustomSerializedBytes);
const payload = await generateTransactionPayload({
function: "0xbeefcafe::your_module::your_function_that_requires_custom_serialization",
functionArguments: [yourCustomBytes],
});
This class is particularly useful when you want to handle a fixed-size byte array without the overhead of
length prepending, such as when dealing with 32-byte addresses stored as U8 in a MoveVector<U8>.
For example, if you store each of the 32 bytes for an address as a U8 in a MoveVector<U8>, when you
serialize that MoveVector<U8>, it will be serialized to 33 bytes. If you solely want to pass around
the 32 bytes as a Serializable class that *does not* prepend the length to the BCS-serialized representation,
use this class.*
+
+
+Creates an instance of the class with a specified hexadecimal input. +The value is converted from hexadecimal format to a Uint8Array.
+The hexadecimal input to be converted.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Serializes the fixed bytes value using the provided serializer. +This function is essential for converting the fixed bytes into a format suitable for storage or transmission.
+The serializer instance used for serialization.
+Serializes the current instance for an entry function using the provided serializer. +This allows the instance to be converted into a format suitable for transmission or storage.
+The serializer used to perform the serialization.
+Serializes the current instance using the provided serializer. +This function is essential for preparing data to be passed as arguments in script functions.
+The serializer instance used to perform the serialization.
+StaticdeserializeDeserializes a fixed-length byte array from the provided deserializer. +This function helps in reconstructing a FixedBytes object from the serialized data.
+The deserializer instance used to read the byte data.
+The length of the byte array to be deserialized.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
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.
+ReadonlydomainThe domain separator prefix used when hashing.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+The Groth16 proof
+The public inputs hash as a 32 byte Uint8Array
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents the verification key stored on-chain used to verify Groth16 proofs.
+ReadonlyalphaThe alpha * G, where G is the generator of G1
ReadonlybetaThe alpha * H, where H is the generator of G2
ReadonlydeltaThe delta * H, where H is the generator of G2
ReadonlygammaThe gamma^{-1} * (beta * a_i + alpha * b_i + c_i) * H, where H is the generator of G1
ReadonlygammaThe gamma * H, where H is the generator of G2
Converts the verification key to a JSON format compatible with snarkjs groth16.verify
+An object containing the verification key in snarkjs format
+StaticfromConverts a Groth16VerificationKeyResponse object into a Groth16VerificationKey instance.
+The Groth16VerificationKeyResponse object containing the verification key data.
+The response containing the Groth16 verification key, including the alpha_g1 component.
+A Groth16VerificationKey instance constructed from the provided response data.
+Calculates the hash of the serialized form of the verification key. +This is useful for comparing verification keys or using them as unique identifiers.
+The SHA3-256 hash of the serialized verification key as a Uint8Array
+Verifies a Groth16 proof using the verification key given the public inputs hash and the proof.
+The Groth16 proof
+The public inputs hash
+true if the proof is valid
+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.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+The bytes of G1 proof point a
+The bytes of G2 proof point b
+The bytes of G1 proof point c
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeNOTE: Do not use this class when working with account addresses; use AccountAddress instead. +When accepting hex data as input to a function, prefer to accept HexInput and
+A helper class for working with hex data. Hex data, when represented as a string, +generally looks like this, for example: 0xaabbcc, 45cd32, etc.
+then use the static helper methods of this class to convert it into the desired +format. This enables the greatest flexibility for the developer.
+Example usage:
+getTransactionByHash(txnHash: HexInput): Promise<Transaction> {
const txnHashString = Hex.fromHexInput(txnHash).toString();
return await getTransactionByHashInner(txnHashString);
}
+
+
+This call to Hex.fromHexInput().toString() converts the HexInput to a hex string
+with a leading 0x prefix, regardless of what the input format was.
Other ways to chain the functions together:
+Hex.fromHexString({ hexInput: "0x1f" }).toUint8Array()new Hex([1, 3]).toStringWithoutPrefix()Create a new Hex instance from a Uint8Array.
+The Uint8Array containing the data to initialize the Hex instance.
+Determine if two Hex instances are equal by comparing their underlying byte data.
+The Hex instance to compare to.
+true if the Hex instances are equal, false if not.
+Get the hex data as a string with the 0x prefix.
+Hex string with 0x prefix
+Get the hex data as a string without the 0x prefix.
+Hex string without 0x prefix
+Get the inner hex data as a Uint8Array. The inner data is already a Uint8Array, so no conversion takes place.
+Hex data as Uint8Array
+StaticfromConverts an instance of HexInput, which can be a string or a Uint8Array, into a Hex instance. +This function is useful for transforming hexadecimal representations into a structured Hex object for further manipulation.
+A HexInput which can be a string or Uint8Array.
+A Hex instance created from the provided hexInput.
+StaticfromConverts a hex string into a Hex instance, allowing for both prefixed and non-prefixed formats.
+A hex string, with or without the 0x prefix.
+Hex - The resulting Hex instance created from the provided string.
+StaticisCheck if the provided string is a valid hexadecimal representation.
+A hex string representing byte data.
+An object containing:
+StatichexConverts a HexInput (string or Uint8Array) to a hex string with '0x' prefix.
+The input to convert, either a hex string (with/without '0x' prefix) or Uint8Array
+A hex string with '0x' prefix (e.g., "0x1234")
+StatichexConverts a HexInput (string or Uint8Array) to a hex string without '0x' prefix.
+The input to convert, either a hex string (with/without '0x' prefix) or Uint8Array
+A hex string without '0x' prefix (e.g., "1234")
+StatichexConverts an instance of HexInput, which can be a string or a Uint8Array, into a Uint8Array.
+A HexInput which can be a string or Uint8Array.
+A Uint8Array created from the provided hexInput.
+Represents a 128-bit signed integer value. +This class provides methods for serialization and deserialization +of I128 values, ensuring that the values are within the valid range.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Serialize an argument to BCS-serialized bytes as a type aware byte sequence. +The byte sequence contains an enum variant index followed by the BCS-serialized +bytes for a typed argument.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a 16-bit signed integer (I16) value. +This class extends the Serializable class and provides methods for serialization +and deserialization of the I16 value.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Serialize an argument to BCS-serialized bytes as a type aware byte sequence. +The byte sequence contains an enum variant index followed by the BCS-serialized +bytes for a typed argument.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a 256-bit signed integer (I256) that extends the Serializable class. +This class provides methods for serialization and deserialization of I256 values, +ensuring that the values are within the valid range.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Serialize an argument to BCS-serialized bytes as a type aware byte sequence. +The byte sequence contains an enum variant index followed by the BCS-serialized +bytes for a typed argument.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a 32-bit signed integer (I32) that can be serialized and deserialized. +This class ensures that the value is within the valid range for an I32.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Serialize an argument to BCS-serialized bytes as a type aware byte sequence. +The byte sequence contains an enum variant index followed by the BCS-serialized +bytes for a typed argument.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a 64-bit signed integer (I64) and provides methods for serialization.
+This class ensures that the value is within the valid range for an I64 and provides +functionality to serialize the value for various use cases, including entry functions +and script functions.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Serialize an argument to BCS-serialized bytes as a type aware byte sequence. +The byte sequence contains an enum variant index followed by the BCS-serialized +bytes for a typed argument.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents an 8-bit signed integer (I8) value. +This class extends the Serializable class and provides methods for serialization and deserialization of I8 values.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Serialize an argument to BCS-serialized bytes as a type aware byte sequence. +The byte sequence contains an enum variant index followed by the BCS-serialized +bytes for a typed argument.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents 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".
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Creates an instance of the class with a specified identifier.
+The unique identifier for the instance.
+Serializes the identifier of the current instance using the provided serializer.
+The serializer instance used to perform the serialization.
+StaticdeserializeDeserializes an identifier from the provided deserializer. +This function is useful for reconstructing an Identifier object from a serialized format.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Account implementation for the Keyless authentication scheme.
+Used to represent a Keyless based account and sign transactions with it.
+Use KeylessAccount.create() to instantiate a KeylessAccount with a JWT, proof and EphemeralKeyPair.
When the proof expires or the JWT becomes invalid, the KeylessAccount must be instantiated again with a new JWT, +EphemeralKeyPair, and corresponding proof.
+Use the static generator create(...) instead.
+Creates an instance of the KeylessAccount with an optional proof.
The parameters for creating a KeylessAccount.
+Optionaladdress?: AccountAddressOptional account address associated with the KeylessAccount.
+The value of the 'aud' claim on the JWT, also known as client ID. This is the identifier for the dApp's +OIDC registration with the identity provider.
+The ephemeral key pair used in the account creation.
+A JWT issuer.
+A JSON Web Token used for authentication.
+A hexadecimal input used for additional security.
+A Zero Knowledge Signature or a promise that resolves to one.
+OptionalproofFetchCallback?: ProofFetchCallbackOptional callback function for fetching proof.
+The claim on the JWT to identify a user. This is typically 'sub' or 'email'.
+The unique id for this user, intended to be a stable user identifier.
+OptionalverificationKeyHash?: HexInputReadonlyaccountAccount address associated with the account
+ReadonlyaudThe value of the 'aud' claim on the JWT, also known as client ID. This is the identifier for the dApp's +OIDC registration with the identity provider.
+ReadonlyephemeralThe EphemeralKeyPair used to generate sign.
+ReadonlyjwtThe JWT token used to derive the account
+ReadonlypepperA value contains 31 bytes of entropy that preserves privacy of the account. Typically fetched from a pepper provider.
+The zero knowledge signature (if ready) which contains the proof used to validate the EphemeralKeyPair.
+ReadonlyproofThe proof of the EphemeralKeyPair or a promise that provides the proof. This is used to allow for awaiting on +fetching the proof.
+ReadonlypublicThe KeylessPublicKey associated with the account
+ReadonlysigningSigning scheme used to sign transactions
+ReadonlyuidThe claim on the JWT to identify a user. This is typically 'sub' or 'email'.
+ReadonlyuidThe value of the uidKey claim on the JWT. This intended to be a stable user identifier.
+This initializes the asynchronous proof fetch
+Emits whether the proof succeeds or fails, but has no return.
+Checks if the proof is expired. If so the account must be re-derived with a new EphemeralKeyPair +and JWT token.
+boolean
+Serializes the transaction data into a format suitable for transmission or storage. +This function ensures that both the transaction bytes and the proof are properly serialized.
+The serializer instance used to convert the transaction data into bytes.
+Sign the given message using Keyless.
+in HexInput format
+Signature
+Sign the given transaction with Keyless. +Signs the transaction and proof to guard against proof malleability.
+the transaction to be signed
+KeylessSignature
+Sign a transaction using Keyless.
+the raw transaction
+the AccountAuthenticator containing the signature of the transaction, together with the account's public key
+Sign a message using Keyless.
+the message to sign, as binary input
+the AccountAuthenticator containing the signature, together with the account's public key
+Note - This function is currently incomplete and should only be used to verify ownership of the KeylessAccount
+Verifies a signature given the message.
+the message that was signed.
+the KeylessSignature to verify
+boolean
+Verify the given message and signature with the public key. It fetches any on chain state if needed for verification.
+The arguments for verifying the signature.
+The configuration object for connecting to the Aptos network
+Raw message data in HexInput format.
+Optionaloptions?: { throwErrorWithReason?: boolean }Signed message signature.
+A boolean indicating whether the signature is valid.
+Waits for asynchronous proof fetching to finish.
+StaticcreateCreates a KeylessAccount instance using the provided parameters. +This function allows you to set up a KeylessAccount with specific attributes such as address, proof, and JWT. +This is used instead of the KeylessAccount constructor.
+The parameters for creating a KeylessAccount.
+Optionaladdress?: AccountAddressOptional account address associated with the KeylessAccount.
+The ephemeral key pair used in the account creation.
+A JSON Web Token used for authentication.
+A hexadecimal input used for additional security.
+A Zero Knowledge Signature or a promise that resolves to one.
+OptionalproofFetchCallback?: ProofFetchCallbackOptional callback function for fetching proof.
+OptionaluidKey?: stringOptional key for user identification, defaults to "sub".
+OptionalverificationKey?: Groth16VerificationKeyOptionalverificationKeyHash?: Uint8Array<ArrayBufferLike>StaticdeserializeDeserializes the provided deserializer to create a KeylessAccount instance. +This function extracts necessary components such as the JWT, UID key, pepper, ephemeral key pair, and proof from the deserializer.
+The deserializer instance used to retrieve the serialized data.
+A KeylessAccount instance created from the deserialized data.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Validates that the Keyless Account can be used to sign transactions.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticfetchFetches the JWK from the issuer's well-known JWKS endpoint.
+The kid of the JWK to fetch
+The keyless public key to query
+A JWK matching the kid in the JWT header.
StaticfromDeserialize bytes using this account's information.
+The bytes being interpreted.
+StaticpartialRepresents the on-chain configuration for how Keyless accounts operate.
+ReadonlymaxThe maximum number of bytes that can be used for the committed ephemeral public key.
+ReadonlymaxThe maximum lifespan of an ephemeral key pair. This is configured on chain.
+ReadonlymaxThe maximum number of bytes that can be used for the extra field.
+ReadonlymaxThe maximum number of bytes that can be used for the issuer value.
+ReadonlymaxThe maximum number of bytes that can be used for the JWT header.
+Optional ReadonlytrainingThe public key of the training wheels account.
+ReadonlyverificationThe verification key used to verify Groth16 proofs on chain
+StaticcreateCreates a new KeylessConfiguration instance from a Groth16VerificationKeyResponse and a KeylessConfigurationResponse.
+The Groth16VerificationKeyResponse object containing the verification key data.
+The KeylessConfigurationResponse object containing the configuration data.
+A new KeylessConfiguration instance.
+StaticcaptureCreates a .stack property on targetObject, which when accessed returns
+a string representing the location in the code at which
+Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
+
+
+The first line of the trace will be prefixed with
+${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
+above constructorOpt, including constructorOpt, will be omitted from the
+generated stack trace.
The constructorOpt argument is useful for hiding implementation
+details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
+
+
+OptionalconstructorOpt: FunctionStaticconstructOptionalinnerError: unknownOptionaldetails: stringStaticfromStatic constructor that creates a KeylessError instance using the KeylessErrors constant
+Optionaldetails?: stringoptional details to include in the error message
+Optionalerror?: unknownThe type of KeylessError
+A new KeylessError instance
+StaticprepareReadonlycategoryOptionalcauseOptional ReadonlydetailsOptional ReadonlyinnerReadonlyresolutionOptionalstackReadonlytypeStaticstackThe Error.stackTraceLimit property specifies the number of stack frames
+collected by a stack trace (whether generated by new Error().stack or
+Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
+will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.
+Represents a Keyless Public Key used for authentication.
+This class encapsulates the public key functionality for keyless authentication,
+including methods for generating and verifying signatures, as well as serialization
+and deserialization of the key. The KeylessPublicKey is represented in the SDK
+as AnyPublicKey.
Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Constructs an instance with the specified parameters for cryptographic operations.
+ReadonlyidA value representing a cryptographic commitment to a user identity.
+It is calculated from the aud, uidKey, uidVal, pepper.
+ReadonlyissThe value of the 'iss' claim on the JWT which identifies the OIDC provider.
+Static ReadonlyID_The number of bytes that idCommitment should be
Get the authentication key for the keyless public key.
+AuthenticationKey - The authentication key derived from the keyless public key.
+Serializes the current instance into a format suitable for transmission or storage. +This function ensures that all relevant fields are properly serialized, including the proof and optional fields.
+The serializer instance used to perform the serialization.
+Get the public key as a hex string with a 0x prefix.
+The public key in hex format.
+Get the raw public key bytes
+Verifies the validity of a signature for a given message.
+The arguments for signature verification.
+The JWK to use for verification.
+The keyless configuration to use for verification.
+The message that was signed.
+The signature to verify against the message.
+true if the signature is valid; otherwise, false.
+StaticcreateCreates a KeylessPublicKey from the JWT components plus pepper
+the client ID of the application
+the iss of the identity
+The pepper used to maintain privacy of the account
+the key to use to get the uidVal in the JWT token
+the value of the uidKey in the JWT token
+KeylessPublicKey
+StaticdeserializeDeserializes a ZeroKnowledgeSig object from the provided deserializer. +This function allows you to reconstruct a ZeroKnowledgeSig instance from its serialized form.
+The deserializer instance used to read the serialized data.
+A new instance of ZeroKnowledgeSig.
+StaticfromCreates a KeylessPublicKey instance from a JWT and a pepper value. +This function is useful for generating a public key that can be used for authentication based on the provided JWT claims and pepper.
+The arguments for creating the KeylessPublicKey.
+The JSON Web Token to decode.
+The pepper value used in the key creation process.
+OptionaluidKey?: stringAn optional key to retrieve the unique identifier from the JWT payload, defaults to "sub".
+A KeylessPublicKey instance created from the provided JWT and pepper.
+StaticisChecks if the provided public key is a valid instance by verifying its structure and types.
+The public key to validate.
+A boolean indicating whether the public key is a valid instance.
+StaticisDetermines if the provided public key is an instance of KeylessPublicKey.
+The public key to check.
+A boolean indicating whether the public key is a KeylessPublicKey instance.
+StaticloadLoads a KeylessPublicKey instance from the provided deserializer. +This function is used to deserialize the necessary components to create a KeylessPublicKey.
+The deserializer used to extract the string and byte data.
+A new instance of KeylessPublicKey.
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Verifies a keyless signature for a given message. It will fetch the keyless configuration and the JWK to +use for verification from the appropriate network as defined by the aptosConfig.
+The aptos config to use for fetching the keyless configuration.
+The message to verify the signature against.
+Optionaloptions?: { throwErrorWithReason?: boolean }OptionalthrowErrorWithReason?: booleanWhether to throw an error with the reason for the failure instead of returning false.
+The signature to verify.
+true if the signature is valid
+Represents a signature of a message signed via a Keyless Account, utilizing proofs or a JWT token for authentication.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+ReadonlyephemeralThe inner signature ZeroKnowledgeSignature or OpenIdSignature
+ReadonlyephemeralThe ephemeral public key used to verify the signature
+ReadonlyephemeralThe signature resulting from signing with the private key of the EphemeralKeyPair
+ReadonlyexpiryThe expiry timestamp in seconds of the EphemeralKeyPair used to sign
+ReadonlyjwtThe jwt header in the token used to create the proof/signature. In json string representation.
+Get the signature as a hex string with a 0x prefix e.g. 0x123456...
+The hex string representation of the signature.
+Get the raw signature bytes
+Get the kid of the JWT used to derive the Keyless Account used to sign.
+the kid as a string
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticgetStaticisRepresents 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").
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Initializes a new instance of the module with the specified account address and name.
+The account address, e.g., "0x1".
+The module name under the specified address, e.g., "coin".
+Serializes the address and name properties using the provided serializer. +This function is essential for converting the object's data into a format suitable for transmission or storage.
+The serializer instance used to perform the serialization.
+StaticdeserializeDeserializes a ModuleId from the provided deserializer. +This function retrieves the account address and identifier to construct a ModuleId instance.
+The deserializer instance used to read the data.
+StaticfromConverts a string literal in the format "account_address::module_name" to a ModuleId.
+A string literal representing the module identifier.
+ModuleId - The corresponding ModuleId object.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
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.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticfromRepresents an argument for entry functions, providing methods to serialize the argument +to BCS-serialized bytes and convert it to different formats.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Check if the MoveOption has a value.
+Returns true if there is exactly one value in the MoveOption.
+Retrieves the inner value of the MoveOption.
+This method is inspired by Rust's Option<T>.unwrap(), where attempting to unwrap a None value results in a panic.
+This method will throw an error if the value is not present.
The contained value if present.
+StaticBoolFactory method to generate a MoveOptionboolean or undefined.
Optionalvalue: boolean | nullthe value used to fill the MoveOption. If value is undefined
+the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticI128Factory method to generate a MoveOptionnumber or a bigint or undefined.
Optionalvalue: AnyNumber | nullthe value used to fill the MoveOption. If value is undefined
+the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticI16Factory method to generate a MoveOptionnumber or undefined.
Optionalvalue: number | nullthe value used to fill the MoveOption. If value is undefined
+the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticI256Factory method to generate a MoveOptionnumber or a bigint or undefined.
Optionalvalue: AnyNumber | nullthe value used to fill the MoveOption. If value is undefined
+the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticI32Factory method to generate a MoveOptionnumber or undefined.
Optionalvalue: number | nullthe value used to fill the MoveOption. If value is undefined
+the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticI64Factory method to generate a MoveOptionnumber or a bigint or undefined.
Optionalvalue: AnyNumber | nullthe value used to fill the MoveOption. If value is undefined
+the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticI8Factory method to generate a MoveOptionnumber or undefined.
Optionalvalue: number | nullthe value used to fill the MoveOption. If value is undefined
+the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticMoveFactory method to generate a MoveOptionstring or undefined.
Optionalvalue: string | nullthe value used to fill the MoveOption. If value is undefined
+the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticU128Factory method to generate a MoveOptionnumber or a bigint or undefined.
Optionalvalue: AnyNumber | nullthe value used to fill the MoveOption. If value is undefined
+the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticU16Factory method to generate a MoveOptionnumber or undefined.
Optionalvalue: number | nullthe value used to fill the MoveOption. If value is undefined
+the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticU256Factory method to generate a MoveOptionnumber or a bigint or undefined.
Optionalvalue: AnyNumber | nullthe value used to fill the MoveOption. If value is undefined
+the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticU32Factory method to generate a MoveOptionnumber or undefined.
Optionalvalue: number | nullthe value used to fill the MoveOption. If value is undefined
+the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticU64Factory method to generate a MoveOptionnumber or a bigint or undefined.
Optionalvalue: AnyNumber | nullthe value used to fill the MoveOption. If value is undefined
+the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
StaticU8Factory method to generate a MoveOptionnumber or undefined.
Optionalvalue: number | nullthe value used to fill the MoveOption. If value is undefined
+the resulting MoveOption's .isSome() method will return false.
a MoveOptionvalue
Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Optionalvalue: T | nullReturns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a string value that can be serialized and deserialized. +This class extends the Serializable base class and provides methods +for serializing the string in different contexts, such as for entry +functions and script functions.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Serialize an argument to BCS-serialized bytes as a type aware byte sequence. +The byte sequence contains an enum variant index followed by the BCS-serialized +bytes for a typed argument.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeThis class is the Aptos Typescript SDK representation of a Move vector<T>,
+where T represents either a primitive type (bool, u8, u64, ...)
+or a BCS-serializable struct itself.
It is a BCS-serializable, array-like type that contains an array of values of type T,
+where T is a class that implements Serializable.
The purpose of this class is to facilitate easy construction of BCS-serializable
+Move vector<T> types.
// in Move: `vector<u8> [1, 2, 3, 4];`
const vecOfU8s = new MoveVector<U8>([new U8(1), new U8(2), new U8(3), new U8(4)]);
// in Move: `std::bcs::to_bytes(vector<u8> [1, 2, 3, 4]);`
const bcsBytes = vecOfU8s.toUint8Array();
// vector<vector<u8>> [ vector<u8> [1], vector<u8> [1, 2, 3, 4], vector<u8> [5, 6, 7, 8] ];
const vecOfVecs = new MoveVector<MoveVector<U8>>([
new MoveVector<U8>([new U8(1)]),
MoveVector.U8([1, 2, 3, 4]),
MoveVector.U8([5, 6, 7, 8]),
]);
// vector<Option<u8>> [ std::option::some<u8>(1), std::option::some<u8>(2) ];
const vecOfOptionU8s = new MoveVector<MoveOption<U8>>([
MoveOption.U8(1),
MoveOption.U8(2),
]);
// vector<MoveString> [ std::string::utf8(b"hello"), std::string::utf8(b"world") ];
const vecOfStrings = new MoveVector([new MoveString("hello"), new MoveString("world")]);
const vecOfStrings2 = MoveVector.MoveString(["hello", "world"]);
+
+
+Initializes a new instance of the class with an optional value. +This constructor sets up the internal vector based on the provided value.
+The initial value to be stored in the vector, or null to initialize an empty vector.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Serializes the current object using the provided serializer. +This function will serialize the value if it is present.
+The serializer instance used to perform the serialization.
+Serializes the current instance into a byte sequence suitable for entry functions. +This allows the data to be properly formatted for transmission or storage. +Uses the optimized serializeAsBytes method to reduce allocations.
+The serializer instance used to serialize the byte sequence.
+Serialize the string as a fixed byte string without the length prefix for use in a script function.
+The serializer used to convert the byte vector into a format suitable for a script function.
+StaticBoolFactory method to generate a MoveVectorboolean or undefined.
+This method allows you to create an optional boolean value that can be used in various contexts where a boolean may or may
+not be present.
The value used to fill the MoveVector. If value is undefined, the resulting MoveVector's .isSome() method
+will return false.
A MoveVectorvalue.
StaticdeserializeDeserialize a MoveVector of type T, specifically where T is a Serializable and Deserializable type.
+NOTE: This only works with a depth of one. Generics will not work.
+NOTE: This will not work with types that aren't of the Serializable class.
+If you're looking for a more flexible deserialization function, you can use the deserializeVector function +in the Deserializer class.
+the Deserializer instance to use, with bytes loaded into it already.
+the class to typecast the input values to, must be a Serializable and Deserializable type.
+a MoveVector of the corresponding class T
+StaticI128Factory method to generate a MoveVector
The values used to fill the MoveVector.
+A MoveVector
StaticI16Factory method to generate a MoveVector
The values used to fill the MoveVector.
+A MoveVector
StaticI256Factory method to generate a MoveVector
The values used to fill the MoveVector.
+A MoveVector
StaticI32Factory method to generate a MoveVector
The values used to fill the MoveVector.
+A MoveVector
StaticI64Factory method to generate a MoveVector
The values used to fill the MoveVector.
+A MoveVector
StaticI8Factory method to generate a MoveVector
The values used to fill the MoveVector.
+A MoveVector
StaticMoveFactory method to generate a MoveVectorstring or undefined.
+This function creates a MoveVector that encapsulates a MoveString if the provided value is not null or undefined.
The value used to fill the MoveVector. If value is undefined, the resulting MoveVector's .isSome() method
+will return false.
A MoveVectorvalue.
StaticU128Factory method to generate a MoveVector
The value used to fill the MoveVector. If value is undefined, the resulting MoveVector's .isSome()
+method will return false.
A MoveVectorvalue.
StaticU16Factory method to generate a MoveOptionnumber or null.
This method allows you to create a MoveVector that can either hold a U16 value or be empty.
+The value used to fill the MoveVector. If value is null or undefined, the resulting MoveVector's
+.isSome() method will return false.
A MoveVectorvalue.
StaticU256Factory method to generate a MoveVector
The value used to fill the MoveVector. If value is undefined or null,
+the resulting MoveVector's .isSome() method will return false.
A MoveVectorvalue.
StaticU32Factory method to generate a MoveVectornumber or null.
This method allows you to create a MoveVector that can either hold a U32 value or be empty.
+The value used to fill the MoveVector. If value is null or undefined,
+the resulting MoveVector's .isSome() method will return false.
A MoveVectorvalue.
StaticU64Factory method to generate a MoveVector
The value used to fill the MoveVector. If value is undefined or null, the resulting MoveVector's
+.isSome() method will return false.
A MoveVectorvalue.
StaticU8Factory method to generate a MoveVectornumber or undefined.
This method allows you to create a MoveVector that encapsulates a U8 value, enabling you to handle optional U8 values +effectively.
+The values used to fill the MoveVector. If values is undefined or null, the resulting MoveVector's
+.isSome() method will return false.
A MoveVectorvalue.
Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Represents a multi-agent transaction that can be serialized and deserialized.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Readonlyraw_The raw transaction
+Readonlysecondary_The secondary signers on this transaction
+StaticdeserializeDeserialize a Raw Transaction With Data
+StaticloadDeserializes a Fee Payer Raw Transaction from the provided deserializer. +This function allows you to reconstruct a Fee Payer Raw Transaction object, which includes the raw transaction data, +secondary signer addresses, and the fee payer address.
+The deserializer used to read the raw transaction data.
+A FeePayerRawTransaction object constructed from the deserialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Represents a multi-agent transaction that can be serialized and deserialized. +This transaction includes a raw transaction, optional fee payer address, and multiple secondary signer addresses.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Represents a MultiAgentTransaction that can be submitted to the Aptos chain for execution. +This class encapsulates the raw transaction data, the secondary signer addresses, and an optional fee payer address.
+The raw transaction data.
+An array of secondary signer addresses.
+OptionalfeePayerAddress: AccountAddressAn optional account address that sponsors the gas fees.
+Serializes the transaction data, including the raw transaction, secondary signer addresses, and fee payer address. +This function is essential for preparing the transaction for transmission or storage in a serialized format.
+The serializer instance used to serialize the transaction data.
+StaticdeserializeDeserializes a MultiAgentTransaction from the provided deserializer. +This function allows you to reconstruct a MultiAgentTransaction object from its serialized form, including any secondary +signer addresses and the fee payer address if present.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Signer implementation for the Multi-Ed25519 authentication scheme.
+Note: This authentication scheme is a legacy authentication scheme. Prefer using MultiKeyAccounts as a +MultiKeyAccount can support any type of signer, not just Ed25519. Generating a signer instance does not +create the account on-chain.
+ReadonlyaccountAccount address associated with the account
+ReadonlypublicPublic key associated with the account
+ReadonlysignerAn array of indices where for signer[i], signerIndicies[i] is the index of the corresponding public key in +publicKey.publicKeys. Used to derive the right public key to use for verification.
+ReadonlysignersThe signers used to sign messages. These signers should correspond to public keys in the +MultiEd25519Account. The number of signers should be equal to this.publicKey.threshold.
+ReadonlysigningSigning scheme used to sign transactions
+Verify the given message and signature with the public key.
+MultiEd25519 signatures do not depend on chain state, so this function is +equivalent to the synchronous verifySignature method.
+The arguments for verifying the signature.
+The configuration object for connecting to the Aptos network
+Raw message data in HexInput format.
+Optionaloptions?: { throwErrorWithReason?: boolean }Signed message signature.
+A boolean indicating whether the signature is valid.
+Sign the given message using the account's Ed25519 private keys.
+in HexInput format
+MultiEd25519Signature
+Sign the given transaction using the available signing capabilities.
+the transaction to be signed
+Signature
+Sign a transaction using the account's Ed25519 private keys.
+the raw transaction
+the AccountAuthenticator containing the signature of the transaction, together with the account's public key
+Sign a message using the account's Ed25519 private key.
+the signing message, as binary input
+the AccountAuthenticator containing the signature, together with the account's public key
+Verify the given message and signature with the public key.
+Represents the public key of a K-of-N Ed25519 multi-sig transaction.
+A K-of-N multi-sig transaction requires at least K out of N authorized signers to sign the transaction +for it to be executed. This class encapsulates the logic for managing the public keys and the threshold +for valid signatures.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Public key for a K-of-N multi-sig transaction. A K-of-N multi-sig transaction means that for such a +transaction to be executed, at least K out of the N authorized signers have signed the transaction +and passed the check conducted by the chain.
+A wrapper to let you choose the param order.
+A list of public keys
+At least "threshold" signatures must be valid
+ReadonlypublicList of Ed25519 public keys for this LegacyMultiEd25519PublicKey
+ReadonlythresholdThe minimum number of valid signatures required, for the number of public keys specified
+Static ReadonlyMAX_Maximum number of public keys supported
+Static ReadonlyMIN_Minimum number of public keys needed
+Static ReadonlyMIN_Minimum threshold for the number of valid signatures required
+Generates an authentication key based on the current instance's byte representation. +This function is essential for creating a secure authentication key that can be used for various cryptographic operations.
+The generated authentication key.
+Create a bitmap that holds the mapping from the original public keys +to the signatures passed in
+array of the index mapping to the matching public keys
+Uint8array bit map
+Serializes the current instance into bytes using the provided serializer. +This allows for the conversion of the instance's data into a format suitable for transmission or storage.
+The serializer used to convert the instance into bytes.
+Get the public key as a hex string with a 0x prefix.
+The public key in hex format.
+Converts a PublicKeys into Uint8Array (bytes) with: bytes = p1_bytes | ... | pn_bytes | threshold
+Verifies a multi-signature against a given message. +This function ensures that the provided signatures meet the required threshold and are valid for the given message.
+True if the signature is valid; otherwise, false.
+Verifies signature with the public key and makes any network calls required to get state required to verify the signature.
+The Aptos configuration
+The message that was signed
+The signature to verify
+StaticdeserializeDeserializes a MultiEd25519Signature from the provided deserializer. +This function helps in reconstructing a MultiEd25519Signature object from its serialized byte representation.
+The deserializer instance used to read the serialized data.
+StaticdeserializeDeserializes a MultiEd25519Signature from the provided deserializer. +This function helps in reconstructing a MultiEd25519Signature object from its serialized byte representation.
+The deserializer instance used to read the serialized data.
+Get the index of the provided public key.
+This function retrieves the index of a specified public key within the MultiKey. +If the public key does not exist, it throws an error.
+The public key to find the index for.
+The corresponding index of the public key, if it exists.
+Represents the signature of a K-of-N Ed25519 multi-sig transaction.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Signature for a K-of-N multi-sig transaction.
+4 bytes, at most 32 signatures are supported. If Nth bit value is 1, the Nth
+signature should be provided in signatures. Bits are read from left to right.
+Alternatively, you can specify an array of bitmap positions.
+Valid position should range between 0 and 31.
A list of signatures
+Readonlybitmap32-bit Bitmap representing who signed the transaction
+This is represented where each public key can be masked to determine whether the message was signed by that key.
+ReadonlysignaturesThe list of underlying Ed25519 signatures
+StaticBITMAP_Number of bytes in the bitmap representing who signed the transaction (32-bits)
+StaticMAX_Maximum number of Ed25519 signatures supported
+Get the signature as a hex string with a 0x prefix e.g. 0x123456...
+The hex string representation of the signature.
+Converts a MultiSignature into Uint8Array (bytes) with bytes = s1_bytes | ... | sn_bytes | bitmap
StaticcreateHelper method to create a bitmap out of the specified bit positions. +This function allows you to set specific bits in a 32-bit long bitmap based on the provided positions.
+The arguments for creating the bitmap.
+The bitmap positions that should be set. A position starts at index 0. Valid positions should range between 0 and 31.
+bitmap that is 32 bits long.
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents 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.
+The public keys of each individual agent can be any type of public key supported by Aptos.
+Since AIP-55, Aptos supports
+Legacy and Unified authentication keys.
Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Signature for a K-of-N multi-sig transaction. +This constructor initializes a multi-signature transaction with the provided signatures and bitmap.
+An object containing the parameters for the multi-signature transaction.
+ReadonlypublicList of any public keys
+ReadonlysignaturesThe minimum number of valid signatures required, for the number of public keys specified
+Generates an authentication key based on the current instance's byte representation. +This key can be used for secure authentication processes within the system.
+The generated authentication key.
+Create a bitmap that holds the mapping from the original public keys +to the signatures passed in
+array of the index mapping to the matching public keys
+Uint8array bit map
+Serializes the object by writing its signatures and bitmap to the provided serializer. +This allows the object to be converted into a format suitable for transmission or storage.
+The serializer instance used to perform the serialization.
+Get the public key as a hex string with a 0x prefix.
+The public key in hex format.
+Get the raw public key bytes
+Verifies the provided signature against the given message. +This function helps ensure the integrity and authenticity of the message by checking if the signature is valid.
+Note: This function will fail if a keyless signature is used. Use verifySignatureAsync instead.
The arguments for verifying the signature.
+The message that was signed.
+The signature to verify.
+Verifies the provided signature against the given message. +This function helps ensure the integrity and authenticity of the message by checking if the signature is valid.
+The arguments for verifying the signature.
+The Aptos configuration to use
+The message that was signed.
+Optionaloptions?: { throwErrorWithReason?: boolean }The signature to verify.
+StaticdeserializeDeserializes a MultiKeySignature from the provided deserializer. +This function retrieves the signatures and bitmap necessary for creating a MultiKeySignature object.
+The deserializer instance used to read the serialized data.
+Get the index of the provided public key.
+This function retrieves the index of a specified public key within the MultiKey. +If the public key does not exist, it throws an error.
+The public key to find the index for.
+The corresponding index of the public key, if it exists.
+Signer implementation for the MultiKey authentication scheme.
+This account utilizes an M of N signing scheme, where M and N are specified in the MultiKey. +It signs messages using an array of M accounts, each corresponding to a public key in the MultiKey.
+Note: Generating a signer instance does not create the account on-chain.
+Constructs a MultiKeyAccount instance, which requires multiple signatures for transactions.
+The arguments for creating a MultiKeyAccount.
+Optionaladdress?: AccountAddressInputAn optional account address input. If not provided, the derived address from the public key will be used.
+The multikey of the account consisting of N public keys and a number M representing the required signatures.
+An array of M signers that will be used to sign the transaction.
+ReadonlyaccountAccount address associated with the account
+ReadonlypublicPublic key associated with the account
+ReadonlysignerAn array of indices where for signer[i], signerIndicies[i] is the index of the corresponding public key in +publicKey.publicKeys. Used to derive the right public key to use for verification.
+ReadonlysignersThe signers used to sign messages. These signers should correspond to public keys in the +MultiKeyAccount's public key. The number of signers should be equal to this.publicKey.signaturesRequired.
+ReadonlysigningSigning scheme used to sign transactions
+Validates that the Keyless Account can be used to sign transactions.
+Sign the given message using the MultiKeyAccount's signers
+The data to be signed in HexInput format.
+MultiKeySignature
+Sign the given transaction using the MultiKeyAccount's signers. +This function aggregates signatures from all signers associated with the MultiKeyAccount.
+The transaction to be signed.
+MultiKeySignature - An object containing the aggregated signatures and a bitmap of the signatures.
+Sign a transaction using the account's signers, returning an AccountAuthenticator that contains the signature and the +account's public key.
+The raw transaction to be signed.
+An AccountAuthenticatorMultiKey containing the signature of the transaction along with the account's public key.
+Sign a message using the account's signers and return an AccountAuthenticator containing the signature along with the +account's public key.
+The signing message, represented as binary input in hexadecimal format.
+An instance of AccountAuthenticatorMultiKey that includes the signature and the public key.
+Verify the given message and signature with the public keys.
+This function checks if the provided signatures are valid for the given message using the corresponding public keys.
+Note: If you are using KeylessAccounts, you must use verifySignatureAsync instead.
The arguments for verifying the signature.
+The raw message data in HexInput format.
+The signed message MultiKeySignature containing multiple signatures.
+A boolean indicating whether the signatures are valid for the message.
+Verify the given message and signature with the public keys.
+This function checks if the provided signatures are valid for the given message using the corresponding public keys.
+The arguments for verifying the signature.
+The raw message data in HexInput format.
+Optionaloptions?: { throwErrorWithReason?: boolean }OptionalthrowErrorWithReason?: booleanWhether to throw an error with the reason for the verification failure.
+The signed message MultiKeySignature containing multiple signatures.
+A boolean indicating whether the signatures are valid for the message.
+Waits for any proofs on KeylessAccount signers to be fetched. This ensures that signing with the KeylessAccount does not +fail due to missing proofs.
+A promise that resolves when all proofs have been fetched.
+StaticfromStatic constructor to create a MultiKeyAccount using the provided public keys and signers.
+The arguments for creating a MultiKeyAccount.
+Optionaladdress?: AccountAddressInputThe N public keys of the MultiKeyAccount.
+The number of signatures required to authorize a transaction.
+An array of M signers that will be used to sign the transaction.
+MultiKeyAccount - The newly created MultiKeyAccount.
+StaticisDetermines if the provided account is a multi-key account.
+The account to check.
+A boolean indicating whether the account is a multi-key account.
+Represents a multi-signature transaction using Ed25519 signatures. +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.
+It includes functionality to validate the number of signatures against a bitmap, +which indicates which public keys have signed the transaction.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Signature for a K-of-N multi-sig transaction.
+4 bytes, at most 32 signatures are supported. If Nth bit value is 1, the Nth
+signature should be provided in signatures. Bits are read from left to right
A list of signatures
+Readonlybitmap32-bit Bitmap representing who signed the transaction
+This is represented where each public key can be masked to determine whether the message was signed by that key.
+ReadonlysignaturesThe list of underlying Ed25519 signatures
+StaticBITMAP_Number of bytes in the bitmap representing who signed the transaction (32-bits)
+StaticMAX_Maximum number of Ed25519 signatures supported
+Converts the bitmap to an array of signer indices.
+Example:
+bitmap: [0b10001000, 0b01000000, 0b00000000, 0b00000000] +signerIndices: [0, 4, 9]
+An array of signer indices.
+Get the signature as a hex string with a 0x prefix e.g. 0x123456...
+The hex string representation of the signature.
+Get the raw signature bytes
+StaticcreateHelper method to create a bitmap out of the specified bit positions
+The bitmap positions that should be set. A position starts at index 0. +Valid position should range between 0 and 31.
+bitmap that is 32bit long
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a MultiSig account that can be serialized and deserialized.
+This class encapsulates the functionality to manage multi-signature transactions, including the address of the +multi-sig account and the associated transaction payload.
+Contains the payload to run a multi-sig account transaction.
+The multi-sig account address the transaction will be executed as.
+Optionaltransaction_payload: MultiSigTransactionPayloadThe payload of the multi-sig transaction. This is optional when executing a multi-sig +transaction whose payload is already stored on chain.
+StaticdeserializeRepresents a multi-signature transaction payload that can be serialized and deserialized.
+This class is designed to encapsulate the transaction payload for multi-sig account transactions
+as defined in the multisig_account.move module. Future enhancements may allow support for script
+payloads as the multisig_account.move module evolves.
Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Contains the payload to run a multi-sig account transaction.
+The payload of the multi-sig transaction. +This can only be EntryFunction for now but, +Script might be supported in the future.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeThis error is used to explain why parsing failed.
+Creates an instance of the error with a specified message and invalid reason.
+The error message that describes the issue.
+The reason why the input is considered invalid.
+This provides a programmatic way to access why parsing failed. Downstream devs +might want to use this to build their own error messages if the default error +messages are not suitable for their use case. This should be an enum.
+StaticcaptureCreates a .stack property on targetObject, which when accessed returns
+a string representing the location in the code at which
+Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
+
+
+The first line of the trace will be prefixed with
+${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
+above constructorOpt, including constructorOpt, will be omitted from the
+generated stack trace.
The constructorOpt argument is useful for hiding implementation
+details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
+
+
+OptionalconstructorOpt: FunctionStaticprepareOptionalcauseOptionalstackStaticstackThe Error.stackTraceLimit property specifies the number of stack frames
+collected by a stack trace (whether generated by new Error().stack or
+Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
+will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.
+A class to handle all ANS operations.
Initializes a new instance of the Aptos class with the provided configuration. +This allows you to interact with the Aptos blockchain using the specified network settings.
+The configuration settings for the Aptos client.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a configuration for connecting to the Aptos testnet
const config = new AptosConfig({ network: Network.TESTNET });
// Initialize the Aptos client with the configuration
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+Clears the target address of a domain or subdomain name, removing the address association. +After clearing, the name will no longer resolve to a specific address.
+The arguments for clearing the target address.
+A string representing the domain or subdomain name (e.g., "test.aptos").
+Optionaloptions?: InputGenerateTransactionOptionsOptional settings for generating the transaction.
+The account initiating the transaction.
+An object containing the transaction and the InputEntryFunctionData
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Clearing the target address for a domain name
const sender = Account.generate(); // replace with a real account
const { transaction, data } = await aptos.clearTargetAddress({
sender,
name: "test.aptos",
});
const targetAddress = await aptos.getTargetAddress({ name: "test.aptos" });
console.log(targetAddress); // Should log undefined after clearing
}
runExample().catch(console.error);
+
+
+Fetches all top-level domain names for a specified account.
+The arguments for retrieving account domains.
+Arguments for retrieving the domains associated with a specific account.
+Optionaloptions?: PaginationArgs & OrderByArg<AnsName> & WhereArg<CurrentAptosNamesBoolExp>A promise of an array of ANSName.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching all top-level domain names for a specific account
const domains = await aptos.getAccountDomains({
accountAddress: "0x1", // replace with a real account address
options: {
limit: 10, // specify the number of names to fetch
offset: 0, // specify the offset for pagination
orderBy: "created_at", // specify the order by which to sort the names
where: {
// additional filters can be specified here
},
},
});
console.log(domains);
}
runExample().catch(console.error);
+
+
+Fetches all names for an account, including both top-level domains and subdomains.
+The arguments for fetching account names.
+Arguments for retrieving account names based on the specified account address.
+Optionaloptions?: PaginationArgs & OrderByArg<AnsName> & WhereArg<CurrentAptosNamesBoolExp>A promise of an array of ANSName.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetch account names for a specific address
const accountNames = await aptos.getAccountNames({
accountAddress: "0x1", // replace with a real account address
options: {
limit: 10, // specify how many names to fetch
orderBy: "name", // specify the order by which to sort the names
},
});
console.log(accountNames);
}
runExample().catch(console.error);
+
+
+Fetches all subdomain names for a specified account.
+The arguments for retrieving subdomains.
+Arguments for retrieving subdomains associated with a specific account.
+Optionaloptions?: PaginationArgs & OrderByArg<AnsName> & WhereArg<CurrentAptosNamesBoolExp>A promise of an array of ANSName.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching subdomain names for a specific account
const subdomains = await aptos.getAccountSubdomains({
accountAddress: "0x1", // replace with a real account address
options: {
limit: 10, // specify the number of subdomains to fetch
offset: 0, // specify the offset for pagination
orderBy: "name", // specify the order by which to sort the names
},
});
console.log(subdomains);
}
runExample().catch(console.error);
+
+
+Fetches all subdomain names for a given domain, excluding the domain itself.
+The arguments for fetching subdomains.
+Arguments for retrieving subdomains associated with a specific domain.
+Optionaloptions?: PaginationArgs & OrderByArg<AnsName> & WhereArg<CurrentAptosNamesBoolExp>A promise that resolves to an array of ANSName.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching subdomains for a specific domain
const subdomains = await aptos.getDomainSubdomains({
domain: "test", // replace with your domain
options: {
limit: 10, // specify the number of subdomains to fetch
offset: 0, // specify the starting point for fetching
orderBy: "name", // specify the order by which to sort the results
},
});
console.log(subdomains);
}
runExample().catch(console.error);
+
+
+Retrieve the expiration time of a domain name or subdomain name from the contract.
+The arguments for retrieving the expiration.
+A string of the name to retrieve.
+number as a unix timestamp in milliseconds.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the expiration time for the domain "test.aptos"
const exp = await aptos.getExpiration({ name: "test.aptos" });
// Log the expiration date
console.log(new Date(exp)); // Outputs the expiration date
}
runExample().catch(console.error);
+
+
+Fetches a single name from the indexer based on the provided name argument.
+The arguments for retrieving the name.
+A string of the name to retrieve, e.g. "test.aptos.apt" or "test.apt" or "test". +Can be inclusive or exclusive of the .apt suffix and can be a subdomain.
+A promise of an ANSName or undefined if the name is not active.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching a name from the indexer
const name = await aptos.getName({ name: "test.aptos" }); // replace with a real name
console.log(name);
}
runExample().catch(console.error);
+
+
+Retrieve the owner address of a specified domain name or subdomain name from the contract.
+The arguments for retrieving the owner address.
+A string representing the name of the domain or subdomain to retrieve the owner address for.
+AccountAddress if the name is owned, undefined otherwise.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve the owner address of "test.aptos"
const owner = await aptos.getOwnerAddress({ name: "test.aptos" });
console.log(owner); // Logs the owner address or undefined if not owned
}
runExample().catch(console.error);
+
+
+Retrieve the primary name for an account. An account can have multiple names, but only one primary name, which may not exist.
+The arguments for retrieving the primary name.
+An AccountAddressInput (address) of the account.
+A string if the account has a primary name, undefined otherwise.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve the primary name for the specified account address
const name = await aptos.getPrimaryName({ address: "0x1" }); // replace with a real account address
console.log(name);
}
runExample().catch(console.error);
+
+
+Retrieve the target address of a domain or subdomain name, which indicates the address the name points to for use on-chain. +Note that the target address can point to addresses that do not own the name.
+The arguments for retrieving the target address.
+A string representing the name, which can be a primary name, a subdomain, or a combination (e.g., +"primary", "primary.apt", "secondary.primary", "secondary.primary.apt").
+AccountAddress if the name has a target, undefined otherwise.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve the target address for the specified domain name
const targetAddr = await aptos.getTargetAddress({ name: "test.aptos" });
console.log(targetAddr); // Logs the target address, e.g., 0x123...
}
runExample().catch(console.error);
+
+
+Registers a new name.
+This function allows you to register a domain or subdomain name with specific expiration policies and options.
+An object containing the transaction and the InputEntryFunctionData
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Registering a subdomain name assuming def.apt is already registered and belongs to the sender alice.
const { transaction, data } = await aptos.registerName({
sender: "0x1", // replace with a real sender account
name: "test.aptos.apt",
expiration: {
policy: "subdomain:independent",
expirationDate: Date.now() + 30 * 24 * 60 * 60 * 1000, // expires in 30 days
},
});
console.log("Transaction:", transaction);
}
runExample().catch(console.error);
+
+
+Renews a domain name for one year. +If a domain name was minted with V1 of the contract, it will automatically be upgraded to V2 via this transaction.
+The arguments for renewing the domain.
+A string representing the domain to renew. Subdomains cannot be renewed.
+Optionaloptions?: InputGenerateTransactionOptionsOptional transaction options.
+The sender account, which must be the domain owner.
+Optionalyears?: 1The number of years to renew the name. Currently, only one year is permitted.
+An object containing the transaction and the InputEntryFunctionData
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Renew the domain "test" for one year
const { transaction, data } = await aptos.renewDomain({
sender: Account.generate(), // replace with a real account
name: "test"
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Sets the primary name for the sender account, allowing them to designate a single primary name among potentially multiple +names. An account may not have a primary name.
+The arguments for setting the primary name.
+Optionalname?: stringA string representing the name to set as primary (e.g., "test.aptos").
+Optionaloptions?: InputGenerateTransactionOptionsOptional transaction options.
+The sender account.
+An object containing the transaction and the InputEntryFunctionData
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Set the primary name for the sender account
const sender = Account.generate(); // replace with a real account
const { transaction, data } = await aptos.setPrimaryName({ sender, name: "test.aptos" });
const primaryName = await aptos.getPrimaryName({ address: sender.accountAddress });
console.log("Primary Name:", primaryName); // Should log: "Primary Name: test.aptos"
}
runExample().catch(console.error);
+
+
+Sets the target address of a domain or subdomain name, pointing it to a specified address for use on-chain. +The target address can be different from the owner of the name.
+The arguments for setting the target address.
+The AccountAddressInput of the address to set the domain or subdomain to.
+A string representing the domain or subdomain name (e.g., "test.aptos").
+Optionaloptions?: InputGenerateTransactionOptionsOptional settings for generating the transaction.
+The account initiating the transaction.
+An object containing the transaction and the InputEntryFunctionData
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Setting the target address for a domain name
const sender = Account.generate(); // replace with a real account
const address = "0x1"; // replace with a real account address
const { transaction, data } = await aptos.setTargetAddress({
sender,
name: "test.aptos",
address,
});
const targetAddress = await aptos.getTargetAddress({ name: "test.aptos" });
console.log(targetAddress); // Should log the address set for "test.aptos"
}
runExample().catch(console.error);
+
+
+A class to query all Account related queries on Aptos.
Creates an instance of the Aptos client with the provided configuration.
+The configuration settings for the Aptos client.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Initialize the Aptos client with testnet configuration
const config = new AptosConfig({ network: Network.TESTNET }); // specify your own network if needed
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+Derives an account by providing a private key. This function resolves the provided private key type and derives the public +key from it.
+If the privateKey is a Secp256k1 type, it derives the account using the derived public key and auth key using the SingleKey +scheme locally. +If the privateKey is an ED25519 type, it looks up the authentication key on chain to determine whether it is a Legacy ED25519 +key or a Unified ED25519 key, and then derives the account based on that.
+The arguments for deriving the account.
+OptionalminimumLedgerVersion?: AnyNumberOptionaloptions?: { throwIfNoAccountFound?: boolean }An account private key.
+The derived Account type.
+import { Aptos, AptosConfig, Network, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Deriving an account from a private key
const account = await aptos.deriveAccountFromPrivateKey({
privateKey: new Ed25519PrivateKey("0x123") // replace with a real private key
});
console.log(account);
}
runExample().catch(console.error);
+
+
+Derives all accounts owned by a signer. This function takes a signer (either an Account or PrivateKey) +and returns all accounts that can be derived from it, ordered by the most recently used account first.
+Note, this function will not return accounts that require more than one signer to be used.
+The arguments for deriving owned accounts
+OptionalminimumLedgerVersion?: AnyNumberThe minimum ledger version to wait for before querying
+Optionaloptions?: { includeUnverified?: boolean; noMultiKey?: boolean }OptionalincludeUnverified?: booleanWhether to include unverified accounts in the results. Unverified accounts +are accounts that can be authenticated with the signer, but there is no history of the signer using the account. +Default is false.
+OptionalnoMultiKey?: booleanIf true, do not include multi-key accounts in the results. Default is false.
+The signer to derive accounts from (Account or PrivateKey)
+Promise resolving to an array of derived Account objects
+import { Aptos, AptosConfig, Network, Ed25519Account } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function getOwnedAccounts() {
const signer = Ed25519Account.generate();
const accounts = await aptos.deriveOwnedAccountsFromSigner({
signer
});
const account = accounts[0];
console.log(account);
}
+
+
+Retrieves the current amount of APT for a specified account. If the account does not exist, it will return 0.
+The arguments for the account query.
+The account address for which to retrieve the APT amount.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+The current amount of APT for the specified account.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the APT amount for a specific account
const accountAPTAmount = await aptos.getAccountAPTAmount({ accountAddress: "0x1" }); // replace with a real account address
console.log("Account APT Amount:", accountAPTAmount);
}
runExample().catch(console.error);
+
+
+Queries the current amount of a specified coin held by an account.
+The parameters for querying the account's coin amount.
+The account address to query for the coin amount.
+OptionalcoinType?: `${string}::${string}::${string}`The coin type to query. Note: If not provided, it may be automatically populated if faMetadataAddress
+is specified.
OptionalfaMetadataAddress?: AccountAddressInputThe fungible asset metadata address to query. Note: If not provided, it may be automatically
+populated if coinType is specified.
The current amount of the specified coin held by the account.
+Use getBalance({ accountAddress, asset }) instead.
+This method is slated for removal in a future release.
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Prefer the new API
const amount = await aptos.getBalance({ accountAddress: "0x1", asset: "0x1::aptos_coin::AptosCoin" });
console.log(`Balance: ${amount}`);
}
runExample().catch(console.error);
+
+
+Retrieves the current count of an account's coins aggregated across all types.
+The parameters for the account coins count query.
+The account address we want to get the total count for.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+The current count of the aggregated coins for the specified account.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Getting the account coins count for a specific account
const accountCoinsCount = await aptos.getAccountCoinsCount({ accountAddress: "0x1" }); // replace with a real account address
console.log("Account Coins Count:", accountCoinsCount);
}
runExample().catch(console.error);
+
+
+Retrieves the coins data for a specified account.
+The account address for which to retrieve the coin's data.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: PaginationArgs & OrderByArg<An array containing the coins data for the specified account.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching coins data for a specific account
const accountCoinsData = await aptos.getAccountCoinsData({
accountAddress: "0x1", // replace with a real account address
options: {
limit: 10, // specify the number of results to return
orderBy: { asset_type: "asc" }, // specify the order of results
},
});
console.log(accountCoinsData);
}
runExample().catch(console.error);
+
+
+Queries for all collections that an account currently has tokens for, including NFTs, fungible tokens, and soulbound tokens. +If you want to filter by a specific token standard, you can pass an optional tokenStandard parameter.
+The account address we want to get the collections for.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: TokenStandardArg & PaginationArgs & OrderByArg<Collections array with the collections data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get account collections with owned tokens for a specific account
const accountCollectionsWithOwnedTokens = await aptos.getAccountCollectionsWithOwnedTokens({
accountAddress: "0x1", // replace with a real account address
options: {
tokenStandard: "NFT", // specify the token standard if needed
limit: 10, // specify the number of results to return
},
});
console.log(accountCollectionsWithOwnedTokens);
}
runExample().catch(console.error);
+
+
+Queries the current state for an Aptos account given its account address.
+The arguments for retrieving account information.
+The Aptos account address to query.
+The account data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve account information for a specific address
const accountInfo = await aptos.getAccountInfo({ accountAddress: "0x1" }); // replace with a real account address
console.log(accountInfo);
}
runExample().catch(console.error);
+
+
+Queries for a specific account module given an account address and module name.
+The Aptos account address.
+The name of the module.
+Optionaloptions?: LedgerVersionArgThe account module associated with the specified account address and module name.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the account module for a specific account address and module name
const module = await aptos.getAccountModule({
accountAddress: "0x1", // replace with a real account address
moduleName: "MyModule" // specify the module name
});
console.log(module);
}
runExample().catch(console.error);
+
+
+Queries for all modules in an account given an account address. +This function may call the API multiple times to auto paginate through results.
+The Aptos account address to query modules for.
+Optionaloptions?: { limit?: number } & LedgerVersionArgimport { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching account modules for a specific account
const accountModules = await aptos.getAccountModules({
accountAddress: "0x1", // replace with a real account address
options: {
limit: 10, // limiting to 10 modules
},
});
console.log(accountModules);
}
runExample().catch(console.error);
+
+
+Queries for a page of modules in an account given an account address.
+The Aptos account address to query modules for.
+Optionaloptions?: CursorPaginationArgs & LedgerVersionArgimport { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching account modules for a specific account
const {modules, cursor} = await aptos.getAccountModulesPage({
accountAddress: "0x1", // replace with a real account address
options: {
cursor: undefined, // starting from the first module
limit: 10, // limiting to 10 modules
},
});
console.log(modules);
console.log(`More to fetch: ${cursor !== undefined}`);
}
runExample().catch(console.error);
+
+
+Queries an account's owned objects.
+The account address we want to get the objects for.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: PaginationArgs & OrderByArg<Objects array with the object data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the objects owned by the specified account
const accountOwnedObjects = await aptos.getAccountOwnedObjects({
accountAddress: "0x1", // replace with a real account address
minimumLedgerVersion: 1, // optional, specify if needed
options: {
offset: 0, // optional, specify if needed
limit: 10, // optional, specify if needed
orderBy: "created_at", // optional, specify if needed
},
});
console.log(accountOwnedObjects);
}
runExample().catch(console.error);
+
+
+Queries the tokens currently owned by a specified account, including NFTs and fungible tokens. +If desired, you can filter the results by a specific token standard.
+The account address for which to retrieve owned tokens.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: TokenStandardArg & PaginationArgs & OrderByArg<An array of tokens with their respective data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the tokens owned by a specific account
const accountOwnedTokens = await aptos.getAccountOwnedTokens({
accountAddress: "0x1", // replace with a real account address
options: {
limit: 10, // specify how many tokens to return
orderBy: "created_at", // specify the order of the results
},
});
console.log(accountOwnedTokens);
}
runExample().catch(console.error);
+
+
+Queries all current tokens of a specific collection that an account owns by the collection address. +This query returns all tokens (v1 and v2 standards) an account owns, including NFTs, fungible, soulbound, etc. +If you want to get only the token from a specific standard, you can pass an optional tokenStandard parameter.
+The account address we want to get the tokens for.
+The address of the collection being queried.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to, before querying.
+Optionaloptions?: TokenStandardArg & PaginationArgs & OrderByArg<Tokens array with the token data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get tokens owned by a specific account in a specific collection
const accountOwnedTokens = await aptos.getAccountOwnedTokensFromCollectionAddress({
accountAddress: "0x1", // replace with a real account address
collectionAddress: "0x2", // replace with a real collection address
});
console.log(accountOwnedTokens);
}
runExample().catch(console.error);
+
+
+Queries a specific account resource given an account address and resource type.
+The typed output of the resource.
+The Aptos account address to query.
+Optionaloptions?: LedgerVersionArgThe string representation of an on-chain Move struct type, e.g., "0x1::aptos_coin::AptosCoin".
+The account resource of the specified type.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the account resource for a specific account address and resource type
const resource = await aptos.getAccountResource({
accountAddress: "0x1", // replace with a real account address
resourceType: "0x1::aptos_coin::AptosCoin"
});
console.log(resource);
}
runExample().catch(console.error);
+
+
+Queries all account resources given an account address. +This function may call the API multiple times to auto paginate through results.
+The Aptos account address to query resources for.
+Optionaloptions?: PaginationArgs & LedgerVersionArgAccount resources.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching account resources for a specific account address
const resources = await aptos.getAccountResources({ accountAddress: "0x1" }); // replace with a real account address
console.log(resources);
}
runExample().catch(console.error);
+
+
+Queries a page of account resources given an account address.
+The Aptos account address to query resources for.
+Optionaloptions?: CursorPaginationArgs & LedgerVersionArgAccount resources.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching account resources for a specific account address
const resources = await aptos.getAccountResourcesPage({
accountAddress: "0x1", // replace with a real account address
options: {
cursor: undefined, // starting from the first resource
limit: 10, // limiting to 10 resources
},
});
console.log(resources);
console.log(`More to fetch: ${resources.cursor !== undefined}`);
}
runExample().catch(console.error);
+
+
+Gets all account info (address, account public key, last transaction version) that have are associated with a public key and related public keys
+For a given public key, it will query all multikeys that the public key is part of. Then for the provided public key and +any multikeys found in the previous step, it will query for any accounts that have an auth key that matches any of the +public keys.
+Note: If an Ed25519PublicKey or an AnyPublicKey that wraps Ed25519PublicKey is passed in, it will query for both legacy and single singer cases.
+The arguments for getting accounts for a public key
+OptionalminimumLedgerVersion?: AnyNumberThe minimum ledger version to wait for before querying
+Optionaloptions?: { includeUnverified?: boolean; noMultiKey?: boolean }OptionalincludeUnverified?: booleanWhether to include unverified accounts in the results. Unverified accounts +are accounts that can be authenticated with the signer, but there is no history of the signer using the account. Default +is false.
+OptionalnoMultiKey?: booleanWhether to exclude multi-key accounts in the results. Default is false.
+The public key to look up accounts for
+Promise resolving to an array of account addresses and their associated public keys
+import { Aptos, AptosConfig, Network, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function getAccounts() {
const privateKey = Ed25519PrivateKey.generate();
const publicKey = privateKey.publicKey();
const accounts = await aptos.getAccountsForPublicKey({
publicKey
});
console.log(accounts);
}
+
+
+Queries the current count of tokens owned by a specified account.
+The parameters for the query.
+The account address to query the token count for.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+The current count of tokens owned by the account.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the count of tokens owned by the account
const tokensCount = await aptos.getAccountTokensCount({ accountAddress: "0x1" }); // replace with a real account address
console.log(`Tokens Count: ${tokensCount}`);
}
runExample().catch(console.error);
+
+
+Queries account transactions given an account address. +This function may call the API multiple times to auto paginate and retrieve all account transactions.
+The Aptos account address to query transactions for.
+Optionaloptions?: PaginationArgsOptional pagination arguments.
+The account transactions.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetch transactions for a specific account
const transactions = await aptos.getAccountTransactions({
accountAddress: "0x1", // replace with a real account address
options: {
offset: 0, // starting from the first transaction
limit: 10, // limiting to 10 transactions
},
});
console.log(transactions);
}
runExample().catch(console.error);
+
+
+Queries the current count of transactions submitted by an account.
+The parameters for the query.
+The account address we want to get the total count for.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Current count of transactions made by an account.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the count of transactions for a specific account
const accountTransactionsCount = await aptos.getAccountTransactionsCount({
accountAddress: "0x1", // replace with a real account address
minimumLedgerVersion: 1, // specify your own minimum ledger version if needed
});
console.log(accountTransactionsCount);
}
runExample().catch(console.error);
+
+
+Retrieves the balance for an account and asset.
+The parameters for the balance query.
+The account address to query.
+The asset to query: Move struct ID (e.g., 0x1::aptos_coin::AptosCoin) or FA metadata address.
The balance as a number.
+Looks up the account address for a given authentication key, handling both rotated and non-rotated keys.
+The authentication key for which to look up the account address.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: LedgerVersionArgPromise
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Look up the original account address for a given authentication key
const accountAddress = await aptos.lookupOriginalAccountAddress({
authenticationKey: "0x1", // replace with a real authentication key
});
console.log("Original Account Address:", accountAddress);
}
runExample().catch(console.error);
+
+
+Adds a dispatchable authentication function to the account.
+The account to add the authentication function to.
+The authentication function info to add.
+Optionaloptions?: InputGenerateTransactionOptionsThe options for the transaction.
+A transaction to add the authentication function to the account.
+const txn = await aptos.abstraction.addAuthenticationFunctionTransaction({
accountAddress: alice.accountAddress,
authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,
});
const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction});
await aptos.waitForTransaction({ transactionHash: txn.hash });
+
+
+Creates a transaction to disable account abstraction. If an authentication function is provided, it will specify to +remove the authentication function.
+The account to disable account abstraction for.
+OptionalauthenticationFunction?: stringThe authentication function info to remove.
+Optionaloptions?: InputGenerateTransactionOptionsThe options for the transaction.
+A transaction to disable account abstraction for the account.
+const txn = await aptos.abstraction.disableAccountAbstractionTransaction({
accountAddress: alice.accountAddress,
authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,
});
const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });
await aptos.waitForTransaction({ transactionHash: txn.hash });
+
+
+Gets the dispatchable authentication function for the account.
+The account to get the dispatchable authentication function for.
+The dispatchable authentication function for the account.
+const functionInfos = await aptos.abstraction.getAuthenticationFunction({
accountAddress: alice.accountAddress,
});
if (functionInfos) {
console.log(`Account ${alice.accountAddress.toString()} is using account abstraction!`);
} else {
console.log(`Account ${alice.accountAddress.toString()} is not using account abstraction.`);
}
+
+
+Will return true if the account is abstracted, otherwise false.
+The account to check.
+Whether the account is abstracted.
+const isAccountAbstractionEnabled = await aptos.abstraction.isAccountAbstractionEnabled({
accountAddress: alice.accountAddress,
authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,
});
if (isAccountAbstractionEnabled) {
console.log(`Account ${alice.accountAddress.toString()} is using account abstraction!`);
} else {
console.log(`Account ${alice.accountAddress.toString()} is not using account abstraction.`);
}
+
+
+Removes a dispatchable authentication function from the account.
+The account to remove the authentication function from.
+The authentication function info to remove.
+Optionaloptions?: InputGenerateTransactionOptionsThe options for the transaction.
+A transaction to remove the authentication function from the account.
+const txn = await aptos.abstraction.removeAuthenticationFunctionTransaction({
accountAddress: alice.accountAddress,
authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,
});
const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });
await aptos.waitForTransaction({ transactionHash: txn.hash });
+
+
+Removes a dispatchable authenticator from the account.
+The account to remove the authenticator from.
+Optionaloptions?: InputGenerateTransactionOptionsThe options for the transaction.
+A transaction to remove the authenticator from the account.
+ReadonlyconfigCreates a transaction to enable account abstraction with the given authentication function.
+Adds a dispatchable authentication function to the account.
+The account to add the authentication function to.
+The authentication function info to add.
+Optionaloptions?: InputGenerateTransactionOptionsThe options for the transaction.
+A transaction to add the authentication function to the account.
+const txn = await aptos.abstraction.addAuthenticationFunctionTransaction({
accountAddress: alice.accountAddress,
authenticationFunction: `${alice.accountAddress}::any_authenticator::authenticate`,
});
const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction});
await aptos.waitForTransaction({ transactionHash: txn.hash });
+
+
+const txn = await aptos.abstraction.enableAccountAbstractionTransaction({
accountAddress: alice.accountAddress,
authenticationFunction: `{alice.accountAddress}::any_authenticator::authenticate`,
});
const txn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });
await aptos.waitForTransaction({ transactionHash: txn.hash });
+
+
+A class to query all Object related queries on Aptos.
Creates an instance of the Aptos client with the provided configuration. +This allows interaction with the Aptos blockchain using the specified settings.
+The configuration settings for the Aptos client.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a configuration for the Aptos client
const config = new AptosConfig({
network: Network.TESTNET, // Specify the desired network
nodeUrl: "https://testnet.aptos.dev", // Replace with your node URL
});
// Create an instance of the Aptos client
const aptos = new Aptos(config);
console.log("Aptos client created successfully", aptos);
}
runExample().catch(console.error);
+
+
+Fetches the object data based on the specified object address.
+OptionalminimumLedgerVersion?: AnyNumberOptional minimum ledger version to wait for.
+The object address to retrieve data for.
+Optionaloptions?: PaginationArgs & OrderByArg<Optional configuration options for pagination and ordering.
+The object data corresponding to the provided address.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching object data by object address
const objectData = await aptos.getObjectDataByObjectAddress({
objectAddress: "0x1", // replace with a real object address
});
console.log(objectData);
}
runExample().catch(console.error);
+
+
+Cancels all pending promises in the queue and rejects them with an AsyncQueueCancelledError. +This ensures that any awaiting code can handle the cancellation appropriately.
+Dequeues the next item from the queue and returns a promise that resolves to it. +If the queue is empty, it creates a new promise that will be resolved when an item is enqueued.
+Promise
Adds an item to the queue. If there are pending dequeued promises, it resolves the oldest promise with the enqueued item +immediately; otherwise, it adds the item to the queue.
+The item to be added to the queue.
+Determine whether the queue has been cancelled.
+boolean - Returns true if the queue is cancelled, otherwise false.
+Determine whether the queue is empty.
+boolean - Returns true if the queue has no elements, otherwise false.
+Retrieve the length of the pending dequeue.
+number - The number of items currently in the pending dequeue.
+Represents an error that occurs when an asynchronous queue operation is cancelled. +This error extends the built-in Error class to provide additional context for cancellation events.
+Optionalmessage: stringOptionalmessage: stringOptionaloptions: ErrorOptionsStaticcaptureCreates a .stack property on targetObject, which when accessed returns
+a string representing the location in the code at which
+Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
+
+
+The first line of the trace will be prefixed with
+${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
+above constructorOpt, including constructorOpt, will be omitted from the
+generated stack trace.
The constructorOpt argument is useful for hiding implementation
+details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
+
+
+OptionalconstructorOpt: FunctionStaticprepareOptionalcauseOptionalstackStaticstackThe Error.stackTraceLimit property specifies the number of stack frames
+collected by a stack trace (whether generated by new Error().stack or
+Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
+will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.
+A class to handle all Build transaction operations.
Initializes a new instance of the Aptos client with the specified configuration. +This allows you to interact with the Aptos blockchain using the provided settings.
+The configuration settings for the Aptos client.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a configuration for the Aptos client
const config = new AptosConfig({
network: Network.TESTNET, // specify the network
nodeUrl: "https://testnet.aptos.dev", // specify the node URL
});
// Initialize the Aptos client
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+Build a multi-agent transaction that allows multiple signers to authorize a transaction.
+The parameters for creating the multi-agent transaction.
+The transaction data.
+Optionaloptions?: InputGenerateTransactionOptionsOptional transaction configurations.
+An array of the secondary signers' account addresses.
+The sender account address.
+OptionalwithFeePayer?: booleanWhether there is a fee payer for the transaction.
+MultiAgentTransaction
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Build a multi-agent transaction
const transaction = await aptos.multiAgent({
sender: "0x1", // replace with a real sender account address
data: {
// Transaction data structure
function: "0x1::aptos_account::transfer",
functionArguments: ["0x2", 100], // replace with a real destination account address and amount
},
secondarySignerAddresses: ["0x3", "0x4"], // replace with real secondary signer addresses
options: {
// Optional transaction configurations
maxGasAmount: "1000",
gasUnitPrice: "1",
},
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Build a simple transaction.
+This function allows you to create a transaction with specified sender and data.
+The transaction data.
+Optionaloptions?: InputGenerateTransactionOptionsOptional transaction configurations.
+The sender account address.
+OptionalwithFeePayer?: booleanWhether there is a fee payer for the transaction.
+SimpleTransaction
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Build a simple transaction
const transaction = await aptos.transaction.simple({
sender: "0x1", // replace with a real sender account address
data: {
function: "0x1::aptos_account::transfer",
functionArguments: ["0x2", 100], // replace with a real destination account address
},
options: {
gasUnitPrice: 100, // specify your own gas unit price if needed
maxGasAmount: 1000, // specify your own max gas amount if needed
},
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+A class to handle all Coin operations.
Initializes a new instance of the Aptos client with the specified configuration. +This allows you to interact with the Aptos blockchain using the provided settings.
+The configuration settings for the Aptos client.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a new Aptos client with testnet configuration
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+Generate a transfer coin transaction that can be simulated, signed, and submitted. +This function helps you create a transaction to transfer a specified amount of coins +from one account to another within the Aptos network.
+The arguments for the transfer transaction.
+The amount of coins to transfer.
+OptionalcoinType?: `${string}::${string}::${string}`Optional. The coin struct type to transfer. Defaults to 0x1::aptos_coin::AptosCoin.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+The recipient account address.
+The sender account address.
+SimpleTransaction
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Generate a transfer coin transaction
const transaction = await aptos.transferCoinTransaction({
sender: "0x1", // replace with a real sender account address
recipient: "0x2", // replace with a real recipient account address
amount: 10,
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+A class to query all DigitalAsset related queries on Aptos.
Initializes a new instance of the Aptos client with the specified configuration. +This allows you to interact with the Aptos blockchain using the provided settings.
+The configuration settings for the Aptos client.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a configuration for the Aptos client
const config = new AptosConfig({ network: Network.TESTNET }); // Specify your desired network
// Initialize the Aptos client with the configuration
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+Add a digital asset property to the blockchain. +This function allows you to specify a new property for a digital asset, including its key, type, and value.
+The arguments for adding a digital asset property.
+The account that mints the digital asset.
+The digital asset address.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`(Optional) The type of the digital asset.
+Optionaloptions?: InputGenerateTransactionOptions(Optional) Options for generating the transaction.
+The property key for storing on-chain properties.
+The type of property value.
+The property value to be stored on-chain.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Add a digital asset property
const transaction = await aptos.addDigitalAssetPropertyTransaction({
creator: Account.generate(), // Replace with a real account
propertyKey: "newKey",
propertyType: "BOOLEAN",
propertyValue: true,
digitalAssetAddress: "0x123", // Replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Add a typed digital asset property to the blockchain. +This function allows you to define and store a specific property for a digital asset, enabling better categorization and +management of digital assets.
+The parameters for adding the typed property.
+The account that mints the digital asset.
+The digital asset address.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`The optional type of the digital asset.
+Optionaloptions?: InputGenerateTransactionOptionsOptional transaction generation options.
+The property key for storing on-chain properties.
+The type of property value.
+The property value to be stored on-chain.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Adding a typed digital asset property
const transaction = await aptos.addDigitalAssetTypedPropertyTransaction({
creator: Account.generate(), // replace with a real account
propertyKey: "typedKey",
propertyType: "STRING",
propertyValue: "hello",
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Burn a digital asset by its creator, allowing for the removal of a specified digital asset from the blockchain.
+The arguments for burning the digital asset.
+The creator account that is burning the digital asset.
+The address of the digital asset to be burned.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset being burned.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network, Account } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const creator = Account.generate(); // Replace with a real creator account
const transaction = await aptos.burnDigitalAssetTransaction({
creator: creator,
digitalAssetAddress: "0x123", // Replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Creates a new collection within the specified account.
+The account of the collection's creator.
+The description of the collection.
+The name of the collection.
+Optionaloptions?: InputGenerateTransactionOptionsOptional parameters for generating the transaction.
+The parameters below are optional:
+The URI to additional info about the collection.
+Options for creating a collection, allowing customization of various attributes such as supply limits, mutability of metadata, +and royalty settings.
+OptionalmaxSupply?: AnyNumberOptionalmutableDescription?: booleanOptionalmutableRoyalty?: booleanOptionalmutableTokenDescription?: booleanOptionalmutableTokenName?: booleanOptionalmutableTokenProperties?: booleanOptionalmutableTokenURI?: booleanOptionalmutableURI?: booleanOptionalroyaltyDenominator?: numberOptionalroyaltyNumerator?: numberOptionaltokensBurnableByCreator?: booleanOptionaltokensFreezableByCreator?: booleanA SimpleTransaction that when submitted will create the collection.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Creating a new collection transaction
const transaction = await aptos.createCollectionTransaction({
creator: Account.generate(), // Replace with a real account
description: "A unique collection of digital assets.",
name: "My Digital Collection",
uri: "https://mycollection.com",
});
console.log("Transaction created:", transaction);
}
runExample().catch(console.error);
+
+
+Freeze the ability to transfer a specified digital asset. +This function allows the creator to restrict the transfer capability of a digital asset.
+The arguments for freezing the digital asset transfer.
+The creator account initiating the freeze.
+The address of the digital asset to be frozen.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset being frozen.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Freeze the digital asset transfer
const transaction = await aptos.freezeDigitalAssetTransaferTransaction({
creator: Account.generate(), // Replace with a real account if needed
digitalAssetAddress: "0x123", // Replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Queries data of a specific collection by the collection creator address and the collection name.
+This function is deprecated; use getCollectionDataByCreatorAddressAndCollectionName instead.
If a creator account has two collections with the same name in v1 and v2, you can pass an optional tokenStandard parameter
+to query a specific standard.
The arguments for querying the collection data.
+The name of the collection.
+The address of the collection's creator.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: TokenStandardArgOptional parameters for the query.
+GetCollectionDataResponse - The response type containing the collection data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Querying collection data by creator address and collection name
const collection = await aptos.getCollectionData({
creatorAddress: "0x1", // replace with a real creator address
collectionName: "myCollection", // specify your collection name
});
console.log(collection);
}
runExample().catch(console.error);
+
+
+Queries data of a specific collection by the collection ID.
+The ID of the collection, which is the same as the address of the collection object.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: TokenStandardArg & PaginationArgsOptional parameters for token standard and pagination.
+GetCollectionDataResponse - The response type containing the collection data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching collection data by collection ID
const collection = await aptos.getCollectionDataByCollectionId({
collectionId: "0x123", // replace with a real collection ID
});
console.log(collection);
}
runExample().catch(console.error);
+
+
+Retrieves data for a specific collection created by a given creator address. +This function allows you to query collection data while optionally specifying a minimum ledger version and pagination options.
+The address of the collection's creator.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: TokenStandardArg & PaginationArgsGetCollectionDataResponse - The response type containing collection data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve collection data by creator address
const collectionData = await aptos.getCollectionDataByCreatorAddress({
creatorAddress: "0x1", // replace with a real creator address
minimumLedgerVersion: 1, // specify the minimum ledger version if needed
options: {
tokenStandard: "v2", // specify the token standard if needed
pagination: { limit: 10, offset: 0 } // specify pagination options if needed
}
});
console.log(collectionData);
}
runExample().catch(console.error);
+
+
+Queries data of a specific collection by the collection creator address and the collection name.
+If a creator account has multiple collections with the same name across different versions,
+specify the tokenStandard parameter to query a specific standard.
The name of the collection.
+The address of the collection's creator.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: TokenStandardArg & PaginationArgsGetCollectionDataResponse - The response type containing collection data.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching collection data by creator address and collection name
const collection = await aptos.getCollectionDataByCreatorAddressAndCollectionName({
creatorAddress: "0x1", // replace with a real creator address
collectionName: "myCollection",
minimumLedgerVersion: 1, // optional, specify if needed
options: { tokenStandard: "v2" } // optional, specify if needed
});
console.log(collection);
}
runExample().catch(console.error);
+
+
+Queries the ID of a specified collection. +This ID corresponds to the collection's object address in V2, while V1 does not utilize objects and lacks an address.
+The name of the collection.
+The address of the collection's creator.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: TokenStandardArgThe collection ID.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching the collection ID for a specific creator and collection name
const collectionId = await aptos.getCollectionId({
creatorAddress: "0x1", // replace with a real creator address
collectionName: "myCollection"
});
console.log("Collection ID:", collectionId);
}
runExample().catch(console.error);
+
+
+Retrieves the current ownership data of a specified digital asset using its address.
+The parameters for the request.
+The address of the digital asset.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+GetCurrentTokenOwnershipResponse containing relevant ownership data of the digital asset.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Getting the current ownership of a digital asset
const digitalAssetOwner = await aptos.getCurrentDigitalAssetOwnership({
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(digitalAssetOwner);
}
runExample().catch(console.error);
+
+
+Retrieves the activity data for a specified digital asset using its address.
+The parameters for the request.
+The address of the digital asset.
+OptionalminimumLedgerVersion?: AnyNumberOptional minimum ledger version to sync up to before querying.
+Optionaloptions?: PaginationArgs & OrderByArg<Optional pagination and ordering parameters.
+A promise that resolves to the activity data related to the digital asset.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the activity data for a digital asset
const digitalAssetActivity = await aptos.getDigitalAssetActivity({
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(digitalAssetActivity);
}
runExample().catch(console.error);
+
+
+Retrieves digital asset data using the address of a digital asset.
+The parameters for the request.
+The address of the digital asset.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+GetTokenDataResponse containing relevant data for the digital asset.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching digital asset data for a specific address
const digitalAsset = await aptos.getDigitalAssetData({
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(digitalAsset);
}
runExample().catch(console.error);
+
+
+Retrieves the digital assets owned by a specified address.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: PaginationArgs & OrderByArg<Optional pagination and ordering parameters for the response.
+The address of the owner.
+GetOwnedTokensResponse containing ownership data of the digital assets belonging to the ownerAddress.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching the digital assets owned by the specified address
const digitalAssets = await aptos.getOwnedDigitalAssets({
ownerAddress: "0x1", // replace with a real account address
});
console.log(digitalAssets);
}
runExample().catch(console.error);
+
+
+Create a transaction to mint a digital asset into the creator's account within an existing collection. +This function helps you generate a transaction that can be simulated or submitted to the blockchain for minting a digital asset.
+The name of the collection the digital asset belongs to.
+The creator of the collection.
+The description of the digital asset.
+The name of the digital asset.
+Optionaloptions?: InputGenerateTransactionOptionsOptional transaction generation options.
+OptionalpropertyKeys?: string[]Optional array of property keys for the digital asset.
+OptionalpropertyTypes?: (Optional array of property types for the digital asset.
+OptionalpropertyValues?: PropertyValue[]Optional array of property values for the digital asset.
+The URI to additional info about the digital asset.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Creating a transaction to mint a digital asset
const transaction = await aptos.mintDigitalAssetTransaction({
creator: Account.generate(), // replace with a real account
collection: "MyCollection",
description: "This is a digital asset.",
name: "MyDigitalAsset",
uri: "https://example.com/my-digital-asset",
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Mint a soul bound digital asset into a recipient's account. +This function allows you to create a unique digital asset that is bound to a specific account.
+The arguments for minting the soul bound transaction.
+The account that mints the digital asset.
+The collection name that the digital asset belongs to.
+The digital asset description.
+The digital asset name.
+Optionaloptions?: InputGenerateTransactionOptionsAdditional options for generating the transaction.
+OptionalpropertyKeys?: string[]The property keys for storing on-chain properties.
+OptionalpropertyTypes?: (The type of property values.
+OptionalpropertyValues?: PropertyValue[]The property values to be stored on-chain.
+The account address where the digital asset will be created.
+The digital asset URL.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Mint a soul bound digital asset
const transaction = await aptos.mintSoulBoundTransaction({
account: Account.generate(), // Replace with a real account
collection: "collectionName",
description: "collectionDescription",
name: "digitalAssetName",
uri: "digital-asset-uri.com",
recipient: "0x123" // Replace with a real recipient account address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Remove a digital asset property from the blockchain. +This function allows you to delete an existing property associated with a digital asset.
+The parameters required to remove the digital asset property.
+The account that mints the digital asset.
+The digital asset address.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+The property key for storing on-chain properties.
+The type of property value.
+The property value to be stored on-chain.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Remove a digital asset property
const transaction = await aptos.removeDigitalAssetPropertyTransaction({
creator: Account.generate(), // replace with a real account
propertyKey: "newKey",
propertyType: "BOOLEAN",
propertyValue: true,
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Set the digital asset description to provide additional context or information about the asset.
+The parameters for setting the digital asset description.
+The creator account responsible for the digital asset.
+The digital asset description to be set.
+The address of the digital asset.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Set the digital asset description
const transaction = await aptos.setDigitalAssetDescriptionTransaction({
creator: Account.generate(), // replace with a real account
description: "This is a digital asset description.",
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Set the digital asset name, allowing you to define a name for a specific digital asset on the blockchain.
+The parameters for setting the digital asset name.
+The creator account responsible for the transaction.
+The address of the digital asset.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset, represented as a Move struct ID.
+The desired name for the digital asset.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+A SimpleTransaction that can be simulated or submitted to the blockchain.
+import { Aptos, AptosConfig, Network, Account } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const creator = Account.generate(); // Generate a new account for the creator
const digitalAssetAddress = "0x123"; // replace with a real digital asset address
// Set the digital asset name
const transaction = await aptos.setDigitalAssetNameTransaction({
creator: creator,
name: "digitalAssetName",
digitalAssetAddress: digitalAssetAddress,
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Set the URI for a digital asset, allowing you to associate a unique identifier with the asset.
+The parameters for the transaction.
+The creator account initiating the transaction.
+The address of the digital asset.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+The digital asset URI to be set.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Set the URI for a digital asset
const transaction = await aptos.setDigitalAssetURITransaction({
creator: Account.generate(), // Replace with a real creator account
uri: "digital-asset-uri.com",
digitalAssetAddress: "0x123", // Replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Transfer ownership of a non-fungible digital asset. +This function allows you to transfer a digital asset only if it is not frozen, meaning the ownership transfer is not disabled.
+The arguments for transferring the digital asset.
+The address of the digital asset being transferred.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset, defaults to "0x4::token::Token".
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+The account address of the recipient.
+The sender account of the current digital asset owner.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Transfer a digital asset
const transaction = await aptos.transferDigitalAssetTransaction({
sender: Account.generate(), // replace with a real sender account
digitalAssetAddress: "0x123", // replace with a real digital asset address
recipient: "0x456", // replace with a real recipient account address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Unfreeze the ability to transfer a digital asset. +This function allows the specified creator account to unfreeze the transfer of a digital asset identified by its address.
+The parameters for unfreezing the digital asset transfer.
+The creator account that is unfreezing the digital asset transfer.
+The address of the digital asset to unfreeze.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset being unfrozen.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Unfreeze the ability to transfer a digital asset
const transaction = await aptos.unfreezeDigitalAssetTransaferTransaction({
creator: Account.generate(), // replace with a real creator account
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Update a digital asset property on-chain.
+The parameters for updating the digital asset property.
+The account that mints the digital asset.
+The address of the digital asset.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`Optional. The type of the digital asset.
+Optionaloptions?: InputGenerateTransactionOptionsOptional. Additional options for generating the transaction.
+The property key for storing on-chain properties.
+The type of property value.
+The property value to be stored on-chain.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Update a digital asset property
const transaction = await aptos.updateDigitalAssetPropertyTransaction({
creator: Account.generate(), // replace with a real account
propertyKey: "newKey",
propertyType: "BOOLEAN",
propertyValue: false,
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Update a typed digital asset property on-chain. +This function allows you to modify the properties of a digital asset, enabling dynamic updates to its attributes.
+The arguments for updating the digital asset property.
+The account that mints the digital asset.
+The digital asset address.
+OptionaldigitalAssetType?: `${string}::${string}::${string}`(Optional) The type of the digital asset.
+Optionaloptions?: InputGenerateTransactionOptions(Optional) Additional options for generating the transaction.
+The property key for storing on-chain properties.
+The type of property value.
+The property value to be stored on-chain.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Update a typed digital asset property
const transaction = await aptos.updateDigitalAssetTypedPropertyTransaction({
creator: Account.generate(), // replace with a real account
propertyKey: "typedKey",
propertyType: "U8",
propertyValue: 2,
digitalAssetAddress: "0x123", // replace with a real digital asset address
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Minimal EventEmitter interface that is molded against the Node.js
+EventEmitter interface.
Optionalcontext: ContextCalls each of the listeners registered for a given event.
+Return an array listing the events for which the emitter has registered +listeners.
+Return the number of listeners listening to a given event.
+Return the listeners registered for a given event.
+Optionalfn: EventListener<EventTypes, T>Optionalcontext: ContextOptionalonce: booleanAdd a listener for a given event.
+Optionalcontext: ContextAdd a one-time listener for a given event.
+Optionalcontext: ContextRemove all listeners, or those of the specified event.
+Optionalevent: EventNames<EventTypes>Remove the listeners of a given event.
+Optionalfn: EventListener<EventTypes, T>Optionalcontext: ContextOptionalonce: booleanA class to query all Faucet related queries on Aptos.
Initializes a new instance of the Aptos client with the specified configuration.
+Note that only devnet has a publicly accessible faucet. For testnet, you must use +the minting page at https://aptos.dev/network/faucet.
+The configuration settings for the Aptos client.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a configuration for the Aptos client
const config = new AptosConfig({ network: Network.DEVNET }); // specify your own network if needed
// Initialize the Aptos client with the configuration
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+This function creates an account if it does not exist and mints the specified amount of coins into that account.
+Note that only devnet has a publicly accessible faucet. For testnet, you must use +the minting page at https://aptos.dev/network/faucet.
+The arguments for funding the account.
+The address of the account to fund.
+The amount of tokens to fund the account with.
+Optionaloptions?: WaitForTransactionOptionsConfiguration options for waiting for the transaction.
+Transaction hash of the transaction that funded the account.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.DEVNET });
const aptos = new Aptos(config);
async function runExample() {
// Fund an account with a specified amount of tokens
const transaction = await aptos.fundAccount({
accountAddress: "0x1", // replace with your account address
amount: 100,
});
console.log("Transaction hash:", transaction.hash);
}
runExample().catch(console.error);
+
+
+A class for querying and managing fungible asset-related operations on the Aptos blockchain.
+Initializes a new instance of the Aptos class with the provided configuration. +This allows you to interact with the Aptos blockchain using the specified network settings.
+The configuration settings for connecting to the Aptos network.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a configuration for the Aptos client
const config = new AptosConfig({ network: Network.TESTNET }); // Specify your own network if needed
// Initialize the Aptos client with the configuration
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+Queries all fungible asset balances.
+Optionalargs: {Optional parameters for the query.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to, before querying.
+Optionaloptions?: PaginationArgs & WhereArg<CurrentFungibleAssetBalancesBoolExp>Optional configuration for pagination and filtering.
+A list of fungible asset metadata.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching current fungible asset balances
const fungibleAssetBalances = await aptos.getCurrentFungibleAssetBalances();
console.log(fungibleAssetBalances);
}
runExample().catch(console.error);
+
+
+Queries all fungible asset activities and returns a list of their metadata.
+Optionalargs: {Optional parameters for the query.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to, before querying.
+Optionaloptions?: PaginationArgs & WhereArg<FungibleAssetActivitiesBoolExp>Optional configuration for pagination and filtering.
+A list of fungible asset metadata.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching fungible asset activities
const fungibleAssetActivities = await aptos.getFungibleAssetActivities();
console.log(fungibleAssetActivities);
}
runExample().catch(console.error);
+
+
+Queries all fungible asset metadata.
+Optionalargs: {Optional parameters for the query.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: PaginationArgs & WhereArg<FungibleAssetMetadataBoolExp>Optional configuration for pagination and filtering.
+A list of fungible asset metadata.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching fungible asset metadata
const fungibleAssets = await aptos.getFungibleAssetMetadata();
console.log(fungibleAssets);
}
runExample().catch(console.error);
+
+
+Queries the fungible asset metadata for a specific asset type. +This function helps retrieve detailed information about a fungible asset based on its type.
+A fungible asset metadata item.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve fungible asset metadata by asset type
const fungibleAsset = await aptos.getFungibleAssetMetadataByAssetType({
assetType: "0x1::aptos_coin::AptosCoin" // replace with your asset type
});
console.log(fungibleAsset);
}
runExample().catch(console.error);
+
+
+Retrieves fungible asset metadata based on the creator address.
+This function allows you to query metadata for a specific fungible asset created by a given address.
+The parameters for the query.
+The creator address of the fungible asset.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+A fungible asset metadata item.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve fungible asset metadata by creator address
const fungibleAsset = await aptos.getFungibleAssetMetadataByCreatorAddress({
creatorAddress: "0x123", // replace with a real creator address
});
console.log(fungibleAsset);
}
runExample().catch(console.error);
+
+
+Transfer a specified amount of fungible asset from the sender's primary store to the recipient's primary store. +This method allows you to transfer any fungible asset, including fungible tokens.
+The arguments for the transfer operation.
+The number of assets to transfer.
+The fungible asset account address. For example, if you're transferring USDT, +this would be the USDT address.
+Optionaloptions?: InputGenerateTransactionOptionsOptional parameters for generating the transaction.
+The recipient account address.
+The sender account.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Transfer fungible asset from sender to recipient
const transaction = await aptos.transferFungibleAsset({
sender: Account.generate(), // replace with a real sender account
fungibleAssetMetadataAddress: "0x123", // replace with a real fungible asset address
recipient: "0x456", // replace with a real recipient account
amount: 5
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Transfer a specified amount of fungible asset from the sender's any (primary or secondary) fungible store to any (primary or secondary) fungible store. +This method allows you to transfer any fungible asset, including fungible tokens.
+The arguments for the transfer operation.
+The number of assets to transfer. Must be a positive number.
+The fungible store address initiating the transfer.
+Optionaloptions?: InputGenerateTransactionOptionsOptional parameters for generating the transaction.
+The sender account initiating the transfer.
+The fungible store address receiving the asset.
+A SimpleTransaction that can be simulated or submitted to the chain.
+Error if:
+import { Aptos, AptosConfig, Network, Account } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function transferAssets() {
// Transfer 100 units of the asset from senderStore to recipientStore
const transaction = await aptos.transferFungibleAssetBetweenStores({
sender: Account.generate(), // replace with a real sender account
fromStore: "0x123", // replace with a real fungible store address
toStore: "0x456", // replace with a real fungible store address
amount: 100
});
console.log(transaction);
}
transferAssets().catch(console.error);
+
+
+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.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a 64-byte G2 element in a cryptographic context. +This class provides methods for serialization and deserialization of G2 bytes.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeA class to query various Aptos-related information and perform operations on the Aptos blockchain.
+Initializes a new instance of the Aptos client with the specified configuration. +This allows users to interact with the Aptos blockchain using the provided settings.
+The configuration settings for the Aptos client.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a configuration for the Aptos client
const config = new AptosConfig({
network: Network.TESTNET, // specify the network
nodeUrl: "https://testnet.aptos.dev" // specify the node URL
});
// Initialize the Aptos client with the configuration
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+Retrieve a block by its height, allowing for the inclusion of transactions if specified.
+The parameters for the block retrieval.
+The block height to look up, starting at 0.
+Optionaloptions?: { withTransactions?: boolean }Optional settings for the retrieval.
+OptionalwithTransactions?: booleanIf set to true, includes all transactions in the block.
+The block with optional transactions included.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve the block at height 5, including transactions
const block = await aptos.getBlockByHeight({ blockHeight: 5, options: { withTransactions: true } });
console.log(block);
}
runExample().catch(console.error);
+
+
+Retrieves block information by the specified ledger version.
+The arguments for retrieving the block.
+The ledger version to lookup block information for.
+Optionaloptions?: { withTransactions?: boolean }Optional parameters for the request.
+OptionalwithTransactions?: booleanIf set to true, include all transactions in the block.
+Block information with optional transactions.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve block information for a specific ledger version
const block = await aptos.getBlockByVersion({ ledgerVersion: 5 });
console.log(block);
}
runExample().catch(console.error);
+
+
+Retrieves the chain ID of the Aptos blockchain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching the chain ID
const chainId = await aptos.getChainId();
console.log("Chain ID:", chainId);
}
runExample().catch(console.error);
@returns The chain ID of the Aptos blockchain.
+
+
+Queries the top user transactions based on the specified limit.
+The arguments for querying top user transactions.
+The number of transactions to return.
+GetChainTopUserTransactionsResponse
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetch the top user transactions with a limit of 5
const topUserTransactions = await aptos.getChainTopUserTransactions({ limit: 5 });
console.log(topUserTransactions);
}
runExample().catch(console.error);
+
+
+Queries for the last successful indexer version, providing insight into the ledger version the indexer is updated to, which +may lag behind the full nodes.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the last successful indexer version
const version = await aptos.getIndexerLastSuccessVersion();
console.log(`Last successful indexer version: ${version}`);
}
runExample().catch(console.error);
+
+
+Queries for the Aptos ledger information.
+The Aptos Ledger Info, which includes details such as chain ID, epoch, and ledger version.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching the ledger information
const ledgerInfo = await aptos.getLedgerInfo();
console.log(ledgerInfo);
}
runExample().catch(console.error);
+
+
+Query the processor status for a specific processor type.
+The processor type to query.
+The status of the specified processor type.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the processor status for the account transactions processor
const status = await aptos.getProcessorStatus("account_transactions_processor");
console.log(status);
}
runExample().catch(console.error);
+
+
+Retrieves data from the Aptos Indexer using a GraphQL query. +This function allows you to execute complex queries to fetch specific data from the Aptos blockchain.
+The provided T type.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Querying the Aptos Indexer for ledger information
const topUserTransactions = await aptos.queryIndexer({
query: { query: `query MyQuery {
ledger_infos {
chain_id
}
}`}
});
console.log(topUserTransactions);
}
runExample().catch(console.error);
+
+
+Queries for a Move view function
+Optionaloptions?: LedgerVersionArgPayload for the view function
+an array of Move values
+Queries for a Move view function with JSON, this provides compatability with the old aptos package
Optionaloptions?: LedgerVersionArgPayload for the view function
+an array of Move values
+A class to query all Keyless related queries on Aptos.
More documentation on how to integrate Keyless Accounts see the below +Aptos Keyless Integration Guide.
+Initializes a new instance of the Aptos class with the provided configuration. +This allows you to interact with the Aptos blockchain using the specified network settings.
+The configuration settings for connecting to the Aptos network.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a new configuration for the Aptos client
const config = new AptosConfig({ network: Network.TESTNET }); // Specify your desired network
// Initialize the Aptos client with the configuration
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+Fetches the pepper from the Aptos pepper service API.
+The arguments for fetching the pepper.
+OptionalderivationPath?: stringA derivation path used for creating multiple accounts per user via the BIP-44 standard. Defaults +to "m/44'/637'/0'/0'/0".
+The EphemeralKeyPair used to generate the nonce in the JWT token.
+JWT token.
+The pepper which is a Uint8Array of length 31.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const ephemeralKeyPair = new EphemeralKeyPair(); // create a new ephemeral key pair
const jwt = "your_jwt_token"; // replace with a real JWT token
// Fetching the pepper using the provided JWT and ephemeral key pair
const pepper = await aptos.getPepper({
jwt,
ephemeralKeyPair,
// derivationPath: "m/44'/637'/0'/0'/0" // specify your own if needed
});
console.log("Fetched pepper:", pepper);
}
runExample().catch(console.error);
+
+
+Fetches a proof from the Aptos prover service API.
+The arguments for fetching the proof.
+The EphemeralKeyPair used to generate the nonce in the JWT token.
+JWT token.
+Optionalpepper?: HexInputThe pepper used for the account. If not provided, it will be fetched from the Aptos pepper service.
+OptionaluidKey?: stringA key in the JWT token to use to set the uidVal in the IdCommitment.
+The proof which is represented by a ZeroKnowledgeSig.
+import { Aptos, AptosConfig, Network, EphemeralKeyPair, getPepper } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const jwt = "your_jwt_token"; // replace with a real JWT token
const ephemeralKeyPair = new EphemeralKeyPair(); // create a new ephemeral key pair
// Fetch the proof using the getProof function
const proof = await aptos.getProof({
jwt,
ephemeralKeyPair,
pepper: await getPepper({}), // fetch the pepper if not provided
uidKey: "sub", // specify the uid key
});
console.log("Fetched proof:", proof);
}
runExample().catch(console.error);
+
+
+This installs a set of FederatedJWKs at an address for a given iss.
+It will fetch the JSON Web Keyset (JWK) set from the well-known endpoint and update the FederatedJWKs at the sender's address +to reflect it.
+the iss claim of the federated OIDC provider.
+OptionaljwksUrl?: stringthe URL to find the corresponding JWKs. For supported IDP providers this parameter in not necessary.
+Optionaloptions?: InputGenerateTransactionOptionsThe account that will install the JWKs
+The pending transaction that results from submission.
+AbstractAn abstract representation of a cryptographic proof associated with specific +zero-knowledge proof schemes, such as Groth16 and PLONK.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+AbstractserializeReturns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
A class to handle all Simulate transaction operations.
Initializes a new instance of the Aptos client with the specified configuration. +This allows you to interact with the Aptos blockchain using the provided settings.
+The configuration settings for the Aptos client.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a configuration for the Aptos client
const config = new AptosConfig({ network: Network.TESTNET }); // Specify your desired network
// Initialize the Aptos client with the configuration
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+Simulates a multi-agent transaction by generating a signed transaction and posting it to the Aptos full node. +This function helps in understanding the outcome of a transaction involving multiple signers before it is executed.
+The parameters for simulating the transaction.
+OptionalfeePayerPublicKey?: PublicKeyThe public key of the fee payer (optional).
+Optionaloptions?: InputSimulateTransactionOptionsOptions for simulating the transaction (optional).
+OptionalsecondarySignersPublicKeys?: (PublicKey | undefined)[]An array of public keys for secondary signers (optional). +Each element of the array can be optional, allowing the corresponding key check to be skipped.
+OptionalsignerPublicKey?: PublicKeyThe public key of the primary signer (optional).
+The raw transaction to be simulated.
+import {
Account,
Aptos,
AptosConfig,
Network,
} from "@aptos-labs/ts-sdk";
async function example() {
let sender1 = Account.generate();
let sender2 = Account.generate();
let receiver = Account.generate();
// 0. Set up the client and test accounts
const config = new AptosConfig({ network: Network.DEVNET });
const aptos = new Aptos(config);
await aptos.fundAccount({
accountAddress: sender.accountAddress,
amount: 100_000_000,
});
// 1. Build
console.log("\n=== 1. Building the transaction ===\n");
const transaction = await aptos.transaction.build.multiAgent({
sender: sender1.accountAddress,
secondarySignerAddresses: [sender2.accountAddress],
data: {
// REPLACE WITH YOUR MULTI-AGENT FUNCTION HERE
function:
"<REPLACE WITH YOUR MULTI AGENT MOVE ENTRY FUNCTION> (Syntax {address}::{module}::{function})",
functionArguments: [],
},
});
console.log("Transaction:", transaction);
// 2. Simulate (Optional)
console.log("\n === 2. Simulating Response (Optional) === \n");
const [userTransactionResponse] = await aptos.transaction.simulate.multiAgent(
{
signerPublicKey: sender1.publicKey,
secondarySignersPublicKeys: [sender2.publicKey],
transaction,
},
);
console.log(userTransactionResponse);
// If the fee looks ok, continue to signing!
// ...
}
example();
+
+
+Simulates a transaction based on the provided parameters and returns the result. +This function helps you understand the outcome of a transaction before executing it on the blockchain.
+The parameters for simulating the transaction.
+OptionalfeePayerPublicKey?: PublicKeyThe public key of the fee payer (optional).
+Optionaloptions?: InputSimulateTransactionOptionsAdditional options for simulating the transaction (optional).
+OptionalsignerPublicKey?: PublicKeyThe public key of the signer for the transaction (optional).
+The raw transaction data to simulate.
+import {
Account,
Aptos,
AptosConfig,
Network,
} from "@aptos-labs/ts-sdk";
async function example() {
let sender = Account.generate();
let receiver = Account.generate();
// 0. Set up the client and test accounts
const config = new AptosConfig({ network: Network.DEVNET });
const aptos = new Aptos(config);
await aptos.fundAccount({
accountAddress: sender.accountAddress,
amount: 100_000_000,
});
// 1. Build the transaction to preview the impact of it
const transaction = await aptos.transaction.build.simple({
sender: sender.accountAddress,
data: {
// All transactions on Aptos are implemented via smart contracts.
function: "0x1::aptos_account::transfer",
functionArguments: [receiver.accountAddress, 100],
},
});
// 2. Simulate to see what would happen if we execute this transaction
const [userTransactionResponse] = await aptos.transaction.simulate.simple({
signerPublicKey: sender.publicKey,
transaction,
});
console.log(userTransactionResponse);
// If the fee looks ok, continue to signing!
// ...
}
example();
+
+
+A class to query all Staking related queries on Aptos.
Creates an instance of the Aptos client with the specified configuration. +This allows you to interact with the Aptos blockchain using the provided settings.
+The configuration settings for the Aptos client.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a configuration for the Aptos client
const config = new AptosConfig({ network: Network.TESTNET }); // Specify your network
// Initialize the Aptos client with the configuration
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+Queries delegated staking activities for a specific delegator and pool.
+The arguments for querying delegated staking activities.
+The address of the delegator.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+The address of the staking pool.
+The response containing delegated staking activities.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get delegated staking activities for a specific delegator and pool
const activities = await aptos.getDelegatedStakingActivities({
delegatorAddress: "0x1", // replace with a real delegator address
poolAddress: "0x2", // replace with a real pool address
minimumLedgerVersion: 1, // specify your own if needed
});
console.log(activities);
}
runExample().catch(console.error);
+
+
+Queries the current number of delegators in a specified pool. Throws an error if the pool is not found.
+The parameters for the query.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+The address of the pool to query.
+The number of delegators for the given pool.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Get the number of delegators for a specific pool
const delegators = await aptos.getNumberOfDelegators({ poolAddress: "0x1" }); // replace with a real pool address
console.log(`Number of delegators: ${delegators}`);
}
runExample().catch(console.error);
+
+
+Retrieves the current number of delegators across all pools.
+Optionalargs: {Optional parameters for the query.
+OptionalminimumLedgerVersion?: AnyNumberOptional ledger version to sync up to before querying.
+Optionaloptions?: OrderByArg<{ num_active_delegator?: any; pool_address?: string | null }>Optional ordering options for the response.
+GetNumberOfDelegatorsForAllPoolsResponse response type containing the number of delegators per pool.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve the number of delegators for all pools
const delegators = await aptos.getNumberOfDelegatorsForAllPools();
console.log(delegators);
}
runExample().catch(console.error);
+
+
+A class to handle all Submit transaction operations.
Initializes a new instance of the Aptos client with the specified configuration. +This allows you to interact with the Aptos blockchain using the provided settings.
+The configuration settings for the Aptos client.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a configuration for the Aptos client
const config = new AptosConfig({
network: Network.TESTNET, // Use the TESTNET for testing
nodeUrl: "https://testnet.aptos.dev", // Specify the node URL
faucetUrl: "https://faucet.testnet.aptos.dev" // Specify the faucet URL
});
// Initialize the Aptos client with the configuration
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+Submits a multi-agent transaction to the Aptos network, allowing multiple signers to authorize the transaction. +This function is useful for scenarios where a transaction requires approval from multiple accounts.
+The parameters for the multi-agent transaction.
+An array of authenticators for additional signers.
+OptionalfeePayerAuthenticator?: AccountAuthenticatorAn optional authenticator for the fee payer account.
+The authenticator for the sender account.
+The raw transaction to be submitted.
+import { Aptos, AptosConfig, Network, Account } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const sender = Account.generate(); // Generate a new sender account
const additionalSigner1 = Account.generate(); // Generate an additional signer account
const additionalSigner2 = Account.generate(); // Generate another additional signer account
const transaction = await aptos.transaction.build.simple({
sender: sender.accountAddress,
data: {
function: "0x1::aptos_account::transfer",
functionArguments: [additionalSigner1.accountAddress, 100],
},
});
const response = await aptos.multiAgent({
transaction,
senderAuthenticator: sender.getAuthenticator(), // Use the sender's authenticator
additionalSignersAuthenticators: [
additionalSigner1.getAuthenticator(), // Use the first additional signer's authenticator
additionalSigner2.getAuthenticator(), // Use the second additional signer's authenticator
],
});
console.log(response); // Log the response from the transaction submission
}
runExample().catch(console.error);
+
+
+Submits a transaction to the Aptos blockchain using the provided transaction details and authenticators. +This function allows you to execute transactions securely by specifying the sender and optional fee payer authenticators.
+The arguments for submitting the transaction.
+OptionalfeePayerAuthenticator?: AccountAuthenticatorThe optional authenticator for the fee payer's account.
+The authenticator for the sender's account.
+The raw transaction data to be submitted.
+import { Aptos, AptosConfig, Network, Account } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const sender = Account.generate(); // Generate a new sender account
const transaction = await aptos.transaction.build.simple({
sender: sender.accountAddress,
data: {
function: "0x1::aptos_account::transfer",
functionArguments: [Account.generate().accountAddress, 100], // Replace with a real destination account
},
});
// Submit the transaction
const response = await aptos.simple({
transaction,
senderAuthenticator: sender.getAuthenticator(), // Use the sender's authenticator
});
console.log("Transaction submitted:", response);
}
runExample().catch(console.error);
+
+
+A class to query all Table Aptos related queries.
Initializes a new instance of the Aptos client with the specified configuration. +This allows you to interact with the Aptos blockchain using the provided settings.
+The configuration settings for the Aptos client.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a new Aptos client with testnet configuration
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
console.log("Aptos client initialized:", aptos);
}
runExample().catch(console.error);
+
+
+Queries for a specific item in a table identified by the handle and the key for the item. +This function allows you to retrieve structured data from a table in the Aptos blockchain.
+Object that describes the table item, including key and value types.
+A pointer to where that table is stored.
+Optionaloptions?: LedgerVersionArgTable item value rendered in JSON.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve a table item from the Aptos blockchain
const tableItem = await aptos.getTableItem({
handle: "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca",
data: {
key_type: "address", // Move type of table key
value_type: "u128", // Move type of table value
key: "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935" // Value of table key
},
});
console.log(tableItem);
}
runExample().catch(console.error);
+
+
+Queries for table items data with optional filtering and pagination. +This function allows you to retrieve specific data from a table based on provided criteria.
+The arguments for querying table items data.
+OptionalminimumLedgerVersion?: AnyNumberOptional minimum ledger version to wait for before querying.
+Optionaloptions?: PaginationArgs & WhereArg<TableItemsBoolExp> & OrderByArg<Optional parameters for pagination and filtering.
+GetTableItemsDataResponse
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Retrieve table items data with specific filtering options
const data = await aptos.getTableItemsData({
minimumLedgerVersion: 1, // specify your own minimum ledger version if needed
options: {
where: {
table_handle: { _eq: "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca" },
transaction_version: { _eq: "0" }
},
limit: 10, // specify your own limit if needed
},
});
console.log(data);
}
runExample().catch(console.error);
+
+
+Queries for the metadata of table items, allowing for filtering and pagination.
+The parameters for the query.
+OptionalminimumLedgerVersion?: AnyNumberOptional minimum ledger version to wait for before querying.
+Optionaloptions?: PaginationArgs & WhereArg<TableMetadatasBoolExp> & OrderByArg<Optional parameters for pagination and filtering.
+GetTableItemsMetadataResponse
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching table items metadata with a filter condition
const data = await aptos.getTableItemsMetadata({
minimumLedgerVersion: 1, // specify your own minimum ledger version if needed
options: {
where: { handle: { _eq: "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca" } },
limit: 10, // specify your own limit if needed
},
});
console.log(data);
}
runExample().catch(console.error);
+
+
+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.
+This class is used as part of the Aptos object, so should be called like so:
+import { Account, Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const APTOS_COIN = "0x1::aptos_coin::AptosCoin";
const COIN_STORE = `0x1::coin::CoinStore<${APTOS_COIN}>`;
const ALICE_INITIAL_BALANCE = 100_000_000;
const TRANSFER_AMOUNT = 100;
async function example() {
console.log(
"This example will create two accounts (Alice and Bob), fund them, and transfer between them.",
);
// Set up the client
const config = new AptosConfig({ network: Network.DEVNET });
const aptos = new Aptos(config);
// Generate two account credentials
// Each account has a private key, a public key, and an address
const alice = Account.generate();
const bob = Account.generate();
console.log("=== Addresses ===\n");
console.log(`Alice's address is: ${alice.accountAddress}`);
console.log(`Bob's address is: ${bob.accountAddress}`);
// Fund the accounts using a faucet
console.log("\n=== Funding accounts ===\n");
await aptos.fundAccount({
accountAddress: alice.accountAddress,
amount: ALICE_INITIAL_BALANCE,
});
// Send a transaction from Alice's account to Bob's account
const txn = await aptos.transaction.build.simple({
sender: alice.accountAddress,
data: {
// All transactions on Aptos are implemented via smart contracts.
function: "0x1::aptos_account::transfer",
functionArguments: [bob.accountAddress, 100],
},
});
console.log("\n=== Transfer transaction ===\n");
// Both signs and submits
const committedTxn = await aptos.signAndSubmitTransaction({
signer: alice,
transaction: txn,
});
// Waits for Aptos to verify and execute the transaction
const executedTransaction = await aptos.waitForTransaction({
transactionHash: committedTxn.hash,
});
console.log("Transaction hash:", executedTransaction.hash);
console.log("\n=== Balances after transfer ===\n");
const newAliceAccountBalance = await aptos.getAccountResource({
accountAddress: alice.accountAddress,
resourceType: COIN_STORE,
});
const newAliceBalance = Number(newAliceAccountBalance.coin.value);
console.log(`Alice's balance is: ${newAliceBalance}`);
const newBobAccountBalance = await aptos.getAccountResource({
accountAddress: bob.accountAddress,
resourceType: COIN_STORE,
});
const newBobBalance = Number(newBobAccountBalance.coin.value);
console.log(`Bob's balance is: ${newBobBalance}`);
}
example();
+
+
+Creates an instance of the Aptos client with the specified configuration. +This allows you to interact with the Aptos blockchain using the provided settings.
+The configuration settings for the Aptos client.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a new Aptos client instance
const config = new AptosConfig({ network: Network.TESTNET }); // Specify the network
const aptos = new Aptos(config);
console.log("Aptos client created successfully:", aptos);
}
runExample().catch(console.error);
+
+
+The arguments for batching transactions.
+An array of transaction payloads to be processed.
+Optionaloptions?: Omit<InputGenerateTransactionOptions, "accountSequenceNumber">Optional. Transaction generation configurations (excluding accountSequenceNumber).
+The sender account to sign and submit the transactions.
+Prefer to use aptos.transaction.batch.forSingleAccount()
Batch transactions for a single account by submitting multiple transaction payloads. +This function is useful for efficiently processing and submitting transactions that do not depend on each other, such as +batch funding or batch token minting.
+import { Aptos, AptosConfig, Network, Account } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
const sender = Account.generate(); // Generate a new account for sending transactions
async function runExample() {
const transactions = [
{ }, // Build your first transaction payload
{ }, // Build your second transaction payload
];
// Batch transactions for the single account
await aptos.batchTransactionsForSingleAccount({
sender,
data: transactions,
});
console.log("Batch transactions submitted successfully.");
}
runExample().catch(console.error);
+
+
+Estimates the gas unit price required to process a transaction on the Aptos blockchain in a timely manner. +This helps users to understand the cost associated with their transactions. +https://api.mainnet.aptoslabs.com/v1/spec#/operations/estimate_gas_price
+An object containing the estimated gas price.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET }); // Specify your network
const aptos = new Aptos(config);
async function runExample() {
// Getting the gas price estimation
const gasPriceEstimation = await aptos.getGasPriceEstimation();
console.log("Estimated Gas Price:", gasPriceEstimation);
}
runExample().catch(console.error);
+
+
+Returns a signing message for a transaction, allowing a user to sign it using their preferred method before submission to the network.
+The arguments for obtaining the signing message.
+A raw transaction for signing elsewhere.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const transaction = await aptos.transaction.build.simple({
sender: "0x1", // replace with a real sender address
data: {
function: "0x1::aptos_account::transfer",
functionArguments: ["0x2", 100], // replace with a real destination address
},
});
const message = await aptos.getSigningMessage({ transaction });
console.log(message);
}
runExample().catch(console.error);
+
+
+Queries on-chain transactions by their transaction hash, returning both pending and committed transactions.
+The transaction from the mempool (pending) or the on-chain (committed) transaction.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetch a transaction by its hash
const transaction = await aptos.getTransactionByHash({ transactionHash: "0x123" }); // replace with a real transaction hash
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Queries on-chain transaction by version. This function will not return pending transactions.
+On-chain transaction. Only on-chain transactions have versions, so this +function cannot be used to query pending transactions.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching a transaction by its version
const transaction = await aptos.getTransactionByVersion({ ledgerVersion: 1 }); // replace 1 with a real version
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Queries on-chain transactions, excluding pending transactions. +Use this function to retrieve historical transactions from the blockchain.
+Optionalargs: { options?: PaginationArgs }Optional parameters for pagination.
+Optionaloptions?: PaginationArgsOptional pagination options.
+An array of on-chain transactions.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetch transactions with pagination
const transactions = await aptos.getTransactions({
options: {
offset: 0, // Start from the first transaction
limit: 10, // Limit to 10 results
},
});
console.log(transactions);
}
runExample().catch(console.error);
+
+
+Defines if the specified transaction is currently in a pending state. +This function helps you determine the status of a transaction using its hash.
+true if the transaction is in a pending state and false otherwise.
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Check if the transaction is pending using its hash
const isPendingTransaction = await aptos.isPendingTransaction({ transactionHash: "0x123" }); // replace with a real transaction hash
console.log("Is the transaction pending?", isPendingTransaction);
}
runExample().catch(console.error);
+
+
+Generates a transaction to publish a Move package to the blockchain. +This function helps you create a transaction that can be simulated or submitted to the chain for publishing a package.
+To get the metadataBytes and byteCode, can compile using Aptos CLI with command
+aptos move compile --save-metadata ...,
https://aptos.dev/tutorials/your-first-dapp/#step-4-publish-a-move-module
+The arguments for publishing the package.
+The publisher account.
+The package metadata bytes.
+An array of the bytecode of each module in the package in compiler output order.
+Optionaloptions?: InputGenerateTransactionOptionsOptional settings for generating the transaction.
+A SimpleTransaction that can be simulated or submitted to the chain.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Replace with a real account address
const account = "0x1";
const metadataBytes = "0x..."; // replace with real metadata bytes
const byteCode = "0x..."; // replace with real module bytecode
const transaction = await aptos.publishPackageTransaction({
account,
metadataBytes,
moduleBytecode: [byteCode],
});
console.log(transaction);
}
runExample().catch(console.error);
+
+
+Rotates the authentication key for a given account. Once an account is rotated, only the new private key +or keyless signing scheme can be used to sign transactions for the account.
+The arguments for rotating the authentication key.
+The account from which the authentication key will be rotated.
+Optionaloptions?: InputGenerateTransactionOptions | undefined(Optional) The target account to rotate to. Required if not using toNewPrivateKey.
+(Optional) The new private key to rotate to. Required if not using toAccount.
+SimpleTransaction that can be submitted to rotate the auth key
+This function supports three modes of rotation:
+For Ed25519 accounts, the function will use a challenge-based rotation that requires signatures from both the old and new keys. +For multi-key accounts like MultiEd25519Account, the function will use a challenge-based rotation that requires signatures from both keys. +For other account types, the function will use an unverified rotation that only requires the new public key.
+Rotates the authentication key for a given account without verifying the new key.
+Accounts with their auth key rotated via this function will be derivable via the getAccountsForPublicKey and
+deriveOwnedAccountsFromSigner functions however the public key will be unverified (no proof of ownership). Thus
+includeUnverified must be set to true to derive the account until the public key is verified via signing a transaction.
The arguments for rotating the authentication key.
+The account from which the authentication key will be rotated.
+Optionaloptions?: InputGenerateTransactionOptionsThe new public key to rotate to.
+A simple transaction object that can be submitted to the network.
+Sign a transaction that can later be submitted to the chain. +This function is essential for ensuring the authenticity of the transaction by using the provided account's signing capabilities.
+The arguments for signing the transaction.
+The account that will sign the transaction.
+A raw transaction to sign.
+AccountAuthenticator - The authenticator for the signed transaction.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const sender = Account.generate(); // Generate a new account for signing
const transaction = await aptos.transaction.build.simple({
sender: sender.accountAddress,
data: {
function: "0x1::aptos_account::transfer",
functionArguments: [ "0x1", 100 ], // replace with a real account address and amount
},
});
const signedTransaction = await aptos.transaction.sign({
signer: sender,
transaction,
}); // Sign the transaction
console.log("Signed Transaction:", signedTransaction);
}
runExample().catch(console.error);
+
+
+Sign and submit a single signer transaction as the fee payer to chain given an authenticator by the sender of the transaction.
+The fee payer account to sign the transaction
+The AccountAuthenticator signed by the sender of the transaction
+An instance of a RawTransaction, plus optional secondary/fee payer addresses
+PendingTransactionResponse
+const transaction = await aptos.transaction.build.simple({sender: alice.accountAddress, feePayer: true ...})
const senderAuthenticator = alice.signTransactionWithAuthenticator(transaction)
const pendingTransaction = await aptos.signAndSubmitAsFeePayer({
senderAuthenticator,
feePayer: bob,
transaction,
})
+
+
+Sign and submit a single signer transaction to the blockchain. +This function allows you to execute a transaction after signing it with the specified account.
+The arguments for signing and submitting the transaction.
+The signer account to sign the transaction.
+An instance of a RawTransaction, plus optional secondary/fee payer addresses.
+PendingTransactionResponse
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const sender = Account.generate(); // Generate a new account for sending the transaction
const transaction = await aptos.transaction.build.simple({
sender: sender.accountAddress,
data: {
function: "0x1::aptos_account::transfer",
functionArguments: [ "0x1", 100 ], // replace with a real account address
},
});
// Sign and submit the transaction
const pendingTransaction = await aptos.signAndSubmitTransaction({
signer: sender,
transaction,
});
console.log(pendingTransaction);
}
runExample().catch(console.error);
+
+
+Sign a transaction as a fee payer that can later be submitted to the chain. +This function ensures that the transaction is marked with the fee payer's address, allowing it to be processed correctly.
+The arguments for signing the transaction.
+The fee payer signer account.
+A raw transaction to sign on. This transaction must include a feePayerAddress property.
AccountAuthenticator - The authenticator for the signed transaction.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
const sender = Account.generate(); // Generate a new account for the fee payer
const transaction = await aptos.transaction.build.simple({
// All transactions on Aptos are implemented via smart contracts.
function: "0x1::aptos_account::transfer",
functionArguments: [sender.accountAddress, 100],
feePayerAddress: sender.accountAddress, // Set the fee payer address
});
const signedTransaction = await aptos.transaction.signAsFeePayer({
signer: sender,
transaction,
});
console.log("Signed transaction as fee payer:", signedTransaction);
}
runExample().catch(console.error);
+
+
+Waits for a transaction to move past the pending state and provides the transaction response. +There are 4 cases.
+checkSuccess is true, the function will throw a FailedTransactionError
+If checkSuccess is false, the function will resolve with the transaction response where the success field is false.args.options.timeoutSecs seconds.
+Optionaloptions?: WaitForTransactionOptionsOptional parameters for waiting behavior.
+The hash of a transaction previously submitted to the blockchain.
+The transaction on-chain response.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Wait for a transaction to complete using its hash
const transactionHash = "0x123"; // replace with a real transaction hash
const transactionResponse = await aptos.waitForTransaction({
transactionHash,
options: {
timeoutSecs: 30, // specify your own timeout if needed
checkSuccess: true,
},
});
console.log(transactionResponse);
}
runExample().catch(console.error);
+
+
+Minimal EventEmitter interface that is molded against the Node.js
+EventEmitter interface.
Initializes a new instance of the Aptos client with the provided configuration settings. +This allows you to interact with the Aptos blockchain using the specified network and options.
+The configuration settings for the Aptos client.
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a configuration for the Aptos client
const config = new AptosConfig({
network: Network.TESTNET, // specify the network to use
nodeUrl: "https://testnet.aptos.dev" // replace with your node URL
});
// Initialize the Aptos client with the configuration
const aptos = new Aptos(config);
console.log("Aptos client initialized successfully.");
}
runExample().catch(console.error);
+
+
+Send batch transactions for a single account.
+This function uses a transaction worker that receives payloads to be processed +and submitted to chain. +Note that this process is best for submitting multiple transactions that +don't rely on each other, i.e. batch funds, batch token mints, etc.
+If any worker failure, the functions throws an error.
+An array of transaction payloads
+Optionaloptions?: Omit<InputGenerateTransactionOptions, "accountSequenceNumber">optional. Transaction generation configurations (excluding accountSequenceNumber)
+The sender account to sign and submit the transaction
+void. Throws if any error
+Optionalcontext: anyCalls each of the listeners registered for a given event.
+Return an array listing the events for which the emitter has registered +listeners.
+Return the number of listeners listening to a given event.
+Return the listeners registered for a given event.
+Optionalfn: (Optionalcontext: anyOptionalonce: booleanAdd a listener for a given event.
+Optionalcontext: anyAdd a one-time listener for a given event.
+Optionalcontext: anyRemove all listeners, or those of the specified event.
+Optionalevent: keyof TransactionWorkerEventsRemove the listeners of a given event.
+Optionalfn: (Optionalcontext: anyOptionalonce: booleanDerive the public key associated with the private key.
+Get the private key in bytes (Uint8Array).
+StaticformatFormat a HexInput to an AIP-80 compliant string.
+ +The HexString or Uint8Array format of the private key.
+StaticparseParse a HexInput that may be a HexString, Uint8Array, or a AIP-80 compliant string to a Hex instance.
+ +A HexString, Uint8Array, or a AIP-80 compliant string.
+Optionalstrict: booleanIf true, the value MUST be compliant with AIP-80.
+AbstractRepresents an abstract public key.
+This class provides a common interface for verifying signatures associated with the public key. +It allows for the retrieval of the raw public key bytes and the public key in a hexadecimal string format.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Get the public key as a hex string with a 0x prefix.
+The public key in hex format.
+Get the raw public key bytes
+AbstractverifyVerifies that the private key associated with this public key signed the message with the given signature.
+Represents the arguments required to verify a digital signature.
+Verifies signature with the public key and makes any network calls required to get state required to verify the signature.
+AbstractserializeReturns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
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.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+RawTransactions contain the metadata and payloads that can be submitted to Aptos chain for execution. +RawTransactions must be signed before Aptos chain can execute them.
+The sender Account Address
+Sequence number of this transaction. This must match the sequence number stored in +the sender's account at the time the transaction executes.
+Instructions for the Aptos Blockchain, including publishing a module, +execute an entry function or execute a script payload.
+Maximum total gas to spend for this transaction. The account must have more +than this gas or the transaction will be discarded during validation.
+Price to be paid per gas unit.
+The blockchain timestamp at which the blockchain would discard this transaction.
+The chain ID of the blockchain that this transaction is intended to be run on.
+Serializes the transaction data, including the fee payer transaction type, raw transaction, secondary signer addresses, +and fee payer address. +This function is essential for preparing the transaction for transmission or storage in a serialized format.
+The serializer instance used to serialize the transaction data.
+StaticdeserializeDeserialize a Raw Transaction With Data. +This function retrieves the appropriate raw transaction based on the variant index provided by the deserializer.
+An instance of the Deserializer used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
AbstractRepresents a raw transaction with associated data that can be serialized and deserialized.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+AbstractserializeStaticdeserializeDeserialize a Raw Transaction With Data
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Represents a challenge required for the account owner to sign in order to rotate the authentication key.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Initializes a new instance of the class with the specified parameters. +This constructor sets up the necessary attributes for managing account keys.
+The parameters required to create the instance.
+The current authentication key of the account.
+The new public key to be set for the account.
+The account address of the originator.
+The sequence number associated with the transaction.
+Serializes the properties of the current instance for transmission or storage. +This function helps in converting the instance data into a format suitable for serialization.
+The serializer used to serialize the instance properties.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
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.
+Scripts contain the Move bytecodes payload that can be submitted to Aptos chain for execution.
+The move module bytecode
+The type arguments that the bytecode function requires.
+The arguments that the bytecode function requires.
+ReadonlyargsThe arguments that the bytecode function requires.
+ReadonlybytecodeThe move module bytecode
+Readonlytype_The type arguments that the bytecode function requires.
+StaticdeserializeRepresents a Secp256k1 ECDSA private key, providing functionality to create, sign messages, +derive public keys, and serialize/deserialize the key.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Create a new PrivateKey instance from a Uint8Array or String.
+ +A HexInput (string or Uint8Array)
+Optionalstrict: booleanIf true, private key must AIP-80 compliant.
+Static ReadonlyLENGTHLength of Secp256k1 ecdsa private key
+Clears the private key from memory by overwriting it with random bytes. +After calling this method, the private key can no longer be used for signing or deriving public keys.
+Note: Due to JavaScript's memory management, this cannot guarantee complete removal of +sensitive data from memory, but it significantly reduces the window of exposure.
+Returns whether the private key has been cleared from memory.
+true if the key has been cleared, false otherwise
+Derive the Secp256k1PublicKey from this private key.
+Secp256k1PublicKey The derived public key.
+Sign the given message with the private key. +This function generates a cryptographic signature for the provided message, ensuring the signature is canonical and non-malleable.
+A message in HexInput format to be signed.
+Signature - The generated signature for the provided message.
+StaticfromDerives a private key from a mnemonic seed phrase using a specified BIP44 path.
+The BIP44 path to derive the key from.
+The mnemonic seed phrase used for key generation.
+The generated private key.
+StaticgenerateGenerate a new random private key.
+Secp256k1PrivateKey - A newly generated Secp256k1 private key.
+StaticisDetermines if the provided private key is an instance of Secp256k1PrivateKey.
+The private key to be checked.
+Get the private key as a AIP-80 compliant hex string.
+ +AIP-80 compliant string representation of the private key.
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a Secp256k1 ECDSA public key.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Create a new PublicKey instance from a HexInput, which can be a string or Uint8Array. +This constructor validates the length of the provided signature data.
+A HexInput (string or Uint8Array) representing the signature data.
+Deserializes a Secp256k1Signature from the provided deserializer. +This function allows you to reconstruct a Secp256k1Signature object from its serialized byte representation.
+The deserializer instance used to read the serialized data.
+Serializes the data into a byte array using the provided serializer. +This function is essential for converting data into a format suitable for transmission or storage.
+The serializer instance used to convert the data.
+Get the public key as a hex string with a 0x prefix.
+The public key in hex format.
+Get the data as a Uint8Array representation.
+Uint8Array representation of the data.
+Verifies a Secp256k1 signature against the public key.
+This function checks the validity of a signature for a given message, ensuring that the signature is canonical as a malleability check.
+The arguments for verifying the signature.
+The message that was signed.
+The signature to verify against the public key.
+Note: Secp256k1Signatures can be verified syncronously.
+Verifies the provided signature against the given message. +This function helps ensure the integrity and authenticity of the message by confirming that the signature is valid.
+The arguments for signature verification.
+The configuration object for connecting to the Aptos network
+The message that was signed.
+The signature to verify, which must be an instance of Secp256k1Signature.
+A boolean indicating whether the signature is valid for the given message.
+StaticisDetermines if the provided public key is a valid instance of a Secp256k1 public key. +This function checks for the presence of a "key" property and validates the length of the key data.
+The public key to validate.
+A boolean indicating whether the public key is a valid Secp256k1 public key.
+StaticisDetermine if the provided public key is an instance of Secp256k1PublicKey.
+The public key to check.
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a signature of a message signed using a Secp256k1 ECDSA private key.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Create a new Signature instance from a Uint8Array or String.
+A HexInput (string or Uint8Array)
+Static ReadonlyLENGTHSecp256k1 ecdsa signatures are 256-bit.
+Get the signature as a hex string with a 0x prefix e.g. 0x123456...
+The hex string representation of the signature.
+Get the raw signature bytes
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a Secp256r1 ECDSA private key, providing functionality to create, sign messages, +derive public keys, and serialize/deserialize the key.
+Create a new PrivateKey instance from a Uint8Array or String.
+ +A HexInput (string or Uint8Array)
+Optionalstrict: booleanIf true, private key must AIP-80 compliant.
+Static ReadonlyLENGTHLength of Secp256r1 ecdsa private key
+Derive the Secp256r1PublicKey from this private key.
+Secp256r1PublicKey The derived public key.
+Serializes the data into a byte array using the provided serializer. +This function is essential for converting data into a format suitable for transmission or storage.
+The serializer instance used to convert the data.
+Sign the given message with the private key. +This function generates a cryptographic signature for the provided message.
+A message in HexInput format to be signed.
+Signature - The generated signature for the provided message.
+Get the private key as a string representation.
+string representation of the private key
+Get the private key in bytes (Uint8Array).
+StaticdeserializeDeserializes a Secp256r1PrivateKey from the provided deserializer. +This function allows you to reconstruct a Secp256r1PrivateKey object from its serialized byte representation.
+The deserializer instance used to read the serialized data.
+StaticgenerateGenerate a new random private key.
+Secp256r1PrivateKey - A newly generated Secp256r1 private key.
+Get the private key as a hex string with the 0x prefix.
+string representation of the private key.
+StaticformatFormat a HexInput to an AIP-80 compliant string.
+ +The HexString or Uint8Array format of the private key.
+StaticparseParse a HexInput that may be a HexString, Uint8Array, or a AIP-80 compliant string to a Hex instance.
+ +A HexString, Uint8Array, or a AIP-80 compliant string.
+Optionalstrict: booleanIf true, the value MUST be compliant with AIP-80.
+Represents a Secp256r1 ECDSA public key.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Create a new PublicKey instance from a HexInput, which can be a string or Uint8Array. +This constructor validates the length of the provided public key data.
+A HexInput (string or Uint8Array) representing the public key data.
+Generates an authentication key from the public key using the Secp256r1 scheme. +This function is essential for creating a secure authentication key that can be used for further cryptographic operations.
+The generated authentication key.
+Converts the public key to BCS (Binary Canonical Serialization) bytes. +This function serializes the public key data into a byte array format suitable for transmission or storage.
+Uint8Array representation of the serialized public key.
+Serializes the data into a byte array using the provided serializer. +This function is essential for converting data into a format suitable for transmission or storage.
+The serializer instance used to convert the data.
+Get the public key as a hex string with the 0x prefix.
+string representation of the public key.
+Get the data as a Uint8Array representation.
+Uint8Array representation of the data.
+Verifies a Secp256r1 signature against the public key.
+This function checks the validity of a signature for a given message.
+Note: Secp256r1Signatures can be verified synchronously.
+Verifies the provided signature against the given message. +This function helps ensure the integrity and authenticity of the message by confirming that the signature is valid.
+The arguments for signature verification.
+A boolean indicating whether the signature is valid for the given message.
+StaticdeserializeDeserializes a Secp256r1PublicKey from the provided deserializer. +This function allows you to reconstruct a Secp256r1PublicKey object from its serialized byte representation.
+The deserializer instance used to read the serialized data.
+StaticisDetermines if the provided public key is a valid instance of a Secp256r1 public key. +This function checks for the presence of a "key" property and validates the length of the key data.
+The public key to validate.
+A boolean indicating whether the public key is a valid Secp256r1 public key.
+StaticloadLoads a Secp256r1PublicKey from the provided deserializer.
+The deserializer instance used to read the serialized data.
+Represents a signature of a message signed using a Secp256r1 ECDSA private key.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Create a new Signature instance from a Uint8Array or String.
+A HexInput (string or Uint8Array)
+Static ReadonlyLENGTHSecp256r1 ecdsa signatures are 256-bit.
+Serializes the data into a byte array using the provided serializer. +This function is essential for converting data into a format suitable for transmission or storage.
+The serializer instance used to convert the data.
+Get the signature as a hex string with the 0x prefix.
+string representation of the signature
+Get the signature in bytes (Uint8Array).
+Uint8Array representation of the signature
+StaticdeserializeDeserializes a Secp256r1Signature from the provided deserializer. +This function allows you to reconstruct a Secp256r1Signature object from its serialized byte representation.
+The deserializer instance used to read the serialized data.
+AbstractThis 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.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+AbstractserializeReturns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Represents a serialized data structure that encapsulates a byte array. +This class extends the Serializable class and provides methods for serialization +and deserialization of byte data, as well as converting to a MoveVector.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserialize the bytecode into a MoveVector of the specified type. +This function allows you to convert serialized data into a usable MoveVector format.
+The class type of the elements in the MoveVector.
+Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Serialize an argument to BCS-serialized bytes as a type aware byte sequence. +The byte sequence contains an enum variant index followed by the BCS-serialized +bytes for a typed argument.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeA 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 Coded Serialization (BCS) layout. The serialized data can be retrieved as a +Uint8Array.
+Constructs a serializer with a buffer of size length bytes, 64 bytes by default.
+The length must be greater than 0.
The size of the buffer in bytes.
+Returns the current number of bytes written to the serializer.
+The number of bytes written.
+Resets the serializer to its initial state, allowing the buffer to be reused. +This clears the buffer contents to prevent data leakage between uses.
+Serializes a Serializable value, facilitating composable serialization.
The Serializable value to serialize.
+the serializer instance
+Serializes a Serializable value as a byte array with a length prefix. +This is the optimized pattern for entry function argument serialization.
+Instead of:
+const bcsBytes = value.bcsToBytes(); // Creates new Serializer, copies bytes
serializer.serializeBytes(bcsBytes);
+
+
+Use:
+serializer.serializeAsBytes(value); // Uses pooled Serializer, avoids extra copy
+
+
+This method uses a pooled Serializer instance to reduce allocations and +directly appends the serialized bytes with a length prefix.
+The Serializable value to serialize as bytes.
+Serializes a boolean value into a byte representation.
+The BCS layout for a boolean uses one byte, where "0x01" represents true and "0x00" represents false.
+The boolean value to serialize.
+Serializes an array of bytes.
+This function encodes the length of the byte array as a u32 integer in uleb128 format, followed by the byte array itself. +BCS layout for "bytes": bytes_length | bytes +where bytes_length is a u32 integer encoded as a uleb128 integer, equal to the length of the bytes array.
+The byte array to serialize.
+Serializes an array of bytes with a known length, allowing for efficient deserialization without needing to serialize the +length itself. +When deserializing, the number of bytes to deserialize needs to be passed in.
+The Uint8Array to be serialized.
+Serializes a 128-bit signed integer value.
+The 128-bit signed integer value to serialize.
+Serializes a 16-bit signed integer value into a binary format. +BCS layout for "int16": Two bytes. Binary format in little-endian representation.
+The 16-bit signed integer value to serialize.
+Serializes a 256-bit signed integer value.
+The 256-bit signed integer value to serialize.
+Serializes a 32-bit signed integer value into a binary format.
+The 32-bit signed integer value to serialize.
+Serializes a 64-bit signed integer into a format suitable for storage or transmission. +This function uses two's complement representation for negative values.
+The 64-bit signed integer to serialize.
+Serializes an 8-bit signed integer value. +BCS layout for "int8": One byte. Binary format in little-endian representation.
+The 8-bit signed integer value to serialize.
+Serializes an optional value which can be a Serializable, string, or Uint8Array. +For strings and Uint8Arrays, it uses the appropriate serialization method.
+Optionalvalue: TThe value to serialize (Serializable, string, Uint8Array, or undefined)
+Optionallen: numberOptional fixed length for Uint8Array serialization. If provided, uses serializeFixedBytes instead of serializeBytes
+const serializer = new Serializer();
serializer.serializeOption("hello"); // Serializes optional string
serializer.serializeOption(new Uint8Array([1, 2, 3])); // Serializes optional bytes
serializer.serializeOption(new Uint8Array([1, 2, 3]), 3); // Serializes optional fixed-length bytes
serializer.serializeOption(new AccountAddress(...)); // Serializes optional Serializable
serializer.serializeOption(undefined); // Serializes none case
+
+
+Optionalvalue: stringThe optional string to serialize. If undefined, it will serialize as 0.
+use serializeOption instead.
+Serializes an optional string, supporting UTF8 encoding.
+The function encodes the existence of the string first, followed by the length and content if it exists.
BCS layout for optional "string": 1 | string_length | string_content +where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content. +BCS layout for undefined: 0
+Serializes a string. UTF8 string is supported. +The number of bytes in the string content is serialized first, as a uleb128-encoded u32 integer. +Then the string content is serialized as UTF8 encoded bytes.
+BCS layout for "string": string_length | string_content +where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
+The string to serialize.
+Serializes a U128 value into a format suitable for storage or transmission.
+The U128 value to serialize, represented as a number.
+Serializes a 16-bit unsigned integer value into a binary format. +BCS layout for "uint16": Two bytes. Binary format in little-endian representation.
+The 16-bit unsigned integer value to serialize.
+Serializes a U256 value into a byte representation. +This function is essential for encoding large numbers in a compact format suitable for transmission or storage.
+The U256 value to serialize, represented as an AnyNumber.
+Serializes a 32-bit unsigned integer value into a binary format. +This function is useful for encoding data that needs to be stored or transmitted in a compact form.
+The 32-bit unsigned integer value to serialize.
+Serializes a 32-bit unsigned integer as a variable-length ULEB128 encoded byte array. +BCS uses uleb128 encoding in two cases: (1) lengths of variable-length sequences and (2) tags of enum values
+The 32-bit unsigned integer value to be serialized.
+Serializes a 64-bit unsigned integer into a format suitable for storage or transmission. +This function breaks down the value into two 32-bit components and writes them in little-endian order.
+The 64-bit unsigned integer to serialize, represented as a number.
+Serializes a Uint8 value and appends it to the buffer. +BCS layout for "uint8": One byte. Binary format in little-endian representation.
+The Uint8 value to serialize.
+Serializes an array of BCS Serializable values to a serializer instance. +The bytes are added to the serializer instance's byte buffer.
+The array of BCS Serializable values
+const addresses = new Array<AccountAddress>(
AccountAddress.from("0x1"),
AccountAddress.from("0x2"),
AccountAddress.from("0xa"),
AccountAddress.from("0xb"),
);
const serializer = new Serializer();
serializer.serializeVector(addresses);
const serializedBytes = serializer.toUint8Array();
// serializedBytes is now the BCS-serialized bytes
// The equivalent value in Move would be:
// `bcs::to_bytes(&vector<address> [@0x1, @0x2, @0xa, @0xb])`;
+
+
+Returns the buffered bytes as a Uint8Array.
+This function allows you to retrieve the byte representation of the buffer up to the current offset. +For better performance, returns a view when the buffer is exactly the right size, or copies +only the used portion otherwise.
+Uint8Array - The byte array representation of the buffer.
+Returns a view of the serialized bytes without copying. +WARNING: The returned view is only valid until the next write operation. +Use toUint8Array() if you need a persistent copy.
+A Uint8Array view of the buffer (not a copy).
+AbstractAn abstract representation of a crypto signature, +associated with a specific signature scheme, e.g., Ed25519 or Secp256k1.
+This class represents the product of signing a message directly from a +PrivateKey and can be verified against a CryptoPublicKey.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Get the signature as a hex string with a 0x prefix e.g. 0x123456...
+The hex string representation of the signature.
+Get the raw signature bytes
+AbstractserializeReturns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Represents a signed transaction that includes a raw transaction and an authenticator. +The authenticator contains a client's public key and the signature of the raw transaction.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Represents a signed transaction that includes a raw transaction and an authenticator. +The authenticator contains a client's public key and the signature of the raw transaction, +which can be of three types: single signature, multi-signature, and multi-agent.
+The raw transaction to be signed.
+Contains a client's public key and the signature of the raw transaction. The authenticator has 3 +flavors: single signature, multi-signature and multi-agent.
+Serializes the raw transaction and its authenticator using the provided serializer. +This function is essential for preparing the transaction data for transmission or storage.
+The serializer instance used to serialize the transaction and authenticator.
+StaticdeserializeDeserializes a signed transaction from the provided deserializer. +This function allows you to reconstruct a SignedTransaction object from its serialized form, enabling further processing or validation.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Represents a simple transaction type that can be submitted to the Aptos chain for execution.
+This transaction type is designed for a single signer and includes metadata such as the Raw Transaction +and an optional sponsor Account Address to cover gas fees.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+SimpleTransaction represents a transaction signed by a single account that +can be submitted to the Aptos chain for execution.
+The Raw Transaction.
+OptionalfeePayerAddress: AccountAddressThe optional sponsor Account Address to pay the gas fees.
+Serializes the transaction data using the provided serializer. +This function ensures that the raw transaction and fee payer address are properly serialized for further processing.
+The serializer instance used to serialize the transaction data.
+StaticdeserializeDeserializes a SimpleTransaction from the given deserializer. +This function helps in reconstructing a SimpleTransaction object from its serialized form.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Signer implementation for the SingleKey authentication scheme. +This class extends a SingleKeyAccount by adding signing capabilities through a valid private key. +Currently, the only supported signature schemes are Ed25519 and Secp256k1.
+Note: Generating a signer instance does not create the account on-chain.
+Creates an instance of the SingleKeySigner using the provided private key and address. +This allows for signing transactions and messages with the specified private key.
+The constructor arguments for initializing the SingleKeySigner.
+Arguments required to create a single key signer.
+Optionaladdress?: AccountAddressInputReadonlyaccountAccount address associated with the account
+ReadonlyprivatePrivate key associated with the account
+ReadonlypublicPublic key associated with the account
+ReadonlysigningSigning scheme used to sign transactions
+Sign the given message using the account's private key.
+The message to be signed in HexInput format.
+A new AnySignature containing the signature of the message.
+Sign the given transaction using the account's private key. +This function generates a signing message for the transaction and then signs it.
+The transaction to be signed.
+Signature - The resulting signature for the signed transaction.
+Sign a transaction using the account's private key. +This function returns an AccountAuthenticator that contains the signature of the transaction along with the account's public key.
+The raw transaction to be signed.
+An AccountAuthenticatorSingleKey containing the signature of the transaction and the account's public key.
+Sign a message using the account's private key and return an AccountAuthenticator containing the signature along with the +account's public key.
+The signing message, represented as binary input in hexadecimal format.
+An instance of AccountAuthenticatorSingleKey containing the signature and the public key.
+Verify the given message and signature with the public key.
+The arguments for verifying the signature.
+Arguments required to verify a single key signature for a given message.
+A boolean indicating whether the signature is valid.
+Verify the given message and signature with the account's public key.
+This function checks if the provided signature is valid for the given message using the account's public key.
+The arguments for verifying the signature.
+The raw message data in HexInput format.
+Optionaloptions?: { throwErrorWithReason?: boolean }OptionalthrowErrorWithReason?: booleanWhether to throw an error with the reason for the verification failure.
+The signed message signature.
+A boolean indicating whether the signature is valid for the message.
+StaticfromDerives an account using a specified BIP44 path and mnemonic seed phrase, defaulting to the Ed25519 signature scheme. +This function allows you to create a single key account based on the provided derivation path and mnemonic.
+The arguments for deriving the account.
+StaticgenerateDerives an account from a randomly generated private key based on the specified signing scheme. +The default generation scheme is Ed25519, but it can also support Secp256k1Ecdsa.
+The arguments for generating the account.
+Arguments for generating a single key signer.
+Optionalscheme?: SigningSchemeInputAn account with the generated private key based on the specified signing scheme.
+StaticfromRepresents 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.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeA 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.
+ReadonlydomainThe domain separator prefix used when hashing.
+OptionalproofThe zero knowledge proof used in signing the transaction.
+The transaction to sign.
+Hashes the bcs serialized from of the class. This is the typescript corollary to the BCSCryptoHash macro in aptos-core.
+Uint8Array
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Optionalproof: ZkProofSerializes the transaction data into a format suitable for transmission or storage. +This function ensures that both the transaction bytes and the proof are properly serialized.
+The serializer instance used to convert the transaction data into bytes.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
AbstractRepresents an abstract base class for transaction authenticators. +This class provides methods for serializing and deserializing different types of transaction authenticators.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+StaticdeserializeDeserializes a TransactionAuthenticator from the provided deserializer. +This function helps in reconstructing the TransactionAuthenticator based on the variant index found in the serialized data.
+The deserializer instance used to read the serialized data.
+AbstractserializeReturns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Represents a transaction authenticator using Ed25519 for a single signer transaction. +This class encapsulates the client's public key and the Ed25519 signature of a raw transaction.
+Creating a Signed Transaction +for details about generating a signature.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Creates an instance of the class with the specified account authenticator.
+The Ed25519PublicKey that will be used for authentication.
+The Ed25519Signature that will be used for authentication.
+Serializes the transaction authenticator by encoding the sender information.
+The serializer instance used to perform the serialization.
+StaticdeserializeDeserializes a TransactionAuthenticator from the provided deserializer. +This function helps in reconstructing the TransactionAuthenticator based on the variant index found in the serialized data.
+The deserializer instance used to read the serialized data.
+StaticloadLoads a TransactionAuthenticatorSingleSender instance from the provided deserializer. +This function helps in deserializing the sender information to create a transaction authenticator.
+The deserializer used to extract the sender data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Represents a transaction authenticator specifically for fee payer transactions. +It encapsulates the sender's account authenticator, addresses of secondary signers, +their respective authenticators, and the fee payer's account information.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+StaticdeserializeDeserializes a TransactionAuthenticator from the provided deserializer. +This function helps in reconstructing the TransactionAuthenticator based on the variant index found in the serialized data.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticloadRepresents a transaction authenticator for a multi-agent transaction.
+This class manages the authentication process involving a primary sender and multiple secondary signers.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+StaticdeserializeDeserializes a TransactionAuthenticator from the provided deserializer. +This function helps in reconstructing the TransactionAuthenticator based on the variant index found in the serialized data.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticloadRepresents a transaction authenticator for multi-signature transactions using Ed25519. +This class is used to validate transactions that require multiple signatures from different signers.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+StaticdeserializeDeserializes a TransactionAuthenticator from the provided deserializer. +This function helps in reconstructing the TransactionAuthenticator based on the variant index found in the serialized data.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticloadRepresents a single sender authenticator for transactions that require a single signer. +This class is responsible for managing the authentication of a transaction initiated by a single sender.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+StaticdeserializeDeserializes a TransactionAuthenticator from the provided deserializer. +This function helps in reconstructing the TransactionAuthenticator based on the variant index found in the serialized data.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticloadAbstractAbstractserializeStaticdeserializeStaticdeserializeStaticloadStaticdeserializeStaticloadStaticdeserializeStaticloadAbstractAbstractserializeStaticdeserializeOptionalmultisigAddress: AccountAddressOptionalreplayProtectionNonce: AnyNumberStaticdeserializeStaticloadAbstractRepresents any transaction payload that can be submitted to the Aptos chain for execution.
+This is specifically required for orderless transactions, but can be used for any transaction payload.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+AbstractserializeStaticdeserializeDeserializes a multisig transaction payload from the provided deserializer. +This function enables the reconstruction of a MultiSigTransactionPayload object from its serialized form.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Represents any transaction payload that can be submitted to the Aptos chain for execution.
+This is specifically required for orderless transactions, but can be used for any transaction payload.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+StaticdeserializeDeserializes a multisig transaction payload from the provided deserializer. +This function enables the reconstruction of a MultiSigTransactionPayload object from its serialized form.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticloadAbstractRepresents a supported Transaction Payload that can be serialized and deserialized.
+This class serves as a base for different types of transaction payloads, allowing for +their serialization into a format suitable for transmission and deserialization back +into their original form.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+AbstractserializeStaticdeserializeDeserializes a multisig transaction payload from the provided deserializer. +This function enables the reconstruction of a MultiSigTransactionPayload object from its serialized form.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
Represents a transaction payload entry function that can be serialized and deserialized.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+StaticdeserializeDeserializes a multisig transaction payload from the provided deserializer. +This function enables the reconstruction of a MultiSigTransactionPayload object from its serialized form.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticloadRepresents a multi-signature transaction payload that can be serialized and deserialized.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+StaticdeserializeDeserializes a multisig transaction payload from the provided deserializer. +This function enables the reconstruction of a MultiSigTransactionPayload object from its serialized form.
+The deserializer instance used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticloadRepresents a transaction payload script that can be serialized and deserialized.
+This class encapsulates a script that defines the logic for a transaction payload.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Initializes a multi-sig account transaction with the provided payload.
+The payload of the multi-sig transaction. This can only be an EntryFunction for now, but Script might be +supported in the future.
+Serializes the transaction payload, enabling future support for multiple types of inner transaction payloads.
+The serializer instance used to serialize the transaction data.
+StaticdeserializeDeserializes a multisig transaction payload from the provided deserializer. +This function enables the reconstruction of a MultiSigTransactionPayload object from its serialized form.
+The deserializer instance used to read the serialized data.
+StaticloadLoads a MultiSig transaction payload from the provided deserializer. +This function helps in reconstructing a MultiSig transaction payload from its serialized form.
+The deserializer used to read the serialized data.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
TransactionWorker provides a simple framework for receiving payloads to be processed.
+Once one start() the process and pushes a new transaction, the worker acquires
+the current account's next sequence number (by using the AccountSequenceNumber class),
+generates a signed transaction and pushes an async submission process into the outstandingTransactions queue.
+At the same time, the worker processes transactions by reading the outstandingTransactions queue
+and submits the next transaction to chain, it
Initializes a new instance of the class, providing a framework for receiving payloads to be processed.
+A configuration object for Aptos.
+The account that will be used for sending transactions.
+The maximum wait time to wait before re-syncing the sequence number to the current on-chain state, +default is 30 seconds.
+The maximum number of transactions that can be submitted per account, default is 100.
+The time to wait in seconds before re-evaluating if the maximum number of transactions are in flight, +default is 10 seconds.
+transactions that have been committed to chain. +Limited to MAX_TRANSACTION_HISTORY_SIZE entries to prevent unbounded memory growth.
+signed transactions waiting to be submitted
+transactions that have been submitted to chain. +Limited to MAX_TRANSACTION_HISTORY_SIZE entries to prevent unbounded memory growth.
+transactions payloads waiting to be generated and signed
+TODO support entry function payload from ABI builder
+Once a transaction has been sent to the chain, this function checks for its execution status.
+The transaction that was sent to the chain and is now waiting to be executed.
+The account's sequence number that was sent with the transaction.
+Generates a signed transaction that can be submitted to the chain.
+An Aptos account used as the sender of the transaction.
+A sequence number the transaction will be generated with.
+A signed transaction object or undefined if the transaction queue is empty.
+Reads the outstanding transaction queue and submits the transactions to the chain. +This function processes each transaction, checking their status and emitting events based on whether they were successfully +sent or failed.
+Throws an error if the process execution fails. +TransactionWorkerEventsEnum.TransactionSent - Emitted when a transaction has been successfully committed to the chain. +TransactionWorkerEventsEnum.TransactionSendFailed - Emitted when a transaction fails to commit, along with the error +reason. +TransactionWorkerEventsEnum.ExecutionFinish - Emitted when the execution of transactions is complete.
+Pushes a transaction to the transactions queue for processing.
+The transaction payload containing necessary details.
+Optionaloptions: InputGenerateTransactionOptionsOptional parameters for transaction configuration.
+Submits the next transaction for the account by generating it with the current sequence number +and adding it to the outstanding transaction queue for processing. +This function continues to submit transactions until there are no more to process.
+Reads the outstanding transaction queue and submits the transactions to the chain. +This function processes each transaction, checking their status and emitting events based on whether they were successfully +sent or failed.
+Throws an error if the process execution fails. +TransactionWorkerEventsEnum.TransactionSent - Emitted when a transaction has been successfully committed to the chain. +TransactionWorkerEventsEnum.TransactionSendFailed - Emitted when a transaction fails to commit, along with the error +reason. +TransactionWorkerEventsEnum.ExecutionFinish - Emitted when the execution of transactions is complete.
+Optionalcontext: anyCalls each of the listeners registered for a given event.
+Return an array listing the events for which the emitter has registered +listeners.
+Return the number of listeners listening to a given event.
+Return the listeners registered for a given event.
+Optionalfn: (Optionalcontext: anyOptionalonce: booleanAdd a listener for a given event.
+Optionalcontext: anyAdd a one-time listener for a given event.
+Optionalcontext: anyRemove all listeners, or those of the specified event.
+Optionalevent: keyof TransactionWorkerEventsRemove the listeners of a given event.
+Optionalfn: (Optionalcontext: anyOptionalonce: booleanAbstractRepresents 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.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+AbstractserializeAbstracttoReturns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a type tag for an address in the system. +This class extends the TypeTag class and provides functionality +to serialize the address type and load it from a deserializer.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents a boolean type tag in the type system. +This class extends the base TypeTag class and provides +methods for serialization and deserialization of the boolean +type tag.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Serializes the current instance's properties into a provided serializer. +This function ensures that the address, module name, name, and type arguments are properly serialized.
+The serializer instance used to serialize the properties.
+Returns the string representation of the object.
+The string representation of the object.
+StaticloadDeserializes a StructTag and returns a new TypeTagStruct instance.
+The deserializer used to read the StructTag data.
+Signed integer helpers
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents 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.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents a type tag for the i128 data type. +This class extends the base TypeTag class and provides methods for serialization and deserialization.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents a type tag for signed 16-bit integers (i16). +This class extends the base TypeTag class and provides methods for serialization and deserialization.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents a type tag for the I256 data type. +This class extends the base TypeTag class and provides methods for serialization and deserialization.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents a type tag for a 32-bit signed integer (i32). +This class extends the base TypeTag class and provides methods for serialization +and deserialization specific to the i32 type.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents a type tag for 64-bit signed integers (i64). +This class extends the base TypeTag class and provides methods for serialization and deserialization.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents a type tag for an 8-bit signed integer (i8). +This class extends the base TypeTag class and provides methods +for serialization and deserialization specific to the i8 type.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents an error that occurs during the parsing of a type tag. +This error extends the built-in Error class and provides additional context +regarding the specific type tag that failed to parse and the reason for the failure.
+Constructs an error indicating a failure to parse a type tag. +This error provides details about the specific type tag that could not be parsed and the reason for the failure.
+The string representation of the type tag that failed to parse.
+The reason why the type tag is considered invalid.
+StaticcaptureCreates a .stack property on targetObject, which when accessed returns
+a string representing the location in the code at which
+Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
+
+
+The first line of the trace will be prefixed with
+${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
+above constructorOpt, including constructorOpt, will be omitted from the
+generated stack trace.
The constructorOpt argument is useful for hiding implementation
+details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
+
+
+OptionalconstructorOpt: FunctionStaticprepareOptionalcauseOptionalstackStaticstackThe Error.stackTraceLimit property specifies the number of stack frames
+collected by a stack trace (whether generated by new Error().stack or
+Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
+will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.
+Represents a reference to a type tag in the type system. +This class extends the TypeTag class and provides functionality +to serialize and deserialize type tag references.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Initializes a new instance of the class with the specified parameters.
+The TypeTag to reference.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents a type tag for a signer in the system. +This class extends the base TypeTag and provides specific functionality +related to the signer type.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents 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.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Checks if the provided value is a 'DelegationKey' for permissioned signers.
+Returns true if the value is a DelegationKey, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Checks if the provided value is of type 'object'. +This function helps determine if a value can be treated as an object type in the context of the SDK.
+Returns true if the value is an object, otherwise false.
+Checks if the specified account address is of type "option".
+Returns true if the account address is an option type, otherwise false.
+Checks if the provided value is of type RateLimiter.
Returns true if the value is a RateLimiter, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Checks if the provided value is of type string. +This function can help ensure that the data being processed is in the correct format before further operations.
+Returns true if the value is a string, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the provided address, module name, and struct name match the current type tag.
+The account address to compare against the type tag.
+The name of the module to compare against the type tag.
+The name of the struct to compare against the type tag.
+True if the address, module name, and struct name match the type tag; otherwise, false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents a type tag for the u128 data type. +This class extends the base TypeTag class and provides methods for serialization and deserialization.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents a type tag for unsigned 16-bit integers (u16). +This class extends the base TypeTag class and provides methods for serialization and deserialization.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents a type tag for the U256 data type. +This class extends the base TypeTag class and provides methods for serialization and deserialization.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents a type tag for a 32-bit unsigned integer (u32). +This class extends the base TypeTag class and provides methods for serialization +and deserialization specific to the u32 type.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents a type tag for 64-bit unsigned integers (u64). +This class extends the base TypeTag class and provides methods for serialization and deserialization.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents a type tag for an 8-bit unsigned integer (u8). +This class extends the base TypeTag class and provides methods +for serialization and deserialization specific to the u8 type.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents a vector type tag, which encapsulates a single type tag value. +This class extends the base TypeTag class and provides methods for serialization, +deserialization, and string representation of the vector type tag.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Deserializes a StructTag from the provided deserializer. +This function allows you to reconstruct a StructTag object from its serialized form.
+The deserializer instance used to read the serialized data.
+Determines if the current instance is of type TypeTagAddress.
+True if the instance is a TypeTagAddress, otherwise false.
+Determines if the current instance is of type TypeTagBool.
+True if the instance is a TypeTagBool, otherwise false.
+Determines if the current instance is of type TypeTagGeneric.
+Returns true if the instance is a TypeTagGeneric, otherwise false.
+Determine if the current instance is a TypeTagSigner.
+Returns true if the instance is a TypeTagSigner, otherwise false.
+Determines if the current instance is a structure type.
+True if the instance is of type TypeTagStruct, otherwise false.
+Determines if the current instance is of the TypeTagU128 type.
+True if the instance is of TypeTagU128, otherwise false.
+Checks if the current instance is of type TypeTagU16.
+True if the instance is TypeTagU16, otherwise false.
+Checks if the current instance is of type TypeTagU256.
+Returns true if the instance is of type TypeTagU256, otherwise false.
+Checks if the current instance is of type TypeTagU32.
+Returns true if the instance is TypeTagU32, otherwise false.
+Checks if the current instance is of type TypeTagU64.
+True if the instance is a TypeTagU64, otherwise false.
+Determines if the current instance is of type TypeTagU8.
Returns true if the instance is of type TypeTagU8, otherwise false.
Checks if the current instance is a vector type. +This can help determine the specific type of data structure being used.
+True if the instance is of type TypeTagVector, otherwise false.
+Staticu8Creates a new TypeTagVector instance with a TypeTagU8 type.
+A new TypeTagVector initialized with TypeTagU8.
+Signed integer helpers
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeStaticloadRepresents a 128-bit unsigned integer value. +This class provides methods for serialization and deserialization +of U128 values, ensuring that the values are within the valid range.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Serialize an argument to BCS-serialized bytes as a type aware byte sequence. +The byte sequence contains an enum variant index followed by the BCS-serialized +bytes for a typed argument.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a 16-bit unsigned integer (U16) value. +This class extends the Serializable class and provides methods for serialization +and deserialization of the U16 value.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Serialize an argument to BCS-serialized bytes as a type aware byte sequence. +The byte sequence contains an enum variant index followed by the BCS-serialized +bytes for a typed argument.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a 256-bit unsigned integer (U256) that extends the Serializable class. +This class provides methods for serialization and deserialization of U256 values, +ensuring that the values are within the valid range.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Serialize an argument to BCS-serialized bytes as a type aware byte sequence. +The byte sequence contains an enum variant index followed by the BCS-serialized +bytes for a typed argument.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a 32-bit unsigned integer (U32) that can be serialized and deserialized. +This class ensures that the value is within the valid range for a U32.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Serialize an argument to BCS-serialized bytes as a type aware byte sequence. +The byte sequence contains an enum variant index followed by the BCS-serialized +bytes for a typed argument.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a 64-bit unsigned integer (U64) and provides methods for serialization.
+This class ensures that the value is within the valid range for a U64 and provides +functionality to serialize the value for various use cases, including entry functions +and script functions.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Serialize an argument to BCS-serialized bytes as a type aware byte sequence. +The byte sequence contains an enum variant index followed by the BCS-serialized +bytes for a typed argument.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents an unsigned 8-bit integer (U8) value. +This class extends the Serializable class and provides methods for serialization and deserialization of U8 values.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Serialize an argument to BCS-serialized bytes as a type aware byte sequence. +The byte sequence contains an enum variant index followed by the BCS-serialized +bytes for a typed argument.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeAn abstract representation of a crypto signature, +associated with a specific signature scheme, e.g., Ed25519 or Secp256k1.
+This class represents the product of signing a message directly from a +PrivateKey and can be verified against a CryptoPublicKey.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Get the signature as a hex string with a 0x prefix e.g. 0x123456...
+The hex string representation of the signature.
+Get the raw signature bytes
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a zero-knowledge signature, encapsulating the proof and its associated metadata.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+ReadonlyexpThe max lifespan of the proof
+Optional ReadonlyextraA key value pair on the JWT token that can be specified on the signature which would reveal the value on chain. +Can be used to assert identity or other attributes.
+Optional ReadonlyoverrideThe 'aud' value of the recovery service which is set when recovering an account.
+ReadonlyproofThe proof
+Optional ReadonlytrainingThe training wheels signature
+Get the signature as a hex string with a 0x prefix e.g. 0x123456...
+The hex string representation of the signature.
+Get the raw signature bytes
+StaticfromDeserialize a ZeroKnowledgeSig object from its BCS serialization in bytes.
+The bytes representing the serialized ZeroKnowledgeSig.
+ZeroKnowledgeSig - The deserialized ZeroKnowledgeSig object.
+Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeRepresents a container for different types of zero-knowledge proofs.
+Serializes a Serializable value to its BCS representation.
+This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.
the BCS representation of the Serializable instance as a byte buffer.
+Converts the BCS-serialized bytes of a value into a Hex instance. +This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
+A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
+Returns the hex string representation of the Serializable value with the 0x prefix.
the hex formatas a string prefixed by 0x.
Returns the hex string representation of the Serializable value without the 0x prefix.
the hex format as a string without 0x prefix.
StaticdeserializeVariants of account authenticators used in transactions. +https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L414
+Provides reasons for an address was invalid.
+Variants of public keys used in cryptographic operations.
+Variants of signature types used for cryptographic operations.
+Types of API endpoints used for routing requests in the Aptos network.
+Specifies the schemes for deriving account addresses from various data sources.
+Derives an address using an AUID, used for objects
+Derives an address from a GUID, used for objects
+Derives an address from another object address
+Derives an address from seed bytes, used for named objects
+Derives an address from seed bytes, used for resource accounts
+Variants of ephemeral certificates used in secure transactions.
+Variants of ephemeral public keys used in cryptographic operations.
+Variants of ephemeral signatures used for secure communication.
+The status of the name.
+The name is in good standing.
+The name no longer functions as a primary or target name. It is open to +being claimed by the public.
+The name is past it's expiration date, but only claimable by the current +owner of the name. It does not function as a primary or target name.
+Provides reasons for parsing failures related to hexadecimal values.
+Supported key types and their associated seeds.
+Different MIME types used for data interchange in transactions and responses.
+BCS representation, used for accept type BCS output
+BCS representation, used for transaction submission in BCS input
+JSON representation, used for transaction submission and accept type JSON output
+Different network environments for connecting to services, ranging from production to development setups.
+select columns of table "current_aptos_names"
+column name
+column name
+column name
+column name
+column name
+column name
+column name
+column name
+column name
+column name
+column name
+column name
+column name
+select "current_aptos_names_aggregate_bool_exp_bool_and_arguments_columns" columns of table "current_aptos_names"
+select "current_aptos_names_aggregate_bool_exp_bool_or_arguments_columns" columns of table "current_aptos_names"
+Variants of private keys that can comply with the AIP-80 standard. +https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md
+Supported processor types for the indexer API, sourced from the processor_status table in the indexer database. +https://cloud.hasura.io/public/graphiql?endpoint=https://api.mainnet.aptoslabs.com/v1/graphql
+Variants of script transaction arguments used in Rust, encompassing various data types for transaction processing. +https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs#L11
+Different schemes for signing keys used in cryptographic operations.
+Specifies the signing schemes available for cryptographic operations.
+Policy for determining how subdomains expire in relation to their parent domain.
+Variants of transaction authenticators used in the system. +https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L44
+Executable types for transactions, which can be either a script or an entry function.
+Empty is reserved for Multisig voting transactions, which do not have an executable payload. +https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L685
+Variants of transaction extra configurations, which can include additional settings or parameters. +https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L737
+The inner payload type to support orderless transactions and all future transaction types. +https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478
+The payload for various transaction types in the system. +https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478
+Different types of transaction responses that can occur in the system.
+Variants of transactions used in the system. +https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L440
+Events emitted by the transaction worker during its operation, allowing the dapp to respond to various transaction states.
+Error types related to parsing type tags, indicating various issues encountered during the parsing process.
+Variants of type tags used in the system, encompassing various data types and structures. +https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27
+Variants of zero-knowledge proofs used in cryptographic operations.
+The main function to use when making an API request, returning the response or throwing an AptosApiError on failure.
+Options for the Aptos request, including the URL and path.
+The configuration information for the SDK client instance.
+The type of API being accessed, which determines how the response is handled.
+The response from the API request or throws an AptosApiError if the request fails.
+Decodes a base64 URL-encoded string into its original form. +This function is useful for converting base64 URL-encoded data back to a readable format.
+The base64 URL-encoded string to decode.
+The decoded string.
+Converts a bigint value into a little-endian byte array of a specified length. +This function is useful for representing large integers in a byte format, which is often required for cryptographic operations +or binary data manipulation.
+The number to convert into bytes.
+The desired length of the resulting byte array.
+A Uint8Array containing the little-endian representation of the bigint value.
+Generates a transaction based on the provided arguments
+Note: we can start with one function to support all different payload/transaction types, +and if to complex to use, we could have function for each type
+Generates a transaction based on the provided arguments. +This function can create both simple and multi-agent transactions, allowing for flexible transaction handling.
+The input arguments for generating the transaction.
+Arguments for generating a single signer raw transaction, used in the transaction builder flow.
+OptionalfeePayerAddress?: AccountAddressInputOptionaloptions?: InputGenerateTransactionOptionsAn instance of a transaction, which may include secondary signer addresses and a fee payer address.
+Converts a little-endian byte array into a BigInt. +This function is useful for interpreting byte data as a numerical value in a way that respects the little-endian format.
+The byte array to convert.
+The resulting BigInt representation of the byte array.
+Checks if the provided argument is BCS encoded and converts it if necessary, ensuring type compatibility with the ABI. +This function helps in validating and converting arguments for entry functions based on their expected types.
+The argument to check or convert, which can be either a simple or entry function argument type.
+The expected type tag for the argument.
+The position of the argument in the function call.
+An array of generic type parameters that may be used for conversion.
+OptionalmoduleAbi: MoveModuleOptionaloptions: { allowUnknownStructs?: boolean }Amount is represented in the smallest unit format on chain, this function converts +a human-readable amount format to the smallest unit format
+The value in human-readable format
+The token decimal
+The value in the smallest units
+Amount is represented in the smallest unit format on chain, this function converts +the smallest unit format to a human-readable amount format
+The value in human-readable format
+The token decimal
+The value in the smallest units
+Converts a non-BCS encoded argument into BCS encoded, if necessary. +This function checks the provided argument against the expected parameter type and converts it accordingly.
+The name of the function for which the argument is being converted.
+The ABI (Application Binary Interface) of the function, which defines its parameters.
+The argument to be converted, which can be of various types.
+The index of the argument in the function's parameter list.
+An array of type tags for any generic type parameters.
+Optionaloptions: { allowUnknownStructs?: boolean }Options for the conversion process.
+OptionalallowUnknownStructs?: booleanIf true, unknown structs will be allowed and converted to a FixedBytes.
Converts a number or a string representation of a number into a number type. +This function is useful for ensuring that the input is in a consistent numeric format, +which can help prevent type mismatches in further processing.
+The input value to be converted. This can be a number, a string representing a number, or any other type.
+Returns the converted number if the input is valid; otherwise, it returns undefined.
+OptionalreplayProtectionNonce: bigintCreates an object address from creator address and seed
+The object creator account address
+The seed in either Uint8Array | string type
+The object account address
+Creates a resource address from creator address and seed
+The creator account address
+The seed in either Uint8Array | string type
+The resource account address
+Creates a token object address from creator address, collection name and token name
+The token creator account address
+The collection name
+The token name
+The token account address
+Creates a user derived object address from source address and derive_from address
+The source account address
+The address to derive from
+The user derived object address
+Derives the appropriate raw transaction type based on the provided transaction details. +This function helps in identifying whether the transaction is a FeePayerRawTransaction, +MultiAgentRawTransaction, or a standard RawTransaction.
+An object representing an Aptos transaction, which may include:
+FeePayerRawTransaction | MultiAgentRawTransaction | RawTransaction
+Deserialize a Script Transaction Argument. +This function retrieves and deserializes various types of script transaction arguments based on the provided deserializer.
+The deserializer used to read the script transaction argument.
+The deserialized script transaction argument.
+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.
+The address of the module containing the entry function.
+The name of the module containing the entry function.
+The name of the entry function to fetch the ABI for.
+The configuration settings for Aptos.
+An object containing the number of signers, type parameters, and function parameters.
+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.
+The address of the module from which to fetch the function ABI.
+The name of the module containing the function.
+The name of the function whose ABI is to be fetched.
+The configuration settings for Aptos.
+Fetches the JWK from the issuer's well-known JWKS endpoint.
+The kid of the JWK to fetch
+The keyless public key which contains the issuer the address to fetch the JWK from (0x1 if not federated).
+A JWK matching the kid in the JWT header.
Fetches the ABI of a specified module from the on-chain module ABI. +Results are cached for 5 minutes to reduce redundant network calls.
+The address of the module from which to fetch the ABI.
+The name of the module containing the ABI.
+The configuration settings for Aptos.
+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.
+The address of the module containing the view function.
+The name of the module containing the view function.
+The name of the view function for which to fetch the ABI.
+The configuration settings for Aptos.
+An object containing the type parameters, parameters, and return types of the view function.
+Finds the index of the first non-signer argument in the function ABI parameters.
+A function is often defined with a signer or &signer arguments at the start, which are filled in
+by signatures and not by the caller. This function helps identify the position of the first argument that
+can be provided by the caller, allowing for easier handling of function parameters.
The ABI of the function to analyze.
+The index of the first non-signer argument, or the length of the parameters array if none are found.
+Generates a raw transaction that can be sent to the Aptos network.
+The arguments for generating the raw transaction.
+The configuration for the Aptos network.
+OptionalfeePayerAddress?: AccountAddressInputThe address of the fee payer for sponsored transactions.
+Optionaloptions?: InputGenerateTransactionOptionsOptional parameters for transaction generation.
+The transaction payload, which can be created using generateTransactionPayload().
+The transaction's sender account address as a hex input.
+RawTransaction - The generated raw transaction.
+Generate 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.
+The input data required to generate the signed transaction.
+A Uint8Array representing the signed transaction in bytes.
+Generate 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.
+The input data required to generate the signed transaction for simulation.
+The data required to simulate a transaction, typically generated by generateTransaction().
OptionalfeePayerPublicKey?: PublicKeyFor a fee payer transaction (aka Sponsored Transaction)
+Optionaloptions?: InputSimulateTransactionOptionsOptionalsecondarySignersPublicKeys?: (PublicKey | undefined)[]For a fee payer or multi-agent transaction that requires additional signers in
+OptionalsignerPublicKey?: PublicKeyFor a single signer transaction
+The transaction to simulate, probably generated by generateTransaction()
A signed serialized transaction that can be simulated.
+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.
+The byte representation of the message to be signed and sent to the chain.
+A domain separator that starts with 'APTOS::'.
+The Uint8Array of the signing message.
+An object that has a BCS serialized form.
+The Uint8Array of the signing message.
+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.
+A transaction that is to be signed, which can include a fee payer address or secondary signer addresses.
+The Uint8Array of the signing message.
+Builds a transaction payload based on the data argument and returns +a transaction payload - TransactionPayloadScript | TransactionPayloadMultiSig | TransactionPayloadEntryFunction
+This uses the RemoteABI by default, and the remote ABI can be skipped by using generateTransactionPayloadWithABI
+Builds a transaction payload based on the provided arguments and returns a transaction payload.
+This function uses the RemoteABI by default, but can also utilize a specified ABI.
+When we call our generateTransactionPayload function with the relevant type properties,
+Typescript can infer the return type based on the appropriate function overload.
The input data for generating the transaction payload.
+The data needed to generate a Script payload.
+OptionaltypeArguments?: TypeArgument[]TransactionPayload - The generated transaction payload, which can be of type TransactionPayloadScript, +TransactionPayloadMultiSig, or TransactionPayloadEntryFunction.
+Generates a transaction payload using the provided ABI and function details. +This function helps create a properly structured transaction payload for executing a specific function on a module.
+The input data required to generate the transaction payload.
+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.
+The input data required to submit the transaction.
+Generates the payload for a view function call using the provided arguments. +This function helps in preparing the necessary data to interact with a specific view function on the blockchain.
+The input data required to generate the view function payload.
+The generated payload for the view function call.
+Generates a payload for a view function call using the provided ABI and arguments. +This function ensures that the type arguments and function arguments are correctly formatted +and match the expected counts as defined in the ABI.
+The input data for generating the view function payload.
+Executes a GET request to retrieve data based on the provided options.
+The options for the GET request.
+Options for making a GET request, including configuration for the API client.
+OptionalacceptType?: MimeTypeThe accepted content type of the response of the API
+The config for the API client
+OptionalcontentType?: MimeTypeThe content type of the request body
+The name of the API method
+Optionaloverrides?: ClientConfigSpecific client overrides for this request to override aptosConfig
+Optionalparams?: Record<string, string | AnyNumber | boolean | undefined>The query parameters for the request
+The URL path to the API method
+The type of API endpoint to call e.g. fullnode, indexer, etc
+The response from the GET request.
+Retrieves data from the Aptos full node using the provided options.
+The options for the request to the Aptos full node.
+A promise that resolves with the response from the Aptos full node.
+Makes a GET request to the Aptos Pepper service to retrieve data.
+The options for the request.
+AptosResponse - The response from the Aptos Pepper service.
+OptionalpublicKey: PublicKeySplits a function identifier into its constituent parts: module address, module name, and function name. +This function helps in validating and extracting details from a function identifier string.
+The function identifier string in the format "moduleAddress::moduleName::functionName".
+An object containing the module address, module name, and function name.
+Parses a JWT and returns the 'iss', 'aud', and 'uid' values.
+The arguments for parsing the JWT.
+The JWT to parse.
+OptionaluidKey?: stringThe key to use for the 'uid' value; defaults to 'sub'.
+The 'iss', 'aud', and 'uid' values from the JWT.
+Retrieves the configuration parameters for Keyless Accounts on the blockchain, including the verifying key and the maximum +expiry horizon.
+The arguments for retrieving the keyless configuration.
+The Aptos configuration object containing network details.
+Optionaloptions?: LedgerVersionArgOptional parameters for the request.
+KeylessConfiguration - The configuration object containing the verifying key and maximum expiry horizon.
+Fetches JWKs from the blockchain with optional caching.
+The Aptos configuration object.
+OptionaljwkAddr?: AccountAddressInputOptional. The address to fetch JWKs from (for federated keyless).
+Optionaloptions?: LedgerVersionArgOptional. Ledger version options.
+OptionaluseCache?: booleanOptional. Whether to use cached JWKs. Defaults to true.
+A map of issuer to JWK arrays.
+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.
+The string to be hashed.
+The maximum size in bytes for the resulting hash.
+bigint - The result of the hash.
+Hashes the set of values using a SHA-3 256 hash algorithm.
+An array of UTF-8 strings or Uint8Array byte arrays to be hashed.
+Determines if the given transaction response is of the type Block Epilogue.
+The transaction response to evaluate.
+A boolean indicating whether the response is a Block Epilogue transaction.
+Determine if the given transaction response is of type BlockMetadata.
+The transaction response to evaluate.
+A boolean indicating whether the response is a BlockMetadata transaction.
+Determines if the provided argument is of type boolean. +This can help in validating input types before processing them further.
+The argument to check, which can be of various types.
+A boolean indicating whether the argument is a boolean.
+Checks if an ED25519 signature is non-canonical. +This function helps determine the validity of a signature by verifying its canonical form.
+The signature to be checked for canonicality.
+A boolean indicating whether the signature is non-canonical.
+Comes from Aptos Core +https://github.com/aptos-labs/aptos-core/blob/main/crates/aptos-crypto/src/ed25519/ed25519_sigs.rs#L47-L85
+Determine if the provided signature is an Ed25519 signature. +This function checks for the presence of the "signature" property +and verifies that its value is "ed25519_signature".
+The transaction signature to be checked.
+A boolean indicating whether the signature is an Ed25519 signature.
+Checks if the provided argument is empty, meaning it is either null or undefined.
+The argument to check for emptiness.
+A boolean indicating whether the argument is empty.
+Determines if the provided argument is a valid encoded entry function argument type. +This function helps validate that the argument conforms to the expected types for entry function parameters.
+The argument to check, which can be of type EntryFunctionArgumentTypes or SimpleEntryFunctionArgumentTypes.
+Determines whether the given object is an encoded struct type with the following properties:
+The object to check
+Whether the object is an encoded struct type
+Determine if the provided signature is a fee payer signature.
+The transaction signature to evaluate.
+A boolean indicating whether the signature is a fee payer signature.
+Determines if the given transaction response is a Genesis transaction.
+The transaction response to evaluate.
+A boolean indicating whether the transaction is a Genesis transaction.
+Determines if the provided argument is a large number, which can be a number, bigint, or string representation of a number.
+The argument to check, which can be of type number, bigint, or string.
+Determine if the provided transaction signature is a multi-agent signature.
+The transaction signature to evaluate.
+A boolean indicating whether the signature is a multi-agent signature.
+Determine if the provided signature is of type "multi_ed25519_signature".
+The transaction signature to check.
+A boolean indicating whether the signature is a multi-ed25519 signature.
+Determines if the provided argument is of type number.
+The argument to check, which can be of various types.
+A boolean indicating whether the argument is a number.
+Determine if the given transaction response is currently pending.
+The transaction response to evaluate.
+A boolean indicating whether the transaction is pending.
+Determines if the provided argument contains script data input by checking for the presence of bytecode.
+The input data to be checked, which can either be a payload with remote ABI or a standard payload.
+The data needed to generate an Entry Function payload.
+Optionalabi?: EntryFunctionABIOptionalfunctionArguments?: (EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes)[]OptionaltypeArguments?: TypeArgument[]The data needed to generate a Script payload.
+OptionaltypeArguments?: TypeArgument[]Determine if the provided signature is a valid secp256k1 ECDSA signature.
+The transaction signature to validate.
+A boolean indicating whether the signature is a secp256k1 ECDSA signature.
+Determine if the provided signature is of type "single_sender".
+The transaction signature to check.
+A boolean indicating whether the signature is a single-sender signature.
+Determines if the provided transaction response is a state checkpoint transaction.
+The transaction response to evaluate.
+A boolean indicating whether the transaction response is of type StateCheckpoint.
+Determines if the given transaction response is a user transaction.
+The transaction response to evaluate.
+A boolean indicating whether the transaction is of type User.
+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. +Parse and validate a path that is compliant to BIP-44 in form m/44'/637'/{account_index}'/{change_index}/{address_index} +for Secp256k1
+Note that for Secp256k1, the last two components must be non-hardened.
+The path string to validate (e.g. m/44'/637'/0'/0/0).
Aptos derive path is 637
+Parse and validate a path that is compliant to SLIP-0010 and BIP-44 +in form m/44'/637'/{account_index}'/{change_index}'/{address_index}'. +See SLIP-0010 https://github.com/satoshilabs/slips/blob/master/slip-0044.md +See BIP-44 https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki
+Note that for Ed25519, all components must be hardened. +This is because non-hardened [PK] derivation would not work due to Ed25519's lack of a key homomorphism. +Specifically, you cannot derive the PK associated with derivation path a/b/c given the PK of a/b. +This is because the PK in Ed25519 is, more or less, computed as 𝑔𝐻(𝑠𝑘), +with the hash function breaking the homomorphism.
+The derivation path string to validate (e.g. m/44'/637'/0'/0'/0').
Determine if the given transaction response is of type Validator.
+The transaction response to evaluate.
+A boolean indicating whether the transaction response is a Validator type.
+Normalizes an instance of a class by deserializing it from its byte representation.
+This function allows the instanceof operator to work correctly when the input objects originate from a different bundle.
The class of the object to normalize.
+The instance to normalize.
+Pads and packs the given byte array to a specified maximum size and appends its length. +This function ensures that the byte array does not exceed the maximum size, throwing an error if it does. +It is useful for preparing byte data for further processing or transmission by ensuring a consistent format.
+The byte array to be padded and packed.
+The maximum allowed size for the byte array.
+A new Uint8Array that contains the padded and packed bytes along with the length of the original byte array.
+This function is a helper for paginating using a function wrapping an API
+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.
+The coin type string in any of these formats:
+The calculated metadata address as an AccountAddress instance
+// All these formats are valid and will produce the same result:
pairedFaMetadataAddress("0x1::aptos_coin::AptosCoin") // simple form
pairedFaMetadataAddress("0x0000000000000000000000000000000000000000000000000000000000000001::aptos_coin::AptosCoin") // long form
pairedFaMetadataAddress("0x00001::aptos_coin::AptosCoin") // with leading zeros
pairedFaMetadataAddress("0x1::coin::Coin<0x1412::a::struct<0x0001::aptos_coin::AptosCoin>>") // nested type parameters
+
+
+Convert an encoded struct to a MoveStructId.
+The struct with account_address, module_name, and struct_name properties
+The MoveStructId
+Parses a type string into a structured representation of type tags, accommodating various formats including generics and +nested types.
+This function can help you accurately interpret type strings, which can include simple types, standalone structs, and complex +nested generics. +It supports multiple generics, spacing within generics, and nested generics of varying depths. +All types are made of a few parts they're either:
+There are a few more special cases that need to be handled, however.
+The string representation of the type to be parsed.
+Optionaloptions: { allowGenerics?: boolean }Optional settings for parsing behavior.
+OptionalallowGenerics?: booleanA flag indicating whether to allow generics in the parsing process.
+The parsed type tag representation.
+Hashes up to 16 scalar elements via the Poseidon hashing algorithm. +Each element must be scalar fields of the BN254 elliptic curve group.
+An array of elements to be hashed, which can be of type number, bigint, or string.
+bigint - The result of the hash.
+Executes a POST request to the specified URL with the provided options.
+The options for the POST request.
+Options for making a POST request, including the API client configuration.
+OptionalacceptType?: MimeTypeThe accepted content type of the response of the API
+The config for the API client
+Optionalbody?: anyThe body of the request, should match the content type of the request
+OptionalcontentType?: MimeTypeThe content type of the request body
+The name of the API method
+Optionaloverrides?: ClientConfigSpecific client overrides for this request to override aptosConfig
+Optionalparams?: Record<string, string | AnyNumber | boolean | undefined>The query parameters for the request
+The URL path to the API method
+The type of API endpoint to call e.g. fullnode, indexer, etc
+The response from the POST request.
+Sends a request to the Aptos faucet to obtain test tokens. +This function modifies the provided configuration to ensure that the API_KEY is not included in the request.
+Note that only devnet has a publicly accessible faucet. For testnet, you must use +the minting page at https://aptos.dev/network/faucet.
+The options for the request.
+Sends a request to the Aptos full node using the specified options. +This function allows you to interact with the Aptos blockchain by sending requests to the full node.
+The options for the request.
+Sends a request to the Aptos indexer with the specified options. +This function allows you to interact with the Aptos indexer and customize the request using various configurations.
+The options for the request to the Aptos indexer.
+Makes a post request to the pepper service.
+The options for the request.
+A promise that resolves to the response from the pepper service.
+Sends a request to the Aptos proving service with the specified options.
+The options for the request to the Aptos proving service.
+Sends a request using the specified options and returns the response.
+The options for the request.
+Represents a client for making requests to a service provider.
+Optionalbody?: ReqOptionalcontentType?: stringOptionalheaders?: Record<string, any>Optionalhttp2?: booleanOptionaloriginMethod?: stringOptionaloverrides?: ClientHeadersType & {Optionalparams?: anyThe client used to make the request.
+The response from the request.
+Convert type arguments to only type tags, allowing for string representations of type tags.
+OptionaltypeArguments: TypeArgument[]An optional array of type arguments that may include string representations.
+An array of TypeTag objects derived from the provided type arguments.
+Throws an error indicating a type mismatch for a specified argument position. +This function helps in debugging by providing clear feedback on expected types.
+The type that was expected for the argument.
+The position of the argument that caused the type mismatch.
+Truncates the provided wallet address at the middle with an ellipsis.
+The wallet address to truncate.
+The number of characters to show at the beginning of the address.
+The number of characters to show at the end of the address.
+The truncated address.
+Validates that a given number is within a specified range. +This function throws an error if the value is outside the defined minimum and maximum bounds.
+Syncronously verifies a keyless signature for a given message. You need to provide the keyless configuration and the +JWK to use for verification.
+The JWK to use for verification.
+The keyless configuration.
+The message to verify the signature against.
+The signature to verify.
+true if the signature is valid
+Logs a warning message to the console only in development environments. +This function helps reduce information leakage in production while maintaining +helpful warnings during development.
+The warning message to log.
+The TypeScript SDK allows you to connect, explore, and interact with the Aptos blockchain. You can use it to request data, send transactions, set up test environments, and more!
+For comprehensive guides, tutorials, and API reference, visit aptos.dev:
+Install with your favorite package manager such as npm, yarn, or pnpm:
+pnpm install @aptos-labs/ts-sdk
+
+
+The SDK is compatible with the Bun runtime. Install the SDK using Bun's package manager:
+bun add @aptos-labs/ts-sdk
+
+
+You can add the SDK to your web application using a script tag:
+<script src="https://unpkg.com/@aptos-labs/ts-sdk/dist/browser/index.global.js"></script>
+
+
+Then, the SDK can be accessed through window.aptosSDK.
Create an Aptos client in order to access the SDK's functionality.
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk"
// You can use AptosConfig to choose which network to connect to
const config = new AptosConfig({ network: Network.TESTNET });
// Aptos is the main entrypoint for all functions
const aptos = new Aptos(config);
+
+
+Bun's HTTP/2 support is not fully mature yet. You need to disable HTTP/2 to ensure the SDK works properly:
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const aptos = new Aptos(new AptosConfig({ network: Network.TESTNET, clientConfig: { http2: false } }));
+
+
+const accountInfo = await aptos.getAccountInfo({ accountAddress: "0x123" });
const modules = await aptos.getAccountModules({ accountAddress: "0x123" });
const tokens = await aptos.getAccountOwnedTokens({ accountAddress: "0x123" });
+
+
+++Note: We introduce a Single Sender authentication (as introduced in AIP-55). Generating an account defaults to Legacy Ed25519 authentication with the option to use the Single Sender unified authentication.
+
const account = Account.generate(); // defaults to Legacy Ed25519
const account = Account.generate({ scheme: SigningSchemeInput.Secp256k1Ecdsa }); // Single Sender Secp256k1
const account = Account.generate({ scheme: SigningSchemeInput.Ed25519, legacy: false }); // Single Sender Ed25519
+
+
+// Create a private key instance for Ed25519 scheme
const privateKey = new Ed25519PrivateKey("myEd25519privatekeystring");
// Or for Secp256k1 scheme
const privateKey = new Secp256k1PrivateKey("mySecp256k1privatekeystring");
// Derive an account from private key
// This is used as a local calculation and therefore is used to instantiate an `Account`
// that has not had its authentication key rotated
const account = Account.fromPrivateKey({ privateKey });
// Also, can use this function that resolves the provided private key type and derives the public key from it
// to support key rotation and differentiation between Legacy Ed25519 and Unified authentications
const aptos = new Aptos();
const account = await aptos.deriveAccountFromPrivateKey({ privateKey });
+
+
+// Create a private key instance for Ed25519 scheme
const privateKey = new Ed25519PrivateKey("myEd25519privatekeystring");
// Or for Secp256k1 scheme
const privateKey = new Secp256k1PrivateKey("mySecp256k1privatekeystring");
// Derive an account from private key and address
// Create an AccountAddress instance from the account address string.
const address = AccountAddress.from("myaccountaddressstring");
// Derive an account from private key and address
const account = Account.fromPrivateKeyAndAddress({ privateKey, address });
+
+
+const path = "m/44'/637'/0'/0'/1";
const mnemonic = "various float stumble...";
const account = Account.fromDerivationPath({ path, mnemonic });
+
+
+/**
* This example shows how to use the Aptos SDK to send a transaction.
* Don't forget to install @aptos-labs/ts-sdk before running this example!
*/
import {
Account,
Aptos,
AptosConfig,
Network,
} from "@aptos-labs/ts-sdk";
async function example() {
console.log("This example will create two accounts (Alice and Bob) and send a transaction transferring APT to Bob's account.");
// 0. Setup the client and test accounts
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
let alice = Account.generate();
let bob = Account.generate();
console.log("=== Addresses ===\n");
console.log(`Alice's address is: ${alice.accountAddress}`);
console.log(`Bob's address is: ${bob.accountAddress}`);
console.log("\n=== Funding accounts ===\n");
await aptos.fundAccount({
accountAddress: alice.accountAddress,
amount: 100_000_000,
});
await aptos.fundAccount({
accountAddress: bob.accountAddress,
amount: 100,
});
console.log("Funded Alice and Bob's accounts!")
// 1. Build
console.log("\n=== 1. Building the transaction ===\n");
const transaction = await aptos.transaction.build.simple({
sender: alice.accountAddress,
data: {
// All transactions on Aptos are implemented via smart contracts.
function: "0x1::aptos_account::transfer",
functionArguments: [bob.accountAddress, 100],
},
});
console.log("Built the transaction!")
// 2. Simulate (Optional)
console.log("\n === 2. Simulating Response (Optional) === \n")
const [userTransactionResponse] = await aptos.transaction.simulate.simple({
signerPublicKey: alice.publicKey,
transaction,
});
console.log(userTransactionResponse)
// 3. Sign
console.log("\n=== 3. Signing transaction ===\n");
const senderAuthenticator = aptos.transaction.sign({
signer: alice,
transaction,
});
console.log("Signed the transaction!")
// 4. Submit
console.log("\n=== 4. Submitting transaction ===\n");
const submittedTransaction = await aptos.transaction.submit.simple({
transaction,
senderAuthenticator,
});
console.log(`Submitted transaction hash: ${submittedTransaction.hash}`);
// 5. Wait for results
console.log("\n=== 5. Waiting for result of transaction ===\n");
const executedTransaction = await aptos.waitForTransaction({ transactionHash: submittedTransaction.hash });
console.log(executedTransaction)
};
example();
+
+
+If you see an import error when you do this:
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
+
+
+It could be that your tsconfig.json is not using node. Make sure your moduleResolution in the tsconfig.json is set to node instead of bundler.
If you found a bug or would like to request a feature, please file an issue. +If, based on the discussion on an issue, you would like to offer a code change, please make a pull request. +If neither of these describes what you would like to contribute, check out the contributing guide.
+To run a unit test in this repo, for example, the keyless end-to-end unit test in tests/e2e/api/keyless.test.ts:
pnpm jest keyless.test.ts
+
+
+The domain name. ie "aptos.apt" would have a domain of "aptos"
+The expiration timestamp of the domain in milliseconds since epoch.
+This is a derived date value. It takes into consideration if the name is a +subdomain and its expiration policy.
+The status of the name's expiration.
+The expiration timestamp of the name in milliseconds since epoch. Note, if +the name is not a subdomain, this will be the same as the domain expiration +timestamp.
+If the name is registered as a primary name for any account. It is +possible to have multiple primary names returned in a single query.
+Whether the name is in the renewable period. This incorporates leading time +before the name expires and the grace period after the name expires.
+Optionalowner_The address of the wallet that owns the name.
+Optionalregistered_The address that the name points to. For example, if you send a transaction +to "aptos.apt" with a target address of "0x1", the registered_address will +be "0x1".
+OptionalsubdomainThe subdomain name, if the name is a subdomain. ie "name.aptos.apt" would have a subdomain of "name"
+The expiration policy for the subdomain. See SubdomainExpirationPolicy for more details.
+The token standard for the name. See AnsTokenStandard for more details.
+Sends a request to the specified URL with the given options.
+The options for the request.
+Represents a client for making requests to a service provider.
+Optionalbody?: ReqOptionalcontentType?: stringOptionalheaders?: Record<string, any>Optionalhttp2?: booleanOptionaloriginMethod?: stringOptionaloverrides?: ClientHeadersType & {Optionalparams?: anyRepresents a client for making requests to a service provider.
+The type of the request payload.
+OptionalbodyOptionalcontentOptionalheadersOptionalhttp2OptionaloriginOptionaloverridesOptionalparamsArguments for creating an Account from a private key when the key type is unknown at compile time.
Arguments for creating an Ed25519Account from an Ed25519PrivateKey.
+To use the SingleKey authentication scheme, set legacy to false.
Arguments for creating a SingleKeyAccount using an Ed25519PrivateKey.
+The legacy property must be set to false to utilize the SingleKey authentication scheme.
Arguments for creating a SingleKeyAccount from a supported private key, excluding Ed25519PrivateKey.
+The legacy argument is always false and cannot be set to true.
Defines the parameters for paginating query results, including the starting position and maximum number of items to return.
+This interface exists to define Deserializable
The type that this will deserialize into.
+Deserializes the buffered bytes into an instance of the specified class type.
+This function provides an alternative syntax for deserialization, allowing users to call
+deserializer.deserialize(MyClass) instead of MyClass.deserialize(deserializer).
The deserializer instance with the buffered bytes.
+The deserialized value of class type T.
+Arguments required to create an instance of an Ed25519 signer.
+Arguments for creating an Ed25519 signer from a derivation path.
+Represents an argument for entry functions, providing methods to serialize the argument +to BCS-serialized bytes and convert it to different formats.
+Convert the argument to BCS-serialized bytes.
+Uint8Array representing the BCS-serialized bytes of the argument.
+Converts the BCS-serialized bytes of an argument into a hexadecimal representation. +This function is useful for obtaining a Hex instance that encapsulates the BCS-serialized bytes, +allowing for easier manipulation and representation of the data.
+A Hex instance containing the BCS-serialized bytes.
+Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Arguments for generating a multi-agent transaction, used in the generateTransaction() method of the transaction builder flow.
Holds user data input for generating a multi-agent transaction.
+Arguments for generating a single signer raw transaction, used in the transaction builder flow.
+Holds user input data for generating a single signer transaction.
+OptionalpluginAdditional parameters that will be passed to the transaction submitter plugin if +configured.
+OptionaltransactionYou can set this to override the configured transaction submitter (if any). +Conversely you can set this to null to ignore any configured transaction submitter.
+An interface which defines if an Account utilizes Keyless signing.
+Abstract ReadonlyaccountAccount address associated with the account
+Abstract ReadonlypublicPublic key associated with the account
+AbstractsigningSigning scheme used to sign transactions
+AbstractsignAbstractsignSign the given transaction using the available signing capabilities.
+the transaction to be signed
+Signature
+AbstractsignSign a transaction using the available signing capabilities.
+the raw transaction
+the AccountAuthenticator containing the signature of the transaction, together with the account's public key
+AbstractsignSign a message using the available signing capabilities.
+the signing message, as binary input
+the AccountAuthenticator containing the signature, together with the account's public key
+Verify the given message and signature with the public key. +This function helps ensure the integrity and authenticity of a message by validating its signature.
+The arguments for verifying the signature.
+Represents the arguments required to verify a digital signature.
+A boolean indicating whether the signature is valid.
+Verify the given message and signature with the public key. It fetches any on chain state if needed for verification.
+The arguments for verifying the signature.
+The configuration object for connecting to the Aptos network
+Raw message data in HexInput format.
+Signed message signature.
+A boolean indicating whether the signature is valid.
+Options for creating a collection, allowing customization of various attributes such as supply limits, mutability of metadata, +and royalty settings.
+OptionalmaxOptionalmutableOptionalmutableOptionalmutableOptionalmutableOptionalmutableOptionalmutableOptionalmutableOptionalroyaltyOptionalroyaltyOptionaltokensOptionaltokensBase interface for all elliptic curve Points.
+Massively speeds up p.multiply(n) by using precompute tables (caching). See wNAF.
OptionalwindowSize: numberOptionalisLazy: booleancalculate cache now. Default (true) ensures it's deferred to first multiply()
Arguments for retrieving the domains associated with a specific account.
+Arguments for retrieving account names based on the specified account address.
+Arguments for retrieving subdomains associated with a specific account.
+Arguments for retrieving subdomains associated with a specific domain.
+OptionaltoOptionalinvertedZ: anyThe 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.
+Options for querying names, including pagination, ordering, and filtering criteria.
+Parameters for registering a name in the Aptos network.
+Instance methods for 3D XYZ projective points.
+affine x coordinate. Different from projective X.
+affine y coordinate. Different from projective Y.
+Massively speeds up p.multiply(n) by using precompute tables (caching). See wNAF.
OptionalwindowSize: numberOptionalisLazy: booleancalculate cache now. Default (true) ensures it's deferred to first multiply()
Encodes point using IEEE P1363 (DER) encoding. First byte is 2/3/4. Default = isCompressed.
+OptionalisCompressed: booleanOptionalisCompressed: booleanArguments for deriving a private key using a mnemonic phrase and a specified BIP44 path.
+Represents an argument for script functions, providing methods to serialize and convert to bytes.
+Serialize an argument to BCS-serialized bytes as a type aware byte sequence. +The byte sequence contains an enum variant index followed by the BCS-serialized +bytes for a typed argument.
+An interface which defines if an Account utilizes SingleKey signing.
+Such an account will use the AnyPublicKey enum to represent its public key when deriving the auth key.
+Abstract ReadonlyaccountAccount address associated with the account
+Abstract ReadonlypublicPublic key associated with the account
+AbstractsigningSigning scheme used to sign transactions
+AbstractsignAbstractsignSign the given transaction using the available signing capabilities.
+the transaction to be signed
+Signature
+AbstractsignSign a transaction using the available signing capabilities.
+the raw transaction
+the AccountAuthenticator containing the signature of the transaction, together with the account's public key
+AbstractsignSign a message using the available signing capabilities.
+the signing message, as binary input
+the AccountAuthenticator containing the signature, together with the account's public key
+Verify the given message and signature with the public key. +This function helps ensure the integrity and authenticity of a message by validating its signature.
+The arguments for verifying the signature.
+Represents the arguments required to verify a digital signature.
+A boolean indicating whether the signature is valid.
+Verify the given message and signature with the public key. It fetches any on chain state if needed for verification.
+The arguments for verifying the signature.
+The configuration object for connecting to the Aptos network
+Raw message data in HexInput format.
+Signed message signature.
+A boolean indicating whether the signature is valid.
+Arguments required to create a single key signer.
+Arguments for generating a single key signer.
+Represents an argument for entry functions, providing methods to serialize the argument +to BCS-serialized bytes and convert it to different formats.
+Convert the argument to BCS-serialized bytes.
+Uint8Array representing the BCS-serialized bytes of the argument.
+Converts the BCS-serialized bytes of an argument into a hexadecimal representation. +This function is useful for obtaining a Hex instance that encapsulates the BCS-serialized bytes, +allowing for easier manipulation and representation of the data.
+A Hex instance containing the BCS-serialized bytes.
+Serialize an argument to BCS-serialized bytes.
+The serializer instance used for serialization.
+Serialize an argument to BCS-serialized bytes. +Serialize an argument as a type-agnostic, fixed byte sequence. The byte sequence contains +the number of the following bytes followed by the BCS-serialized bytes for a typed argument.
+The serializer used to convert the argument.
+Serialize an argument to BCS-serialized bytes as a type aware byte sequence. +The byte sequence contains an enum variant index followed by the BCS-serialized +bytes for a typed argument.
+You can implement this interface and set it in PluginSettings when building a +client to override the default transaction submission behavior. This is useful if +you'd like to submit transactions via a gas station for example.
+class MyGasStationClient implements TransactionSubmitter {
async submitTransaction(
args: { aptosConfig: AptosConfig } & InputSubmitTransactionData,
): Promise<PendingTransactionResponse> {
// TODO: Implement the logic to submit the transaction to the gas station
}
}
const network = Network.MAINNET;
const myGasStationClient = new MyGasStationClient(network);
const config = new AptosConfig({
network,
pluginConfig: {
transactionSubmitter: myGasStationClient,
},
});
const aptos = new Aptos(config);
+
+
+Submit a transaction to the Aptos blockchain or something that will do it on your +behalf, for example a gas station. See the comments of TransactionSubmitter for more.
+The arguments for submitting the transaction.
+The configuration for connecting to the Aptos network.
+PendingTransactionResponse - The response containing the status of the submitted transaction.
+Defines the events emitted by the transaction worker during various stages of transaction processing. *
+Represents the arguments required to verify a digital signature.
+Utility functions for working with accounts.
+The input for an account address, which can be either a hexadecimal string or a standard account address.
+The data associated with an account, including its sequence number.
+The union of all single account signatures, including Ed25519, Secp256k1, and MultiEd25519 signatures.
+The token standard for the ANS name. v1 is the original token standard, v2 is +the new token standard. v1 has been deprecated.
+A number or a bigint value.
+Unified type that holds all the return interfaces when generating different transaction types
+Holds all return interfaces for generating different transaction types.
+The transaction payload type generated from the generateTransactionPayload() function, which can be an entry function,
+script, or multi-signature payload.
The API request type
+the url to make the request to, i.e. https://fullnode.devnet.aptoslabs.com/v1
+Configuration options for initializing the SDK, allowing customization of its behavior and interaction with the Aptos network.
+Optional ReadonlyclientOptional ReadonlyclientOptional ReadonlyfaucetOptional ReadonlyfaucetOptional ReadonlyfullnodeOptional ReadonlyfullnodeOptional ReadonlyindexerOptional ReadonlyindexerOptional ReadonlynetworkOptional ReadonlypepperOptional ReadonlypluginOptional ReadonlyproverOptional ReadonlytransactionA list of supported Authentication Key schemes in Aptos, consisting of combinations of signing schemes and derive schemes.
+A Block type
+Describes the gas state of the block, indicating whether the block gas limit has been reached.
+A transaction executed at the end of a block that tracks data from the entire block.
+Final state of resources changed by the transaction
+Whether the transaction was successful
+The VM status of the transaction, can tell useful information in a failure
+The structure representing a blockchain block with its height.
+Final state of resources changed by the transaction
+The events emitted at the block creation
+The indices of the proposers who failed to propose
+Previous block votes
+Whether the transaction was successful
+The VM status of the transaction, can tell useful information in a failure
+A configuration object for requests to the server, including API key, extra headers, and cookie handling options.
+Security Note: Consider implementing client-side rate limiting in your application to prevent +accidental API abuse. You can use libraries like 'bottleneck' or 'p-queue' to limit request rates.
+The response for a committed transaction, which can be one of several transaction types.
+The decoded data for a table, including its key in JSON format.
+Deserializes a serialized object using the provided deserializer. +This function allows you to reconstruct an object from its serialized form.
+An instance of the Deserializer used to read the serialized data.
+Interface for an Entry function's ABI, enabling type checking and input conversion for ABI-based transaction submissions.
+Entry function arguments for building a raw transaction using BCS serialized arguments.
+The response payload for an entry function, containing the type of the entry.
+The structure for an event, identified by a unique GUID.
+A configuration object for a faucet, including optional authentication and headers for requests.
+A configuration object for a Fullnode, allowing for the inclusion of extra headers in requests.
+The output of the estimate gas API, including the deprioritized estimate for the gas unit price.
+Optionaldeprioritized_The deprioritized estimate for the gas unit price
+The current estimate for the gas unit price
+Optionalprioritized_The prioritized estimate for the gas unit price
+The response for a genesis transaction, indicating the type of transaction.
+Final state of resources changed by the transaction
+Events emitted during genesis
+Optionalstate_Whether the transaction was successful
+The VM status of the transaction, can tell useful information in a failure
+The response containing the current Aptos names from the GetNamesQuery.
+The account addresses for an authentication key.
+The current balances of fungible assets for an account.
+The response structure for retrieving account collections associated with owned tokens.
+The response containing the current token ownerships for an account from a specific collection.
+The response structure for querying tokens owned by an account.
+Options for making a request to the Aptos API, excluding the "type" field.
+The response structure for retrieving user transactions from the top of the blockchain.
+The response structure for retrieving data from the current collections.
+The current balances of fungible assets for a specific query.
+The response structure for retrieving the current token ownership details.
+The response containing the delegated staking activities from the query.
+The response containing the events from the GetEventsQuery.
+The response containing the activities related to fungible assets.
+The response containing metadata for a fungible asset.
+The number of active delegators per pool in response to a query.
+CUSTOM RESPONSE TYPES FOR THE END USER
+To provide a good dev exp, we build custom types derived from the +query types to be the response type the end developer/user will +work with.
+These types are used as the return type when calling a sdk api function +that calls the function that queries the server (usually under the /api/ folder)
+The response containing the current token ownerships for a user.
+The status of the processor as returned by the GetProcessorStatusQuery.
+Options for making a GET request, including configuration for the API client.
+OptionalacceptThe accepted content type of the response of the API
+The config for the API client
+OptionalcontentThe content type of the request body
+The name of the API method
+OptionaloverridesSpecific client overrides for this request to override aptosConfig
+OptionalparamsThe query parameters for the request
+The URL path to the API method
+The type of API endpoint to call e.g. fullnode, indexer, etc
+The response structure for retrieving items from a table.
+The metadata for table items retrieved from a query.
+The response structure for retrieving token activity data.
+The response structure for retrieving token data, containing the current token information.
+The GraphQL query to pass into the queryIndexer function.
Hexadecimal data input for functions, supporting both string and Uint8Array formats.
+An Indexer configuration object for sending requests with additional headers.
+The data needed to generate an Entry Function payload.
+The input data for an entry function, including its associated ABI.
+Combines input function data with Aptos configuration for remote ABI interactions.
+Input options for generating a transaction using the orderless method, which does not require an account sequence number.
+A unified type for generating various transaction types.
+Input options for generating a transaction that requires an account sequence number, which is the default method.
+Unified type holding user data input interfaces for generating various transaction types.
+Optional options to set when generating a transaction, including a maximum gas amount.
+The data needed to generate a transaction payload for Entry Function, Script, or Multi Sig types.
+The payload for generating a transaction, which can be either an entry function or a multi-signature transaction.
+The payload for generating a transaction, which can be either script data, entry function data with remote ABI, or +multi-signature data.
+The data needed to generate a Multi Sig payload
+The data needed to generate a Multi Sig payload, including the multisig address.
+The data needed to generate a Multi Sig payload, including the multisig address.
+The data needed to generate a Script payload.
+The data required to simulate a transaction, typically generated by generateTransaction().
OptionalfeeFor a fee payer transaction (aka Sponsored Transaction)
+OptionalsecondaryFor a fee payer or multi-agent transaction that requires additional signers in
+The transaction to simulate, probably generated by generateTransaction()
OptionalsignerFor a single signer transaction
+Options for simulating a transaction input, including whether to estimate the gas unit price.
+The data needed to generate a View Function payload.
+Data needed to generate a view function, including the fetched ABI.
+Data required to create a view function payload and retrieve the remote ABI, including Aptos configuration.
+The data needed to generate a View Function payload in JSON format.
+A signed 128-bit integer.
+A signed 16-bit integer.
+A signed 256-bit integer.
+A signed 32-bit integer.
+A signed 64-bit integer.
+A signed 8-bit integer.
+Information about the current blockchain ledger, including its chain ID.
+Chain ID of the current chain
+Optionalgit_Git hash of the build of the API endpoint. Can be used to determine the exact +software version used by the API endpoint.
+A string representing a Move address.
+Move function
+Generic type params associated with the Move function
+Whether the function can be called as an entry function directly in a transaction
+Whether the function is a view function or not
+Parameters associated with the move function
+Return type of the function
+The move function containing its name. Same as MoveStructId since it reads weird to take a StructId for a Function.
+A string representing a 128-bit signed integer in the Move programming language.
+A 16-bit signed integer used in the Move programming language.
+A string representation of a 256-bit signed integer used in Move programming.
+A 32-bit signed integer type used in Move programming.
+A string representation of a 64-bit signed integer used in Move programming.
+A number representing a Move int8 type.
+A Move module
+A string representation of a Move module, formatted as module_name::function_name.
+Module names are case-sensitive.
The type for identifying objects to be moved within the system.
+The type for move options, which can be a MoveType, null, or undefined.
+A move struct
+Abilities associated with the struct
+Fields associated with the struct
+Generic types associated with the struct
+True if the struct is an enum (e.g. enum MyEnum { A, B, C }), false if it is a +regular struct (e.g. struct MyStruct { a: u8, b: u8 }).
+Whether the struct is a module event (aka v2 event). This will be false for v1 +events because the value is derived from the #[event] attribute on the struct in +the Move source code. This attribute is only relevant for v2 events.
+Whether the struct is a native struct of Move
+A structure representing a move with a name.
+A union type that encompasses various data types used in Move, including primitive types, address types, object types, and +arrays of MoveType.
+A string representing a 128-bit unsigned integer in the Move programming language.
+A 16-bit unsigned integer used in the Move programming language.
+A string representation of a 256-bit unsigned integer used in Move programming.
+A 32-bit unsigned integer type used in Move programming.
+A string representation of a 64-bit unsigned integer used in Move programming.
+A number representing a Move uint8 type.
+Possible Move values acceptable by move functions (entry, view)
+Map of a Move value to the corresponding TypeScript value
+Bool -> boolean
u8, u16, u32 -> number
u64, u128, u256 -> string
i8, i16, i32 -> number
i64, i128, i256 -> string
String -> string
Address -> 0x${string}
Struct - 0x${string}::${string}::${string}
Object -> 0x${string}
Vector -> Array<MoveValue>
Option -> MoveValue | null | undefined
The response payload for a multisig transaction, containing the type of the transaction.
+A generic type that being passed by each function and holds an +array of properties we can sort the query by
+Specifies the order direction for sorting, including options for handling null values.
+Whereas ParsingError is thrown when parsing fails, e.g. in a fromString function, +this type is returned from "defensive" functions like isValid.
+OptionalinvalidIf valid is false, this will be a code explaining why parsing failed.
+OptionalinvalidIf valid is false, this will be a string explaining why parsing failed.
+True if valid, false otherwise.
+The response for a pending transaction, indicating that the transaction is still being processed.
+Config for plugins. This can be used to override certain client behavior.
+OptionalIGNORE_If true, we won't use the TRANSACTION_SUBMITTER if set.
+OptionalTRANSACTION_If given, this will be used for submitting transactions instead of the default +implementation (which submits transactions directly via a node).
+Options for posting a request to Aptos, excluding the type field.
+Options for making a POST request, including the API client configuration.
+OptionalacceptThe accepted content type of the response of the API
+The config for the API client
+OptionalbodyThe body of the request, should match the content type of the request
+OptionalcontentThe content type of the request body
+The name of the API method
+OptionaloverridesSpecific client overrides for this request to override aptosConfig
+OptionalparamsThe query parameters for the request
+The URL path to the API method
+The type of API endpoint to call e.g. fullnode, indexer, etc
+Options for handling errors in the Aptos API.
+Boolean expression to compare columns of type "bigint". All fields are combined with logical 'AND'.
+Boolean expression to compare columns of type "Boolean". All fields are combined with logical 'AND'.
+Boolean expression to filter rows from the table "current_aptos_names". All fields are combined with a logical 'AND'.
+Optional_Optional_Optional_OptionaldomainOptionaldomain_Optionaldomain_Optionalexpiration_Optionalis_Optionalis_Optionalis_Optionallast_Optionalowner_Optionalregistered_OptionalsubdomainOptionalsubdomain_Optionaltoken_Optionaltoken_Boolean expression to filter rows from the table "current_fungible_asset_balances". All fields are combined with a logical 'AND'.
+Optional_Optional_Optional_OptionalamountOptionalamount_Optionalamount_Optionalasset_Optionalasset_Optionalasset_Optionalis_Optionalis_Optionallast_Optionallast_Optionallast_Optionallast_Optionallast_Optionallast_OptionalmetadataOptionalowner_Optionalstorage_Optionaltoken_The abstract public key that is used to identify the account. +Depends on the use cases, most of the time it is the public key of the source wallet
+The authentication function that will be used to verify the signature.
+The signer function signs transactions and returns the authenticator bytes in the AbstractionAuthData.
object should be in either of the following forms:
interface EventTypes {
'event-with-parameters': any[]
'event-with-example-handler': (...args: any[]) => void
}
+
+
+Boolean expression to filter rows from the table "fungible_asset_activities". All fields are combined with a logical 'AND'.
+Optional_Optional_Optional_OptionalamountOptionalasset_Optionalblock_Optionalentry_Optionalevent_Optionalgas_Optionalis_Optionalis_Optionalis_OptionalmetadataOptionalowner_Optionalowner_Optionalowner_Optionalstorage_Optionalstorage_Optionaltoken_Optionaltransaction_Optionaltransaction_OptionaltypeBoolean expression to filter rows from the table "fungible_asset_metadata". All fields are combined with a logical 'AND'.
+Optional_Optional_Optional_Optionalasset_Optionalcreator_OptionaldecimalsOptionalicon_Optionallast_Optionallast_Optionalmaximum_OptionalnameOptionalproject_Optionalsupply_Optionalsupply_Optionalsupply_OptionalsymbolOptionaltoken_The response containing the Groth16 verification key, including the alpha_g1 component.
+Boolean expression to compare columns of type "Int". All fields are combined with logical 'AND'.
+Boolean expression to compare columns of type "jsonb". All fields are combined with logical 'AND'.
+Optional_Optional_is the column contained in the given json value
+Optional_does the column contain the given json value at the top level
+Optional_Optional_Optional_Optional_does the string exist as a top-level key in the column
+Optional_do all of these strings exist as top-level keys in the column
+Optional_do any of these strings exist as top-level keys in the column
+Optional_Optional_Optional_Optional_Optional_Optional_The response for keyless configuration containing the maximum committed EPK bytes.
+Boolean expression to compare columns of type "numeric". All fields are combined with logical 'AND'.
+Obtain the parameters of a function type in a tuple
+Accepted property value types for user input, including boolean, number, bigint, string, AccountAddress, and Uint8Array.
+To pass in an Array, use Uint8Array type
+for example new MoveVector([new MoveString("hello"), new MoveString("world")]).bcsToBytes()
All built-in and custom scalars, mapped to their actual values
+Boolean expression to compare columns of type "String". All fields are combined with logical 'AND'.
+Optional_Optional_Optional_Optional_does the column match the given case-insensitive pattern
+Optional_Optional_does the column match the given POSIX regular expression, case insensitive
+Optional_Optional_does the column match the given pattern
+Optional_Optional_Optional_Optional_does the column NOT match the given case-insensitive pattern
+Optional_Optional_does the column NOT match the given POSIX regular expression, case insensitive
+Optional_does the column NOT match the given pattern
+Optional_does the column NOT match the given POSIX regular expression, case sensitive
+Optional_does the column NOT match the given SQL regular expression
+Optional_does the column match the given POSIX regular expression, case sensitive
+Optional_does the column match the given SQL regular expression
+Boolean expression to filter rows from the table "table_items". All fields are combined with a logical 'AND'.
+Boolean expression to filter rows from the table "table_metadatas". All fields are combined with a logical 'AND'.
+Boolean expression to compare columns of type "timestamp". All fields are combined with logical 'AND'.
+Script function arguments for building raw transactions using BCS serialized arguments.
+The payload for a script response, containing the type of the script.
+Entry function arguments for building a raw transaction using remote ABI, supporting various data types including primitives and arrays.
+The arguments for generating a single key signer from a specified derivation path.
+The response for a state checkpoint transaction, indicating the type of transaction.
+Final state of resources changed by the transaction
+Whether the transaction was successful
+The VM status of the transaction, can tell useful information in a failure
+The payload for a success event.
+The request payload for the GetTableItem API.
+The token standard to query for, which can be either version "v1" or "v2".
+The signature for a transaction using the Ed25519 algorithm.
+The signature of the fee payer in a transaction.
+A configuration object for default parameters for transaction generation.
+The structure for a multi-agent signature in a transaction.
+The structure for a multi-signature transaction using Ed25519.
+The public keys for the Ed25519 signature
+Signature associated with the public keys in the same order
+The number of signatures required for a successful transaction
+The payload for a transaction response, which can be an entry function, script, or multisig payload.
+The response for a transaction, which can be either pending or committed.
+The structure for a Secp256k1 signature in a transaction.
+JSON representations of transaction signatures returned from the node API.
+The structure for a multi-signature transaction using Ed25519.
+Inputs for Entry functions, view functions, and scripts, which can be a string representation of various types including +primitive types, vectors, and structured types.
+This can be a string version of the type argument such as:
+A 128-bit unsigned integer used for precise arithmetic operations.
+A 16-bit unsigned integer.
+A 256-bit unsigned integer used for precise numerical calculations.
+A 32-bit unsigned integer.
+A 64-bit unsigned integer value.
+BCS types
+The response structure for a user transaction.
+Final state of resources changed by the transaction
+Events generated by the transaction
+OptionalsignatureWhether the transaction was successful
+The VM status of the transaction, can tell useful information in a failure
+The response for a validator transaction, indicating the type of transaction.
+Final state of resources changed by the transaction
+The events emitted by the validator transaction
+Whether the transaction was successful
+The VM status of the transaction, can tell useful information in a failure
+Represents the arguments required to verify a digital signature asynchronously.
+The validity of certain types of signatures are dependent on network state. This is the case for +Keyless signatures which need to lookup the verification key and keyless configuration.
+Interface for a view function's ABI, providing type checking and input conversion for ABI-based transaction submissions.
+The payload sent to the fullnode for a JSON view request.
+Options for configuring the behavior of the waitForTransaction() function.
+A union type that encompasses both script and direct write sets for data operations.
+The structure for a module deletion change in a write set.
+The payload for a resource deletion in a write set change.
+The payload for a write set change that deletes a table item.
+The structure for a write module change in a write set.
+The resource associated with a write set change, identified by its type.
+The structure for a write operation on a table in a write set change.
+ConstConstConstThe default gas currency for the network.
+ConstConstAptos derive path is 637
+ConstThe default max gas amount when none is given.
+This is the maximum number of gas units that will be used by a transaction before being rejected.
+Note that max gas amount varies based on the transaction. A larger transaction will go over this +default gas amount, and the value will need to be changed for the specific transaction.
+ConstThe default transaction expiration seconds from now.
+This time is how long until the blockchain nodes will reject the transaction.
+Note that the transaction expiration time varies based on network connection and network load. It may need to be +increased for the transaction to be processed.
+ConstThe default number of seconds to wait for a transaction to be processed.
+This time is the amount of time that the SDK will wait for a transaction to be processed when waiting for +the results of the transaction. It may take longer based on network connection and network load.
+ConstConstRegular 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
+ConstConstConstConstConstConstConstConstConstThe minimum max gas amount that the SDK will allow for a transaction.
+This value acts as a floor to prevent transactions from being built with a max gas amount +below the network's minimum transaction gas units, which would cause +MAX_GAS_UNITS_BELOW_MIN_TRANSACTION_GAS_UNITS errors.
+ConstConstConstConstConstConstConstConstConstConstShared TextEncoder instance for string serialization to avoid repeated instantiation.
+Const
Account implementation for the Keyless authentication scheme. This abstract class is used for standard Keyless Accounts +and Federated Keyless Accounts.
+