Send Raw Curl Requests

You can interact directly with the VSL RPC server by sending raw JSON-RPC requests using tools like curl. This is especially useful for quick queries, automation, or debugging without needing a frontend interface.

Only simple query methods that do not require request signing can be called this way. Signed operations (e.g. submitting claims) require integration with tools like the VSL Snap or other authenticating clients.

How it works

Each curl request sends a JSON-RPC payload to the RPC server URL (usually http://localhost:44444 during development). Here's the general format:

curl -X POST \
  -H 'Content-Type: application/json' \
  -d '<JSON-PAYLOAD>' \
  http://localhost:44444

You replace <JSON-PAYLOAD> with a valid JSON-RPC body.

Example Queries

Below are some example methods you can use to retrieve data from a running VSL node. You can plug in your own account IDs, claim IDs, or addresses as needed.

Check server health

curl -X POST \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"vsl_getHealth"}' \
  http://localhost:44444

Get account nonce

curl -X POST \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"vsl_getAccountNonce","params":{"account_id": "0xcd9390ebf4c69c8b091c15a0f4e470880c82e239"}}' \
  http://localhost:44444

Get account balance

curl -X POST \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"vsl_getBalance","params":{"account_id": "0xcd9390ebf4c69c8b091c15a0f4e470880c82e239"}}' \
  http://localhost:44444

Get all asset balances for an account

curl -X POST \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"vsl_getAssetBalances","params":{"account_id": "0xcd9390ebf4c69c8b091c15a0f4e470880c82e239"}}' \
  http://localhost:44444

Get balance for a specific asset

curl -X POST \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"vsl_getAssetBalance","params":{"account_id": "0xcd9390ebf4c69c8b091c15a0f4e470880c82e239", "asset_id": "ba9f90abf46fcf4896b870d82a547a56972d4e05da4e4fdec78acdb3eb91bb48"}}' \
  http://localhost:44444

List submitted claims (sender or receiver)

curl -X POST \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"vsl_listSubmittedClaimsForSender","params":{"since": {"seconds": 0, "nanos": 0}, "address": "0x0101010101010101010101010101010101010101"}}' \
  http://localhost:44444

Change method to:

  • vsl_listSubmittedClaimsForReceiver for receiver side

  • You can omit the "address" field to fetch for all accounts.

List settled claims (sender or receiver)

curl -X POST \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"vsl_listSettledClaimsForReceiver","params":{"since": {"seconds": 0, "nanos": 0}, "address": "0x0101010101010101010101010101010101010101"}}' \
  http://localhost:44444

Change method to vsl_listSettledClaimsForSender for sender view.

Get settled claim by ID

curl -X POST \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"vsl_getSettledClaimById","params":{"claim_id": "0xc6dd1fccbd1a2c5616f799cef2158a8eb42be8dcbd6e62491c474b08fb25a6ae"}}' \
  http://localhost:44444

Get account state

curl -X POST \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"vsl_getAccountState","params":{"account_id": "0xcd9390ebf4c69c8b091c15a0f4e470880c82e239"}}' \
  http://localhost:44444

Additional notes

  • You must have a local node running and accessible at the target address.

  • The methods listed above are read-only; they won’t change state or require signatures.

  • Methods like vsl_getAccount and vsl_getAssetById are not yet implemented.

Last updated

Was this helpful?