Shinami's Node Service provides a fast, reliable way to interact with the Sui blockchain.
Shinami's Node Service provides a reliable way to interact with the Sui blockchain that scales with you as you grow. You'll find API endpoints and key usage notes below. If you ever need help with an integration question, you can reach out to us.
Authentication, Rate Limits, and Error Handling
Authentication
You authenticate via an access key passed in a header ('X-Api-Key: ACCESS_KEY') or in the request url, e.g. https://api.shinami.com/node/v1/ACCESS_KEY
. We recommend using a request header and not putting access keys in your request URLs for reduced visibility (in logs, etc). These steps are done automatically by our TypeScript SDK.
For more information, including how to set up API access keys, see our Authentication and API Keys guide.
Rate Limits
When you surpass the QPS limit for a key, we return a JSON-RPC error code -32010
. We recommend implementing retries with a backoff to handle any rate limits errors that arise. If you haven't assigned all the QPS you have for a network, or one key has more than it needs, you can adjust the rate limits of your keys to better balance your QPS allotment across your keys. You may also be able to reduce requests by using methods like sui_multiGetObjects
instead of multiple calls to sui_getObject
.
NOTE: Depending on your plan, you may also be subject to overall daily request limits. Hitting this limit will result result in a -32012
, and you should not retry until the next day UTC. You can see your Node Service request totals in the Node Service Metrics section of your Shinami Dashboard. You can see your account limits on the "Sui Node Service" tab of the Billing page of your Shinami dashboard, where you can also upgrade your plan if needed.
Error Handling
See our Error Reference guide.
How to Send a Request
When sending a request to our Node Service, make sure to:
- Set the URL to
https://api.shinami.com/node/v1/
- Send your access key in one of these two ways:
- A header (recommended):
"X-Api-Key: YOUR_ACCESS_KEY"
- In the URL:
https://api.shinami.com/node/v1/ACCESS_KEY
- A header (recommended):
- Use an access key tied to the network you want to interact with. When you create an API access key in your Shinami dashboard, you give it rights to exactly one network. We route to Mainnet or Testnet based on the API access key you send in the request.
Sample Request
Here is a quick sample request you can make using cURL, the Shinami Clients TypeScript SDK, or the Mysten Rust SDK . It's asking for the current reference price for gas on Testnet.
Example Request Template
Replace all instances of {{name}}
with the actual value for that name
curl https://api.shinami.com/node/v1 \
-X POST \
-H 'X-API-Key: {{nodeTestnetAccessKey}}' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc":"2.0",
"method":"suix_getReferenceGasPrice",
"params":[],
"id":1
}'
import { createSuiClient } from "@shinami/clients/sui";
const nodeClient = createSuiClient({{nodeTestnetAccessKey}});
await nodeClient.getReferenceGasPrice();
use sui_sdk::SuiClientBuilder;
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
let sui = SuiClientBuilder::default()
.ws_url("wss://api.shinami.com:443/node/v1/{{nodeTestnetAccessKey}}")
.build("https://api.shinami.com:443/node/v1/{{nodeTestnetAccessKey}}")
.await?;
let resp = sui.read_api().get_reference_gas_price().await?;
println!("{}", resp);
Ok(())
}
Example Response
{
"jsonrpc":"2.0",
"result":"750",
"id":1
}
// The reference gas price is 750 MIST, which is 0.00000075 SUI
750n // BigInt<u64>
// The reference gas price is 750 MIST, which is 0.00000075 SUI
1000
For a detailed look at how Sui charges for transactions, see here. You can use Shinami's Gas Station to increase user engagement by sponsoring your users' transactions so they don't have to think about all those calculations.