# List trades

Lists the trades the agent made or proposed, newest first, each with its `status` and receipts. Filter by `runId` or `conversationId`.

`GET /v1/users/{userId}/wallet/trades`

## Authentication

Both headers are required.

- Header: `X-Api-Key: YOUR_API_KEY`
- Header: `Authorization: Bearer YOUR_USER_TOKEN` — A user's session token, from Create a session.

## Path parameters



```json
[
  {
    "schema": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
    },
    "in": "path",
    "name": "userId",
    "required": true,
    "description": "Your id for the user: the `userId` you sent to Create a user. It must be the session's user."
  }
]
```


## Query parameters



```json
[
  {
    "schema": {
      "type": "string",
      "maxLength": 256
    },
    "in": "query",
    "name": "cursor",
    "required": false,
    "description": "Where the previous page ended; omit for the first page"
  },
  {
    "schema": {
      "default": 50,
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "in": "query",
    "name": "limit",
    "required": false,
    "description": "How many rows to answer, at most 100"
  },
  {
    "schema": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "in": "query",
    "name": "runId",
    "required": false,
    "description": "Only trades proposed by this agent run."
  },
  {
    "schema": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "in": "query",
    "name": "conversationId",
    "required": false,
    "description": "Only trades proposed in this conversation."
  }
]
```


## Request example

Illustrative request. Replace the host, credentials and resource IDs with your own. If a request file is shown, create it from the schema above. Review the requested action before sending it.

```sh
curl --request GET 'https://api.example.test/v1/users/YOUR_USER_ID/wallet/trades' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Authorization: Bearer YOUR_USER_TOKEN'
```

## Responses

### 200

A page of trades.



```json
{
  "description": "A page of trades.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WalletTrade"
            },
            "description": "This page's rows."
          },
          "nextCursor": {
            "description": "The cursor for the next page; null once there are no more rows.",
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "How many rows the list holds in all."
          }
        },
        "required": [
          "data",
          "nextCursor",
          "total"
        ]
      }
    }
  }
}
```


### 400

The request could not be read as this operation expects.

- `invalid_input` — the body or query failed validation; `issues` names each field
- `invalid_cursor` — the `cursor` is not one this list minted



