Skip to main content

cfx_checkBalanceAgainstTransaction

Check if user balance is enough for the transaction.

Params

(6)

1. account_addr (required)

string
Match pattern:
^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$

2. contract_addr (required)

string
Match pattern:
^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$

3. gas_limit (required)

string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$

4. gas_price (required)

string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$

5. storage_limit (required)

string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$

6. epoch (required)

(one of)
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,15}|0)$

Result

(cfx_checkBalanceAgainstTransaction_result)
isBalanceEnough
boolean
willPayCollateral
boolean
willPayTxFee
boolean

Endpoint

Params

account_addr

contract_addr

gas_limit

gas_price

storage_limit

epoch


Request

curl -X POST --data \
'{
"method": "cfx_checkBalanceAgainstTransaction",
"params": [
null,
null,
null,
null,
null,
null
],
"jsonrpc": "2.0",
"id": 1
}' \
-H "Content-Type: application/json" \
https://test.confluxrpc.com