Package-level declarations

Types

Link copied to clipboard

This class is used to represent an account address.

Link copied to clipboard

This interface is used to define the input for an account address.

Link copied to clipboard
@Serializable
data class AccountData(val sequenceNumber: ULong, val authenticationKey: String)

Represents core account metadata on the Aptos blockchain.

Link copied to clipboard
data class AccountModulesArgs(val accountAddress: AccountAddressInput, val options: AccountModulesArgs.Options? = null)
Link copied to clipboard
@Serializable
data class AccountResource(val type: String, val data: Data)
Link copied to clipboard

This enum is used to explain why an address was invalid.

Link copied to clipboard
@Serializable
data class AddressMap(val handle: String)
Link copied to clipboard

Predefined marker for the canonical AptosCoin.

Link copied to clipboard

Thrown only at configuration boundaries that cannot return an AptosResult.

Link copied to clipboard
sealed interface AptosError

Stable error categories exposed by the redesigned SDK API.

Link copied to clipboard
data class AptosPage<out T>(val items: List<T>, val totalCount: Int, val request: PageRequest)

A page of domain models with a stable aggregate count.

Link copied to clipboard
sealed interface AptosResult<out T>

The public, typed outcome of a Kaptos operation.

Link copied to clipboard
data class AptosSlice<out T>(val items: List<T>, val request: PageRequest)

An offset page for indexer datasets that do not expose an aggregate-count field.

Link copied to clipboard
Link copied to clipboard
data class BibeCiphertext(val id: ByteString, val threeG2Points: ByteString, val paddedKey: FixedBytes16, val nonce: FixedBytes12, val body: ByteString)
Link copied to clipboard
@Serializable
data class Block(val blockHeight: String, val blockHash: String, val blockTimestamp: String, val firstVersion: String, val lastVersion: String)
Link copied to clipboard
@Serializable
@SerialName(value = "block_epilogue_transaction")
data class BlockEpilogueTransactionResponse(val type: TransactionResponseType, val version: String, val hash: String, val stateChangeHash: String, val eventRootHash: String, val stateCheckpointHash: String?, val gasUsed: String, val success: Boolean, val vmStatus: String, val accumulatorRootHash: String, val timestamp: String) : TransactionResponse
Link copied to clipboard
@Serializable
@SerialName(value = "block_metadata_transaction")
data class BlockMetadataTransactionResponse(val type: TransactionResponseType, val version: String, val hash: String, val stateChangeHash: String, val eventRootHash: String, val stateCheckpointHash: String?, val gasUsed: String, val success: Boolean, val vmStatus: String, val accumulatorRootHash: String, val id: String, val epoch: String, val round: String, val events: List<Event>, val previousBlockVotesBitvec: List<Long>, val proposer: String, val failedProposerIndices: List<Long>, val timestamp: String) : TransactionResponse
Link copied to clipboard
@Serializable(with = BoolSerializer::class)
data class Bool(val value: Boolean) : TransactionArgument
Link copied to clipboard
open class ByteString(value: ByteArray)

Immutable byte sequence with content equality.

Link copied to clipboard
data class ClaimedEntryFunction(val module: ModuleId, val function: Identifier? = null)
Link copied to clipboard
interface Client
Link copied to clipboard
data class CreateCollectionOptions(val maxSupply: Long = Long.MAX_VALUE, val mutableDescription: Boolean = true, val mutableRoyalty: Boolean = true, val mutableURI: Boolean = true, val mutableTokenDescription: Boolean = true, val mutableTokenName: Boolean = true, val mutableTokenProperties: Boolean = true, val mutableTokenURI: Boolean = true, val tokensBurnableByCreator: Boolean = true, val tokensFreezableByCreator: Boolean = true, val royaltyNumerator: Long = 0, val royaltyDenominator: Long = 1)

Options for creating a new collection in an account.

Link copied to clipboard
@Serializable
data class Data(val authenticationKey: String? = null, val coinRegisterEvents: Event? = null, val guidCreationNum: String? = null, val keyRotationEvents: Event? = null, val sequenceNumber: String? = null)
Link copied to clipboard
Link copied to clipboard
data class EncryptedCiphertext(val verificationKey: FixedBytes32, val bibeCiphertext: BibeCiphertext, val associatedData: ByteString, val signature: FixedBytes64)
Link copied to clipboard
data class EncryptedTransactionPayload(val ciphertext: EncryptedCiphertext, val extraConfig: TransactionExtraConfig, val payloadHash: FixedBytes32, val encryptionEpoch: ULong, val claimedEntryFunction: ClaimedEntryFunction? = null)

