StateService.GetCoinInfo
Get coin info through sui.rpc.v2.StateService/GetCoinInfo on Inodra's Sui gRPC endpoint.
Endpoint
| Network | Host | Authentication |
|---|---|---|
| Mainnet | mainnet-grpc.inodra.com:443 | x-api-key metadata |
| Testnet | testnet-grpc.inodra.com:443 | x-api-key metadata |
Full method name: sui.rpc.v2.StateService/GetCoinInfo. Unary: one request, one response. Get a key from the dashboard; the same key works on every protocol.
Request: GetCoinInfoRequest
Request message for NodeService.GetCoinInfo.
| Field | Type | Description |
|---|---|---|
coin_type | string | The coin type to request information about |
Response: GetCoinInfoResponse
Response message for NodeService.GetCoinInfo.
| Field | Type | Description |
|---|---|---|
coin_type | string | Required. The coin type. |
metadata | CoinMetadata | This field will be populated with information about this coin type's 0x2::coin::CoinMetadata if it exists and has not been wrapped. |
treasury | CoinTreasury | This field will be populated with information about this coin type's 0x2::coin::TreasuryCap if it exists and has not been wrapped. |
regulated_metadata | RegulatedCoinMetadata | If this coin type is a regulated coin, this field will be populated with information either from its Currency object in the CoinRegistry, or from its 0x2::coin::RegulatedCoinMetadata object for coins that have not been migrated to the CoinRegistry If this coin is not known to be regulated, only the coin_regulated_state field will be populated. |
CoinMetadata
Metadata for a coin type
| Field | Type | Description |
|---|---|---|
id | string | ObjectId of the 0x2::coin::CoinMetadata object or 0x2::sui::coin_registry::Currency object (when registered with CoinRegistry). |
decimals | uint32 | Number of decimal places to coin uses. |
name | string | Name for the token |
symbol | string | Symbol for the token |
description | string | Description of the token |
icon_url | string | URL for the token logo |
metadata_cap_id | string | The MetadataCap ID if it has been claimed for this coin type. This capability allows updating the coin's metadata fields. Only populated when metadata is from CoinRegistry. |
metadata_cap_state | CoinMetadata.MetadataCapState | State of the MetadataCap for this coin type. |
CoinTreasury
Information about a coin type's 0x2::coin::TreasuryCap and its total available supply
| Field | Type | Description |
|---|---|---|
id | string | ObjectId of the 0x2::coin::TreasuryCap object. |
total_supply | uint64 | Total available supply for this coin type. |
supply_state | CoinTreasury.SupplyState | Supply state indicating if the supply is fixed or can still be minted |
grpcurl
grpcurl -H "x-api-key: YOUR_API_KEY" \
-d '{
"coin_type": "0x2::sui::SUI"
}' \
mainnet-grpc.inodra.com:443 \
sui.rpc.v2.StateService/GetCoinInfoServer reflection is enabled, so no proto files are needed for grpcurl. Field masks are written as {"paths": [...]}.
TypeScript
import { GrpcWebFetchTransport, SuiGrpcClient } from '@mysten/sui/grpc'
const transport = new GrpcWebFetchTransport({
baseUrl: 'https://mainnet-grpc.inodra.com',
meta: { 'x-api-key': process.env.INODRA_API_KEY! }
})
const client = new SuiGrpcClient({ network: 'mainnet', transport })
const { coinMetadata } = await client.getCoinMetadata({ coinType: '0x2::sui::SUI' })
console.log(coinMetadata?.symbol, coinMetadata?.decimals)Uses the typed SuiGrpcClient method from @mysten/sui v2 that calls this RPC. Install with npm install @mysten/sui and set INODRA_API_KEY. The gRPC gateway guide covers native gRPC transport for backends.
Credits
1 credit per call. See credits and billing for the full table.
JSON-RPC equivalent
Replaces suix_getCoinMetadata. The JSON-RPC to gRPC migration guide has before and after code for the common calls.