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://shared.eu-central-1.getblock.io/<ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "channel_authorize",
"params": [{
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"amount": "1000000",
"secret": "s..."
}],
"id": "getblock.io"
}'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: 'channel_authorize',
params: [{
channel_id: '5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3',
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
Returns
Field
Type
Description
signature
string
Authorization signature
Use Cases
Payment channel claims
Micropayments
Streaming payments
SDK Integration
xrpl.js
Last updated
Was this helpful?