Batch-encryption wire record. Cryptographic construction lives in kaptos-encrypted-transactions.

Link copied to clipboard
class EntryFunctionABI(typeParameters: List<MoveFunctionGenericTypeParam>, parameters: List<TypeTag>, val signers: Int? = null) : FunctionABI

Interface of an Entry function's ABI.

Link copied to clipboard

Builder for constructing entry-function arguments with inferred MoveArgument conversions.

Link copied to clipboard
data class EntryFunctionCall(val module: ModuleId, val function: Identifier, val typeArguments: List<TypeTag> = emptyList(), val arguments: List<MoveArgument> = emptyList())
Link copied to clipboard
@Serializable
data class Event(val guid: Guid, val sequenceNumber: String? = null, val type: String? = null, val data: JsonElement? = null)
Link copied to clipboard
data class ExternalFeePayerRequest(val transactionBytes: ByteArray, val senderAuthenticatorBytes: ByteArray, val additionalSignersAuthenticatorBytes: List<ByteArray> = emptyList(), val fingerprint: String)

Opaque BCS values accepted by an external Aptos Gas Station.

Link copied to clipboard
@Serializable
data class FaucetRequest(val address: String, val amount: Long)
Link copied to clipboard
@Serializable
data class FaucetResponse(val txnHashes: List<String>)
Link copied to clipboard
data class FeePayerSignature(val transaction: UnsignedTransaction.FeePayer, val authenticator: AccountAuthenticator)

The immutable transaction and authenticator produced when a sponsor signs.

Link copied to clipboard
@Serializable
data class FixedBytes(val value: HexInput) : TransactionArgument
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open class FunctionABI(val typeParameters: List<MoveFunctionGenericTypeParam>, val parameters: List<TypeTag>)

Data need for a generic function ABI, both view and entry

Link copied to clipboard
data class FunctionArguments(val functionArguments: List<EntryFunctionArgument>)
Link copied to clipboard
Link copied to clipboard
@Serializable
data class GasEstimation(val gasEstimate: Long, val deprioritizedGasEstimate: Long? = null, val prioritizedGasEstimate: Long? = null)
Link copied to clipboard
@Serializable
@SerialName(value = "genesis_transaction")
data class GenesisTransactionResponse(val type: TransactionResponseType = TransactionResponseType.GENESIS, val version: String, val hash: String, val stateChangeHash: String, val eventRootHash: String, val stateCheckpointHash: String?, val gasUsed: String, val success: Boolean, val vmStatus: String, val accumulatorRootHash: String, val payload: JsonElement, val events: List<Event>) : TransactionResponse
Link copied to clipboard
@Serializable
data class GraphqlQuery(val query: String, val variables: Map<String, Int>? = null)
Link copied to clipboard
@Serializable
data class Guid(val creationNumber: String? = null, val accountAddress: String? = null)
Link copied to clipboard
Link copied to clipboard
@Serializable
data class Identifier(value: String)

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"

Link copied to clipboard
data class InputEntryFunctionData(val function: MoveFunctionId, val typeArguments: List<TypeTag>, val functionArguments: List<EntryFunctionArgument>, val abi: EntryFunctionABI? = null) : InputGenerateTransactionPayloadData

The data needed to generate an Entry Function payload

Link copied to clipboard
@Serializable
data class InputViewFunctionData(val function: MoveFunctionId, val typeArguments: List<TypeTag>, val functionArguments: List<EntryFunctionArgument>, val abi: ViewFunctionABI? = null)

The data needed to generate a View Function payload

Link copied to clipboard
@Serializable
data class LedgerInfo(val chainId: Long, val epoch: String, val ledgerVersion: String, val oldestLedgerVersion: String, val ledgerTimestamp: String, val nodeRole: String, val oldestBlockHeight: String, val blockHeight: String, val gitHash: String = "", val encryptionKey: String? = null)
Link copied to clipboard
data class LedgerVersionArg(val ledgerVersion: Int? = null)
Link copied to clipboard
class LedgerVersionQueryParam : QueryParams
Link copied to clipboard
@Serializable
data class ModuleId(val address: AccountAddress, val name: Identifier)

Representation of a ModuleId that can serialized and deserialized ModuleId means the module address (e.g "0x1") and the module name (e.g "coin")

