Package-level declarations

Types

Link copied to clipboard
class Aptos(val settings: AptosConfig = AptosConfig()) : AutoCloseable

Kotlin-native, namespaced entry point for Aptos APIs.

Link copied to clipboard
data class AptosConfig(val network: Network = Network.DEVNET, val endpoints: AptosEndpoints = AptosEndpoints(), val commonHeaders: Map<String, String> = emptyMap(), val fullNode: AptosEndpointConfig = AptosEndpointConfig(), val indexer: AptosEndpointConfig = AptosEndpointConfig(), val faucet: AptosEndpointConfig = AptosEndpointConfig(), val requestTimeoutMillis: Long, val indexerWaitTimeoutMillis: Long, val archivalFallback: Boolean = true, val namesContractAddress: AccountAddress? = null, val transactionDefaults: TransactionDefaults = TransactionDefaults(), val transport: AptosTransport? = null, val abiCachePolicy: AbiCachePolicy = xyz.mcxross.kaptos.move.AbiCachePolicy())

Immutable configuration for the namespaced Aptos API.

Link copied to clipboard
data class AptosEndpointConfig(val headers: Map<String, String> = emptyMap(), val authToken: String? = null, val requestHeaders: suspend () -> Map<String, String> = { emptyMap() })

Headers and optional bearer token applied to one Aptos endpoint.

Link copied to clipboard
data class AptosEndpoints(val fullNode: String? = null, val indexer: String? = null, val faucet: String? = null)

Optional endpoint overrides. Unspecified endpoints are derived from AptosConfig.network.

Link copied to clipboard
data class TransactionDefaults(val maxGasAmount: ULong, val expirationSecondsFromNow: ULong)

Defaults used when a transaction build does not provide per-request options.

Functions

Link copied to clipboard
suspend fun <T> aptos(config: AptosConfig = AptosConfig(), block: suspend Aptos.() -> T): T

Runs one Aptos workflow with managed lifecycle semantics.