pm_createPolicy

pm_createPolicy

๐Ÿ“˜ Supported on both Mainnet and Testnet.

Endpoint

  • Mainnet: https://open-platform-ap.nodereal.io/{apikey}/megafuel
  • Testnet: https://open-platform-ap.nodereal.io/{apikey}/megafuel-testnet

The {apikey} should be created via Nodereal MegaNode. Please refer to Sponsor Guidelines.

Create a new sponsor policy. The caller's MegaNode identity (derived from the api-key) is automatically set as the policy owner.

Notes:

  • maxGasCost is always initialised to 0 at creation time. Fund the policy afterwards via the deposit API.
  • Each sponsor may own at most N policies (default 5, configurable by the platform).
post/{apiKey}/megafuel

Request

  • Base URL
    https://open-platform-ap.nodereal.io
  • URL
    https://open-platform-ap.nodereal.io/{apiKey}/megafuel
  • Auth
    none declared

Path parameters

apiKeystring required

Request body

idinteger
jsonrpcstring
method'pm_createPolicy'

Example request

{
  "params": [
    {
      "name": "my-sponsorship-policy",
      "chainID": 56,
      "maxGasCostPerAddr": "1000000000000000000",
      "maxGasCostPerAddrPerDay": "100000000000000000",
      "minSupportedAmount": "0",
      "maxTxCountPerAddrPerDay": "100",
      "start": 1700000000,
      "end": 1900000000,
      "sponsorName": "Acme Corp",
      "sponsorIcon": "https://example.com/icon.png",
      "sponsorWebsite": "https://example.com",
      "fundingFromAddress": "0xDE08B1Fd79b7016F8DD3Df11f7fa0FbfdF07c941",
      "description": "Sponsors gas fees for Acme dApp users",
      "telegram": "@acme_support",
      "phone": "+1-800-123-4567"
    }
  ]
}

Response

idinteger
jsonrpcstring

Example response

{
  "result": {
    "fundingFromAddress": "0xDE08B1Fd79b7016F8DD3Df11f7fa0FbfdF07c941"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.