MoveArgumentCodec

class MoveArgumentCodec(moduleLoader: MoveModuleLoader, cachePolicy: AbiCachePolicy = AbiCachePolicy())

ABI-aware codec for recursive Move struct and enum arguments.

Fetched ABIs expire according to AbiCachePolicy. Preloaded ABIs stay pinned until invalidated.

Constructors

Link copied to clipboard
constructor(moduleLoader: MoveModuleLoader, cachePolicy: AbiCachePolicy = AbiCachePolicy())

Functions

Link copied to clipboard
suspend fun clearCache()

Clear fetched and preloaded ABIs. In-flight loads finish before this invalidation returns.

Link copied to clipboard
suspend fun encode(type: TypeTag, argument: MoveArgument, typeArguments: List<TypeTag> = emptyList()): AptosResult<MoveArgument.PreSerialized>

Encode one value according to its instantiated Move type.

Link copied to clipboard
suspend fun entryFunctionPayload(function: String, typeArguments: List<TypeTag> = emptyList(), arguments: List<MoveArgument> = emptyList()): AptosResult<TransactionPayload.EntryFunction>

Resolve an entry-function ABI and return a payload with every argument encoded.

Link copied to clipboard
suspend fun invalidateModule(address: AccountAddress, name: String)

Remove one fetched or preloaded module after a known deployment or upgrade.

Link copied to clipboard
suspend fun preload(vararg values: MoveModuleBytecode)

Add trusted module ABIs to this codec's cache.