Files
xrpl-dev-portal/content/references/http-websocket-apis/public-api-methods/server-info-methods/server_definitions.md
2024-01-12 01:09:01 -08:00

2.3 KiB

html, parent, blurb, labels
html parent blurb labels
server_definitions.html server-info-methods.html Retrieve an SDK-compatible `definitions.json`, generated from the `rippled` instance currently running.
Core Server

server_definitions

[Source]

The server_definitions command returns an SDK-compatible definitions.json, generated from the rippled instance currently running. You can use this to query a node in a network, quickly receiving the definitions necessary to serialize/deserialize its binary data.

Request Format

An example of the request format:

WebSocket

{
  "id": 2,
  "command": "server_definitions"
}

Try it! >

The request does not take any parameters.

Response Format

An example of a successful response:

WebSocket

{
  "id": 1,
  "result": {
    "FIELDS": [
      [
        "Generic",
        {
          "isSerialized": false,
          "isSigningField": false,
          "isVLEncoded": false,
          "nth": 0,
          "type": "Unknown"
        }
      ],
      [
        "Invalid",
        {
          "isSerialized": false,
          "isSigningField": false,
          "isVLEncoded": false,
          "nth": -1,
          "type": "Unknown"
        }
      ],
      [
        "ObjectEndMarker",
        {
          "isSerialized": true,
          "isSigningField": true,
          "isVLEncoded": false,
          "nth": 1,
          "type": "STObject"
        }
      ],
      [
        "ArrayEndMarker",
        {
          "isSerialized": true,
          "isSigningField": true,
          "isVLEncoded": false,
          "nth": 1,
          "type": "STArray"
        }
      ]
      ...
    ]
  }
}

To see a full definitions.json file and descriptions of the top-level fields, see: Definitions File.

Possible Errors

Any of the [universal error types][].

{% include '_snippets/rippled-api-links.md' %} {% include '_snippets/tx-type-links.md' %} {% include '_snippets/rippled_versions.md' %}