Standard RPC

All of The Solana Official JSON-RPC API methods that are supported.

Example๏ผšgetBalance

Returns the balance of the account of provided Pubkey

Parameters:

  • <string> - Pubkey of account to query, as base-58 encoded string

  • <object> - (optional) Commitment

Results:

  • RpcResponse<u64> - RpcResponse JSON object with value field set to the balance

Request Example๏ผš

const axios = require('axios');

(async () => {
    const response = await axios.post('https://api.particle.network/solana', {
        chainId: 103,
        jsonrpc: '2.0',
        id: 0,
        method: 'getBalance',
        params: ['8FE27ioQh3T7o22QsYVT5Re8NnHFqmFNbdqwiF3ywuZQ'],
    }, {
        auth: {
            username: 'Your Project Id',
            password: 'Your Project Server Key',
        }
    });

    console.log(response.data);
})();

Response Example๏ผš

{
    "jsonrpc": "2.0",
    "result": {
        "context": {
            "slot": 133898617
        },
        "value": 3467728040
    },
    "id": 0
}

Last updated