For the complete documentation index, see llms.txt. This page is also available as Markdown.

sign_for - XRPL

Example code for the sign_for JSON RPC method. Complete guide to using sign_fo JSON-RPC in the GetBlock Web3 documentation.

This method provides one signature for a multi-signed transaction. This method is admin-only on public servers.

Parameters

Parameter
Type
Required
Description

account

string

Yes

Address to sign for

tx_json

object

Yes

Transaction to sign

secret

string

No

Signer's secret

seed

string

No

Signer's seed

seed_hex

string

No

Seed in hex

passphrase

string

No

Passphrase

key_type

string

No

Key algorithm

Request Example

curl
curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS_TOKEN>/' \

--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "sign_for",
    "params": [{
        "account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
        "tx_json": {
            "TransactionType": "Payment",
            "Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
            "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
            "Amount": "1000000",
            "Fee": "30"
        },
        "secret": "s..."
    }],
    "id": "getblock.io"
}'
sign_for.js
const axios = require('axios');

const url = 'https://shared.eu-central-1.getblock.io/<ACCESS_TOKEN>/';
const headers = {
    'Content-Type': 'application/json'
};

const payload = {
    jsonrpc: '2.0',
    method: 'sign_for',
    params: [{
        account: 'rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH',
        tx_json: {
            TransactionType: 'Payment',
            Account: 'rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH',
            Destination: 'ra5nK24KXen9AHvsdFTKHSANinZseWnPcX',
            Amount: '1000000',
            Fee: '30'
        },
        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

tx_blob

string

Transaction with signature

tx_json

object

Transaction JSON

Use Cases

  • Multi-signature wallets

  • Shared custody

  • Organizational accounts

Last updated

Was this helpful?