Gas Policy Rules (Legacy)

Create a gas policy rule (legacy - use /v2/fee-sponsorship for new integrations).

Changed on
post/v1/policy_rules

Request

  • Base URL: https://api.openfort.io
  • URL: https://api.openfort.io/v1/policy_rules
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Request body

type'contract_functions' | 'account_functions' | 'rate_limit' required
functionNamestring

Name of the function in the contract to allow. If you want to allow all functions, use the wildcard 'All functions'.

contractstring

The contract ID you want to interact with. Must have been added to Openfort first, starts with con_.

wildcardboolean

When using contract_functions type, set this to true to allow all contracts.

gasLimitstring

Gas limit in WEI (i.e. factor 10^18).

countLimitinteger

Number of times the function will be sponsored.

timeIntervalType'minute' | 'hour' | 'day' | 'week' | 'month'
timeIntervalValueinteger

Time interval value.

policystring required

The unique Policy ID to add the rule to (starts with pol_).

Example request

{
  "functionName": "All functions",
  "contract": "con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35",
  "wildcard": true,
  "gasLimit": "1000000000000000000",
  "countLimit": 1,
  "timeIntervalValue": 1,
  "policy": "pol_7e07ae30-2a4d-48fa-803f-361da94905dd"
}

Response

Successful response.

OR
OR
OR
OR

Changes

    • info

      the security scope policies:write was added to the endpoint's security scheme sk

    • info

      api operation id CreatePolicyRule removed and replaced with CreateGasPolicyRuleLegacy

    • info

      api tag Gas Policy Rules (Legacy) added

    • info

      api tag PolicyRules removed