API Reference

cfx_getSponsorInfo - Conflux

Returns the sponsor info of a given contract.

Parameters

  • BASE32 - Address of the contract.
  • QUANTITY|TAG - (optional, default: "latest_state") Integer epoch number, or the string "latest_state", "latest_confirmed", "latest_checkpoint" or "earliest", see the epoch number parameter

Returns

Object - A sponsor info object. If the contract doesn't have a sponsor, then all fields in the object returned will be 0:

  • sponsorBalanceForCollateral: QUANTITY - The sponsored balance for storage.
  • sponsorBalanceForGas: QUANTITY - The sponsored balance for gas.
  • sponsorGasBound: QUANTITY - The max gas that could be sponsored for one transaction.
  • sponsorForCollateral: BASE32 - The address of the storage sponsor.
  • sponsorForGas: BASE32 - The address of the gas sponsor.

Example

Request

curl -X POST \
--data '{"jsonrpc":"2.0","method":"cfx_getSponsorInfo","params":["cfx:type.contract:acc7uawf5ubtnmezvhu9dhc6sghea0403y2dgpyfjp","latest_state"],"id":1}' \
-H "Content-Type: application/json" \
https://cfx-core.unifra.io/v1/ad2eb3c7a9404cc6a35a6641eaf70577 


Result

{
    "jsonrpc": "2.0",
    "result": {
        "sponsorBalanceForCollateral": "0x40f4311efb055ac000",
        "sponsorBalanceForGas": "0x8ac722e0735bf15c",
        "sponsorForCollateral": "CFX:TYPE.CONTRACT:ACBKXBTRUAYAF2HE1899E1533X4WG2A07EYJJRZU31",
        "sponsorForGas": "CFX:TYPE.CONTRACT:ACGZZ08M8Z2YWKEDA0JZU52FGAZ9U95Y1Y50RNWMT3",
        "sponsorGasBound": "0x2540be400"
    },
    "id": 0
}
Language
URL
Click Try It! to start a request and see the response here!