Saltar al contenido principal

cfx_call

Call contract, returning the output data.

The MAX_GAS_CALL_REQUEST is used as max value of cfx_call or cfx_estimate's gas value to prevent call_virtual consumes too much resource. The tx_pool will reject the tx if the gas is larger than half of the block gas limit. which is 30_000_000 before 1559, and 60_000_000 after 1559.pub const MAX_GAS_CALL_REQUEST: u64 = 15_000_000;

accessList

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],
"method": "cfx_call"
}'

Params

tx required

The MAX_GAS_CALL_REQUEST is used as max value of cfx_call or cfx_estimate's gas value to prevent call_virtual consumes too much resource. The tx_pool will reject the tx if the gas is larger than half of the block gas limit. which is 30_000_000 before 1559, and 60_000_000 after 1559.pub const MAX_GAS_CALL_REQUEST: u64 = 15_000_000;
type : object
  • accessList accessList
    type : array
    • items[x] CfxAccessListItem
      type : object
      • address address
        type : string
        Pattern : ^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
      • storageKeys storageKeys
        type : array
        • items[x] H256
          type : string
          Pattern : ^0x[0-9,a-f,A-F]{64}$
  • data data
    type : string
    Pattern : ^0x[0-9a-f]*$
  • from from
    type : string
    Pattern : ^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
  • gas gas
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • gasPrice gasPrice
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • maxFeePerGas maxFeePerGas
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • maxPriorityFeePerGas maxPriorityFeePerGas
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • nonce nonce
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • storageLimit storageLimit
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,15}|0)$
  • to to
    type : string
    Pattern : ^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
  • transactionType transactionType
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,15}|0)$
  • value value
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$

block_hash_or_epoch_number optional

Schema
type : any
Always valid

Result

Schema
type : string
Pattern : ^0x[0-9a-f]*$