GetCoinInfo - Sui
GetCoinInfo. Returns metadata, supply and regulation info for a coin type.
GetCoinInfo - sui [Value: 20CU]
Returns metadata, treasury and regulation information for a coin type.
gRPC: sui.rpc.v2.StateService/GetCoinInfo
Use cases
- Read token decimals and symbol
- Check total supply
- Detect regulated coins
Constraints
- Treasury info only if TreasuryCap is not wrapped
- Metadata only if not wrapped
Unlock Access to 100+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Language
Request
Examples
grpcurl \
-H "x-drpc-key: {API-KEY}" \
-H "x-drpc-chain: sui" \
-d '{
"coin_type": "0x2::sui::SUI"
}' \
grpc.drpc.live:443 \
sui.rpc.v2.StateService/GetCoinInfoResponse
200
{
"coin_type": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
"metadata": {
"id": "0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3",
"decimals": 9,
"name": "Sui",
"symbol": "SUI",
"description": "",
"icon_url": ""
}
}Request params
object
coin_typestring
The coin type to request information about, for example `0x2::sui::SUI`.
Response
200
Returns metadata, treasury and regulation information for a coin type.Response params
object
coin_typestring
The coin type.
metadataobject
Coin metadata from `0x2::coin::CoinMetadata` or the CoinRegistry `Currency` object.
object
idstring
Id of the metadata or `Currency` object.
decimalsinteger
Number of decimal places the coin uses.
namestring
Name of the token.
symbolstring
Symbol of the token.
descriptionstring
Description of the token.
icon_urlstring
URL of the token logo.
metadata_cap_idstring
Id of the MetadataCap, if claimed.
metadata_cap_statestring
`METADATA_CAP_STATE_UNKNOWN`, `CLAIMED`, `UNCLAIMED` or `DELETED`.
treasuryobject
`0x2::coin::TreasuryCap` information and total supply, if the TreasuryCap exists and has not been wrapped.
object
idstring
Id of the `0x2::coin::TreasuryCap` object.
total_supplystring
Total supply of the coin.
supply_statestring
`SUPPLY_STATE_UNKNOWN`, `FIXED` or `BURN_ONLY`.
regulated_metadataobject
Regulation information. If the coin is not known to be regulated, only `coin_regulated_state` is set.
object
idstring
Id of the `RegulatedCoinMetadata` object, for coins not migrated to the CoinRegistry.
coin_metadata_objectstring
Id of the coin's metadata object.
deny_cap_objectstring
Id of the coin's `DenyCap` object.
allow_global_pauseboolean
Whether the coin can be globally paused.
variantinteger
Variant of the regulated coin metadata.
coin_regulated_statestring
`COIN_REGULATED_STATE_UNKNOWN`, `REGULATED` or `UNREGULATED`.