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

calculate_dao_maximum_withdraw - Nervos

Example code for the calculate_dao_maximum_withdraw JSON-RPC method. Complete guide on how to use calculate_dao_maximum_withdraw JSON-RPC in GetBlock Web3 documentation.

Calculates the maximum CKB amount that a Nervos DAO deposit cell can withdraw. Nervos DAO is a protocol-level mechanism for locking CKB to receive secondary issuance — this method computes the matured value given the deposit's out point and a target withdraw header.

Parameters

Parameter
Type
Required
Description

out_point

OutPoint

Yes

Out point of the Nervos DAO deposit cell

kind

DaoWithdrawingCalculationKind

Yes

Either a withdraw block hash (H256) or a withdraw header (Header)

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "calculate_dao_maximum_withdraw",
    "params": [
        {
            "tx_hash": "0xa0ef4eb5f4ceeb08a4c8524d84c5da95dce2f608e0ca2ec8091191b0f330c6e0",
            "index": "0x0"
        },
        "0x02530b25ad0ff677acc365cb73de3e8cc09c7ddd58272e879252e199d08df83b"
    ],
    "id": "getblock.io"
}'
import axios from 'axios';

const data = JSON.stringify({
    "jsonrpc": "2.0",
    "method": "calculate_dao_maximum_withdraw",
    "params": [
        {
            "tx_hash": "0xa0ef4eb5f4ceeb08a4c8524d84c5da95dce2f608e0ca2ec8091191b0f330c6e0",
            "index": "0x0"
        },
        "0x02530b25ad0ff677acc365cb73de3e8cc09c7ddd58272e879252e199d08df83b"
    ],
    "id": "getblock.io"
});

const config = {
    method: 'post',
    url: 'https://go.getblock.io/<ACCESS-TOKEN>/',
    headers: {
        'Content-Type': 'application/json'
    },
    data: data
};

axios(config)
    .then(response => console.log(JSON.stringify(response.data, null, 2)))
    .catch(error => console.log(error));

Response Example

Response Parameters

Field
Type
Description

result

Uint64

Maximum withdrawable CKB amount in Shannon (hex)

Use Cases

  • Nervos DAO portfolio dashboards showing accumulated rewards

  • Wallet UIs for DAO deposit/withdraw flows

  • Computing optimal withdraw timing for DAO depositors

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

-32603

Internal error

Server-side error while processing the request

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?