Overview
Authentication, rate limits, error handling, and sending to specific regions
See our JSON-RPC API overview doc for information on how to send toTokyo - apac1
Mainnet and US-East - us1
Mainnet or Testnet. The examples below use the US-East
region URL.
Reading Object Data
sui_getObject
DescriptionReturn the object data for a specified object. Params
id
: the ID of the queried objectoptions
:SuiObjectDataOptions
- Optional. Sui options for specifying the object content to be returned. All options default to false if not provided.
US East - us1
region URL since it is currently the only region where we offer Testnet. To send to another region, see our our Node Service API Overview. The TypeScript example uses the Shinami Clients SDK, which you can install with:
Shell
{{name}}
with the actual value for that name
-
SuiObjectResponse
, which can be either of:- data:
SuiObjectData
- error :
ObjectResponseError
- data:
sui_multiGetObjects
DescriptionReturn the object data for a list of objects. Params
ids
: A list of object ids to be queriedoptions
:SuiObjectDataOptions
- Optional. Sui options for specifying the object content to be returned for each id. All options default to false if not provided.
US East - us1
region URL since it is currently the only region where we offer Testnet. To send to another region, see our our Node Service API Overview. The TypeScript example uses the Shinami Clients SDK, which you can install with:
Shell
{{name}}
with the actual value for that name
SuiObjectResponse
, whose elements can be either of:
- data:
SuiObjectData
- error :
ObjectResponseError
sui_tryGetPastObject
Caution:This will not return data on deleted objects or old object versions unless you are using a Shinami dedicated node with extra history storage enabled. For more info see here.
Return the object information for a specified version.
Note there is no software-level guarantee/SLA that objects with past versions can be retrieved by this API, even if the object and version exists/existed. We store full object history on Mainnet but no object history on Testnet, as explained here.
Name | Type | Description |
---|---|---|
object_id | string | The ID of the object you want historical information about. |
version | number | The version of the object you wish to retrieve. |
options | (Optional) SuiObjectDataOptions for specifying the object content to be returned |
US East - us1
region URL since it is currently the only region where we offer Testnet. To send to another region, see our our Node Service API Overview. The TypeScript example uses the Shinami Clients SDK, which you can install with:
Shell
NODE_SERVICE_API_KEY
with your actual API key value
Type | Description |
---|---|
ObjectRead | Contents vary based on the status. Statuses include “VersionFound”, “ObjectNotExists”, “ObjectDeleted”, “VersionNotFound”, and “VersionTooHigh”. Some examples are shown in the example responses. Click the link on the type to learn more about the possible data shapes. |
sui_tryMultiGetPastObjects
Caution:This will not return data on deleted objects or old object versions unless you are using a Shinami dedicated node with extra history storage enabled. For more info see here.
Return object information for a vector of objects and versions.
Note there is no software-level guarantee/SLA that objects with past versions can be retrieved by this API, even if the object and version exists/existed. We store full object history on Mainnet but no object history on Testnet, as explained here.
past_objects
:[GetPastObjectRequest]
- a vector of objects and versions to be queriedoptions
:ObjectDataOptions
- Optional. Sui options for specifying the object content to be returned
SuiPastObjectResponse[]
: [ObjectRead]
suix_getDynamicFieldObject
DescriptionReturn the dynamic field object information for a specified object. Params
-
parent_object_id
:String
- the ID of the queried parent object -
name
: typeDynamicFieldName
with elements:type
:String
- the type of the objectvalue
: additional identifying information (see example below)
US East - us1
region URL since it is currently the only region where we offer Testnet. To send to another region, see our our Node Service API Overview. The TypeScript example uses the Shinami Clients SDK, which you can install with:
Shell
{{name}}
with the actual value for that name
-
SuiObjectResponse
: typeSuiObjectResponse
with optional elementsdata
?: typeSuiObjectData
|null
error
?: typeObjectResponseError
|null
suix_getDynamicFields
DescriptionReturn the list of dynamic field objects owned by an object. Params
parent_object_id
:String
- the ID of the queried parent objectcursor
:String
- optional paging cursorlimit
:uint
- maximum number of items per page; defaults to maximum possible if not specified, which is 50.
US East - us1
region URL since it is currently the only region where we offer Testnet. To send to another region, see our our Node Service API Overview. The TypeScript example uses the Shinami Clients SDK, which you can install with:
Shell
{{name}}
with the actual value for that name
DynamicFieldPage
: type DynamicFieldPage with elements:
data
: Array of type DynamicFieldInfonextCursor
:String
|null
hasNextPage
:Boolean
suix_getOwnedObjects
DescriptionReturn the list of objects owned by an address. Params
-
owner
: the owner’s Sui address -
SuiObjectResponseQuery
filter
:SuiObjectDataFilter
- Optional. Object query criteria.options
:SuiObjectDataOptions
- Optional. Sui options for specifying the object content to be returned. All options default to false if not provided.
-
cursor
:CheckpointedObjectID
- optional paging cursor. If provided, the query will start from the next item after the specified cursor. Default to start from the first item if not specified. -
limit
:uint>
- optional limit of items per page; default to maximum limit of 50 if not specified.
US East - us1
region URL since it is currently the only region where we offer Testnet. To send to another region, see our our Node Service API Overview. The TypeScript example uses the Shinami Clients SDK, which you can install with:
Shell
{{name}}
with the actual value for that name
PaginatedObjectsResponse
containing:
data
: list of typeSuiObjectResponse
hasNextPage
:boolean
- iffalse
, there are no more results to fetchnextCursor?
:String
- ifhasNextPage
istrue
use this cursor in the subsequent request to fetch additional objects.
Reading Coin Data
suix_getBalance
DescriptionReturn the total Coin balance owned by an address for one coin type. Params
owner
:SuiAddress
- the owner’s Sui addresscoin_type
:string
- (optional) fully qualified type names for the coin. Defaults to0x2::sui::SUI
if not specified.
US East - us1
region URL since it is currently the only region where we offer Testnet. To send to another region, see our our Node Service API Overview. The TypeScript example uses the Shinami Clients SDK, which you can install with:
{{name}}
with the actual value for that name
CoinBalance
object containing:
- coinType :
string
- coinObjectCount :
uint
- totalBalance :
BigInt_for_uint128
- lockedBalance :
object
suix_getAllBalances
DescriptionReturn the balance for all Coin types owned by an address. Params
owner
:SuiAddress
- the owner’s Sui address
US East - us1
region URL since it is currently the only region where we offer Testnet. To send to another region, see our our Node Service API Overview. The TypeScript example uses the Shinami Clients SDK, which you can install with:
Shell
{{name}}
with the actual value for that name
CoinBalance
, where a CoinBalance
is an object containing:
- coinType :
string
- coinObjectCount :
uint
- totalBalance :
BigInt_for_uint128
- lockedBalance :
object
suix_getCoins
DescriptionReturn all Coin objects owned by an address of a given Coin type. Params
owner
:SuiAddress
- the owner’s Sui addresscoin_type
:string
- (optional) fully qualified type names for the coin. Defaults to0x2::sui::SUI
if not specified.cursor
:string
- (optional) paging cursor of the coin Object to start after when returning results for the next requestlimit
:uint
- (optional) maximum number of items per page
US East - us1
region URL since it is currently the only region where we offer Testnet. To send to another region, see our our Node Service API Overview. The TypeScript example uses the Shinami Clients SDK, which you can install with:
Shell
{{name}}
with the actual value for that name
PaginatedCoins
object with fields:
-
data: Array of type
CoinStruct
with fields:- balance:
String
- coinObjectId:
String
- coinType:
String
- digest:
String
- previousTransaction:
String
- version:
String
- balance:
-
hasNextPage:
Boolean
-
nextCursor?:
string
|null
suix_getAllCoins
DescriptionReturn all Coin objects owned by an address. Params
owner
:SuiAddress
- the owner’s Sui addresscursor
:string
- (optional) paging cursorlimit
:uint
- (optional) maximum number of items per page
US East - us1
region URL since it is currently the only region where we offer Testnet. To send to another region, see our our Node Service API Overview. The TypeScript example uses the Shinami Clients SDK, which you can install with:
Shell
{{name}}
with the actual value for that name
PaginatedCoins
object with fields:
-
data: Array of type
CoinStruct
with fields:- balance:
String
- coinObjectId:
String
- coinType:
String
- digest:
String
- previousTransaction:
String
- version:
String
- balance:
-
hasNextPage:
Boolean
-
nextCursor?:
string
|null
suix_getCoinMetadata
DescriptionReturn metadata(e.g., symbol, decimals) for a coin. Request parameters
Name | Type | Description |
---|---|---|
coinType | string | fully qualified type names for the coin (e.g., "0x2::sui::SUI" ). Remember that your API key determines which network you’re querying. |
US East - us1
region URL since it is currently the only region where we offer Testnet. To send to another region, see our our Node Service API Overview. The TypeScript example uses the Shinami Clients SDK, which you can install with:
{{name}}
with the actual value for that name
CoinMetadata
with fields:
Name | Type | Description |
---|---|---|
decimals | number | Number of decimal places the coin uses. |
description | string | Description of the token. |
iconUrl | string | null | URL for the token logo if it exists. |
id | string | null | Object id for the CoinMetadata object if it exists. |
name | string | Name for the token. |
symbol | string | Symbol for the token. |
suix_getTotalSupply
DescriptionReturn total supply for a coin. Request parameters
Name | Type | Description |
---|---|---|
coinType | string | fully qualified type names for the coin (e.g., "0x2::sui::SUI" ). Remember that your API key determines which network you’re querying. |
US East - us1
region URL since it is currently the only region where we offer Testnet. To send to another region, see our our Node Service API Overview. The TypeScript example uses the Shinami Clients SDK, which you can install with:
Shell
{{name}}
with the actual value for that name
CoinSupply
with fields:
Name | Type | Description |
---|---|---|
value | string | The total supply of the coin. |