Gas Policy Rules (Legacy)

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

post/v1/policy_rules/{id}

Request

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

Path parameters

idstring required

Specifies the unique policy rule ID (starts with afu_).

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.

Example request

{
  "functionName": "All functions",
  "contract": "con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35",
  "wildcard": true,
  "gasLimit": "1000000000000000000",
  "countLimit": 1,
  "timeIntervalValue": 1
}

Response

Successful response.

OR
OR
OR
OR

Changes