Transactions

Create a transaction.

Changed on

Creates a transaction for an account.

For accounts whose key is held by the user, the response has status: "awaiting_signature" and a nextAction with the hash to sign; submit the signature with POST /v2/transactions/{id}/signature. For custodial and backend-wallet accounts the transaction is signed and broadcast in the same call and the response already carries a receipt (unless waitForReceipt is false).

post/v2/transactions

Request

  • Base URL: https://api.openfort.io
  • URL: https://api.openfort.io/v2/transactions
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer
    • HTTP bearer
    • HTTP bearer

Headers

X-Behalf-Of-Projectstring

Project ID to act on behalf of (for ecosystem operations).

Request body

chainIdinteger required

The chain ID. Must be a supported chain.

accountIdstring required

ID of the account that executes the transaction (starts with acc_).

feeSponsorshipIdstring

ID of the fee sponsorship that pays for gas (starts with pol_). Omit to pay gas from the account's native token balance.

feeSponsorshipTokenstring

For a fee sponsorship that accepts several user-pay ERC-20 tokens, the on-chain address of the token the user pays the fee in. Must be one of the sponsorship's configured tokens on this chain.

waitForReceiptboolean

Whether to hold the request until the transaction is mined and the receipt is available (default true). Set to false to respond as soon as the transaction is broadcast (status: "submitted") and poll GET /v2/transactions/{id} for the outcome.

authorizationstring

EIP-7702 signed authorization (hex) for a delegated account that is not yet delegated on-chain.

Example request

{
  "chainId": 80002,
  "accountId": "acc_e1b24353-1741-4a3d-9e91-2b0fd2942f60",
  "feeSponsorshipId": "pol_7e07ae30-2a4d-48fa-803f-361da94905dd",
  "feeSponsorshipToken": "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",
  "calls": [
    {
      "to": "0x3994801f2BF191D22aA60c2ce3728c4D0e856a7B",
      "value": "1000000000000000000",
      "contractId": "con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35",
      "functionName": "mint"
    }
  ],
  "authorization": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1c"
}

Response

Successful response.

idstring required
object'transaction' required
createdAtinteger required
updatedAtinteger required
chainIdinteger required
status'awaiting_signature' | 'submitted' | 'succeeded' | 'reverted' | 'failed' required
accountIdstring required

ID of the account that executes the transaction (starts with acc_).

walletIdstring

ID of the wallet that owns the account (starts with pla_). Absent for backend wallets.

feeSponsorshipIdstring

ID of the fee sponsorship paying for gas (starts with pol_). Absent when the account pays its own gas.

costUsdstring

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

Example response

{
  "chainId": 80002,
  "accountId": "acc_e1b24353-1741-4a3d-9e91-2b0fd2942f60",
  "walletId": "pla_6f6c9067-89fa-4fc8-ac72-c242a268c584",
  "feeSponsorshipId": "pol_7e07ae30-2a4d-48fa-803f-361da94905dd",
  "account": {
    "custody": "Developer"
  },
  "feeSponsorship": {
    "name": "My DeFi Gas Sponsorship",
    "description": "Sponsors gas for free-tier users",
    "chainId": 8453,
    "enabled": true,
    "strategy": {
      "sponsorSchema": "pay_for_user",
      "tokenContract": "con_48eeba57-2cd5-4159-a2cb-057a23a35e65",
      "tokenContractAmount": "1000000000000000000",
      "dynamicExchangeRate": true,
      "splTokens": [
        "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
      ],
      "tokenContracts": [
        {
          "contract": "con_48eeba57-2cd5-4159-a2cb-057a23a35e65",
          "amount": "1000000000000000000"
        }
      ]
    },
    "paymasterId": "pay_48eeba57-2cd5-4159-a2cb-057a23a35e65",
    "forwarderContractId": "cfo_48eeba57-2cd5-4159-a2cb-057a23a35e65",
    "policyId": "ply_48eeba57-2cd5-4159-a2cb-057a23a35e65"
  },
  "calls": [
    {
      "to": "0x3994801f2BF191D22aA60c2ce3728c4D0e856a7B",
      "value": "1000000000000000000",
      "contractId": "con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35",
      "functionName": "mint"
    }
  ],
  "execution": {
    "entryPointVersion": "0.8"
  },
  "nextAction": {
    "hash": "0x1a3d1d2fbb8a9c1a3f0f7d2b6c4a8b2b1e1d5c9a7f3e2b1c0d9e8f7a6b5c4d3e"
  },
  "receipt": {
    "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."
      }
    }
  },
  "costUsd": "0.42"
}

Changes

    • breaking

      the / request property type changed from no type to object

    • breaking

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

    • breaking

      removed the required property / from the response with the status

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • 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 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 optional property // to the response with the status

    • breaking

      added the new required request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the optional property from the response with the status

    • info

      added the new optional request property