getFungibleAssetMetadataByAssetType

Queries the fungible asset metadata for a specific asset type.

Usage

val aptos = Aptos(AptosConfig(AptosSettings(network = Network.TESTNET)))
val resolution = aptos.getFungibleAssetMetadataByAssetType(APTOS_COIN)

when (resolution) {
is Result.Ok -> {
val data = resolution.value
println("Asset type from response: ${data?.asset_type}")
}
is Result.Err -> {
println("Error retrieving metadata by asset type: ${resolution.error.message}")
}
}

Return

A Result containing a single fungible asset metadata object or an AptosIndexerError.

Parameters

assetType

The asset type to query for, e.g., "0x1::aptos_coin::AptosCoin".

page

Optional pagination arguments.

minimumLedgerVersion

Optional ledger version to sync up to before querying.