Link copied to clipboard
@Serializable
enum MoveAbility : Enum<MoveAbility>
Link copied to clipboard
@Serializable
data class MoveFunction(val name: String, val visibility: MoveVisibility, val isEntry: Boolean, val isView: Boolean, val genericTypeParams: List<MoveFunctionGenericTypeParam>, val params: List<String>, val return: List<String>)
Link copied to clipboard
@Serializable
data class MoveFunctionGenericTypeParam(val constraints: List<MoveAbility>)
Link copied to clipboard
Link copied to clipboard
@Serializable
data class MoveModule(val address: String, val name: String, val friends: List<MoveModuleId>, val exposedFunctions: List<MoveFunction>, val structs: List<MoveStruct>)
Link copied to clipboard
@Serializable
data class MoveModuleBytecode(val bytecode: String, val abi: MoveModule? = null)
Link copied to clipboard
typealias MoveModuleId = String
Link copied to clipboard
@Serializable(with = MoveOptionSerializer::class)
data class MoveOption<T : EntryFunctionArgument>(val value: T?) : TransactionArgument
Link copied to clipboard
@Serializable
data class MoveResource(val type: String)
Link copied to clipboard
@Serializable(with = MoveStringSerializer::class)
data class MoveString(val value: String) : TransactionArgument
Link copied to clipboard
@Serializable
data class MoveStruct(val name: String, val isNative: Boolean, val isEvent: Boolean = false, val isEnum: Boolean = false, val abilities: List<MoveAbility>, val genericTypeParams: List<MoveFunctionGenericTypeParam>, val fields: List<MoveStructField>, val variants: List<MoveStructVariant> = emptyList())
Link copied to clipboard
@Serializable
data class MoveStructField(val name: String, val type: String)
Link copied to clipboard
typealias MoveStructId = String
Link copied to clipboard
abstract class MoveStructType(typeString: String) : MoveType

Base class for defining typed Move struct markers or wrappers.

Link copied to clipboard
@Serializable
data class MoveStructVariant(val name: String, val fields: List<MoveStructField>)
Link copied to clipboard
interface MoveType

Represents a Move type in Kotlin that can provide its corresponding TypeTag.

Link copied to clipboard

Registry mapping Kotlin types to Move TypeTags for reified type inference.

Link copied to clipboard
@Serializable
sealed class MoveValue
Link copied to clipboard
@Serializable(with = MoveVectorSerializer::class)
data class MoveVector<T : EntryFunctionArgument>(var values: List<T>) : TransactionArgument

This class is the Kotlin representation of a Move vector<T>, where T is a type that represents either a primitive type (bool, u8, u64, ...) or a BCS-serializable struct itself.

Link copied to clipboard
@Serializable
enum MoveVisibility : Enum<MoveVisibility>
Link copied to clipboard
sealed interface MultisigPayload
Link copied to clipboard

Enum class representing the network to connect to.

Link copied to clipboard
@Serializable
data class OriginatingAddress(val addressMap: AddressMap)
Link copied to clipboard
@Serializable
data class OriginatingAddressResponse(val type: String, val data: OriginatingAddress)
Link copied to clipboard
data class PageRequest(val offset: Int = 0, val limit: Int = 20)

Kotlin-native offset pagination shared by indexer-backed services.

Link copied to clipboard
data class PaginationArgs(val offset: Int? = null, val limit: Int? = null)

Controls the number of results that are returned and the starting position of those results.

Link copied to clipboard
class PaginationQueryParams : QueryParams
Link copied to clipboard
@Serializable
@SerialName(value = "pending_transaction")
data class PendingTransactionResponse(val type: TransactionResponseType = TransactionResponseType.PENDING, val hash: String, val sender: String, val sequenceNumber: String, val maxGasAmount: String, val gasUnitPrice: String, val expirationTimestampSecs: String) : TransactionResponse
Link copied to clipboard

The list of supported Processor types for our indexer api.

Link copied to clipboard
sealed class PropertyType
Link copied to clipboard
sealed class PropertyValue
Link copied to clipboard
sealed interface ReplayProtection

Selects conventional sequence-number or AIP-122 nonce replay protection.

