random

XRP RPC

Archive Method

Only on the full archive nodes. Complex queries might take longer and incur additional cost

How to use it

// yarn add @tatumio/tatum

import { TatumSDK, Xrp, Network } from '@tatumio/tatum'

const tatum = (await TatumSDK.init) < Xrp > { network: Network.XRP }

const res = await tatum.rpc.random()

await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs

Overview

The random method is an RPC method provided by the Ripple (XRP) blockchain. This command returns a random number that can be used as a source of entropy for random number generation by clients. It's particularly useful in scenarios where a high-entropy random number is required, such as cryptographic operations or unique identifier generation.

Parameters

The random method accepts no parameters.

Return Object

The random method returns an object with the following fields:

  • random: A Random 256-bit hex value.
  • status: The status of the request, typically "success".

JSON-RPC Request Example

{
  "method": "random",
  "params": [{}]
}

JSON-RPC Response Example

{
  "result": {
    "random": "4E57146AA47BC6E88FDFE8BAA235B900126C916B6CC521550996F590487B837A",
    "status": "success"
  }
}

This response includes a random 256-bit hex value generated by the XRP node.