跳到主要内容

cfx_getSponsorInfo

Returns sponsor information of the given contract

curl --request POST \
--url https://main.confluxrpc.com \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"params": ["CFXTEST:TYPE.USER:AATGGCS6J4VMKE5M10WY04SKDZ7D27RDX2CZXKDMY3",null],
"method": "cfx_getSponsorInfo"
}'

Params

addr required

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

epoch_number 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
  • availableStoragePoints availableStoragePoints
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • sponsorBalanceForCollateral sponsorBalanceForCollateral
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • sponsorBalanceForGas sponsorBalanceForGas
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • sponsorForCollateral sponsorForCollateral
    type : string
    Pattern : ^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
  • sponsorForGas sponsorForGas
    type : string
    Pattern : ^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
  • sponsorGasBound sponsorGasBound
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • usedStoragePoints usedStoragePoints
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$

Examples

Request

curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getSponsorInfo",
"params": [
"CFXTEST:TYPE.USER:AATGGCS6J4VMKE5M10WY04SKDZ7D27RDX2CZXKDMY3"
]
}' \
-H "Content-Type: application/json" \
localhost:12539

Response

{
"sponsorBalanceForCollateral": "0x0",
"sponsorBalanceForGas": "0x0",
"sponsorForCollateral": "CFXTEST:TYPE.NULL:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6F0VRCSW",
"sponsorForGas": "CFXTEST:TYPE.NULL:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6F0VRCSW",
"sponsorGasBound": "0x0"
}