Abstract
Readonly
Abstract
accountAccount address associated with the account
+Readonly
Abstract
privatePrivate key associated with the account. +Note: this will be removed in the next major release, + as not all accounts have a private key.
+Readonly
Abstract
publicPublic key associated with the account
+Abstract
signingSigning scheme used to sign transactions
+Abstract
signAbstract
signSign 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
+Static
authPublicKey - public key of the account
+The authentication key for the associated account
+use publicKey.authKey()
instead.
+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
Static
fromDerives an account with bip44 path and mnemonics
+Static
fromCreates an account from the provided private key.
+Static
fromStatic
generateDerives an account from a randomly generated private key.
+Optional
args: GenerateEd25519AccountArgsAn account compatible with the provided signature scheme
+Generated using TypeDoc
NOTE: 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.
+Creates an instance of AccountAddress from a Uint8Array.
+Readonly
dataThis is the internal representation of an account address.
+Static
FOURStatic
Readonly
LENGTHThe number of bytes that make up an account address.
+Static
Readonly
LONG_The length of an address string in LONG form without a leading 0x.
+Static
ONEStatic
THREEStatic
TWOStatic
ZEROReturn whether AccountAddresses are equal. AccountAddresses are considered equal +if their underlying byte data is identical.
+The AccountAddress to compare to.
+true if the AccountAddresses are equal, false if not.
+Returns whether an address is special, where special 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 if not.
+Serialize the AccountAddress to a Serializer instance's data buffer.
+The serializer to serialize the AccountAddress to.
+void
+const serializer = new Serializer();
const address = AccountAddress.fromString("0x1");
address.serialize(serializer);
const bytes = serializer.toUint8Array();
// `bytes` is now the BCS-serialized address.
+
+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.
+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.
+Return the AccountAddress as a string as per AIP-40. +https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
+In short, it means that special addresses are represented in SHORT form, meaning +0x0 through to 0xf inclusive, and every other address is represented in LONG form, +meaning 0x + 64 hex characters.
+AccountAddress as a string conforming to AIP-40.
+NOTE: Prefer to use toString
where possible.
Whereas toString will format special addresses (as defined by isSpecial) using the +SHORT form (no leading 0s), this format the address in the LONG format +unconditionally.
+This means it will be 0x + 64 hex characters.
+AccountAddress as a string in LONG form.
+NOTE: Prefer to use toString
where possible.
Whereas toString will format special addresses (as defined by isSpecial) using the +SHORT form (no leading 0s), this function will include leading zeroes. The string +will not have a leading zero.
+This means it will be 64 hex characters without a leading 0x.
+AccountAddress as a string in LONG form without a leading 0x.
+Static
deserializeDeserialize an AccountAddress from the byte buffer in a Deserializer instance.
+The deserializer to deserialize the AccountAddress from.
+An instance of AccountAddress.
+const bytes = hexToBytes("0x0102030405060708091011121314151617181920212223242526272829303132");
const deserializer = new Deserializer(bytes);
const address = AccountAddress.deserialize(deserializer);
// `address` is now an instance of AccountAddress.
+
+Static
fromConvenience method for creating an AccountAddress from all known inputs.
+This handles, Uint8array, string, and AccountAddress itself
+Static
fromConvenience method for creating an AccountAddress from all known inputs.
+This handles, Uint8array, string, and AccountAddress itself
+Static
fromNOTE: This function has relaxed parsing behavior. For strict behavior, please use
+the fromStringStrict
function. Where possible use fromStringStrict
rather than this
+function, fromString
is only provided for backwards compatibility.
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:
+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.
+Static
fromNOTE: 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:
+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.
+Static
isCheck if the string is a valid AccountAddress.
+A hex string representing an account address.
+Optional
strict?: booleanIf true, use strict parsing behavior. If false, use relaxed parsing behavior.
+valid = true if the string is valid, valid = false if not. If the string +is not valid, invalidReason will be set explaining why it is invalid.
+Generated using TypeDoc
Abstract
Abstract
serializeStatic
deserializeGenerated using TypeDoc
Transaction authenticator Ed25519 for a multi signer transaction
+Account's Ed25519 public key.
+Account's Ed25519 signature
+Readonly
public_Readonly
signatureStatic
deserializeStatic
loadGenerated using TypeDoc
Transaction authenticator Multi Ed25519 for a multi signers transaction
+Account's MultiEd25519 public key.
+Account's MultiEd25519 signature
+Readonly
public_Readonly
signatureStatic
deserializeStatic
loadGenerated using TypeDoc
AccountAuthenticatorMultiKey for a multi signer
+MultiKey
+Signature
+Readonly
public_Readonly
signaturesReadonly
signatures_Static
deserializeStatic
loadGenerated using TypeDoc
AccountAuthenticatorSingleKey for a single signer
+AnyPublicKey
+AnySignature
+Readonly
public_Readonly
signatureStatic
deserializeStatic
loadGenerated using TypeDoc
Abstract
An abstract representation of an account public key.
+Provides a common interface for deriving an authentication key.
+Abstract
authGet the authentication key associated with this public key
+Abstract
serializeAbstract
toAbstract
verifyVerifies that the private key associated with this public key signed the message with the given signature.
+Generated using TypeDoc
Readonly
accountReadonly
aptosWe 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 a incremental integer.
+When they complete, they increment that number and that entity is able to enter the lock
.
+That would guarantee ordering.
Generated using TypeDoc
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
.
Readonly
publicReference to the inner public key
+Readonly
variantIndex of the underlying enum variant
+Get the authentication key associated with this public key
+Verifies that the private key associated with this public key signed the message with the given signature.
+Static
deserializeStatic
isuse instanceof AnyPublicKey
instead.
Generated using TypeDoc
Instance of signature that uses the SingleKey authentication scheme.
+This signature can only be generated by a SingleKeySigner
, since it uses the
+same authentication scheme.
Readonly
signaturePrivate
Readonly
variantIndex of the underlying enum variant
+Static
deserializeGenerated using TypeDoc
This class is the main entry point into Aptos's +APIs and separates functionality into different namespaces.
+To use the SDK, create a new Aptos instance to get access +to all the sdk functionality.
+Optional
settings: AptosConfigReadonly
accountReadonly
ansReadonly
coinReadonly
configReadonly
digitalReadonly
eventReadonly
faucetReadonly
fungibleReadonly
generalReadonly
stakingReadonly
transactionAdd a digital asset property
+The digital asset address
+Optional
digitalOptional
options?: InputGenerateTransactionOptionsThe 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 chain
+Add a typed digital asset property
+The digital asset address
+Optional
digitalOptional
options?: InputGenerateTransactionOptionsThe 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 chain
+An array of transaction payloads
+Optional
options?: Omit<InputGenerateTransactionOptions, "accountSequenceNumber">optional. Transaction generation configurations (excluding accountSequenceNumber)
+The sender account to sign and submit the transaction
+void. Throws if any error
+Prefer to use aptos.transaction.batch.forSingleAccount()
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 +dont rely on each other, i.e batch funds, batch token mints, etc.
+If any worker failure, the functions throws an error.
+Burn a digital asset by its creator
+The creator account
+The digital asset address
+Optional
digitalOptional
options?: InputGenerateTransactionOptionsA SimpleTransaction that can be simulated or submitted to chain
+Creates a new collection within the specified account
+A SimpleTransaction that when submitted will create the collection.
+Derives an account by providing a private key. +This functions 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 a ED25519 type, it looks up the authentication key on chain, and uses it to resolve +whether it is a Legacy ED25519 key or a Unified ED25519 key. It then derives the account based +on that.
+An account private key
+Account type
+Freeze digital asset transfer ability
+The creator account
+The digital asset address
+Optional
digitalOptional
options?: InputGenerateTransactionOptionsA SimpleTransaction that can be simulated or submitted to chain
+This creates an account if it does not exist and mints the specified amount of +coins into that account
+Address of the account to fund
+Amount of tokens to fund the account with
+Optional
options?: WaitForTransactionOptionsConfiguration options for waitForTransaction
+Transaction hash of the transaction that funded the account
+Queries the account's APT amount
+The account address we want to get the total count for
+Optional
minimumOptional ledger version to sync up to, before querying
+Current amount of account's APT
+Queries the account's coin amount by the coin type
+The account address we want to get the total count for
+The coin type to query
+Optional
minimumOptional ledger version to sync up to, before querying
+Current amount of account's coin
+Queries the current count of an account's coins aggregated
+The account address we want to get the total count for
+Optional
minimumOptional ledger version to sync up to, before querying
+Current count of the aggregated count of all account's coins
+Queries an account's coins data
+The account address we want to get the coins data for
+Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: PaginationArgs & OrderByArg<{ Array with the coins data
+Queries for all collections that an account currently has tokens for.
+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 param
+The account address we want to get the collections for
+Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: TokenStandardArg & PaginationArgs & OrderByArg<{ Collections array with the collections data
+Fetches all top level domain names for an account
+a promise of an array of ANSName
+Get events by creation number and an account address
+The account address
+The event creation number
+Optional
minimumOptional ledger version to sync up to, before querying
+Promise
Get events by event type and an account address
+The account address
+The event type
+Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: PaginationArgs & OrderByArg<{ Promise
Queries the current state for an Aptos account given its account address
+Aptos account address
+The account data
+{
sequence_number: "1",
authentication_key: "0x5307b5f4bc67829097a8ba9b43dba3b88261eeccd1f709d9bde240fc100fbb69"
}
+
+Queries for a specific account module given account address and module name
+Aptos account address
+The name of the module
+Optional
options?: LedgerVersionArgAccount module
+{
bytecode: "0xa11ceb0b0600000006010002030206050807070f0d081c200",
abi: { address: "0x1" }
}
+
+Queries for all modules in an account given an account address
+Note: In order to get all account modules, this function may call the API +multiple times as it auto paginates.
+Aptos account address
+Optional
options?: PaginationArgs & LedgerVersionArgAccount modules
+Fetches all names for an account (both top level domains and subdomains)
+a promise of an array of ANSName
+Queries an account's owned objects
+The account address we want to get the objects for
+Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: PaginationArgs & OrderByArg<{ Objects array with the object data
+Queries the account's current owned tokens.
+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 param
+The account address we want to get the tokens for
+Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: TokenStandardArg & PaginationArgs & OrderByArg<{ Tokens array with the token data
+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 param
+The account address we want to get the tokens for
+The address of the collection being queried
+Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: TokenStandardArg & PaginationArgs & OrderByArg<{ Tokens array with the token data
+Queries a specific account resource given account address and resource type. Note that the default is any
in order
+to allow for ease of accessing properties of the object.
Aptos account address
+Optional
options?: LedgerVersionArgString representation of an on-chain Move struct type, i.e "0x1::aptos_coin::AptosCoin"
+Account resource
+{
value: 6
}
+
+Queries all account resources given an account address
+Note: In order to get all account resources, this function may call the API +multiple times as it auto paginates.
+Aptos account address
+Optional
options?: PaginationArgs & LedgerVersionArgAccount resources
+Fetches all subdomains names for an account
+a promise of an array of ANSName
+Queries the current count of tokens owned by an account
+The account address
+Optional
minimumOptional ledger version to sync up to, before querying
+Current count of tokens owned by the account
+Queries account transactions given an account address
+Note: In order to get all account transactions, this function may call the API +multiple times as it auto paginates.
+Aptos account address
+Optional
options?: PaginationArgsThe account transactions
+Queries the current count of transactions submitted by an account
+The account address we want to get the total count for
+Optional
minimumOptional ledger version to sync up to, before querying
+Current count of transactions made by an account
+Queries data of a specific collection by the collection creator address and the collection name.
+If, for some reason, a creator account has 2 collections with the same name in v1 and v2,
+can pass an optional tokenStandard
parameter to query a specific standard
the name of the collection
+the address of the collection's creator
+Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: TokenStandardArgGetCollectionDataResponse response type
+Queries data of a specific collection by the collection ID.
+the ID of the collection, it's the same thing as the address of the collection object
+Optional
minimumOptional ledger version to sync up to, before querying
+GetCollectionDataResponse response type
+Queries a collection's ID.
+This is the same as the collection's object address in V2, but V1 does +not use objects, and does not have an address
+the name of the collection
+the address of the collection's creator
+Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: TokenStandardArgthe collection id
+Gets digital asset ownership data given the address of a digital asset.
+Optional
minimumOptional ledger version to sync up to, before querying
+GetCurrentTokenOwnershipResponse containing relevant ownership data of the digital asset.
+Queries all fungible asset balances
+Optional
args: { Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: PaginationArgs & WhereArg<CurrentFungibleAssetBalancesBoolExp>A list of fungible asset metadata
+Queries delegated staking activities
+Delegator address
+Optional
minimumOptional ledger version to sync up to, before querying
+Pool address
+GetDelegatedStakingActivitiesResponse response type
+Gets the activity data given the address of a digital asset.
+Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: PaginationArgs & OrderByArg<{ GetTokenActivityResponse containing relevant activity data to the digital asset.
+Gets digital asset data given the address of a digital asset.
+Optional
minimumOptional ledger version to sync up to, before querying
+GetTokenDataResponse containing relevant data to the digital asset.
+Fetches all subdomains names for a given domain. Note, this will not return the domain itself.
+a promise of an array of ANSName
+Get all events
+An optional where
can be passed in to filter out the response.
Optional
args: { Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: PaginationArgs & OrderByArg<{ GetEventsQuery response type
+{ where:
{
transaction_version: { _eq: 123456 },
}
}
+
+Retrieve the expiration time of a domain name or subdomain name from the contract.
+// Will return the expiration of "test.aptos.apt" or undefined
const exp = await aptos.getExpiration({name: "test.aptos"})
// new Date(exp) would give you the date in question: 2021-01-01T00:00:00.000Z
+
+A string of the name to retrieve
+number as a unix timestamp in milliseconds.
+Queries all fungible asset activities
+Optional
args: { Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: PaginationArgs & WhereArg<FungibleAssetActivitiesBoolExp>A list of fungible asset metadata
+Queries all fungible asset metadata.
+Optional
args: { Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: PaginationArgs & WhereArg<FungibleAssetMetadataBoolExp>A list of fungible asset metadata
+Queries a fungible asset metadata
+This query returns the fungible asset metadata for a specific fungible asset.
+The asset type of the fungible asset. +e.g +"0x1::aptos_coin::AptosCoin" for Aptos Coin +"0xc2948283c2ce03aafbb294821de7ee684b06116bb378ab614fa2de07a99355a8" - address format if this is fungible asset
+Optional
minimumOptional ledger version to sync up to, before querying
+A fungible asset metadata item
+Gives an estimate of the gas unit price required to get a +transaction on chain in a reasonable amount of time. +For more information https://api.mainnet.aptoslabs.com/v1/spec#/operations/estimate_gas_price
+Object holding the outputs of the estimate gas API
+{
gas_estimate: number;
deprioritized_gas_estimate?: number;
prioritized_gas_estimate?: number;
}
+
+Queries for the Aptos ledger info
+Aptos Ledger Info
+{
"chain_id": 4,
"epoch": "8",
"ledger_version": "714",
"oldest_ledger_version": "0",
"ledger_timestamp": "1694695496521775",
"node_role": "validator",
"oldest_block_height": "0",
"block_height": "359",
"git_hash": "c82193f36f4e185fed9f68c4ad21f6c6dd390c6e"
}
+
+Get module events by event type
+The event type
+Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: PaginationArgs & OrderByArg<{ Promise
Fetches a single name from the indexer
+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. +Can be a subdomain.
+A promise of an ANSName or undefined
+Queries current number of delegators in a pool. Throws an error if the pool is not found.
+Optional
minimumOptional ledger version to sync up to, before querying
+Pool address
+The number of delegators for the given pool
+Queries current number of delegators in a pool. Throws an error if the pool is not found.
+Optional
args: { Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: OrderByArg<{ GetNumberOfDelegatorsForAllPoolsResponse response type
+Gets the digital assets that the given address owns.
+Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: PaginationArgs & OrderByArg<{ The address of the owner
+GetOwnedTokensResponse containing ownership data of the digital assets belonging to the ownerAddresss.
+Retrieve the owner address of a domain name or subdomain name from the contract.
+// Will return the owner address of "test.aptos.apt" or undefined
const owner = await aptos.getOwnerAddress({name: "test.aptos"})
// owner = 0x123...
+
+A string of the name to retrieve
+MoveAddressType if the name is owned, undefined otherwise
+Retrieve the primary name for an account. An account can have +multiple names that target it, but only a single name that is primary. An +account also may not have a primary name.
+const name = await aptos.getPrimaryName({address: alice.accountAddress})
// name = test.aptos
+
+A AccountAddressInput (address) of the account
+a string if the account has a primary name, undefined otherwise
+Query the processor status for a specific processor type.
+The processor type to query
+Returns a signing message for a transaction.
+This allows a user to sign a transaction using their own preferred signing method, and +then submit it to the network.
+A raw transaction for signing elsewhere
+Queries for a table item for a table identified by the handle and the key for the item. +Key and value types need to be passed in to help with key serialization and value deserialization.
+Object that describes table item
+A pointer to where that table is stored
+Optional
options?: LedgerVersionArgTable item value rendered in JSON
+https://api.devnet.aptoslabs.com/v1/accounts/0x1/resource/0x1::coin::CoinInfo%3C0x1::aptos_coin::AptosCoin%3E
{
data.key_type = "address" // Move type of table key
data.value_type = "u128" // Move type of table value
data.key = "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935" // Value of table key
}
+
+Retrieve the target address of a domain or subdomain name. This is the +address the name points to for use on chain. Note, the target address can +point to addresses that are not the owner of the name
+const targetAddr = await aptos.getTargetAddress({name: "test.aptos"})
// targetAddr = 0x123...
+
+A string of the name: primary, primary.apt, secondary.primary, secondary.primary.apt, etc.
+MoveAddressType if the name has a target, undefined otherwise
+Queries on-chain transaction by transaction hash. This function will return pending transactions.
+Transaction from mempool (pending) or on-chain (committed) transaction
+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.
+Queries on-chain transactions. This function will not return pending
+transactions. For that, use getTransactionsByHash
.
Optional
args: { Optional
options?: PaginationArgsArray of on-chain transactions
+Defines if specified transaction is currently in pending state
+To create a transaction hash:
+true
if transaction is in pending state and false
otherwise
Looks up the account address for a given authentication key
+This handles both if the account's authentication key has been rotated or not.
+The authentication key
+Optional
minimumOptional ledger version to sync up to, before querying
+Optional
options?: LedgerVersionArgPromise
Create a transaction to mint a digital asset into the creators account within an existing collection.
+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
+Optional
options?: InputGenerateTransactionOptionsOptional
propertyOptional
propertyOptional
propertythe URI to additional info about the digital asset
+A SimpleTransaction that can be simulated or submitted to chain
+Mint a soul bound digital asset into a recipient's account
+The account that mints the digital asset
+The collection name that the digital asset belongs to
+The digital asset description
+The digital asset name
+Optional
options?: InputGenerateTransactionOptionsOptional
propertyThe property keys for storing on-chain properties
+Optional
propertyThe type of property values
+Optional
propertyThe 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 chain
+Generates a transaction to publish a move package to chain.
+To get the metadataBytes
and byteCode
, can compile using Aptos CLI with command
+aptos move compile --save-metadata ...
,
+For more info https://aptos.dev/tutorials/your-first-dapp/#step-4-publish-a-move-module
The publisher account
+The package metadata bytes
+An array of the bytecode of each module in the package in compiler output order
+Optional
options?: InputGenerateTransactionOptionsA SimpleTransaction that can be simulated or submitted to chain
+A generic function for retrieving data from Aptos Indexer. +For more detailed queries specification see +https://cloud.hasura.io/public/graphiql?endpoint=https://api.mainnet.aptoslabs.com/v1/graphql
+The provided T type
+{
query: `query MyQuery {
ledger_infos {
chain_id
}
}`;
}
+
+Registers a new name
+// An example of registering a subdomain name assuming def.apt is already registered
// and belongs to the sender alice.
const txn = aptos.registerName({
sender: alice,
name: "test.aptos.apt",
expiration: {
policy: "subdomain:independent",
expirationDate: Date.now() + 30 * 24 * 60 * 60 * 1000,
},
});
+
+SimpleTransaction
+Remove a digital asset property
+The digital asset address
+Optional
digitalOptional
options?: InputGenerateTransactionOptionsThe 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 chain
+Renews a domain name
+Note: If a domain name was minted with V1 of the contract, it will automatically be upgraded to V2 via this transaction.
+await aptos.renewDomain({sender: alice, name: "test"})
// test.apt will be renewed for one year
+
+A string of the domain the subdomain will be under. The signer must be the domain owner. +Subdomains cannot be renewed.
+Optional
options?: InputGenerateTransactionOptionsThe sender account
+Optional
years?: 1The number of years to renew the name. Currently only one year is permitted.
+SimpleTransaction
+Rotate an account's auth key. After rotation, only the new private key can be used to sign txns for +the account. +Note: Only legacy Ed25519 scheme is supported for now. +More info: https://aptos.dev/guides/account-management/key-rotation/
+The account to rotate the auth key for
+The new private key to rotate to
+PendingTransactionResponse
+Set the digital asset description
+The creator account
+The digital asset description
+The digital asset address
+Optional
digitalOptional
options?: InputGenerateTransactionOptionsA SimpleTransaction that can be simulated or submitted to chain
+Set the digital asset name
+The creator account
+The digital asset address
+Optional
digitalThe digital asset name
+Optional
options?: InputGenerateTransactionOptionsA SimpleTransaction that can be simulated or submitted to chain
+Set the digital asset name
+The creator account
+The digital asset address
+Optional
digitalOptional
options?: InputGenerateTransactionOptionsThe digital asset uri
+A SimpleTransaction that can be simulated or submitted to chain
+Sets the primary name for the sender. An account can have +multiple names that target it, but only a single name that is primary. An +account also may not have a primary name.
+await aptos.setPrimaryName({sender: alice, name: "test.aptos"})
const primaryName = await aptos.getPrimaryName({address: alice.accountAddress})
// primaryName = test.aptos
+
+Optional
name?: stringA string of the name: test, test.apt, test.aptos, test.aptos.apt, etc.
+Optional
options?: InputGenerateTransactionOptionsThe sender account
+SimpleTransaction
+Sets the target address of a domain or subdomain name. This is the +address the name points to for use on chain. Note, the target address can +point to addresses that are not the owner of the name
+await aptos.setTargetAddress({sender: alice, name: "test.aptos", address: bob.accountAddress})
const address = await aptos.getTargetAddress({name: "test.aptos"})
// address = bob.accountAddress
+
+A AccountAddressInput of the address to set the domain or subdomain to
+A string of the name: test.aptos.apt, test.apt, test, test.aptos, etc.
+Optional
options?: InputGenerateTransactionOptionsSimpleTransaction
+Sign a transaction that can later be submitted to chain
+The signer account
+A raw transaction to sign on
+AccountAuthenticator
+Sign and submit a single signer transaction to chain
+The signer account to sign the transaction
+An instance of a RawTransaction, plus optional secondary/fee payer addresses
+{
rawTransaction: RawTransaction,
secondarySignerAddresses? : Array<AccountAddress>,
feePayerAddress?: AccountAddress
}
+
+PendingTransactionResponse
+Sign a transaction as a fee payer that can later be submitted to chain
+The fee payer signer account
+A raw transaction to sign on
+AccountAuthenticator
+Generate a transfer coin transaction that can be simulated and/or signed and submitted
+The amount to transfer
+Optional
coinoptional. The coin struct type to transfer. Defaults to 0x1::aptos_coin::AptosCoin
+Optional
options?: InputGenerateTransactionOptionsThe recipient address
+The sender account
+SimpleTransaction
+Transfer a digital asset (non fungible digital asset) ownership.
+We can transfer a digital asset only when the digital asset is not frozen +(i.e. owner transfer is not disabled such as for soul bound digital assets)
+The digital asset address
+Optional
digitaloptional. The digital asset type, default to "0x4::token::Token"
+Optional
options?: InputGenerateTransactionOptionsThe recipient account address
+The sender account of the current digital asset owner
+A SimpleTransaction that can be simulated or submitted to chain
+Transfer amount
of fungible asset from sender's primary store to recipient's primary store.
Use this method to transfer any fungible asset including fungible token.
+Optional
options?: InputGenerateTransactionOptionsA SimpleTransaction that can be simulated or submitted to chain.
+Unfreeze digital asset transfer ability
+The creator account
+The digital asset address
+Optional
digitalOptional
options?: InputGenerateTransactionOptionsA SimpleTransaction that can be simulated or submitted to chain
+Update a digital asset property
+The digital asset address
+Optional
digitalOptional
options?: InputGenerateTransactionOptionsThe 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 chain
+Update a typed digital asset property
+The digital asset address
+Optional
digitalOptional
options?: InputGenerateTransactionOptionsThe 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 chain
+Queries for a Move view function
+Optional
options?: LedgerVersionArgPayload for the view function
+an array of Move values
+`
const payload: ViewRequest = {
function: "0x1::coin::balance",
typeArguments: ["0x1::aptos_coin::AptosCoin"],
functionArguments: [accountAddress],
};
`
+
+Waits for a transaction to move past the pending state.
+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.Optional
options?: WaitForTransactionOptionsThe hash of a transaction previously submitted to the blockchain.
+The transaction on-chain. See above for more details.
+Generated using TypeDoc
The type returned from an API error
+the error name "AptosApiError"
+the url the request was made to
+the response status. i.e. 400
+the response message
+the response data
+the AptosRequest
+Readonly
dataReadonly
requestOptional
stackReadonly
statusReadonly
statusReadonly
urlStatic
Optional
prepareOptional override for formatting stack traces
+Static
stackStatic
captureGenerated using TypeDoc
This class holds the config information for the SDK client instance.
+Optional
settings: AptosSettingsReadonly
clientThe client instance the SDK uses. Defaults to `@aptos-labs/aptos-client
+Optional
Readonly
clientOptional client configurations
+Optional
Readonly
faucetThe optional hardcoded faucet URL to send requests to instead of using the network
+Optional
Readonly
faucetOptional specific Faucet configurations
+Optional
Readonly
fullnodeThe optional hardcoded fullnode URL to send requests to instead of using the network
+Optional
Readonly
fullnodeOptional specific Fullnode configurations
+Optional
Readonly
indexerThe optional hardcoded indexer URL to send requests to instead of using the network
+Optional
Readonly
indexerOptional specific Indexer configurations
+Readonly
networkThe Network that this SDK is associated with. Defaults to DEVNET
+Generated using TypeDoc
Each account stores an authentication key. Authentication key enables account owners to rotate +their private key(s) associated with the account without changing the address that hosts their account.
+Readonly
dataThe raw bytes of the authentication key.
+Static
Readonly
LENGTHAn 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. Since an AccountAddress is also 32 bytes, +the AuthenticationKey bytes are directly translated to an AccountAddress.
+AccountAddress
+Static
deserializeDeserialize an AuthenticationKey from the byte buffer in a Deserializer instance.
+The deserializer to deserialize the AuthenticationKey from.
+An instance of AuthenticationKey.
+Static
fromConverts a PublicKey(s) to an AuthenticationKey, using the derivation scheme inferred from the +instance of the PublicKey type passed in.
+AuthenticationKey
+Static
fromthe public key and scheme to use for the derivation
+Use fromPublicKey
instead
+Derives an AuthenticationKey from the public key seed bytes and an explicit derivation scheme.
This facilitates targeting a specific scheme for deriving an authentication key from a public key.
+Static
fromGenerated using TypeDoc
Readonly
valueSerialize 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.
+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.
+Static
deserializeGenerated using TypeDoc
Representation of a ChainId that can serialized and deserialized
+Readonly
chainStatic
deserializeGenerated using TypeDoc
Private
bufferPrivate
offsetHelper 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
+const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));
const value = deserializer.deserialize(MyClass); // where MyClass has a `deserialize` function
// value is now an instance of MyClass
// equivalent to `const value = MyClass.deserialize(deserializer)`
+
+Deserializes a string. UTF8 string is supported. Reads the string's bytes length "l" first, +and then reads "l" bytes of content. Decodes the byte array 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.
+const deserializer = new Deserializer(new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));
assert(deserializer.deserializeStr() === "1234abcd");
+
+Deserializes a uint64 number.
+BCS layout for "uint64": Eight bytes. Binary format in little-endian representation.
+const deserializer = new Deserializer(new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));
assert(deserializer.deserializeU64() === 1311768467750121216);
+
+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
+
+Private
readGenerated using TypeDoc
Signer implementation for the Ed25519 authentication scheme. +This extends an Ed25519Account by adding signing capabilities through an Ed25519PrivateKey.
+Note: Generating a signer instance does not create the account on-chain.
+Readonly
accountAccount address associated with the account
+Readonly
privatePrivate key associated with the account
+Readonly
publicPublic key associated with the account
+Readonly
signingSigning scheme used to sign transactions
+Sign the given message with the private key.
+in HexInput format
+AccountSignature
+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
+Static
fromDerives an account with bip44 path and mnemonics
+Static
generateDerives a signer from a randomly generated private key
+Generated using TypeDoc
Represents the private key of an Ed25519 key pair.
+Create a new PrivateKey instance from a Uint8Array or String.
+HexInput (string or Uint8Array)
+Private
Readonly
signingThe Ed25519 signing key
+Static
Readonly
LENGTHLength of an Ed25519 private key
+Static
Readonly
SLIP_The Ed25519 key seed to use for BIP-32 compatibility +See more https://github.com/satoshilabs/slips/blob/master/slip-0010.md
+Derive the Ed25519PublicKey for this private key.
+Ed25519PublicKey
+Sign the given message with the private key.
+in HexInput format
+Signature
+Static
deserializeStatic
fromDerives a private key from a mnemonic seed phrase.
+To derive multiple keys from the same phrase, change the path
+IMPORTANT: Ed25519 supports hardened derivation only (since it lacks a key homomorphism, +so non-hardened derivation cannot work)
+the BIP44 path
+the mnemonic seed phrase
+Static
Private
fromA private inner function so we can separate from the main fromDerivationPath() method +to add tests to verify we create the keys correctly.
+the BIP44 path
+the seed phrase created by the mnemonics
+the offset used for key derivation, defaults to 0x80000000
+Static
generateGenerate a new random private key.
+Ed25519PrivateKey
+Static
isuse instanceof Ed25519PrivateKey
instead.
Generated using TypeDoc
Represents 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
Create a new PublicKey instance from a Uint8Array or String.
+A HexInput (string or Uint8Array)
+Private
Readonly
keyBytes of the public key
+Static
Readonly
LENGTHLength of an Ed25519 public key
+Get the authentication key associated with this public key
+Verifies a signed data with a public key
+Static
deserializeStatic
isuse instanceof Ed25519PublicKey
instead.
Generated using TypeDoc
A signature of a message signed using an Ed25519 private key
+Private
Readonly
dataThe signature bytes
+Static
Readonly
LENGTHLength of an Ed25519 signature
+Static
deserializeGenerated using TypeDoc
Representation of a EntryFunction that can serialized and deserialized
+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.
+A coin transfer function has one type argument "CoinType".
+public entry fun transfer<CoinType>(from: &signer, to: address, amount: u64)
+
+A coin transfer function has three arguments "from", "to" and "amount".
+public entry fun transfer<CoinType>(from: &signer, to: address, amount: u64)
+
+Readonly
argsReadonly
function_Readonly
module_Readonly
type_Static
buildA helper function to build a EntryFunction payload from raw primitive values
+Fully qualified module name in format "AccountAddress::module_id" e.g. "0x1::coin"
+Function name
+Type arguments that 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,)
+
+Static
deserializeDeserializes 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.
+Generated using TypeDoc
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: Attempting to use this class for a serialized script function will result in 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.
+Private
constructorReadonly
valueSerialize 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.
+Static
deserializeThe 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
+Generated using TypeDoc
Representation of a Fee Payer Transaction that can serialized and deserialized
+Readonly
fee_The fee payer account address
+Readonly
raw_The raw transaction
+Readonly
secondary_The secondary signers on this transaction - optional and can be empty
+Serialize a Raw Transaction With Data
+Static
deserializeDeserialize a Raw Transaction With Data
+Static
loadGenerated using TypeDoc
This class exists to represent a contiguous sequence of already serialized BCS-bytes.
+It 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.
+If you want to write your own serialization function and pass the bytes as a transaction argument, + you should use this class.
+ This class is also more generally used to represent type-agnostic BCS bytes as a vector
An example of this is the 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],
});
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.
+
+value: HexInput representing a sequence of Uint8 bytes
+a Serializable FixedBytes instance, which when serialized, does not prepend the length of the bytes
+EntryFunctionBytes
+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.
+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.
+Static
deserializeGenerated using TypeDoc
NOTE: Do not use this class when working with account addresses, use AccountAddress.
+NOTE: When accepting hex data as input to a function, prefer to accept HexInput and +then use the static helper methods of this class to convert it into the desired +format. This enables the greatest flexibility for the developer.
+Hex is a helper class for working with hex data. Hex data, when represented as a +string, generally looks like this, for example: 0xaabbcc, 45cd32, etc.
+You might use this class like this:
+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.
These are some other ways to chain the functions together:
+Hex.fromString({ hexInput: "0x1f" }).toUint8Array()
new Hex([1, 3]).toStringWithoutPrefix()
Private
Readonly
dataReturn whether Hex instances are equal. Hex instances are considered equal if +their underlying byte data is identical.
+The Hex instance to compare to.
+true if the Hex instances are equal, false if not.
+Static
fromStatic
fromStatic
isCheck if the string is valid hex.
+A hex string representing byte data.
+valid = true if the string is valid, false if not. If the string is not +valid, invalidReason and invalidReasonMessage will be set explaining why it is +invalid.
+Generated using TypeDoc
Representation of an Identifier that can serialized and deserialized. +We use Identifier to represent the module "name" in "ModuleId" and +the "function name" in "EntryFunction"
+Static
deserializeGenerated using TypeDoc
Representation of a ModuleId that can serialized and deserialized +ModuleId means the module address (e.g "0x1") and the module name (e.g "coin")
+Full name of a module.
+The account address. e.g "0x1"
+The module name under the "address". e.g "coin"
+Readonly
addressReadonly
nameStatic
deserializeStatic
fromGenerated using TypeDoc
Optional
value: null | TOptional
Readonly
valuePrivate
vecSerialize 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.
+Retrieves the inner value of the MoveOption.
+This method is inspired by Rust's Option<T>.unwrap()
.
+In Rust, attempting to unwrap a None
value results in a panic.
Similarly, this method will throw an error if the value is not present.
+The contained value if present.
+const option = new MoveOption<Bool>(new Bool(true));
const value = option.unwrap(); // Returns the Bool instance
+
+Throws an error if the MoveOption does not contain a value.
+Static
BoolFactory method to generate a MoveOptionboolean
or undefined
.
Optional
value: null | booleana MoveOptionvalue
MoveOption.Bool(true).isSome() === true;
MoveOption.Bool().isSome() === false;
MoveOption.Bool(undefined).isSome() === false;
+
+value: the value used to fill the MoveOption. If value
is undefined
+the resulting MoveOption's .isSome() method will return false.
Static
MoveFactory method to generate a MoveOptionstring
or undefined
.
Optional
value: null | stringa MoveOptionvalue
MoveOption.MoveString("hello").isSome() === true;
MoveOption.MoveString("").isSome() === true;
MoveOption.MoveString().isSome() === false;
MoveOption.MoveString(undefined).isSome() === false;
+
+value: the value used to fill the MoveOption. If value
is undefined
+the resulting MoveOption's .isSome() method will return false.
Static
U128Factory method to generate a MoveOptionnumber
or a bigint
or undefined
.
Optional
value: null | AnyNumbera MoveOptionvalue
MoveOption.U128(1).isSome() === true;
MoveOption.U128().isSome() === false;
MoveOption.U128(undefined).isSome() === false;
+
+value: the value used to fill the MoveOption. If value
is undefined
+the resulting MoveOption's .isSome() method will return false.
Static
U16Factory method to generate a MoveOptionnumber
or undefined
.
Optional
value: null | numbera MoveOptionvalue
MoveOption.U16(1).isSome() === true;
MoveOption.U16().isSome() === false;
MoveOption.U16(undefined).isSome() === false;
+
+value: the value used to fill the MoveOption. If value
is undefined
+the resulting MoveOption's .isSome() method will return false.
Static
U256Factory method to generate a MoveOptionnumber
or a bigint
or undefined
.
Optional
value: null | AnyNumbera MoveOptionvalue
MoveOption.U256(1).isSome() === true;
MoveOption.U256().isSome() === false;
MoveOption.U256(undefined).isSome() === false;
+
+value: the value used to fill the MoveOption. If value
is undefined
+the resulting MoveOption's .isSome() method will return false.
Static
U32Factory method to generate a MoveOptionnumber
or undefined
.
Optional
value: null | numbera MoveOptionvalue
MoveOption.U32(1).isSome() === true;
MoveOption.U32().isSome() === false;
MoveOption.U32(undefined).isSome() === false;
+
+value: the value used to fill the MoveOption. If value
is undefined
+the resulting MoveOption's .isSome() method will return false.
Static
U64Factory method to generate a MoveOptionnumber
or a bigint
or undefined
.
Optional
value: null | AnyNumbera MoveOptionvalue
MoveOption.U64(1).isSome() === true;
MoveOption.U64().isSome() === false;
MoveOption.U64(undefined).isSome() === false;
+
+value: the value used to fill the MoveOption. If value
is undefined
+the resulting MoveOption's .isSome() method will return false.
Static
U8Factory method to generate a MoveOptionnumber
or undefined
.
Optional
value: null | numbera MoveOptionvalue
MoveOption.U8(1).isSome() === true;
MoveOption.U8().isSome() === false;
MoveOption.U8(undefined).isSome() === false;
+
+value: the value used to fill the MoveOption. If value
is undefined
+the resulting MoveOption's .isSome() method will return false.
Static
deserializeGenerated using TypeDoc
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.
+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.
+Static
deserializeGenerated using TypeDoc
This 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"]);
+
+values: an Array
a MoveVector<T>
with the values values
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.
+NOTE: This function will only work when the inner values in the MoveVector
are U8
s.
Static
BoolFactory method to generate a MoveVector of Bools from an array of booleans.
+a MoveVector<Bool>
const v = MoveVector.Bool([true, false, true, false]);
+
+values: an array of bools
to convert to Bools
Static
MoveFactory method to generate a MoveVector of MoveStrings from an array of strings.
+a MoveVector<MoveString>
const v = MoveVector.MoveString(["hello", "world"]);
+
+values: an array of strings
to convert to MoveStrings
Static
U128Factory method to generate a MoveVector of U128s from an array of numbers or bigints.
+a MoveVector<U128>
const v = MoveVector.U128([1, 2, 3, 4]);
+
+values: an array of numbers of type number | bigint
to convert to U128s
Static
U16Factory method to generate a MoveVector of U16s from an array of numbers.
+a MoveVector<U16>
const v = MoveVector.U16([1, 2, 3, 4]);
+
+values: an array of numbers
to convert to U16s
Static
U256Factory method to generate a MoveVector of U256s from an array of numbers or bigints.
+a MoveVector<U256>
const v = MoveVector.U256([1, 2, 3, 4]);
+
+values: an array of numbers of type number | bigint
to convert to U256s
Static
U32Factory method to generate a MoveVector of U32s from an array of numbers.
+a MoveVector<U32>
const v = MoveVector.U32([1, 2, 3, 4]);
+
+values: an array of numbers
to convert to U32s
Static
U64Factory method to generate a MoveVector of U64s from an array of numbers or bigints.
+a MoveVector<U64>
const v = MoveVector.U64([1, 2, 3, 4]);
+
+values: an array of numbers of type number | bigint
to convert to U64s
Static
U8Factory method to generate a MoveVector of U8s from an array of numbers.
+a MoveVector<U8>
const v = MoveVector.U8([1, 2, 3, 4]);
+
+values: an array of numbers
to convert to U8s
Static
deserializeDeserialize 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.
+a MoveVector of the corresponding class T +*
+const vec = MoveVector.deserialize(deserializer, U64);
+
+deserializer: the Deserializer instance to use, with bytes loaded into it already. +cls: the class to typecast the input values to, must be a Serializable and Deserializable type.
+Generated using TypeDoc
Representation of a Multi Agent Transaction that can serialized and deserialized
+Readonly
raw_The raw transaction
+Readonly
secondary_The secondary signers on this transaction
+Serialize a Raw Transaction With Data
+Static
deserializeDeserialize a Raw Transaction With Data
+Static
loadGenerated using TypeDoc
Represents the public key of a K-of-N Ed25519 multi-sig transaction.
+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 list of public keys
+At least "threshold" signatures must be valid
+Readonly
publicList of Ed25519 public keys for this LegacyMultiEd25519PublicKey
+Readonly
thresholdThe minimum number of valid signatures required, for the number of public keys specified
+Static
Readonly
MAX_Maximum number of public keys supported
+Static
Readonly
MIN_Minimum number of public keys needed
+Static
Readonly
MIN_Minimum threshold for the number of valid signatures required
+Get the authentication key associated with this public key
+Verifies that the private key associated with this public key signed the message with the given signature.
+Static
deserializeGenerated using TypeDoc
Represents the signature of a K-of-N Ed25519 multi-sig transaction.
+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
+Readonly
bitmap32-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.
+Readonly
signaturesThe list of underlying Ed25519 signatures
+Static
BITMAP_Number of bytes in the bitmap representing who signed the transaction (32-bits)
+Static
MAX_Maximum number of Ed25519 signatures supported
+Static
createHelper 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
+Here's an example of valid bits
[0, 2, 31]
+
+[0, 2, 31]
means the 1st, 3rd and 32nd bits should be set in the bitmap.
+The result bitmap should be 0b1010000000000000000000000000001
Static
deserializeGenerated using TypeDoc
Represents the public key of a multi-agent account.
+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.
Readonly
publicList of any public keys
+Readonly
signaturesThe minimum number of valid signatures required, for the number of public keys specified
+Get the authentication key associated with this public key
+Verifies that the private key associated with this public key signed the message with the given signature.
+Static
deserializeGenerated using TypeDoc
An abstract representation of a crypto signature, +associated to a specific signature scheme e.g. Ed25519 or Secp256k1
+This is the product of signing a message directly from a PrivateKey +and can be verified against a CryptoPublicKey.
+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
+Readonly
bitmap32-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.
+Readonly
signaturesThe list of underlying Ed25519 signatures
+Static
BITMAP_Number of bytes in the bitmap representing who signed the transaction (32-bits)
+Static
MAX_Maximum number of Ed25519 signatures supported
+Static
createHelper 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
+Here's an example of valid bits
[0, 2, 31]
+
+[0, 2, 31]
means the 1st, 3rd and 32nd bits should be set in the bitmap.
+The result bitmap should be 0b1010000000000000000000000000001
Static
deserializeGenerated using TypeDoc
Representation of a MultiSig that can serialized and deserialized
+Contains the payload to run a multi-sig account transaction.
+The multi-sig account address the transaction will be executed as.
+Optional
transaction_payload: MultiSigTransactionPayloadThe payload of the multi-sig transaction. This is optional when executing a multi-sig + transaction whose payload is already stored on chain.
+Readonly
multisig_Optional
Readonly
transaction_Static
deserializeGenerated using TypeDoc
Representation of a MultiSig Transaction Payload from multisig_account.move
+that can be serialized and deserialized
This class exists right now to represent an extensible transaction payload class for
+transactions used in multisig_account.move
. Eventually, this class will be able to
+support script payloads when the multisig_account.move
module supports them.
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.
+Readonly
transaction_Static
deserializeGenerated using TypeDoc
This error is used to explain why parsing failed.
+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.
+Optional
stackStatic
Optional
prepareOptional override for formatting stack traces
+Static
stackStatic
captureGenerated using TypeDoc
Abstract
An abstract representation of a public key.
+Provides a common interface for verifying any signature.
+Abstract
serializeAbstract
toAbstract
verifyVerifies that the private key associated with this public key signed the message with the given signature.
+Generated using TypeDoc
Representation of a Raw Transaction that can serialized and deserialized
+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.
+Readonly
chain_Readonly
expiration_Readonly
gas_Readonly
max_Readonly
payloadReadonly
senderReadonly
sequence_Static
deserializeGenerated using TypeDoc
Abstract
Representation of a Raw Transaction With Data that can serialized and deserialized
+Abstract
serializeSerialize a Raw Transaction With Data
+Static
deserializeDeserialize a Raw Transaction With Data
+Generated using TypeDoc
Representation of the challenge which is needed to sign by owner of the account +to rotate the authentication key.
+Readonly
accountReadonly
currentReadonly
moduleReadonly
newReadonly
originatorReadonly
sequenceReadonly
structGenerated using TypeDoc
Representation of a Script that can serialized and deserialized
+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.
+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,)
+
+Readonly
argsThe arguments that the bytecode function requires.
+Readonly
bytecodeThe move module bytecode
+Readonly
type_The type arguments that the bytecode function requires.
+Static
deserializeGenerated using TypeDoc
A Secp256k1 ecdsa private key
+Create a new PrivateKey instance from a Uint8Array or String.
+A HexInput (string or Uint8Array)
+Private
Readonly
keyThe private key bytes
+Static
Readonly
LENGTHLength of Secp256k1 ecdsa private key
+Derive the Secp256k1PublicKey from this private key.
+Secp256k1PublicKey
+Sign the given message with the private key.
+in HexInput format
+Signature
+Static
deserializeStatic
fromDerives a private key from a mnemonic seed phrase.
+the BIP44 path
+the mnemonic seed phrase
+The generated key
+Static
Private
fromA private inner function so we can separate from the main fromDerivationPath() method +to add tests to verify we create the keys correctly.
+the BIP44 path
+the seed phrase created by the mnemonics
+The generated key
+Static
generateGenerate a new random private key.
+Secp256k1PrivateKey
+Static
isuse instanceof Secp256k1PrivateKey
instead
Generated using TypeDoc
Represents the Secp256k1 ecdsa public key
+Secp256k1 authentication key is represented in the SDK as AnyPublicKey
.
Create a new PublicKey instance from a Uint8Array or String.
+A HexInput (string or Uint8Array)
+Private
Readonly
keyStatic
Readonly
LENGTHVerifies that the private key associated with this public key signed the message with the given signature.
+Static
deserializeStatic
isuse instanceof Secp256k1PublicKey
instead
Generated using TypeDoc
A signature of a message signed using a Secp256k1 ecdsa private key
+Create a new Signature instance from a Uint8Array or String.
+A HexInput (string or Uint8Array)
+Private
Readonly
dataThe signature bytes
+Static
Readonly
LENGTHSecp256k1 ecdsa signatures are 256-bit.
+Static
deserializeGenerated using TypeDoc
Abstract
Abstract
serializeGenerated using TypeDoc
Private
bufferPrivate
offsetProtected
appendPrivate
ensureSerializes a Serializable
value, facilitating composable serialization.
The Serializable value to serialize
+the serializer instance
+// Define the MoveStruct class that implements the Serializable interface
class MoveStruct extends Serializable {
constructor(
public creatorAddress: AccountAddress, // where AccountAddress extends Serializable
public collectionName: string,
public tokenName: string
) {}
serialize(serializer: Serializer): void {
serializer.serialize(this.creatorAddress); // Composable serialization of another Serializable object
serializer.serializeStr(this.collectionName);
serializer.serializeStr(this.tokenName);
}
}
// Construct a MoveStruct
const moveStruct = new MoveStruct(new AccountAddress(...), "MyCollection", "TokenA");
// Serialize a string, a u64 number, and a MoveStruct instance.
const serializer = new Serializer();
serializer.serializeStr("ExampleString");
serializer.serializeU64(12345678);
serializer.serialize(moveStruct);
// Get the bytes from the Serializer instance
const serializedBytes = serializer.toUint8Array();
+
+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.
+const serializer = new Serializer();
serializer.serializeStr("1234abcd");
assert(serializer.toUint8Array() === new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));
+
+Serializes a uint128 number.
+BCS layout for "uint128": Sixteen bytes. Binary format in little-endian representation.
+Serializes a uint16 number.
+BCS layout for "uint16": Two bytes. Binary format in little-endian representation.
+const serializer = new Serializer();
serializer.serializeU16(4660);
assert(serializer.toUint8Array() === new Uint8Array([0x34, 0x12]));
+
+Serializes a uint256 number.
+BCS layout for "uint256": Sixteen bytes. Binary format in little-endian representation.
+Serializes a uint32 number.
+BCS layout for "uint32": Four bytes. Binary format in little-endian representation.
+const serializer = new Serializer();
serializer.serializeU32(305419896);
assert(serializer.toUint8Array() === new Uint8Array([0x78, 0x56, 0x34, 0x12]));
+
+Serializes a uint64 number.
+BCS layout for "uint64": Eight bytes. Binary format in little-endian representation.
+const serializer = new Serializer();
serializer.serializeU64(1311768467750121216);
assert(serializer.toUint8Array() === new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));
+
+Serializes an array of BCS Serializable values to a serializer instance. +Note that this does not return anything. 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])`;
+
+Private
serializeGenerated using TypeDoc
Abstract
An abstract representation of a crypto signature, +associated to a specific signature scheme e.g. Ed25519 or Secp256k1
+This is the product of signing a message directly from a PrivateKey +and can be verified against a CryptoPublicKey.
+Abstract
serializeAbstract
toGenerated using TypeDoc
A SignedTransaction consists of a raw transaction and an authenticator. The authenticator +contains a client's public key and the signature of the raw transaction.
+Contains a client's public key and the signature of the raw transaction. +Authenticator has 3 flavors: single signature, multi-signature and multi-agent.
+Readonly
authenticatorReadonly
raw_Static
deserializeGenerated using TypeDoc
Signer implementation for the SingleKey authentication scheme. +This 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.
+Readonly
accountAccount address associated with the account
+Readonly
privatePrivate key associated with the account
+Readonly
publicPublic key associated with the account
+Readonly
signingSigning scheme used to sign transactions
+Sign the given message with the private key.
+in HexInput format
+AccountSignature
+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
+Static
fromDerives an account with bip44 path and mnemonics, +Default to using an Ed25519 signature scheme.
+Static
generateDerives an account from a randomly generated private key. +Default generation is using an Ed25519 key
+Account with the given signature scheme
+Generated using TypeDoc
Readonly
addressReadonly
moduleReadonly
nameReadonly
typeStatic
deserializeGenerated using TypeDoc
Abstract
Abstract
serializeStatic
deserializeGenerated using TypeDoc
Transaction authenticator Ed25519 for a single signer transaction
+Client's public key.
+Ed25519 signature of a raw transaction.
+Creating a Signed Transaction +for details about generating a signature.
+Readonly
public_Readonly
signatureStatic
deserializeStatic
loadGenerated using TypeDoc
Transaction authenticator for a fee payer transaction
+Sender account authenticator
+Secondary signers address
+Secondary signers account authenticators
+Object of the fee payer account address and the fee payer authentication
+Readonly
fee_Readonly
secondary_Readonly
secondary_Readonly
senderStatic
deserializeStatic
loadGenerated using TypeDoc
Transaction authenticator for a multi-agent transaction
+Sender account authenticator
+Secondary signers address
+Secondary signers account authenticators
+Readonly
secondary_Readonly
secondary_Readonly
senderStatic
deserializeStatic
loadGenerated using TypeDoc
Transaction authenticator Ed25519 for a multi signers transaction
+Client's public key.
+Multi Ed25519 signature of a raw transaction.
+Readonly
public_Readonly
signatureStatic
deserializeStatic
loadGenerated using TypeDoc
Single Sender authenticator for a single signer transaction
+AccountAuthenticator
+Readonly
senderStatic
deserializeStatic
loadGenerated using TypeDoc
Abstract
Representation of the supported Transaction Payload +that can serialized and deserialized
+Abstract
serializeSerialize a Transaction Payload
+Static
deserializeDeserialize a Transaction Payload
+Generated using TypeDoc
Representation of a Transaction Payload Entry Function that can serialized and deserialized
+Readonly
entrySerialize a Transaction Payload
+Static
deserializeDeserialize a Transaction Payload
+Static
loadGenerated using TypeDoc
Representation of a Transaction Payload Multi-sig that can serialized and deserialized
+Readonly
multiSerialize a Transaction Payload
+Static
deserializeDeserialize a Transaction Payload
+Static
loadGenerated using TypeDoc
Representation of a Transaction Payload Script that can serialized and deserialized
+Readonly
scriptSerialize a Transaction Payload
+Static
deserializeDeserialize a Transaction Payload
+Static
loadGenerated using TypeDoc
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
Provides a simple framework for receiving payloads to be processed.
+a config object
+the max wait time to wait before resyncing the sequence number +to the current on-chain state, default to 30
+submit up to maximumInFlight
transactions per account.
+Mempool limits the number of transactions per account to 100, hence why we default to 100.
If maximumInFlight
are in flight, wait sleepTime
seconds before re-evaluating, default to 10
Readonly
accountReadonly
accountReadonly
aptostransactions that have been committed to chain
+signed transactions waiting to be submitted
+transactions that have been submitted to chain
+Readonly
tasktransactions payloads waiting to be generated and signed
+TODO support entry function payload from ABI builder
+Static
prefixedRest
...args: ArgumentMap<TransactionWorkerEvents>[Extract<T, keyof TransactionWorkerEvents>]Optional
context: anyOnce transaction has been sent to chain, we check for its execution status.
+transactions that were sent to chain and are now waiting to be executed
+the account's sequence number that was sent with the transaction
+Calls each of the listeners registered for a given event.
+Rest
...args: ArgumentMap<TransactionWorkerEvents>[Extract<T, keyof TransactionWorkerEvents>]Return an array listing the events for which the emitter has registered +listeners.
+Generates a signed transaction that can be submitted to chain
+an Aptos account
+a sequence number the transaction will be generated with
+Return the number of listeners listening to a given event.
+Return the listeners registered for a given event.
+Optional
fn: ((...args) => void)Rest
...args: ArgumentMap<TransactionWorkerEvents>[Extract<T, keyof TransactionWorkerEvents>]Optional
context: anyOptional
once: booleanAdd a listener for a given event.
+Rest
...args: ArgumentMap<TransactionWorkerEvents>[Extract<T, keyof TransactionWorkerEvents>]Optional
context: anyAdd a one-time listener for a given event.
+Rest
...args: ArgumentMap<TransactionWorkerEvents>[Extract<T, keyof TransactionWorkerEvents>]Optional
context: anyReads the outstanding transaction queue and submits the transaction to chain.
+If the transaction has fulfilled, it pushes the transaction to the processed +transactions queue and fires a transactionsFulfilled event.
+If the transaction has failed, it pushes the transaction to the processed +transactions queue with the failure reason and fires a transactionsFailed event.
+Push transaction to the transactions queue
+Transaction payload
+Optional
options: InputGenerateTransactionOptionsRemove the listeners of a given event.
+Optional
fn: ((...args) => void)Rest
...args: ArgumentMap<TransactionWorkerEvents>[Extract<T, keyof TransactionWorkerEvents>]Optional
context: anyOptional
once: booleanGenerated using TypeDoc
Abstract
Abstract
serializeAbstract
toStatic
deserializeGenerated using TypeDoc
Static
deserializeStatic
loadGenerated using TypeDoc
Static
deserializeStatic
loadGenerated using TypeDoc
Generics are used for type parameters in entry functions. However, +they are not actually serialized into a real type, so they cannot be +used as a type directly.
+Readonly
valueStatic
deserializeStatic
loadGenerated using TypeDoc
Optional
stackStatic
Optional
prepareOptional override for formatting stack traces
+Static
stackStatic
captureGenerated using TypeDoc
Readonly
valueStatic
deserializeStatic
loadGenerated using TypeDoc
Static
deserializeStatic
loadGenerated using TypeDoc
Readonly
valueStatic
deserializeStatic
loadGenerated using TypeDoc
Static
deserializeStatic
loadGenerated using TypeDoc
Static
deserializeStatic
loadGenerated using TypeDoc
Static
deserializeStatic
loadGenerated using TypeDoc
Static
deserializeStatic
loadGenerated using TypeDoc
Static
deserializeStatic
loadGenerated using TypeDoc
Static
deserializeStatic
loadGenerated using TypeDoc
Readonly
valueStatic
deserializeStatic
loadStatic
u8Generated using TypeDoc
Readonly
valueSerialize 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.
+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.
+Static
deserializeGenerated using TypeDoc
Readonly
valueSerialize 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.
+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.
+Static
deserializeGenerated using TypeDoc
Readonly
valueSerialize 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.
+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.
+Static
deserializeGenerated using TypeDoc
Readonly
valueSerialize 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.
+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.
+Static
deserializeGenerated using TypeDoc
Readonly
valueSerialize 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.
+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.
+Static
deserializeGenerated using TypeDoc
Readonly
valueSerialize 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.
+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.
+Static
deserializeGenerated using TypeDoc
Transaction Authenticator enum as they are represented in Rust +https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L414
+Generated using TypeDoc
This enum is used to explain why an address was invalid.
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Scheme used for deriving account addresses from other data
+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
+Generated using TypeDoc
Generated using TypeDoc
A list of supported key types and associated seeds
+Generated using TypeDoc
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
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
The list of supported Processor types for our indexer api.
+These can be found from the processor_status table in the indexer database. +https://cloud.hasura.io/public/graphiql?endpoint=https://api.mainnet.aptoslabs.com/v1/graphql
+Generated using TypeDoc
Generated using TypeDoc
Script transaction arguments enum as they are represented in Rust +https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs#L11
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Transaction Authenticator enum as they are represented in Rust +https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L44
+Generated using TypeDoc
Transaction payload enum as they are represented in Rust +https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478
+Generated using TypeDoc
TRANSACTION TYPES
+Generated using TypeDoc
Transaction variants enum as they are represented in Rust +https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L440
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
TypeTag enum as they are represented in Rust +https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27
+Generated using TypeDoc
Derive a child key from the private key
+Generated using TypeDoc
Generated using TypeDoc
The main function to use when doing an API request.
+AptosRequest
+The config information for the SDK client instance
+the response or AptosApiError
+Generated using TypeDoc
We are defining function signatures, each with its specific input and output.
+These are the possible function signature for our generateTransaction
function.
+When we call our generateTransaction
function with the relevant type properties,
+Typescript can infer the return type based on the appropriate function overload.
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
+An instance of a RawTransaction, plus optional secondary/fee payer addresses
+{
rawTransaction: RawTransaction,
secondarySignerAddresses? : Array<AccountAddress>,
feePayerAddress?: AccountAddress
}
+
+Generated using TypeDoc
Generated using TypeDoc
Converts a non-BCS encoded argument into BCS encoded, if necessary
+Generated using TypeDoc
Creates an object address from creator address and seed
+The object creator account address
+The seed in either Uint8Array | string type
+The object account address
+Generated using TypeDoc
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
+Generated using TypeDoc
Generated using TypeDoc
Derive the raw transaction type - FeePayerRawTransaction or MultiAgentRawTransaction or RawTransaction
+A aptos transaction type
+FeePayerRawTransaction | MultiAgentRawTransaction | RawTransaction
+Generated using TypeDoc
Deserialize a Script Transaction Argument
+Generated using TypeDoc
Generated using TypeDoc
Fetches the ABI for an entry function from the module
+Generated using TypeDoc
Fetches a function ABI from the on-chain module ABI. It doesn't validate whether it's a view or entry function.
+Generated using TypeDoc
Fetches the ABI for a view function from the module
+Generated using TypeDoc
Finds first non-signer arg.
+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.
Generated using TypeDoc
Generate a multi signers signed transaction that can be submitted to chain
+MultiAgentRawTransaction | FeePayerRawTransaction
+The account authenticator of the transaction sender
+Optional
feePayerAuthenticator: AccountAuthenticatorOptional
additionalSignersAuthenticators: AccountAuthenticator[]A SignedTransaction
+Generated using TypeDoc
Generates a raw transaction
+AptosConfig
+Optional
feeOptional
options?: InputGenerateTransactionOptionsThe transaction payload - can create by using generateTransactionPayload()
+The transaction's sender account address as a hex input
+RawTransaction
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
We are defining function signatures, each with its specific input and output.
+These are the possible function signature for our generateTransactionPayload
function.
+When we call our generateTransactionPayload
function with the relevant type properties,
+Typescript can infer the return type based on the appropriate function overload.
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
+TransactionPayload
+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
+TransactionPayload
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Main function to do a Get request
+GetRequestOptions
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Aptos derive path is 637
+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, last two components must be non-hardened.
+path string (e.g. m/44'/637'/0'/0/0
).
Generated using TypeDoc
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.
+path string (e.g. m/44'/637'/0'/0'/0'
).
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
All types are made of a few parts they're either:
+There are a few more special cases that need to be handled, however.
+Optional
options: { Optional
allowGenerated using TypeDoc
Main function to do a Post request
+PostRequestOptions
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Given a url and method, sends the request with axios and +returns the response.
+Generated using TypeDoc
Sign a transaction that can later be submitted to chain
+The signer account to sign the transaction
+A aptos transaction type to sign
+The signer AccountAuthenticator
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
The Aptos TypeScript SDK provides a convenient way to interact with the Aptos blockchain using TypeScript. It offers a +set of utility functions, classes, and types to simplify the integration process and enhance developer productivity.
+This repository supports version >= 0.0.0 of the Aptos SDK npm package.
+Install with your favorite package manager such as npm, yarn, or pnpm:
+pnpm install @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" />
+
+Then, the SDK can be accessed through window.aptosSDK
.
Initialize Aptos
to access the SDK API.
// initiate the main entry point into Aptos SDK
const aptos = new Aptos();
+
+If you want to pass in a custom config
+// an optional config information for the SDK client instance.
const config = new AptosConfig({ network: Network.LOCAL }); // default network is devnet
const aptos = new Aptos(config);
+
+const modules = await aptos.getAccountModules({ 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 = await 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
// Read more https://github.com/aptos-labs/aptos-ts-sdk/blob/main/src/api/account.ts#L364
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");
// Derieve an account from private key and address
const account = await Account.fromPrivateKeyAndAddress({ privateKey, address });
+
+const path = "m/44'/637'/0'/0'/1";
const mnemonic = "various float stumble...";
const account = Account.fromDerivationPath({ path, mnemonic });
+
+Using transaction submission api
+const alice: Account = Account.generate();
const bobAddress = "0xb0b";
// build transaction
const transaction = await aptos.transaction.build.simple({
sender: alice.accountAddress,
data: {
function: "0x1::coin::transfer",
typeArguments: ["0x1::aptos_coin::AptosCoin"],
functionArguments: [bobAddress, 100],
},
});
// using sign and submit separately
const senderAuthenticator = aptos.transaction.sign({ signer: alice, transaction });
const committedTransaction = await aptos.transaction.submit.simple({ transaction, senderAuthenticator });
// using signAndSubmit combined
const committedTransaction = await aptos.signAndSubmitTransaction({ signer: alice, transaction });
+
+Using built in transferCoinTransaction
const alice: Account = Account.generate();
const bobAddress = "0xb0b";
// build transaction
const transaction = await aptos.transferCoinTransaction({
sender: alice,
recipient: bobAddress,
amount: 100,
});
const pendingTransaction = await aptos.signAndSubmitTransaction({ signer: alice, transaction });
+
+package.json
files to get you going quickly!To run the SDK tests, simply run from the root of this repository:
+++Note: for a better experience, make sure there is no aptos local node process up and running (can check if there is a process running on port 8080).
+
pnpm i
pnpm test
+
+If you see import error when you do this
+import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
+
+It could be your tsconfig.json
is not incompatible, make sure your moduleResolution
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, checkout out the contributing guide.
+Generated using TypeDoc
The API response type
+the response status. i.e. 200
+the response message
+the response data
+the url the request was made to
+the response headers
+(optional) - the request object
+(optional) - the request object
+Optional
configOptional
requestGenerated using TypeDoc
Generated using TypeDoc
Optional
bodyOptional
contentOptional
headersOptional
overridesOptional
API_Optional
WITH_Optional
AUTH_Optional
paramsGenerated using TypeDoc
Optional
configOptional
headersOptional
requestOptional
responseGenerated using TypeDoc
Arguments for creating an opaque Account
from any supported private key.
+This is used when the private key type is not known at compilation time.
Optional
addressOptional
legacyGenerated using TypeDoc
Arguments for creating an Ed25519Account
from an Ed25519PrivateKey
.
+This is the default input type when passing an Ed25519PrivateKey
.
+In order to use the SingleKey authentication scheme, legacy
needs to be explicitly set to false.
Optional
addressOptional
legacyGenerated using TypeDoc
Arguments for creating an SingleKeyAccount
from an Ed25519PrivateKey
.
+The legacy
argument needs to be explicitly set to false in order to
+use the SingleKey
authentication scheme.
Optional
addressGenerated using TypeDoc
Arguments for creating an SingleKeyAccount
from any supported private key
+that is not an Ed25519PrivateKey
.
+The legacy
argument defaults to false and cannot be explicitly set to true.
Optional
addressOptional
legacyGenerated using TypeDoc
This interface exists to define Deserializable
Generated using TypeDoc
Optional
addressGenerated using TypeDoc
Generated using TypeDoc
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.
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Interface of the arguments to generate a multi-agent transaction.
+Used to provide to generateTransaction()
method in the transaction builder flow
Optional
feeOptional
optionsGenerated using TypeDoc
Interface that holds the user data input when generating a multi-agent transaction
+Optional
optionsOptional
withGenerated using TypeDoc
Interface of the arguments to generate a single signer transaction.
+Used to provide to generateTransaction()
method in the transaction builder flow
Optional
feeOptional
optionsGenerated using TypeDoc
Interface that holds the user data input when generating a single signer transaction
+Optional
optionsOptional
secondaryOptional
withGenerated using TypeDoc
Interface that holds the user data input when submitting a transaction
+Optional
additionalOptional
feeGenerated using TypeDoc
Interface that holds the return data when generating a multi-agent transaction.
+a bcs serialized raw transaction
+secondary signer addresses for multi-agent transaction
+Optional
feeGenerated using TypeDoc
Generated using TypeDoc
Controls the number of results that are returned and the starting position of those results.
+parameter specifies the starting position of the query result within the set of data. Default is 0.
+specifies the maximum number of items or records to return in a query result. Default is 25.
+Optional
limitOptional
offsetGenerated using TypeDoc
An abstract representation of a private key. +It is associated to a signature scheme and provides signing capabilities.
+Generated using TypeDoc
Generated using TypeDoc
Serialize an argument to BCS-serialized 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.
+Generated using TypeDoc
Interface that holds the return data when generating a single signer transaction
+a bcs serialized raw transaction
+Optional
feeOptional
secondaryGenerated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
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.
+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.
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
The union of all single account signatures.
+Generated using TypeDoc
Generated using TypeDoc
Unified type that holds all the return interfaces when generating different transaction types
+Generated using TypeDoc
Type that holds all raw transaction instances Aptos SDK supports
+Generated using TypeDoc
The generated transaction payload type that was produces from generateTransactionPayload()
function.
Generated using TypeDoc
The API request type
+Optional
acceptOptional
body?: anyOptional
contentOptional
originOptional
overrides?: ClientConfig & FullNodeConfig & IndexerConfig & FaucetConfigOptional
params?: Record<string, string | AnyNumber | boolean | undefined>Optional
path?: stringthe url to make the request to, i.e https://fullnode.devnet.aptoslabs.com/v1
+the request method "GET" | "POST"
+(optional) - the endpoint to make the request to, i.e transactions
+(optional) - the body of the request
+(optional) - the content type to set the content-type
header to,
+by default is set to application/json
(optional) - query params to add to the request
+(optional) - the local method the request came from
+(optional) - a ClientConfig
object type to override request data
Generated using TypeDoc
Set of configuration options that can be provided when initializing the SDK. +The purpose of these options is to configure various aspects of the SDK's +behavior and interaction with the Aptos network
+Optional
Readonly
client?: ClientOptional
Readonly
clientOptional
Readonly
faucet?: stringOptional
Readonly
faucetOptional
Readonly
fullnode?: stringOptional
Readonly
fullnodeOptional
Readonly
indexer?: stringOptional
Readonly
indexerOptional
Readonly
network?: NetworkGenerated using TypeDoc
A list of Authentication Key schemes that are supported by Aptos.
+They are combinations of signing schemes and derive schemes.
+Generated using TypeDoc
A Block type
+Optional
transactions?: TransactionResponse[]The transactions in the block in sequential order
+Generated using TypeDoc
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
+Generated using TypeDoc
A configuration object we can pass with the request to the server.
+Optional
API_Optional
WITH_api key generated from developer portal https://developers.aptoslabs.com/manage/api-keys}
+extra headers we want to send with the request
+whether to carry cookies. By default, it is set to true and cookies will be sent
+Generated using TypeDoc
General type definition for client HEADERS
+Optional
HEADERS?: Record<string, string | number | boolean>Generated using TypeDoc
Generated using TypeDoc
Key of table in JSON
+Type of key
+Value of table in JSON
+Type of value
+Generated using TypeDoc
Deleted table data
+Deleted key
+Deleted key type
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Interface of an Entry function's ABI.
+This is used to provide type checking and simple input conversion on ABI based transaction submission.
+Optional
signers?: numberGenerated using TypeDoc
Entry function arguments to be used when building a raw transaction using BCS serialized arguments
+Generated using TypeDoc
Arguments of the function
+Type arguments of the function
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
A Faucet only configuration object
+Optional
AUTH_extra headers we want to send with the request
+an auth token to send with a faucet request
+Generated using TypeDoc
A Fullnode only configuration object
+extra headers we want to send with the request
+Generated using TypeDoc
Data need for a generic function ABI, both view and entry
+Generated using TypeDoc
Type holding the outputs of the estimate gas API
+Optional
deprioritized_The deprioritized estimate for the gas unit price
+The current estimate for the gas unit price
+Optional
prioritized_The prioritized estimate for the gas unit price
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Input type to generate an account using Single Signer +Secp256k1
+Optional
legacy?: falseGenerated using TypeDoc
Generated using TypeDoc
Final state of resources changed by the transaction
+Events emitted during genesis
+Optional
state_Whether the transaction was successful
+The VM status of the transaction, can tell useful information in a failure
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
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)
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Optional
acceptThe accepted content type of the response of the API
+The config for the API client
+Optional
contentThe content type of the request body
+The name of the API method
+Optional
overrides?: ClientConfigSpecific client overrides for this request to override aptosConfig
+Optional
params?: 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
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
The graphql query type to pass into the queryIndexer
function
Optional
variables?: {}Generated using TypeDoc
Hex data as input to a function
+Generated using TypeDoc
An Indexer only configuration object
+extra headers we want to send with the request
+Generated using TypeDoc
The data needed to generate an Entry Function payload
+Optional
abi?: EntryFunctionABIOptional
typeGenerated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Unified type that holds all the interfaces to generate different transaction types
+Generated using TypeDoc
Unified type that holds all the user data input interfaces when generating different transaction types
+Generated using TypeDoc
Optional options to set when generating a transaction
+Optional
accountOptional
expireOptional
gasOptional
maxGenerated using TypeDoc
Unified type for the data needed to generate a transaction payload of types: +Entry Function | Script | Multi Sig
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
The data needed to generate a Multi Sig payload
+Generated using TypeDoc
Generated using TypeDoc
The data needed to generate a Multi Sig payload
+Generated using TypeDoc
The data needed to generate a Script payload
+Optional
typeGenerated using TypeDoc
Optional
feeFor a fee payer transaction (aka Sponsored Transaction)
+Optional
options?: InputSimulateTransactionOptionsOptional
secondaryFor a fee payer or multi-agent transaction that requires additional signers in
+For a single signer transaction
+The transaction to simulate, probably generated by generateTransaction()
Generated using TypeDoc
Optional
estimateOptional
estimateOptional
estimateGenerated using TypeDoc
The data needed to generate a View Function payload
+Optional
abi?: ViewFunctionABIOptional
functionOptional
typeGenerated using TypeDoc
Data needed to generate a view function, with an already fetched ABI
+Generated using TypeDoc
Data needed to generate a view function payload and fetch the remote ABI
+Generated using TypeDoc
Chain ID of the current chain
+Optional
git_Git hash of the build of the API endpoint. Can be used to determine the exact +software version used by the API endpoint.
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
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
+Generated using TypeDoc
Move abilities tied to the generic type param and associated with the function that uses it
+Generated using TypeDoc
Generated using TypeDoc
A Move module
+Public functions of the module
+Friends of the module
+Structs of the module
+Generated using TypeDoc
Optional
abi?: MoveModuleGenerated using TypeDoc
Move module id is a string representation of Move module. +Module name is case-sensitive.
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Move script bytecode
+Optional
abi?: MoveFunctionGenerated using TypeDoc
A move struct
+Abilities associated with the struct
+Fields associated with the struct
+Generic types associated with the struct
+Whether the struct is a native struct of Move
+Generated using TypeDoc
Move struct field
+Generated using TypeDoc
This is the format for a fully qualified struct, resource, or entry function in Move.
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Map of Move types to local TypeScript types
+Generated using TypeDoc
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
String -> string
Address -> 0x${string}
Struct - 0x${string}::${string}::${string}
Object -> 0x${string}
Vector -> Array<MoveValue>
Option -> MoveValue | null | undefined
Generated using TypeDoc
Optional
transaction_Generated using TypeDoc
A generic type that being passed by each function and holds an +array of properties we can sort the query by
+Generated using TypeDoc
Generated using TypeDoc
Whereas ParsingError is thrown when parsing fails, e.g. in a fromString function, +this type is returned from "defensive" functions like isValid.
+Optional
invalidIf valid is false, this will be a code explaining why parsing failed.
+Optional
invalidIf valid is false, this will be a string explaining why parsing failed.
+True if valid, false otherwise.
+Generated using TypeDoc
Optional
signature?: TransactionSignatureGenerated using TypeDoc
Generated using TypeDoc
Optional
acceptThe accepted content type of the response of the API
+The config for the API client
+Optional
body?: anyThe body of the request, should match the content type of the request
+Optional
contentThe content type of the request body
+The name of the API method
+Optional
overrides?: ClientConfigSpecific client overrides for this request to override aptosConfig
+Optional
params?: 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
+Generated using TypeDoc
Script function arguments to be used when building a raw transaction using BCS serialized arguments
+Generated using TypeDoc
Arguments of the function
+Type arguments of the function
+Generated using TypeDoc
Generated using TypeDoc
Entry function arguments to be used when building a raw transaction using remote ABI
+Generated using TypeDoc
Generated using TypeDoc
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
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Refers to the token standard we want to query for
+Generated using TypeDoc
Generated using TypeDoc
The other involved parties' addresses
+The associated signatures, in the same order as the secondary addresses
+Generated using TypeDoc
The other involved parties' addresses
+The associated signatures, in the same order as the secondary addresses
+Generated using TypeDoc
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
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
These are the JSON representations of transaction signatures returned from the node API.
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
BCS types
+Generated using TypeDoc
Final state of resources changed by the transaction
+Events generated by the transaction
+Optional
signature?: TransactionSignatureWhether the transaction was successful
+The VM status of the transaction, can tell useful information in a failure
+Generated using TypeDoc
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
+Generated using TypeDoc
Interface of an View function's ABI.
+This is used to provide type checking and simple input conversion on ABI based transaction submission.
+Generated using TypeDoc
Option properties to pass for waitForTransaction() function
+Optional
checkOptional
timeoutOptional
waitGenerated using TypeDoc
Generated using TypeDoc
WRITESET CHANGE TYPES
+Generated using TypeDoc
State key hash
+Generated using TypeDoc
Generated using TypeDoc
Optional
data?: DeletedTableDataGenerated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Optional
data?: DecodedTableDataGenerated using TypeDoc
Const
Generated using TypeDoc
Const
The default gas currency for the network.
+Generated using TypeDoc
Const
Aptos derive path is 637
+Generated using TypeDoc
Const
The 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.
+Generated using TypeDoc
Const
The 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.
+Generated using TypeDoc
Const
The 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.
+Generated using TypeDoc
Const
Generated using TypeDoc
Const
Generated using TypeDoc
Const
Generated using TypeDoc
Const
Generated using TypeDoc
Const
Generated using TypeDoc
Const
Generated using TypeDoc
Const
Generated using TypeDoc
Const
Generated using TypeDoc
Const
Generated using TypeDoc
Interface for a generic Aptos account.
+The interface is defined as abstract class to provide a single entrypoint for account generation, +either through
+Account.generate()
orAccount.fromDerivationPath
. +Despite this being an abstract class, it should be treated as an interface and enforced using +theimplements
keyword.Note: Generating an account instance does not create the account on-chain.
+