Link copied to clipboard
@Serializable
sealed class ScriptFunctionArgument
Link copied to clipboard
class ScriptPayload(bytecode: ByteArray, val typeArguments: List<TypeTag> = emptyList(), val arguments: List<MoveArgument> = emptyList())
Link copied to clipboard
@Serializable
data class ScriptPayloadResponse(val type: String, val code: String, val type_arguments: List<String>, val arguments: List<String>) : TransactionPayloadResponse
Link copied to clipboard
Link copied to clipboard
data class SimulationOptions(val estimateGasUnitPrice: Boolean = false, val estimateMaxGasAmount: Boolean = false, val estimatePrioritizedGasUnitPrice: Boolean = false)

Controls the estimates returned by transaction simulation.

Link copied to clipboard
class SpecificPaginationQueryParams : QueryParams
Link copied to clipboard
@Serializable
@SerialName(value = "state_checkpoint_transaction")
data class StateCheckpointTransactionResponse(val type: TransactionResponseType, val version: String, val hash: String, val stateChangeHash: String, val eventRootHash: String, val stateCheckpointHash: String?, val gasUsed: String, val success: Boolean, val vmStatus: String, val accumulatorRootHash: String, val timestamp: String) : TransactionResponse
Link copied to clipboard
@Serializable
class StructTag(val address: AccountAddress, val moduleName: String, val name: String, val typeArgs: List<TypeTag>)
Link copied to clipboard
@Serializable
data class TableItemRequest(val key_type: String, val value_type: String, val key: JsonElement)
Link copied to clipboard
Link copied to clipboard
data class TokenStandardArg(val tokenStandard: TokenStandard? = null)
Link copied to clipboard
@Serializable
sealed class TransactionArgument : EntryFunctionArgument
Link copied to clipboard
@Serializable
data class TransactionEd25519Signature(val type: String, val public_key: String, val signature: String) : TransactionSignature
Link copied to clipboard
sealed interface TransactionExecutable
Link copied to clipboard
sealed interface TransactionExtraConfig
Link copied to clipboard
data class TransactionOptions(val maxGasAmount: ULong? = null, val gasUnitPrice: ULong? = null, val expirationTimestampSecs: ULong? = null, val expirationSecondsFromNow: ULong? = null, val replayProtection: ReplayProtection? = null)

Immutable options used when building a transaction.

Link copied to clipboard
sealed interface TransactionPayload

Exact wire model for Aptos transaction payload variants.

Link copied to clipboard
@Serializable
sealed class TransactionPayloadResponse
Link copied to clipboard
class TransactionQueryParams : QueryParams
Link copied to clipboard
@Serializable
sealed class TransactionResponse
Link copied to clipboard
Link copied to clipboard
@Serializable
sealed class TransactionSignature
Link copied to clipboard
data class TypeArguments(val typeArguments: List<TypeTag>)
Link copied to clipboard
Link copied to clipboard
@Serializable(with = TypeTagSerializer::class)
sealed class TypeTag
Link copied to clipboard
data object TypeTagAddress : TypeTag
Link copied to clipboard
data object TypeTagBool : TypeTag
Link copied to clipboard
class TypeTagGeneric(val id: UShort) : TypeTag
Link copied to clipboard
data object TypeTagI128 : TypeTag
Link copied to clipboard
data object TypeTagI16 : TypeTag
Link copied to clipboard
data object TypeTagI256 : TypeTag
Link copied to clipboard
data object TypeTagI32 : TypeTag
Link copied to clipboard
data object TypeTagI64 : TypeTag
Link copied to clipboard
data object TypeTagI8 : TypeTag
Link copied to clipboard
class TypeTagReference(val ref: TypeTag) : TypeTag
Link copied to clipboard
data object TypeTagSigner : TypeTag
Link copied to clipboard
@Serializable
class TypeTagStruct(val type: StructTag) : TypeTag
Link copied to clipboard
data object TypeTagU128 : TypeTag
Link copied to clipboard
data object TypeTagU16 : TypeTag
Link copied to clipboard
data object TypeTagU256 : TypeTag
Link copied to clipboard
data object TypeTagU32 : TypeTag
Link copied to clipboard
data object TypeTagU64 : TypeTag
Link copied to clipboard
data object TypeTagU8 : TypeTag
Link copied to clipboard
@Serializable
enum TypeTagVariants : Enum<TypeTagVariants>
Link copied to clipboard
class TypeTagVector(val type: TypeTag) : TypeTag
Link copied to clipboard
@Serializable
data class U128(val value: String) : TransactionArgument
Link copied to clipboard
@Serializable
data class U16(val value: UShort) : TransactionArgument
Link copied to clipboard
@Serializable
data class U256(val value: String) : TransactionArgument
Link copied to clipboard
@Serializable
data class U32(val value: UInt) : TransactionArgument
Link copied to clipboard
@Serializable(with = U64Serializer::class)
data class U64(val value: ULong) : TransactionArgument
Link copied to clipboard
@Serializable(with = U8Serializer::class)
data class U8(val value: Byte) : TransactionArgument
Link copied to clipboard
sealed interface UnsignedTransaction

