Gas Policies (Legacy)

Withdraw tokens collected by gas policy (legacy).

Changed on

Transfer ERC-20 tokens collected by a gas policy.

When using a policy that includes payment of gas in ERC-20 tokens, this endpoint returns the amount of tokens paid for gas. This is specific to a policy that doesn't use your own deposited tokens in the paymaster.

post/v1/policies/{id}/withdraw

Request

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

Path parameters

idstring required

Specifies the unique policy ID (starts with pol_).

Request body

accountstring required

ID of the Dev Account this TransactionIntent will send the specified amount of tokens to (starts with dac_).

amountstring required

Amount in WEI to withdraw (i.e. factor 10^18)..

Example request

{
  "account": "dac_e1b24353-1741-4a3d-9e91-2b0fd2942f60",
  "amount": "300000"
}

Response

Successful response.

idstring required
object'transactionIntent' required
createdAtinteger required
updatedAtinteger required

The unix timestamp in seconds when the transactionIntent was created.

chainIdinteger required

The chain ID.

abstractionType'accountAbstractionV6' | 'accountAbstractionV8' | 'accountAbstractionV9' | 'standard' required
userOperationHashstring
userOperationunknown
finalCoststring

The actual transaction cost in USD, available after on-chain confirmation.

Example response

{
  "chainId": 5,
  "details": {
    "from": "0x8ab66318aCC6b29A27e74e534bfe3ecf81C50387",
    "data": "0x8c5a...",
    "nonce": "0",
    "gas": "21000",
    "maxFeePerGas": "1000000000",
    "maxPriorityFeePerGas": "1000000000",
    "value": "0x8ab66318aCC6b29A27e74e534bfe3ecf81C50387"
  },
  "response": {
    "error": {
      "reason": "AA31: paymaster deposit too low",
      "name": "ExecutionResult",
      "explanation": {
        "cause": "The paymaster does not have enough native tokens deposited in the EntryPoint to cover the gas cost.",
        "solution": "Top up your account balance in the dashboard or deposit more to the Paymaster contract on the relevant chain."
      }
    }
  },
  "finalCost": "0.42",
  "interactions": [
    {
      "value": "1000000000000000000",
      "contract": "con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35",
      "functionName": "mint",
      "functionArgs": [
        "0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d"
      ]
    }
  ]
}

Changes

    • info

      removed from the response property anyOf list for the response status

    • info

      removed the zkSync enum value from the response property for the response status

    • breaking

      the / response's property type changed from no type to object for status

    • info

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

    • info

      added the optional property to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the required property // to the response with the status