xrp

XRP (XRP)

Method: POST sign

dropdown
POST

sign

Method not allowed

The sign method takes a transaction in JSON format and a seed value, and returns a signed binary representation of the transaction.

To contribute one signature to a multi-signed transaction, use the sign_for method instead.

By default, this method is admin-only.

It can be used as a public method if the server has enabled public signing.

Parameters

tx_json - Object

Transaction definition in JSON format

secret - String

(Optional) The secret seed of the account supplying the transaction, used to sign it. Do not send your secret to untrusted servers or through unsecured network connections. Cannot be used with key_type, seed, seed_hex, or passphrase.

seed - String

(Optional) The secret seed of the account supplying the transaction, used to sign it.

Must be in the XRP Ledger's base58 format.

If provided, you must also specify the key_type. Cannot be used with secret, seed_hex, or passphrase.

seed_hex - String

(Optional) The secret seed of the account supplying the transaction, used to sign it.

Must be in hexadecimal format.

If provided, you must also specify the key_type. Cannot be used with secret, seed, or passphrase.

passphrase - String

(Optional) The secret seed of the account supplying the transaction, used to sign it, as a string passphrase.

If provided, you must also specify the key_type.

Cannot be used with secret, seed, or seed_hex.

key_type - String

(Optional) The signing algorithm of the cryptographic key pair provided.

Valid types are secp256k1 or ed25519. Defaults to secp256k1.

Cannot be used with secret.

offline - Boolean

(Optional) If true, when constructing the transaction, do not try to automatically fill any transaction details.

The default is false.

build_path - Boolean

(Optional) If this field is provided, the server auto-fills the Paths field of a Payment transaction before signing.

You must omit this field if the transaction is a direct XRP payment or if it is not a Payment-type transaction.

fee_mult_max - Integer

(Optional) Signing fails with the error rpcHIGH_FEE if the auto-filled Fee value would be greater than the reference transaction cost × fee_mult_max ÷ fee_div_max.

This field has no effect if you explicitly specify the Fee field of the transaction.

The default is 10.

fee_div_max - Integer

(Optional) Signing fails with the error rpcHIGH_FEE if the auto-filled Fee value would be greater than the reference transaction cost × fee_mult_max ÷ fee_div_max.

This field has no effect if you explicitly specify the Fee field of the transaction.

Request

curl --location --request POST 'https://xrp.getblock.io' 
--header 'x-api-key: YOUR-API-KEY' 
--header 'Content-Type: application/json' 
--data-raw '{"jsonrpc": "2.0",
"method": "sign",
"params": [{"tx_json": {"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "Amount": {"currency": "USD", "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "value": "1"}, "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "TransactionType": "Payment"}}],
"id": "getblock.io"}'


Response

{
    "result": "null",
    "id": "getblock.io",
    "status_code": 405,
    "message": "Method not allowed"
}