Aptos

class Aptos(val settings: AptosConfig = AptosConfig()) : AutoCloseable

Kotlin-native, namespaced entry point for Aptos APIs.

Use aptos for one workflow so clients and SDK-owned accounts are cleaned up automatically. Construct this class directly when an application needs a long-lived client.

Constructors

Link copied to clipboard
constructor(settings: AptosConfig = AptosConfig())

Properties

Link copied to clipboard

Account-abstraction status and authentication-function transaction builders.

Link copied to clipboard

Account lookup, balance, discovery, and authentication-key rotation operations.

Link copied to clipboard

Legacy coin-standard transaction builders.

Link copied to clipboard

Digital-asset reads and transaction builders.

Link copied to clipboard

Faucet funding operations for networks that advertise a faucet.

Link copied to clipboard

Fungible-asset transaction builders.

Link copied to clipboard

Low-level typed GraphQL execution for queries not covered by a domain service.

Link copied to clipboard

Ledger metadata and block lookup operations.

Link copied to clipboard

Aptos Names Service reads and transaction builders.

Link copied to clipboard

Object lookup operations.

Link copied to clipboard
Link copied to clipboard

Delegated-staking reads.

Link copied to clipboard

REST and indexer table operations.

Link copied to clipboard

Transaction building, signing, simulation, submission, and confirmation operations.

Link copied to clipboard

Shared transport handle used by this client and optional Kaptos modules. Its lifecycle remains owned by Aptos, unless it was supplied in AptosConfig.

Link copied to clipboard

Read-only Move view-function calls.

Functions

Link copied to clipboard
fun account(privateKey: String, address: AccountAddressInput? = null): Account

Creates an SDK-owned account from a canonical algorithm-prefixed AIP-80 string.

fun account(privateKey: Aip80PrivateKey, address: AccountAddressInput? = null): Account

Creates an SDK-owned account from a validated AIP-80 private key.

fun account(privateKey: PrivateKey, address: AccountAddressInput? = null): Account

Creates an SDK-owned local account. Its private key is cleared automatically when this client closes, including when used inside aptos.

fun account(signingScheme: SigningSchemeInput = SigningSchemeInput.Ed25519, address: AccountAddressInput? = null): Account

Generates an SDK-owned local account. Ed25519 is the conventional Aptos default.

Link copied to clipboard
suspend fun clearAbiCache()

Clear fetched and preloaded ABIs after a deployment or before a workflow requiring fresh ABIs.

Link copied to clipboard
open override fun close()

Clears SDK-owned secrets and closes SDK-created transports. Injected transports remain caller-owned. Calling this method more than once has no effect.

Link copied to clipboard
fun ed25519Account(privateKey: String, address: AccountAddressInput? = null): Ed25519Account

Creates an SDK-owned legacy Ed25519 account from a canonical AIP-80 string.

Creates an SDK-owned legacy Ed25519 account from a validated AIP-80 private key.

Creates an SDK-owned legacy Ed25519 account while retaining its concrete account type.

Link copied to clipboard
fun <T : AutoCloseable> own(resource: T): T

Transfers resource ownership to this client. Owned resources are closed in reverse order before the transport. Most applications use the higher-level account factories instead.

Link copied to clipboard

Creates an SDK-owned SingleKey account while retaining its concrete account type.

fun singleKeyAccount(signingScheme: SigningSchemeInput = SigningSchemeInput.Ed25519, address: AccountAddressInput? = null): SingleKeyAccount

Generates an SDK-owned SingleKey account; Ed25519 is the default key algorithm.