channel_authorize - XRPL

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

This method creates a signature that can be used to redeem a specific amount of XRP from a payment channel.

Parameters

Parameter
Type
Required
Description

channel_id

string

Yes

Channel ID (64 hex)

amount

string

Yes

Amount to authorize in drops

secret

string

No

Secret key (if not using key_type)

seed

string

No

Seed value

seed_hex

string

No

Seed in hex

passphrase

string

No

Passphrase

key_type

string

No

Key algorithm

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": "channel_authorize",
    "params": [{
        "channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
        "amount": "1000000",
        "secret": "s..."
    }],
    "id": "getblock.io"
}'

Response Example

Returns

Field
Type
Description

signature

string

Authorization signature

Use Cases

  • Payment channel claims

  • Micropayments

  • Streaming payments

SDK Integration

xrpl.js

circle-info

Note: channel_authorize requires admin or local signing. Use local signing (client-side) when possible.

Last updated

Was this helpful?