POSTserver_definitions

XRP Ledger Mainnethttps://xrpl-mainnet.nodit.io/

Returns the definitions.json data the server uses. It provides the definitions needed to serialize and deserialize transactions and ledger entries in SDK-compatible form.

Request Body
methodstringrequired
hashstring

The hash of a set of definitions you already hold. When it matches the server's hash, the body is omitted and only the hash is returned, reducing unnecessary transfer.

Responses
FIELDSobject[]

The list of field definitions. Each item consists of a field name and its serialization metadata.

TRANSACTION_FORMATSobject

The structure definition for each transaction type.

LEDGER_ENTRY_FORMATSobject

The structure definition for each ledger entry type.

TRANSACTION_FLAGSobject

The flag values for each transaction type.

LEDGER_ENTRY_FLAGSobject

The flag values for ledger entries.

ACCOUNT_SET_FLAGSobject

The flag values for the AccountSet transaction.

TRANSACTION_RESULTSobject

The mapping between transaction result codes and their numeric values.

TYPESobject

The mapping between serialization type names and their numeric values.

hashstring

The hash of this set of definitions. The body is omitted when it matches the hash in the request.

X-API-KEY
RequestCU15
cURL
curl -X POST "https://xrpl-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "method": "server_definitions",
  "params": [
    {}
  ]
}'
Response
Example · 200
{
  "result": {
    "hash": "409A6F1C1D6B9F0E5A4B3C2D1E0F9A8B7C6D5E4F3A2B1C0D9E8F7A6B5C4D3E2F",
    "TYPES": {
      "Validation": 10003,
      "Done": -1,
      "Hash128": 4
    },
    "LEDGER_ENTRY_TYPES": {
      "Any": 0,
      "AccountRoot": 97
    },
    "TRANSACTION_RESULTS": {
      "tesSUCCESS": 0,
      "temMALFORMED": -299
    },
    "TRANSACTION_TYPES": {
      "Payment": 0,
      "OfferCreate": 7
    }
  }
}