> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://www.openfort.io/api/mcp` to find what you need.
>
> **Have feedback?** Use `submit_feedback` on the same MCP server.

# Transaction Intents

Create, sign, and track blockchain transactions executed through Openfort.

## List transaction intents

`GET /v1/transaction_intents`

Returns a list of TransactionIntents.

### Query parameters

- `limit` `integer <int32>`: Specifies the maximum number of records to return.
- `skip` `integer <int32>`: Specifies the offset for the first records to return.
- `order` `string`: Specifies the order in which to sort the results.
- `expand` `string[]`: Specifies the fields to expand in the response.
- `chainId` `integer <int32>`: The chain ID. Must be a [supported chain](https://www.openfort.io/docs/configuration/chains).
- `account` `string[]`: Filter by account ID or developer account (starts with acc_ or dac_ respectively).
- `player` `string[]`: Filter by player ID (starts with pla_).
- `status` `number <double>`: Filter by successful (1) or failed (0) transaction intents.
- `policy` `string[]`: Filter by policy ID (starts with pol_).

### Responses

#### `200`: Successful response.

Body (`application/json`):

- `object` `string` _(required)_
- `url` `string` _(required)_
- `data` `object[]` _(required)_
  - `id` `string` _(required)_
  - `object` `string` _(required)_
  - `createdAt` `integer <int32>` _(required)_
  - `updatedAt` `integer <int32>` _(required)_: The unix timestamp in seconds when the transactionIntent was created.
  - `chainId` `integer <int32>` _(required)_: The chain ID.
  - `abstractionType` `string` _(required)_: The transaction abstraction type
  - `transitions` `object[]`: Transition of statuses the transaction has gone through.
    - `fromStatus` `string` _(required)_
    - `toStatus` `string` _(required)_
    - `at` `number <double>` _(required)_
  - `details` `object`: Specific transaction details based on its type
  - `userOperationHash` `string`
  - `userOperation` `unknown`
  - `response` `object`
    - `createdAt` `integer <int32>` _(required)_: The unix timestamp in seconds when the transactionIntent was created.
    - `blockNumber` `integer <int32>`: The block height (number) of the block including the transaction of this log.
    - `transactionHash` `string`: The transaction hash of the transaction of this log.
    - `l1GasUsed` `string`: The l1 gas used by the transaction of this log.
    - `gasUsed` `string`: The gas used by the transaction of this log.
    - `gasFee` `string`: The gas fee by the transaction of this log.
    - `l1GasFee` `string`: The l1 gas fee by the transaction of this log.
    - `status` `integer <int32>`: The status of the transaction of this log.
    - `logs` `object[]`: The logs of the transaction of this log.
      - `blockNumber` `number <double>` _(required)_
      - `blockHash` `string` _(required)_
      - `transactionIndex` `number <double>` _(required)_
      - `removed` `boolean` _(required)_
      - `address` `string` _(required)_
      - `data` `string` _(required)_
      - `topics` `string[]` _(required)_
      - `transactionHash` `string` _(required)_
      - `logIndex` `number <double>` _(required)_
      - `orphaned` `boolean`
    - `to` `string`: The address of the contract of this log.
    - `error` `object`: The error of the transaction, if it failed or was rejected. Contains the error reason and, for known Account Abstraction errors (AA10–AA99), an explanation with cause and solution.
      - `reason` `string` _(required)_: The error reason string returned by the bundler or execution environment.
      - `name` `string`: The decoded error name from the contract revert, if available.
      - `explanation` `object`: Detailed explanation of the error cause and suggested solution. Present only for known Account Abstraction error codes (AA10–AA99).
        - `cause` `string` _(required)_: A human-readable description of what caused the error.
        - `solution` `string` _(required)_: A human-readable suggestion for how to resolve the error.
  - `finalCost` `string`: The actual transaction cost in USD, available after on-chain confirmation.
  - `interactions` `object[]`
    - `to` `string`: The address of the recipient of native tokens. Use *only* to transfer native tokens. If you provide one of a `pla_...`, or `acc_...` it will be converted to the corresponding address.
    - `value` `string`: The value intended to be sent with the transaction. Should be a stringified number in WEI (i.e. factor 10^18). *
    - `contract` `string`: The contract ID you want to interact with. Must have been added to Openfort first, starts with `con_`.
    - `functionName` `string`: The function name of the contract. Accepts a a function signature as well (e.g. mint(address)).
    - `functionArgs` `unknown[]`: The function arguments of the contract, in string format. If you provide one of a `pla_...`, `con_...` or `acc_...` it will be converted to the corresponding address.
    - `dataSuffix` `string`: Data to append to the end of the calldata. Useful for [adding a "domain" tag](https://opensea.notion.site/opensea/Seaport-Order-Attributions-ec2d69bf455041a5baa490941aad307f)
    - `data` `string`: The encoded calldata of the contract.
  - `nextAction` `object`
    - `type` `string` _(required)_
    - `payload` `object` _(required)_
      - `userOp` `unknown`: The userOperation.
      - `userOpHash` `string`: The hashed userOperation.
      - `userOperation` `unknown`: The userOperation.
      - `userOperationHash` `string`: The hashed userOperation.
      - `signableHash` `string`: chain-agnostic hash to sign.
  - `policy` `object`: The policy ID (starts with pol_).
  - `player` `object`: The player ID (starts with pla_).
  - `account` `object` _(required)_: The account ID (starts with acc_).
- `start` `integer <int32>` _(required)_
- `end` `integer <int32>` _(required)_
- `total` `integer <int32>` _(required)_

#### `401`: Error response.

Body (`application/json`):

- `error` `object` _(required)_
  - `type` `string` _(required)_
  - `message` `string` _(required)_
  - `details` `object`

### Example request

```bash
curl 'https://api.openfort.io/v1/transaction_intents?limit=10&skip=0&order=desc&expand=policy&chainId=80002&account=acc_dc981458-a653-4539-b120-a321915b2896&player=pla_556166c9-77ad-4a39-aaf8-c432defa8a0f&status=1&policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd'
```

```ts
fetch('https://api.openfort.io/v1/transaction_intents?limit=10&skip=0&order=desc&expand=policy&chainId=80002&account=acc_dc981458-a653-4539-b120-a321915b2896&player=pla_556166c9-77ad-4a39-aaf8-c432defa8a0f&status=1&policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd')
```

## Create a transaction intent object

`POST /v1/transaction_intents`

Creates a TransactionIntent.

A pending TransactionIntent has the `response` attribute as undefined.

After the TransactionIntent is created and broadcasted to the blockchain, `response` will be populated with the transaction hash and a status (1 success, 0 fail).

When using a non-custodial account, a `nextAction` attribute is returned with the `userOperationHash` that must be signed by the owner of the account.

### Header parameters

- `X-Behalf-Of-Project` `string`

### Request body (required) (`application/json`)

- `chainId` `integer <int32>` _(required)_: The chain ID. Must be a [supported chain](https://www.openfort.io/docs/configuration/chains).
- `player` `string`: ID of the Player this TransactionIntent belongs to, if one exists (starts with `pla_`). If you omit this parameter a new Player will be created.
- `account` `string`: ID of the Account this TransactionIntent is executed with, if one exists (starts with `acc_` or `dac_`). When providing a Player and ChainID, you can omit this parameter.
- `policy` `string`: ID of the Policy that defines the gas sponsorship strategy (starts with `pol_`). If no Policy is provided, the own Account native token funds will be used to pay for gas.
- `externalOwnerAddress` `string`: Use this parameter to create a new Account for Player with the provided owner address. If you omit this parameter and no Account exists for the Player, a custodial Account will be created.
- `optimistic` `boolean`: Set to `true` to indicate that the transactionIntent request should be resolved as soon as possible, after the transactionIntent is created and simulated and before it arrives on chain.
- `signedAuthorization` `string`: Signed authorization for delegated accounts. This signature is used to authorize the user operation for AccountAbstractionV8. The signature should be in the format "0x..." and will be parsed to extract r, s, and yParity values.
- `interactions` `object[]` _(required)_
  - `to` `string`: The address of the recipient of native tokens. Use *only* to transfer native tokens. If you provide one of a `pla_...`, or `acc_...` it will be converted to the corresponding address.
  - `value` `string`: The value intended to be sent with the transaction. Should be a stringified number in WEI (i.e. factor 10^18). *
  - `contract` `string`: The contract ID you want to interact with. Must have been added to Openfort first, starts with `con_`.
  - `functionName` `string`: The function name of the contract. Accepts a a function signature as well (e.g. mint(address)).
  - `functionArgs` `unknown[]`: The function arguments of the contract, in string format. If you provide one of a `pla_...`, `con_...` or `acc_...` it will be converted to the corresponding address.
  - `dataSuffix` `string`: Data to append to the end of the calldata. Useful for [adding a "domain" tag](https://opensea.notion.site/opensea/Seaport-Order-Attributions-ec2d69bf455041a5baa490941aad307f)
  - `data` `string`: The encoded calldata of the contract.

### Responses

#### `200`: Successful response.

Body (`application/json`):

- `id` `string` _(required)_
- `object` `string` _(required)_
- `createdAt` `integer <int32>` _(required)_
- `updatedAt` `integer <int32>` _(required)_: The unix timestamp in seconds when the transactionIntent was created.
- `chainId` `integer <int32>` _(required)_: The chain ID.
- `abstractionType` `string` _(required)_: The transaction abstraction type
- `transitions` `object[]`: Transition of statuses the transaction has gone through.
  - `fromStatus` `string` _(required)_
  - `toStatus` `string` _(required)_
  - `at` `number <double>` _(required)_
- `details` `object`: Specific transaction details based on its type
- `userOperationHash` `string`
- `userOperation` `unknown`
- `response` `object`
  - `createdAt` `integer <int32>` _(required)_: The unix timestamp in seconds when the transactionIntent was created.
  - `blockNumber` `integer <int32>`: The block height (number) of the block including the transaction of this log.
  - `transactionHash` `string`: The transaction hash of the transaction of this log.
  - `l1GasUsed` `string`: The l1 gas used by the transaction of this log.
  - `gasUsed` `string`: The gas used by the transaction of this log.
  - `gasFee` `string`: The gas fee by the transaction of this log.
  - `l1GasFee` `string`: The l1 gas fee by the transaction of this log.
  - `status` `integer <int32>`: The status of the transaction of this log.
  - `logs` `object[]`: The logs of the transaction of this log.
    - `blockNumber` `number <double>` _(required)_
    - `blockHash` `string` _(required)_
    - `transactionIndex` `number <double>` _(required)_
    - `removed` `boolean` _(required)_
    - `address` `string` _(required)_
    - `data` `string` _(required)_
    - `topics` `string[]` _(required)_
    - `transactionHash` `string` _(required)_
    - `logIndex` `number <double>` _(required)_
    - `orphaned` `boolean`
  - `to` `string`: The address of the contract of this log.
  - `error` `object`: The error of the transaction, if it failed or was rejected. Contains the error reason and, for known Account Abstraction errors (AA10–AA99), an explanation with cause and solution.
    - `reason` `string` _(required)_: The error reason string returned by the bundler or execution environment.
    - `name` `string`: The decoded error name from the contract revert, if available.
    - `explanation` `object`: Detailed explanation of the error cause and suggested solution. Present only for known Account Abstraction error codes (AA10–AA99).
      - `cause` `string` _(required)_: A human-readable description of what caused the error.
      - `solution` `string` _(required)_: A human-readable suggestion for how to resolve the error.
- `finalCost` `string`: The actual transaction cost in USD, available after on-chain confirmation.
- `interactions` `object[]`
  - `to` `string`: The address of the recipient of native tokens. Use *only* to transfer native tokens. If you provide one of a `pla_...`, or `acc_...` it will be converted to the corresponding address.
  - `value` `string`: The value intended to be sent with the transaction. Should be a stringified number in WEI (i.e. factor 10^18). *
  - `contract` `string`: The contract ID you want to interact with. Must have been added to Openfort first, starts with `con_`.
  - `functionName` `string`: The function name of the contract. Accepts a a function signature as well (e.g. mint(address)).
  - `functionArgs` `unknown[]`: The function arguments of the contract, in string format. If you provide one of a `pla_...`, `con_...` or `acc_...` it will be converted to the corresponding address.
  - `dataSuffix` `string`: Data to append to the end of the calldata. Useful for [adding a "domain" tag](https://opensea.notion.site/opensea/Seaport-Order-Attributions-ec2d69bf455041a5baa490941aad307f)
  - `data` `string`: The encoded calldata of the contract.
- `nextAction` `object`
  - `type` `string` _(required)_
  - `payload` `object` _(required)_
    - `userOp` `unknown`: The userOperation.
    - `userOpHash` `string`: The hashed userOperation.
    - `userOperation` `unknown`: The userOperation.
    - `userOperationHash` `string`: The hashed userOperation.
    - `signableHash` `string`: chain-agnostic hash to sign.
- `policy` `object`: The policy ID (starts with pol_).
- `player` `object`: The player ID (starts with pla_).
- `account` `object` _(required)_: The account ID (starts with acc_).

#### `400`: Request has invalid parameters.

Body (`application/json`):

- `error` `object` _(required)_
  - `type` `string` _(required)_
  - `message` `string` _(required)_
  - `details` `object`

#### `401`: Error response.

Body (`application/json`):

- `error` `object` _(required)_
  - `type` `string` _(required)_
  - `message` `string` _(required)_
  - `details` `object`

#### `409`: Error response.

Body (`application/json`):

- `error` `object` _(required)_
  - `type` `string` _(required)_
  - `message` `string` _(required)_
  - `details` `object`

### Example request

```bash
curl https://api.openfort.io/v1/transaction_intents \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{
  "chainId": 80002,
  "player": "pla_e0b84653-1741-4a3d-9e91-2b0fd2942f60",
  "account": "acc_e1b24353-1741-4a3d-9e91-2b0fd2942f60",
  "policy": "pol_7e07ae30-2a4d-48fa-803f-361da94905dd",
  "externalOwnerAddress": "0x1234567890abcdef1234567890abcdef12345678",
  "optimistic": true,
  "signedAuthorization": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1c",
  "interactions": [
    {
      "to": "string",
      "value": "1000000000000000000",
      "contract": "con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35",
      "functionName": "mint",
      "functionArgs": [
        "0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d"
      ],
      "dataSuffix": "string",
      "data": "string"
    }
  ]
}'
```

```ts
fetch('https://api.openfort.io/v1/transaction_intents', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    chainId: 80002,
    player: 'pla_e0b84653-1741-4a3d-9e91-2b0fd2942f60',
    account: 'acc_e1b24353-1741-4a3d-9e91-2b0fd2942f60',
    policy: 'pol_7e07ae30-2a4d-48fa-803f-361da94905dd',
    externalOwnerAddress: '0x1234567890abcdef1234567890abcdef12345678',
    optimistic: true,
    signedAuthorization: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1c',
    interactions: [
      {
        to: 'string',
        value: '1000000000000000000',
        contract: 'con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35',
        functionName: 'mint',
        functionArgs: ['0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d'],
        dataSuffix: 'string',
        data: 'string'
      }
    ]
  })
})
```

## Get a transaction intent object

`GET /v1/transaction_intents/{id}`

Retrieves the details of a TransactionIntent that has previously been created.

### Path parameters

- `id` `string` _(required)_: Specifies the unique transaction intent ID (starts with tin_).

### Query parameters

- `expand` `string[]`: Specifies the expandable fields.

### Responses

#### `200`: Successful response.

Body (`application/json`):

- `id` `string` _(required)_
- `object` `string` _(required)_
- `createdAt` `integer <int32>` _(required)_
- `updatedAt` `integer <int32>` _(required)_: The unix timestamp in seconds when the transactionIntent was created.
- `chainId` `integer <int32>` _(required)_: The chain ID.
- `abstractionType` `string` _(required)_: The transaction abstraction type
- `transitions` `object[]`: Transition of statuses the transaction has gone through.
  - `fromStatus` `string` _(required)_
  - `toStatus` `string` _(required)_
  - `at` `number <double>` _(required)_
- `details` `object`: Specific transaction details based on its type
- `userOperationHash` `string`
- `userOperation` `unknown`
- `response` `object`
  - `createdAt` `integer <int32>` _(required)_: The unix timestamp in seconds when the transactionIntent was created.
  - `blockNumber` `integer <int32>`: The block height (number) of the block including the transaction of this log.
  - `transactionHash` `string`: The transaction hash of the transaction of this log.
  - `l1GasUsed` `string`: The l1 gas used by the transaction of this log.
  - `gasUsed` `string`: The gas used by the transaction of this log.
  - `gasFee` `string`: The gas fee by the transaction of this log.
  - `l1GasFee` `string`: The l1 gas fee by the transaction of this log.
  - `status` `integer <int32>`: The status of the transaction of this log.
  - `logs` `object[]`: The logs of the transaction of this log.
    - `blockNumber` `number <double>` _(required)_
    - `blockHash` `string` _(required)_
    - `transactionIndex` `number <double>` _(required)_
    - `removed` `boolean` _(required)_
    - `address` `string` _(required)_
    - `data` `string` _(required)_
    - `topics` `string[]` _(required)_
    - `transactionHash` `string` _(required)_
    - `logIndex` `number <double>` _(required)_
    - `orphaned` `boolean`
  - `to` `string`: The address of the contract of this log.
  - `error` `object`: The error of the transaction, if it failed or was rejected. Contains the error reason and, for known Account Abstraction errors (AA10–AA99), an explanation with cause and solution.
    - `reason` `string` _(required)_: The error reason string returned by the bundler or execution environment.
    - `name` `string`: The decoded error name from the contract revert, if available.
    - `explanation` `object`: Detailed explanation of the error cause and suggested solution. Present only for known Account Abstraction error codes (AA10–AA99).
      - `cause` `string` _(required)_: A human-readable description of what caused the error.
      - `solution` `string` _(required)_: A human-readable suggestion for how to resolve the error.
- `finalCost` `string`: The actual transaction cost in USD, available after on-chain confirmation.
- `interactions` `object[]`
  - `to` `string`: The address of the recipient of native tokens. Use *only* to transfer native tokens. If you provide one of a `pla_...`, or `acc_...` it will be converted to the corresponding address.
  - `value` `string`: The value intended to be sent with the transaction. Should be a stringified number in WEI (i.e. factor 10^18). *
  - `contract` `string`: The contract ID you want to interact with. Must have been added to Openfort first, starts with `con_`.
  - `functionName` `string`: The function name of the contract. Accepts a a function signature as well (e.g. mint(address)).
  - `functionArgs` `unknown[]`: The function arguments of the contract, in string format. If you provide one of a `pla_...`, `con_...` or `acc_...` it will be converted to the corresponding address.
  - `dataSuffix` `string`: Data to append to the end of the calldata. Useful for [adding a "domain" tag](https://opensea.notion.site/opensea/Seaport-Order-Attributions-ec2d69bf455041a5baa490941aad307f)
  - `data` `string`: The encoded calldata of the contract.
- `nextAction` `object`
  - `type` `string` _(required)_
  - `payload` `object` _(required)_
    - `userOp` `unknown`: The userOperation.
    - `userOpHash` `string`: The hashed userOperation.
    - `userOperation` `unknown`: The userOperation.
    - `userOperationHash` `string`: The hashed userOperation.
    - `signableHash` `string`: chain-agnostic hash to sign.
- `policy` `object`: The policy ID (starts with pol_).
- `player` `object`: The player ID (starts with pla_).
- `account` `object` _(required)_: The account ID (starts with acc_).

#### `401`: Error response.

Body (`application/json`):

- `error` `object` _(required)_
  - `type` `string` _(required)_
  - `message` `string` _(required)_
  - `details` `object`

### Example request

```bash
curl 'https://api.openfort.io/v1/transaction_intents/tin_48eeba57-2cd5-4159-a2cb-057a23a35e65?expand=players'
```

```ts
fetch('https://api.openfort.io/v1/transaction_intents/tin_48eeba57-2cd5-4159-a2cb-057a23a35e65?expand=players')
```

## Estimate gas cost of creating a transaction

`POST /v1/transaction_intents/estimate_gas_cost`

Estimate the gas cost of broadcasting a TransactionIntent.

This is a simulation, it does not send the transaction on-chain.

If a Policy ID is used that includes payment of gas in ERC-20 tokens, an extra field `estimatedTXGasFeeToken` is returned with the estimated amount of tokens that will be used.

### Request body (required) (`application/json`)

- `chainId` `integer <int32>` _(required)_: The chain ID. Must be a [supported chain](https://www.openfort.io/docs/configuration/chains).
- `player` `string`: ID of the Player this TransactionIntent belongs to, if one exists (starts with `pla_`). If you omit this parameter a new Player will be created.
- `account` `string`: ID of the Account this TransactionIntent is executed with, if one exists (starts with `acc_` or `dac_`). When providing a Player and ChainID, you can omit this parameter.
- `policy` `string`: ID of the Policy that defines the gas sponsorship strategy (starts with `pol_`). If no Policy is provided, the own Account native token funds will be used to pay for gas.
- `externalOwnerAddress` `string`: Use this parameter to create a new Account for Player with the provided owner address. If you omit this parameter and no Account exists for the Player, a custodial Account will be created.
- `optimistic` `boolean`: Set to `true` to indicate that the transactionIntent request should be resolved as soon as possible, after the transactionIntent is created and simulated and before it arrives on chain.
- `signedAuthorization` `string`: Signed authorization for delegated accounts. This signature is used to authorize the user operation for AccountAbstractionV8. The signature should be in the format "0x..." and will be parsed to extract r, s, and yParity values.
- `interactions` `object[]` _(required)_
  - `to` `string`: The address of the recipient of native tokens. Use *only* to transfer native tokens. If you provide one of a `pla_...`, or `acc_...` it will be converted to the corresponding address.
  - `value` `string`: The value intended to be sent with the transaction. Should be a stringified number in WEI (i.e. factor 10^18). *
  - `contract` `string`: The contract ID you want to interact with. Must have been added to Openfort first, starts with `con_`.
  - `functionName` `string`: The function name of the contract. Accepts a a function signature as well (e.g. mint(address)).
  - `functionArgs` `unknown[]`: The function arguments of the contract, in string format. If you provide one of a `pla_...`, `con_...` or `acc_...` it will be converted to the corresponding address.
  - `dataSuffix` `string`: Data to append to the end of the calldata. Useful for [adding a "domain" tag](https://opensea.notion.site/opensea/Seaport-Order-Attributions-ec2d69bf455041a5baa490941aad307f)
  - `data` `string`: The encoded calldata of the contract.

### Responses

#### `200`: Successful response.

Body (`application/json`):

- `estimatedTXGas` `string` _(required)_: estimated TX gas cost
- `estimatedTXGasFee` `string` _(required)_: estimated TX gas cost in the chain native token (WEI)
- `estimatedTXGasFeeUSD` `string` _(required)_: estimated TX gas cost in USD
- `estimatedTXGasFeeToken` `string`: when using a policy, the estimated TX gas cost in the ERC-20 token defined in the strategy (WEI)
- `gasPrice` `string` _(required)_: gas price used for the estimation

#### `400`: Request has invalid parameters.

Body (`application/json`):

- `error` `object` _(required)_
  - `type` `string` _(required)_
  - `message` `string` _(required)_
  - `details` `object`

#### `401`: Error response.

Body (`application/json`):

- `error` `object` _(required)_
  - `type` `string` _(required)_
  - `message` `string` _(required)_
  - `details` `object`

#### `409`: Error response.

Body (`application/json`):

- `error` `object` _(required)_
  - `type` `string` _(required)_
  - `message` `string` _(required)_
  - `details` `object`

### Example request

```bash
curl https://api.openfort.io/v1/transaction_intents/estimate_gas_cost \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{
  "chainId": 80002,
  "player": "pla_e0b84653-1741-4a3d-9e91-2b0fd2942f60",
  "account": "acc_e1b24353-1741-4a3d-9e91-2b0fd2942f60",
  "policy": "pol_7e07ae30-2a4d-48fa-803f-361da94905dd",
  "externalOwnerAddress": "0x1234567890abcdef1234567890abcdef12345678",
  "optimistic": true,
  "signedAuthorization": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1c",
  "interactions": [
    {
      "to": "string",
      "value": "1000000000000000000",
      "contract": "con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35",
      "functionName": "mint",
      "functionArgs": [
        "0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d"
      ],
      "dataSuffix": "string",
      "data": "string"
    }
  ]
}'
```

```ts
fetch('https://api.openfort.io/v1/transaction_intents/estimate_gas_cost', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    chainId: 80002,
    player: 'pla_e0b84653-1741-4a3d-9e91-2b0fd2942f60',
    account: 'acc_e1b24353-1741-4a3d-9e91-2b0fd2942f60',
    policy: 'pol_7e07ae30-2a4d-48fa-803f-361da94905dd',
    externalOwnerAddress: '0x1234567890abcdef1234567890abcdef12345678',
    optimistic: true,
    signedAuthorization: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1c',
    interactions: [
      {
        to: 'string',
        value: '1000000000000000000',
        contract: 'con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35',
        functionName: 'mint',
        functionArgs: ['0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d'],
        dataSuffix: 'string',
        data: 'string'
      }
    ]
  })
})
```

## Send a signed transaction signableHash

`POST /v1/transaction_intents/{id}/signature`

Broadcasts a signed TransactionIntent to the blockchain.

Use this endpoint to send the signed `signableHash`. Openfort will then put it on-chain.

### Path parameters

- `id` `string` _(required)_: Specifies the unique transaction intent ID (starts with tin_).

### Request body (required) (`application/json`)

- `signature` `string` _(required)_: signed userOperationHash by the owner or valid session key
- `optimistic` `boolean`: Set to `true` to indicate that the transactionIntent request should be resolved as soon as possible, after the transactionIntent is created and simulated and before it arrives on chain.

### Responses

#### `200`: Successful response.

Body (`application/json`):

- `id` `string` _(required)_
- `object` `string` _(required)_
- `createdAt` `integer <int32>` _(required)_
- `updatedAt` `integer <int32>` _(required)_: The unix timestamp in seconds when the transactionIntent was created.
- `chainId` `integer <int32>` _(required)_: The chain ID.
- `abstractionType` `string` _(required)_: The transaction abstraction type
- `transitions` `object[]`: Transition of statuses the transaction has gone through.
  - `fromStatus` `string` _(required)_
  - `toStatus` `string` _(required)_
  - `at` `number <double>` _(required)_
- `details` `object`: Specific transaction details based on its type
- `userOperationHash` `string`
- `userOperation` `unknown`
- `response` `object`
  - `createdAt` `integer <int32>` _(required)_: The unix timestamp in seconds when the transactionIntent was created.
  - `blockNumber` `integer <int32>`: The block height (number) of the block including the transaction of this log.
  - `transactionHash` `string`: The transaction hash of the transaction of this log.
  - `l1GasUsed` `string`: The l1 gas used by the transaction of this log.
  - `gasUsed` `string`: The gas used by the transaction of this log.
  - `gasFee` `string`: The gas fee by the transaction of this log.
  - `l1GasFee` `string`: The l1 gas fee by the transaction of this log.
  - `status` `integer <int32>`: The status of the transaction of this log.
  - `logs` `object[]`: The logs of the transaction of this log.
    - `blockNumber` `number <double>` _(required)_
    - `blockHash` `string` _(required)_
    - `transactionIndex` `number <double>` _(required)_
    - `removed` `boolean` _(required)_
    - `address` `string` _(required)_
    - `data` `string` _(required)_
    - `topics` `string[]` _(required)_
    - `transactionHash` `string` _(required)_
    - `logIndex` `number <double>` _(required)_
    - `orphaned` `boolean`
  - `to` `string`: The address of the contract of this log.
  - `error` `object`: The error of the transaction, if it failed or was rejected. Contains the error reason and, for known Account Abstraction errors (AA10–AA99), an explanation with cause and solution.
    - `reason` `string` _(required)_: The error reason string returned by the bundler or execution environment.
    - `name` `string`: The decoded error name from the contract revert, if available.
    - `explanation` `object`: Detailed explanation of the error cause and suggested solution. Present only for known Account Abstraction error codes (AA10–AA99).
      - `cause` `string` _(required)_: A human-readable description of what caused the error.
      - `solution` `string` _(required)_: A human-readable suggestion for how to resolve the error.
- `finalCost` `string`: The actual transaction cost in USD, available after on-chain confirmation.
- `interactions` `object[]`
  - `to` `string`: The address of the recipient of native tokens. Use *only* to transfer native tokens. If you provide one of a `pla_...`, or `acc_...` it will be converted to the corresponding address.
  - `value` `string`: The value intended to be sent with the transaction. Should be a stringified number in WEI (i.e. factor 10^18). *
  - `contract` `string`: The contract ID you want to interact with. Must have been added to Openfort first, starts with `con_`.
  - `functionName` `string`: The function name of the contract. Accepts a a function signature as well (e.g. mint(address)).
  - `functionArgs` `unknown[]`: The function arguments of the contract, in string format. If you provide one of a `pla_...`, `con_...` or `acc_...` it will be converted to the corresponding address.
  - `dataSuffix` `string`: Data to append to the end of the calldata. Useful for [adding a "domain" tag](https://opensea.notion.site/opensea/Seaport-Order-Attributions-ec2d69bf455041a5baa490941aad307f)
  - `data` `string`: The encoded calldata of the contract.
- `nextAction` `object`
  - `type` `string` _(required)_
  - `payload` `object` _(required)_
    - `userOp` `unknown`: The userOperation.
    - `userOpHash` `string`: The hashed userOperation.
    - `userOperation` `unknown`: The userOperation.
    - `userOperationHash` `string`: The hashed userOperation.
    - `signableHash` `string`: chain-agnostic hash to sign.
- `policy` `object`: The policy ID (starts with pol_).
- `player` `object`: The player ID (starts with pla_).
- `account` `object` _(required)_: The account ID (starts with acc_).

#### `401`: Error response.

Body (`application/json`):

- `error` `object` _(required)_
  - `type` `string` _(required)_
  - `message` `string` _(required)_
  - `details` `object`

#### `409`: Error response.

Body (`application/json`):

- `error` `object` _(required)_
  - `type` `string` _(required)_
  - `message` `string` _(required)_
  - `details` `object`

### Example request

```bash
curl https://api.openfort.io/v1/transaction_intents/tin_48eeba57-2cd5-4159-a2cb-057a23a35e65/signature \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{
  "signature": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
  "optimistic": true
}'
```

```ts
fetch('https://api.openfort.io/v1/transaction_intents/tin_48eeba57-2cd5-4159-a2cb-057a23a35e65/signature', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    signature: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
    optimistic: true
  })
})
```
