sign - XRPL
Example code for the sign JSON RPC method. Complete guide to using sign JSON-RPC in the GetBlock Web3 documentation.
Parameters
Parameter
Type
Required
Description
Request Example
curl --location --request POST 'https://xrp.getblock.io/mainnet/' \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "sign",
"params": [{
"tx_json": {
"TransactionType": "Payment",
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
"Amount": "1000000"
},
"secret": "s..."
}],
"id": "getblock.io"
}'const axios = require('axios');
const url = 'https://xrp.getblock.io/mainnet/';
const headers = {
'x-api-key': 'YOUR-API-KEY',
'Content-Type': 'application/json'
};
// Note: sign method typically not available on public RPCs
// Use local signing instead
const payload = {
jsonrpc: '2.0',
method: 'sign',
params: [{
tx_json: {
TransactionType: 'Payment',
Account: 'rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH',
Destination: 'ra5nK24KXen9AHvsdFTKHSANinZseWnPcX',
Amount: '1000000'
},
secret: 's...'
}],
id: 'getblock.io'
};
axios.post(url, payload, { headers })
.then(response => console.log(response.data))
.catch(error => console.error(error));Response Example
Response Parameters
Field
Type
Description
Use Cases
Recommended: Local Signing
Last updated
Was this helpful?