跳到主要内容

cfx_checkBalanceAgainstTransaction

Check if user balance is enough for the transaction.

  • must have required property 'account_addr'
  • must have required property 'contract_addr'
  • must have required property 'gas_limit'
  • must have required property 'gas_price'
  • must have required property 'storage_limit'
curl --request POST \
--url https://main.confluxrpc.com \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"params": [null,null,null,null,null,null],
"method": "cfx_checkBalanceAgainstTransaction"
}'

Params

account_addr required

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

contract_addr required

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

gas_limit required

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

gas_price required

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

storage_limit required

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

epoch optional

Represents rpc api epoch number param.
oneOf
type : string
Pattern : ^0x([1-9a-f][0-9a-f]{0,15}|0)$

Result

Schema
type : object
  • isBalanceEnough isBalanceEnough
    type : boolean
  • willPayCollateral willPayCollateral
    type : boolean
  • willPayTxFee willPayTxFee
    type : boolean