A transaction before account authenticators are attached.

Link copied to clipboard
Link copied to clipboard
@Serializable
@SerialName(value = "user_transaction")
data class UserTransactionResponse(val type: TransactionResponseType = TransactionResponseType.USER, val version: String, val hash: String, val stateChangeHash: String, val eventRootHash: String, val statecCheckpointHash: String?, val gasUsed: String, val success: Boolean, val vmStatus: String, val accumulatorRootHash: String, val sender: String, val sequenceNumber: String, val maxGasAmount: String, val gasUnitPrice: String, val expirationTimestampSecs: String, val events: List<Event>, val timestamp: String) : TransactionResponse
Link copied to clipboard
@Serializable
@SerialName(value = "validator_transaction")
data class ValidatorTransactionResponse(val type: TransactionResponseType = TransactionResponseType.VALIDATOR, val version: String, val hash: String, val stateChangeHash: String, val eventRootHash: String, val stateCheckpointHash: String?, val gasUsed: String, val success: Boolean, val vmStatus: String, val accumulatorRootHash: String, val events: List<Event>, val timestamp: String, val validatorTransactionType: String, val dkgTranscript: JsonElement? = null) : TransactionResponse
Link copied to clipboard
class ViewFunctionABI(typeParameters: List<MoveFunctionGenericTypeParam>, parameters: List<TypeTag>, val returnTypes: List<TypeTag>) : FunctionABI

Interface of an View function's ABI.

Link copied to clipboard
data class WaitForTransactionOptions(val timeoutSecs: Int = DEFAULT_TXN_TIMEOUT_SEC, val checkSuccess: Boolean = true, val waitForIndexer: Boolean? = null)

Options for waiting for a transaction to be finalized.

Link copied to clipboard
@Serializable
sealed class WriteSetChange
Link copied to clipboard
@Serializable
@SerialName(value = "WriteSetChange::Delete")
data class WriteSetChangeDeleteModule(val type: String, val address: String, val state_key_hash: String, val module: String) : WriteSetChange

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the failure, or null for success.

Link copied to clipboard
inline fun <T, R> AptosResult<T>.flatMap(transform: (T) -> AptosResult<R>): AptosResult<R>

Chains another typed Aptos operation after a successful value.

Link copied to clipboard
inline fun <T, R> AptosResult<T>.fold(onSuccess: (T) -> R, onFailure: (AptosError) -> R): R

Reduces either branch to one caller-defined result type.

Link copied to clipboard
inline fun <T> AptosResult<T>.getOrElse(defaultValue: (AptosError) -> T): T

Returns the success value or derives a fallback from the typed error.

Link copied to clipboard

Returns the success value, or null for a failure.

Link copied to clipboard
inline fun <T, R> AptosResult<T>.map(transform: (T) -> R): AptosResult<R>

Transforms a successful value while retaining a failure unchanged.

Link copied to clipboard
Link copied to clipboard
inline fun <T> AptosResult<T>.onFailure(action: (AptosError) -> Unit): AptosResult<T>

Performs action for failure and returns this result unchanged.

Link copied to clipboard
inline fun <T> AptosResult<T>.onSuccess(action: (T) -> Unit): AptosResult<T>

Performs action for success and returns this result unchanged.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun String.toTypeTag(allowGenerics: Boolean = false): TypeTag

Parses this string into a TypeTag.

Link copied to clipboard
@JvmName(name = "toTypeTagsFromAny")
fun Iterable<Any?>.toTypeTags(): List<TypeTag>

Converts each element in this iterable to a TypeTag.

fun Iterable<String>.toTypeTags(allowGenerics: Boolean = false): List<TypeTag>

Parses each string in this iterable into a TypeTag.

Link copied to clipboard
Link copied to clipboard
inline fun <T> typeTag(): TypeTag

Alias for typeTagOf.

Link copied to clipboard
inline fun <T> typeTagOf(): TypeTag

Infers a TypeTag from a reified Kotlin type.