Skip to main content

JSON-RPC

Soroban-RPC will accept HTTP POST requests using the JSON-RPC 2.0 specification. Errors are returned via the jsonrpc error object wherever possible (and makes sense).

For production and other publicly-accessible instances, the JSON-RPC endpoint should be served over SSL on port 443, where possible, for security and ease of use. Though, soroban-rpc does not terminate ssl by itself, so will need a load-balancer or other service to terminate SSL for it.

To interact with soroban-rpc from inside a JavaScript application, use the JavaScript SDK package, which gives a convenient interface for the RPC methods inside of its SorobanRpc module.

When XDR is passed as a parameter or returned, it is always a string encoded using standard base64.

info

Please note that parameter structure must contain named parameters as a by-name object, and not as positional arguments as a by-position array. Positional arguments as a by-position array will be deprecated in future RPC releases.

Open-RPC Specification‚Äč

Soroban-RPC provides an OpenRPC specification document that can be used to mock, build, and/or validate both server and client software implementations. This document is used to generate all of our methods documentation pages. You can view the full specification document here. Additionally, you can experiment with this specificaiton document in the OpenRPC Playground.