```json
{
  "description": "The request could not be read as this operation expects.\n\n- `invalid_input` — the body or query failed validation; `issues` names each field\n- `invalid_cursor` — the `cursor` is not one this list minted",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 401

A credential is missing, invalid or expired.

- `partner_key_required` — no `X-Api-Key` header was sent
- `partner_key_invalid` — the `X-Api-Key` is unknown or revoked
- `credential_expired` — the user token has expired; obtain a fresh one



```json
{
  "description": "A credential is missing, invalid or expired.\n\n- `partner_key_required` — no `X-Api-Key` header was sent\n- `partner_key_invalid` — the `X-Api-Key` is unknown or revoked\n- `credential_expired` — the user token has expired; obtain a fresh one",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 403

The credentials are valid but may not do this.

- `subject_mismatch` — the `{userId}` in the path is not the token's user
- `account_disabled` — an operator disabled the account
- `origin_rejected` — a browser `Origin` other than the configured web origin
- `permission_required` — the verified credential is not permitted to make this call



```json
{
  "description": "The credentials are valid but may not do this.\n\n- `subject_mismatch` — the `{userId}` in the path is not the token's user\n- `account_disabled` — an operator disabled the account\n- `origin_rejected` — a browser `Origin` other than the configured web origin\n- `permission_required` — the verified credential is not permitted to make this call",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 404

The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.



```json
{
  "description": "The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 429

A limit refused the request; wait for `Retry-After` when it is sent.

- `rate_limited` — the per-key or per-user limit is spent; honour `Retry-After`
- `partner_request_capacity` — this partner's request quota across all keys and replicas is spent; honour Retry-After



```json
{
  "description": "A limit refused the request; wait for `Retry-After` when it is sent.\n\n- `rate_limited` — the per-key or per-user limit is spent; honour `Retry-After`\n- `partner_request_capacity` — this partner's request quota across all keys and replicas is spent; honour Retry-After",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 500

A fault on our side; quote `requestId` when reporting it.

- `internal` — a fault on our side; quote `requestId` when reporting it



```json
{
  "description": "A fault on our side; quote `requestId` when reporting it.\n\n- `internal` — a fault on our side; quote `requestId` when reporting it",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 503

The service cannot take this right now (draining, a dependency did not answer, or an operator paused the work); `retryable` says whether to try again.

- `internal` — a fault on our side; quote `requestId` when reporting it



```json
{
  "description": "The service cannot take this right now (draining, a dependency did not answer, or an operator paused the work); `retryable` says whether to try again.\n\n- `internal` — a fault on our side; quote `requestId` when reporting it",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


## Complete OpenAPI definition

The exact operation and all referenced components, including recursive schemas.



```json
{
  "operation": {
    "operationId": "wallets.listTrades",
    "summary": "List trades",
    "tags": [
      "wallets"
    ],
    "description": "Lists the trades the agent made or proposed, newest first, each with its `status` and receipts. Filter by `runId` or `conversationId`.",
    "parameters": [
      {
        "schema": {
          "type": "string",
          "maxLength": 256
        },
        "in": "query",
        "name": "cursor",
        "required": false,
        "description": "Where the previous page ended; omit for the first page"
      },
      {
        "schema": {
          "default": 50,
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "in": "query",
        "name": "limit",
        "required": false,
        "description": "How many rows to answer, at most 100"
      },
      {
        "schema": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "in": "query",
        "name": "runId",
        "required": false,
        "description": "Only trades proposed by this agent run."
      },
      {
        "schema": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "in": "query",
        "name": "conversationId",
        "required": false,
        "description": "Only trades proposed in this conversation."
      },
      {
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
        },
        "in": "path",
        "name": "userId",
        "required": true,
        "description": "Your id for the user: the `userId` you sent to Create a user. It must be the session's user."
      }
    ],
    "security": [
      {
        "apiKey": [],
        "userToken": []
      }
    ],
    "responses": {
      "200": {
        "description": "A page of trades.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WalletTrade"
                  },
                  "description": "This page's rows."
                },
                "nextCursor": {
                  "description": "The cursor for the next page; null once there are no more rows.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "total": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "How many rows the list holds in all."
                }
              },
              "required": [
                "data",
                "nextCursor",
                "total"
              ]
            }
          }
        }
      },
      "400": {
        "$ref": "#/components/responses/InvalidInput"
      },
      "401": {
        "$ref": "#/components/responses/Unauthorized"
      },
      "403": {
        "$ref": "#/components/responses/Forbidden"
      },
      "404": {
        "$ref": "#/components/responses/NotFound"
      },
      "429": {
        "$ref": "#/components/responses/TooManyRequests"
      },
      "500": {
        "$ref": "#/components/responses/Internal"
      },
      "503": {
        "$ref": "#/components/responses/Unavailable"
      }
    }
  },
  "components": {
    "schemas": {
      "WalletTrade": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "The trade's id."
          },
          "source": {
            "type": "object",
            "properties": {
              "conversationId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "The conversation's id."
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The proposing conversation, or null when historical lineage was not retained."
              },
              "runId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "The run's id. It stays the same while the run pauses for approvals and resumes."
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The proposing stable agent run, or null when historical lineage was not retained."
              },
              "callId": {
                "description": "The recorded proposing model tool call, or null when historical lineage was not retained.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "automationRunId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The automation run that started the proposing run, or null when an automation did not start it."
              }
            },
            "required": [
              "conversationId",
              "runId",
              "callId",
              "automationRunId"
            ],
            "description": "Where the trade came from: the conversation, run and tool call that proposed it, and the automation run behind it, if any. None of them is consent."
          },
          "request": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "actions": {
                    "minItems": 1,
                    "maxItems": 16,
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "swap",
                              "description": "Exchange one asset for another; custody never leaves the agent wallet."
                            },
                            "input": {
                              "type": "object",
                              "properties": {
                                "pinned": {
                                  "type": "object",
                                  "properties": {
                                    "tokenId": {
                                      "type": "string",
                                      "maxLength": 256,
                                      "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                      "description": "The exact ledger asset identifier, including its token standard namespace."
                                    },
                                    "decimals": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 38,
                                      "description": "How many decimal places the token's smallest unit represents."
                                    }
                                  },
                                  "required": [
                                    "tokenId",
                                    "decimals"
                                  ],
                                  "description": "The exact input asset's token id and decimals."
                                }
                              },
                              "required": [
                                "pinned"
                              ],
                              "description": "The concrete asset this request spends; it must match the approved action at this position."
                            },
                            "quantity": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "exact_input_tokens",
                                      "description": "Spend an exact amount of the input token."
                                    },
                                    "amountRaw": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,38})$",
                                      "description": "The exact input amount, in the input token's smallest unit."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "amountRaw"
                                  ],
                                  "description": "An exact quantity of the input token, not its USD value: exactly 5 USDC at decimals 6 is amountRaw \"5000000\". No floating-point arithmetic or bash."
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "exact_input_value_usd",
                                      "description": "Spend a USD-denominated value of the input token."
                                    },
                                    "value": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,38})(?:\\.\\d{1,18})?$",
                                      "description": "The USD value to spend, as a decimal string."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "value"
                                  ],
                                  "description": "A USD value of the input token: \"$5 worth of USDC\" is value \"5\", never exactly 5 USDC. The host converts it at live prices."
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "exact_output_tokens",
                                      "description": "Receive an exact amount of the output token."
                                    },
                                    "amountRaw": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,38})$",
                                      "description": "The exact output amount, in the output token's smallest unit."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "amountRaw"
                                  ],
                                  "description": "An exact quantity of the output token, scaled by its verified decimals; the host calculates the input."
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "all_of_input",
                                      "description": "Spend everything the agent wallet holds of the input asset."
                                    }
                                  },
                                  "required": [
                                    "kind"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "fraction_of_input",
                                      "description": "Spend a fraction of the input asset."
                                    },
                                    "bps": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,4})$",
                                      "description": "The fraction to spend, in basis points of the input asset."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "bps"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "fraction_of_position",
                                      "description": "Sell a fraction of this automation's own position in the input asset."
                                    },
                                    "bps": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,4})$",
                                      "description": "The fraction to sell, in basis points of this automation's own position; 10000 is all of it."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "bps"
                                  ],
                                  "description": "A fraction of what THIS automation's own settled fills still hold of the input asset, never of the wallet balance; only on an action with an `exit` guard."
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "gain_of_position",
                                      "description": "Sell only the gain on this automation's own position in the input asset."
                                    }
                                  },
                                  "required": [
                                    "kind"
                                  ],
                                  "description": "Only the gain on THIS automation's own position, priced in the token its buys paid with; only with a take_profit or harvest_every `exit` guard and a pinned output other than that token."
                                }
                              ],
                              "description": "How much moves: an exact token amount, an exact USD value, an exact output amount, all of the input, or a fraction of it."
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "pinned": {
                                  "type": "object",
                                  "properties": {
                                    "tokenId": {
                                      "type": "string",
                                      "maxLength": 256,
                                      "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                      "description": "The exact ledger asset identifier, including its token standard namespace."
                                    },
                                    "decimals": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 38,
                                      "description": "How many decimal places the token's smallest unit represents."
                                    }
                                  },
                                  "required": [
                                    "tokenId",
                                    "decimals"
                                  ],
                                  "description": "The exact output asset's token id and decimals."
                                }
                              },
                              "required": [
                                "pinned"
                              ],
                              "description": "The concrete asset this request produces; it must match the approved action at this position."
                            }
                          },
                          "required": [
                            "kind",
                            "input",
                            "quantity",
                            "output"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "withdraw_to_owner",
                              "description": "Return an asset to the account that owns the agent wallet."
                            },
                            "input": {
                              "type": "object",
                              "properties": {
                                "pinned": {
                                  "type": "object",
                                  "properties": {
                                    "tokenId": {
                                      "type": "string",
                                      "maxLength": 256,
                                      "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                      "description": "The exact ledger asset identifier, including its token standard namespace."
                                    },
                                    "decimals": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 38,
                                      "description": "How many decimal places the token's smallest unit represents."
                                    }
                                  },
                                  "required": [
                                    "tokenId",
                                    "decimals"
                                  ],
                                  "description": "The exact input asset's token id and decimals."
                                }
                              },
                              "required": [
                                "pinned"
                              ],
                              "description": "The concrete asset this request spends; it must match the approved action at this position."
                            },
                            "quantity": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "exact_input_tokens",
                                      "description": "Spend an exact amount of the input token."
                                    },
                                    "amountRaw": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,38})$",
                                      "description": "The exact input amount, in the input token's smallest unit."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "amountRaw"
                                  ],
                                  "description": "An exact quantity of the input token, not its USD value: exactly 5 USDC at decimals 6 is amountRaw \"5000000\". No floating-point arithmetic or bash."
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "exact_input_value_usd",
                                      "description": "Spend a USD-denominated value of the input token."
                                    },
                                    "value": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,38})(?:\\.\\d{1,18})?$",
                                      "description": "The USD value to spend, as a decimal string."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "value"
                                  ],
                                  "description": "A USD value of the input token: \"$5 worth of USDC\" is value \"5\", never exactly 5 USDC. The host converts it at live prices."
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "exact_output_tokens",
                                      "description": "Receive an exact amount of the output token."
                                    },
                                    "amountRaw": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,38})$",
                                      "description": "The exact output amount, in the output token's smallest unit."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "amountRaw"
                                  ],
                                  "description": "An exact quantity of the output token, scaled by its verified decimals; the host calculates the input."
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "all_of_input",
                                      "description": "Spend everything the agent wallet holds of the input asset."
                                    }
                                  },
                                  "required": [
                                    "kind"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "fraction_of_input",
                                      "description": "Spend a fraction of the input asset."
                                    },
                                    "bps": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,4})$",
                                      "description": "The fraction to spend, in basis points of the input asset."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "bps"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "fraction_of_position",
                                      "description": "Sell a fraction of this automation's own position in the input asset."
                                    },
                                    "bps": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,4})$",
                                      "description": "The fraction to sell, in basis points of this automation's own position; 10000 is all of it."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "bps"
                                  ],
                                  "description": "A fraction of what THIS automation's own settled fills still hold of the input asset, never of the wallet balance; only on an action with an `exit` guard."
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "gain_of_position",
                                      "description": "Sell only the gain on this automation's own position in the input asset."
                                    }
                                  },
                                  "required": [
                                    "kind"
                                  ],
                                  "description": "Only the gain on THIS automation's own position, priced in the token its buys paid with; only with a take_profit or harvest_every `exit` guard and a pinned output other than that token."
                                }
                              ],
                              "description": "How much moves: an exact token amount, an exact USD value, an exact output amount, all of the input, or a fraction of it."
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "pinned": {
                                  "type": "object",
                                  "properties": {
                                    "tokenId": {
                                      "type": "string",
                                      "maxLength": 256,
                                      "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                      "description": "The exact ledger asset identifier, including its token standard namespace."
                                    },
                                    "decimals": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 38,
                                      "description": "How many decimal places the token's smallest unit represents."
                                    }
                                  },
                                  "required": [
                                    "tokenId",
                                    "decimals"
                                  ],
                                  "description": "The exact output asset's token id and decimals."
                                }
                              },
                              "required": [
                                "pinned"
                              ],
                              "description": "The concrete asset this request produces; it must match the approved action at this position."
                            }
                          },
                          "required": [
                            "kind",
                            "input",
                            "quantity",
                            "output"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "withdraw_transfer",
                              "description": "Pay the exact approved destination through the provider’s chain or Intents transfer route."
                            },
                            "input": {
                              "type": "object",
                              "properties": {
                                "pinned": {
                                  "type": "object",
                                  "properties": {
                                    "tokenId": {
                                      "type": "string",
                                      "maxLength": 256,
                                      "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                      "description": "The exact ledger asset identifier, including its token standard namespace."
                                    },
                                    "decimals": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 38,
                                      "description": "How many decimal places the token's smallest unit represents."
                                    }
                                  },
                                  "required": [
                                    "tokenId",
                                    "decimals"
                                  ],
                                  "description": "The exact input asset's token id and decimals."
                                }
                              },
                              "required": [
                                "pinned"
                              ],
                              "description": "The concrete asset this request spends; it must match the approved action at this position."
                            },
                            "quantity": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "exact_input_tokens",
                                      "description": "Spend an exact amount of the input token."
                                    },
                                    "amountRaw": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,38})$",
                                      "description": "The exact input amount, in the input token's smallest unit."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "amountRaw"
                                  ],
                                  "description": "An exact quantity of the input token, not its USD value: exactly 5 USDC at decimals 6 is amountRaw \"5000000\". No floating-point arithmetic or bash."
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "exact_input_value_usd",
                                      "description": "Spend a USD-denominated value of the input token."
                                    },
                                    "value": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,38})(?:\\.\\d{1,18})?$",
                                      "description": "The USD value to spend, as a decimal string."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "value"
                                  ],
                                  "description": "A USD value of the input token: \"$5 worth of USDC\" is value \"5\", never exactly 5 USDC. The host converts it at live prices."
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "exact_output_tokens",
                                      "description": "Receive an exact amount of the output token."
                                    },
                                    "amountRaw": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,38})$",
                                      "description": "The exact output amount, in the output token's smallest unit."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "amountRaw"
                                  ],
                                  "description": "An exact quantity of the output token, scaled by its verified decimals; the host calculates the input."
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "all_of_input",
                                      "description": "Spend everything the agent wallet holds of the input asset."
                                    }
                                  },
                                  "required": [
                                    "kind"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "fraction_of_input",
                                      "description": "Spend a fraction of the input asset."
                                    },
                                    "bps": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,4})$",
                                      "description": "The fraction to spend, in basis points of the input asset."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "bps"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "fraction_of_position",
                                      "description": "Sell a fraction of this automation's own position in the input asset."
                                    },
                                    "bps": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,4})$",
                                      "description": "The fraction to sell, in basis points of this automation's own position; 10000 is all of it."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "bps"
                                  ],
                                  "description": "A fraction of what THIS automation's own settled fills still hold of the input asset, never of the wallet balance; only on an action with an `exit` guard."
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "gain_of_position",
                                      "description": "Sell only the gain on this automation's own position in the input asset."
                                    }
                                  },
                                  "required": [
                                    "kind"
                                  ],
                                  "description": "Only the gain on THIS automation's own position, priced in the token its buys paid with; only with a take_profit or harvest_every `exit` guard and a pinned output other than that token."
                                }
                              ],
                              "description": "How much moves: an exact token amount, an exact USD value, an exact output amount, all of the input, or a fraction of it."
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "pinned": {
                                  "type": "object",
                                  "properties": {
                                    "tokenId": {
                                      "type": "string",
                                      "maxLength": 256,
                                      "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                      "description": "The exact ledger asset identifier, including its token standard namespace."
                                    },
                                    "decimals": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 38,
                                      "description": "How many decimal places the token's smallest unit represents."
                                    }
                                  },
                                  "required": [
                                    "tokenId",
                                    "decimals"
                                  ],
                                  "description": "The exact output asset's token id and decimals."
                                }
                              },
                              "required": [
                                "pinned"
                              ],
                              "description": "The concrete asset this request produces; it must match the approved action at this position."
                            },
                            "recipient": {
                              "type": "object",
                              "properties": {
                                "rail": {
                                  "type": "string",
                                  "enum": [
                                    "chain",
                                    "intents"
                                  ],
                                  "description": "A native blockchain transfer or a signed transfer within an Intents ledger."
                                },
                                "network": {
                                  "type": "string",
                                  "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                  "description": "Exact network identifier from wallet capabilities; near-intents and near-intents-confidential are ledgers, not the NEAR blockchain."
                                },
                                "address": {
                                  "type": "string",
                                  "pattern": "^[\\x21-\\x7e]{1,256}$",
                                  "description": "Exact network address, preserving case and any routing metadata encoded in its native address format. Names must be resolved before approval."
                                },
                                "memo": {
                                  "type": "null",
                                  "description": "Standalone routing memos are unsupported; routing must be encoded in the approved address."
                                }
                              },
                              "required": [
                                "rail",
                                "network",
                                "address",
                                "memo"
                              ],
                              "description": "The exact approved payout rail, network and address."
                            },
                            "minimumReceivedRaw": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Minimum acceptable payout in output-asset atomic units, or null when the approved all-in loss bound alone sets the floor."
                            },
                            "maxFeeRaw": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Optional separate withdrawal fee cap in output-asset atomic units; null means undisclosed, while all-in loss and minimum receive remain enforced."
                            }
                          },
                          "required": [
                            "kind",
                            "input",
                            "quantity",
                            "output",
                            "recipient",
                            "minimumReceivedRaw",
                            "maxFeeRaw"
                          ]
                        }
                      ]
                    },
                    "description": "The complete ordered financial actions proposed for this execution, with concrete assets and exact quantity rules."
                  },
                  "bounds": {
                    "type": "object",
                    "properties": {
                      "maxValueLossBps": {
                        "type": "string",
                        "pattern": "^(0|[1-9]\\d{0,4})$",
                        "description": "The most value an execution may give up to price movement and fees together, in basis points; 0 allows no loss."
                      },
                      "maxSignatureLifetimeSeconds": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 259500,
                        "description": "Explicit maximum lifetime of each released transfer signature, in seconds. 1Click confidential swaps require up to 259500 seconds (72 hours 5 minutes). This does not extend the execution window or approval validity."
                      }
                    },
                    "required": [
                      "maxValueLossBps",
                      "maxSignatureLifetimeSeconds"
                    ],
                    "description": "The explicit loss and signature-lifetime limits; these must exactly match the approved grant."
                  },
                  "execution": {
                    "description": "Required on every new chat proposal: the exact execution limits proposed for approval. Copy existing signed grants unchanged; historical approvals and standing grants with this field omitted retain their original execution behavior.",
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "ordered",
                              "parallel_independent"
                            ],
                            "description": "Ordered actions run in approved order. Parallel-independent actions run up to four concurrently after the complete initially funded request is reserved."
                          },
                          "maxPreparationAttempts": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 3,
                            "description": "The maximum unsigned preparation attempts for each approved action, including its first attempt."
                          },
                          "dispatchWindowSeconds": {
                            "type": "integer",
                            "minimum": 60,
                            "maximum": 86400,
                            "description": "The maximum dispatch window in seconds for this operation, from when its approval opened: exactly 1200 for a new chat request, and up to its signed deadline for an automation's grant. Closing dispatch never proves a submitted transfer did not move; observation continues."
                          }
                        },
                        "required": [
                          "mode",
                          "maxPreparationAttempts",
                          "dispatchWindowSeconds"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "mode": {
                            "type": "string",
                            "const": "dependency_graph"
                          },
                          "dependencies": {
                            "minItems": 1,
                            "maxItems": 16,
                            "type": "array",
                            "items": {
                              "maxItems": 16,
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 15
                              }
                            },
                            "description": "One row per requested action, listing its sorted unique predecessor action indices. A successor requires confirmed predecessor settlement. Every action must be funded from initial holdings."
                          },
                          "maxPreparationAttempts": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 3,
                            "description": "The maximum unsigned preparation attempts for each approved action, including its first attempt."
                          },
                          "dispatchWindowSeconds": {
                            "type": "integer",
                            "minimum": 60,
                            "maximum": 86400,
                            "description": "The maximum dispatch window in seconds for this operation, from when its approval opened: exactly 1200 for a new chat request, and up to its signed deadline for an automation's grant. Closing dispatch never proves a submitted transfer did not move; observation continues."
                          }
                        },
                        "required": [
                          "mode",
                          "dependencies",
                          "maxPreparationAttempts",
                          "dispatchWindowSeconds"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "actions",
                  "bounds"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "What the agent asked for: the actions and their limits, as swaps and payouts to the destination the user approved. A refused proposal is shown with its refusal. `null` only for old trades recorded without it."
          },
          "approval": {
            "type": "object",
            "properties": {
              "request": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "approvalId": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                        "description": "The approval of this exact trade request."
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "pending",
                          "approved",
                          "denied",
                          "expired"
                        ],
                        "description": "The recorded review decision; overdue pending reviews are presented as expired."
                      },
                      "expiresAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                        "description": "The deadline after which this review cannot authorize execution."
                      },
                      "contract": {
                        "description": "The exact reviewed financial terms, when retained and readable.",
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "near_intents_transfer",
                            "description": "Which contract template this is."
                          },
                          "actions": {
                            "minItems": 1,
                            "maxItems": 16,
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "swap",
                                      "description": "Exchange one asset for another; custody never leaves the agent wallet."
                                    },
                                    "input": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "pinned": {
                                              "type": "object",
                                              "properties": {
                                                "tokenId": {
                                                  "type": "string",
                                                  "maxLength": 256,
                                                  "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                                  "description": "The exact ledger asset identifier, including its token standard namespace."
                                                },
                                                "decimals": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 38,
                                                  "description": "How many decimal places the token's smallest unit represents."
                                                }
                                              },
                                              "required": [
                                                "tokenId",
                                                "decimals"
                                              ],
                                              "description": "The exact token this asset is pinned to."
                                            }
                                          },
                                          "required": [
                                            "pinned"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "any": {
                                              "type": "boolean",
                                              "const": true,
                                              "description": "Any token the agent wallet holds; the executor picks one at execution."
                                            }
                                          },
                                          "required": [
                                            "any"
                                          ]
                                        }
                                      ],
                                      "description": "The asset this action spends: pinned to one token, or any token the agent wallet holds."
                                    },
                                    "quantity": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "exact_input_tokens",
                                              "description": "Spend an exact amount of the input token."
                                            },
                                            "amountRaw": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,38})$",
                                              "description": "The exact input amount, in the input token's smallest unit."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "amountRaw"
                                          ],
                                          "description": "An exact quantity of the input token, not its USD value: exactly 5 USDC at decimals 6 is amountRaw \"5000000\". No floating-point arithmetic or bash."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "exact_input_value_usd",
                                              "description": "Spend a USD-denominated value of the input token."
                                            },
                                            "value": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,38})(?:\\.\\d{1,18})?$",
                                              "description": "The USD value to spend, as a decimal string."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "value"
                                          ],
                                          "description": "A USD value of the input token: \"$5 worth of USDC\" is value \"5\", never exactly 5 USDC. The host converts it at live prices."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "exact_output_tokens",
                                              "description": "Receive an exact amount of the output token."
                                            },
                                            "amountRaw": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,38})$",
                                              "description": "The exact output amount, in the output token's smallest unit."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "amountRaw"
                                          ],
                                          "description": "An exact quantity of the output token, scaled by its verified decimals; the host calculates the input."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "all_of_input",
                                              "description": "Spend everything the agent wallet holds of the input asset."
                                            }
                                          },
                                          "required": [
                                            "kind"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "fraction_of_input",
                                              "description": "Spend a fraction of the input asset."
                                            },
                                            "bps": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,4})$",
                                              "description": "The fraction to spend, in basis points of the input asset."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "bps"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "fraction_of_position",
                                              "description": "Sell a fraction of this automation's own position in the input asset."
                                            },
                                            "bps": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,4})$",
                                              "description": "The fraction to sell, in basis points of this automation's own position; 10000 is all of it."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "bps"
                                          ],
                                          "description": "A fraction of what THIS automation's own settled fills still hold of the input asset, never of the wallet balance; only on an action with an `exit` guard."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "gain_of_position",
                                              "description": "Sell only the gain on this automation's own position in the input asset."
                                            }
                                          },
                                          "required": [
                                            "kind"
                                          ],
                                          "description": "Only the gain on THIS automation's own position, priced in the token its buys paid with; only with a take_profit or harvest_every `exit` guard and a pinned output other than that token."
                                        }
                                      ],
                                      "description": "How much moves: an exact token amount, an exact USD value, an exact output amount, all of the input, or a fraction of it."
                                    },
                                    "output": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "pinned": {
                                              "type": "object",
                                              "properties": {
                                                "tokenId": {
                                                  "type": "string",
                                                  "maxLength": 256,
                                                  "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                                  "description": "The exact ledger asset identifier, including its token standard namespace."
                                                },
                                                "decimals": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 38,
                                                  "description": "How many decimal places the token's smallest unit represents."
                                                }
                                              },
                                              "required": [
                                                "tokenId",
                                                "decimals"
                                              ],
                                              "description": "The exact token this asset is pinned to."
                                            }
                                          },
                                          "required": [
                                            "pinned"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "any": {
                                              "type": "boolean",
                                              "const": true,
                                              "description": "Any token the agent wallet holds; the executor picks one at execution."
                                            }
                                          },
                                          "required": [
                                            "any"
                                          ]
                                        }
                                      ],
                                      "description": "The asset this action produces: pinned to one token, or left open."
                                    },
                                    "exit": {
                                      "description": "Optional exit guard: this action sells only when the asset's price in its output token crosses the automation's own average cost by the approved amount.",
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "take_profit",
                                              "description": "Sell when the asset is this far ABOVE the automation's average cost."
                                            },
                                            "gainBps": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,4})$",
                                              "description": "How far above the average cost the price must be, in basis points."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "gainBps"
                                          ],
                                          "description": "A take-profit exit: sell once the price is up this much on average cost."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "stop_loss",
                                              "description": "Sell when the asset is this far BELOW the automation's average cost."
                                            },
                                            "lossBps": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,4})$",
                                              "description": "How far below the average cost the price must be, in basis points."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "lossBps"
                                          ],
                                          "description": "A stop-loss exit: sell once the price is down this much on average cost."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "harvest_every",
                                              "description": "Take profits on a schedule: sell only the gain every this many days, counted from the last harvest that settled, or from the first deposit that settled."
                                            },
                                            "days": {
                                              "type": "string",
                                              "pattern": "^[1-9]\\d{0,2}$",
                                              "description": "How many days apart harvests are, 7 to 365, as a decimal string: \"7\" weekly, \"30\" monthly."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "days"
                                          ],
                                          "description": "A scheduled harvest: only on a gain_of_position exit selling a curated yield vault's share token (earn_vaults). Every `days` days it sells only the gain, if there is any, and the automation keeps running."
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "input",
                                    "quantity",
                                    "output"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "withdraw_to_owner",
                                      "description": "Return an asset to the account that owns the agent wallet."
                                    },
                                    "input": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "pinned": {
                                              "type": "object",
                                              "properties": {
                                                "tokenId": {
                                                  "type": "string",
                                                  "maxLength": 256,
                                                  "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                                  "description": "The exact ledger asset identifier, including its token standard namespace."
                                                },
                                                "decimals": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 38,
                                                  "description": "How many decimal places the token's smallest unit represents."
                                                }
                                              },
                                              "required": [
                                                "tokenId",
                                                "decimals"
                                              ],
                                              "description": "The exact token this asset is pinned to."
                                            }
                                          },
                                          "required": [
                                            "pinned"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "any": {
                                              "type": "boolean",
                                              "const": true,
                                              "description": "Any token the agent wallet holds; the executor picks one at execution."
                                            }
                                          },
                                          "required": [
                                            "any"
                                          ]
                                        }
                                      ],
                                      "description": "The asset this action spends: pinned to one token, or any token the agent wallet holds."
                                    },
                                    "quantity": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "exact_input_tokens",
                                              "description": "Spend an exact amount of the input token."
                                            },
                                            "amountRaw": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,38})$",
                                              "description": "The exact input amount, in the input token's smallest unit."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "amountRaw"
                                          ],
                                          "description": "An exact quantity of the input token, not its USD value: exactly 5 USDC at decimals 6 is amountRaw \"5000000\". No floating-point arithmetic or bash."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "exact_input_value_usd",
                                              "description": "Spend a USD-denominated value of the input token."
                                            },
                                            "value": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,38})(?:\\.\\d{1,18})?$",
                                              "description": "The USD value to spend, as a decimal string."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "value"
                                          ],
                                          "description": "A USD value of the input token: \"$5 worth of USDC\" is value \"5\", never exactly 5 USDC. The host converts it at live prices."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "exact_output_tokens",
                                              "description": "Receive an exact amount of the output token."
                                            },
                                            "amountRaw": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,38})$",
                                              "description": "The exact output amount, in the output token's smallest unit."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "amountRaw"
                                          ],
                                          "description": "An exact quantity of the output token, scaled by its verified decimals; the host calculates the input."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "all_of_input",
                                              "description": "Spend everything the agent wallet holds of the input asset."
                                            }
                                          },
                                          "required": [
                                            "kind"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "fraction_of_input",
                                              "description": "Spend a fraction of the input asset."
                                            },
                                            "bps": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,4})$",
                                              "description": "The fraction to spend, in basis points of the input asset."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "bps"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "fraction_of_position",
                                              "description": "Sell a fraction of this automation's own position in the input asset."
                                            },
                                            "bps": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,4})$",
                                              "description": "The fraction to sell, in basis points of this automation's own position; 10000 is all of it."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "bps"
                                          ],
                                          "description": "A fraction of what THIS automation's own settled fills still hold of the input asset, never of the wallet balance; only on an action with an `exit` guard."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "gain_of_position",
                                              "description": "Sell only the gain on this automation's own position in the input asset."
                                            }
                                          },
                                          "required": [
                                            "kind"
                                          ],
                                          "description": "Only the gain on THIS automation's own position, priced in the token its buys paid with; only with a take_profit or harvest_every `exit` guard and a pinned output other than that token."
                                        }
                                      ],
                                      "description": "How much moves: an exact token amount, an exact USD value, an exact output amount, all of the input, or a fraction of it."
                                    },
                                    "output": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "pinned": {
                                              "type": "object",
                                              "properties": {
                                                "tokenId": {
                                                  "type": "string",
                                                  "maxLength": 256,
                                                  "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                                  "description": "The exact ledger asset identifier, including its token standard namespace."
                                                },
                                                "decimals": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 38,
                                                  "description": "How many decimal places the token's smallest unit represents."
                                                }
                                              },
                                              "required": [
                                                "tokenId",
                                                "decimals"
                                              ],
                                              "description": "The exact token this asset is pinned to."
                                            }
                                          },
                                          "required": [
                                            "pinned"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "any": {
                                              "type": "boolean",
                                              "const": true,
                                              "description": "Any token the agent wallet holds; the executor picks one at execution."
                                            }
                                          },
                                          "required": [
                                            "any"
                                          ]
                                        }
                                      ],
                                      "description": "The asset this action produces: pinned to one token, or left open."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "input",
                                    "quantity",
                                    "output"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "withdraw_transfer",
                                      "description": "Pay the exact approved destination through the provider’s chain or Intents transfer route."
                                    },
                                    "input": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "pinned": {
                                              "type": "object",
                                              "properties": {
                                                "tokenId": {
                                                  "type": "string",
                                                  "maxLength": 256,
                                                  "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                                  "description": "The exact ledger asset identifier, including its token standard namespace."
                                                },
                                                "decimals": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 38,
                                                  "description": "How many decimal places the token's smallest unit represents."
                                                }
                                              },
                                              "required": [
                                                "tokenId",
                                                "decimals"
                                              ],
                                              "description": "The exact token this asset is pinned to."
                                            }
                                          },
                                          "required": [
                                            "pinned"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "any": {
                                              "type": "boolean",
                                              "const": true,
                                              "description": "Any token the agent wallet holds; the executor picks one at execution."
                                            }
                                          },
                                          "required": [
                                            "any"
                                          ]
                                        }
                                      ],
                                      "description": "The asset this action spends: pinned to one token, or any token the agent wallet holds."
                                    },
                                    "quantity": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "exact_input_tokens",
                                              "description": "Spend an exact amount of the input token."
                                            },
                                            "amountRaw": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,38})$",
                                              "description": "The exact input amount, in the input token's smallest unit."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "amountRaw"
                                          ],
                                          "description": "An exact quantity of the input token, not its USD value: exactly 5 USDC at decimals 6 is amountRaw \"5000000\". No floating-point arithmetic or bash."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "exact_input_value_usd",
                                              "description": "Spend a USD-denominated value of the input token."
                                            },
                                            "value": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,38})(?:\\.\\d{1,18})?$",
                                              "description": "The USD value to spend, as a decimal string."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "value"
                                          ],
                                          "description": "A USD value of the input token: \"$5 worth of USDC\" is value \"5\", never exactly 5 USDC. The host converts it at live prices."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "exact_output_tokens",
                                              "description": "Receive an exact amount of the output token."
                                            },
                                            "amountRaw": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,38})$",
                                              "description": "The exact output amount, in the output token's smallest unit."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "amountRaw"
                                          ],
                                          "description": "An exact quantity of the output token, scaled by its verified decimals; the host calculates the input."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "all_of_input",
                                              "description": "Spend everything the agent wallet holds of the input asset."
                                            }
                                          },
                                          "required": [
                                            "kind"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "fraction_of_input",
                                              "description": "Spend a fraction of the input asset."
                                            },
                                            "bps": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,4})$",
                                              "description": "The fraction to spend, in basis points of the input asset."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "bps"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "fraction_of_position",
                                              "description": "Sell a fraction of this automation's own position in the input asset."
                                            },
                                            "bps": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,4})$",
                                              "description": "The fraction to sell, in basis points of this automation's own position; 10000 is all of it."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "bps"
                                          ],
                                          "description": "A fraction of what THIS automation's own settled fills still hold of the input asset, never of the wallet balance; only on an action with an `exit` guard."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "gain_of_position",
                                              "description": "Sell only the gain on this automation's own position in the input asset."
                                            }
                                          },
                                          "required": [
                                            "kind"
                                          ],
                                          "description": "Only the gain on THIS automation's own position, priced in the token its buys paid with; only with a take_profit or harvest_every `exit` guard and a pinned output other than that token."
                                        }
                                      ],
                                      "description": "How much moves: an exact token amount, an exact USD value, an exact output amount, all of the input, or a fraction of it."
                                    },
                                    "output": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "pinned": {
                                              "type": "object",
                                              "properties": {
                                                "tokenId": {
                                                  "type": "string",
                                                  "maxLength": 256,
                                                  "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                                  "description": "The exact ledger asset identifier, including its token standard namespace."
                                                },
                                                "decimals": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 38,
                                                  "description": "How many decimal places the token's smallest unit represents."
                                                }
                                              },
                                              "required": [
                                                "tokenId",
                                                "decimals"
                                              ],
                                              "description": "The exact token this asset is pinned to."
                                            }
                                          },
                                          "required": [
                                            "pinned"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "any": {
                                              "type": "boolean",
                                              "const": true,
                                              "description": "Any token the agent wallet holds; the executor picks one at execution."
                                            }
                                          },
                                          "required": [
                                            "any"
                                          ]
                                        }
                                      ],
                                      "description": "The asset this action produces: pinned to one token, or left open."
                                    },
                                    "recipient": {
                                      "type": "object",
                                      "properties": {
                                        "rail": {
                                          "type": "string",
                                          "enum": [
                                            "chain",
                                            "intents"
                                          ],
                                          "description": "A native blockchain transfer or a signed transfer within an Intents ledger."
                                        },
                                        "network": {
                                          "type": "string",
                                          "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                          "description": "Exact network identifier from wallet capabilities; near-intents and near-intents-confidential are ledgers, not the NEAR blockchain."
                                        },
                                        "address": {
                                          "type": "string",
                                          "pattern": "^[\\x21-\\x7e]{1,256}$",
                                          "description": "Exact network address, preserving case and any routing metadata encoded in its native address format. Names must be resolved before approval."
                                        },
                                        "memo": {
                                          "type": "null",
                                          "description": "Standalone routing memos are unsupported; routing must be encoded in the approved address."
                                        }
                                      },
                                      "required": [
                                        "rail",
                                        "network",
                                        "address",
                                        "memo"
                                      ],
                                      "description": "The exact approved payout rail, network and address."
                                    },
                                    "minimumReceivedRaw": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "pattern": "^(0|[1-9]\\d{0,38})$"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ],
                                      "description": "Minimum acceptable payout in output-asset atomic units, or null when the approved all-in loss bound alone sets the floor."
                                    },
                                    "maxFeeRaw": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "pattern": "^(0|[1-9]\\d{0,38})$"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ],
                                      "description": "Optional separate withdrawal fee cap in output-asset atomic units; null means undisclosed, while all-in loss and minimum receive remain enforced."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "input",
                                    "quantity",
                                    "output",
                                    "recipient",
                                    "minimumReceivedRaw",
                                    "maxFeeRaw"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "send",
                                      "description": "Not executable, and refused in new contracts: pay an address with withdraw_transfer."
                                    },
                                    "input": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "pinned": {
                                              "type": "object",
                                              "properties": {
                                                "tokenId": {
                                                  "type": "string",
                                                  "maxLength": 256,
                                                  "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                                  "description": "The exact ledger asset identifier, including its token standard namespace."
                                                },
                                                "decimals": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 38,
                                                  "description": "How many decimal places the token's smallest unit represents."
                                                }
                                              },
                                              "required": [
                                                "tokenId",
                                                "decimals"
                                              ],
                                              "description": "The exact token this asset is pinned to."
                                            }
                                          },
                                          "required": [
                                            "pinned"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "any": {
                                              "type": "boolean",
                                              "const": true,
                                              "description": "Any token the agent wallet holds; the executor picks one at execution."
                                            }
                                          },
                                          "required": [
                                            "any"
                                          ]
                                        }
                                      ],
                                      "description": "The asset this action spends: pinned to one token, or any token the agent wallet holds."
                                    },
                                    "quantity": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "exact_input_tokens",
                                              "description": "Spend an exact amount of the input token."
                                            },
                                            "amountRaw": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,38})$",
                                              "description": "The exact input amount, in the input token's smallest unit."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "amountRaw"
                                          ],
                                          "description": "An exact quantity of the input token, not its USD value: exactly 5 USDC at decimals 6 is amountRaw \"5000000\". No floating-point arithmetic or bash."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "exact_input_value_usd",
                                              "description": "Spend a USD-denominated value of the input token."
                                            },
                                            "value": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,38})(?:\\.\\d{1,18})?$",
                                              "description": "The USD value to spend, as a decimal string."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "value"
                                          ],
                                          "description": "A USD value of the input token: \"$5 worth of USDC\" is value \"5\", never exactly 5 USDC. The host converts it at live prices."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "exact_output_tokens",
                                              "description": "Receive an exact amount of the output token."
                                            },
                                            "amountRaw": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,38})$",
                                              "description": "The exact output amount, in the output token's smallest unit."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "amountRaw"
                                          ],
                                          "description": "An exact quantity of the output token, scaled by its verified decimals; the host calculates the input."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "all_of_input",
                                              "description": "Spend everything the agent wallet holds of the input asset."
                                            }
                                          },
                                          "required": [
                                            "kind"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "fraction_of_input",
                                              "description": "Spend a fraction of the input asset."
                                            },
                                            "bps": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,4})$",
                                              "description": "The fraction to spend, in basis points of the input asset."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "bps"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "fraction_of_position",
                                              "description": "Sell a fraction of this automation's own position in the input asset."
                                            },
                                            "bps": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,4})$",
                                              "description": "The fraction to sell, in basis points of this automation's own position; 10000 is all of it."
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "bps"
                                          ],
                                          "description": "A fraction of what THIS automation's own settled fills still hold of the input asset, never of the wallet balance; only on an action with an `exit` guard."
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "gain_of_position",
                                              "description": "Sell only the gain on this automation's own position in the input asset."
                                            }
                                          },
                                          "required": [
                                            "kind"
                                          ],
                                          "description": "Only the gain on THIS automation's own position, priced in the token its buys paid with; only with a take_profit or harvest_every `exit` guard and a pinned output other than that token."
                                        }
                                      ],
                                      "description": "How much moves: an exact token amount, an exact USD value, an exact output amount, all of the input, or a fraction of it."
                                    },
                                    "output": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "pinned": {
                                              "type": "object",
                                              "properties": {
                                                "tokenId": {
                                                  "type": "string",
                                                  "maxLength": 256,
                                                  "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                                  "description": "The exact ledger asset identifier, including its token standard namespace."
                                                },
                                                "decimals": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 38,
                                                  "description": "How many decimal places the token's smallest unit represents."
                                                }
                                              },
                                              "required": [
                                                "tokenId",
                                                "decimals"
                                              ],
                                              "description": "The exact token this asset is pinned to."
                                            }
                                          },
                                          "required": [
                                            "pinned"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "any": {
                                              "type": "boolean",
                                              "const": true,
                                              "description": "Any token the agent wallet holds; the executor picks one at execution."
                                            }
                                          },
                                          "required": [
                                            "any"
                                          ]
                                        }
                                      ],
                                      "description": "The asset this action produces: pinned to one token, or left open."
                                    },
                                    "recipient": {
                                      "type": "object",
                                      "properties": {
                                        "chain": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 32,
                                          "description": "Which chain the destination address is on."
                                        },
                                        "address": {
                                          "type": "string",
                                          "pattern": "^[\\x21-\\x7e]{1,128}$",
                                          "description": "The destination address on that chain."
                                        }
                                      },
                                      "required": [
                                        "chain",
                                        "address"
                                      ],
                                      "description": "The pinned destination this action pays."
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "input",
                                    "quantity",
                                    "output",
                                    "recipient"
                                  ]
                                }
                              ]
                            },
                            "description": "The actions this contract authorizes, executed in order."
                          },
                          "validUntil": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                            "description": "When this contract's authority expires."
                          },
                          "maxExecutions": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 10000,
                            "description": "How many times this contract may be executed before it is exhausted."
                          },
                          "maxTotalInput": {
                            "description": "Optional total cap on what all executions together may spend, per input token, in raw units. A $500 budget paid in USDC is 500 USDC. Every action input must be pinned and capped.",
                            "minItems": 1,
                            "maxItems": 16,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "tokenId": {
                                  "type": "string",
                                  "maxLength": 256,
                                  "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                  "description": "The exact ledger asset identifier, including its token standard namespace."
                                },
                                "decimals": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 38,
                                  "description": "How many decimal places the token's smallest unit represents."
                                },
                                "amountRaw": {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$",
                                  "description": "The most this contract may spend of this token in total, across every execution, in the token's smallest unit."
                                }
                              },
                              "required": [
                                "tokenId",
                                "decimals",
                                "amountRaw"
                              ],
                              "description": "One capped input token and its total spend ceiling."
                            }
                          },
                          "bounds": {
                            "type": "object",
                            "properties": {
                              "maxValueLossBps": {
                                "type": "string",
                                "pattern": "^(0|[1-9]\\d{0,4})$",
                                "description": "The most value an execution may give up to price movement and fees together, in basis points; 0 allows no loss."
                              },
                              "maxSignatureLifetimeSeconds": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 259500,
                                "description": "Explicit maximum lifetime of each released transfer signature, in seconds. 1Click confidential swaps require up to 259500 seconds (72 hours 5 minutes). This does not extend the execution window or approval validity."
                              }
                            },
                            "required": [
                              "maxValueLossBps",
                              "maxSignatureLifetimeSeconds"
                            ],
                            "description": "The value-loss and signature-lifetime limits every execution must respect."
                          },
                          "execution": {
                            "description": "Optional explicit recovery authority, signed with these exact actions and bounds; omitted on historical approvals.",
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "mode": {
                                    "type": "string",
                                    "enum": [
                                      "ordered",
                                      "parallel_independent"
                                    ],
                                    "description": "Ordered actions run in approved order. Parallel-independent actions run up to four concurrently after the complete initially funded request is reserved."
                                  },
                                  "maxPreparationAttempts": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3,
                                    "description": "The maximum unsigned preparation attempts for each approved action, including its first attempt."
                                  },
                                  "dispatchWindowSeconds": {
                                    "type": "integer",
                                    "minimum": 60,
                                    "maximum": 86400,
                                    "description": "The maximum dispatch window in seconds for this operation, from when its approval opened: exactly 1200 for a new chat request, and up to its signed deadline for an automation's grant. Closing dispatch never proves a submitted transfer did not move; observation continues."
                                  }
                                },
                                "required": [
                                  "mode",
                                  "maxPreparationAttempts",
                                  "dispatchWindowSeconds"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "mode": {
                                    "type": "string",
                                    "const": "dependency_graph"
                                  },
                                  "dependencies": {
                                    "minItems": 1,
                                    "maxItems": 16,
                                    "type": "array",
                                    "items": {
                                      "maxItems": 16,
                                      "type": "array",
                                      "items": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 15
                                      }
                                    },
                                    "description": "One row per requested action, listing its sorted unique predecessor action indices. A successor requires confirmed predecessor settlement. Every action must be funded from initial holdings."
                                  },
                                  "maxPreparationAttempts": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3,
                                    "description": "The maximum unsigned preparation attempts for each approved action, including its first attempt."
                                  },
                                  "dispatchWindowSeconds": {
                                    "type": "integer",
                                    "minimum": 60,
                                    "maximum": 86400,
                                    "description": "The maximum dispatch window in seconds for this operation, from when its approval opened: exactly 1200 for a new chat request, and up to its signed deadline for an automation's grant. Closing dispatch never proves a submitted transfer did not move; observation continues."
                                  }
                                },
                                "required": [
                                  "mode",
                                  "dependencies",
                                  "maxPreparationAttempts",
                                  "dispatchWindowSeconds"
                                ]
                              }
                            ]
                          }
                        },
                        "required": [
                          "type",
                          "actions",
                          "validUntil",
                          "maxExecutions",
                          "bounds"
                        ]
                      },
                      "executionRestriction": {
                        "description": "Present when the reviewed request was forbidden from signing or moving funds.",
                        "type": "string",
                        "const": "signing_disabled"
                      }
                    },
                    "required": [
                      "approvalId",
                      "status",
                      "expiresAt"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The exact request's retained review; null when standing consent supplied authority."
              },
              "grantApprovalId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The approval that created the immutable grant used by this trade, if bound."
              }
            },
            "required": [
              "request",
              "grantApprovalId"
            ],
            "description": "Who approved the trade: the approval of this request, or the standing approval it ran under."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "completed",
              "partial",
              "refunded",
              "failed",
              "denied",
              "expired",
              "uncertain"
            ],
            "description": "`pending` until it starts, usually while it waits for the user's approval. `processing` while it runs, or while a swap it sent waits for the provider to confirm it. Then `completed` (every swap settled, or there was nothing to swap: `outcome.status` is `no_trade`), `partial` (some swaps settled and a later one did not; the settled swaps stand), `refunded` (the provider sent the funds back to the agent wallet) or `failed` (nothing was swapped; `failureReason` says why). `denied` and `expired` mean the user denied it, or its approval ran out, before it started. `uncertain` means the result could not be confirmed yet: never ask the agent for a replacement, keep checking. `completed`, `partial`, `refunded`, `failed`, `denied` and `expired` are final."
          },
          "failureReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "insufficient_funds",
                  "quote_rejected",
                  "quote_expired",
                  "unavailable",
                  "not_authorized",
                  "stopped",
                  "not_executed",
                  "signing_disabled"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "When `status` is `failed`, why; otherwise `null`. `insufficient_funds`: the agent wallet did not hold enough when the trade started. `quote_rejected`: the price or transfer at execution failed its checks or fell outside the approved limits. `quote_expired`: the quote ran out before the provider took the swap. `unavailable`: a temporary problem stopped it before anything was sent. `not_authorized`: the approval did not cover it when it started (it asked for something else, or the approval had expired or used up its limits), or nothing could sign it then (the automation firing it ran for was not confirmed in time, or is no longer current). `stopped`: an operator paused trading, stopped the automation or turned the wallet off. `not_executed`: the provider did not carry it out. `signing_disabled`: this deployment does not sign trades. In every case nothing was swapped."
          },
          "outcome": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string",
                        "const": "in_progress"
                      },
                      "operationId": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                        "description": "The persisted financial operation still owned by its durable executor."
                      }
                    },
                    "required": [
                      "status",
                      "operationId"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string",
                        "const": "no_trade",
                        "description": "The request resolved without attempting a financial action."
                      }
                    },
                    "required": [
                      "status"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string",
                        "const": "refused",
                        "description": "The financial command refused execution under its authority or safety checks."
                      },
                      "scope": {
                        "type": "string",
                        "enum": [
                          "authority",
                          "request",
                          "transient",
                          "insufficient_funds",
                          "request_frozen",
                          "verification",
                          "stale_evidence",
                          "account_busy",
                          "conflict",
                          "paused",
                          "held",
                          "withdrawn",
                          "spend_cap_reached",
                          "no_signing_authority",
                          "not_available_in_region",
                          "no_account",
                          "withdrawal_too_small",
                          "withdrawal_reserve_required",
                          "nothing_freed",
                          "order_invalid",
                          "route_unavailable",
                          "buy_too_small",
                          "reserve_required",
                          "loss_bound_exceeded",
                          "token_blocked"
                        ],
                        "description": "The bounded category of the refusal; no provider text, account details or amounts are exposed here. `buy_too_small` (a Solana buy below its minimum), `reserve_required` (it would spend the SOL the Solana account keeps for fees) and `loss_bound_exceeded` (no route returned at least the approved minimum) can be corrected by asking the user for other terms; `token_blocked` means the token's own rules, or its missing price, keep it from trading through fin; `route_unavailable` means the requested financial route was not available; `nothing_freed` means a cash-out's withdrawal found nothing its exit freed to bring home."
                      }
                    },
                    "required": [
                      "status",
                      "scope"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "settled",
                          "pending",
                          "partial",
                          "refunded",
                          "not_executed"
                        ],
                        "description": "The financial outcome: settled, unresolved, mixed or incomplete, refunded, or conclusively not executed. An outcome can still be waiting for receipts; the trade's or withdrawal's `status` says whether it is final."
                      },
                      "reason": {
                        "description": "Present when execution was restricted to a mode that cannot sign or move funds.",
                        "type": "string",
                        "const": "signing_disabled"
                      },
                      "stopped": {
                        "description": "Present only on a partial outcome whose run refused a later leg before it was claimed: the planned action the run stopped on and the bounded reason it never started.",
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 15,
                            "description": "The leg's zero-based position in the frozen plan."
                          },
                          "reason": {
                            "type": "string",
                            "enum": [
                              "lineage_unavailable",
                              "consent_invalid",
                              "allowance_exhausted",
                              "spend_cap_reached",
                              "position_unknown",
                              "exit_not_reached",
                              "selection_mismatch",
                              "action_mismatch",
                              "request_frozen",
                              "insufficient_funds",
                              "evidence_unavailable",
                              "inventory_stale",
                              "plan_conflict",
                              "leg_order",
                              "quote_invalid",
                              "payload_invalid",
                              "account_busy",
                              "expired",
                              "credentials_unavailable",
                              "execution_paused",
                              "automation_held",
                              "authority_withdrawn",
                              "perps_disabled",
                              "prediction_disabled",
                              "not_available_in_region",
                              "no_account",
                              "withdrawal_too_small",
                              "withdrawal_reserve_required",
                              "nothing_freed",
                              "order_invalid",
                              "route_unsupported",
                              "route_changed",
                              "solana_disabled",
                              "token_unpriced",
                              "token_mismatch",
                              "token_freezable",
                              "token_transfer_hook",
                              "token_permanent_delegate",
                              "token_non_transferable",
                              "token_default_frozen",
                              "token_transfer_fee",
                              "token_pausable",
                              "token_unknown_extension",
                              "token_not_sellable",
                              "route_invalid",
                              "loss_bound_exceeded",
                              "reserve_required",
                              "buy_too_small",
                              "swap_already_landed",
                              "solana_unavailable"
                            ],
                            "description": "The bounded category the stopped leg was refused with; no provider text, account details or amounts."
                          }
                        },
                        "required": [
                          "index",
                          "reason"
                        ]
                      },
                      "blocked": {
                        "description": "Unclaimed actions blocked before dispatch, with unique indices disjoint from all actual legs.",
                        "minItems": 1,
                        "maxItems": 16,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "index": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 15,
                              "description": "The leg's zero-based position in the frozen plan."
                            },
                            "reason": {
                              "type": "string",
                              "enum": [
                                "lineage_unavailable",
                                "consent_invalid",
                                "allowance_exhausted",
                                "spend_cap_reached",
                                "position_unknown",
                                "exit_not_reached",
                                "selection_mismatch",
                                "action_mismatch",
                                "request_frozen",
                                "insufficient_funds",
                                "evidence_unavailable",
                                "inventory_stale",
                                "plan_conflict",
                                "leg_order",
                                "quote_invalid",
                                "payload_invalid",
                                "account_busy",
                                "expired",
                                "credentials_unavailable",
                                "execution_paused",
                                "automation_held",
                                "authority_withdrawn",
                                "perps_disabled",
                                "prediction_disabled",
                                "not_available_in_region",
                                "no_account",
                                "withdrawal_too_small",
                                "withdrawal_reserve_required",
                                "nothing_freed",
                                "order_invalid",
                                "route_unsupported",
                                "route_changed",
                                "solana_disabled",
                                "token_unpriced",
                                "token_mismatch",
                                "token_freezable",
                                "token_transfer_hook",
                                "token_permanent_delegate",
                                "token_non_transferable",
                                "token_default_frozen",
                                "token_transfer_fee",
                                "token_pausable",
                                "token_unknown_extension",
                                "token_not_sellable",
                                "route_invalid",
                                "loss_bound_exceeded",
                                "reserve_required",
                                "buy_too_small",
                                "swap_already_landed",
                                "solana_unavailable"
                              ],
                              "description": "The bounded category the stopped leg was refused with; no provider text, account details or amounts."
                            }
                          },
                          "required": [
                            "index",
                            "reason"
                          ]
                        }
                      },
                      "legs": {
                        "maxItems": 16,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "index": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 15,
                              "description": "The leg's zero-based position in the frozen plan."
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "claimed",
                                "signed",
                                "uncertain",
                                "settled",
                                "refunded",
                                "not_executed"
                              ],
                              "description": "The recorded execution or settlement state of this actual leg."
                            }
                          },
                          "required": [
                            "index",
                            "state"
                          ]
                        },
                        "description": "The actual execution legs represented by this outcome; unattempted planned legs have no invented receipt."
                      },
                      "solana": {
                        "description": "Present only on a Solana operation's outcome: what it paid, received and signed on Solana. `legs` are its 1Click legs.",
                        "$ref": "#/components/schemas/SolanaOperationDetail"
                      }
                    },
                    "required": [
                      "status",
                      "legs"
                    ]
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The recorded outcome behind `status`, as evidence; `null` until there is one. Read `status` to decide what to do. On a `partial` trade, `outcome.stopped` names the swap it stopped on when that swap never started."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When the trade was proposed."
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the trade started; `null` before then."
          },
          "reportedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When its outcome was recorded; settlement can still follow."
          },
          "plan": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "The frozen trade execution plan identity."
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                    "description": "When the trade execution terms were frozen."
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                    "description": "The deadline after which this plan cannot authorize new signing."
                  },
                  "legs": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "exact_input",
                              "description": "Spends the fixed input amount and requires at least minimumOutputRaw in return."
                            },
                            "index": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 15,
                              "description": "The leg's zero-based position in the frozen plan."
                            },
                            "actionIndex": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 15,
                              "description": "The zero-based index of the original requested action this leg implements."
                            },
                            "input": {
                              "type": "object",
                              "properties": {
                                "tokenId": {
                                  "type": "string",
                                  "maxLength": 256,
                                  "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                  "description": "The exact ledger asset identifier, including its token standard namespace."
                                },
                                "decimals": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 38,
                                  "description": "How many decimal places the token's smallest unit represents."
                                },
                                "amountRaw": {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$",
                                  "description": "The exact input amount, in the asset's smallest unit as an integer string."
                                }
                              },
                              "required": [
                                "tokenId",
                                "decimals",
                                "amountRaw"
                              ],
                              "description": "The pinned input asset and exact amount this leg may spend."
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "tokenId": {
                                  "type": "string",
                                  "maxLength": 256,
                                  "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                  "description": "The exact ledger asset identifier, including its token standard namespace."
                                },
                                "decimals": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 38,
                                  "description": "How many decimal places the token's smallest unit represents."
                                }
                              },
                              "required": [
                                "tokenId",
                                "decimals"
                              ],
                              "description": "The pinned asset this leg must receive."
                            },
                            "minimumOutputRaw": {
                              "type": "string",
                              "pattern": "^(0|[1-9]\\d{0,38})$",
                              "description": "The minimum acceptable output amount, in the output asset's smallest unit as an integer string."
                            },
                            "referenceOutputRaw": {
                              "type": "string",
                              "pattern": "^(0|[1-9]\\d{0,38})$",
                              "description": "The reference output amount from trusted price evidence before applying the approved loss bound, in the output asset's smallest unit."
                            },
                            "inputPriceUsd": {
                              "type": "string",
                              "maxLength": 80,
                              "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$",
                              "description": "Enforcement's own trusted USD price per whole token at plan freeze, as plain decimal text."
                            },
                            "outputPriceUsd": {
                              "type": "string",
                              "maxLength": 80,
                              "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$",
                              "description": "Enforcement's own trusted USD price per whole token at plan freeze, as plain decimal text."
                            }
                          },
                          "required": [
                            "kind",
                            "index",
                            "actionIndex",
                            "input",
                            "output",
                            "minimumOutputRaw",
                            "referenceOutputRaw"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "exact_output",
                              "description": "Receives the fixed output amount and spends no more than maximumInputRaw."
                            },
                            "index": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 15,
                              "description": "The leg's zero-based position in the frozen plan."
                            },
                            "actionIndex": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 15,
                              "description": "The zero-based index of the original requested action this leg implements."
                            },
                            "input": {
                              "type": "object",
                              "properties": {
                                "tokenId": {
                                  "type": "string",
                                  "maxLength": 256,
                                  "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                  "description": "The exact ledger asset identifier, including its token standard namespace."
                                },
                                "decimals": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 38,
                                  "description": "How many decimal places the token's smallest unit represents."
                                }
                              },
                              "required": [
                                "tokenId",
                                "decimals"
                              ],
                              "description": "The pinned asset this leg may spend."
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "tokenId": {
                                  "type": "string",
                                  "maxLength": 256,
                                  "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                  "description": "The exact ledger asset identifier, including its token standard namespace."
                                },
                                "decimals": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 38,
                                  "description": "How many decimal places the token's smallest unit represents."
                                },
                                "amountRaw": {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$",
                                  "description": "The exact output amount, in the asset's smallest unit as an integer string."
                                }
                              },
                              "required": [
                                "tokenId",
                                "decimals",
                                "amountRaw"
                              ],
                              "description": "The pinned output asset and exact amount this leg must receive."
                            },
                            "maximumInputRaw": {
                              "type": "string",
                              "pattern": "^(0|[1-9]\\d{0,38})$",
                              "description": "The maximum permitted input amount, in the input asset's smallest unit as an integer string."
                            },
                            "referenceInputRaw": {
                              "type": "string",
                              "pattern": "^(0|[1-9]\\d{0,38})$",
                              "description": "The reference input amount from trusted price evidence before applying the approved loss bound, in the input asset's smallest unit."
                            },
                            "inputPriceUsd": {
                              "type": "string",
                              "maxLength": 80,
                              "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$",
                              "description": "Enforcement's own trusted USD price per whole token at plan freeze, as plain decimal text."
                            },
                            "outputPriceUsd": {
                              "type": "string",
                              "maxLength": 80,
                              "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$",
                              "description": "Enforcement's own trusted USD price per whole token at plan freeze, as plain decimal text."
                            }
                          },
                          "required": [
                            "kind",
                            "index",
                            "actionIndex",
                            "input",
                            "output",
                            "maximumInputRaw",
                            "referenceInputRaw"
                          ]
                        }
                      ]
                    },
                    "description": "Every frozen planned leg, including unattempted legs."
                  }
                },
                "required": [
                  "id",
                  "createdAt",
                  "expiresAt",
                  "legs"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The steps the trade planned, fixed before signing, or `null` before there is a plan. A planned step is not proof it ran."
          },
          "legs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                  "description": "The durable claim identity for this actually attempted trade leg."
                },
                "index": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "This actual leg position in the frozen plan, counting from zero."
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "claimed",
                    "signed",
                    "uncertain",
                    "settled",
                    "refunded",
                    "not_executed"
                  ],
                  "description": "One leg's progress: `claimed` (its allowance is reserved, not yet signed), `signed` (signed, not yet submitted), `uncertain` (submitted; the provider's outcome is not yet confirmed), then terminal — `settled`, `refunded`, or `not_executed`."
                },
                "inputToken": {
                  "description": "The input asset id this leg claimed, or null on a leg claimed before the trade record was stored.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "outputToken": {
                  "description": "The output asset id this leg claimed, or null on a leg claimed before the trade record was stored.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "debitRaw": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d{0,38})$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The exact input the signed transfer debits, in the input asset's smallest unit as an integer string. Null when not recorded."
                },
                "quoteOutputRaw": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d{0,38})$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The verified provider quote's reported output, in the output asset's smallest unit as an integer string. Null when not recorded."
                },
                "settledOutputRaw": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d{0,38})$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The settled output amount the database derived from the verified receipt, in the output asset's smallest unit as an integer string, or null when the leg is not settled or its settlement carried no amount."
                },
                "minimumOutputRaw": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d{0,38})$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The frozen minimum output of an exact-input leg, or null for an exact-output leg or an unrecorded claim."
                },
                "maximumInputRaw": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d{0,38})$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The frozen maximum input of an exact-output leg, or null for an exact-input leg or an unrecorded claim."
                },
                "inputPriceUsd": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 80,
                      "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Enforcement's own trusted USD price per whole input token at plan freeze, or null when unknown. Valuation evidence."
                },
                "outputPriceUsd": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 80,
                      "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Enforcement's own trusted USD price per whole output token at plan freeze, or null when unknown. Valuation evidence."
                },
                "pricesObservedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The oldest trusted market observation time the frozen prices came from, or null when unknown."
                },
                "inputValueUsdAtPlan": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The debit valued at the trusted plan-freeze input price, truncated to cents, or null when the debit or price is unknown. Derived on read, never stored."
                },
                "outputValueUsdAtPlan": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The settled output valued at the trusted plan-freeze output price, truncated to cents, or null when the settled amount or price is unknown. Derived on read, never stored."
                },
                "quoteInputUsd": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 80,
                      "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The provider's own reported USD value of the input: provider-reported, untrusted, display only, or null when absent or malformed."
                },
                "quoteOutputUsd": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 80,
                      "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The provider's own reported USD value of the output: provider-reported, untrusted, display only, or null when absent or malformed."
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                  "description": "When this trade execution leg was claimed."
                },
                "signedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "When this leg signature was durably recorded; null before signing."
                },
                "settledAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "When this leg terminal resolution was recorded, or null while unresolved; inspect its receipt for the resolution kind."
                },
                "receipt": {
                  "anyOf": [
                    {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "approvalId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                              "description": "The approval's id."
                            },
                            "legId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                              "description": "Which leg of the plan this receipt settles."
                            },
                            "index": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 15,
                              "description": "This leg's position within the plan, counting from zero."
                            },
                            "state": {
                              "type": "string",
                              "const": "settled",
                              "description": "The leg settled: its output asset moved as planned."
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "tokenId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256,
                                  "description": "The asset's NEP-141 token id."
                                },
                                "decimals": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 38,
                                  "description": "How many decimal places the token's smallest unit represents."
                                },
                                "amountRaw": {
                                  "description": "The amount, in the token's smallest unit, when it is known.",
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$"
                                }
                              },
                              "required": [
                                "tokenId",
                                "decimals"
                              ],
                              "description": "What the leg produced."
                            }
                          },
                          "required": [
                            "approvalId",
                            "legId",
                            "index",
                            "state",
                            "output"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "approvalId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                              "description": "The approval's id."
                            },
                            "legId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                              "description": "Which leg of the plan this receipt settles."
                            },
                            "index": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 15,
                              "description": "This leg's position within the plan, counting from zero."
                            },
                            "state": {
                              "type": "string",
                              "const": "refunded",
                              "description": "The leg did not settle and its input asset was returned."
                            },
                            "refund": {
                              "type": "object",
                              "properties": {
                                "tokenId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256,
                                  "description": "The asset's NEP-141 token id."
                                },
                                "decimals": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 38,
                                  "description": "How many decimal places the token's smallest unit represents."
                                },
                                "amountRaw": {
                                  "description": "The amount, in the token's smallest unit, when it is known.",
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$"
                                }
                              },
                              "required": [
                                "tokenId",
                                "decimals"
                              ],
                              "description": "What was returned."
                            }
                          },
                          "required": [
                            "approvalId",
                            "legId",
                            "index",
                            "state",
                            "refund"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "approvalId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                              "description": "The approval's id."
                            },
                            "legId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                              "description": "Which leg of the plan this receipt settles."
                            },
                            "index": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 15,
                              "description": "This leg's position within the plan, counting from zero."
                            },
                            "state": {
                              "type": "string",
                              "const": "not_executed",
                              "description": "The leg did not settle. Most reasons mean it never reached the provider; `rejected` means it did and was refused there — see `reason`."
                            },
                            "reason": {
                              "description": "Why nothing executed: `signing_disabled` when automatic signing was off, `signing_failed` when signing itself failed, `rejected` when the provider refused the submission outright (it did reach the provider), `expired` when the leg's own signing/deposit window elapsed before a terminal fact arrived, or `failed` otherwise. Optional so receipts written before the reason was carried still parse.",
                              "type": "string",
                              "enum": [
                                "signing_disabled",
                                "signing_failed",
                                "rejected",
                                "expired",
                                "failed"
                              ]
                            },
                            "unsignedBy": {
                              "description": "Present with `signing_failed` on an Agent API wallet's leg when the NEAR Intents Agent API, the wallet's signer, released no signature for it: it refused the request, or its own history proves it released none. Nothing moved.",
                              "type": "string",
                              "const": "agent_api"
                            }
                          },
                          "required": [
                            "approvalId",
                            "legId",
                            "index",
                            "state"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The complete verified public settlement, refund or non-execution evidence, or null while unresolved."
                },
                "transferPayout": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "rail": {
                          "type": "string",
                          "enum": [
                            "chain",
                            "intents"
                          ],
                          "description": "A native blockchain transfer or a signed transfer within an Intents ledger."
                        },
                        "network": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9-]{0,63}$",
                          "description": "Exact network identifier from wallet capabilities; near-intents and near-intents-confidential are ledgers, not the NEAR blockchain."
                        },
                        "address": {
                          "type": "string",
                          "pattern": "^[\\x21-\\x7e]{1,256}$",
                          "description": "Exact network address, preserving case and any routing metadata encoded in its native address format. Names must be resolved before approval."
                        },
                        "transactionHashes": {
                          "minItems": 1,
                          "maxItems": 16,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^[\\x21-\\x7e]{1,256}$",
                            "description": "Network transaction or ledger intent identifier; opaque and case-sensitive, not necessarily an EVM hash."
                          },
                          "description": "Destination chain transactions, or the funding intent identifiers binding the provider-confirmed ledger payout."
                        },
                        "quotedFeeRaw": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^(0|[1-9]\\d{0,38})$"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Withdrawal fee in destination-asset units from the bound signed quote, or null when not disclosed. Actual received amount is recorded separately."
                        }
                      },
                      "required": [
                        "rail",
                        "network",
                        "address",
                        "transactionHashes",
                        "quotedFeeRaw"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "For a step that paid an address the user approved: where the payout landed and its transaction ids, as a withdrawal's receipt shows them. `null` for a swap, a payout to the user's main wallet, a step that has not settled, or an older trade."
                },
                "intentHashes": {
                  "maxItems": 16,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[\\x21-\\x7e]{1,256}$",
                    "description": "Network transaction or ledger intent identifier; opaque and case-sensitive, not necessarily an EVM hash."
                  },
                  "description": "The NEAR Intents ids of the intents that carried out this step, as 1Click reported them when it settled. Quote one to support to trace the step. They are on the confidential NEAR Intents ledger, which no public explorer shows. Empty until the step settles, and for a step that was refunded or did not run."
                },
                "refundReason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Z][A-Z0-9_]{0,63}$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "When the step was refunded, 1Click's own code for why, such as `NO_LIQUIDITY` or `AMOUNT_LESS_THAN_MIN_AMOUNT_OUT`; `null` when it gave none, for any other step, and for a step refunded before Fin kept this. Show it, don't branch on it: 1Click may add codes."
                }
              },
              "required": [
                "id",
                "index",
                "state",
                "inputToken",
                "outputToken",
                "debitRaw",
                "quoteOutputRaw",
                "settledOutputRaw",
                "minimumOutputRaw",
                "maximumInputRaw",
                "inputPriceUsd",
                "outputPriceUsd",
                "pricesObservedAt",
                "inputValueUsdAtPlan",
                "outputValueUsdAtPlan",
                "quoteInputUsd",
                "quoteOutputUsd",
                "createdAt",
                "signedAt",
                "settledAt",
                "receipt",
                "transferPayout",
                "intentHashes",
                "refundReason"
              ]
            },
            "description": "The steps that actually ran, in plan order, each with its amounts and receipt. A planned step that never started has no entry."
          }
        },
        "required": [
          "id",
          "source",
          "request",
          "approval",
          "status",
          "failureReason",
          "outcome",
          "createdAt",
          "startedAt",
          "reportedAt",
          "plan",
          "legs"
        ],
        "description": "A trade the agent made or proposed from the agent wallet: what it asked for, who approved it, its `status`, and the plan it ran and the result of each step as evidence."
      },
      "SolanaOperationDetail": {
        "type": "object",
        "properties": {
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell",
              "fund",
              "withdraw"
            ],
            "description": "Which Solana operation this is: a buy, a sell, a fund or a withdrawal."
          },
          "token": {
            "description": "The token bought or sold; absent for a fund or a withdrawal.",
            "$ref": "#/components/schemas/SolanaToken"
          },
          "account": {
            "type": "string",
            "minLength": 32,
            "maxLength": 44,
            "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
            "description": "The agent's own Solana account the operation used."
          },
          "transactions": {
            "maxItems": 6,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "purpose": {
                  "type": "string",
                  "enum": [
                    "swap",
                    "sweep"
                  ],
                  "description": "`swap` trades on Jupiter; `sweep` sends SOL back to the agent wallet through 1Click."
                },
                "signature": {
                  "type": "string",
                  "minLength": 64,
                  "maxLength": 88,
                  "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                  "description": "A Solana transaction signature, which is also its id: base58 text of 64 bytes."
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "signed",
                    "dispatching",
                    "landed",
                    "failed",
                    "expired",
                    "uncertain"
                  ],
                  "description": "`signed` and `dispatching` are not yet sent or not yet seen; `landed` succeeded on chain, `failed` landed with an error, `expired` provably never will; `uncertain` is not yet known: never sign it again."
                },
                "feeLamports": {
                  "description": "The network fee the transaction paid, in lamports, once it landed.",
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,38})$"
                }
              },
              "required": [
                "purpose",
                "signature",
                "state"
              ],
              "description": "One signed Solana transaction of this operation."
            },
            "description": "Every transaction the operation signed, in the order it signed them. A multi-coin sale lists here only its one transfer back: each coin's swaps are under its own entry of `sales`."
          },
          "paid": {
            "description": "What the operation spent, once known.",
            "type": "object",
            "properties": {
              "asset": {
                "type": "string",
                "enum": [
                  "usdc",
                  "sol",
                  "token"
                ],
                "description": "`usdc` is the stablecoin a buy or fund paid (one USDC or USDT holding of the agent wallet, counted one raw unit for one) or the USDC on NEAR a sale or withdrawal returned, `sol` is SOL, `token` is the operation's own token."
              },
              "amountRaw": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "The exact amount, in the asset's smallest unit."
              }
            },
            "required": [
              "asset",
              "amountRaw"
            ]
          },
          "received": {
            "description": "What the operation received, once it landed or settled.",
            "type": "object",
            "properties": {
              "asset": {
                "type": "string",
                "enum": [
                  "usdc",
                  "sol",
                  "token"
                ],
                "description": "`usdc` is the stablecoin a buy or fund paid (one USDC or USDT holding of the agent wallet, counted one raw unit for one) or the USDC on NEAR a sale or withdrawal returned, `sol` is SOL, `token` is the operation's own token."
              },
              "amountRaw": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "The exact amount, in the asset's smallest unit."
              }
            },
            "required": [
              "asset",
              "amountRaw"
            ]
          },
          "solLeftLamports": {
            "description": "SOL the operation left in the Solana account, in lamports: what a partial outcome left behind.",
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$"
          },
          "sales": {
            "description": "Present only on a multi-coin sale's outcome: each sale in the order it ran. `received` is what the whole sale returned.",
            "maxItems": 6,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "token": {
                  "description": "The coin this sale sold, or was to sell.",
                  "$ref": "#/components/schemas/SolanaToken"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "sold",
                    "not_sold",
                    "uncertain"
                  ],
                  "description": "`sold` once its swap landed; `not_sold` when it ended without selling anything (refused before any signature, every attempt failed or expired, or the sale stopped before it); `uncertain` while an attempt of it may still land: never sign it again."
                },
                "paid": {
                  "description": "What this sale sold, once its swap landed: the token's exact amount.",
                  "type": "object",
                  "properties": {
                    "asset": {
                      "type": "string",
                      "enum": [
                        "usdc",
                        "sol",
                        "token"
                      ],
                      "description": "`usdc` is the stablecoin a buy or fund paid (one USDC or USDT holding of the agent wallet, counted one raw unit for one) or the USDC on NEAR a sale or withdrawal returned, `sol` is SOL, `token` is the operation's own token."
                    },
                    "amountRaw": {
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d{0,38})$",
                      "description": "The exact amount, in the asset's smallest unit."
                    }
                  },
                  "required": [
                    "asset",
                    "amountRaw"
                  ]
                },
                "solGainedLamports": {
                  "description": "The SOL this sale's landed swap added to the Solana account, in lamports, before the one transfer back.",
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,38})$"
                },
                "transactions": {
                  "description": "This coin's swap attempts the sale signed, in the order it signed them; absent while none was signed.",
                  "maxItems": 3,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "purpose": {
                        "type": "string",
                        "enum": [
                          "swap",
                          "sweep"
                        ],
                        "description": "`swap` trades on Jupiter; `sweep` sends SOL back to the agent wallet through 1Click."
                      },
                      "signature": {
                        "type": "string",
                        "minLength": 64,
                        "maxLength": 88,
                        "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                        "description": "A Solana transaction signature, which is also its id: base58 text of 64 bytes."
                      },
                      "state": {
                        "type": "string",
                        "enum": [
                          "signed",
                          "dispatching",
                          "landed",
                          "failed",
                          "expired",
                          "uncertain"
                        ],
                        "description": "`signed` and `dispatching` are not yet sent or not yet seen; `landed` succeeded on chain, `failed` landed with an error, `expired` provably never will; `uncertain` is not yet known: never sign it again."
                      },
                      "feeLamports": {
                        "description": "The network fee the transaction paid, in lamports, once it landed.",
                        "type": "string",
                        "pattern": "^(0|[1-9]\\d{0,38})$"
                      }
                    },
                    "required": [
                      "purpose",
                      "signature",
                      "state"
                    ],
                    "description": "One signed Solana transaction of this operation."
                  }
                }
              },
              "required": [
                "token",
                "state"
              ],
              "description": "One coin of a multi-coin sale, and what became of it."
            }
          }
        },
        "required": [
          "side",
          "account",
          "transactions"
        ],
        "description": "What one Solana operation did on chain."
      },
      "SolanaToken": {
        "type": "object",
        "properties": {
          "mint": {
            "type": "string",
            "minLength": 32,
            "maxLength": 44,
            "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
            "description": "The token's mint address, exactly as solana_token_search or solana_token returned it. Never a ticker."
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18,
            "description": "The mint's decimals, exactly as returned with the mint."
          },
          "tokenProgram": {
            "type": "string",
            "enum": [
              "spl_token",
              "token_2022"
            ],
            "description": "The program that owns the mint, exactly as returned with the mint: `spl_token` or `token_2022`."
          }
        },
        "required": [
          "mint",
          "decimals",
          "tokenProgram"
        ],
        "description": "One Solana token, pinned by its mint, its decimals and its token program."
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The kind of problem as a URN, `urn:fin:error:<kind>`; stable, compare against it"
          },
          "title": {
            "type": "string",
            "description": "The kind's human title, for logs; never parse it"
          },
          "status": {
            "type": "integer",
            "minimum": 400,
            "maximum": 599,
            "description": "The HTTP status, repeated in the body"
          },
          "reason": {
            "description": "The machine-readable why. One of:\n\n- `run_active` (409) — a run already holds this conversation\n- `budget_exhausted` (429) — the user's AI usage budget, or your partner account's AI spend limit, is used up until the next day or month, or an operator froze it\n- `approval_not_pending` (409) — the approval was already decided or has expired, or its id does not exist or belongs to a different conversation\n- `execution_capacity` (429) — no capacity is free to run this right now; honour `Retry-After`\n- `execution_unavailable` (503) — the service that runs the agent could not take the work; `retryable` says whether to try again\n- `stop_pending` (409) — a stop is already in progress and its cleanup is not yet confirmed\n- `automation_changed` (409) — the automation changed while this request was handled; read it again and retry\n- `automation_held` (409) — an operator holds the automation; it fires again when released\n- `automation_invalid` (409) — the automation's definition cannot run as written\n- `automation_paused` (409) — the automation is paused; resume it first\n- `automation_has_no_webhook` (409) — the automation does not run on incoming events, so it has no webhook\n- `automation_limit` (409) — the user already has as many automations as the deployment allows\n- `profile_unknown_tool` (400) — `profile.tools` names a tool this deployment does not have\n- `deployment_paused` (503) — an operator paused this kind of work for the deployment; try again later\n- `run_not_active` (409) — the run named in the path is not the conversation's live run\n- `withdrawal_changed` (409) — the request key already binds different withdrawal terms, or the current balance cannot cover the requested amount\n- `swap_changed` (409) — the swap cannot be made as asked: an asset is no longer available or the current balance cannot cover the amount; get a new quote\n- `order_changed` (409) — the order can no longer be placed as prepared: the agent wallet no longer holds the amount, an asset is no longer offered, or its minimum no longer matches the assets' precision; prepare it again\n- `prediction_order_changed` (409) — the Polymarket order can no longer be placed as signed: the market closed or stopped taking orders, its price is off the market's tick or its size off Polymarket's minimum, its fee or cost would exceed the signed caps, the Polymarket account cannot cover it, or the signature lapsed before it was placed. Nothing was placed; prepare it again\n- `solana_trade_changed` (409) — the Solana trade can no longer run as signed: the token's decimals or program changed, the agent's Solana account or holdings no longer fit it, another Solana trade is running, or the signature lapsed before it started. Nothing moved; prepare it again\n- `trade_not_recoverable` (409) — the original trade or a recovery attempt remains active or uncertain, its unfinished actions lack conclusive recovery proof, or its remaining proposal can no longer be used\n- `order_not_cancelable` (409) — the limit order can no longer be cancelled: it filled or expired, or the swap provider never took it. Read the order for where it stands\n- `grid_not_active` (409) — the grid is not running, so it cannot be paused: it is already paused, stopping or ended. Read the grid for where it stands\n- `grid_not_paused` (409) — the grid is not paused, so there is nothing to resume. Read the grid for where it stands\n- `suggestion_changed` (409) — the suggestion no longer holds: the account or the market moved since fin made it, the user set it aside, or it cannot be made where the user is now. Say it changed, and read the page's suggestions again\n- `request_key_conflict` (409) — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request\n- `question_not_pending` (409) — the questionnaire has already been answered, closed, or is not awaiting this submission\n- `flag_changed` (409) — the flag's targeting changed since you read it; read it again and retry\n- `group_changed` (409) — the group changed or was deleted since you read it; read it again and retry\n- `group_in_use` (409) — a flag's rules still name this group; take it out of those rules first\n- `group_name_taken` (409) — another group already has this name\n- `agent_wallet_required` (409) — create the agent wallet before opening a perps, prediction-market or Solana account\n- `wallet_account_unsupported` (409) — the user's wallet is an Agent API wallet, whose Intents account is a 0x address this route cannot name; read it with Get wallet account, Get wallet account balances and Open a wallet account session instead\n- `conversation_deleted` (410) — the conversation was deleted; its history stays readable\n- `automation_deleted` (410) — the automation was deleted\n- `grid_ended` (410) — the grid stopped, expired or failed; it stays readable but takes no command. A new grid needs the user's approval in chat\n- `credential_expired` (401) — the user token has expired; obtain a fresh one\n- `account_disabled` (403) — an operator disabled the account\n- `perps_disabled` (403) — perps is not enabled for this user\n- `prediction_disabled` (403) — prediction-market trading is not enabled for this user\n- `solana_disabled` (403) — Solana trading is not enabled for this user\n- `no_account` (404) — the user has not opened the account this call reads; open it first\n- `not_available_in_region` (403) — perps funding is unavailable in the user's region for this request; withdrawals remain available\n- `steering_disabled` (403) — steering a working run is not turned on for this user; send the message with Start a run once the run ends\n- `baskets_disabled` (403) — idea baskets are not turned on for this user; hide the Ideas pages and their baskets\n- `basket_buying` (409) — the basket is still buying, so it cannot be deleted yet; try again once its result is in\n- `basket_awaiting_approval` (409) — an approval to buy this basket is still open; decline it in the chat, then delete the basket\n- `basket_step_not_failed` (409) — the step bought, or the basket is not partly bought, so no order can be linked to it; read the basket again\n- `basket_step_linked` (409) — another order is already linked to this step; a link is permanent, so read the basket again\n- `basket_order_not_linkable` (400) — the order cannot stand in for this step: it is not one of the step's `failures[].linkable` orders, or another basket step already holds it\n- `voice_disabled` (403) — voice input is not turned on for this user; let them type instead\n- `voice_unavailable` (503) — this deployment has no speech model, so it cannot transcribe recordings; let the user type instead\n- `provider_unavailable` (503) — an external provider the call depends on did not answer\n- `quote_refused` (400) — 1Click would not quote this request, usually an amount below what it routes or a pair it does not offer; nothing was reserved. Change the amount or the assets and quote again; for a deposit address, no address was issued, so offer another network\n- `invalid_input` (400) — the body or query failed validation; `issues` names each field\n- `internal` (500) — a fault on our side; quote `requestId` when reporting it\n- `partner_key_required` (401) — no `X-Api-Key` header was sent\n- `partner_key_invalid` (401) — the `X-Api-Key` is unknown or revoked\n- `subject_mismatch` (403) — the `{userId}` in the path is not the token's user\n- `origin_rejected` (403) — a browser `Origin` other than the configured web origin\n- `permission_required` (403) — the verified credential is not permitted to make this call\n- `signature_required` (403) — creating the agent wallet needs the user's signature: send the user's signature of `creation.message` from Get the agent wallet as `authorization`\n- `asset_not_withdrawable` (403) — tokenized stocks cannot be withdrawn; sell them first\n- `asset_not_swappable` (403) — the swap names an asset this user cannot buy or trade with this request: a tokenized stock with no `context.country`, or one where tokenized stocks are not available, or bought while buying them is not enabled for the user; or a yield vault's share token bought while the user's `earn` flag is off\n- `asset_not_tradable` (403) — the order names an asset this user cannot buy or trade with this request: a tokenized stock with no `context.country`, or one where tokenized stocks are not available, or bought while buying them is not enabled for the user; or a yield vault's share token bought while the user's `earn` flag is off\n- `solana_token_not_tradable` (403) — Fin won't trade this token: its mint lets someone freeze, move or charge for holdings or pause transfers, it can't be sold back, Fin couldn't read its mint, it has no reliable price, or it is wrapped SOL. A sale is refused only for what would stop it landing\n- `limit_orders_disabled` (403) — limit orders are not enabled for this user\n- `grid_trading_disabled` (403) — grid trading is not enabled for this user, so a paused grid cannot be resumed; pausing and cancelling a grid are never gated\n- `deposit_limit_exceeded` (429) — the deposit would take the agent wallet past the user's deposit limit, or, for a deposit address, the wallet has no room left under it; nothing was recorded. Read `depositLimit.availableCents` from Get balances for how much fits now, and deposit no more than that\n- `policy_change_throttled` (429) — the user's Agent API wallet changed what it allows a few minutes ago, and the NEAR Intents Agent API lets it change again only after a cooldown; nothing was asked or signed, so call again once `Retry-After` has passed\n- `agent_slippage_exceeded` (403) — the user's wallet is an Agent API wallet whose agent signs only trades that lose at most the share of their value its owner allowed (`max_slippage_bps`): fees, price and slippage together, by 1Click's own USD values at the quote's minimum output. This trade's quote loses more, states no USD value, or, before there is a quote, its loss bound is already quoted with more slippage than that (half the bound, plus 1Click's fee at the most it has been seen to take, 20 basis points, before an approval). Very small trades lose more to fixed fees; nothing was signed, so ask again with a larger amount or a smaller loss bound\n- `agent_api_orders_unavailable` (403) — the user's Agent API wallet needs wallet setup to enable limit orders, or the order exceeds this wallet's 168-hour maximum; finish wallet setup or choose at most 168 hours before trying again; nothing was approved or signed\n- `destination_not_allowed` (403) — the user's wallet is an Agent API wallet, whose agent pays a deposit only to itself, to a NEAR Intents account its owner listed (on the confidential ledger) or to an address on a chain its owner listed; allow this one with Add a withdrawal destination (one owner signature), then ask again. A public NEAR Intents account, or an address with no valid spelling on its chain, cannot be paid at all; nothing was signed\n- `rate_limited` (429) — the per-key or per-user limit is spent; honour `Retry-After`\n- `partner_request_capacity` (429) — this partner's request quota across all keys and replicas is spent; honour Retry-After\n- `partner_run_capacity` (429) — this partner's active run quota is full; honour Retry-After and reuse the same request identity\n- `stream_capacity` (429) — the partner, user or replica has no free stream capacity; honour `Retry-After`\n- `invalid_cursor` (400) — the `cursor` is not one this list minted\n- `invalid_question_answer` (400) — the questionnaire answer does not match its questions or allowed choices\n- `question_closed` (410) — the questionnaire expired or was cancelled\n- `unknown_target` (400) — a rule names a partner, group or user that does not exist, or a user outside the partners the same rule names\n- `scope_invalid` (400) — a subject in the scope is not a subject id, or appears twice\n- `subject_unsupported` (404) — a subject in the scope is not one market briefs cover; list them with List market subjects\n- `brief_not_found` (404) — no market brief job with this id was created with your partner key\n- `briefs_busy` (429) — your market briefs are at their limit of briefs generating at once; retry after `Retry-After`\n- `market_briefs_disabled` (403) — market briefs are not turned on for your partner key\n- `story_not_found` (404) — no market story with this id is current: it never was one, or Fin no longer shows it because its sources were withdrawn or its figures can no longer be read",
            "type": "string",
            "enum": [
              "run_active",
              "budget_exhausted",
              "approval_not_pending",
              "execution_capacity",
              "execution_unavailable",
              "stop_pending",
              "automation_changed",
              "automation_held",
              "automation_invalid",
              "automation_paused",
              "automation_has_no_webhook",
              "automation_limit",
              "profile_unknown_tool",
              "deployment_paused",
              "run_not_active",
              "withdrawal_changed",
              "swap_changed",
              "order_changed",
              "prediction_order_changed",
              "solana_trade_changed",
              "trade_not_recoverable",
              "order_not_cancelable",
              "grid_not_active",
              "grid_not_paused",
              "suggestion_changed",
              "request_key_conflict",
              "question_not_pending",
              "flag_changed",
              "group_changed",
              "group_in_use",
              "group_name_taken",
              "agent_wallet_required",
              "wallet_account_unsupported",
              "conversation_deleted",
              "automation_deleted",
              "grid_ended",
              "credential_expired",
              "account_disabled",
              "perps_disabled",
              "prediction_disabled",
              "solana_disabled",
              "no_account",
              "not_available_in_region",
              "steering_disabled",
              "baskets_disabled",
              "basket_buying",
              "basket_awaiting_approval",
              "basket_step_not_failed",
              "basket_step_linked",
              "basket_order_not_linkable",
              "voice_disabled",
              "voice_unavailable",
              "provider_unavailable",
              "quote_refused",
              "invalid_input",
              "internal",
              "partner_key_required",
              "partner_key_invalid",
              "subject_mismatch",
              "origin_rejected",
              "permission_required",
              "signature_required",
              "asset_not_withdrawable",
              "asset_not_swappable",
              "asset_not_tradable",
              "solana_token_not_tradable",
              "limit_orders_disabled",
              "grid_trading_disabled",
              "deposit_limit_exceeded",
              "policy_change_throttled",
              "agent_slippage_exceeded",
              "agent_api_orders_unavailable",
              "destination_not_allowed",
              "rate_limited",
              "partner_request_capacity",
              "partner_run_capacity",
              "stream_capacity",
              "invalid_cursor",
              "invalid_question_answer",
              "question_closed",
              "unknown_target",
              "scope_invalid",
              "subject_unsupported",
              "brief_not_found",
              "briefs_busy",
              "market_briefs_disabled",
              "story_not_found"
            ]
          },
          "requestId": {
            "type": "string",
            "description": "The id Fin used for this request; quote it when reporting a problem"
          },
          "retryable": {
            "type": "boolean",
            "description": "Whether repeating the same request later can succeed without changing it"
          },
          "detail": {
            "description": "Only on `invalid_input`: which part of the request failed validation",
            "type": "string"
          },
          "issues": {
            "description": "Only on `invalid_input`: one entry per failing field",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "description": "The JSON pointer of the failing field; empty for the root object"
                },
                "message": {
                  "type": "string",
                  "description": "Why the field failed"
                }
              },
              "required": [
                "path",
                "message"
              ]
            }
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "requestId",
          "retryable"
        ],
        "description": "RFC 9457 problem details: what every error response carries. Never a provider's message, a query or a stack."
      }
    },
    "responses": {
      "InvalidInput": {
        "description": "The request could not be read as this operation expects.\n\n- `invalid_input` — the body or query failed validation; `issues` names each field\n- `invalid_cursor` — the `cursor` is not one this list minted",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "A credential is missing, invalid or expired.\n\n- `partner_key_required` — no `X-Api-Key` header was sent\n- `partner_key_invalid` — the `X-Api-Key` is unknown or revoked\n- `credential_expired` — the user token has expired; obtain a fresh one",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The credentials are valid but may not do this.\n\n- `subject_mismatch` — the `{userId}` in the path is not the token's user\n- `account_disabled` — an operator disabled the account\n- `origin_rejected` — a browser `Origin` other than the configured web origin\n- `permission_required` — the verified credential is not permitted to make this call",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "NotFound": {
        "description": "The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "A limit refused the request; wait for `Retry-After` when it is sent.\n\n- `rate_limited` — the per-key or per-user limit is spent; honour `Retry-After`\n- `partner_request_capacity` — this partner's request quota across all keys and replicas is spent; honour Retry-After",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Internal": {
        "description": "A fault on our side; quote `requestId` when reporting it.\n\n- `internal` — a fault on our side; quote `requestId` when reporting it",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Unavailable": {
        "description": "The service cannot take this right now (draining, a dependency did not answer, or an operator paused the work); `retryable` says whether to try again.\n\n- `internal` — a fault on our side; quote `requestId` when reporting it",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key"
      },
      "userToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "fin_session_<opaque>",
        "description": "A user's session token, from Create a session."
      }
    }
  }
}
```

