Coin Query API
suix_getAllBalances
Gets all balances for the address in the request.
curl --location 'https://sui.nownodes.io' \
--header 'Content-Type: application/json' \
--header 'api-key: API_KEY' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "suix_getAllBalances",
"params": [
"0x94f1a597b4e8f709a396f7f6b1482bdcd65a673d111e49286c527fab7c2d0961"
]
}'
{
"jsonrpc": "2.0",
"result": [
{
"coinType": "0x2::sui::SUI",
"coinObjectCount": 15,
"totalBalance": "3000000000",
"lockedBalance": {}
}
],
"id": 1
}
suix_getAllCoins
Return all Coin objects owned by an address.
curl --location 'https://sui.nownodes.io' \
--header 'Content-Type: application/json' \
--header 'api-key: API_KEY' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "suix_getAllCoins",
"params": [
"0x41f5975e3c6bd5c95f041a8493ad7e9934be26e69152d2c2e86d8a9bdbd242b3",
"0x2564cd31a71cf9833609b111436d8f0f47b7f8b9927ec3f8975a1dcbf9b25564",
3
]
}'
{
"jsonrpc": "2.0",
"result": {
"data": [
{
"coinType": "0x2::sui::SUI",
"coinObjectId": "0x91825debff541cf4e08b5c5f7296ff9840e6f0b185af93984cde8cf3870302c0",
"version": "103626",
"digest": "7dp5WtTmtGp83EXYYFMzjBJRFeSgR67AzqMETLrfgeFx",
"balance": "200000000",
"previousTransaction": "9WfFUVhjbbh4tWkyUse1QxzbKX952cyXScH7xJNPB2vQ"
},
{
"coinType": "0x2::sui::SUI",
"coinObjectId": "0x48a53f22e2e901ea2a5bf44fdd5bb94a1d83b6efc4dd779f0890ca3b1f6ba997",
"version": "103626",
"digest": "9xLdMXezY8d1yRA2TtN6pYjapyy2EVKHWNriGPFGCFvd",
"balance": "200000000",
"previousTransaction": "Byq9SyV7x6fvzaf88YRA9JM8vLbVLJAqUX8pESDmKcgw"
},
{
"coinType": "0x2::sui::SUI",
"coinObjectId": "0x6867fcc63161269c5c0c73b02229486bbaff319209dfb8299ced3b8609037997",
"version": "103626",
"digest": "5xexWFq6QpGHBQyC9P2cbAJXq9qm2EjzfuRM9NwS1uyG",
"balance": "200000000",
"previousTransaction": "CEjwHmo98nAiYhSMfKoSDvUMtfKJ6ge6Uj4wKotK4MPZ"
}
],
"nextCursor": "0x861c5e055605b2bb1199faf653a8771e448930bc95a0369fad43a9870a2e5878",
"hasNextPage": true
},
"id": 1
}
suix_getBalance
Return the total coin balance for one coin type, owned by the address owner.
curl --location 'https://sui.nownodes.io' \
--header 'Content-Type: application/json' \
--header 'api-key: API_KEY' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "suix_getBalance",
"params": [
"0x51ceab2edc89f74730e683ebee65578cb3bc9237ba6fca019438a9737cf156ae",
"0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC"
]
}'
{
"jsonrpc": "2.0",
"result": {
"coinType": "0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC",
"coinObjectCount": 15,
"totalBalance": "15",
"lockedBalance": {}
},
"id": 1
}
suix_getCoinMetadata
Return metadata(e.g., symbol, decimals) for a coin
curl --location 'https://sui.nownodes.io' \
--header 'Content-Type: application/json' \
--header 'api-key: API_KEY' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "suix_getCoinMetadata",
"params": [
"0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC"
]
}'
{
"jsonrpc": "2.0",
"result": {
"decimals": 9,
"name": "Usdc",
"symbol": "USDC",
"description": "Stable coin.",
"iconUrl": null,
"id": "0x6d907beaa3a49db57bdfdb3557e6d405cbf01c293a53e01457d65e92b5d8dd68"
},
"id": 1
}
suix_getCoins
Return all Coin<coin_type
> objects owned by an address.
curl --location 'https://sui.nownodes.io' \
--header 'Content-Type: application/json' \
--header 'api-key: API_KEY' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "suix_getCoins",
"params": [
"0xd62ca040aba24f862a763851c54908cd2a0ee7d709c11b93d4a2083747b76856",
"0x2::sui::SUI",
"0xe5c651321915b06c81838c2e370109b554a448a78d3a56220f798398dde66eab",
3
]
}'
{
"jsonrpc": "2.0",
"result": {
"data": [
{
"coinType": "0x2::sui::SUI",
"coinObjectId": "0xa5a8e30db5a798a7354340b6ea78a66f50921841ab5359ec7a3dc01f282420ae",
"version": "103626",
"digest": "tw5DzJTfdxTn4f3rekFrhN7dQTUezBgsEhycDobTBLb",
"balance": "200000000",
"previousTransaction": "HSein75AFXgdsnbABWLQ5mvjFmPFWrBFi9CMVsNn7gJr"
},
{
"coinType": "0x2::sui::SUI",
"coinObjectId": "0x47dfa99496428c65b2054ad7db1872b87ff05b1047bb5e3adf5257cceb08ecb4",
"version": "103626",
"digest": "AfgFe7ZfjJ5dWV6VAy2LbtvBFhcABkvdvwEjLrRcFqtr",
"balance": "200000000",
"previousTransaction": "5WHnm9jUZEtDvSvsj7HBrP5BoxA3UY6R57qqumXJXboV"
},
{
"coinType": "0x2::sui::SUI",
"coinObjectId": "0xd4f062dbcfc3bf73f5861945592222ff7b090ac21c8a3cf840abdc5b743da778",
"version": "103626",
"digest": "9er6jxigfuQEKsn9gtPV2oW1zGQRcFtKNijHVe88GUJD",
"balance": "200000000",
"previousTransaction": "H3gwoKE2FSLx3BwvNTTKqCsNHmg6ARzm345icHhXUAEW"
}
],
"nextCursor": "0xd4f062dbcfc3bf73f5861945592222ff7b090ac21c8a3cf840abdc5b743da778",
"hasNextPage": true
},
"id": 1
}
suix_getTotalSupply
Return total supply for a coin
curl --location 'https://sui.nownodes.io' \
--header 'Content-Type: application/json' \
--header 'api-key: API_KEY' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "suix_getTotalSupply",
"params": [
"0x0a52124e2d53af3bef7959609efa51761ad155441a1b73bdaeecce7c56488b13::acoin::ACOIN"
]
}'
{
"jsonrpc": "2.0",
"result": {
"value": "12023692"
},
"id": 1
}
Last updated