Policies

Relay one stored owner-signed budget operation

Changed on

Feature off by default, Sepolia only. First submit requires an unexpired preparation. Submit accepts only a personal_sign signature of the raw userOpHash. A durable hold and submitting marker precede relay of the exact operation. Repeat calls reconcile the hash without rebroadcasting. Rejected or unknown sends keep the hold until the nonce is consumed. Successful inclusion stays submitted until reset proof passes; activation and hold release are atomic. Signing is self-funded and fee capped.

post/wallets/{address}/policies/preparations/{id}:submit

Request

  • Base URL
    https://api.avaprotocol.org/api/v1
  • Auth
    HTTP bearer

Query parameters

chainIdinteger

The chain to operate on (a single value). Omit to use the aggregator default (the request's JWT aud chain, then the gateway default).

Request body

signaturestring required

Arbitrary-length hex-encoded byte string.

Response

Stored change and its current state; active only after reset proof.

state'prepared' | 'submitting' | 'submitted' | 'active' | 'reverted' | 'rejected' | 'unsent' | 'superseded'

prepared expires after ten minutes; that window limits only the first relay. submitting, submitted and rejected remain recoverable without expiry and keep Ava runs paused. A bundler rejection is not final. active, reverted and superseded are settled. unsent is possible only before a submitting marker. Successful inclusion stays submitted until reset verification passes; activation and hold release are atomic.

reasonstring
transactionHashstring

Arbitrary-length hex-encoded byte string.

inclusionBlockinteger
finalReadBlockinteger
isCancelboolean

A successful cancel settles as active with isCancel true; it consumes the nonce and does not activate a new permission.

preparationIdstring

ULID identifier (26-char Crockford base32).

policyIdstring required

ULID identifier (26-char Crockford base32).

chainIdinteger required

Numeric chain ID (e.g. 11155111 for Sepolia, 8453 for Base). On chain-aware trigger/node configs this is required and must be a configured chain; on query/filter params it is optional.

entityIdinteger required

The validation entity allocated for this grant (provisional until submit).

sessionSignerstring required

Lowercase or checksummed hex EOA / contract address.

deadlineinteger required

Unix seconds; bounds signing → first use, NOT the grant lifetime.

validUntilinteger required

Absolute grant expiry, unix milliseconds. Echo verbatim to submit.

digeststring

The EIP-712 hash the typed data produces, for client-side verification.

typedDataobject

The exact eth_signTypedData_v4 payload for the owner's wallet.

basePolicyIdstring

Set when prepare merged an add. Empty means there was no usable grant. Echo changes.basePolicyId, including the empty string.

affectedTaskIdsstring[]

Enabled tasks this prepare left out because dropTaskIds named them. Echo those ids as submit's dropTaskIds.

nativeRecipientsEthereumAddress[]
allowContractRecipientboolean

Example response

{
  "preparationId": "01JG2FE5MDVKBPHEG0PEYSDKAC",
  "signing": {
    "preparationId": "01JG2FE5MDVKBPHEG0PEYSDKAC",
    "userOp": {
      "sender": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
      "factory": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
      "paymaster": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
    },
    "userOpHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "entryPoint": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
  },
  "budget": {
    "chainId": 11155111,
    "policyId": "01JG2FE5MDVKBPHEG0PEYSDKAC",
    "erc20": [
      {
        "token": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
      }
    ],
    "unmeteredPermissions": [
      {
        "target": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
        "token": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
      }
    ],
    "retirements": [
      {
        "policyId": "01JG2FE5MDVKBPHEG0PEYSDKAC",
        "erc20": [
          {
            "token": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
            "amount": "500000000"
          }
        ],
        "native": {
          "amount": "10000000000000000"
        }
      }
    ],
    "liveApprovals": [
      {
        "token": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
        "spender": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
      }
    ],
    "pendingChange": {
      "preparationId": "01JG2FE5MDVKBPHEG0PEYSDKAC",
      "policyId": "01JG2FE5MDVKBPHEG0PEYSDKAC"
    }
  },
  "approvalResets": [
    {
      "token": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
      "spender": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
    }
  ],
  "unmeteredPermissions": [
    {
      "target": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
      "token": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
    }
  ],
  "policyId": "01JG2FE5MDVKBPHEG0PEYSDKAC",
  "chainId": 11155111,
  "sessionSigner": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
  "changes": {
    "keptActions": [
      {
        "target": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
      }
    ],
    "addedActions": [
      {
        "target": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
      }
    ],
    "removedActions": [
      {
        "target": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
      }
    ],
    "capChanges": [
      {
        "token": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
      }
    ]
  },
  "allowedActions": [
    {
      "target": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
    }
  ],
  "erc20SpendCap": {
    "token": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
    "amount": "500000000"
  },
  "erc20SpendCaps": [
    {
      "token": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
      "amount": "500000000"
    }
  ],
  "nativeRecipients": [
    "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
  ],
  "delegatedNativeRecipients": [
    {
      "recipient": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB",
      "delegate": "0x82F2Dd9a552a69f2ceD7Ff2D05c43aB8430158FB"
    }
  ],
  "nativeSpendCap": {
    "amount": "10000000000000000"
  }
}

Changes