{
  "openapi": "3.1.0",
  "info": {
    "title": "Fin API",
    "version": "19.19.0",
    "description": "Fin's API lets your backend give each of your users an AI agent: create the user, sign them\nin, send the agent messages and follow what it does. The agent can hold funds in its own\nwallet and trade, but only with the user's signed approval. Start with the\n[quickstart](/quickstart).\n\n## Base URL\n\nUse the API origin your deployment operator gives you, and append each operation's path to it:\n\n```text\nhttps://{your-deployment}\n```\n\nCreating a user, for example, is `POST /v1/users`. Paths about one user start with their id,\nyour own `userId`, as in `GET /v1/users/{userId}/runs`. The documentation site is a separate\norigin and does not serve API requests.\n\n## Authentication\n\nEvery request carries your API key. Requests about a user also carry that user's session\ntoken:\n\n| Header | What it is |\n| --- | --- |\n| `X-Api-Key: fin_…` | Your API key. Identifies your app. Keep it on your server. |\n| `Authorization: Bearer fin_session_…` | A user's session token, from [Create a session](/api-reference/users/create-session). |\n\nA few calls need only the API key: Create a user, Start wallet sign-in, Create a session, Get\nyour AI usage and Get your rate limits.\n\n### API keys\n\nYour deployment operator issues your keys. A key is shown once, when it is created, and can\ncarry an expiry. To rotate one, get a new key, switch your backend to it, then have the old\none revoked; a revoked key can keep working for up to 30 seconds. Never put an API key in\nbrowser code, a URL or a public repository.\n\n### Sign a user in\n\nCreate the user once with [Create a user](/api-reference/users/create) (`POST /v1/users`,\nbody `{userId, name}`). Then open a session for them whenever they use your app, in one of two\nways:\n\n- **Your app has its own login.** After your login verifies the user, call\n  `POST /v1/users/{userId}/sessions` with `{\"controller\": …}`: the wallet or passkey they signed\n  in with. Your API key vouches for them, so they sign nothing extra.\n- **Your app has no login.** Call [Start wallet sign-in](/api-reference/users/session-challenge)\n  for the user's wallet, have them sign the returned `message` exactly as it is, and send\n  `{challengeId, signature}` to `POST /v1/users/{userId}/sessions`.\n\nEither way you get a `token`. Sessions last one hour and cannot be refreshed. A request with an\nexpired token answers `401` with reason `credential_expired`: create another session the same\nway. A `401` with no reason means the token was revoked or was never valid. Revoke the session\nwhen the user logs out of your app. Logging out deletes nothing and does not stop work already\nstarted.\n\nThe first session registers the user's wallet (their *controller*) for good. Every later\nsession must name the same wallet, and that wallet signs everything that moves money. Only\nvouch for users your login has really verified, with the wallet they really used.\n\nIf your app proxies browser requests, allow only the user operations the browser needs,\nrequire its verified session, and bind any `{userId}` path to that session. Never attach\nyour API key to arbitrary browser-selected Fin paths: even a signed-in user must not call\npartner-only enrollment, session issuance, provider-session or partner usage operations.\nProvision and vouch inside your trusted login handler, deriving the user and controller\nfrom the login it verified rather than from a browser-supplied identity.\n\n### Supported wallets\n\n| Wallet | `controller` | `signature` | How the wallet signs |\n| --- | --- | --- | --- |\n| EVM | `{kind: \"evm\", chainId, address}` | `{kind: \"evm\", signature}` (0x, 65 bytes) | ERC-191 personal message signing |\n| NEAR | `{kind: \"near\", accountId}` | `{kind: \"near\", publicKey, signature, nonce}` | NEP-413 `signMessage({message, recipient, nonce})` with the `recipient` the API returns and 32 random bytes as `nonce` |\n| Solana | `{kind: \"solana\", address}` | `{kind: \"solana\", signature}` | `signMessage` over the UTF-8 bytes |\n| Stellar | `{kind: \"stellar\", address}` | `{kind: \"stellar\", signature}` | SEP-53 message signing |\n| TON | `{kind: \"ton\", publicKey}` | `{kind: \"ton\", signature, address, domain, timestamp}` | TON Connect `signData({type: \"text\", text: message})`, `domain` one of your registered origins' hosts |\n| Tron | `{kind: \"tron\", address}` | `{kind: \"tron\", signature}` (0x, 65 bytes) | TIP-191 `signMessageV2` |\n| Passkey | `{kind: \"webauthn\", credentialId, publicKey, rpId, origin}` | the WebAuthn assertion | a P-256 or Ed25519 assertion whose challenge is the SHA-256 of the message |\n\nEd25519 signatures are 64 bytes in padded standard base64. A NEAR account must sign with one of\nits current full-access keys. A passkey must belong to one of your registered origins.\n\n### Security model\n\nThree things authorize three different kinds of action:\n\n| Credential | Lets you | Cannot |\n| --- | --- | --- |\n| API key | Create users, open sessions, read your usage | Read or act for a user without their session |\n| Session token | Everything a signed-in user can do: chat, start and cancel runs, read history, manage automations | Move money or create the agent wallet |\n| The user's signature | Create the agent wallet, withdraw, swap, place a limit order, approve a trade | Anything other than the one request it signs |\n| An agent 1Click session, from [Get a 1Click session](/api-reference/wallets/create-session) | Read the agent wallet at 1Click: balances, history and orders; cancel its open orders | Move funds: every withdrawal, swap, order and trade still needs the user's signature |\n\nMoney only moves with the user's signature over that exact request, or within limits the user\nsigned for an automation ahead of time. The API gives you the message to sign each time; show\nthe user what it covers before they sign. A signature is valid for about five minutes and works\nonce.\n\nKeep the API key and session tokens on your server (or in HttpOnly cookies) and proxy browser\nrequests through your backend; never put them in browser JavaScript, URLs or local storage.\nThe same goes for an agent's 1Click tokens. Fin cannot revoke those once it has issued them:\neach lasts until its `refreshTokenExpiresAt`, so delete them when the user signs out.\nFin never calls your servers, so read a resource again (or follow the event stream) to see\nchanges, with a live session.\n\n## Quickstart\n\nFollow [the quickstart](/quickstart) to create a user, sign them in and get the agent's first\nreply.\n\n## Pagination\n\nLists take `limit` and `cursor` and answer `{ data, nextCursor }`, plus `total` where the\noperation says so. Pass `nextCursor` back as `cursor` to get the next page; `null` means you\nhave reached the end for now. Keep the other query parameters the same while paging.\n\nMost lists are newest first. A conversation's events are oldest first, so you can replay\nthem in order.\n\n## Idempotency\n\nCommands that create something take an `Idempotency-Key` header: a UUID you generate and\nkeep for that request. If a response is lost, send the same request again with the same key\nand the same body; you get the original result back and nothing happens twice. The same key\nwith a different body is refused with `409 request_key_conflict`.\n\n| Operation | `Idempotency-Key` |\n| --- | --- |\n| Create a deposit, Create a deposit address, Withdraw funds, Swap tokens, Place an order | Required. For a withdrawal or a swap, use the `requestKey` from the quote; for an order, the one from Prepare an order. |\n| Create a conversation, Start a run | Optional, but without it a retry creates a second one. |\n\nCreate a user and Create the agent wallet need no key: they return the existing user or wallet.\nGet a 1Click session needs none either: every call is a separate session, and one lost on its\nway to you simply expires unused. Report a deposit transaction records nothing, so a repeat is\nsafe.\nApproving or denying is a single decision; a repeat answers `409 approval_not_pending`.\n\nAfter a lost money response, find what happened before trying again: list deposits or\nwithdrawals with `requestKey=<your key>`. Never retry money requests automatically with a new\nkey.\n\n## Rate limits\n\nAll your API keys share one set of limits: by default 600 requests a minute, 32 runs in\nprogress and 32 open event streams (4 per user), plus daily and monthly AI spend. Read yours\nwith [Get your rate limits](/api-reference/partner/quotas).\n\nWhen a limit is reached the API answers `429` with a `reason` and, when it can tell,\na `Retry-After` header. Wait and retry the same request. See\n[Usage and limits](/usage-and-quotas) for the details.\n\n## Versioning\n\nThis is version 7 of the API, served under `/v1`. Responses can gain new fields at any time,\nso ignore fields you don't recognise. Request bodies are strict: an unknown field is refused.\nEnums are closed: a value that isn't documented is a bug to report, and a new value only ships\nwith a new API version.\n\nNothing you rely on disappears without notice. An operation or an enum value that is going away\nis announced in this reference at least 30 days ahead: the operation is marked deprecated and\nsays the date after which it is removed, and what to use instead; a value is named, with its\ndate, on the schema it belongs to. The full list is `x-fin-retirements` in\n[`/openapi.json`](/openapi.json). Any other breaking change ships as a new API version with a\nlist of what changed.\n\nSend `X-Request-Id` (8–64 characters of `[A-Za-z0-9._-]`) to trace a request; the response\nechoes the id Fin used. Quote it when you report a problem.\n\nSend `X-End-User-IP` and `X-End-User-Agent` with each request to say who is on the other end:\nthe address and user agent your own server saw for the person using your app. Fin records them\nbeside the request so that a security question about an account can be answered later, and\nuses them for nothing else — not rate limits, sign-in or any decision. Both are optional; an\naddress that is not a valid IPv4 or IPv6 address is ignored, and the user agent is kept up to 512\ncharacters. Send what your server observed, never a value your client supplied. With the SDK, pass\n`endUser: { ip, userAgent }` in each call's options ([call options](/sdk-reference#call-options)).\n\n## Errors\n\nEvery failure is an RFC 9457 problem (`application/problem+json`). `type` names the kind,\n`reason` is the machine-readable why, `retryable` says whether repeating the same request\ncan succeed, and `requestId` is what to quote. A resource that belongs to someone else\nanswers exactly like a missing one.\n\n```json\n{ \"type\": \"urn:fin:error:conflict\", \"title\": \"Conflict\", \"status\": 409,\n  \"reason\": \"run_active\", \"requestId\": \"0192…\", \"retryable\": false }\n```\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- `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- `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- `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- `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\n\n## Events\n\nThe journal and the stream carry one shape. On the stream, `id` is the journal `seq`,\n`event` is the type below, and `data` is a `{ delivery, seq, payload }` frame; resume with\n`Last-Event-ID` or `?cursor=`.\n\n- `run.started` — Opens a new run: the engine admitted it and is about to process the input, whether an ordinary turn or an automation firing. Emitted once, at admission — a run resumed after an approval does not get a second one. `run.ended` closes what this event opened.\n- `run.ended` — The root run reached a terminal state: completed, failed or aborted. Its runId is the same as run.started and every pause/resume. Waiting for approval emits run.paused instead. Accounting includes all continuation segments.\n- `run.paused` — The run is waiting for human input or approval. Its identity and original request remain unchanged.\n- `run.resumed` — An approval decision resumed the same root run. No new instruction or run identity was created.\n- `run.steered` — The agent read a message the user sent while the run was working (Steer a run). Emitted at the agent's next step, before its next reply, so it lands in the conversation where the agent saw it; `steerId` matches the run's `steers` entry. Several messages sent within one step each get their own event, in the order sent. The same run continues; a message the run ended before reading never gets one.\n- `agent.entry` — One durable message in the conversation: the user's message, the assistant's completed reply, or a tool's display text once it resolves. Streaming assistant text arrives first as `agent.text_delta` and lands here only when the turn completes.\n- `agent.text_delta` — A chunk of the assistant's reply while it is still generating. Delivered live only — never written to the durable journal or replayed on reconnect — and superseded by the complete text in the `agent.entry` that follows.\n- `tool.call` — The assistant asked to call a tool. Emitted once the call is committed to the conversation, before it runs; `approval.opened` follows if a human must decide first, otherwise the call proceeds straight to `tool.result`.\n- `tool.result` — One tool call resolved: `outcome` says what happened (completed, denied, parked for approval, or failed). Immediately followed by an `agent.entry` (role `tool`) carrying that outcome's own display text.\n- `approval.opened` — A tool call is parked, waiting on a human decision. Carries the terms the approval card renders: the call's input, a summary, and the authorization contract in effect, if any. `approval.decided` or `approval.expired` closes it.\n- `approval.decided` — The user, or a partner integration, approved or denied a parked approval. `approve` says which way; a denial may carry `reason`. Consuming the decision to execute the tool follows as `approval.consumed`, but only when the decision was an approval — a denial never reaches consumption.\n- `question.opened` — A questionnaire is waiting for the user. Its full content is durable and replayable.\n- `question.answered` — The user answered or skipped a questionnaire; its accepted result is durable.\n- `question.closed` — A pending questionnaire expired or was cancelled.\n- `approval.consumed` — The approval was spent to authorize its tool call, immediately before that call runs. This is when the call is authorized, not when it finishes: the call can still fail after this event lands, and nothing here rolls it back. Marks the approval used; it cannot authorize a second execution.\n- `approval.expired` — A parked approval lapsed before anyone decided: its deadline passed, or the run it belongs to stopped while it was still pending.\n- `automation.fired` — An automation triggered this conversation's run. Emitted once, immediately before the `run.started` it precedes, naming the automation and its name at fire time.\n- `intents.settlement` — A later, independently verified financial fact about one leg of an authorized swap — settled, refunded, or never executed — never inferred from the model's own tool result. Appended whenever the provider confirms the outcome, independent of the run that requested it; `legId` and `operationId` join it back to its financial request, progress and authorizing approval. Archived receipts retain their original `occurrenceId`.\n- `intents.progress` — Best-effort, display-only progress for an authorized swap, between approval and its settlement receipt: freezing the plan (`planning`), the frozen legs (`planned`), then each leg's own stage (`stage`). Never gates execution and may arrive out of order or not at all; an `intents.settlement` receipt always takes precedence, and a terminal outcome is never reported here.\n- `perps.reconciled` — A later, independently verified answer to an approved perps order, cancellation or withdrawal whose own `tool.result` was left unconfirmed — never inferred from the model's own tool result. Appended once, by recovery, in the same commit that records the request's final outcome, independent of the run that made the call; `callId` joins it to that call's `tool.result`, `approvalId` to its approval, and `operationId` to its financial request. `result` has the shape the tool itself returns; show it in place of the call's earlier unconfirmed result.\n- `prediction.funding` — Recovery's latest view of an approved `prediction_fund` call, appended whenever it changes, independent of the run that made the call: the first leg's verified 1Click outcome (native Base USDC delivered to Polymarket's bridge, refunded, or not executed) and every transaction the bridge reports at the pinned deposit address, each `COMPLETED` one checked against its canonical Polygon receipt. Delivery to the bridge is not pUSD funding, a bridge `FAILED` is not a refund, and attribution of any bridge transaction to this funding stays unknown. `callId` joins it to that call's `tool.result`; show the latest in place of it.\n- `prediction.withdrawal` — Recovery's latest view of an attempted owner-approved pUSD withdrawal, independent of the run: its outgoing Polygon transfer receipt, what the bridge reports, and arrival at the unique linked 1Click deposit address. Only that deposit's own receipt establishes a credit or refund into the agent's confidential Intents wallet. A bridge status alone is not a receipt. Replace the original tool result by callId; recovery never signs or resends.\n- `composite.progress` — Best-effort display snapshot of an approved basket's pieces (`composite_execute`), appended after a piece changes state: each piece `todo`, `live`, `done`, `bad` or `skip`. Revision orders snapshots for the same call; ignore an older one. The call's own `tool.result` is the authoritative outcome of every piece, and each piece's own venue events keep their meaning; progress grants no execution permission.\n- `solana.progress` — Best-effort display snapshot derived from committed Solana funding, swap or sweep facts. Revision orders snapshots; repeated unchanged observations are omitted. A confirmed funding phase is only delivered SOL, and a confirmed swap phase does not establish sweep settlement. Final tool outcomes and solana.reconciled remain authoritative; progress grants no execution permission.\n- `solana.reconciled` — A later, independently verified answer to an approved Solana buy, sell or withdrawal whose own `tool.result` was left unconfirmed — never inferred from the model's own tool result. Appended once, by recovery, in the same commit that records the request's final outcome, independent of the run that made the call; `callId` joins it to that call's `tool.result`, `approvalId` to its approval, and `operationId` to its financial request. `result` has the shape the tool itself returns, with its `solana` detail; show it in place of the call's earlier unconfirmed result.\n- `prediction.order` — The latest observation of a Polymarket order. Replace the original placement call's result, joined by `callId`, with `result`. A match is not settlement; cancellation stops only the unmatched part and does not reverse earlier fills. Observations can arrive after the run ends."
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key"
      },
      "automationSourceKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Automation-Key",
        "description": "An automation's webhook secret, from Rotate the webhook secret. It only sends events to that automation."
      },
      "userToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "fin_session_<opaque>",
        "description": "A user's session token, from Create a session."
      }
    },
    "schemas": {
      "PredictionOrderInputInput": {
        "type": "object",
        "properties": {
          "marketId": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,19}$"
          },
          "assetId": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,77})$"
          },
          "marketQuestion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "outcome": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "side": {
            "type": "string",
            "enum": [
              "BUY",
              "SELL"
            ]
          },
          "limitPriceUsdDecimal": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,17})(\\.[0-9]{1,6})?$"
          },
          "quantity": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "shares"
                  },
                  "sizeSharesDecimal": {
                    "type": "string",
                    "pattern": "^(0|[1-9][0-9]{0,17})(\\.[0-9]{1,6})?$"
                  }
                },
                "required": [
                  "kind",
                  "sizeSharesDecimal"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "budget"
                  },
                  "amountUsdDecimal": {
                    "type": "string",
                    "pattern": "^(0|[1-9][0-9]{0,17})(\\.[0-9]{1,6})?$"
                  }
                },
                "required": [
                  "kind",
                  "amountUsdDecimal"
                ],
                "additionalProperties": false
              }
            ]
          },
          "orderType": {
            "type": "string",
            "enum": [
              "GTC",
              "GTD",
              "FOK",
              "FAK"
            ]
          },
          "expiresAt": {
            "type": "integer",
            "minimum": 0,
            "maximum": 253402300799
          },
          "maxFeeUsdDecimal": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,17})(\\.[0-9]{1,6})?$"
          },
          "maxSpendUsdDecimal": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,17})(\\.[0-9]{1,6})?$"
          }
        },
        "required": [
          "marketId",
          "assetId",
          "marketQuestion",
          "outcome",
          "side",
          "limitPriceUsdDecimal",
          "quantity",
          "orderType",
          "maxFeeUsdDecimal",
          "maxSpendUsdDecimal"
        ],
        "additionalProperties": false
      },
      "VenueFundingPaymentInput": {
        "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."
          },
          "maxInputRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The most of the coin this funding may spend, in its smallest unit: the approved dollars at the price read when the approval opened, plus 5%."
          }
        },
        "required": [
          "tokenId",
          "decimals",
          "maxInputRaw"
        ],
        "additionalProperties": false,
        "description": "The coin this funding pays with and the most of it it may spend, as the owner approved them. Absent: the funding spends one USDC or USDT holding."
      },
      "SolanaTokenInput": {
        "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"
        ],
        "additionalProperties": false,
        "description": "One Solana token, pinned by its mint, its decimals and its token program."
      },
      "SolanaBuyInputInput": {
        "type": "object",
        "properties": {
          "token": {
            "description": "The exact token to buy.",
            "$ref": "#/components/schemas/SolanaTokenInput"
          },
          "pay": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "usdc",
                    "description": "Pay from one USDC or USDT holding of the agent wallet (USDC on NEAR, Base, Arbitrum, Ethereum or Solana, or USDT on NEAR; any USDC that covers it before USDT), moved to Solana as SOL first."
                  },
                  "amountRaw": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "Exact USDC or USDT to spend, in six-decimal atomic units: $50 is \"50000000\". At least 5 (\"5000000\"); a smaller buy is refused."
                  }
                },
                "required": [
                  "kind",
                  "amountRaw"
                ],
                "additionalProperties": false,
                "description": "Spend an exact amount of USDC or USDT from the agent wallet."
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "sol",
                    "description": "Pay with SOL already in the agent's Solana account."
                  },
                  "lamports": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "Exact SOL to spend, in lamports (nine decimals): 0.5 SOL is \"500000000\"."
                  }
                },
                "required": [
                  "kind",
                  "lamports"
                ],
                "additionalProperties": false,
                "description": "Spend an exact amount of SOL the agent's Solana account already holds."
              }
            ],
            "description": "What the buy spends, as an exact input amount. Buying an exact number of tokens is not supported."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1500,
            "description": "Explicit all-in maximum value loss in basis points, from the value paid to the value received, fees and price impact included: at least 1, at most 1500. Required; no default."
          },
          "maxSolTopUpUsdcRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The most extra USDC or USDT the funding may add to keep SOL in the Solana account for network fees, in six-decimal atomic units: \"0\" for none, at most \"1000000\" (1 USDC). Must be \"0\" when paying with SOL."
          },
          "payWith": {
            "description": "A buy paid in dollars and approved in chat as one call: the coin its funding pays with instead of a USDC or USDT holding, and the most of it it may spend, the SOL top-up included. Never SOL. A buy from a token's page refuses it.",
            "$ref": "#/components/schemas/VenueFundingPaymentInput"
          }
        },
        "required": [
          "token",
          "pay",
          "maxValueLossBps",
          "maxSolTopUpUsdcRaw"
        ],
        "additionalProperties": false,
        "description": "One exact-input buy of a Solana token through the agent's own Solana account."
      },
      "SolanaSellInputInput": {
        "type": "object",
        "properties": {
          "token": {
            "description": "The exact token to sell.",
            "$ref": "#/components/schemas/SolanaTokenInput"
          },
          "amount": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "exact",
                    "description": "Sell an exact amount of the token."
                  },
                  "amountRaw": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "Exact amount of the token to sell, in its smallest unit (scaled by the token's decimals)."
                  }
                },
                "required": [
                  "kind",
                  "amountRaw"
                ],
                "additionalProperties": false,
                "description": "Sell an exact amount of the token."
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "fraction",
                    "description": "Sell a share of what the Solana account holds of the token."
                  },
                  "bps": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10000,
                    "description": "The share to sell, in basis points of the account's balance of the token: all of it is 10000, half is 5000."
                  }
                },
                "required": [
                  "kind",
                  "bps"
                ],
                "additionalProperties": false,
                "description": "Sell a share of the account's balance of the token."
              }
            ],
            "description": "How much of the token to sell."
          },
          "receive": {
            "type": "string",
            "enum": [
              "usdc",
              "sol"
            ],
            "description": "`usdc` returns the proceeds to the agent wallet as USDC on NEAR, which is what selling means; `sol` keeps them as SOL in the agent's Solana account."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1500,
            "description": "Explicit all-in maximum value loss in basis points, from the value paid to the value received, fees and price impact included: at least 1, at most 1500. Required; no default."
          }
        },
        "required": [
          "token",
          "amount",
          "receive",
          "maxValueLossBps"
        ],
        "additionalProperties": false,
        "description": "One sell of a Solana token held in the agent's own Solana account."
      },
      "WithdrawalTermsInput": {
        "type": "object",
        "properties": {
          "assetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to withdraw from the agent wallet: an `assetId` from Get balances."
          },
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The amount to withdraw, in the asset's smallest unit."
          },
          "destination": {
            "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."
              },
              "assetId": {
                "type": "string",
                "pattern": "^asset_[a-f0-9]{64}$",
                "description": "The asset the recipient receives: an `id` from List supported assets."
              },
              "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."
              }
            },
            "required": [
              "rail",
              "network",
              "assetId",
              "address"
            ],
            "additionalProperties": false,
            "description": "Where the funds go: the network, the asset received and the recipient's address."
          },
          "minimumReceivedRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The least the recipient receives, in the received asset's smallest unit."
          },
          "maxFeeRaw": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The most the withdrawal fee can be, in the received asset's smallest unit. `null` when the provider does not state this fee separately, which does not mean zero; the minimum received and the loss limit still apply."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 300,
            "description": "The most the transfer may lose in total, fees and price movement included, in basis points (100 = 1%), from 1 to 300."
          }
        },
        "required": [
          "assetId",
          "amountRaw",
          "destination",
          "minimumReceivedRaw",
          "maxFeeRaw",
          "maxValueLossBps"
        ],
        "additionalProperties": false,
        "description": "The exact terms of a withdrawal: what leaves the agent wallet, where it goes, and the limits it must stay within."
      },
      "SwapTermsInput": {
        "type": "object",
        "properties": {
          "sellAssetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to sell from the agent wallet: an `assetId` from Get balances."
          },
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The exact amount to sell, in the sold asset's smallest unit."
          },
          "buyAssetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to buy: an `id` from List supported assets. It stays in the agent wallet."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 300,
            "description": "The most the swap may lose in total, fees and price movement included, in basis points (100 = 1%), from 1 to 300."
          },
          "minimumReceivedRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The least the agent wallet receives of the bought asset, in its smallest unit."
          }
        },
        "required": [
          "sellAssetId",
          "amountRaw",
          "buyAssetId",
          "maxValueLossBps",
          "minimumReceivedRaw"
        ],
        "additionalProperties": false,
        "description": "The exact terms of a swap in the agent wallet: what it sells, what it buys, and the limits it must stay within."
      },
      "OrderTermsInput": {
        "type": "object",
        "properties": {
          "sellAssetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to sell from the agent wallet: an `assetId` from Get balances."
          },
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The exact amount to sell, in the sold asset's smallest unit. It leaves the agent wallet when the order is placed."
          },
          "buyAssetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to buy: an `id` from List supported assets. What the order buys comes back to the agent wallet."
          },
          "limitPrice": {
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d{0,38})(\\.\\d{1,38})?$",
            "description": "The least the order sells at, as bought-asset units per ONE sold unit, written as a plain decimal: \"5\" means at least 5 of the bought asset for each one sold. Never scale it by decimals."
          },
          "expiresInHours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 720,
            "description": "How long the order rests before it expires, in whole hours from 1 to 720 (30 days)."
          },
          "minimumReceivedRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The least the whole order receives at its limit price, in the bought asset's smallest unit, rounded up. This is the floor the user signs: an order that would receive less is never placed."
          }
        },
        "required": [
          "sellAssetId",
          "amountRaw",
          "buyAssetId",
          "limitPrice",
          "expiresInHours",
          "minimumReceivedRaw"
        ],
        "additionalProperties": false,
        "description": "The exact terms of a limit order in the agent wallet: what it sells, what it buys, the least it sells at, how long it rests, and the least it receives in all."
      },
      "DepositTermsInput": {
        "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."
          },
          "assetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to deposit: an `id` from List supported assets."
          },
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The exact amount the user sends, in the asset's smallest unit."
          },
          "refundAddress": {
            "type": "string",
            "pattern": "^[\\x21-\\x7e]{1,256}$",
            "description": "Where the funds go back to if the deposit cannot be credited: an address the user controls on the network they send from."
          },
          "minimumCreditRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The least the agent wallet must be credited, in the same asset's smallest unit."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 300,
            "description": "The most the transfer may lose in total, fees and price movement included, in basis points (100 = 1%), from 1 to 300."
          }
        },
        "required": [
          "rail",
          "network",
          "assetId",
          "amountRaw",
          "refundAddress",
          "minimumCreditRaw",
          "maxValueLossBps"
        ],
        "additionalProperties": false,
        "description": "The exact terms of a deposit: what the user sends, from which network, and the limits the credit must stay within."
      },
      "PerpsAutomationActionInput": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "reduce",
                "description": "Reduce or close the position."
              },
              "fractionBps": {
                "type": "integer",
                "minimum": 1,
                "maximum": 10000,
                "description": "How much of the position to close, in basis points: 10000 closes it all."
              },
              "maxSlippageBps": {
                "type": "integer",
                "minimum": 1,
                "maximum": 500,
                "description": "The worst fill allowed, in basis points from the mark when it fires."
              }
            },
            "required": [
              "kind",
              "fractionBps",
              "maxSlippageBps"
            ],
            "additionalProperties": false,
            "description": "Close part or all of the position with a reduce-only market order."
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "add_margin",
                "description": "Add margin to the perps account."
              },
              "amountRaw": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "Exact USDC moved from the agent wallet into the perps account, six decimals: 5 USDC is \"5000000\"."
              },
              "maxValueLossBps": {
                "type": "integer",
                "minimum": 0,
                "maximum": 300,
                "description": "Maximum value lost to fees moving it, in basis points."
              }
            },
            "required": [
              "kind",
              "amountRaw",
              "maxValueLossBps"
            ],
            "additionalProperties": false,
            "description": "Fund the agent's own perps account from its agent wallet."
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "open",
                "description": "Open the position at market."
              },
              "notionalUsd": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]{0,6})(\\.[0-9]{1,2})?$",
                "description": "The position's size in US dollars at the mark when it fires, at most two places: a $200 position is \"200\". The size in the coin is this over the mark, rounded down to the market's size precision."
              },
              "leverage": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Leverage the user chose for this market, at most the market's maximum. Never assume it: ask the user."
              },
              "marginMode": {
                "type": "string",
                "enum": [
                  "cross",
                  "isolated"
                ],
                "description": "How the position is margined, which the user chose with the leverage: `cross` shares the account's margin, `isolated` risks only this position's own. An isolated-only market takes `isolated`. Never assume it: ask the user."
              },
              "maxSlippageBps": {
                "type": "integer",
                "minimum": 1,
                "maximum": 500,
                "description": "The worst fill allowed, in basis points from the mark when it fires; the take-profit and stop-loss fill within the same bound of their trigger."
              },
              "takeProfitPercent": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^(0|[1-9][0-9]?)(\\.[0-9]{0,3}[1-9])?$"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "A native take-profit this far from the mark when it opens, in percent of price in the position's favour (\"10\" is 10%), or null for none."
              },
              "stopLossPercent": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^(0|[1-9][0-9]?)(\\.[0-9]{0,3}[1-9])?$"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "A native stop-loss this far from the mark when it opens, in percent of price against the position (\"5\" is 5%), or null for none."
              }
            },
            "required": [
              "kind",
              "notionalUsd",
              "leverage",
              "marginMode",
              "maxSlippageBps",
              "takeProfitPercent",
              "stopLossPercent"
            ],
            "additionalProperties": false,
            "description": "Open the position with a market order, only while the agent holds nothing on this coin, optionally protected by a native take-profit and stop-loss."
          }
        ],
        "description": "What a perps automation does each time its rule fires: open the named position while the agent holds nothing on its coin, reduce the named position, or add margin to the agent's own perps account."
      },
      "PerpsAutomationContractInput": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "perps_automation",
            "description": "Which authorization contract this is."
          },
          "coin": {
            "type": "string",
            "pattern": "^(?:xyz:)?[A-Za-z0-9]{1,20}$",
            "description": "The market's coin name exactly as perps_markets lists it, such as `BTC` or `xyz:TSLA`."
          },
          "asset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1099999,
            "description": "The market's asset id exactly as perps_markets lists it for that coin."
          },
          "position": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "description": "The position the action is for. `open` acts only while the agent holds nothing on this coin; `reduce` and `add_margin` act only while it holds this side, and nothing happens otherwise."
          },
          "action": {
            "$ref": "#/components/schemas/PerpsAutomationActionInput"
          },
          "maxExecutions": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "How many firings may act under this approval."
          },
          "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": "The deadline after which this approval authorizes nothing."
          }
        },
        "required": [
          "type",
          "coin",
          "asset",
          "position",
          "action",
          "maxExecutions",
          "validUntil"
        ],
        "additionalProperties": false,
        "description": "A standing approval for one perps automation: open the agent's own position while it holds nothing on the coin, reduce or close it, or add margin to its own account, each time its rule fires, up to its limits."
      },
      "PredictionAutomationActionInput": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "buy",
                "description": "Buy shares of the outcome."
              },
              "amountUsdDecimal": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]{0,6})(\\.[0-9]{1,2})?$",
                "description": "The USD each firing spends before fees, to the cent: \"50\" is $50. Each buy is an immediate order that fills what it can at once and cancels the rest."
              },
              "maxPriceUsdDecimal": {
                "type": "string",
                "pattern": "^0\\.[0-9]{1,4}$",
                "description": "The most a share may cost, as the market's chance: \"0.32\" never pays more than 32¢ a share. Use a price on the market's tick."
              },
              "maxFeeUsdDecimal": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]{0,6})(\\.[0-9]{1,6})?$",
                "description": "The most each firing may pay Polymarket in fees, in USD: \"1\" is $1."
              }
            },
            "required": [
              "kind",
              "amountUsdDecimal",
              "maxPriceUsdDecimal",
              "maxFeeUsdDecimal"
            ],
            "additionalProperties": false,
            "description": "Buy the outcome with a USD budget at no more than a maximum price."
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "sell",
                "description": "Sell shares of the outcome."
              },
              "fractionBps": {
                "type": "integer",
                "minimum": 1,
                "maximum": 10000,
                "description": "How much of the agent's holding of the outcome each firing sells, in basis points: 10000 sells it all."
              },
              "minPriceUsdDecimal": {
                "type": "string",
                "pattern": "^0\\.[0-9]{1,4}$",
                "description": "The least a share may sell for, as the market's chance: \"0.7\" never sells below 70¢ a share. Use a price on the market's tick."
              },
              "maxFeeUsdDecimal": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]{0,6})(\\.[0-9]{1,6})?$",
                "description": "The most each firing may pay Polymarket in fees, in USD: \"1\" is $1."
              }
            },
            "required": [
              "kind",
              "fractionBps",
              "minPriceUsdDecimal",
              "maxFeeUsdDecimal"
            ],
            "additionalProperties": false,
            "description": "Sell a share of the agent's holding of the outcome at no less than a minimum price."
          }
        ],
        "description": "What a Polymarket automation does each time its rule fires: buy the outcome with a USD budget at no more than a maximum price, or sell a share of the agent's holding of it at no less than a minimum price."
      },
      "PredictionAutomationContractInput": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "prediction_automation",
            "description": "Which authorization contract this is."
          },
          "market": {
            "type": "object",
            "properties": {
              "marketId": {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,19}$",
                "description": "The market's id exactly as prediction_market returns it."
              },
              "conditionId": {
                "type": "string",
                "pattern": "^0x[0-9a-fA-F]{64}$",
                "description": "The market's conditionId exactly as prediction_market returns it."
              },
              "assetId": {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,77}$",
                "description": "The outcome's CLOB token id, exactly the assetId prediction_market lists for that outcome. Yes and No are different tokens."
              },
              "marketQuestion": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1000,
                "description": "The market's question exactly as prediction_market returns it."
              },
              "outcome": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "The outcome's name exactly as prediction_market returns it."
              }
            },
            "required": [
              "marketId",
              "conditionId",
              "assetId",
              "marketQuestion",
              "outcome"
            ],
            "additionalProperties": false,
            "description": "The one Polymarket outcome this automation trades."
          },
          "action": {
            "$ref": "#/components/schemas/PredictionAutomationActionInput"
          },
          "maxExecutions": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "How many firings may trade under this approval; a buy spends at most maxExecutions × amountUsdDecimal in all."
          },
          "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": "The deadline after which this approval authorizes nothing."
          }
        },
        "required": [
          "type",
          "market",
          "action",
          "maxExecutions",
          "validUntil"
        ],
        "additionalProperties": false,
        "description": "A standing approval for one Polymarket automation: buy one outcome with a USD budget at no more than a maximum price, or sell a share of the agent's holding of it at no less than a minimum price, each time its rule fires, up to its limits."
      },
      "SolanaBuyContractInput": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "solana_buy",
            "description": "Which authorization contract this is."
          },
          "buy": {
            "description": "The exact approved token, payment, all-in loss bound and SOL top-up cap, and, for a buy whose funding pays with a coin, that coin and the most of it it may spend.",
            "$ref": "#/components/schemas/SolanaBuyInputInput"
          },
          "maxExecutions": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "How many times this grant may execute: 1 for a one-shot approval."
          },
          "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 grant's authority expires; for a one-shot approval, the approval's own expiry."
          }
        },
        "required": [
          "type",
          "buy",
          "maxExecutions",
          "validUntil"
        ],
        "additionalProperties": false,
        "description": "An approved Solana buy, executed only exactly as approved."
      },
      "SolanaSellContractInput": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "solana_sell",
            "description": "Which authorization contract this is."
          },
          "sell": {
            "description": "The exact approved token, amount, proceeds and all-in loss bound.",
            "$ref": "#/components/schemas/SolanaSellInputInput"
          },
          "maxExecutions": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "How many times this grant may execute: 1 for a one-shot approval."
          },
          "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 grant's authority expires; for a one-shot approval, the approval's own expiry."
          }
        },
        "required": [
          "type",
          "sell",
          "maxExecutions",
          "validUntil"
        ],
        "additionalProperties": false,
        "description": "An approved Solana sell, executed only exactly as approved."
      },
      "AutomationJsonValueInput": {
        "description": "Any JSON value: a string, number, boolean, null, array or object, nested to any depth.",
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationJsonValueInput"
            }
          },
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/AutomationJsonValueInput"
            }
          }
        ]
      },
      "AutomationRuleInput": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "number",
            "const": 1,
            "description": "The rule schema's version; always `1`."
          },
          "delivery": {
            "default": {
              "overlap": "queue",
              "maxPendingOccurrences": 100
            },
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "overlap": {
                    "type": "string",
                    "const": "queue",
                    "description": "Queue a new occurrence and run it once the active one finishes."
                  },
                  "maxPendingOccurrences": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "description": "How many occurrences may wait in the queue, not counting the one currently active, including one whose run is itself waiting on an approval."
                  }
                },
                "required": [
                  "overlap",
                  "maxPendingOccurrences"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "overlap": {
                    "type": "string",
                    "const": "coalesce",
                    "description": "Close the occurrence already pending as `coalesced` and record the new match as a fresh occurrence, rather than queuing a second."
                  }
                },
                "required": [
                  "overlap"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "overlap": {
                    "type": "string",
                    "const": "skip",
                    "description": "Drop a new match while an occurrence is already active."
                  }
                },
                "required": [
                  "overlap"
                ],
                "additionalProperties": false
              }
            ],
            "description": "What happens when a new occurrence is ready before the previous one has finished."
          },
          "maxDeliveryLatenessSeconds": {
            "default": 86400,
            "description": "How long a new occurrence may wait to be delivered before its deadline passes and it is refused, in seconds.",
            "type": "integer",
            "minimum": 1,
            "maximum": 86400
          },
          "maxEvaluationGapSeconds": {
            "default": 600,
            "description": "The longest gap allowed between evaluations before `firing.mode: rising_edge` treats its history as broken and waits for a fresh baseline, in seconds.",
            "type": "integer",
            "minimum": 1,
            "maximum": 2678400
          },
          "wakes": {
            "minItems": 1,
            "maxItems": 7,
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "at",
                      "description": "A one-time wake at an exact moment; exhausted after that check, even if its condition is false."
                    },
                    "runAt": {
                      "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                      "description": "The exact moment this wake fires, as an ISO 8601 timestamp with an offset."
                    },
                    "misfire": {
                      "default": {
                        "mode": "latest",
                        "maxLatenessSeconds": null
                      },
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "skip",
                              "description": "Drop a wake the engine could not evaluate in time; wait for the next one."
                            },
                            "graceSeconds": {
                              "default": 5,
                              "description": "How late this wake may still run before it counts as missed, in seconds.",
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 60
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "latest",
                              "description": "Run once for the most recently missed wake, dropping any earlier ones."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "all",
                              "description": "Run once for every missed wake, oldest first."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        }
                      ],
                      "description": "What happens when the engine could not evaluate this wake on time."
                    },
                    "evaluationTime": {
                      "default": "detection_time",
                      "description": "Which moment this wake is evaluated as of: `scheduled_time` the time it was due, `detection_time` when the engine actually ran it.",
                      "type": "string",
                      "enum": [
                        "scheduled_time",
                        "detection_time"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "runAt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "interval",
                      "description": "A wake that repeats on a fixed elapsed interval."
                    },
                    "intervalMinutes": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 44640,
                      "description": "How often this wake repeats, in minutes."
                    },
                    "misfire": {
                      "default": {
                        "mode": "latest",
                        "maxLatenessSeconds": null
                      },
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "skip",
                              "description": "Drop a wake the engine could not evaluate in time; wait for the next one."
                            },
                            "graceSeconds": {
                              "default": 5,
                              "description": "How late this wake may still run before it counts as missed, in seconds.",
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 60
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "latest",
                              "description": "Run once for the most recently missed wake, dropping any earlier ones."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "all",
                              "description": "Run once for every missed wake, oldest first."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        }
                      ],
                      "description": "What happens when the engine could not evaluate this wake on time."
                    },
                    "evaluationTime": {
                      "default": "detection_time",
                      "description": "Which moment this wake is evaluated as of: `scheduled_time` the time it was due, `detection_time` when the engine actually ran it.",
                      "type": "string",
                      "enum": [
                        "scheduled_time",
                        "detection_time"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "intervalMinutes"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "calendar",
                      "description": "A wake on a recurring calendar schedule: local times, weekdays, months and days of the month."
                    },
                    "timeZone": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80,
                      "description": "The IANA time zone a calendar wake's local times are interpreted in."
                    },
                    "localTimes": {
                      "minItems": 1,
                      "maxItems": 24,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                      },
                      "description": "The times of day this wake fires, each in 24-hour `HH:MM` form, in `timeZone`."
                    },
                    "weekdays": {
                      "default": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7
                      ],
                      "description": "Which ISO weekdays this wake fires on, 1 (Monday) through 7 (Sunday). Defaults to every day.",
                      "minItems": 1,
                      "maxItems": 7,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 7
                      }
                    },
                    "months": {
                      "default": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12
                      ],
                      "description": "Which months this wake fires in, 1 (January) through 12 (December). Defaults to every month.",
                      "minItems": 1,
                      "maxItems": 12,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 12
                      }
                    },
                    "monthDays": {
                      "default": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26,
                        27,
                        28,
                        29,
                        30,
                        31
                      ],
                      "description": "Which days of the month this wake fires on, 1 through 31. Defaults to every day.",
                      "minItems": 1,
                      "maxItems": 31,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 31
                      }
                    },
                    "misfire": {
                      "default": {
                        "mode": "latest",
                        "maxLatenessSeconds": null
                      },
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "skip",
                              "description": "Drop a wake the engine could not evaluate in time; wait for the next one."
                            },
                            "graceSeconds": {
                              "default": 5,
                              "description": "How late this wake may still run before it counts as missed, in seconds.",
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 60
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "latest",
                              "description": "Run once for the most recently missed wake, dropping any earlier ones."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "all",
                              "description": "Run once for every missed wake, oldest first."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        }
                      ],
                      "description": "What happens when the engine could not evaluate this wake on time."
                    },
                    "evaluationTime": {
                      "default": "detection_time",
                      "description": "Which moment this wake is evaluated as of: `scheduled_time` the time it was due, `detection_time` when the engine actually ran it.",
                      "type": "string",
                      "enum": [
                        "scheduled_time",
                        "detection_time"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "timeZone",
                    "localTimes"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "event",
                      "description": "A wake evaluated each time a matching custom webhook event arrives."
                    },
                    "eventType": {
                      "type": "string",
                      "pattern": "^[A-Za-z][A-Za-z0-9_.:-]{0,79}$",
                      "description": "The event `type` this wake matches; a live webhook delivery of a different type is ignored before it reaches the condition."
                    },
                    "fields": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "path": {
                            "minItems": 1,
                            "maxItems": 8,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
                            },
                            "description": "The keys to walk, in order, from an observation's top level down to this field."
                          },
                          "valueType": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "boolean",
                                    "description": "A true/false value."
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "string",
                                    "description": "A text value."
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "integer",
                                    "description": "A whole-number value, compared exactly."
                                  },
                                  "unit": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64,
                                    "description": "The unit an integer or decimal value is measured in, as the source or literal declares it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "unit"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "decimal",
                                    "description": "An exact decimal value, as text, compared exactly."
                                  },
                                  "unit": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64,
                                    "description": "The unit an integer or decimal value is measured in, as the source or literal declares it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "unit"
                                ],
                                "additionalProperties": false
                              }
                            ],
                            "description": "What type this field's value has, and the unit it carries when it has one."
                          },
                          "optional": {
                            "description": "Whether the provider may genuinely not observe this field, rather than fail to read it. When true, a missing value resolves a condition over it to `missing_field` and the rule's verdict to `unknown`, rather than zero, null or false.",
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "path",
                          "valueType"
                        ],
                        "additionalProperties": false,
                        "description": "One data field an event or a source's observation carries: where it lives, and its type."
                      },
                      "description": "The data fields an event of this type is declared to carry."
                    }
                  },
                  "required": [
                    "kind",
                    "eventType",
                    "fields"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "reader_update",
                      "description": "A wake evaluated each time the named reader delivers a fresh observation."
                    },
                    "binding": {
                      "type": "string",
                      "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                      "description": "The binding name a rule or a plan gives one configured source."
                    }
                  },
                  "required": [
                    "kind",
                    "binding"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "description": "Occasions to evaluate the rule's condition: alternatives, not an AND of conditions. At most one clock and one event stream."
          },
          "readers": {
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                  "description": "The binding name a rule or a plan gives one configured source."
                },
                "readerId": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.-]{0,79}$",
                  "description": "The installed source operation's id, as listed by List automation data sources."
                },
                "config": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "$ref": "#/components/schemas/AutomationJsonValueInput"
                  },
                  "description": "Arbitrary JSON data: an event's data, a reader's configuration, or a source plan's configuration. Bounded to 16 KiB, 8 levels of nesting and 256 entries."
                },
                "delivery": {
                  "description": "Use reviewed push updates; omit for periodic snapshots.",
                  "type": "string",
                  "const": "push"
                },
                "pollIntervalSeconds": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 2147483,
                  "description": "Polling cadence, or subscription lease/reconciliation cadence for push delivery, in seconds."
                },
                "maxAgeSeconds": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 86400,
                  "description": "Maximum retained input age at evaluation, matching requirement.maxAgeSeconds when present. Snapshots use observation time; events use trusted receipt time. Collection separately enforces the provider's acquisition-age guarantee."
                },
                "requirement": {
                  "type": "object",
                  "properties": {
                    "maxLatencySeconds": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 2147483
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The target delay between an observation and its delivery, in seconds; null when delivery has no target deadline."
                    },
                    "maxAgeSeconds": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 86400,
                      "description": "Maximum acceptable input age at evaluation, matching the reader's maxAgeSeconds, measured from the provider's own observation time. The selected provider's acquisition guarantee must fit within this limit and does not reduce this evaluation window."
                    },
                    "allowDegradedLatency": {
                      "type": "boolean",
                      "description": "Whether delivery slower than the target delay is still accepted."
                    },
                    "maxAcceptedLatencySeconds": {
                      "description": "The slowest delivery still accepted, in seconds, when `allowDegradedLatency` is set.",
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 2147483
                    }
                  },
                  "required": [
                    "maxLatencySeconds",
                    "maxAgeSeconds",
                    "allowDegradedLatency"
                  ],
                  "additionalProperties": false,
                  "description": "What a reader needs from its source: how fresh an answer must be, and whether a slower one is still acceptable."
                }
              },
              "required": [
                "name",
                "readerId",
                "config",
                "pollIntervalSeconds",
                "maxAgeSeconds"
              ],
              "additionalProperties": false
            },
            "description": "The named source bindings this rule reads from, referenced by `condition` and by each `reader_update` wake's `binding`."
          },
          "condition": {
            "description": "The rule's condition tree, up to 8 levels deep and 128 nodes total, built from five node kinds: `{op:\"bool\", value}` a fixed true/false leaf; `{op:\"compare\", comparator, left, right}` one of `eq`/`ne`/`lt`/`lte`/`gt`/`gte` between two operands — `lt`/`lte`/`gt`/`gte` require both operands to be `integer` or `decimal`, and both sides must share the same type and, for `integer`/`decimal`, the same unit; `{op:\"all\", args}` / `{op:\"any\", args}` AND/OR over one or more child nodes; `{op:\"not\", arg}` negates one child node. An operand is either `{kind:\"field\", binding, path}` — a bound reader's name and the key path into its data — or `{kind:\"literal\", type, value, unit?}` with `type` one of `boolean`/`string`/`integer`/`decimal` (`integer`/`decimal` values are exact decimal strings and carry `unit`)."
          },
          "exit": {
            "description": "The exit watch, when this rule's automation has exit actions on its contract. Present exactly when the contract has an exit action.",
            "type": "object",
            "properties": {
              "intervalSeconds": {
                "type": "integer",
                "minimum": 60,
                "maximum": 2678400,
                "description": "How often this automation re-checks its exit guards, in seconds; at least 60 and at most 2678400 (31 days), the same span an interval wake may cover. Recommend 300."
              },
              "readers": {
                "type": "object",
                "properties": {
                  "asset": {
                    "type": "string",
                    "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                    "description": "The binding in `readers` that prices the asset this automation bought, in USD."
                  },
                  "quote": {
                    "type": "string",
                    "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                    "description": "The binding in `readers` that prices the token this automation pays with, in USD."
                  }
                },
                "required": [
                  "asset",
                  "quote"
                ],
                "additionalProperties": false,
                "description": "The two price bindings each exit guard is measured against; both must be the reviewed USD token-price operation."
              },
              "push": {
                "description": "Additional push-delivered USD prices that may check exits between periodic 1Click checks.",
                "type": "object",
                "properties": {
                  "readers": {
                    "type": "object",
                    "properties": {
                      "asset": {
                        "type": "string",
                        "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                        "description": "The binding name a rule or a plan gives one configured source."
                      },
                      "quote": {
                        "type": "string",
                        "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                        "description": "The binding name a rule or a plan gives one configured source."
                      }
                    },
                    "required": [
                      "asset",
                      "quote"
                    ],
                    "additionalProperties": false,
                    "description": "The supplementary price bindings for the bought asset and its paying token."
                  }
                },
                "required": [
                  "readers"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "intervalSeconds",
              "readers"
            ],
            "additionalProperties": false
          },
          "firing": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "each_match",
                  "rising_edge"
                ],
                "description": "When a qualifying evaluation fires: `each_match` fires on every qualifying evaluation, including the first; `rising_edge` fires only on a known false-to-true transition."
              },
              "repeat": {
                "type": "string",
                "enum": [
                  "once",
                  "repeating"
                ],
                "description": "Whether this rule fires at most once, or keeps watching after it fires."
              },
              "maxRuns": {
                "description": "Maximum deliverable runs recorded for this automation across pauses and resumes. Missed or refused deliveries do not count; recorded runs count even if later canceled, coalesced or failed. Omit for no finite limit beyond repeat=once.",
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              },
              "initial": {
                "type": "string",
                "enum": [
                  "baseline",
                  "fire_if_true"
                ],
                "description": "How `rising_edge` treats the first known state: `baseline` records it without firing, `fire_if_true` fires immediately if it is already true."
              },
              "cooldownSeconds": {
                "type": "integer",
                "minimum": 0,
                "maximum": 2678400,
                "description": "The minimum time between firings, in seconds; it does not require the condition to stay true that whole time. For `rising_edge`, a false-to-true edge that lands inside cooldown is discarded, not queued: it is not replayed once cooldown ends, so the rule needs an entirely fresh edge after cooldown lapses before it fires again — simply remaining true past the cooldown boundary does not trigger a firing."
              }
            },
            "required": [
              "mode",
              "repeat",
              "initial",
              "cooldownSeconds"
            ],
            "additionalProperties": false,
            "description": "How this rule turns a qualifying evaluation into a firing: which ones count, how often, and how many."
          },
          "news": {
            "description": "Present only on a news exit: the owner's own words, which Fin's news judge reads new stories against. Its rule is fixed: one `news.judged` event wake, no readers, the judged condition and one firing, over a reduce-only perps contract.",
            "type": "object",
            "properties": {
              "condition": {
                "type": "string",
                "minLength": 3,
                "maxLength": 500,
                "description": "The owner's condition in their own words, exactly as they said it, such as `right before Anthropic's IPO`. Never paraphrased: the judge reads the news against these words."
              },
              "match": {
                "type": "string",
                "minLength": 2,
                "maxLength": 80,
                "pattern": "^[\\p{L}\\p{N} .'&-]+$",
                "description": "A few words every story the judge reads must contain in its headline or summary, such as `Anthropic IPO`: a broad filter, not the condition. The judge decides from the condition."
              }
            },
            "required": [
              "condition",
              "match"
            ],
            "additionalProperties": false
          },
          "maxSnapshotSkewSeconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 86400,
            "description": "The most that bound readers' observation times may disagree before evaluation reports `snapshot_skew`, in seconds."
          }
        },
        "required": [
          "schemaVersion",
          "wakes",
          "readers",
          "condition",
          "firing",
          "maxSnapshotSkewSeconds"
        ],
        "additionalProperties": false,
        "description": "One automation's rule: when it wakes, what condition it evaluates, and how it fires."
      },
      "CreateWalletInput": {
        "type": "object",
        "properties": {
          "authorization": {
            "description": "The user's signature of `creation.message` from Get the agent wallet. Required when the user has no wallet yet, unless you send `signIn`, or send neither from the session that opened the account with a new passkey (Create a session answered `createsWallet: true`); not read once the wallet exists.",
            "type": "object",
            "properties": {
              "controllerId": {
                "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 `controllerId` returned with the message, unchanged: the wallet that signed."
              },
              "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 `expiresAt` returned with the message, unchanged, character for character."
              },
              "signature": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "evm",
                        "description": "An EIP-191 personal-message signature by the current controller."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte hexadecimal signature over the exact supplied message."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "webauthn",
                        "description": "A user-verified WebAuthn assertion over the message digest."
                      },
                      "credentialId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The signing credential identifier encoded as base64url."
                      },
                      "clientDataJSON": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's client-data JSON bytes encoded as base64url."
                      },
                      "authenticatorData": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator data bytes encoded as base64url."
                      },
                      "signature": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's signature encoded as base64url."
                      },
                      "userHandle": {
                        "description": "The optional authenticator user handle encoded as base64url.",
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 8192,
                            "pattern": "^[A-Za-z0-9_-]+$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "credentialId",
                      "clientDataJSON",
                      "authenticatorData",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "near",
                        "description": "A NEP-413 `signMessage` result over `{message, nonce, recipient}`, where `recipient` is the host of Fin's audience."
                      },
                      "publicKey": {
                        "type": "string",
                        "pattern": "^ed25519:[1-9A-HJ-NP-Za-km-z]{32,44}$",
                        "description": "The signing key as the wallet reports it (`ed25519:` then base58)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "nonce": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$",
                        "description": "The 32-byte nonce the caller gave the wallet, in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "publicKey",
                      "signature",
                      "nonce"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "solana",
                        "description": "A Solana `signMessage` Ed25519 signature over the exact UTF-8 message bytes."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "stellar",
                        "description": "A SEP-53 signature: Ed25519 over sha256(\"Stellar Signed Message:\\n\" + message)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "ton",
                        "description": "A TON Connect `signData` result for a `text` payload that is exactly the message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "address": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "description": "The signing wallet's address exactly as the wallet returned it."
                      },
                      "domain": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 253,
                        "description": "The dApp domain the wallet attested; it must be a partner-registered origin's host."
                      },
                      "timestamp": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991,
                        "description": "The wallet's signing time in UNIX seconds; it must be within five minutes."
                      }
                    },
                    "required": [
                      "kind",
                      "signature",
                      "address",
                      "domain",
                      "timestamp"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "tron",
                        "description": "A TIP-191 `signMessageV2` signature over the exact message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte recoverable secp256k1 signature in hexadecimal."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  }
                ],
                "description": "The user's signature of the `message`, exactly as the API returned it."
              }
            },
            "required": [
              "controllerId",
              "expiresAt",
              "signature"
            ],
            "additionalProperties": false
          },
          "signIn": {
            "description": "Instead of `authorization`: the user's account-opening sign-in, from a challenge Start wallet sign-in answered with `createsWallet: true`. Send it within that challenge's five minutes; the user signs nothing more.",
            "type": "object",
            "properties": {
              "challengeId": {
                "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 `challengeId` of the sign-in that opened this session."
              },
              "signature": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "evm",
                        "description": "An EIP-191 personal-message signature by the current controller."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte hexadecimal signature over the exact supplied message."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "webauthn",
                        "description": "A user-verified WebAuthn assertion over the message digest."
                      },
                      "credentialId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The signing credential identifier encoded as base64url."
                      },
                      "clientDataJSON": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's client-data JSON bytes encoded as base64url."
                      },
                      "authenticatorData": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator data bytes encoded as base64url."
                      },
                      "signature": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's signature encoded as base64url."
                      },
                      "userHandle": {
                        "description": "The optional authenticator user handle encoded as base64url.",
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 8192,
                            "pattern": "^[A-Za-z0-9_-]+$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "credentialId",
                      "clientDataJSON",
                      "authenticatorData",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "near",
                        "description": "A NEP-413 `signMessage` result over `{message, nonce, recipient}`, where `recipient` is the host of Fin's audience."
                      },
                      "publicKey": {
                        "type": "string",
                        "pattern": "^ed25519:[1-9A-HJ-NP-Za-km-z]{32,44}$",
                        "description": "The signing key as the wallet reports it (`ed25519:` then base58)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "nonce": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$",
                        "description": "The 32-byte nonce the caller gave the wallet, in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "publicKey",
                      "signature",
                      "nonce"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "solana",
                        "description": "A Solana `signMessage` Ed25519 signature over the exact UTF-8 message bytes."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "stellar",
                        "description": "A SEP-53 signature: Ed25519 over sha256(\"Stellar Signed Message:\\n\" + message)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "ton",
                        "description": "A TON Connect `signData` result for a `text` payload that is exactly the message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "address": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "description": "The signing wallet's address exactly as the wallet returned it."
                      },
                      "domain": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 253,
                        "description": "The dApp domain the wallet attested; it must be a partner-registered origin's host."
                      },
                      "timestamp": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991,
                        "description": "The wallet's signing time in UNIX seconds; it must be within five minutes."
                      }
                    },
                    "required": [
                      "kind",
                      "signature",
                      "address",
                      "domain",
                      "timestamp"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "tron",
                        "description": "A TIP-191 `signMessageV2` signature over the exact message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte recoverable secp256k1 signature in hexadecimal."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  }
                ],
                "description": "The same signature you sent to Create a session for that challenge."
              }
            },
            "required": [
              "challengeId",
              "signature"
            ],
            "additionalProperties": false
          }
        },
        "additionalProperties": false,
        "description": "The user's signature that creates their agent wallet."
      },
      "ConfirmWalletInput": {
        "type": "object",
        "properties": {
          "authorization": {
            "type": "object",
            "properties": {
              "controllerId": {
                "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 `controllerId` returned with the message, unchanged: the wallet that signed."
              },
              "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 `expiresAt` returned with the message, unchanged, character for character."
              },
              "signature": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "evm",
                        "description": "An EIP-191 personal-message signature by the current controller."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte hexadecimal signature over the exact supplied message."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "webauthn",
                        "description": "A user-verified WebAuthn assertion over the message digest."
                      },
                      "credentialId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The signing credential identifier encoded as base64url."
                      },
                      "clientDataJSON": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's client-data JSON bytes encoded as base64url."
                      },
                      "authenticatorData": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator data bytes encoded as base64url."
                      },
                      "signature": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's signature encoded as base64url."
                      },
                      "userHandle": {
                        "description": "The optional authenticator user handle encoded as base64url.",
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 8192,
                            "pattern": "^[A-Za-z0-9_-]+$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "credentialId",
                      "clientDataJSON",
                      "authenticatorData",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "near",
                        "description": "A NEP-413 `signMessage` result over `{message, nonce, recipient}`, where `recipient` is the host of Fin's audience."
                      },
                      "publicKey": {
                        "type": "string",
                        "pattern": "^ed25519:[1-9A-HJ-NP-Za-km-z]{32,44}$",
                        "description": "The signing key as the wallet reports it (`ed25519:` then base58)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "nonce": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$",
                        "description": "The 32-byte nonce the caller gave the wallet, in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "publicKey",
                      "signature",
                      "nonce"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "solana",
                        "description": "A Solana `signMessage` Ed25519 signature over the exact UTF-8 message bytes."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "stellar",
                        "description": "A SEP-53 signature: Ed25519 over sha256(\"Stellar Signed Message:\\n\" + message)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "ton",
                        "description": "A TON Connect `signData` result for a `text` payload that is exactly the message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "address": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "description": "The signing wallet's address exactly as the wallet returned it."
                      },
                      "domain": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 253,
                        "description": "The dApp domain the wallet attested; it must be a partner-registered origin's host."
                      },
                      "timestamp": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991,
                        "description": "The wallet's signing time in UNIX seconds; it must be within five minutes."
                      }
                    },
                    "required": [
                      "kind",
                      "signature",
                      "address",
                      "domain",
                      "timestamp"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "tron",
                        "description": "A TIP-191 `signMessageV2` signature over the exact message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte recoverable secp256k1 signature in hexadecimal."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  }
                ],
                "description": "The user's signature of the `message`, exactly as the API returned it."
              }
            },
            "required": [
              "controllerId",
              "expiresAt",
              "signature"
            ],
            "additionalProperties": false,
            "description": "The user's signature of confirmation.message from Get the agent wallet, unchanged."
          }
        },
        "required": [
          "authorization"
        ],
        "additionalProperties": false,
        "description": "The owner's confirmation of their existing agent wallet."
      },
      "WithdrawInput": {
        "type": "object",
        "properties": {
          "terms": {
            "description": "The quote's `terms`, unchanged.",
            "$ref": "#/components/schemas/WithdrawalTermsInput"
          },
          "authorization": {
            "type": "object",
            "properties": {
              "controllerId": {
                "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 `controllerId` returned with the message, unchanged: the wallet that signed."
              },
              "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 `expiresAt` returned with the message, unchanged, character for character."
              },
              "signature": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "evm",
                        "description": "An EIP-191 personal-message signature by the current controller."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte hexadecimal signature over the exact supplied message."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "webauthn",
                        "description": "A user-verified WebAuthn assertion over the message digest."
                      },
                      "credentialId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The signing credential identifier encoded as base64url."
                      },
                      "clientDataJSON": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's client-data JSON bytes encoded as base64url."
                      },
                      "authenticatorData": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator data bytes encoded as base64url."
                      },
                      "signature": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's signature encoded as base64url."
                      },
                      "userHandle": {
                        "description": "The optional authenticator user handle encoded as base64url.",
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 8192,
                            "pattern": "^[A-Za-z0-9_-]+$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "credentialId",
                      "clientDataJSON",
                      "authenticatorData",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "near",
                        "description": "A NEP-413 `signMessage` result over `{message, nonce, recipient}`, where `recipient` is the host of Fin's audience."
                      },
                      "publicKey": {
                        "type": "string",
                        "pattern": "^ed25519:[1-9A-HJ-NP-Za-km-z]{32,44}$",
                        "description": "The signing key as the wallet reports it (`ed25519:` then base58)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "nonce": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$",
                        "description": "The 32-byte nonce the caller gave the wallet, in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "publicKey",
                      "signature",
                      "nonce"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "solana",
                        "description": "A Solana `signMessage` Ed25519 signature over the exact UTF-8 message bytes."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "stellar",
                        "description": "A SEP-53 signature: Ed25519 over sha256(\"Stellar Signed Message:\\n\" + message)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "ton",
                        "description": "A TON Connect `signData` result for a `text` payload that is exactly the message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "address": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "description": "The signing wallet's address exactly as the wallet returned it."
                      },
                      "domain": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 253,
                        "description": "The dApp domain the wallet attested; it must be a partner-registered origin's host."
                      },
                      "timestamp": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991,
                        "description": "The wallet's signing time in UNIX seconds; it must be within five minutes."
                      }
                    },
                    "required": [
                      "kind",
                      "signature",
                      "address",
                      "domain",
                      "timestamp"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "tron",
                        "description": "A TIP-191 `signMessageV2` signature over the exact message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte recoverable secp256k1 signature in hexadecimal."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  }
                ],
                "description": "The user's signature of the `message`, exactly as the API returned it."
              }
            },
            "required": [
              "controllerId",
              "expiresAt",
              "signature"
            ],
            "additionalProperties": false,
            "description": "The user's signature of the quote's `authorization.message`, with its `controllerId` and `expiresAt` unchanged. Checked on arrival and never stored."
          }
        },
        "required": [
          "terms",
          "authorization"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "terms": {
              "assetId": "asset_1111111111111111111111111111111111111111111111111111111111111111",
              "amountRaw": "1000000",
              "destination": {
                "rail": "chain",
                "network": "eth",
                "assetId": "asset_2222222222222222222222222222222222222222222222222222222222222222",
                "address": "0x2222222222222222222222222222222222222222"
              },
              "minimumReceivedRaw": "975000",
              "maxFeeRaw": null,
              "maxValueLossBps": 250
            },
            "authorization": {
              "controllerId": "ee79012b-d19c-44f8-aef8-828b88142809",
              "expiresAt": "2026-09-22T18:04:30.000Z",
              "signature": {
                "kind": "evm",
                "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
              }
            }
          }
        ],
        "description": "A quoted withdrawal and the user's signature allowing it."
      },
      "WithdrawalQuoteRequestInput": {
        "type": "object",
        "properties": {
          "assetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to withdraw from the agent wallet: an `assetId` from Get balances."
          },
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The amount to withdraw, in the asset's smallest unit."
          },
          "destination": {
            "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."
              },
              "assetId": {
                "type": "string",
                "pattern": "^asset_[a-f0-9]{64}$",
                "description": "The asset the recipient receives: an `id` from List supported assets."
              },
              "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."
              }
            },
            "required": [
              "rail",
              "network",
              "assetId",
              "address"
            ],
            "additionalProperties": false,
            "description": "Where the funds go: the network, the asset received and the recipient's address."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 300,
            "description": "The most the transfer may lose in total, fees and price movement included, in basis points (100 = 1%), from 1 to 300."
          }
        },
        "required": [
          "assetId",
          "amountRaw",
          "destination",
          "maxValueLossBps"
        ],
        "additionalProperties": false,
        "description": "What to withdraw, where it goes, and the most it may lose; the quote fills in the rest."
      },
      "SolanaTradeRequestInput": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "side": {
                "type": "string",
                "const": "buy",
                "description": "Buy the token."
              },
              "buy": {
                "description": "The exact buy: the token, what it pays, its all-in loss bound and its SOL top-up cap.",
                "$ref": "#/components/schemas/SolanaBuyInputInput"
              }
            },
            "required": [
              "side",
              "buy"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "side": {
                "type": "string",
                "const": "sell",
                "description": "Sell the token."
              },
              "sell": {
                "description": "The exact sale: the token, how much of it, where the proceeds go and its all-in loss bound.",
                "$ref": "#/components/schemas/SolanaSellInputInput"
              }
            },
            "required": [
              "side",
              "sell"
            ],
            "additionalProperties": false
          }
        ],
        "description": "A buy or a sale of one Solana token through the agent's own Solana account."
      },
      "PlaceSolanaTradeInput": {
        "type": "object",
        "properties": {
          "trade": {
            "description": "The prepared trade, unchanged.",
            "$ref": "#/components/schemas/SolanaTradeRequestInput"
          },
          "authorization": {
            "type": "object",
            "properties": {
              "controllerId": {
                "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 `controllerId` returned with the message, unchanged: the wallet that signed."
              },
              "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 `expiresAt` returned with the message, unchanged, character for character."
              },
              "signature": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "evm",
                        "description": "An EIP-191 personal-message signature by the current controller."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte hexadecimal signature over the exact supplied message."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "webauthn",
                        "description": "A user-verified WebAuthn assertion over the message digest."
                      },
                      "credentialId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The signing credential identifier encoded as base64url."
                      },
                      "clientDataJSON": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's client-data JSON bytes encoded as base64url."
                      },
                      "authenticatorData": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator data bytes encoded as base64url."
                      },
                      "signature": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's signature encoded as base64url."
                      },
                      "userHandle": {
                        "description": "The optional authenticator user handle encoded as base64url.",
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 8192,
                            "pattern": "^[A-Za-z0-9_-]+$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "credentialId",
                      "clientDataJSON",
                      "authenticatorData",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "near",
                        "description": "A NEP-413 `signMessage` result over `{message, nonce, recipient}`, where `recipient` is the host of Fin's audience."
                      },
                      "publicKey": {
                        "type": "string",
                        "pattern": "^ed25519:[1-9A-HJ-NP-Za-km-z]{32,44}$",
                        "description": "The signing key as the wallet reports it (`ed25519:` then base58)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "nonce": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$",
                        "description": "The 32-byte nonce the caller gave the wallet, in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "publicKey",
                      "signature",
                      "nonce"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "solana",
                        "description": "A Solana `signMessage` Ed25519 signature over the exact UTF-8 message bytes."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "stellar",
                        "description": "A SEP-53 signature: Ed25519 over sha256(\"Stellar Signed Message:\\n\" + message)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "ton",
                        "description": "A TON Connect `signData` result for a `text` payload that is exactly the message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "address": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "description": "The signing wallet's address exactly as the wallet returned it."
                      },
                      "domain": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 253,
                        "description": "The dApp domain the wallet attested; it must be a partner-registered origin's host."
                      },
                      "timestamp": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991,
                        "description": "The wallet's signing time in UNIX seconds; it must be within five minutes."
                      }
                    },
                    "required": [
                      "kind",
                      "signature",
                      "address",
                      "domain",
                      "timestamp"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "tron",
                        "description": "A TIP-191 `signMessageV2` signature over the exact message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte recoverable secp256k1 signature in hexadecimal."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  }
                ],
                "description": "The user's signature of the `message`, exactly as the API returned it."
              }
            },
            "required": [
              "controllerId",
              "expiresAt",
              "signature"
            ],
            "additionalProperties": false,
            "description": "The user's signature of the prepared trade's `authorization.message`, with its `controllerId` and `expiresAt` unchanged. Checked on arrival and never stored."
          }
        },
        "required": [
          "trade",
          "authorization"
        ],
        "additionalProperties": false
      },
      "SwapQuoteRequestInput": {
        "type": "object",
        "properties": {
          "sellAssetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to sell from the agent wallet: an `assetId` from Get balances."
          },
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The exact amount to sell, in the sold asset's smallest unit."
          },
          "buyAssetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to buy: an `id` from List supported assets. It stays in the agent wallet."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 300,
            "description": "The most the swap may lose in total, fees and price movement included, in basis points (100 = 1%), from 1 to 300."
          },
          "context": {
            "type": "object",
            "properties": {
              "country": {
                "description": "The country the user is making this request from, as an uppercase ISO 3166-1 alpha-2 code such as `GB`, resolved by your server from the request (your edge's IP geolocation), never taken from the browser. A tokenized stock is traded only when this reports a country where it is available.",
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              }
            },
            "additionalProperties": false,
            "description": "What your app knows about the user as they make this request. It applies to this request only, so send it with every request that may trade a tokenized stock."
          }
        },
        "required": [
          "sellAssetId",
          "amountRaw",
          "buyAssetId",
          "maxValueLossBps"
        ],
        "additionalProperties": false,
        "description": "What to sell, how much, what to buy, and the most the swap may lose; the quote fills in the rest. A swap of a tokenized stock also needs `context.country`."
      },
      "SwapTokensInput": {
        "type": "object",
        "properties": {
          "terms": {
            "description": "The quote's `terms`, unchanged.",
            "$ref": "#/components/schemas/SwapTermsInput"
          },
          "authorization": {
            "type": "object",
            "properties": {
              "controllerId": {
                "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 `controllerId` returned with the message, unchanged: the wallet that signed."
              },
              "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 `expiresAt` returned with the message, unchanged, character for character."
              },
              "signature": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "evm",
                        "description": "An EIP-191 personal-message signature by the current controller."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte hexadecimal signature over the exact supplied message."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "webauthn",
                        "description": "A user-verified WebAuthn assertion over the message digest."
                      },
                      "credentialId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The signing credential identifier encoded as base64url."
                      },
                      "clientDataJSON": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's client-data JSON bytes encoded as base64url."
                      },
                      "authenticatorData": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator data bytes encoded as base64url."
                      },
                      "signature": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's signature encoded as base64url."
                      },
                      "userHandle": {
                        "description": "The optional authenticator user handle encoded as base64url.",
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 8192,
                            "pattern": "^[A-Za-z0-9_-]+$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "credentialId",
                      "clientDataJSON",
                      "authenticatorData",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "near",
                        "description": "A NEP-413 `signMessage` result over `{message, nonce, recipient}`, where `recipient` is the host of Fin's audience."
                      },
                      "publicKey": {
                        "type": "string",
                        "pattern": "^ed25519:[1-9A-HJ-NP-Za-km-z]{32,44}$",
                        "description": "The signing key as the wallet reports it (`ed25519:` then base58)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "nonce": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$",
                        "description": "The 32-byte nonce the caller gave the wallet, in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "publicKey",
                      "signature",
                      "nonce"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "solana",
                        "description": "A Solana `signMessage` Ed25519 signature over the exact UTF-8 message bytes."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "stellar",
                        "description": "A SEP-53 signature: Ed25519 over sha256(\"Stellar Signed Message:\\n\" + message)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "ton",
                        "description": "A TON Connect `signData` result for a `text` payload that is exactly the message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "address": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "description": "The signing wallet's address exactly as the wallet returned it."
                      },
                      "domain": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 253,
                        "description": "The dApp domain the wallet attested; it must be a partner-registered origin's host."
                      },
                      "timestamp": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991,
                        "description": "The wallet's signing time in UNIX seconds; it must be within five minutes."
                      }
                    },
                    "required": [
                      "kind",
                      "signature",
                      "address",
                      "domain",
                      "timestamp"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "tron",
                        "description": "A TIP-191 `signMessageV2` signature over the exact message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte recoverable secp256k1 signature in hexadecimal."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  }
                ],
                "description": "The user's signature of the `message`, exactly as the API returned it."
              }
            },
            "required": [
              "controllerId",
              "expiresAt",
              "signature"
            ],
            "additionalProperties": false,
            "description": "The user's signature of the quote's `authorization.message`, with its `controllerId` and `expiresAt` unchanged. Checked on arrival and never stored."
          },
          "context": {
            "description": "What your app knows about the user as they make this request. A swap of a tokenized stock needs `context.country` again here: it applies to this request only, and a retry that finds its swap needs none.",
            "type": "object",
            "properties": {
              "country": {
                "description": "The country the user is making this request from, as an uppercase ISO 3166-1 alpha-2 code such as `GB`, resolved by your server from the request (your edge's IP geolocation), never taken from the browser. A tokenized stock is traded only when this reports a country where it is available.",
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "terms",
          "authorization"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "terms": {
              "sellAssetId": "asset_1111111111111111111111111111111111111111111111111111111111111111",
              "amountRaw": "1000000",
              "buyAssetId": "asset_3333333333333333333333333333333333333333333333333333333333333333",
              "minimumReceivedRaw": "331250000000000000000000",
              "maxValueLossBps": 250
            },
            "authorization": {
              "controllerId": "ee79012b-d19c-44f8-aef8-828b88142809",
              "expiresAt": "2026-09-22T18:04:30.000Z",
              "signature": {
                "kind": "evm",
                "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
              }
            }
          }
        ],
        "description": "A quoted swap and the user's signature allowing it."
      },
      "WalletSetupSignatureInput": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "standard": {
                "type": "string",
                "const": "nep366"
              },
              "payload": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {},
                "description": "The `intent.payload` the user signed, unchanged."
              },
              "signed_delegate": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16384,
                "pattern": "^[A-Za-z0-9+/]+={0,2}$",
                "description": "The signed delegate action the NEAR wallet answered (`signedDelegateActions[0]`), base64."
              }
            },
            "required": [
              "standard",
              "payload",
              "signed_delegate"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "standard": {
                "type": "string",
                "const": "nep413"
              },
              "payload": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {},
                "description": "The `intent.payload` the user signed, unchanged."
              },
              "public_key": {
                "type": "string",
                "pattern": "^ed25519:[1-9A-HJ-NP-Za-km-z]{32,44}$",
                "description": "The key that signed, as the NEAR wallet reports it."
              },
              "signature": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "The signature the NEAR wallet answered, as it answered it."
              }
            },
            "required": [
              "standard",
              "payload",
              "public_key",
              "signature"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "standard": {
                "type": "string",
                "const": "eip712"
              },
              "payload": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {},
                "description": "The `intent.payload` the user signed, unchanged."
              },
              "signature": {
                "type": "string",
                "pattern": "^0x[0-9a-fA-F]{130}$",
                "description": "The 65-byte typed-data signature the EVM wallet answered."
              }
            },
            "required": [
              "standard",
              "payload",
              "signature"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "standard": {
                "type": "string",
                "const": "webauthn"
              },
              "payload": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {},
                "description": "The `intent.payload` the user signed, unchanged."
              },
              "credential": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 8192,
                    "pattern": "^[A-Za-z0-9_-]+$"
                  },
                  "rawId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 8192,
                    "pattern": "^[A-Za-z0-9_-]+$"
                  },
                  "type": {
                    "type": "string",
                    "const": "public-key"
                  },
                  "response": {
                    "type": "object",
                    "properties": {
                      "clientDataJSON": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$"
                      },
                      "authenticatorData": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$"
                      },
                      "signature": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$"
                      },
                      "userHandle": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 8192,
                            "pattern": "^[A-Za-z0-9_-]+$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "clientDataJSON",
                      "authenticatorData",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  "clientExtensionResults": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "authenticatorAttachment": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "rawId",
                  "type",
                  "response",
                  "clientExtensionResults"
                ],
                "additionalProperties": false,
                "description": "The passkey assertion, as `startAuthentication` answers it (JSON-encoded)."
              }
            },
            "required": [
              "standard",
              "payload",
              "credential"
            ],
            "additionalProperties": false
          }
        ],
        "description": "The setup step's `intent` with the user's wallet output added: `signed_delegate` for `nep366`, `public_key` and `signature` for `nep413`, `signature` for `eip712`, `credential` for `webauthn`."
      },
      "ContinueWalletSetupInput": {
        "type": "object",
        "properties": {
          "setupId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "The `step.setupId` the user signed."
          },
          "signature": {
            "$ref": "#/components/schemas/WalletSetupSignatureInput"
          }
        },
        "required": [
          "setupId",
          "signature"
        ],
        "additionalProperties": false,
        "description": "The user's signature of one wallet setup step."
      },
      "RenewWalletAccessInput": {
        "type": "object",
        "properties": {
          "authorization": {
            "type": "object",
            "properties": {
              "controllerId": {
                "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 `controllerId` returned with the message, unchanged: the wallet that signed."
              },
              "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 `expiresAt` returned with the message, unchanged, character for character."
              },
              "signature": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "evm",
                        "description": "An EIP-191 personal-message signature by the current controller."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte hexadecimal signature over the exact supplied message."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "webauthn",
                        "description": "A user-verified WebAuthn assertion over the message digest."
                      },
                      "credentialId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The signing credential identifier encoded as base64url."
                      },
                      "clientDataJSON": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's client-data JSON bytes encoded as base64url."
                      },
                      "authenticatorData": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator data bytes encoded as base64url."
                      },
                      "signature": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's signature encoded as base64url."
                      },
                      "userHandle": {
                        "description": "The optional authenticator user handle encoded as base64url.",
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 8192,
                            "pattern": "^[A-Za-z0-9_-]+$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "credentialId",
                      "clientDataJSON",
                      "authenticatorData",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "near",
                        "description": "A NEP-413 `signMessage` result over `{message, nonce, recipient}`, where `recipient` is the host of Fin's audience."
                      },
                      "publicKey": {
                        "type": "string",
                        "pattern": "^ed25519:[1-9A-HJ-NP-Za-km-z]{32,44}$",
                        "description": "The signing key as the wallet reports it (`ed25519:` then base58)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "nonce": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$",
                        "description": "The 32-byte nonce the caller gave the wallet, in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "publicKey",
                      "signature",
                      "nonce"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "solana",
                        "description": "A Solana `signMessage` Ed25519 signature over the exact UTF-8 message bytes."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "stellar",
                        "description": "A SEP-53 signature: Ed25519 over sha256(\"Stellar Signed Message:\\n\" + message)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "ton",
                        "description": "A TON Connect `signData` result for a `text` payload that is exactly the message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "address": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "description": "The signing wallet's address exactly as the wallet returned it."
                      },
                      "domain": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 253,
                        "description": "The dApp domain the wallet attested; it must be a partner-registered origin's host."
                      },
                      "timestamp": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991,
                        "description": "The wallet's signing time in UNIX seconds; it must be within five minutes."
                      }
                    },
                    "required": [
                      "kind",
                      "signature",
                      "address",
                      "domain",
                      "timestamp"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "tron",
                        "description": "A TIP-191 `signMessageV2` signature over the exact message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte recoverable secp256k1 signature in hexadecimal."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  }
                ],
                "description": "The user's signature of the `message`, exactly as the API returned it."
              }
            },
            "required": [
              "controllerId",
              "expiresAt",
              "signature"
            ],
            "additionalProperties": false,
            "description": "The user's signature of `renewal.message` from Get wallet account, unchanged."
          }
        },
        "required": [
          "authorization"
        ],
        "additionalProperties": false,
        "description": "The owner's request to renew the agent's access to their Agent API wallet."
      },
      "AddWalletDestinationInput": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "network": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9-]{0,63}$",
                "description": "The blockchain the destination is on: a network `id` from List supported assets, such as `eth` or `near`."
              },
              "address": {
                "type": "string",
                "pattern": "^[\\x21-\\x7e]{1,256}$",
                "description": "The destination's address on that network, exactly as withdrawals to it will name it."
              }
            },
            "required": [
              "network",
              "address"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "venue": {
                "type": "string",
                "enum": [
                  "perps",
                  "prediction",
                  "solana"
                ],
                "description": "A venue account of the agent's own that funding it pays: `perps` its Hyperliquid account, `prediction` the Polymarket bridge's deposit address for its Polymarket account, `solana` its Solana account. Fin names the exact address and chain the funding pays, opening the account first when it is new (`no_account` while a Polymarket account is still opening)."
              }
            },
            "required": [
              "venue"
            ],
            "additionalProperties": false
          }
        ],
        "description": "A place the user lets their Agent API wallet pay: an address on a network, or one of the agent's own venue accounts by its venue."
      },
      "BasketLinkInputInput": {
        "type": "object",
        "properties": {
          "piece": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5,
            "description": "The step that did not buy, as `failures[].piece` names it."
          },
          "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 order to link, as one of that step's `failures[].linkable[].operationId`."
          }
        },
        "required": [
          "piece",
          "operationId"
        ],
        "additionalProperties": false
      },
      "CreateMarketBriefInputInput": {
        "type": "object",
        "properties": {
          "scope": {
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "description": "A subject's id: `market`, `chain:<chain>`, `asset:<asset>`, `asset:<asset>@<chain>` or `stock:<TICKER>`."
            },
            "description": "The subjects to research together, one to ten, in any order."
          },
          "window": {
            "type": "string",
            "enum": [
              "24h"
            ],
            "description": "The window the brief explains. Only `24h` today."
          },
          "mode": {
            "description": "Use `news` to research even a quiet price move; `auto`, the default, may return a free quiet brief.",
            "type": "string",
            "enum": [
              "auto",
              "news"
            ]
          }
        },
        "required": [
          "scope",
          "window"
        ],
        "additionalProperties": false,
        "description": "What a market brief should explain."
      },
      "OrderRequestInput": {
        "type": "object",
        "properties": {
          "sellAssetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to sell from the agent wallet: an `assetId` from Get balances."
          },
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The exact amount to sell, in the sold asset's smallest unit. It leaves the agent wallet when the order is placed."
          },
          "buyAssetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to buy: an `id` from List supported assets. What the order buys comes back to the agent wallet."
          },
          "limitPrice": {
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d{0,38})(\\.\\d{1,38})?$",
            "description": "The least the order sells at, as bought-asset units per ONE sold unit, written as a plain decimal: \"5\" means at least 5 of the bought asset for each one sold. Never scale it by decimals."
          },
          "expiresInHours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 720,
            "description": "How long the order rests before it expires, in whole hours from 1 to 720 (30 days)."
          },
          "context": {
            "type": "object",
            "properties": {
              "country": {
                "description": "The country the user is making this request from, as an uppercase ISO 3166-1 alpha-2 code such as `GB`, resolved by your server from the request (your edge's IP geolocation), never taken from the browser. A tokenized stock is traded only when this reports a country where it is available.",
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              }
            },
            "additionalProperties": false,
            "description": "What your app knows about the user as they make this request. It applies to this request only, so send it with every request that may trade a tokenized stock."
          }
        },
        "required": [
          "sellAssetId",
          "amountRaw",
          "buyAssetId",
          "limitPrice",
          "expiresInHours"
        ],
        "additionalProperties": false,
        "description": "What to sell, how much, what to buy, the least it sells at and how long it rests; preparing fills in the least the whole order receives. An order of a tokenized stock also needs `context.country`."
      },
      "PlaceOrderInput": {
        "type": "object",
        "properties": {
          "terms": {
            "description": "The prepared order's `terms`, unchanged.",
            "$ref": "#/components/schemas/OrderTermsInput"
          },
          "authorization": {
            "type": "object",
            "properties": {
              "controllerId": {
                "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 `controllerId` returned with the message, unchanged: the wallet that signed."
              },
              "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 `expiresAt` returned with the message, unchanged, character for character."
              },
              "signature": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "evm",
                        "description": "An EIP-191 personal-message signature by the current controller."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte hexadecimal signature over the exact supplied message."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "webauthn",
                        "description": "A user-verified WebAuthn assertion over the message digest."
                      },
                      "credentialId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The signing credential identifier encoded as base64url."
                      },
                      "clientDataJSON": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's client-data JSON bytes encoded as base64url."
                      },
                      "authenticatorData": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator data bytes encoded as base64url."
                      },
                      "signature": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's signature encoded as base64url."
                      },
                      "userHandle": {
                        "description": "The optional authenticator user handle encoded as base64url.",
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 8192,
                            "pattern": "^[A-Za-z0-9_-]+$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "credentialId",
                      "clientDataJSON",
                      "authenticatorData",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "near",
                        "description": "A NEP-413 `signMessage` result over `{message, nonce, recipient}`, where `recipient` is the host of Fin's audience."
                      },
                      "publicKey": {
                        "type": "string",
                        "pattern": "^ed25519:[1-9A-HJ-NP-Za-km-z]{32,44}$",
                        "description": "The signing key as the wallet reports it (`ed25519:` then base58)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "nonce": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$",
                        "description": "The 32-byte nonce the caller gave the wallet, in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "publicKey",
                      "signature",
                      "nonce"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "solana",
                        "description": "A Solana `signMessage` Ed25519 signature over the exact UTF-8 message bytes."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "stellar",
                        "description": "A SEP-53 signature: Ed25519 over sha256(\"Stellar Signed Message:\\n\" + message)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "ton",
                        "description": "A TON Connect `signData` result for a `text` payload that is exactly the message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "address": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "description": "The signing wallet's address exactly as the wallet returned it."
                      },
                      "domain": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 253,
                        "description": "The dApp domain the wallet attested; it must be a partner-registered origin's host."
                      },
                      "timestamp": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991,
                        "description": "The wallet's signing time in UNIX seconds; it must be within five minutes."
                      }
                    },
                    "required": [
                      "kind",
                      "signature",
                      "address",
                      "domain",
                      "timestamp"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "tron",
                        "description": "A TIP-191 `signMessageV2` signature over the exact message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte recoverable secp256k1 signature in hexadecimal."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  }
                ],
                "description": "The user's signature of the `message`, exactly as the API returned it."
              }
            },
            "required": [
              "controllerId",
              "expiresAt",
              "signature"
            ],
            "additionalProperties": false,
            "description": "The user's signature of the prepared order's `authorization.message`, with its `controllerId` and `expiresAt` unchanged. Checked on arrival and never stored."
          },
          "context": {
            "description": "What your app knows about the user as they make this request. An order of a tokenized stock needs `context.country` again here: it applies to this request only, and a retry that finds its order needs none.",
            "type": "object",
            "properties": {
              "country": {
                "description": "The country the user is making this request from, as an uppercase ISO 3166-1 alpha-2 code such as `GB`, resolved by your server from the request (your edge's IP geolocation), never taken from the browser. A tokenized stock is traded only when this reports a country where it is available.",
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "terms",
          "authorization"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "terms": {
              "sellAssetId": "asset_1111111111111111111111111111111111111111111111111111111111111111",
              "amountRaw": "100000000",
              "buyAssetId": "asset_3333333333333333333333333333333333333333333333333333333333333333",
              "limitPrice": "0.357142857143",
              "minimumReceivedRaw": "35714285714300000000000000",
              "expiresInHours": 720
            },
            "authorization": {
              "controllerId": "ee79012b-d19c-44f8-aef8-828b88142809",
              "expiresAt": "2026-09-22T18:04:30.000Z",
              "signature": {
                "kind": "evm",
                "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
              }
            }
          }
        ],
        "description": "A prepared limit order and the user's signature allowing it."
      },
      "PlacePredictionOrderInput": {
        "type": "object",
        "properties": {
          "order": {
            "description": "The prepared order, unchanged.",
            "$ref": "#/components/schemas/PredictionOrderInputInput"
          },
          "authorization": {
            "type": "object",
            "properties": {
              "controllerId": {
                "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 `controllerId` returned with the message, unchanged: the wallet that signed."
              },
              "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 `expiresAt` returned with the message, unchanged, character for character."
              },
              "signature": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "evm",
                        "description": "An EIP-191 personal-message signature by the current controller."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte hexadecimal signature over the exact supplied message."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "webauthn",
                        "description": "A user-verified WebAuthn assertion over the message digest."
                      },
                      "credentialId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The signing credential identifier encoded as base64url."
                      },
                      "clientDataJSON": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's client-data JSON bytes encoded as base64url."
                      },
                      "authenticatorData": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator data bytes encoded as base64url."
                      },
                      "signature": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "pattern": "^[A-Za-z0-9_-]+$",
                        "description": "The authenticator's signature encoded as base64url."
                      },
                      "userHandle": {
                        "description": "The optional authenticator user handle encoded as base64url.",
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 8192,
                            "pattern": "^[A-Za-z0-9_-]+$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "credentialId",
                      "clientDataJSON",
                      "authenticatorData",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "near",
                        "description": "A NEP-413 `signMessage` result over `{message, nonce, recipient}`, where `recipient` is the host of Fin's audience."
                      },
                      "publicKey": {
                        "type": "string",
                        "pattern": "^ed25519:[1-9A-HJ-NP-Za-km-z]{32,44}$",
                        "description": "The signing key as the wallet reports it (`ed25519:` then base58)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "nonce": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$",
                        "description": "The 32-byte nonce the caller gave the wallet, in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "publicKey",
                      "signature",
                      "nonce"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "solana",
                        "description": "A Solana `signMessage` Ed25519 signature over the exact UTF-8 message bytes."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "stellar",
                        "description": "A SEP-53 signature: Ed25519 over sha256(\"Stellar Signed Message:\\n\" + message)."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "ton",
                        "description": "A TON Connect `signData` result for a `text` payload that is exactly the message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9+/]{86}==$",
                        "description": "The 64-byte Ed25519 signature in padded standard base64."
                      },
                      "address": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "description": "The signing wallet's address exactly as the wallet returned it."
                      },
                      "domain": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 253,
                        "description": "The dApp domain the wallet attested; it must be a partner-registered origin's host."
                      },
                      "timestamp": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991,
                        "description": "The wallet's signing time in UNIX seconds; it must be within five minutes."
                      }
                    },
                    "required": [
                      "kind",
                      "signature",
                      "address",
                      "domain",
                      "timestamp"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "tron",
                        "description": "A TIP-191 `signMessageV2` signature over the exact message."
                      },
                      "signature": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{130}$",
                        "description": "The 65-byte recoverable secp256k1 signature in hexadecimal."
                      }
                    },
                    "required": [
                      "kind",
                      "signature"
                    ],
                    "additionalProperties": false
                  }
                ],
                "description": "The user's signature of the `message`, exactly as the API returned it."
              }
            },
            "required": [
              "controllerId",
              "expiresAt",
              "signature"
            ],
            "additionalProperties": false,
            "description": "The user's signature of the prepared order's `authorization.message`, with its `controllerId` and `expiresAt` unchanged. Checked on arrival and never stored."
          }
        },
        "required": [
          "order",
          "authorization"
        ],
        "additionalProperties": false
      },
      "RunFeedbackRatingInput": {
        "type": "string",
        "enum": [
          "up",
          "down"
        ],
        "description": "How the user rated the reply: `up` for a thumbs-up, `down` for a thumbs-down."
      },
      "RunFeedbackReasonInput": {
        "type": "string",
        "enum": [
          "wrong",
          "unhelpful",
          "slow",
          "unsafe",
          "other"
        ],
        "description": "Why the user rated the reply down: `wrong` it was incorrect, `unhelpful` it did not do what was asked, `slow` it took too long, `unsafe` it was risky or inappropriate, `other` none of these."
      },
      "DepositQuoteRequestInput": {
        "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."
          },
          "assetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to deposit: an `id` from List supported assets."
          },
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The amount the user would send, in the asset's smallest unit."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 300,
            "description": "The most the transfer may lose in total, fees and price movement included, in basis points (100 = 1%), from 1 to 300."
          }
        },
        "required": [
          "rail",
          "network",
          "assetId",
          "amountRaw",
          "maxValueLossBps"
        ],
        "additionalProperties": false,
        "description": "The deposit to price: what the user would send, from which network, how much, and the most it may lose."
      },
      "CreateDepositInput": {
        "type": "object",
        "properties": {
          "terms": {
            "description": "What the user sends, the least the wallet must be credited, and where a refund goes.",
            "$ref": "#/components/schemas/DepositTermsInput"
          }
        },
        "required": [
          "terms"
        ],
        "additionalProperties": false,
        "description": "The terms of a deposit into the agent wallet."
      },
      "CreateDepositAddressInput": {
        "type": "object",
        "properties": {
          "network": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "description": "The network the user sends on: a blockchain network from List supported assets, never an Intents ledger."
          },
          "assetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset the user sends: an `id` from List supported assets, listed on that network."
          }
        },
        "required": [
          "network",
          "assetId"
        ],
        "additionalProperties": false,
        "description": "The asset and network of a deposit whose amount is not known yet."
      },
      "ReportDepositTransactionInput": {
        "type": "object",
        "properties": {
          "transactionHash": {
            "type": "string",
            "pattern": "^[\\x21-\\x7e]{1,256}$",
            "description": "The hash of the transfer the user sent to the address, as their wallet or exchange shows it."
          }
        },
        "required": [
          "transactionHash"
        ],
        "additionalProperties": false,
        "description": "The transfer that paid a deposit address."
      },
      "LimitOrderContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "limit_order",
            "description": "Which contract template this is."
          },
          "order": {
            "type": "object",
            "properties": {
              "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 asset the order sells: token id and decimals."
                  }
                },
                "required": [
                  "pinned"
                ],
                "description": "The input (base) asset this order sells."
              },
              "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 asset the order buys: token id and decimals."
                  }
                },
                "required": [
                  "pinned"
                ],
                "description": "The output (quote) asset this order buys."
              },
              "quantity": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "The exact input amount to sell, in the input asset's smallest unit. 1 NEAR with verified decimals 24 is \"1000000000000000000000000\". Scale decimal digits with the verified decimals and reject excess fractional digits; no floating-point arithmetic or bash."
              },
              "limitPrice": {
                "type": "string",
                "maxLength": 80,
                "pattern": "^(0|[1-9]\\d{0,38})(\\.\\d{1,38})?$",
                "description": "The minimum price the fill must reach, as output-asset units per ONE input unit, written as a plain human decimal: \"5\" means at least 5 output tokens per 1 input token. Never scale it by decimals."
              },
              "expiresInHours": {
                "type": "integer",
                "minimum": 1,
                "maximum": 720,
                "description": "How long the order may rest before it expires, in whole hours. Use the user's duration within this wallet's maximum, or the wallet's default from the latest request's host context when none is given. The schema permits up to 720 hours (30 days); a wallet may have a lower maximum. Never shorten a requested duration to fit."
              }
            },
            "required": [
              "input",
              "output",
              "quantity",
              "limitPrice",
              "expiresInHours"
            ],
            "description": "The exact approved placement request."
          },
          "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": "The latest instant the order may be created and funded under this consent."
          }
        },
        "required": [
          "type",
          "order",
          "validUntil"
        ],
        "description": "Owner-signed authority for one resting limit order: the exact approved placement, created and funded once by the policy worker before the approval expires."
      },
      "PredictionOrderInput": {
        "type": "object",
        "properties": {
          "marketId": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,19}$"
          },
          "assetId": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,77})$"
          },
          "marketQuestion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "outcome": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "side": {
            "type": "string",
            "enum": [
              "BUY",
              "SELL"
            ]
          },
          "limitPriceUsdDecimal": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,17})(\\.[0-9]{1,6})?$"
          },
          "quantity": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "shares"
                  },
                  "sizeSharesDecimal": {
                    "type": "string",
                    "pattern": "^(0|[1-9][0-9]{0,17})(\\.[0-9]{1,6})?$"
                  }
                },
                "required": [
                  "kind",
                  "sizeSharesDecimal"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "budget"
                  },
                  "amountUsdDecimal": {
                    "type": "string",
                    "pattern": "^(0|[1-9][0-9]{0,17})(\\.[0-9]{1,6})?$"
                  }
                },
                "required": [
                  "kind",
                  "amountUsdDecimal"
                ]
              }
            ]
          },
          "orderType": {
            "type": "string",
            "enum": [
              "GTC",
              "GTD",
              "FOK",
              "FAK"
            ]
          },
          "expiresAt": {
            "type": "integer",
            "minimum": 0,
            "maximum": 253402300799
          },
          "maxFeeUsdDecimal": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,17})(\\.[0-9]{1,6})?$"
          },
          "maxSpendUsdDecimal": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,17})(\\.[0-9]{1,6})?$"
          }
        },
        "required": [
          "marketId",
          "assetId",
          "marketQuestion",
          "outcome",
          "side",
          "limitPriceUsdDecimal",
          "quantity",
          "orderType",
          "maxFeeUsdDecimal",
          "maxSpendUsdDecimal"
        ]
      },
      "PredictionOrderContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "prediction_order"
          },
          "order": {
            "$ref": "#/components/schemas/PredictionOrderInput"
          },
          "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))$"
          }
        },
        "required": [
          "type",
          "order",
          "validUntil"
        ]
      },
      "VenueFundingPayment": {
        "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."
          },
          "maxInputRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The most of the coin this funding may spend, in its smallest unit: the approved dollars at the price read when the approval opened, plus 5%."
          }
        },
        "required": [
          "tokenId",
          "decimals",
          "maxInputRaw"
        ],
        "description": "The coin this funding pays with and the most of it it may spend, as the owner approved them. Absent: the funding spends one USDC or USDT holding."
      },
      "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."
      },
      "SolanaBuyInput": {
        "type": "object",
        "properties": {
          "token": {
            "description": "The exact token to buy.",
            "$ref": "#/components/schemas/SolanaToken"
          },
          "pay": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "usdc",
                    "description": "Pay from one USDC or USDT holding of the agent wallet (USDC on NEAR, Base, Arbitrum, Ethereum or Solana, or USDT on NEAR; any USDC that covers it before USDT), moved to Solana as SOL first."
                  },
                  "amountRaw": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "Exact USDC or USDT to spend, in six-decimal atomic units: $50 is \"50000000\". At least 5 (\"5000000\"); a smaller buy is refused."
                  }
                },
                "required": [
                  "kind",
                  "amountRaw"
                ],
                "description": "Spend an exact amount of USDC or USDT from the agent wallet."
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "sol",
                    "description": "Pay with SOL already in the agent's Solana account."
                  },
                  "lamports": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "Exact SOL to spend, in lamports (nine decimals): 0.5 SOL is \"500000000\"."
                  }
                },
                "required": [
                  "kind",
                  "lamports"
                ],
                "description": "Spend an exact amount of SOL the agent's Solana account already holds."
              }
            ],
            "description": "What the buy spends, as an exact input amount. Buying an exact number of tokens is not supported."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1500,
            "description": "Explicit all-in maximum value loss in basis points, from the value paid to the value received, fees and price impact included: at least 1, at most 1500. Required; no default."
          },
          "maxSolTopUpUsdcRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The most extra USDC or USDT the funding may add to keep SOL in the Solana account for network fees, in six-decimal atomic units: \"0\" for none, at most \"1000000\" (1 USDC). Must be \"0\" when paying with SOL."
          },
          "payWith": {
            "description": "A buy paid in dollars and approved in chat as one call: the coin its funding pays with instead of a USDC or USDT holding, and the most of it it may spend, the SOL top-up included. Never SOL. A buy from a token's page refuses it.",
            "$ref": "#/components/schemas/VenueFundingPayment"
          }
        },
        "required": [
          "token",
          "pay",
          "maxValueLossBps",
          "maxSolTopUpUsdcRaw"
        ],
        "description": "One exact-input buy of a Solana token through the agent's own Solana account."
      },
      "SolanaSellInput": {
        "type": "object",
        "properties": {
          "token": {
            "description": "The exact token to sell.",
            "$ref": "#/components/schemas/SolanaToken"
          },
          "amount": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "exact",
                    "description": "Sell an exact amount of the token."
                  },
                  "amountRaw": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "Exact amount of the token to sell, in its smallest unit (scaled by the token's decimals)."
                  }
                },
                "required": [
                  "kind",
                  "amountRaw"
                ],
                "description": "Sell an exact amount of the token."
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "fraction",
                    "description": "Sell a share of what the Solana account holds of the token."
                  },
                  "bps": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10000,
                    "description": "The share to sell, in basis points of the account's balance of the token: all of it is 10000, half is 5000."
                  }
                },
                "required": [
                  "kind",
                  "bps"
                ],
                "description": "Sell a share of the account's balance of the token."
              }
            ],
            "description": "How much of the token to sell."
          },
          "receive": {
            "type": "string",
            "enum": [
              "usdc",
              "sol"
            ],
            "description": "`usdc` returns the proceeds to the agent wallet as USDC on NEAR, which is what selling means; `sol` keeps them as SOL in the agent's Solana account."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1500,
            "description": "Explicit all-in maximum value loss in basis points, from the value paid to the value received, fees and price impact included: at least 1, at most 1500. Required; no default."
          }
        },
        "required": [
          "token",
          "amount",
          "receive",
          "maxValueLossBps"
        ],
        "description": "One sell of a Solana token held in the agent's own Solana account."
      },
      "SolanaSale": {
        "type": "object",
        "properties": {
          "token": {
            "description": "The exact token to sell.",
            "$ref": "#/components/schemas/SolanaToken"
          },
          "amount": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "exact",
                    "description": "Sell an exact amount of the token."
                  },
                  "amountRaw": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "Exact amount of the token to sell, in its smallest unit (scaled by the token's decimals)."
                  }
                },
                "required": [
                  "kind",
                  "amountRaw"
                ],
                "description": "Sell an exact amount of the token."
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "fraction",
                    "description": "Sell a share of what the Solana account holds of the token."
                  },
                  "bps": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10000,
                    "description": "The share to sell, in basis points of the account's balance of the token: all of it is 10000, half is 5000."
                  }
                },
                "required": [
                  "kind",
                  "bps"
                ],
                "description": "Sell a share of the account's balance of the token."
              }
            ],
            "description": "How much of the token to sell."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1500,
            "description": "Explicit all-in maximum value loss in basis points, from the value paid to the value received, fees and price impact included: at least 1, at most 1500. Required; no default."
          }
        },
        "required": [
          "token",
          "amount",
          "maxValueLossBps"
        ],
        "description": "One coin of a multi-coin sale, sold through the agent's own Solana account."
      },
      "SolanaSellManyInput": {
        "type": "object",
        "properties": {
          "sells": {
            "minItems": 2,
            "maxItems": 6,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SolanaSale"
            },
            "description": "The coins to sell, in the order they are sold: 2 to 6, each a different mint, none of them SOL itself."
          },
          "receive": {
            "type": "string",
            "enum": [
              "usdc",
              "sol"
            ],
            "description": "`usdc` returns the summed proceeds of every sale that went through to the agent wallet as USDC on NEAR, in one transfer once the last sale ran; `sol` keeps them as SOL in the agent's Solana account."
          }
        },
        "required": [
          "sells",
          "receive"
        ],
        "description": "Several sells of Solana tokens held in the agent's own Solana account, approved together and run as one: each sale on its own, one after another, then one transfer of what they returned."
      },
      "SolanaFundInput": {
        "type": "object",
        "properties": {
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "Exact USDC or USDT to move from the agent wallet into the agent's Solana account as SOL, in six-decimal atomic units: 5 USDC is \"5000000\". Spent from one USDC or USDT holding of the agent wallet (USDC on NEAR, Base, Arbitrum, Ethereum or Solana, or USDT on NEAR; any USDC that covers it before USDT) that alone covers it, never split across holdings, or, when it pays with a coin, that coin's value of it."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300,
            "description": "Explicit maximum value loss in basis points, including provider fees: at most 300. Required; no default."
          },
          "payWith": {
            "description": "Approved in chat as one call: the coin this funding pays with instead of a USDC or USDT holding, and the most of it it may spend. Never SOL.",
            "$ref": "#/components/schemas/VenueFundingPayment"
          }
        },
        "required": [
          "amountRaw",
          "maxValueLossBps"
        ],
        "description": "Move an exact amount of USDC or USDT, or that many dollars of a coin, from the agent wallet into its own Solana account as SOL."
      },
      "SolanaWithdrawInput": {
        "type": "object",
        "properties": {
          "amount": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "exact",
                    "description": "Withdraw an exact amount of SOL."
                  },
                  "lamports": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "Exact SOL to withdraw, in lamports (nine decimals): 0.5 SOL is \"500000000\"."
                  }
                },
                "required": [
                  "kind",
                  "lamports"
                ],
                "description": "Withdraw an exact amount of SOL."
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "all_spendable",
                    "description": "Withdraw all the SOL above the reserve the account keeps for rent and network fees."
                  }
                },
                "required": [
                  "kind"
                ],
                "description": "Withdraw all the spendable SOL."
              }
            ],
            "description": "How much SOL to withdraw from the agent's Solana account."
          },
          "receive": {
            "type": "string",
            "enum": [
              "usdc",
              "sol"
            ],
            "description": "`usdc` returns it to the agent wallet as USDC on NEAR; `sol` returns it to the agent wallet as SOL."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300,
            "description": "Explicit maximum value loss in basis points, including provider fees: at most 300. Required; no default."
          }
        },
        "required": [
          "amount",
          "receive",
          "maxValueLossBps"
        ],
        "description": "Move SOL from the agent's own Solana account back to its agent wallet."
      },
      "WithdrawalTerms": {
        "type": "object",
        "properties": {
          "assetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to withdraw from the agent wallet: an `assetId` from Get balances."
          },
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The amount to withdraw, in the asset's smallest unit."
          },
          "destination": {
            "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."
              },
              "assetId": {
                "type": "string",
                "pattern": "^asset_[a-f0-9]{64}$",
                "description": "The asset the recipient receives: an `id` from List supported assets."
              },
              "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."
              }
            },
            "required": [
              "rail",
              "network",
              "assetId",
              "address"
            ],
            "description": "Where the funds go: the network, the asset received and the recipient's address."
          },
          "minimumReceivedRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The least the recipient receives, in the received asset's smallest unit."
          },
          "maxFeeRaw": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The most the withdrawal fee can be, in the received asset's smallest unit. `null` when the provider does not state this fee separately, which does not mean zero; the minimum received and the loss limit still apply."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 300,
            "description": "The most the transfer may lose in total, fees and price movement included, in basis points (100 = 1%), from 1 to 300."
          }
        },
        "required": [
          "assetId",
          "amountRaw",
          "destination",
          "minimumReceivedRaw",
          "maxFeeRaw",
          "maxValueLossBps"
        ],
        "description": "The exact terms of a withdrawal: what leaves the agent wallet, where it goes, and the limits it must stay within."
      },
      "SwapTerms": {
        "type": "object",
        "properties": {
          "sellAssetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to sell from the agent wallet: an `assetId` from Get balances."
          },
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The exact amount to sell, in the sold asset's smallest unit."
          },
          "buyAssetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to buy: an `id` from List supported assets. It stays in the agent wallet."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 300,
            "description": "The most the swap may lose in total, fees and price movement included, in basis points (100 = 1%), from 1 to 300."
          },
          "minimumReceivedRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The least the agent wallet receives of the bought asset, in its smallest unit."
          }
        },
        "required": [
          "sellAssetId",
          "amountRaw",
          "buyAssetId",
          "maxValueLossBps",
          "minimumReceivedRaw"
        ],
        "description": "The exact terms of a swap in the agent wallet: what it sells, what it buys, and the limits it must stay within."
      },
      "OrderTerms": {
        "type": "object",
        "properties": {
          "sellAssetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to sell from the agent wallet: an `assetId` from Get balances."
          },
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The exact amount to sell, in the sold asset's smallest unit. It leaves the agent wallet when the order is placed."
          },
          "buyAssetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to buy: an `id` from List supported assets. What the order buys comes back to the agent wallet."
          },
          "limitPrice": {
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d{0,38})(\\.\\d{1,38})?$",
            "description": "The least the order sells at, as bought-asset units per ONE sold unit, written as a plain decimal: \"5\" means at least 5 of the bought asset for each one sold. Never scale it by decimals."
          },
          "expiresInHours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 720,
            "description": "How long the order rests before it expires, in whole hours from 1 to 720 (30 days)."
          },
          "minimumReceivedRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The least the whole order receives at its limit price, in the bought asset's smallest unit, rounded up. This is the floor the user signs: an order that would receive less is never placed."
          }
        },
        "required": [
          "sellAssetId",
          "amountRaw",
          "buyAssetId",
          "limitPrice",
          "expiresInHours",
          "minimumReceivedRaw"
        ],
        "description": "The exact terms of a limit order in the agent wallet: what it sells, what it buys, the least it sells at, how long it rests, and the least it receives in all."
      },
      "DepositTerms": {
        "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."
          },
          "assetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to deposit: an `id` from List supported assets."
          },
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The exact amount the user sends, in the asset's smallest unit."
          },
          "refundAddress": {
            "type": "string",
            "pattern": "^[\\x21-\\x7e]{1,256}$",
            "description": "Where the funds go back to if the deposit cannot be credited: an address the user controls on the network they send from."
          },
          "minimumCreditRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The least the agent wallet must be credited, in the same asset's smallest unit."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 300,
            "description": "The most the transfer may lose in total, fees and price movement included, in basis points (100 = 1%), from 1 to 300."
          }
        },
        "required": [
          "rail",
          "network",
          "assetId",
          "amountRaw",
          "refundAddress",
          "minimumCreditRaw",
          "maxValueLossBps"
        ],
        "description": "The exact terms of a deposit: what the user sends, from which network, and the limits the credit must stay within."
      },
      "ValueAtTime": {
        "type": "object",
        "properties": {
          "usd": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$",
            "description": "The value in US dollars as plain decimal text, rounded down to the cent: the amount times `priceUsd`."
          },
          "priceUsd": {
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$",
            "description": "The USD price of one whole token it was valued at, as plain decimal text."
          },
          "pricedAt": {
            "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 that price was observed."
          }
        },
        "required": [
          "usd",
          "priceUsd",
          "pricedAt"
        ],
        "description": "What an amount was worth in US dollars when it moved, and the price it was valued at. Display only: derived on read, never an input to a transfer or a limit."
      },
      "DepositAddress": {
        "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 deposit address's id."
          },
          "requestKey": {
            "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 `Idempotency-Key` it was created with."
          },
          "network": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "description": "The network the user sends on."
          },
          "assetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset the user sends: an `id` from List supported assets."
          },
          "state": {
            "type": "string",
            "enum": [
              "preparing",
              "awaiting_deposit",
              "incomplete",
              "processing",
              "credited",
              "refunded",
              "unknown",
              "expired",
              "failed"
            ],
            "description": "Where the deposit is: `preparing` (getting the address), `awaiting_deposit` (waiting for the user's transfer), `processing`, then `credited` or `refunded`. `incomplete` means less than `minimumDepositRaw` arrived: it is refunded to the agent wallet, so tell the user not to top it up. `failed` means no address was issued. `expired` means the address stopped taking deposits with no transfer seen; a late transfer still moves it on. `unknown` means Fin saw something it could not confirm; it never proves that no money moved, so keep checking."
          },
          "instruction": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "asset": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^asset_[a-f0-9]{64}$",
                        "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
                      },
                      "network": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9-]{0,63}$",
                        "description": "The asset's native blockchain network."
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "native",
                          "token"
                        ],
                        "description": "Native currency or a token contract according to the provider catalog."
                      },
                      "contractAddress": {
                        "anyOf": [
                          {
                            "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."
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "Native-chain token identifier; null for native currency."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 38,
                        "description": "Atomic-unit precision."
                      },
                      "symbol": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 64,
                        "description": "Display label; the asset id determines identity."
                      }
                    },
                    "required": [
                      "id",
                      "network",
                      "kind",
                      "contractAddress",
                      "decimals",
                      "symbol"
                    ],
                    "description": "The asset to send, on its network, and the precision its amounts are in."
                  },
                  "address": {
                    "type": "string",
                    "pattern": "^[\\x21-\\x7e]{1,256}$",
                    "description": "The one-time address to send to. It takes one transfer: never save or reuse it."
                  },
                  "memo": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "pattern": "^[\\x20-\\x7e]+$"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Required deposit memo or tag, exactly as returned; null means absent."
                  },
                  "minimumDepositRaw": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "The least one transfer must carry to be credited, in the asset's smallest unit. Less is refunded to the agent wallet."
                  },
                  "sendBefore": {
                    "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": "Send by this time; a transfer sent later may be refunded instead of credited."
                  },
                  "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": "When the address stops taking deposits. A transfer that arrives later is still watched, and refunded to the agent wallet."
                  },
                  "creditEstimateSeconds": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 86400
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "About how long the credit takes once the network has confirmed the transfer, in seconds; null when no estimate was given."
                  }
                },
                "required": [
                  "asset",
                  "address",
                  "memo",
                  "minimumDepositRaw",
                  "sendBefore",
                  "expiresAt",
                  "creditEstimateSeconds"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Where and what to send; `null` until the address is issued."
          },
          "receipt": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "observedAt": {
                    "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 outcome was observed."
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "credited",
                      "refunded"
                    ],
                    "description": "Whether the transfer was credited or refunded."
                  },
                  "depositedRaw": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "What arrived at the address."
                  },
                  "creditedRaw": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "What the agent wallet was credited; zero when all of it was refunded."
                  },
                  "refundedRaw": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "What went back to the agent wallet uncredited, such as a transfer below the minimum."
                  },
                  "sourceTransactionHashes": {
                    "minItems": 1,
                    "maxItems": 32,
                    "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 transfers that paid the address, on the network they were sent on."
                  },
                  "refundTransactionHashes": {
                    "maxItems": 32,
                    "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 refund's ledger identifiers, when they were reported."
                  }
                },
                "required": [
                  "observedAt",
                  "state",
                  "depositedRaw",
                  "creditedRaw",
                  "refundedRaw",
                  "sourceTransactionHashes",
                  "refundTransactionHashes"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "What arrived, what was credited and what was refunded; `null` until then."
          },
          "seenAt": {
            "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 Fin first saw the user's transfer: the first check that found it on its way, or already credited or refunded. `null` until then, and for a transfer Fin saw before it kept this."
          },
          "arrivedRaw": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$"
              },
              {
                "type": "null"
              }
            ],
            "description": "What 1Click reported arriving while it confirmed the transfer, in the asset's smallest unit; `null` until it reports a figure. For display while it confirms: `receipt` records what was finally credited."
          },
          "value": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ValueAtTime"
              },
              {
                "type": "null"
              }
            ],
            "description": "What was credited (`receipt.creditedRaw`) was worth when it was credited, at the price Fin recorded with the credit. `null` until it is credited, and when no fresh price was known then."
          },
          "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 deposit address was created."
          },
          "updatedAt": {
            "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 it last changed."
          }
        },
        "required": [
          "id",
          "requestKey",
          "network",
          "assetId",
          "state",
          "instruction",
          "receipt",
          "seenAt",
          "arrivedRaw",
          "value",
          "createdAt",
          "updatedAt"
        ],
        "description": "A one-time address that takes one transfer of any amount into the agent wallet, and how that transfer is going."
      },
      "PerpsTrigger": {
        "type": "object",
        "properties": {
          "triggerPrice": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,19})(\\.[0-9]{0,11}[1-9])?$",
            "description": "The mark price that fires this exit."
          },
          "limitPrice": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,19})(\\.[0-9]{0,11}[1-9])?$",
            "description": "The worst price the exit may fill at once fired; it executes as a market order within it."
          }
        },
        "required": [
          "triggerPrice",
          "limitPrice"
        ],
        "description": "A reduce-only market exit on the same size: fires at triggerPrice and fills no worse than limitPrice."
      },
      "PerpsTrailingStop": {
        "type": "object",
        "properties": {
          "retracement": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "percent": {
                    "type": "string",
                    "pattern": "^(0|[1-9][0-9]?)(\\.[0-9]{0,3}[1-9])?$",
                    "description": "How far the mark price may reverse from its best since activation, in percent: `2` is 2%."
                  }
                },
                "required": [
                  "percent"
                ],
                "description": "Trail by a percentage of the best mark price."
              },
              {
                "type": "object",
                "properties": {
                  "price": {
                    "type": "string",
                    "pattern": "^(0|[1-9][0-9]{0,19})(\\.[0-9]{0,11}[1-9])?$",
                    "description": "How far the mark price may reverse from its best since activation, in price units."
                  }
                },
                "required": [
                  "price"
                ],
                "description": "Trail by a fixed price distance."
              }
            ],
            "description": "How far the mark price may reverse from its best before the stop fires."
          },
          "activationPrice": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]{0,19})(\\.[0-9]{0,11}[1-9])?$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The mark price that starts the trailing; null to trail from placement."
          }
        },
        "required": [
          "retracement",
          "activationPrice"
        ],
        "description": "A reduce-only market exit on the same size that follows the mark price as it moves in the position's favour and fires once it reverses by the retracement."
      },
      "PerpsOrderInput": {
        "type": "object",
        "properties": {
          "coin": {
            "type": "string",
            "pattern": "^(?:xyz:)?[A-Za-z0-9]{1,20}$",
            "description": "The market's coin name exactly as perps_markets lists it, such as `BTC` or `xyz:TSLA`."
          },
          "asset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1099999,
            "description": "The market's asset id exactly as perps_markets lists it for that coin."
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "description": "The position this order opens, adds to, reduces or protects. A reduce-only entry on a long position sells."
          },
          "size": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,19})(\\.[0-9]{0,11}[1-9])?$",
            "description": "Exact size in the coin, at most the market's `szDecimals` places."
          },
          "leverage": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              },
              {
                "type": "null"
              }
            ],
            "description": "Leverage the user chose for this market, at most the market's maximum. Required for an entry that is not reduce-only; null otherwise. Never assume it: ask the user."
          },
          "marginMode": {
            "description": "How the position is margined, which the user chose with the leverage: `cross` shares the account's margin with every cross position, `isolated` puts only this position's own margin at risk (perps_margin_update adds or removes it later). Present exactly when leverage is; an isolated-only market (perps_markets `onlyIsolated`) takes `isolated`. Never assume it: ask the user. Absent on orders approved before margin modes existed, which were cross.",
            "type": "string",
            "enum": [
              "cross",
              "isolated"
            ]
          },
          "entry": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "price": {
                    "type": "string",
                    "pattern": "^(0|[1-9][0-9]{0,19})(\\.[0-9]{0,11}[1-9])?$",
                    "description": "The limit price; for an immediate (`Ioc`) order, the worst price it may fill at."
                  },
                  "timeInForce": {
                    "type": "string",
                    "enum": [
                      "Gtc",
                      "Ioc",
                      "Alo"
                    ],
                    "description": "`Ioc` fills now within `price` and cancels the rest (a market order), `Gtc` rests until filled or cancelled, `Alo` rests only as a maker order."
                  },
                  "reduceOnly": {
                    "type": "boolean",
                    "description": "True to only reduce or close the existing position, never open or add."
                  }
                },
                "required": [
                  "price",
                  "timeInForce",
                  "reduceOnly"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The order itself; null for take-profit and stop-loss on the existing position only."
          },
          "takeProfit": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PerpsTrigger"
              },
              {
                "type": "null"
              }
            ],
            "description": "A reduce-only take-profit, or null."
          },
          "stopLoss": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PerpsTrigger"
              },
              {
                "type": "null"
              }
            ],
            "description": "A reduce-only stop-loss, or null."
          },
          "trailingStop": {
            "description": "A reduce-only trailing stop, placed after the order (or alone on the existing position); absent or null for none. It carries no builder fee.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/PerpsTrailingStop"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "coin",
          "asset",
          "side",
          "size",
          "leverage",
          "entry",
          "takeProfit",
          "stopLoss"
        ],
        "description": "One exact Hyperliquid order on the agent's own account, with optional exits."
      },
      "PerpsCancelInput": {
        "type": "object",
        "properties": {
          "coin": {
            "type": "string",
            "pattern": "^(?:xyz:)?[A-Za-z0-9]{1,20}$",
            "description": "The market's coin name exactly as perps_markets lists it, such as `BTC` or `xyz:TSLA`."
          },
          "asset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1099999,
            "description": "The market's asset id exactly as perps_markets lists it for that coin."
          },
          "oid": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "description": "The resting order's id exactly as perps_orders lists it."
          }
        },
        "required": [
          "coin",
          "asset",
          "oid"
        ],
        "description": "Cancel one resting order on the agent's own account."
      },
      "PerpsOrderContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "perps_order",
            "description": "Which authorization contract this is."
          },
          "order": {
            "description": "The exact approved order.",
            "$ref": "#/components/schemas/PerpsOrderInput"
          },
          "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": "The deadline after which this one-shot approval authorizes nothing."
          }
        },
        "required": [
          "type",
          "order",
          "validUntil"
        ],
        "description": "One approved Hyperliquid order, signed once exactly as approved."
      },
      "PerpsCancelContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "perps_cancel",
            "description": "Which authorization contract this is."
          },
          "cancel": {
            "description": "The exact order approved for cancelling.",
            "$ref": "#/components/schemas/PerpsCancelInput"
          },
          "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": "The deadline after which this one-shot approval authorizes nothing."
          }
        },
        "required": [
          "type",
          "cancel",
          "validUntil"
        ],
        "description": "One approved cancellation of one resting Hyperliquid order."
      },
      "PerpsPlacementOutcome": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "entry",
              "take_profit",
              "stop_loss",
              "trailing_stop"
            ],
            "description": "Which part of the order: `entry`, `take_profit`, `stop_loss` or `trailing_stop`."
          },
          "cloid": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^0x[0-9a-f]{32}$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The client order id it is reconciled by; null for a trailing stop, which Hyperliquid gives none and the host matches by its terms instead."
          },
          "state": {
            "type": "string",
            "enum": [
              "filled",
              "resting",
              "triggered_pending",
              "triggered",
              "cancelled",
              "rejected",
              "unknown"
            ],
            "description": "`filled` executed (possibly partly; see `filledSize`), `resting` waits on the book, `triggered_pending` is an exit waiting for its trigger, `triggered` is an exit whose trigger fired and became a market order (its fill is in the account's fills, not here), `rejected` never placed, `unknown` not yet known: never resubmit it."
          },
          "oid": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Hyperliquid's order id once it named one; null for a trigger it answered without one, or an answer not yet known."
          },
          "filledSize": {
            "description": "How much filled, in the coin, as Hyperliquid wrote it; null when nothing filled or it did not say.",
            "type": [
              "string",
              "null"
            ]
          },
          "averagePrice": {
            "description": "The average fill price, as Hyperliquid wrote it; null when it did not say.",
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "description": "Hyperliquid's own refusal text for this placement; null otherwise."
          }
        },
        "required": [
          "role",
          "cloid",
          "state",
          "oid",
          "filledSize",
          "averagePrice",
          "error"
        ],
        "description": "What one placement of an order came to on Hyperliquid."
      },
      "PerpsOrderOutcome": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "placed",
              "rejected",
              "uncertain",
              "cancelled",
              "applied",
              "not_executed"
            ],
            "description": "`placed` Hyperliquid accepted the order (see each placement), `rejected` it accepted none (or refused the margin change), `uncertain` the answer was lost and the host reconciles what is still unknown by client order id (a trailing stop with no answer only when one order matches its terms; a margin change from the account's own transaction list), `cancelled` the cancellation took effect, `applied` the margin change took effect, `not_executed` nothing was signed."
          },
          "placements": {
            "maxItems": 4,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PerpsPlacementOutcome"
            },
            "description": "Each placement's own answer, in the order's order: entry, take-profit, stop-loss, then trailing stop."
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "description": "Why nothing was placed or the cancellation did not take effect, in Hyperliquid's or the host's words; null otherwise."
          }
        },
        "required": [
          "status",
          "placements",
          "reason"
        ],
        "description": "The result of one approved perps order, cancellation or margin change."
      },
      "PerpsAutomationAction": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "reduce",
                "description": "Reduce or close the position."
              },
              "fractionBps": {
                "type": "integer",
                "minimum": 1,
                "maximum": 10000,
                "description": "How much of the position to close, in basis points: 10000 closes it all."
              },
              "maxSlippageBps": {
                "type": "integer",
                "minimum": 1,
                "maximum": 500,
                "description": "The worst fill allowed, in basis points from the mark when it fires."
              }
            },
            "required": [
              "kind",
              "fractionBps",
              "maxSlippageBps"
            ],
            "description": "Close part or all of the position with a reduce-only market order."
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "add_margin",
                "description": "Add margin to the perps account."
              },
              "amountRaw": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "Exact USDC moved from the agent wallet into the perps account, six decimals: 5 USDC is \"5000000\"."
              },
              "maxValueLossBps": {
                "type": "integer",
                "minimum": 0,
                "maximum": 300,
                "description": "Maximum value lost to fees moving it, in basis points."
              }
            },
            "required": [
              "kind",
              "amountRaw",
              "maxValueLossBps"
            ],
            "description": "Fund the agent's own perps account from its agent wallet."
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "open",
                "description": "Open the position at market."
              },
              "notionalUsd": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]{0,6})(\\.[0-9]{1,2})?$",
                "description": "The position's size in US dollars at the mark when it fires, at most two places: a $200 position is \"200\". The size in the coin is this over the mark, rounded down to the market's size precision."
              },
              "leverage": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "Leverage the user chose for this market, at most the market's maximum. Never assume it: ask the user."
              },
              "marginMode": {
                "type": "string",
                "enum": [
                  "cross",
                  "isolated"
                ],
                "description": "How the position is margined, which the user chose with the leverage: `cross` shares the account's margin, `isolated` risks only this position's own. An isolated-only market takes `isolated`. Never assume it: ask the user."
              },
              "maxSlippageBps": {
                "type": "integer",
                "minimum": 1,
                "maximum": 500,
                "description": "The worst fill allowed, in basis points from the mark when it fires; the take-profit and stop-loss fill within the same bound of their trigger."
              },
              "takeProfitPercent": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^(0|[1-9][0-9]?)(\\.[0-9]{0,3}[1-9])?$"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "A native take-profit this far from the mark when it opens, in percent of price in the position's favour (\"10\" is 10%), or null for none."
              },
              "stopLossPercent": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^(0|[1-9][0-9]?)(\\.[0-9]{0,3}[1-9])?$"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "A native stop-loss this far from the mark when it opens, in percent of price against the position (\"5\" is 5%), or null for none."
              }
            },
            "required": [
              "kind",
              "notionalUsd",
              "leverage",
              "marginMode",
              "maxSlippageBps",
              "takeProfitPercent",
              "stopLossPercent"
            ],
            "description": "Open the position with a market order, only while the agent holds nothing on this coin, optionally protected by a native take-profit and stop-loss."
          }
        ],
        "description": "What a perps automation does each time its rule fires: open the named position while the agent holds nothing on its coin, reduce the named position, or add margin to the agent's own perps account."
      },
      "PerpsAutomationContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "perps_automation",
            "description": "Which authorization contract this is."
          },
          "coin": {
            "type": "string",
            "pattern": "^(?:xyz:)?[A-Za-z0-9]{1,20}$",
            "description": "The market's coin name exactly as perps_markets lists it, such as `BTC` or `xyz:TSLA`."
          },
          "asset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1099999,
            "description": "The market's asset id exactly as perps_markets lists it for that coin."
          },
          "position": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "description": "The position the action is for. `open` acts only while the agent holds nothing on this coin; `reduce` and `add_margin` act only while it holds this side, and nothing happens otherwise."
          },
          "action": {
            "$ref": "#/components/schemas/PerpsAutomationAction"
          },
          "maxExecutions": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "How many firings may act under this approval."
          },
          "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": "The deadline after which this approval authorizes nothing."
          }
        },
        "required": [
          "type",
          "coin",
          "asset",
          "position",
          "action",
          "maxExecutions",
          "validUntil"
        ],
        "description": "A standing approval for one perps automation: open the agent's own position while it holds nothing on the coin, reduce or close it, or add margin to its own account, each time its rule fires, up to its limits."
      },
      "PerpsMarginInput": {
        "type": "object",
        "properties": {
          "coin": {
            "type": "string",
            "pattern": "^(?:xyz:)?[A-Za-z0-9]{1,20}$",
            "description": "The market's coin name exactly as perps_markets lists it, such as `BTC` or `xyz:TSLA`."
          },
          "asset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1099999,
            "description": "The market's asset id exactly as perps_markets lists it for that coin."
          },
          "change": {
            "type": "string",
            "enum": [
              "add",
              "remove"
            ],
            "description": "`add` moves USDC from the account into the position's isolated margin, lowering its liquidation risk; `remove` takes it back out, raising that risk. A strict isolated market never lets margin be removed while the position is open."
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,8})(\\.[0-9]{0,5}[1-9])?$",
            "description": "Exact USDC to move, at most six decimal places, such as `25` or `12.5`."
          }
        },
        "required": [
          "coin",
          "asset",
          "change",
          "amount"
        ],
        "description": "Add or remove margin on one isolated position on the agent's own account."
      },
      "PerpsMarginContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "perps_margin",
            "description": "Which authorization contract this is."
          },
          "margin": {
            "description": "The exact approved margin change.",
            "$ref": "#/components/schemas/PerpsMarginInput"
          },
          "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": "The deadline after which this one-shot approval authorizes nothing."
          }
        },
        "required": [
          "type",
          "margin",
          "validUntil"
        ],
        "description": "One approved change to one isolated position's margin, signed once exactly as approved."
      },
      "PerpsTransferInput": {
        "type": "object",
        "properties": {
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "Exact amount in six-decimal atomic units in either direction: 5 USDC is \"5000000\". A withdrawal returns USDC. A funding spends it from one USDC or USDT holding of the agent wallet (USDC on NEAR, Base, Arbitrum, Ethereum or Solana, or USDT on NEAR; any USDC that covers it before USDT) that alone covers it, never split across holdings, or, when it pays with a coin, that coin's value of it; Hyperliquid receives USDC. Never supply an address."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300,
            "description": "Explicit maximum value loss in basis points, including provider fees and any swap or cross-chain hop of the USDC, USDT or coin a funding spends. Required; no default."
          },
          "payWith": {
            "description": "A funding only, approved in chat as one call: the coin it pays with instead of a USDC or USDT holding, and the most of it it may spend. A withdrawal never carries it.",
            "$ref": "#/components/schemas/VenueFundingPayment"
          }
        },
        "required": [
          "amountRaw",
          "maxValueLossBps"
        ],
        "description": "An exact transfer between the agent's own wallet and its perps account, which holds USDC."
      },
      "PerpsTransferContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "perps_transfer",
            "description": "Which authorization contract this is."
          },
          "direction": {
            "type": "string",
            "enum": [
              "fund",
              "withdraw"
            ],
            "description": "Fund the own perps account from the agent wallet, or withdraw back to the same agent wallet."
          },
          "transfer": {
            "description": "The exact approved amount and all-in loss bound, and, for a funding paid with a coin, that coin and the most of it it may spend.",
            "$ref": "#/components/schemas/PerpsTransferInput"
          },
          "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": "The deadline after which this one-shot approval authorizes nothing."
          }
        },
        "required": [
          "type",
          "direction",
          "transfer",
          "validUntil"
        ],
        "description": "One approved perps transfer in exactly the named direction."
      },
      "PerpsFreedWithdrawalInput": {
        "type": "object",
        "properties": {
          "upToRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The most this withdrawal may move, in six-decimal atomic USDC: what the exit before it frees, sized by the host before the approval opens. Never more than the exit freed."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300,
            "description": "Explicit maximum value loss in basis points, including provider fees and any swap or cross-chain hop of the USDC, USDT or coin a funding spends. Required; no default."
          }
        },
        "required": [
          "upToRaw",
          "maxValueLossBps"
        ],
        "description": "Withdraw to the agent's own confidential Intents wallet what the exit before it freed on its own Hyperliquid account, never more than upToRaw."
      },
      "PerpsFreedWithdrawalContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "perps_freed_withdrawal",
            "description": "Which authorization contract this is."
          },
          "withdrawal": {
            "description": "The signed maximum and all-in loss bound of the withdrawal home.",
            "$ref": "#/components/schemas/PerpsFreedWithdrawalInput"
          },
          "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": "The deadline after which this one-shot approval authorizes nothing."
          }
        },
        "required": [
          "type",
          "withdrawal",
          "validUntil"
        ],
        "description": "One withdrawal home of what a cash-out's exit freed on Hyperliquid, at most the signed maximum. Only ever a piece of a cash-out."
      },
      "PredictionAutomationAction": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "buy",
                "description": "Buy shares of the outcome."
              },
              "amountUsdDecimal": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]{0,6})(\\.[0-9]{1,2})?$",
                "description": "The USD each firing spends before fees, to the cent: \"50\" is $50. Each buy is an immediate order that fills what it can at once and cancels the rest."
              },
              "maxPriceUsdDecimal": {
                "type": "string",
                "pattern": "^0\\.[0-9]{1,4}$",
                "description": "The most a share may cost, as the market's chance: \"0.32\" never pays more than 32¢ a share. Use a price on the market's tick."
              },
              "maxFeeUsdDecimal": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]{0,6})(\\.[0-9]{1,6})?$",
                "description": "The most each firing may pay Polymarket in fees, in USD: \"1\" is $1."
              }
            },
            "required": [
              "kind",
              "amountUsdDecimal",
              "maxPriceUsdDecimal",
              "maxFeeUsdDecimal"
            ],
            "description": "Buy the outcome with a USD budget at no more than a maximum price."
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "sell",
                "description": "Sell shares of the outcome."
              },
              "fractionBps": {
                "type": "integer",
                "minimum": 1,
                "maximum": 10000,
                "description": "How much of the agent's holding of the outcome each firing sells, in basis points: 10000 sells it all."
              },
              "minPriceUsdDecimal": {
                "type": "string",
                "pattern": "^0\\.[0-9]{1,4}$",
                "description": "The least a share may sell for, as the market's chance: \"0.7\" never sells below 70¢ a share. Use a price on the market's tick."
              },
              "maxFeeUsdDecimal": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]{0,6})(\\.[0-9]{1,6})?$",
                "description": "The most each firing may pay Polymarket in fees, in USD: \"1\" is $1."
              }
            },
            "required": [
              "kind",
              "fractionBps",
              "minPriceUsdDecimal",
              "maxFeeUsdDecimal"
            ],
            "description": "Sell a share of the agent's holding of the outcome at no less than a minimum price."
          }
        ],
        "description": "What a Polymarket automation does each time its rule fires: buy the outcome with a USD budget at no more than a maximum price, or sell a share of the agent's holding of it at no less than a minimum price."
      },
      "PredictionAutomationContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "prediction_automation",
            "description": "Which authorization contract this is."
          },
          "market": {
            "type": "object",
            "properties": {
              "marketId": {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,19}$",
                "description": "The market's id exactly as prediction_market returns it."
              },
              "conditionId": {
                "type": "string",
                "pattern": "^0x[0-9a-fA-F]{64}$",
                "description": "The market's conditionId exactly as prediction_market returns it."
              },
              "assetId": {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,77}$",
                "description": "The outcome's CLOB token id, exactly the assetId prediction_market lists for that outcome. Yes and No are different tokens."
              },
              "marketQuestion": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1000,
                "description": "The market's question exactly as prediction_market returns it."
              },
              "outcome": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "The outcome's name exactly as prediction_market returns it."
              }
            },
            "required": [
              "marketId",
              "conditionId",
              "assetId",
              "marketQuestion",
              "outcome"
            ],
            "description": "The one Polymarket outcome this automation trades."
          },
          "action": {
            "$ref": "#/components/schemas/PredictionAutomationAction"
          },
          "maxExecutions": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "How many firings may trade under this approval; a buy spends at most maxExecutions × amountUsdDecimal in all."
          },
          "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": "The deadline after which this approval authorizes nothing."
          }
        },
        "required": [
          "type",
          "market",
          "action",
          "maxExecutions",
          "validUntil"
        ],
        "description": "A standing approval for one Polymarket automation: buy one outcome with a USD budget at no more than a maximum price, or sell a share of the agent's holding of it at no less than a minimum price, each time its rule fires, up to its limits."
      },
      "PredictionFundInput": {
        "type": "object",
        "properties": {
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "Exact debit in six-decimal atomic units: 5 USDC or USDT is \"5000000\", spent from one USDC or USDT holding of the agent wallet (USDC on NEAR, Base, Arbitrum, Ethereum or Solana, or USDT on NEAR; any USDC that covers it before USDT) that alone covers it, never split across holdings, or, when it pays with a coin, that coin's value of it. The host resolves the agent’s own Polymarket Deposit Wallet and its bridge address; never supply an address."
          },
          "maxFirstLegLossBps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300,
            "description": "Explicit maximum loss, in basis points, of the first leg only: the wallet's USDC, USDT or coin delivered as native Base USDC to Polymarket's bridge, fees and any cross-chain hop included. It does not bound the bridge's conversion to pUSD on Polygon, whose fees and output are variable and estimated. Required; no default."
          },
          "payWith": {
            "description": "Approved in chat as one call or as a funded order's funding: the coin the first leg pays with instead of a USDC or USDT holding, and the most of it it may spend.",
            "$ref": "#/components/schemas/VenueFundingPayment"
          }
        },
        "required": [
          "amountRaw",
          "maxFirstLegLossBps"
        ],
        "description": "Fund the agent's own Polymarket Deposit Wallet: one exact USDC or USDT debit, or that many dollars of a coin, delivered as native Base USDC to Polymarket's bridge, which credits an estimated, not guaranteed, pUSD amount on Polygon later."
      },
      "PredictionFundContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "prediction_fund",
            "description": "One approved Polymarket funding transfer."
          },
          "transfer": {
            "description": "The exact approved USDC or USDT debit and the first leg's loss bound, and, for a funding paid with a coin, that coin and the most of it it may spend.",
            "$ref": "#/components/schemas/PredictionFundInput"
          },
          "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": "The deadline after which this one-shot approval authorizes nothing."
          }
        },
        "required": [
          "type",
          "transfer",
          "validUntil"
        ],
        "description": "One exact USDC or USDT debit delivered as native Base USDC to Polymarket's bridge for the agent's own account; the final pUSD amount is not bounded."
      },
      "PredictionWithdrawInput": {
        "type": "object",
        "properties": {
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "Exact pUSD debit in six-decimal atomic units: 5 pUSD is \"5000000\". Only the agent’s own Deposit Wallet is spent."
          },
          "maxLossBps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300,
            "description": "Explicit maximum estimated route loss in basis points, fees included; required, never defaulted. The bridge quote is an estimate, not a guaranteed final credit."
          }
        },
        "required": [
          "amountRaw",
          "maxLossBps"
        ],
        "description": "Withdraw pUSD through Polymarket’s conversion service as native USDC on Polygon to a unique verified 1Click address crediting only the agent’s own confidential Intents wallet. Funding remains a separate USDC route."
      },
      "PredictionWithdrawContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "prediction_withdraw"
          },
          "withdrawal": {
            "$ref": "#/components/schemas/PredictionWithdrawInput"
          },
          "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))$"
          }
        },
        "required": [
          "type",
          "withdrawal",
          "validUntil"
        ]
      },
      "PredictionFreedWithdrawalInput": {
        "type": "object",
        "properties": {
          "upToRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The most this withdrawal may move, in six-decimal atomic pUSD: what the sale before it frees, sized by the host before the approval opens. Never more than the sale freed."
          },
          "maxLossBps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300,
            "description": "Explicit maximum estimated route loss in basis points, fees included; required, never defaulted. The bridge quote is an estimate, not a guaranteed final credit."
          }
        },
        "required": [
          "upToRaw",
          "maxLossBps"
        ],
        "description": "Withdraw to the agent's own confidential Intents wallet what the sale before it freed in its own Polymarket Deposit Wallet, never more than upToRaw."
      },
      "PredictionFreedWithdrawalContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "prediction_freed_withdrawal"
          },
          "withdrawal": {
            "$ref": "#/components/schemas/PredictionFreedWithdrawalInput"
          },
          "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))$"
          }
        },
        "required": [
          "type",
          "withdrawal",
          "validUntil"
        ],
        "description": "One withdrawal home of what a cash-out's sale freed on Polymarket, at most the signed maximum. Only ever a piece of a cash-out."
      },
      "CompositeContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "composite",
            "description": "Which authorization contract this is."
          },
          "pieces": {
            "minItems": 1,
            "maxItems": 6,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "tool": {
                  "type": "string",
                  "enum": [
                    "intents_execute",
                    "perps_fund",
                    "perps_order_place",
                    "prediction_fund",
                    "prediction_order_place",
                    "perps_withdraw",
                    "prediction_withdraw"
                  ],
                  "description": "The tool whose one-shot call this piece is."
                },
                "contract": {
                  "anyOf": [
                    {
                      "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"
                      ]
                    },
                    {
                      "$ref": "#/components/schemas/PerpsTransferContract"
                    },
                    {
                      "$ref": "#/components/schemas/PerpsOrderContract"
                    },
                    {
                      "$ref": "#/components/schemas/PredictionFundContract"
                    },
                    {
                      "$ref": "#/components/schemas/PredictionOrderContract"
                    },
                    {
                      "$ref": "#/components/schemas/PerpsFreedWithdrawalContract"
                    },
                    {
                      "$ref": "#/components/schemas/PredictionFreedWithdrawalContract"
                    }
                  ]
                },
                "startBy": {
                  "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))$"
                }
              },
              "required": [
                "tool",
                "contract",
                "startBy"
              ]
            }
          },
          "dependencies": {
            "type": "array",
            "items": {
              "maxItems": 6,
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            }
          },
          "walletDebit": {
            "anyOf": [
              {
                "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."
                }
              },
              {
                "type": "array",
                "prefixItems": [],
                "items": false,
                "maxItems": 0
              }
            ],
            "description": "The sum of every piece's debit from the agent wallet, per token, in raw units. Empty when the pieces are venue orders paid from money already on their venues, as when finishing a basket, or a cash-out, which closes a position and brings home what that freed."
          },
          "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 every piece that has not started loses its authority."
          }
        },
        "required": [
          "type",
          "pieces",
          "dependencies",
          "walletDebit",
          "validUntil"
        ],
        "description": "One owner signature over several exact one-shot grants and the order they run in."
      },
      "PredictionBridgeCredit": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "verified"
              },
              "blockNumber": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "The finalized canonical block, as a decimal."
              },
              "blockHash": {
                "type": "string",
                "pattern": "^0x[0-9a-f]{64}$"
              },
              "logIndex": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "creditRaw": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "The pUSD this receipt's one incoming log credited to the Deposit Wallet, with no pUSD leaving it in the same transaction; six-decimal atomic units."
              }
            },
            "required": [
              "state",
              "blockNumber",
              "blockHash",
              "logIndex",
              "creditRaw"
            ]
          },
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "not_credited"
              },
              "reason": {
                "type": "string",
                "enum": [
                  "reverted",
                  "no_credit_log",
                  "multiple_credit_logs",
                  "outgoing_in_transaction"
                ],
                "description": "`reverted` the transaction failed; `no_credit_log` no pUSD transfer to the Deposit Wallet; `multiple_credit_logs` more than one, so no single credit can be named; `outgoing_in_transaction` pUSD also left the Deposit Wallet in the same transaction, so no net credit is named."
              }
            },
            "required": [
              "state",
              "reason"
            ]
          },
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "unconfirmed",
                "description": "No receipt yet, or its block is not finalized and canonical yet."
              }
            },
            "required": [
              "state"
            ]
          },
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "unavailable",
                "description": "Polygon could not be read; nothing is inferred."
              }
            },
            "required": [
              "state"
            ]
          }
        ]
      },
      "PredictionBridgeTransaction": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "pattern": "^[A-Z][A-Z_]{0,63}$",
            "description": "The bridge's status, verbatim: documented `DEPOSIT_DETECTED`, `PROCESSING`, `ORIGIN_TX_CONFIRMED`, `SUBMITTED`, `COMPLETED`, `FAILED`. `FAILED` is not a refund."
          },
          "fromChainId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "fromTokenAddress": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "fromAmountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$"
          },
          "toChainId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "toTokenAddress": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "createdTimeMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "txHash": {
            "description": "The bridge's own hash for the row, reported once `COMPLETED`. It names no Polygon transaction: the onramp row's is an ERC-4337 user operation's, and the Base row's is no chain's transaction. Never evidence of arrival.",
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "routeMatches": {
            "type": "boolean",
            "description": "Whether the row has the pinned route's shape. Shape alone never links a bridge row to a particular funding or withdrawal."
          },
          "credit": {
            "description": "Recorded only by releases before 2026-11-15, which read the row's hash as a Polygon transaction; never written now. A funding's arrival is its `attribution`, a withdrawal's the linked deposit receipt.",
            "$ref": "#/components/schemas/PredictionBridgeCredit"
          }
        },
        "required": [
          "status",
          "fromChainId",
          "fromTokenAddress",
          "fromAmountRaw",
          "toChainId",
          "toTokenAddress",
          "routeMatches"
        ]
      },
      "PredictionBridgeObservation": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "not_observed",
                "description": "Nothing was delivered to the bridge yet, so its status was not read."
              }
            },
            "required": [
              "state"
            ]
          },
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "unavailable",
                "description": "The bridge's status could not be read."
              },
              "attemptedAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "state",
              "attemptedAtMs"
            ]
          },
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "observed"
              },
              "observedAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "complete": {
                "type": "boolean",
                "description": "Whether every page was read; false when the walk stopped at its bound."
              },
              "transactions": {
                "maxItems": 500,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PredictionBridgeTransaction"
                },
                "description": "Every transaction the bridge reports at the address, newest first."
              }
            },
            "required": [
              "state",
              "observedAtMs",
              "complete",
              "transactions"
            ]
          }
        ]
      },
      "PredictionFirstLeg": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "pending"
              }
            },
            "required": [
              "state"
            ]
          },
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "delivered_to_bridge"
              },
              "deliveredRaw": {
                "description": "Native Base USDC 1Click reported delivered to the bridge address; absent when its settlement stated no figure.",
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$"
              }
            },
            "required": [
              "state"
            ]
          },
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "refunded"
              },
              "refundedRaw": {
                "description": "The USDC 1Click reported refunded to the agent wallet, in the asset the first leg spent; absent when its refund stated no figure.",
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$"
              }
            },
            "required": [
              "state"
            ]
          },
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "not_executed"
              }
            },
            "required": [
              "state"
            ]
          }
        ],
        "description": "The first leg's verified 1Click outcome, or `pending` while it has none."
      },
      "PredictionFundAttribution": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "credited",
                "description": "This funding's pUSD arrived in the Deposit Wallet."
              },
              "creditRaw": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "The pUSD the one matching receipt credited to the Deposit Wallet; six-decimal atomic units."
              },
              "transactionHash": {
                "type": "string",
                "pattern": "^0x[0-9a-f]{64}$",
                "description": "The Polygon transaction that credited it."
              }
            },
            "required": [
              "state",
              "creditRaw",
              "transactionHash"
            ]
          },
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "unknown"
              },
              "reason": {
                "type": "string",
                "enum": [
                  "not_at_bridge",
                  "delivery_unmeasured",
                  "bridge_not_read",
                  "awaiting_bridge",
                  "credit_not_verified",
                  "ambiguous",
                  "provider_reports_no_source_link"
                ],
                "description": "`not_at_bridge` step 1 has not delivered to the bridge; `delivery_unmeasured` 1Click reported no delivered figure or the leg has no signing time, so no conversion can be matched; `bridge_not_read` Polygon could not be read just now, or this answer was rebuilt from the record without reading it; `awaiting_bridge` Polygon shows no conversion of the delivered amount out of the bridge address yet; `credit_not_verified` the one matching conversion's receipt shows no single pUSD credit to the Deposit Wallet; `ambiguous` more than one conversion of the delivered amount, or another of the owner's open fundings at the address, could be this one; `provider_reports_no_source_link` recorded by a release that never attributed."
              },
              "candidates": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "Finalized transfers of exactly the delivered amount out of the bridge address on Polygon after the first leg was signed, not credited to another funding."
              }
            },
            "required": [
              "state",
              "reason",
              "candidates"
            ]
          }
        ]
      },
      "PredictionDepositWalletBalance": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "observed"
              },
              "pusdRaw": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "pUSD the wallet holds; six-decimal atomic units."
              },
              "readAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "state",
              "pusdRaw",
              "readAtMs"
            ]
          },
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "unavailable",
                "description": "Polygon could not be read; nothing is inferred."
              },
              "attemptedAtMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "state",
              "attemptedAtMs"
            ]
          }
        ],
        "description": "The wallet's whole balance, never this funding's amount."
      },
      "PredictionFundSubmitted": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "submitted",
            "description": "The exact USDC debit was attempted."
          },
          "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)$"
          },
          "firstLeg": {
            "$ref": "#/components/schemas/PredictionFirstLeg"
          },
          "bridge": {
            "type": "object",
            "properties": {
              "depositWallet": {
                "type": "string",
                "pattern": "^0x[0-9a-f]{40}$",
                "description": "The agent's own Polymarket Deposit Wallet."
              },
              "bridgeAddress": {
                "type": "string",
                "pattern": "^0x[0-9a-f]{40}$",
                "description": "The bridge deposit address the first leg paid, pinned before signing."
              },
              "minDepositRaw": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "The bridge's minimum for native Base USDC when the address was pinned."
              },
              "observation": {
                "$ref": "#/components/schemas/PredictionBridgeObservation"
              }
            },
            "required": [
              "depositWallet",
              "bridgeAddress",
              "minDepositRaw",
              "observation"
            ]
          },
          "attribution": {
            "$ref": "#/components/schemas/PredictionFundAttribution"
          },
          "balance": {
            "description": "The Deposit Wallet's live pUSD balance, read for the call's own answer and each `prediction.funding` change. Absent only from an answer rebuilt from the record without a live read, or recorded before balances were reported.",
            "$ref": "#/components/schemas/PredictionDepositWalletBalance"
          }
        },
        "required": [
          "status",
          "operationId",
          "firstLeg",
          "bridge",
          "attribution"
        ]
      },
      "PredictionWithdrawTransfer": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "confirmed",
              "reverted",
              "uncertain"
            ]
          },
          "transactionHash": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{64}$"
          }
        },
        "required": [
          "state"
        ]
      },
      "PredictionWithdrawDeposit": {
        "type": "object",
        "properties": {
          "depositId": {
            "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)$"
          },
          "state": {
            "type": "string",
            "enum": [
              "preparing",
              "awaiting_deposit",
              "incomplete",
              "processing",
              "credited",
              "refunded",
              "unknown",
              "expired",
              "failed"
            ]
          },
          "receipt": {
            "type": "object",
            "properties": {
              "observedAt": {
                "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 outcome was observed."
              },
              "state": {
                "type": "string",
                "enum": [
                  "credited",
                  "refunded"
                ],
                "description": "Whether the transfer was credited or refunded."
              },
              "depositedRaw": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "What arrived at the address."
              },
              "creditedRaw": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "What the agent wallet was credited; zero when all of it was refunded."
              },
              "refundedRaw": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "What went back to the agent wallet uncredited, such as a transfer below the minimum."
              },
              "sourceTransactionHashes": {
                "minItems": 1,
                "maxItems": 32,
                "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 transfers that paid the address, on the network they were sent on."
              },
              "refundTransactionHashes": {
                "maxItems": 32,
                "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 refund's ledger identifiers, when they were reported."
              }
            },
            "required": [
              "observedAt",
              "state",
              "depositedRaw",
              "creditedRaw",
              "refundedRaw",
              "sourceTransactionHashes",
              "refundTransactionHashes"
            ]
          }
        },
        "required": [
          "depositId",
          "state"
        ]
      },
      "PredictionWithdrawSubmitted": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "submitted"
          },
          "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)$"
          },
          "transfer": {
            "$ref": "#/components/schemas/PredictionWithdrawTransfer"
          },
          "deposit": {
            "$ref": "#/components/schemas/PredictionWithdrawDeposit"
          },
          "bridge": {
            "type": "object",
            "properties": {
              "observation": {
                "$ref": "#/components/schemas/PredictionBridgeObservation"
              }
            },
            "required": [
              "observation"
            ]
          }
        },
        "required": [
          "status",
          "operationId",
          "transfer",
          "deposit",
          "bridge"
        ],
        "description": "One attempted pUSD withdrawal with outgoing receipt, bridge observation and linked 1Click arrival kept separate. Only the linked deposit receipt establishes credited or refunded funds."
      },
      "SolanaRisk": {
        "type": "object",
        "properties": {
          "level": {
            "type": "string",
            "enum": [
              "blocked",
              "high",
              "medium",
              "low",
              "unknown"
            ],
            "description": "The overall verdict: `blocked` has a hard flag and is never bought; `unknown` when the mint could not be read, which also blocks a buy, since a mint no one has read never passes; `high` with two or more of `low_liquidity`, `new_token`, `top_holders`, `suspicious`, `unverified` and `low_organic`, `medium` with one, `low` with none. Never a statement that a token is safe."
          },
          "hard": {
            "maxItems": 19,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "freeze_authority",
                "transfer_hook",
                "permanent_delegate",
                "non_transferable",
                "default_frozen",
                "transfer_fee",
                "pausable",
                "unknown_extension",
                "not_sellable",
                "mint_authority",
                "hook_authority",
                "low_liquidity",
                "new_token",
                "top_holders",
                "unverified",
                "low_organic",
                "suspicious",
                "promoted",
                "unpriced"
              ]
            },
            "description": "Facts that refuse a buy: `freeze_authority` (the creator can freeze holdings), `transfer_hook` (every transfer runs the creator's program), `permanent_delegate` (someone can move or burn any holding), `non_transferable`, `default_frozen` (new holdings start frozen), `transfer_fee` (transfers pay a fee, or someone can set one), `pausable` (someone can pause every transfer, or has), `unknown_extension` (a Token-2022 extension Fin has not reviewed) and `not_sellable`."
          },
          "soft": {
            "maxItems": 19,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "freeze_authority",
                "transfer_hook",
                "permanent_delegate",
                "non_transferable",
                "default_frozen",
                "transfer_fee",
                "pausable",
                "unknown_extension",
                "not_sellable",
                "mint_authority",
                "hook_authority",
                "low_liquidity",
                "new_token",
                "top_holders",
                "unverified",
                "low_organic",
                "suspicious",
                "promoted",
                "unpriced"
              ]
            },
            "description": "Warnings to show beside the token, such as `mint_authority` (more can be created) and `hook_authority` (the issuer can add a transfer rule later). `new_token` warns that the mint or its first trading pool is less than a day old; their timestamps remain distinct. Only `unpriced` stops a buy, because a buy's loss cannot be bounded without a price."
          }
        },
        "required": [
          "level",
          "hard",
          "soft"
        ],
        "description": "Fin's risk verdict on a Solana token, from its mint facts and the venue's data."
      },
      "SolanaBuyContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "solana_buy",
            "description": "Which authorization contract this is."
          },
          "buy": {
            "description": "The exact approved token, payment, all-in loss bound and SOL top-up cap, and, for a buy whose funding pays with a coin, that coin and the most of it it may spend.",
            "$ref": "#/components/schemas/SolanaBuyInput"
          },
          "maxExecutions": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "How many times this grant may execute: 1 for a one-shot approval."
          },
          "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 grant's authority expires; for a one-shot approval, the approval's own expiry."
          }
        },
        "required": [
          "type",
          "buy",
          "maxExecutions",
          "validUntil"
        ],
        "description": "An approved Solana buy, executed only exactly as approved."
      },
      "SolanaSellContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "solana_sell",
            "description": "Which authorization contract this is."
          },
          "sell": {
            "description": "The exact approved token, amount, proceeds and all-in loss bound.",
            "$ref": "#/components/schemas/SolanaSellInput"
          },
          "maxExecutions": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "How many times this grant may execute: 1 for a one-shot approval."
          },
          "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 grant's authority expires; for a one-shot approval, the approval's own expiry."
          }
        },
        "required": [
          "type",
          "sell",
          "maxExecutions",
          "validUntil"
        ],
        "description": "An approved Solana sell, executed only exactly as approved."
      },
      "SolanaSellManyContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "solana_sell_many",
            "description": "Which authorization contract this is."
          },
          "sellMany": {
            "description": "The exact approved coins, amounts and loss bounds, in order, and where the proceeds go.",
            "$ref": "#/components/schemas/SolanaSellManyInput"
          },
          "maxExecutions": {
            "type": "number",
            "const": 1,
            "description": "A multi-coin sale is approved once and runs once: always 1."
          },
          "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 grant's authority expires; for a one-shot approval, the approval's own expiry."
          }
        },
        "required": [
          "type",
          "sellMany",
          "maxExecutions",
          "validUntil"
        ],
        "description": "An approved multi-coin Solana sale, executed only exactly as approved."
      },
      "SolanaFundContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "solana_fund",
            "description": "Which authorization contract this is."
          },
          "fund": {
            "description": "The exact approved amount and loss bound, and, for a funding paid with a coin, that coin and the most of it it may spend.",
            "$ref": "#/components/schemas/SolanaFundInput"
          },
          "maxExecutions": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "How many times this grant may execute: 1 for a one-shot approval."
          },
          "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 grant's authority expires; for a one-shot approval, the approval's own expiry."
          }
        },
        "required": [
          "type",
          "fund",
          "maxExecutions",
          "validUntil"
        ],
        "description": "An approved move of USDC or USDT, or a coin, into the agent's own Solana account."
      },
      "SolanaWithdrawContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "solana_withdraw",
            "description": "Which authorization contract this is."
          },
          "withdraw": {
            "description": "The exact approved amount, what returns and the loss bound.",
            "$ref": "#/components/schemas/SolanaWithdrawInput"
          },
          "maxExecutions": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "How many times this grant may execute: 1 for a one-shot approval."
          },
          "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 grant's authority expires; for a one-shot approval, the approval's own expiry."
          }
        },
        "required": [
          "type",
          "withdraw",
          "maxExecutions",
          "validUntil"
        ],
        "description": "An approved move of SOL from the agent's own Solana account back to its agent wallet."
      },
      "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."
      },
      "GridContract": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "grid",
            "description": "Which contract template this is."
          },
          "grid": {
            "type": "object",
            "properties": {
              "base": {
                "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 base asset: token id and decimals."
                  }
                },
                "required": [
                  "pinned"
                ],
                "description": "The asset the grid buys low and sells high."
              },
              "quote": {
                "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 quote asset: token id and decimals."
                  }
                },
                "required": [
                  "pinned"
                ],
                "description": "The asset prices are in and buys are paid with."
              },
              "levels": {
                "minItems": 2,
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 80,
                  "pattern": "^(0|[1-9]\\d{0,38})(\\.\\d{1,38})?$"
                },
                "description": "The 2 to 20 grid prices, strictly ascending: quote units per ONE base unit, plain human decimals."
              },
              "quantityPerCell": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "The exact base amount every cell buys and sells, in the base asset's smallest unit. Fixed: profits never compound."
              },
              "cells": {
                "minItems": 1,
                "maxItems": 19,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "start": {
                      "type": "string",
                      "enum": [
                        "buy",
                        "idle"
                      ],
                      "description": "The side the cell's first order is on: buy at its low level, or idle (the cell never places)."
                    }
                  },
                  "required": [
                    "start"
                  ]
                },
                "description": "One entry per cell, lowest first (levels.length - 1 of them): cells wholly below the start price and the one straddling it buy, cells wholly above it stay idle."
              }
            },
            "required": [
              "base",
              "quote",
              "levels",
              "quantityPerCell",
              "cells"
            ],
            "description": "A grid's exact terms: pair, levels, quantity and starting sides."
          },
          "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 the grid ends: no order is placed, and none rests, after it. At most 720 hours after the approval's own expiry."
          }
        },
        "required": [
          "type",
          "grid",
          "validUntil"
        ],
        "description": "Owner-signed authority for one grid: the resting cell orders its terms derive, until it ends."
      },
      "FinEvent": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "run.started",
                "description": "Identifies this as a `run.started` event."
              },
              "payload": {
                "type": "object",
                "properties": {
                  "input": {
                    "type": "string",
                    "description": "The user's message, or the automation's triggering text, that this run processes."
                  },
                  "origin": {
                    "description": "Which automation triggered this run; absent for an ordinary user turn.",
                    "type": "object",
                    "properties": {
                      "automationId": {
                        "type": "string",
                        "description": "The automation that started this run."
                      },
                      "name": {
                        "type": "string",
                        "description": "The automation's name at the time it started this run."
                      }
                    },
                    "required": [
                      "automationId",
                      "name"
                    ]
                  },
                  "runId": {
                    "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 this event opened, so a client following the stream can name it (to stop it)."
                  }
                },
                "required": [
                  "input",
                  "runId"
                ],
                "description": "The `run.started` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "Opens a new run: the engine admitted it and is about to process the input, whether an ordinary turn or an automation firing. Emitted once, at admission — a run resumed after an approval does not get a second one. `run.ended` closes what this event opened."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "run.ended",
                "description": "Identifies this as a `run.ended` event."
              },
              "payload": {
                "type": "object",
                "properties": {
                  "runId": {
                    "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 admitted root run that reached its terminal state."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "completed",
                      "aborted",
                      "failed"
                    ],
                    "description": "The terminal result of the root run; approval waits do not end it."
                  },
                  "usage": {
                    "description": "Token counts and cost for this run, once its accounting settles.",
                    "type": "object",
                    "properties": {
                      "inputTokens": {
                        "type": "number",
                        "description": "How many input tokens the run consumed."
                      },
                      "outputTokens": {
                        "type": "number",
                        "description": "How many output tokens the run produced."
                      },
                      "costCents": {
                        "type": "string",
                        "pattern": "^(0|[1-9]\\d*)$",
                        "description": "The run's cost, in whole USD cents."
                      },
                      "costUncertain": {
                        "type": "boolean",
                        "description": "True when the exact provider cost could not be confirmed and `costCents` is a best-effort estimate."
                      }
                    },
                    "required": [
                      "inputTokens",
                      "outputTokens",
                      "costCents",
                      "costUncertain"
                    ]
                  },
                  "error": {
                    "description": "The run's failure message, present when `status` is `failed`.",
                    "type": "string"
                  },
                  "failure": {
                    "description": "Structured cause of a failed run: its `code`, `stage` and optional provider detail. Present when `status` is `failed`; absent on runs that failed before this field existed.",
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "model_timeout",
                          "model_invalid_output",
                          "execution_deadline",
                          "provider_rate_limit",
                          "provider_unavailable",
                          "provider_authentication",
                          "internal_error",
                          "context_too_large",
                          "daily_budget_exhausted",
                          "monthly_budget_exhausted",
                          "budget_frozen",
                          "partner_daily_budget_exhausted",
                          "partner_monthly_budget_exhausted",
                          "unknown"
                        ],
                        "description": "Why the execution failed: `model_timeout` (the model was too slow to respond), `execution_deadline` (the run's active time limit elapsed before it finished), `provider_rate_limit` or `provider_unavailable` (classified from HTTP status or a connection/body-read failure observed by the host), `model_invalid_output` (terminal structured output still failed its required format after bounded repair), `context_too_large` (the request stayed over the model's context window after the host condensed earlier history and retried once), `daily_budget_exhausted`, `monthly_budget_exhausted` or `budget_frozen` (the user's AI budget for the UTC day or month, or an operator's freeze on it, left no room for the run's next model request), `partner_daily_budget_exhausted` or `partner_monthly_budget_exhausted` (the partner account's AI spend limit for the UTC day or month left no room for it), `internal_error` (a host-side fault), or `unknown` when nothing more specific was classified. A budget or spend-limit code means a limit stopped the run, not that the model failed; trying again fails the same way until the limit clears. A raised user budget or a lifted freeze applies at once; a raised partner limit applies from the next UTC day or month, because the open period keeps the cap it started with."
                      },
                      "stage": {
                        "type": "string",
                        "enum": [
                          "model_request",
                          "tool_execution",
                          "finalization"
                        ],
                        "description": "Which phase of the run was executing when it failed: `model_request` while calling or awaiting the model provider, `tool_execution` while running or resuming a tool call, or `finalization` while settling the run's output and accounting after the model finished."
                      },
                      "providerMessage": {
                        "description": "The model provider's own error text, when one was available: credential values are redacted and it is cut to 256 characters, but it is not a content classifier, so other sensitive detail may remain. Treat it as diagnostic context only — never branch on it, and review before showing it to an end user.",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256
                      },
                      "diagnosticReference": {
                        "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": "This failed run's own id, repeated here as one field to cite when asking support to check the host's internal logs for this execution; it carries no meaning beyond that."
                      }
                    },
                    "required": [
                      "code",
                      "stage",
                      "diagnosticReference"
                    ]
                  }
                },
                "required": [
                  "runId",
                  "status"
                ],
                "description": "The `run.ended` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "The root run reached a terminal state: completed, failed or aborted. Its runId is the same as run.started and every pause/resume. Waiting for approval emits run.paused instead. Accounting includes all continuation segments."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "run.paused",
                "description": "Identifies this as a `run.paused` event."
              },
              "payload": {
                "type": "object",
                "properties": {
                  "runId": {
                    "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 admitted root run, retained across approval waits and continuations."
                  }
                },
                "required": [
                  "runId"
                ],
                "description": "The run is waiting for approval; it has not finished."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "The run is waiting for human input or approval. Its identity and original request remain unchanged."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "run.resumed",
                "description": "Identifies this as a `run.resumed` event."
              },
              "payload": {
                "type": "object",
                "properties": {
                  "runId": {
                    "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 same root run that paused."
                  }
                },
                "required": [
                  "runId"
                ],
                "description": "The paused run has resumed after an approval decision."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "An approval decision resumed the same root run. No new instruction or run identity was created."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "run.steered",
                "description": "Identifies this as a `run.steered` event."
              },
              "payload": {
                "type": "object",
                "properties": {
                  "runId": {
                    "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 the message was sent to; it keeps working."
                  },
                  "steerId": {
                    "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 message's id, as the run's `steers` entry names it."
                  },
                  "text": {
                    "type": "string",
                    "description": "The user's message, as they sent it."
                  }
                },
                "required": [
                  "runId",
                  "steerId",
                  "text"
                ],
                "description": "The `run.steered` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "The agent read a message the user sent while the run was working (Steer a run). Emitted at the agent's next step, before its next reply, so it lands in the conversation where the agent saw it; `steerId` matches the run's `steers` entry. Several messages sent within one step each get their own event, in the order sent. The same run continues; a message the run ended before reading never gets one."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "agent.entry",
                "description": "Identifies this as an `agent.entry` event."
              },
              "payload": {
                "type": "object",
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "user",
                      "assistant",
                      "tool"
                    ],
                    "description": "Who this message is from: `user`, `assistant`, or `tool` for a tool's own display text."
                  },
                  "text": {
                    "type": "string",
                    "description": "The message's display text."
                  },
                  "interrupted": {
                    "description": "Present on an assistant draft whose model response did not complete. Preserve it as interrupted even if the run later recovers and completes.",
                    "type": "boolean",
                    "const": true
                  },
                  "tool": {
                    "description": "Which tool this entry displays the result of; present only when `role` is `tool`.",
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "The tool's public name."
                      },
                      "outcome": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "completed",
                                "description": "The tool ran and returned a result."
                              },
                              "result": {
                                "description": "The tool's own result value."
                              },
                              "financialFailures": {
                                "description": "Bounded financial failure display evidence. The tool result and spending authority are unchanged.",
                                "type": "object",
                                "properties": {
                                  "nodeFailures": {
                                    "minItems": 1,
                                    "maxItems": 16,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "index": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 15
                                        },
                                        "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"
                                          ]
                                        },
                                        "category": {
                                          "type": "string",
                                          "enum": [
                                            "price_limit",
                                            "insufficient_funds",
                                            "unavailable",
                                            "integrity",
                                            "dependency",
                                            "expired",
                                            "authority",
                                            "conflict",
                                            "stopped",
                                            "request_blocked",
                                            "unknown"
                                          ]
                                        },
                                        "diagnostic": {
                                          "type": "object",
                                          "properties": {
                                            "rule": {
                                              "type": "string",
                                              "enum": [
                                                "quote_floor",
                                                "quote_ceiling"
                                              ]
                                            },
                                            "classification": {
                                              "type": "string",
                                              "const": "terms"
                                            },
                                            "expectedAtomic": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,38})$"
                                            },
                                            "observedAtomic": {
                                              "type": "string",
                                              "pattern": "^(0|[1-9]\\d{0,38})$"
                                            },
                                            "inputTokenId": {
                                              "type": "string",
                                              "maxLength": 256,
                                              "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                              "description": "The exact ledger asset identifier, including its token standard namespace."
                                            },
                                            "outputTokenId": {
                                              "type": "string",
                                              "maxLength": 256,
                                              "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                              "description": "The exact ledger asset identifier, including its token standard namespace."
                                            }
                                          },
                                          "required": [
                                            "rule",
                                            "classification",
                                            "expectedAtomic",
                                            "observedAtomic",
                                            "inputTokenId",
                                            "outputTokenId"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "index",
                                        "reason",
                                        "category"
                                      ]
                                    }
                                  },
                                  "preflightFailure": {
                                    "type": "object",
                                    "properties": {
                                      "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"
                                        ]
                                      },
                                      "index": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 15
                                      },
                                      "diagnostic": {
                                        "type": "object",
                                        "properties": {
                                          "rule": {
                                            "type": "string",
                                            "enum": [
                                              "quote_floor",
                                              "quote_ceiling"
                                            ]
                                          },
                                          "classification": {
                                            "type": "string",
                                            "const": "terms"
                                          },
                                          "expectedAtomic": {
                                            "type": "string",
                                            "pattern": "^(0|[1-9]\\d{0,38})$"
                                          },
                                          "observedAtomic": {
                                            "type": "string",
                                            "pattern": "^(0|[1-9]\\d{0,38})$"
                                          },
                                          "inputTokenId": {
                                            "type": "string",
                                            "maxLength": 256,
                                            "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                            "description": "The exact ledger asset identifier, including its token standard namespace."
                                          },
                                          "outputTokenId": {
                                            "type": "string",
                                            "maxLength": 256,
                                            "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                            "description": "The exact ledger asset identifier, including its token standard namespace."
                                          }
                                        },
                                        "required": [
                                          "rule",
                                          "classification",
                                          "expectedAtomic",
                                          "observedAtomic",
                                          "inputTokenId",
                                          "outputTokenId"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "reason"
                                    ]
                                  },
                                  "recoverable": {
                                    "maxItems": 16,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "index": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 15
                                        },
                                        "kind": {
                                          "type": "string",
                                          "enum": [
                                            "unclaimed",
                                            "refunded",
                                            "not_executed"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "index",
                                        "kind"
                                      ]
                                    }
                                  },
                                  "recovery": {
                                    "description": "Root operations omit this. A recovery child carries a proved original-action map, or null when no safe map is available; null disables recovery controls.",
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "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)$"
                                          },
                                          "originalIndices": {
                                            "minItems": 1,
                                            "maxItems": 16,
                                            "type": "array",
                                            "items": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 15
                                            }
                                          },
                                          "maxValueLossBps": {
                                            "type": "string",
                                            "pattern": "^(0|[1-9]\\d{0,4})$"
                                          }
                                        },
                                        "required": [
                                          "operationId",
                                          "originalIndices",
                                          "maxValueLossBps"
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                }
                              },
                              "providerRef": {
                                "description": "The upstream provider's own reference, when it returned one.",
                                "type": "string"
                              }
                            },
                            "required": [
                              "status",
                              "result"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "denied",
                                "description": "The call was refused before it ran."
                              },
                              "error": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string",
                                    "enum": [
                                      "denied",
                                      "egress_denied",
                                      "invalid_input",
                                      "execution_failed"
                                    ],
                                    "description": "Why the tool call did not produce a result: `denied` by policy or the user, `egress_denied` for a network destination the tool cannot reach, `invalid_input` for arguments the tool rejected, or `execution_failed` for a fault while it ran."
                                  },
                                  "message": {
                                    "type": "string",
                                    "description": "A human-readable explanation of the failure."
                                  },
                                  "hint": {
                                    "description": "A suggestion for what to try instead, when there is one.",
                                    "type": "string"
                                  },
                                  "recovery": {
                                    "type": "string",
                                    "enum": [
                                      "wait",
                                      "owner",
                                      "none"
                                    ],
                                    "description": "Who can fix the failure: `wait` when the same request may succeed later without anyone acting and nothing was signed or sent, `owner` when it fails the same way until the owner acts (the remedy says how), or `none` when this attempt cannot succeed and neither waiting nor the owner changes that, though a later run may. A failure that names no class is `none`."
                                  },
                                  "remedy": {
                                    "type": "string",
                                    "enum": [
                                      "add_funds",
                                      "edit_automation"
                                    ],
                                    "description": "What the owner does about an `owner` failure: `add_funds` of the asset the action spends or sells, or `edit_automation` to change its terms."
                                  },
                                  "retryAfterSeconds": {
                                    "description": "For a `wait` failure, how long the failing service asked to wait before the same request is repeated, in whole seconds.",
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 86400
                                  },
                                  "reference": {
                                    "description": "Correlation for diagnosis: the request id, or the workflow id of background work. Never a cause.",
                                    "type": "string",
                                    "maxLength": 128
                                  }
                                },
                                "required": [
                                  "code",
                                  "message"
                                ],
                                "description": "Why the call was denied."
                              }
                            },
                            "required": [
                              "status",
                              "error"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "pending_approval",
                                "description": "The call is parked, waiting on a human decision."
                              },
                              "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."
                              },
                              "summary": {
                                "type": "string",
                                "description": "A short human-readable summary of what approving this would do."
                              }
                            },
                            "required": [
                              "status",
                              "approvalId",
                              "summary"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "failed",
                                "description": "The call ran but did not complete successfully."
                              },
                              "error": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string",
                                    "enum": [
                                      "denied",
                                      "egress_denied",
                                      "invalid_input",
                                      "execution_failed"
                                    ],
                                    "description": "Why the tool call did not produce a result: `denied` by policy or the user, `egress_denied` for a network destination the tool cannot reach, `invalid_input` for arguments the tool rejected, or `execution_failed` for a fault while it ran."
                                  },
                                  "message": {
                                    "type": "string",
                                    "description": "A human-readable explanation of the failure."
                                  },
                                  "hint": {
                                    "description": "A suggestion for what to try instead, when there is one.",
                                    "type": "string"
                                  },
                                  "recovery": {
                                    "type": "string",
                                    "enum": [
                                      "wait",
                                      "owner",
                                      "none"
                                    ],
                                    "description": "Who can fix the failure: `wait` when the same request may succeed later without anyone acting and nothing was signed or sent, `owner` when it fails the same way until the owner acts (the remedy says how), or `none` when this attempt cannot succeed and neither waiting nor the owner changes that, though a later run may. A failure that names no class is `none`."
                                  },
                                  "remedy": {
                                    "type": "string",
                                    "enum": [
                                      "add_funds",
                                      "edit_automation"
                                    ],
                                    "description": "What the owner does about an `owner` failure: `add_funds` of the asset the action spends or sells, or `edit_automation` to change its terms."
                                  },
                                  "retryAfterSeconds": {
                                    "description": "For a `wait` failure, how long the failing service asked to wait before the same request is repeated, in whole seconds.",
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 86400
                                  },
                                  "reference": {
                                    "description": "Correlation for diagnosis: the request id, or the workflow id of background work. Never a cause.",
                                    "type": "string",
                                    "maxLength": 128
                                  }
                                },
                                "required": [
                                  "code",
                                  "message"
                                ],
                                "description": "Why the call failed."
                              }
                            },
                            "required": [
                              "status",
                              "error"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "pending_input",
                                "description": "The call is paused for a human questionnaire response."
                              },
                              "questionId": {
                                "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 questionnaire the user needs to answer."
                              },
                              "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": "When the questionnaire expires if it remains unanswered."
                              }
                            },
                            "required": [
                              "status",
                              "questionId",
                              "expiresAt"
                            ]
                          }
                        ],
                        "description": "The call's outcome: completed, denied, parked for approval or input, or failed."
                      }
                    },
                    "required": [
                      "name",
                      "outcome"
                    ]
                  }
                },
                "required": [
                  "role",
                  "text"
                ],
                "description": "The `agent.entry` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "One durable message in the conversation: the user's message, the assistant's completed reply, or a tool's display text once it resolves. Streaming assistant text arrives first as `agent.text_delta` and lands here only when the turn completes."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "agent.text_delta",
                "description": "Identifies this as an `agent.text_delta` event."
              },
              "payload": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "The chunk of assistant reply text this delta adds."
                  }
                },
                "required": [
                  "text"
                ],
                "description": "The `agent.text_delta` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "A chunk of the assistant's reply while it is still generating. Delivered live only — never written to the durable journal or replayed on reconnect — and superseded by the complete text in the `agent.entry` that follows."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "tool.call",
                "description": "Identifies this as a `tool.call` event."
              },
              "payload": {
                "type": "object",
                "properties": {
                  "callId": {
                    "description": "This call's id, so later events (`approval.opened`, `tool.result`) can be matched to it.",
                    "type": "string"
                  },
                  "tool": {
                    "type": "string",
                    "description": "The tool's public name."
                  },
                  "input": {
                    "description": "The call's arguments, scrubbed for public display."
                  },
                  "batch": {
                    "description": "The calls the agent asked for together in one step. They arrive together in `index` order, and the agent reads every result before its next step, so you can draw them as one group. A call asked for alone has `size` 1. Absent on calls made before this field existed.",
                    "type": "object",
                    "properties": {
                      "index": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 63,
                        "description": "This call's place among them, from 0."
                      },
                      "size": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 64,
                        "description": "How many calls the agent asked for together, this one included."
                      }
                    },
                    "required": [
                      "index",
                      "size"
                    ]
                  },
                  "origin": {
                    "description": "Written by the retired standalone CLI door; kept so its journals still parse.",
                    "type": "string",
                    "const": "cli"
                  }
                },
                "required": [
                  "tool",
                  "input"
                ],
                "description": "The `tool.call` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "The assistant asked to call a tool. Emitted once the call is committed to the conversation, before it runs; `approval.opened` follows if a human must decide first, otherwise the call proceeds straight to `tool.result`."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "tool.result",
                "description": "Identifies this as a `tool.result` event."
              },
              "payload": {
                "type": "object",
                "properties": {
                  "callId": {
                    "description": "This call's id, matching the `tool.call` it resolves.",
                    "type": "string"
                  },
                  "callSeq": {
                    "description": "With `origin`, the retired CLI door's way of pairing a result to its call; historical only.",
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "tool": {
                    "type": "string",
                    "description": "The tool's public name."
                  },
                  "outcome": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "const": "completed",
                            "description": "The tool ran and returned a result."
                          },
                          "result": {
                            "description": "The tool's own result value."
                          },
                          "financialFailures": {
                            "description": "Bounded financial failure display evidence. The tool result and spending authority are unchanged.",
                            "type": "object",
                            "properties": {
                              "nodeFailures": {
                                "minItems": 1,
                                "maxItems": 16,
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "index": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 15
                                    },
                                    "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"
                                      ]
                                    },
                                    "category": {
                                      "type": "string",
                                      "enum": [
                                        "price_limit",
                                        "insufficient_funds",
                                        "unavailable",
                                        "integrity",
                                        "dependency",
                                        "expired",
                                        "authority",
                                        "conflict",
                                        "stopped",
                                        "request_blocked",
                                        "unknown"
                                      ]
                                    },
                                    "diagnostic": {
                                      "type": "object",
                                      "properties": {
                                        "rule": {
                                          "type": "string",
                                          "enum": [
                                            "quote_floor",
                                            "quote_ceiling"
                                          ]
                                        },
                                        "classification": {
                                          "type": "string",
                                          "const": "terms"
                                        },
                                        "expectedAtomic": {
                                          "type": "string",
                                          "pattern": "^(0|[1-9]\\d{0,38})$"
                                        },
                                        "observedAtomic": {
                                          "type": "string",
                                          "pattern": "^(0|[1-9]\\d{0,38})$"
                                        },
                                        "inputTokenId": {
                                          "type": "string",
                                          "maxLength": 256,
                                          "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                          "description": "The exact ledger asset identifier, including its token standard namespace."
                                        },
                                        "outputTokenId": {
                                          "type": "string",
                                          "maxLength": 256,
                                          "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                          "description": "The exact ledger asset identifier, including its token standard namespace."
                                        }
                                      },
                                      "required": [
                                        "rule",
                                        "classification",
                                        "expectedAtomic",
                                        "observedAtomic",
                                        "inputTokenId",
                                        "outputTokenId"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "index",
                                    "reason",
                                    "category"
                                  ]
                                }
                              },
                              "preflightFailure": {
                                "type": "object",
                                "properties": {
                                  "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"
                                    ]
                                  },
                                  "index": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 15
                                  },
                                  "diagnostic": {
                                    "type": "object",
                                    "properties": {
                                      "rule": {
                                        "type": "string",
                                        "enum": [
                                          "quote_floor",
                                          "quote_ceiling"
                                        ]
                                      },
                                      "classification": {
                                        "type": "string",
                                        "const": "terms"
                                      },
                                      "expectedAtomic": {
                                        "type": "string",
                                        "pattern": "^(0|[1-9]\\d{0,38})$"
                                      },
                                      "observedAtomic": {
                                        "type": "string",
                                        "pattern": "^(0|[1-9]\\d{0,38})$"
                                      },
                                      "inputTokenId": {
                                        "type": "string",
                                        "maxLength": 256,
                                        "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                        "description": "The exact ledger asset identifier, including its token standard namespace."
                                      },
                                      "outputTokenId": {
                                        "type": "string",
                                        "maxLength": 256,
                                        "pattern": "^(?:nep141|nep245|1cs_v1):[\\x21-\\x7e]+$",
                                        "description": "The exact ledger asset identifier, including its token standard namespace."
                                      }
                                    },
                                    "required": [
                                      "rule",
                                      "classification",
                                      "expectedAtomic",
                                      "observedAtomic",
                                      "inputTokenId",
                                      "outputTokenId"
                                    ]
                                  }
                                },
                                "required": [
                                  "reason"
                                ]
                              },
                              "recoverable": {
                                "maxItems": 16,
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "index": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 15
                                    },
                                    "kind": {
                                      "type": "string",
                                      "enum": [
                                        "unclaimed",
                                        "refunded",
                                        "not_executed"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "index",
                                    "kind"
                                  ]
                                }
                              },
                              "recovery": {
                                "description": "Root operations omit this. A recovery child carries a proved original-action map, or null when no safe map is available; null disables recovery controls.",
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "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)$"
                                      },
                                      "originalIndices": {
                                        "minItems": 1,
                                        "maxItems": 16,
                                        "type": "array",
                                        "items": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 15
                                        }
                                      },
                                      "maxValueLossBps": {
                                        "type": "string",
                                        "pattern": "^(0|[1-9]\\d{0,4})$"
                                      }
                                    },
                                    "required": [
                                      "operationId",
                                      "originalIndices",
                                      "maxValueLossBps"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            }
                          },
                          "providerRef": {
                            "description": "The upstream provider's own reference, when it returned one.",
                            "type": "string"
                          }
                        },
                        "required": [
                          "status",
                          "result"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "const": "denied",
                            "description": "The call was refused before it ran."
                          },
                          "error": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "string",
                                "enum": [
                                  "denied",
                                  "egress_denied",
                                  "invalid_input",
                                  "execution_failed"
                                ],
                                "description": "Why the tool call did not produce a result: `denied` by policy or the user, `egress_denied` for a network destination the tool cannot reach, `invalid_input` for arguments the tool rejected, or `execution_failed` for a fault while it ran."
                              },
                              "message": {
                                "type": "string",
                                "description": "A human-readable explanation of the failure."
                              },
                              "hint": {
                                "description": "A suggestion for what to try instead, when there is one.",
                                "type": "string"
                              },
                              "recovery": {
                                "type": "string",
                                "enum": [
                                  "wait",
                                  "owner",
                                  "none"
                                ],
                                "description": "Who can fix the failure: `wait` when the same request may succeed later without anyone acting and nothing was signed or sent, `owner` when it fails the same way until the owner acts (the remedy says how), or `none` when this attempt cannot succeed and neither waiting nor the owner changes that, though a later run may. A failure that names no class is `none`."
                              },
                              "remedy": {
                                "type": "string",
                                "enum": [
                                  "add_funds",
                                  "edit_automation"
                                ],
                                "description": "What the owner does about an `owner` failure: `add_funds` of the asset the action spends or sells, or `edit_automation` to change its terms."
                              },
                              "retryAfterSeconds": {
                                "description": "For a `wait` failure, how long the failing service asked to wait before the same request is repeated, in whole seconds.",
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 86400
                              },
                              "reference": {
                                "description": "Correlation for diagnosis: the request id, or the workflow id of background work. Never a cause.",
                                "type": "string",
                                "maxLength": 128
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "description": "Why the call was denied."
                          }
                        },
                        "required": [
                          "status",
                          "error"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "const": "pending_approval",
                            "description": "The call is parked, waiting on a human decision."
                          },
                          "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."
                          },
                          "summary": {
                            "type": "string",
                            "description": "A short human-readable summary of what approving this would do."
                          }
                        },
                        "required": [
                          "status",
                          "approvalId",
                          "summary"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "const": "failed",
                            "description": "The call ran but did not complete successfully."
                          },
                          "error": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "string",
                                "enum": [
                                  "denied",
                                  "egress_denied",
                                  "invalid_input",
                                  "execution_failed"
                                ],
                                "description": "Why the tool call did not produce a result: `denied` by policy or the user, `egress_denied` for a network destination the tool cannot reach, `invalid_input` for arguments the tool rejected, or `execution_failed` for a fault while it ran."
                              },
                              "message": {
                                "type": "string",
                                "description": "A human-readable explanation of the failure."
                              },
                              "hint": {
                                "description": "A suggestion for what to try instead, when there is one.",
                                "type": "string"
                              },
                              "recovery": {
                                "type": "string",
                                "enum": [
                                  "wait",
                                  "owner",
                                  "none"
                                ],
                                "description": "Who can fix the failure: `wait` when the same request may succeed later without anyone acting and nothing was signed or sent, `owner` when it fails the same way until the owner acts (the remedy says how), or `none` when this attempt cannot succeed and neither waiting nor the owner changes that, though a later run may. A failure that names no class is `none`."
                              },
                              "remedy": {
                                "type": "string",
                                "enum": [
                                  "add_funds",
                                  "edit_automation"
                                ],
                                "description": "What the owner does about an `owner` failure: `add_funds` of the asset the action spends or sells, or `edit_automation` to change its terms."
                              },
                              "retryAfterSeconds": {
                                "description": "For a `wait` failure, how long the failing service asked to wait before the same request is repeated, in whole seconds.",
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 86400
                              },
                              "reference": {
                                "description": "Correlation for diagnosis: the request id, or the workflow id of background work. Never a cause.",
                                "type": "string",
                                "maxLength": 128
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "description": "Why the call failed."
                          }
                        },
                        "required": [
                          "status",
                          "error"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "const": "pending_input",
                            "description": "The call is paused for a human questionnaire response."
                          },
                          "questionId": {
                            "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 questionnaire the user needs to answer."
                          },
                          "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": "When the questionnaire expires if it remains unanswered."
                          }
                        },
                        "required": [
                          "status",
                          "questionId",
                          "expiresAt"
                        ]
                      }
                    ],
                    "description": "The call's outcome: completed, denied, parked for approval or input, or failed."
                  },
                  "origin": {
                    "description": "Written by the retired standalone CLI door; kept so its journals still parse.",
                    "type": "string",
                    "const": "cli"
                  }
                },
                "required": [
                  "tool",
                  "outcome"
                ],
                "description": "The `tool.result` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "One tool call resolved: `outcome` says what happened (completed, denied, parked for approval, or failed). Immediately followed by an `agent.entry` (role `tool`) carrying that outcome's own display text."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "approval.opened",
                "description": "Identifies this as an `approval.opened` event."
              },
              "payload": {
                "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."
                  },
                  "callId": {
                    "description": "The tool call this approval parks; absent for direct operations without a model call.",
                    "type": "string"
                  },
                  "tool": {
                    "type": "string",
                    "description": "The tool name awaiting approval."
                  },
                  "input": {
                    "description": "The call's arguments, as shown on the approval card."
                  },
                  "summary": {
                    "type": "string",
                    "description": "A short human-readable summary of what approving this would do."
                  },
                  "contract": {
                    "description": "Effective terms rendered before approval; absent for tools without authorization contracts.",
                    "oneOf": [
                      {
                        "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"
                        ]
                      },
                      {
                        "$ref": "#/components/schemas/LimitOrderContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsTransferContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsOrderContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsCancelContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsAutomationContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsMarginContract"
                      },
                      {
                        "$ref": "#/components/schemas/PredictionFundContract"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaBuyContract"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaSellContract"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaFundContract"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaWithdrawContract"
                      },
                      {
                        "$ref": "#/components/schemas/PredictionOrderContract"
                      },
                      {
                        "$ref": "#/components/schemas/PredictionWithdrawContract"
                      },
                      {
                        "$ref": "#/components/schemas/CompositeContract"
                      },
                      {
                        "$ref": "#/components/schemas/PredictionAutomationContract"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaSellManyContract"
                      },
                      {
                        "$ref": "#/components/schemas/GridContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsFreedWithdrawalContract"
                      },
                      {
                        "$ref": "#/components/schemas/PredictionFreedWithdrawalContract"
                      }
                    ]
                  },
                  "executionRestriction": {
                    "description": "Set when this approval disallows automatic signing; fixed when the approval opened, never inferred from the current UI mode.",
                    "type": "string",
                    "const": "signing_disabled"
                  },
                  "expiresAt": {
                    "description": "When the parked decision lapses; optional so journal entries written before it still parse.",
                    "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))$"
                  }
                },
                "required": [
                  "approvalId",
                  "tool",
                  "input",
                  "summary"
                ],
                "description": "The `approval.opened` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "A tool call is parked, waiting on a human decision. Carries the terms the approval card renders: the call's input, a summary, and the authorization contract in effect, if any. `approval.decided` or `approval.expired` closes it."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "approval.decided",
                "description": "Identifies this as an `approval.decided` event."
              },
              "payload": {
                "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."
                  },
                  "approve": {
                    "type": "boolean",
                    "description": "True when the user approved; false when denied."
                  },
                  "reason": {
                    "description": "The user's reason, mainly given with a denial.",
                    "type": "string"
                  },
                  "attestation": {
                    "description": "The partner-side confirmation cited for the decision; never verified by fin.",
                    "type": "object",
                    "properties": {
                      "reference": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "description": "The partner's own reference for its confirmation."
                      }
                    },
                    "required": [
                      "reference"
                    ]
                  },
                  "decidedBy": {
                    "description": "Which integration released it; absent on journals written before v1, null for the deployment's own app.",
                    "type": "object",
                    "properties": {
                      "partnerKeyId": {
                        "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 partner key that released this decision; null for the deployment's own app."
                      }
                    },
                    "required": [
                      "partnerKeyId"
                    ]
                  }
                },
                "required": [
                  "approvalId",
                  "approve"
                ],
                "description": "The `approval.decided` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "The user, or a partner integration, approved or denied a parked approval. `approve` says which way; a denial may carry `reason`. Consuming the decision to execute the tool follows as `approval.consumed`, but only when the decision was an approval — a denial never reaches consumption."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "question.opened",
                "description": "Identifies this as a `question.opened` event."
              },
              "payload": {
                "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 questionnaire's unique id."
                  },
                  "conversationId": {
                    "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 containing this questionnaire."
                  },
                  "runId": {
                    "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 waiting for this questionnaire."
                  },
                  "callId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256,
                    "description": "The tool call that opened this questionnaire."
                  },
                  "questions": {
                    "minItems": 1,
                    "maxItems": 5,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "description": "The stable id used to match this question with its answer."
                        },
                        "label": {
                          "description": "Optional short title for this question.",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "prompt": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "description": "The question text shown to the user."
                        },
                        "options": {
                          "minItems": 2,
                          "maxItems": 6,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "value": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128,
                                "description": "The stable value returned when this option is selected."
                              },
                              "label": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512,
                                "description": "The text shown to the user for this option."
                              },
                              "description": {
                                "description": "Optional explanation shown with this option.",
                                "type": "string",
                                "maxLength": 512
                              },
                              "recommended": {
                                "description": "Whether this is the option the agent recommends: at most one per question, with why in its description.",
                                "type": "boolean"
                              },
                              "picture": {
                                "description": "A small drawing an app may show over this choice: `schedule` for buying on a regular schedule, `dip` for buying only after a fall, `once` for one buy now. Absent when none fits; an app that draws none shows the choice without it.",
                                "type": "string",
                                "enum": [
                                  "schedule",
                                  "dip",
                                  "once"
                                ]
                              }
                            },
                            "required": [
                              "value",
                              "label"
                            ],
                            "description": "One choice presented for a question."
                          },
                          "description": "The choices shown for this question."
                        },
                        "multiple": {
                          "description": "Whether the user may select more than one choice.",
                          "type": "boolean"
                        },
                        "amount": {
                          "type": "object",
                          "properties": {
                            "min": {
                              "type": "string",
                              "maxLength": 40,
                              "pattern": "^(0|[1-9]\\d{0,20})(\\.\\d{1,18})?$",
                              "description": "The smallest amount the slider offers, as a decimal string."
                            },
                            "max": {
                              "type": "string",
                              "maxLength": 40,
                              "pattern": "^(0|[1-9]\\d{0,20})(\\.\\d{1,18})?$",
                              "description": "The largest amount the slider offers, as a decimal string."
                            },
                            "step": {
                              "type": "string",
                              "maxLength": 40,
                              "pattern": "^(0|[1-9]\\d{0,20})(\\.\\d{1,18})?$",
                              "description": "How far one slider step moves, as a decimal string."
                            },
                            "unit": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 16,
                              "description": "What the amount counts: \"usd\" for dollars, or a token symbol such as \"USDC\"."
                            }
                          },
                          "required": [
                            "min",
                            "max",
                            "step",
                            "unit"
                          ],
                          "description": "Asks for one amount on a slider. The options are its presets, each value a decimal string within min and max; an amount between them is answered as customText."
                        }
                      },
                      "required": [
                        "id",
                        "prompt",
                        "options"
                      ],
                      "description": "One question and its available choices."
                    },
                    "description": "The questions and choices shown to the user."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "answered",
                      "skipped",
                      "expired",
                      "cancelled"
                    ],
                    "description": "The current questionnaire status."
                  },
                  "answer": {
                    "anyOf": [
                      {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "answered",
                                "description": "The questionnaire was answered."
                              },
                              "answers": {
                                "minItems": 1,
                                "maxItems": 5,
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 64,
                                      "description": "The id of the question this answer corresponds to."
                                    },
                                    "values": {
                                      "maxItems": 6,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 128
                                      },
                                      "description": "Selected option values; empty when customText is supplied."
                                    },
                                    "customText": {
                                      "description": "Optional user-supplied text in place of selected options.",
                                      "type": "string",
                                      "maxLength": 2048
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "values"
                                  ],
                                  "description": "The user's answer to one question."
                                },
                                "description": "The selected options or custom text for each question the user answered. A question they skipped has no answer."
                              }
                            },
                            "required": [
                              "status",
                              "answers"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "skipped",
                                "description": "The questionnaire was skipped."
                              }
                            },
                            "required": [
                              "status"
                            ]
                          }
                        ],
                        "description": "The result of answering or skipping a questionnaire."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "The accepted answers or skip result, or null when none was accepted."
                  },
                  "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 questionnaire was created."
                  },
                  "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": "When the questionnaire expires if unanswered."
                  },
                  "resolvedAt": {
                    "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 questionnaire was answered, skipped, expired, or cancelled; null while pending."
                  }
                },
                "required": [
                  "id",
                  "conversationId",
                  "runId",
                  "callId",
                  "questions",
                  "status",
                  "answer",
                  "createdAt",
                  "expiresAt",
                  "resolvedAt"
                ],
                "description": "The `question.opened` event's full resource."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "A questionnaire is waiting for the user. Its full content is durable and replayable."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "question.answered",
                "description": "Identifies this as a `question.answered` event."
              },
              "payload": {
                "type": "object",
                "properties": {
                  "questionId": {
                    "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 questionnaire that was resolved."
                  },
                  "answer": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "const": "answered",
                            "description": "The questionnaire was answered."
                          },
                          "answers": {
                            "minItems": 1,
                            "maxItems": 5,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 64,
                                  "description": "The id of the question this answer corresponds to."
                                },
                                "values": {
                                  "maxItems": 6,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "description": "Selected option values; empty when customText is supplied."
                                },
                                "customText": {
                                  "description": "Optional user-supplied text in place of selected options.",
                                  "type": "string",
                                  "maxLength": 2048
                                }
                              },
                              "required": [
                                "id",
                                "values"
                              ],
                              "description": "The user's answer to one question."
                            },
                            "description": "The selected options or custom text for each question the user answered. A question they skipped has no answer."
                          }
                        },
                        "required": [
                          "status",
                          "answers"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "const": "skipped",
                            "description": "The questionnaire was skipped."
                          }
                        },
                        "required": [
                          "status"
                        ]
                      }
                    ],
                    "description": "The user's answers or decision to skip."
                  },
                  "resolvedAt": {
                    "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 questionnaire was answered or skipped."
                  }
                },
                "required": [
                  "questionId",
                  "answer",
                  "resolvedAt"
                ],
                "description": "The `question.answered` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "The user answered or skipped a questionnaire; its accepted result is durable."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "question.closed",
                "description": "Identifies this as a `question.closed` event."
              },
              "payload": {
                "type": "object",
                "properties": {
                  "questionId": {
                    "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 questionnaire that was closed."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "expired",
                      "cancelled"
                    ],
                    "description": "Why the questionnaire closed without an answer."
                  },
                  "resolvedAt": {
                    "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 questionnaire closed."
                  }
                },
                "required": [
                  "questionId",
                  "status",
                  "resolvedAt"
                ],
                "description": "The `question.closed` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "A pending questionnaire expired or was cancelled."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "approval.consumed",
                "description": "Identifies this as an `approval.consumed` event."
              },
              "payload": {
                "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."
                  }
                },
                "required": [
                  "approvalId"
                ],
                "description": "The `approval.consumed` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "The approval was spent to authorize its tool call, immediately before that call runs. This is when the call is authorized, not when it finishes: the call can still fail after this event lands, and nothing here rolls it back. Marks the approval used; it cannot authorize a second execution."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "approval.expired",
                "description": "Identifies this as an `approval.expired` event."
              },
              "payload": {
                "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."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Why the approval expired: the deadline passed, or its run stopped first."
                  }
                },
                "required": [
                  "approvalId",
                  "reason"
                ],
                "description": "The `approval.expired` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "A parked approval lapsed before anyone decided: its deadline passed, or the run it belongs to stopped while it was still pending."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "automation.fired",
                "description": "Identifies this as an `automation.fired` event."
              },
              "payload": {
                "type": "object",
                "properties": {
                  "automationId": {
                    "type": "string",
                    "description": "The automation that fired this run."
                  },
                  "name": {
                    "type": "string",
                    "description": "The automation's name at the time it fired."
                  }
                },
                "required": [
                  "automationId",
                  "name"
                ],
                "description": "The `automation.fired` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "An automation triggered this conversation's run. Emitted once, immediately before the `run.started` it precedes, naming the automation and its name at fire time."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "intents.settlement",
                "description": "Identifies this as an `intents.settlement` event."
              },
              "payload": {
                "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."
                      },
                      "operationId": {
                        "description": "The durable financial request this evidence belongs to.",
                        "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)$"
                      },
                      "occurrenceId": {
                        "description": "The archived event's original identity, retained verbatim; current receipts use `operationId`.",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "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."
                      },
                      "operationId": {
                        "description": "The durable financial request this evidence belongs to.",
                        "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)$"
                      },
                      "occurrenceId": {
                        "description": "The archived event's original identity, retained verbatim; current receipts use `operationId`.",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "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."
                      },
                      "operationId": {
                        "description": "The durable financial request this evidence belongs to.",
                        "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)$"
                      },
                      "occurrenceId": {
                        "description": "The archived event's original identity, retained verbatim; current receipts use `operationId`.",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "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"
                    ]
                  }
                ],
                "description": "The `intents.settlement` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "A later, independently verified financial fact about one leg of an authorized swap — settled, refunded, or never executed — never inferred from the model's own tool result. Appended whenever the provider confirms the outcome, independent of the run that requested it; `legId` and `operationId` join it back to its financial request, progress and authorizing approval. Archived receipts retain their original `occurrenceId`."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "intents.progress",
                "description": "Identifies this as an `intents.progress` event."
              },
              "payload": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "operationId": {
                        "description": "The durable financial request this evidence belongs to.",
                        "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)$"
                      },
                      "occurrenceId": {
                        "description": "The archived event's original identity, retained verbatim; current progress uses `operationId`.",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "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 grant's approval id: the chat approval for a one-shot, the creation approval for an automation."
                      },
                      "kind": {
                        "type": "string",
                        "const": "planning",
                        "description": "Authorized; reading balances and prices to freeze the plan."
                      }
                    },
                    "required": [
                      "approvalId",
                      "kind"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "operationId": {
                        "description": "The durable financial request this evidence belongs to.",
                        "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)$"
                      },
                      "occurrenceId": {
                        "description": "The archived event's original identity, retained verbatim; current progress uses `operationId`.",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "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 grant's approval id: the chat approval for a one-shot, the creation approval for an automation."
                      },
                      "kind": {
                        "type": "string",
                        "const": "planned",
                        "description": "The frozen plan: every swap, with the amount on the side the plan fixed."
                      },
                      "legs": {
                        "minItems": 1,
                        "maxItems": 16,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "index": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 15,
                              "description": "This leg's position within the plan, counting from zero."
                            },
                            "input": {
                              "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": "The input asset and, when the plan fixed this side, the exact amount it spends."
                            },
                            "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": "The output asset and, when the plan fixed this side, the exact amount it receives."
                            },
                            "minimumOutputRaw": {
                              "description": "The floor an exact-input swap's output must clear; present only when the input side is fixed.",
                              "type": "string",
                              "pattern": "^(0|[1-9]\\d{0,38})$"
                            },
                            "maximumInputRaw": {
                              "description": "The ceiling an exact-output swap's input may spend; present only when the output side is fixed.",
                              "type": "string",
                              "pattern": "^(0|[1-9]\\d{0,38})$"
                            }
                          },
                          "required": [
                            "index",
                            "input",
                            "output"
                          ]
                        },
                        "description": "Every swap in the frozen plan, indexed from zero."
                      }
                    },
                    "required": [
                      "approvalId",
                      "kind",
                      "legs"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "operationId": {
                        "description": "The durable financial request this evidence belongs to.",
                        "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)$"
                      },
                      "occurrenceId": {
                        "description": "The archived event's original identity, retained verbatim; current progress uses `operationId`.",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "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 grant's approval id: the chat approval for a one-shot, the creation approval for an automation."
                      },
                      "kind": {
                        "type": "string",
                        "const": "stage",
                        "description": "One swap moved; `legId` joins it to its receipt once the swap is claimed."
                      },
                      "index": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 15,
                        "description": "Which leg, by position, this update is about."
                      },
                      "stage": {
                        "type": "string",
                        "enum": [
                          "checking",
                          "retrying",
                          "quoting",
                          "signed",
                          "confirming",
                          "unresolved"
                        ],
                        "description": "What the executor is doing right now, between approval and a receipt: `checking` while it checks the complete frozen request before dispatch; `retrying` while a bounded preparation attempt waits to retry; `quoting` while it fetches and validates the provider quote, then claims and signs; `signed` once the signature is persisted, about to submit; `confirming` once submitted (or recovered), waiting for the provider's terminal fact; `unresolved` when the run's settle budget ended before a terminal fact and the sweep continues."
                      },
                      "legId": {
                        "description": "Joins this stage to its settlement receipt once the swap is claimed; absent before then.",
                        "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)$"
                      }
                    },
                    "required": [
                      "approvalId",
                      "kind",
                      "index",
                      "stage"
                    ]
                  }
                ],
                "description": "The `intents.progress` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "Best-effort, display-only progress for an authorized swap, between approval and its settlement receipt: freezing the plan (`planning`), the frozen legs (`planned`), then each leg's own stage (`stage`). Never gates execution and may arrive out of order or not at all; an `intents.settlement` receipt always takes precedence, and a terminal outcome is never reported here."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "perps.reconciled",
                "description": "Identifies this as a `perps.reconciled` event."
              },
              "payload": {
                "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 that authorized the call."
                      },
                      "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 durable financial request this answer belongs to."
                      },
                      "callId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "description": "The tool call whose own result this answer supersedes, as `tool.result` names it."
                      },
                      "tool": {
                        "type": "string",
                        "enum": [
                          "perps_order_place",
                          "perps_order_cancel",
                          "perps_margin_update"
                        ],
                        "description": "The order placement, cancellation or margin change Hyperliquid has now answered."
                      },
                      "result": {
                        "description": "Hyperliquid's final answer, in the shape the tool itself returns: `placed`, `rejected`, `cancelled` or `applied`.",
                        "$ref": "#/components/schemas/PerpsOrderOutcome"
                      }
                    },
                    "required": [
                      "approvalId",
                      "operationId",
                      "callId",
                      "tool",
                      "result"
                    ]
                  },
                  {
                    "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 that authorized the call."
                      },
                      "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 durable financial request this answer belongs to."
                      },
                      "callId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "description": "The tool call whose own result this answer supersedes, as `tool.result` names it."
                      },
                      "tool": {
                        "type": "string",
                        "const": "perps_withdraw",
                        "description": "The withdrawal whose settlement the provider has now confirmed."
                      },
                      "result": {
                        "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"
                            ]
                          }
                        ],
                        "description": "The confirmed ending, in the shape the tool itself returns: `settled` or `refunded`."
                      }
                    },
                    "required": [
                      "approvalId",
                      "operationId",
                      "callId",
                      "tool",
                      "result"
                    ]
                  }
                ],
                "description": "The `perps.reconciled` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "A later, independently verified answer to an approved perps order, cancellation or withdrawal whose own `tool.result` was left unconfirmed — never inferred from the model's own tool result. Appended once, by recovery, in the same commit that records the request's final outcome, independent of the run that made the call; `callId` joins it to that call's `tool.result`, `approvalId` to its approval, and `operationId` to its financial request. `result` has the shape the tool itself returns; show it in place of the call's earlier unconfirmed result."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "prediction.funding",
                "description": "Identifies this as a `prediction.funding` event."
              },
              "payload": {
                "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 that authorized the call."
                  },
                  "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 durable financial request this answer belongs to."
                  },
                  "callId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256,
                    "description": "The tool call whose own result this answer supersedes, as `tool.result` names it."
                  },
                  "tool": {
                    "type": "string",
                    "const": "prediction_fund",
                    "description": "The funding tool whose call this updates."
                  },
                  "result": {
                    "description": "The funding's current stages, in the shape the tool itself returns.",
                    "$ref": "#/components/schemas/PredictionFundSubmitted"
                  }
                },
                "required": [
                  "approvalId",
                  "operationId",
                  "callId",
                  "tool",
                  "result"
                ],
                "description": "The `prediction.funding` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "Recovery's latest view of an approved `prediction_fund` call, appended whenever it changes, independent of the run that made the call: the first leg's verified 1Click outcome (native Base USDC delivered to Polymarket's bridge, refunded, or not executed) and every transaction the bridge reports at the pinned deposit address, each `COMPLETED` one checked against its canonical Polygon receipt. Delivery to the bridge is not pUSD funding, a bridge `FAILED` is not a refund, and attribution of any bridge transaction to this funding stays unknown. `callId` joins it to that call's `tool.result`; show the latest in place of it."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "prediction.withdrawal",
                "description": "Identifies this as a `prediction.withdrawal` event."
              },
              "payload": {
                "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 that authorized the call."
                  },
                  "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 durable financial request this answer belongs to."
                  },
                  "callId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256,
                    "description": "The tool call whose own result this answer supersedes, as `tool.result` names it."
                  },
                  "tool": {
                    "type": "string",
                    "const": "prediction_withdraw"
                  },
                  "result": {
                    "$ref": "#/components/schemas/PredictionWithdrawSubmitted"
                  }
                },
                "required": [
                  "approvalId",
                  "operationId",
                  "callId",
                  "tool",
                  "result"
                ],
                "description": "The attempted withdrawal's outgoing receipt, bridge observation and unique linked deposit arrival."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "Recovery's latest view of an attempted owner-approved pUSD withdrawal, independent of the run: its outgoing Polygon transfer receipt, what the bridge reports, and arrival at the unique linked 1Click deposit address. Only that deposit's own receipt establishes a credit or refund into the agent's confidential Intents wallet. A bridge status alone is not a receipt. Replace the original tool result by callId; recovery never signs or resends."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "composite.progress",
                "description": "Identifies this as a `composite.progress` event."
              },
              "payload": {
                "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."
                  },
                  "callId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256,
                    "description": "The `composite_execute` call."
                  },
                  "revision": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1024,
                    "description": "Snapshot order: ignore an older snapshot for the same call."
                  },
                  "pieces": {
                    "minItems": 1,
                    "maxItems": 6,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "index": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 5
                        },
                        "tool": {
                          "type": "string",
                          "enum": [
                            "intents_execute",
                            "perps_fund",
                            "perps_order_place",
                            "prediction_fund",
                            "prediction_order_place",
                            "perps_withdraw",
                            "prediction_withdraw"
                          ]
                        },
                        "operationId": {
                          "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"
                            }
                          ]
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "todo",
                            "live",
                            "done",
                            "bad",
                            "skip"
                          ],
                          "description": "`todo` waiting, `live` running, `done` executed, `bad` failed, `skip` never started because a piece it depends on did not succeed or the basket ended."
                        },
                        "reason": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 300
                        }
                      },
                      "required": [
                        "index",
                        "tool",
                        "operationId",
                        "state"
                      ]
                    }
                  }
                },
                "required": [
                  "approvalId",
                  "callId",
                  "revision",
                  "pieces"
                ],
                "description": "Display-only basket piece states."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "Best-effort display snapshot of an approved basket's pieces (`composite_execute`), appended after a piece changes state: each piece `todo`, `live`, `done`, `bad` or `skip`. Revision orders snapshots for the same call; ignore an older one. The call's own `tool.result` is the authoritative outcome of every piece, and each piece's own venue events keep their meaning; progress grants no execution permission."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "solana.progress",
                "description": "Identifies this as a `solana.progress` event."
              },
              "payload": {
                "type": "object",
                "properties": {
                  "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)$"
                  },
                  "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."
                  },
                  "callId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256,
                    "description": "The original tool call, including a standing occurrence without its own approval card."
                  },
                  "revision": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1024,
                    "description": "Persisted lifecycle stage number. Ignore an older snapshot for the same operation."
                  },
                  "phase": {
                    "type": "string",
                    "enum": [
                      "funding",
                      "swap",
                      "sweep"
                    ]
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "preparing",
                      "prepared",
                      "submitting",
                      "pending",
                      "delivering",
                      "confirmed",
                      "uncertain",
                      "refunded",
                      "failed",
                      "not_executed"
                    ]
                  },
                  "transactionIndex": {
                    "description": "The stored native transaction attempt, never a funding plan leg index.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 5
                  },
                  "sale": {
                    "description": "On a multi-coin sale's swap, which coin it sells: its zero-based place in the sale's `sells`. A multi-coin sale's progress names this in place of `transactionIndex`, and nothing on its one transfer back; absent on every other operation.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 5
                  },
                  "paid": {
                    "description": "What a sale sold, once its swap landed: the amount its result reports as `paid`. Absent before then, and for other operations.",
                    "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"
                    ]
                  }
                },
                "required": [
                  "operationId",
                  "approvalId",
                  "callId",
                  "revision",
                  "phase",
                  "state"
                ],
                "description": "Display-only committed Solana stage, never a final operation result."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "Best-effort display snapshot derived from committed Solana funding, swap or sweep facts. Revision orders snapshots; repeated unchanged observations are omitted. A confirmed funding phase is only delivered SOL, and a confirmed swap phase does not establish sweep settlement. Final tool outcomes and solana.reconciled remain authoritative; progress grants no execution permission."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "solana.reconciled",
                "description": "Identifies this as a `solana.reconciled` event."
              },
              "payload": {
                "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 that authorized the call."
                  },
                  "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 durable financial request this answer belongs to."
                  },
                  "callId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256,
                    "description": "The tool call whose own result this answer supersedes, as `tool.result` names it."
                  },
                  "tool": {
                    "type": "string",
                    "enum": [
                      "solana_buy",
                      "solana_sell",
                      "solana_sell_many",
                      "solana_withdraw"
                    ],
                    "description": "The Solana buy, sell, multi-coin sale or withdrawal whose outcome is now known."
                  },
                  "result": {
                    "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"
                        ]
                      }
                    ],
                    "description": "The confirmed ending, in the shape the tool itself returns, with its `solana` detail."
                  }
                },
                "required": [
                  "approvalId",
                  "operationId",
                  "callId",
                  "tool",
                  "result"
                ],
                "description": "The `solana.reconciled` event's own fields."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "A later, independently verified answer to an approved Solana buy, sell or withdrawal whose own `tool.result` was left unconfirmed — never inferred from the model's own tool result. Appended once, by recovery, in the same commit that records the request's final outcome, independent of the run that made the call; `callId` joins it to that call's `tool.result`, `approvalId` to its approval, and `operationId` to its financial request. `result` has the shape the tool itself returns, with its `solana` detail; show it in place of the call's earlier unconfirmed result."
          },
          {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The event's position in the conversation's journal; strictly increasing."
              },
              "conversationId": {
                "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."
              },
              "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 event was appended to the journal."
              },
              "requestId": {
                "description": "The request that produced this event, when one did; null for scheduler and recovery writes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "prediction.order",
                "description": "Identifies this as a `prediction.order` event."
              },
              "payload": {
                "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 that authorized the call."
                  },
                  "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 durable financial request this answer belongs to."
                  },
                  "callId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256,
                    "description": "The tool call whose own result this answer supersedes, as `tool.result` names it."
                  },
                  "tool": {
                    "type": "string",
                    "const": "prediction_order_place"
                  },
                  "result": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "const": "submitted"
                          },
                          "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)$"
                          },
                          "order": {
                            "$ref": "#/components/schemas/PredictionOrderInput"
                          },
                          "observation": {
                            "type": "object",
                            "properties": {
                              "orderId": {
                                "type": "string",
                                "pattern": "^0x[0-9a-f]{64}$"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "live",
                                  "partially_filled",
                                  "matched",
                                  "filled",
                                  "cancelled",
                                  "expired",
                                  "rejected",
                                  "uncertain"
                                ]
                              },
                              "originalSizeRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9][0-9]{0,77})$"
                              },
                              "matchedSizeRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9][0-9]{0,77})$"
                              },
                              "remainingSizeRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9][0-9]{0,77})$"
                              },
                              "trades": {
                                "maxItems": 1000,
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "tradeId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "status": {
                                      "type": "string",
                                      "enum": [
                                        "MATCHED",
                                        "MINED",
                                        "CONFIRMED",
                                        "RETRYING",
                                        "FAILED"
                                      ]
                                    },
                                    "sizeRaw": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9][0-9]{0,77})$"
                                    },
                                    "transactionHash": {
                                      "type": "string",
                                      "pattern": "^0x[0-9a-f]{64}$"
                                    }
                                  },
                                  "required": [
                                    "tradeId",
                                    "status",
                                    "sizeRaw"
                                  ]
                                }
                              },
                              "observedAtMs": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "settledCollateralRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9][0-9]{0,77})$"
                              },
                              "settledFeeRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9][0-9]{0,77})$"
                              },
                              "cancelRequested": {
                                "type": "boolean"
                              },
                              "polymarketError": {
                                "description": "What Polymarket answered when the order was sent, when it answered with an error: kept with the order for good. Absent when Polymarket gave no reason.",
                                "type": "object",
                                "properties": {
                                  "httpStatus": {
                                    "description": "The HTTP status Polymarket answered with, when it answered with an error status.",
                                    "type": "integer",
                                    "minimum": 100,
                                    "maximum": 599
                                  },
                                  "message": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 300,
                                    "description": "Polymarket's own words, exactly as it answered, cut to their first 300 characters."
                                  }
                                },
                                "required": [
                                  "message"
                                ]
                              }
                            },
                            "required": [
                              "orderId",
                              "status",
                              "originalSizeRaw",
                              "matchedSizeRaw",
                              "remainingSizeRaw",
                              "trades",
                              "observedAtMs"
                            ]
                          }
                        },
                        "required": [
                          "status",
                          "operationId",
                          "order",
                          "observation"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "const": "blocked"
                          },
                          "reason": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256
                          }
                        },
                        "required": [
                          "status",
                          "reason"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "approvalId",
                  "operationId",
                  "callId",
                  "tool",
                  "result"
                ],
                "description": "The original Polymarket order's latest observed state, not a new placement."
              }
            },
            "required": [
              "seq",
              "conversationId",
              "createdAt",
              "requestId",
              "type",
              "payload"
            ],
            "description": "The latest observation of a Polymarket order. Replace the original placement call's result, joined by `callId`, with `result`. A match is not settlement; cancellation stops only the unmatched part and does not reverse earlier fills. Observations can arrive after the run ends."
          }
        ],
        "description": "One journal entry: the event type and its payload, in the order it happened."
      },
      "MessageToSign": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The text the user signs with their registered wallet or passkey. Sign it exactly as returned: a changed character makes the signature invalid."
          },
          "controllerId": {
            "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 user's registered wallet or passkey, the only one whose signature is accepted. Send it back unchanged beside the signature."
          },
          "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": "When the signature stops being accepted, about four and a half minutes after this was issued. Send it back unchanged beside the signature."
          },
          "recipient": {
            "description": "NEAR wallets only: the `recipient` to pass to `signMessage` together with the message.",
            "type": "string"
          }
        },
        "required": [
          "message",
          "controllerId",
          "expiresAt"
        ],
        "description": "A message for the user to sign with their registered wallet or passkey, and the values to send back with the signature."
      },
      "AutomationJsonValue": {
        "description": "Any JSON value: a string, number, boolean, null, array or object, nested to any depth.",
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationJsonValue"
            }
          },
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/AutomationJsonValue"
            }
          }
        ]
      },
      "AutomationRule": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "number",
            "const": 1,
            "description": "The rule schema's version; always `1`."
          },
          "delivery": {
            "default": {
              "overlap": "queue",
              "maxPendingOccurrences": 100
            },
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "overlap": {
                    "type": "string",
                    "const": "queue",
                    "description": "Queue a new occurrence and run it once the active one finishes."
                  },
                  "maxPendingOccurrences": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "description": "How many occurrences may wait in the queue, not counting the one currently active, including one whose run is itself waiting on an approval."
                  }
                },
                "required": [
                  "overlap",
                  "maxPendingOccurrences"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "overlap": {
                    "type": "string",
                    "const": "coalesce",
                    "description": "Close the occurrence already pending as `coalesced` and record the new match as a fresh occurrence, rather than queuing a second."
                  }
                },
                "required": [
                  "overlap"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "overlap": {
                    "type": "string",
                    "const": "skip",
                    "description": "Drop a new match while an occurrence is already active."
                  }
                },
                "required": [
                  "overlap"
                ]
              }
            ],
            "description": "What happens when a new occurrence is ready before the previous one has finished."
          },
          "maxDeliveryLatenessSeconds": {
            "default": 86400,
            "description": "How long a new occurrence may wait to be delivered before its deadline passes and it is refused, in seconds.",
            "type": "integer",
            "minimum": 1,
            "maximum": 86400
          },
          "maxEvaluationGapSeconds": {
            "default": 600,
            "description": "The longest gap allowed between evaluations before `firing.mode: rising_edge` treats its history as broken and waits for a fresh baseline, in seconds.",
            "type": "integer",
            "minimum": 1,
            "maximum": 2678400
          },
          "wakes": {
            "minItems": 1,
            "maxItems": 7,
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "at",
                      "description": "A one-time wake at an exact moment; exhausted after that check, even if its condition is false."
                    },
                    "runAt": {
                      "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                      "description": "The exact moment this wake fires, as an ISO 8601 timestamp with an offset."
                    },
                    "misfire": {
                      "default": {
                        "mode": "latest",
                        "maxLatenessSeconds": null
                      },
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "skip",
                              "description": "Drop a wake the engine could not evaluate in time; wait for the next one."
                            },
                            "graceSeconds": {
                              "default": 5,
                              "description": "How late this wake may still run before it counts as missed, in seconds.",
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 60
                            }
                          },
                          "required": [
                            "mode",
                            "graceSeconds"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "latest",
                              "description": "Run once for the most recently missed wake, dropping any earlier ones."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode",
                            "maxLatenessSeconds"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "all",
                              "description": "Run once for every missed wake, oldest first."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode",
                            "maxLatenessSeconds"
                          ]
                        }
                      ],
                      "description": "What happens when the engine could not evaluate this wake on time."
                    },
                    "evaluationTime": {
                      "default": "detection_time",
                      "description": "Which moment this wake is evaluated as of: `scheduled_time` the time it was due, `detection_time` when the engine actually ran it.",
                      "type": "string",
                      "enum": [
                        "scheduled_time",
                        "detection_time"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "runAt",
                    "misfire",
                    "evaluationTime"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "interval",
                      "description": "A wake that repeats on a fixed elapsed interval."
                    },
                    "intervalMinutes": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 44640,
                      "description": "How often this wake repeats, in minutes."
                    },
                    "misfire": {
                      "default": {
                        "mode": "latest",
                        "maxLatenessSeconds": null
                      },
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "skip",
                              "description": "Drop a wake the engine could not evaluate in time; wait for the next one."
                            },
                            "graceSeconds": {
                              "default": 5,
                              "description": "How late this wake may still run before it counts as missed, in seconds.",
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 60
                            }
                          },
                          "required": [
                            "mode",
                            "graceSeconds"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "latest",
                              "description": "Run once for the most recently missed wake, dropping any earlier ones."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode",
                            "maxLatenessSeconds"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "all",
                              "description": "Run once for every missed wake, oldest first."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode",
                            "maxLatenessSeconds"
                          ]
                        }
                      ],
                      "description": "What happens when the engine could not evaluate this wake on time."
                    },
                    "evaluationTime": {
                      "default": "detection_time",
                      "description": "Which moment this wake is evaluated as of: `scheduled_time` the time it was due, `detection_time` when the engine actually ran it.",
                      "type": "string",
                      "enum": [
                        "scheduled_time",
                        "detection_time"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "intervalMinutes",
                    "misfire",
                    "evaluationTime"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "calendar",
                      "description": "A wake on a recurring calendar schedule: local times, weekdays, months and days of the month."
                    },
                    "timeZone": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80,
                      "description": "The IANA time zone a calendar wake's local times are interpreted in."
                    },
                    "localTimes": {
                      "minItems": 1,
                      "maxItems": 24,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                      },
                      "description": "The times of day this wake fires, each in 24-hour `HH:MM` form, in `timeZone`."
                    },
                    "weekdays": {
                      "default": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7
                      ],
                      "description": "Which ISO weekdays this wake fires on, 1 (Monday) through 7 (Sunday). Defaults to every day.",
                      "minItems": 1,
                      "maxItems": 7,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 7
                      }
                    },
                    "months": {
                      "default": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12
                      ],
                      "description": "Which months this wake fires in, 1 (January) through 12 (December). Defaults to every month.",
                      "minItems": 1,
                      "maxItems": 12,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 12
                      }
                    },
                    "monthDays": {
                      "default": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26,
                        27,
                        28,
                        29,
                        30,
                        31
                      ],
                      "description": "Which days of the month this wake fires on, 1 through 31. Defaults to every day.",
                      "minItems": 1,
                      "maxItems": 31,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 31
                      }
                    },
                    "misfire": {
                      "default": {
                        "mode": "latest",
                        "maxLatenessSeconds": null
                      },
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "skip",
                              "description": "Drop a wake the engine could not evaluate in time; wait for the next one."
                            },
                            "graceSeconds": {
                              "default": 5,
                              "description": "How late this wake may still run before it counts as missed, in seconds.",
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 60
                            }
                          },
                          "required": [
                            "mode",
                            "graceSeconds"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "latest",
                              "description": "Run once for the most recently missed wake, dropping any earlier ones."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode",
                            "maxLatenessSeconds"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "all",
                              "description": "Run once for every missed wake, oldest first."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode",
                            "maxLatenessSeconds"
                          ]
                        }
                      ],
                      "description": "What happens when the engine could not evaluate this wake on time."
                    },
                    "evaluationTime": {
                      "default": "detection_time",
                      "description": "Which moment this wake is evaluated as of: `scheduled_time` the time it was due, `detection_time` when the engine actually ran it.",
                      "type": "string",
                      "enum": [
                        "scheduled_time",
                        "detection_time"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "timeZone",
                    "localTimes",
                    "weekdays",
                    "months",
                    "monthDays",
                    "misfire",
                    "evaluationTime"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "event",
                      "description": "A wake evaluated each time a matching custom webhook event arrives."
                    },
                    "eventType": {
                      "type": "string",
                      "pattern": "^[A-Za-z][A-Za-z0-9_.:-]{0,79}$",
                      "description": "The event `type` this wake matches; a live webhook delivery of a different type is ignored before it reaches the condition."
                    },
                    "fields": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "path": {
                            "minItems": 1,
                            "maxItems": 8,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
                            },
                            "description": "The keys to walk, in order, from an observation's top level down to this field."
                          },
                          "valueType": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "boolean",
                                    "description": "A true/false value."
                                  }
                                },
                                "required": [
                                  "type"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "string",
                                    "description": "A text value."
                                  }
                                },
                                "required": [
                                  "type"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "integer",
                                    "description": "A whole-number value, compared exactly."
                                  },
                                  "unit": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64,
                                    "description": "The unit an integer or decimal value is measured in, as the source or literal declares it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "unit"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "decimal",
                                    "description": "An exact decimal value, as text, compared exactly."
                                  },
                                  "unit": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64,
                                    "description": "The unit an integer or decimal value is measured in, as the source or literal declares it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "unit"
                                ]
                              }
                            ],
                            "description": "What type this field's value has, and the unit it carries when it has one."
                          },
                          "optional": {
                            "description": "Whether the provider may genuinely not observe this field, rather than fail to read it. When true, a missing value resolves a condition over it to `missing_field` and the rule's verdict to `unknown`, rather than zero, null or false.",
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "path",
                          "valueType"
                        ],
                        "description": "One data field an event or a source's observation carries: where it lives, and its type."
                      },
                      "description": "The data fields an event of this type is declared to carry."
                    }
                  },
                  "required": [
                    "kind",
                    "eventType",
                    "fields"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "reader_update",
                      "description": "A wake evaluated each time the named reader delivers a fresh observation."
                    },
                    "binding": {
                      "type": "string",
                      "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                      "description": "The binding name a rule or a plan gives one configured source."
                    }
                  },
                  "required": [
                    "kind",
                    "binding"
                  ]
                }
              ]
            },
            "description": "Occasions to evaluate the rule's condition: alternatives, not an AND of conditions. At most one clock and one event stream."
          },
          "readers": {
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                  "description": "The binding name a rule or a plan gives one configured source."
                },
                "readerId": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.-]{0,79}$",
                  "description": "The installed source operation's id, as listed by List automation data sources."
                },
                "config": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "$ref": "#/components/schemas/AutomationJsonValue"
                  },
                  "description": "Arbitrary JSON data: an event's data, a reader's configuration, or a source plan's configuration. Bounded to 16 KiB, 8 levels of nesting and 256 entries."
                },
                "delivery": {
                  "description": "Use reviewed push updates; omit for periodic snapshots.",
                  "type": "string",
                  "const": "push"
                },
                "pollIntervalSeconds": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 2147483,
                  "description": "Polling cadence, or subscription lease/reconciliation cadence for push delivery, in seconds."
                },
                "maxAgeSeconds": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 86400,
                  "description": "Maximum retained input age at evaluation, matching requirement.maxAgeSeconds when present. Snapshots use observation time; events use trusted receipt time. Collection separately enforces the provider's acquisition-age guarantee."
                },
                "requirement": {
                  "type": "object",
                  "properties": {
                    "maxLatencySeconds": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 2147483
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The target delay between an observation and its delivery, in seconds; null when delivery has no target deadline."
                    },
                    "maxAgeSeconds": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 86400,
                      "description": "Maximum acceptable input age at evaluation, matching the reader's maxAgeSeconds, measured from the provider's own observation time. The selected provider's acquisition guarantee must fit within this limit and does not reduce this evaluation window."
                    },
                    "allowDegradedLatency": {
                      "type": "boolean",
                      "description": "Whether delivery slower than the target delay is still accepted."
                    },
                    "maxAcceptedLatencySeconds": {
                      "description": "The slowest delivery still accepted, in seconds, when `allowDegradedLatency` is set.",
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 2147483
                    }
                  },
                  "required": [
                    "maxLatencySeconds",
                    "maxAgeSeconds",
                    "allowDegradedLatency"
                  ],
                  "description": "What a reader needs from its source: how fresh an answer must be, and whether a slower one is still acceptable."
                }
              },
              "required": [
                "name",
                "readerId",
                "config",
                "pollIntervalSeconds",
                "maxAgeSeconds"
              ]
            },
            "description": "The named source bindings this rule reads from, referenced by `condition` and by each `reader_update` wake's `binding`."
          },
          "condition": {
            "description": "The rule's condition tree, up to 8 levels deep and 128 nodes total, built from five node kinds: `{op:\"bool\", value}` a fixed true/false leaf; `{op:\"compare\", comparator, left, right}` one of `eq`/`ne`/`lt`/`lte`/`gt`/`gte` between two operands — `lt`/`lte`/`gt`/`gte` require both operands to be `integer` or `decimal`, and both sides must share the same type and, for `integer`/`decimal`, the same unit; `{op:\"all\", args}` / `{op:\"any\", args}` AND/OR over one or more child nodes; `{op:\"not\", arg}` negates one child node. An operand is either `{kind:\"field\", binding, path}` — a bound reader's name and the key path into its data — or `{kind:\"literal\", type, value, unit?}` with `type` one of `boolean`/`string`/`integer`/`decimal` (`integer`/`decimal` values are exact decimal strings and carry `unit`)."
          },
          "exit": {
            "description": "The exit watch, when this rule's automation has exit actions on its contract. Present exactly when the contract has an exit action.",
            "type": "object",
            "properties": {
              "intervalSeconds": {
                "type": "integer",
                "minimum": 60,
                "maximum": 2678400,
                "description": "How often this automation re-checks its exit guards, in seconds; at least 60 and at most 2678400 (31 days), the same span an interval wake may cover. Recommend 300."
              },
              "readers": {
                "type": "object",
                "properties": {
                  "asset": {
                    "type": "string",
                    "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                    "description": "The binding in `readers` that prices the asset this automation bought, in USD."
                  },
                  "quote": {
                    "type": "string",
                    "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                    "description": "The binding in `readers` that prices the token this automation pays with, in USD."
                  }
                },
                "required": [
                  "asset",
                  "quote"
                ],
                "description": "The two price bindings each exit guard is measured against; both must be the reviewed USD token-price operation."
              },
              "push": {
                "description": "Additional push-delivered USD prices that may check exits between periodic 1Click checks.",
                "type": "object",
                "properties": {
                  "readers": {
                    "type": "object",
                    "properties": {
                      "asset": {
                        "type": "string",
                        "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                        "description": "The binding name a rule or a plan gives one configured source."
                      },
                      "quote": {
                        "type": "string",
                        "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                        "description": "The binding name a rule or a plan gives one configured source."
                      }
                    },
                    "required": [
                      "asset",
                      "quote"
                    ],
                    "description": "The supplementary price bindings for the bought asset and its paying token."
                  }
                },
                "required": [
                  "readers"
                ]
              }
            },
            "required": [
              "intervalSeconds",
              "readers"
            ]
          },
          "firing": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "each_match",
                  "rising_edge"
                ],
                "description": "When a qualifying evaluation fires: `each_match` fires on every qualifying evaluation, including the first; `rising_edge` fires only on a known false-to-true transition."
              },
              "repeat": {
                "type": "string",
                "enum": [
                  "once",
                  "repeating"
                ],
                "description": "Whether this rule fires at most once, or keeps watching after it fires."
              },
              "maxRuns": {
                "description": "Maximum deliverable runs recorded for this automation across pauses and resumes. Missed or refused deliveries do not count; recorded runs count even if later canceled, coalesced or failed. Omit for no finite limit beyond repeat=once.",
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              },
              "initial": {
                "type": "string",
                "enum": [
                  "baseline",
                  "fire_if_true"
                ],
                "description": "How `rising_edge` treats the first known state: `baseline` records it without firing, `fire_if_true` fires immediately if it is already true."
              },
              "cooldownSeconds": {
                "type": "integer",
                "minimum": 0,
                "maximum": 2678400,
                "description": "The minimum time between firings, in seconds; it does not require the condition to stay true that whole time. For `rising_edge`, a false-to-true edge that lands inside cooldown is discarded, not queued: it is not replayed once cooldown ends, so the rule needs an entirely fresh edge after cooldown lapses before it fires again — simply remaining true past the cooldown boundary does not trigger a firing."
              }
            },
            "required": [
              "mode",
              "repeat",
              "initial",
              "cooldownSeconds"
            ],
            "description": "How this rule turns a qualifying evaluation into a firing: which ones count, how often, and how many."
          },
          "news": {
            "description": "Present only on a news exit: the owner's own words, which Fin's news judge reads new stories against. Its rule is fixed: one `news.judged` event wake, no readers, the judged condition and one firing, over a reduce-only perps contract.",
            "type": "object",
            "properties": {
              "condition": {
                "type": "string",
                "minLength": 3,
                "maxLength": 500,
                "description": "The owner's condition in their own words, exactly as they said it, such as `right before Anthropic's IPO`. Never paraphrased: the judge reads the news against these words."
              },
              "match": {
                "type": "string",
                "minLength": 2,
                "maxLength": 80,
                "pattern": "^[\\p{L}\\p{N} .'&-]+$",
                "description": "A few words every story the judge reads must contain in its headline or summary, such as `Anthropic IPO`: a broad filter, not the condition. The judge decides from the condition."
              }
            },
            "required": [
              "condition",
              "match"
            ]
          },
          "maxSnapshotSkewSeconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 86400,
            "description": "The most that bound readers' observation times may disagree before evaluation reports `snapshot_skew`, in seconds."
          }
        },
        "required": [
          "schemaVersion",
          "delivery",
          "maxDeliveryLatenessSeconds",
          "maxEvaluationGapSeconds",
          "wakes",
          "readers",
          "condition",
          "firing",
          "maxSnapshotSkewSeconds"
        ],
        "description": "One automation's rule: when it wakes, what condition it evaluates, and how it fires."
      },
      "JsonValue": {
        "description": "Any JSON value: a string, number, boolean, null, array or object.",
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        ]
      },
      "PolicyApprovalMessage": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "const": "fin.policy.contract.v1",
            "description": "Domain separation for this signed policy message."
          },
          "binding": {
            "type": "object",
            "properties": {
              "network": {
                "type": "string",
                "enum": [
                  "testnet",
                  "mainnet"
                ],
                "description": "The NEAR network this policy deployment serves."
              },
              "project_uuid": {
                "type": "string",
                "minLength": 1,
                "description": "Stable policy deployment identifier."
              },
              "caller_id": {
                "type": "string",
                "minLength": 1,
                "description": "Fin integration identity bound into consent."
              }
            },
            "required": [
              "network",
              "project_uuid",
              "caller_id"
            ],
            "description": "The deployment and caller to which this consent applies."
          },
          "owner_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "SHA-256 of the canonical owner descriptor."
          },
          "wallet_id": {
            "type": "string",
            "minLength": 1,
            "description": "The policy worker's wallet identity receiving this grant; the worker spends only from that wallet's own account."
          },
          "approval_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 exact persisted approval to which this owner-signed grant belongs."
          },
          "nonce": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "Unique consent nonce; replay cannot create additional allowance."
          },
          "issued_at_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Consent issue time in Unix milliseconds."
          },
          "source": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "one_shot",
                    "description": "One approved request, executed by the run that asked for it."
                  }
                },
                "required": [
                  "kind"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "grid",
                    "description": "A standing grid grant: the cell orders its terms derive, placed by the grid engine without a run."
                  }
                },
                "required": [
                  "kind"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "automation",
                    "description": "A standing grant that the named automation's recorded firings may exercise."
                  },
                  "definition": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120,
                        "description": "The automation's name, as approved."
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 8192,
                        "description": "The automation's saved prompt, as approved."
                      },
                      "rule": {
                        "$ref": "#/components/schemas/AutomationRule"
                      }
                    },
                    "required": [
                      "name",
                      "prompt",
                      "rule"
                    ],
                    "description": "The automation's exact saved definition; any edit invalidates this consent."
                  },
                  "maxSigningDelaySeconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 86400,
                    "description": "The owner-approved time after the worker records a firing during which its run may obtain signatures."
                  },
                  "automationId": {
                    "description": "The saved automation whose edited terms the owner approves; absent for creation.",
                    "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)$"
                  },
                  "definitionVersion": {
                    "description": "The saved definition version those edited terms authorize; absent for creation.",
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "kind",
                  "definition",
                  "maxSigningDelaySeconds"
                ]
              }
            ],
            "description": "What this consent authorizes: one present-user request, the firings of one exact automation, or one grid's derived orders."
          },
          "contract": {
            "oneOf": [
              {
                "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"
                ]
              },
              {
                "$ref": "#/components/schemas/LimitOrderContract"
              },
              {
                "$ref": "#/components/schemas/PerpsTransferContract"
              },
              {
                "$ref": "#/components/schemas/PerpsOrderContract"
              },
              {
                "$ref": "#/components/schemas/PerpsCancelContract"
              },
              {
                "$ref": "#/components/schemas/PerpsAutomationContract"
              },
              {
                "$ref": "#/components/schemas/PerpsMarginContract"
              },
              {
                "$ref": "#/components/schemas/PredictionFundContract"
              },
              {
                "$ref": "#/components/schemas/SolanaBuyContract"
              },
              {
                "$ref": "#/components/schemas/SolanaSellContract"
              },
              {
                "$ref": "#/components/schemas/SolanaFundContract"
              },
              {
                "$ref": "#/components/schemas/SolanaWithdrawContract"
              },
              {
                "$ref": "#/components/schemas/PredictionOrderContract"
              },
              {
                "$ref": "#/components/schemas/PredictionWithdrawContract"
              },
              {
                "$ref": "#/components/schemas/CompositeContract"
              },
              {
                "$ref": "#/components/schemas/PredictionAutomationContract"
              },
              {
                "$ref": "#/components/schemas/SolanaSellManyContract"
              },
              {
                "$ref": "#/components/schemas/GridContract"
              },
              {
                "$ref": "#/components/schemas/PerpsFreedWithdrawalContract"
              },
              {
                "$ref": "#/components/schemas/PredictionFreedWithdrawalContract"
              }
            ],
            "description": "The exact approved authority: swap actions with their bounds, count and expiry, one limit order, one perps transfer/order/cancellation or margin change, one Polymarket funding/order/withdrawal, the exact Solana actions, or one grid."
          }
        },
        "required": [
          "domain",
          "binding",
          "owner_id",
          "wallet_id",
          "approval_id",
          "nonce",
          "issued_at_ms",
          "source",
          "contract"
        ],
        "description": "Owner-signed authority for one exact financial contract."
      },
      "User": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "description": "Your identifier for this user: unique within your partner, 1-128 characters of letters, digits, `.`, `_`, `:` or `-`, starting with a letter or digit. It appears in URLs, so never use an email address or other personal data."
          },
          "partnerId": {
            "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": "Your partner id, from your API key."
          },
          "agentId": {
            "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 user's agent."
          },
          "sessionId": {
            "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": "This session's id; Revoke a session signs it out."
          },
          "controllerId": {
            "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 id of the wallet or passkey the user signed in with."
          },
          "name": {
            "type": "string",
            "description": "The user's display name."
          },
          "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": "When this session expires (UTC)."
          }
        },
        "required": [
          "userId",
          "partnerId",
          "agentId",
          "sessionId",
          "controllerId",
          "name",
          "expiresAt"
        ],
        "description": "The signed-in user, their agent and the session the token belongs to."
      },
      "UserFeature": {
        "type": "object",
        "properties": {
          "feature": {
            "type": "string",
            "enum": [
              "limit_orders",
              "market_research",
              "push_exit_monitoring",
              "perps",
              "perps_api_wallet",
              "tokenized_stocks",
              "earn",
              "steering",
              "prediction",
              "notifications",
              "solana",
              "voice",
              "agent_api_wallets",
              "baskets",
              "news_exits",
              "news_home",
              "grid_trading",
              "funded_orders",
              "feed_extension",
              "proactive",
              "cash_outs",
              "coin_funding"
            ],
            "description": "The feature:\n- `limit_orders`: Placing new resting limit orders. Reading and cancelling orders are never gated.\n- `market_research`: Research in chat from the market desk: its market read, liquidity map and narratives, price history, news, prediction markets, derivatives, sentiment, macro and protocol data, project profiles, fundraising and research.\n- `push_exit_monitoring`: Push price feeds as an extra exit trigger on new automations, checked when one is previewed or saved.\n- `perps`: Opening, reading, funding and trading the agent's own Hyperliquid perpetual futures account.\n- `perps_api_wallet`: Sign the agent's Hyperliquid orders, cancels and margin changes with an approved API wallet instead of the account key.\n- `tokenized_stocks`: Buying and selling Ondo's tokenized U.S. stocks and ETFs, where the user's country allows them.\n- `earn`: Depositing into near.com's curated yield vaults. Withdrawing from a vault is never gated.\n- `steering`: Sending a message to a run that is still working, so the agent reads it at its next step.\n- `prediction`: Opening, reading, funding and exact approved orders on the agent's own Polymarket account.\n- `notifications`: Lets fin promise a ping on the person's devices, where their app delivers one.\n- `solana`: Buying any Solana token through the agent's own Solana account, and finding memecoins. Selling and withdrawing are never gated.\n- `voice`: Talking instead of typing: one short recording turned into text in the message box, on the deployment's own model provider.\n- `agent_api_wallets`: New agent wallets set up through the NEAR Intents Agent API, owned by the user's own wallet or passkey, for users whose app reads the wallet's `intentsAccount`.\n- `baskets`: Turning an idea into a basket of positions across venues, bought with one approval and one signature.\n- `news_exits`: Closing a perps position when the news shows what its owner described in their own words.\n- `news_home`: The fin app's news-first Home: a token ticker, the market's top stories and latest moves, and the balance with its four actions in the sidebar.\n- `grid_trading`: Starting and resuming grids of resting limit orders. Reading, pausing and cancelling a grid are never gated.\n- `funded_orders`: One approval that funds a Polymarket buy's or a Hyperliquid perps order's shortfall, then places the order.\n- `feed_extension`: Experimental feed extension pages and post handoff.\n- `proactive`: fin pings about big news and big moves in what the person holds and looks over their week, with options; in chat, an answer about the news ends with ways to act on it.\n- `cash_outs`: One approval that closes a perps position or sells Polymarket shares, then brings what that freed home.\n- `coin_funding`: A one-shot venue funding paid from a coin of the agent wallet (NEAR, ETH, BTC and the other reviewed coins) under its one signature."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the user has the feature now."
          }
        },
        "required": [
          "feature",
          "enabled"
        ],
        "description": "A feature and whether this user has it."
      },
      "UserFeatures": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserFeature"
            },
            "description": "Every feature, each once."
          }
        },
        "required": [
          "data"
        ],
        "description": "The features an operator turns on or off for each user, and this user's."
      },
      "PartnerFeature": {
        "type": "object",
        "properties": {
          "feature": {
            "type": "string",
            "enum": [
              "market_briefs",
              "disable_invite_code_requirements"
            ],
            "description": "The feature:\n- `market_briefs`: The partner-only market briefs API: what part of the market did and why, with sources.\n- `disable_invite_code_requirements`: Anyone can open an account in the partner's app without an invite code. An invite someone holds still shows and still gives its gift."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether your key has the feature now."
          }
        },
        "required": [
          "feature",
          "enabled"
        ],
        "description": "A feature and whether your key has it."
      },
      "PartnerFeatures": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerFeature"
            },
            "description": "Every feature, each once."
          }
        },
        "required": [
          "data"
        ],
        "description": "The features an operator turns on or off for each partner's key, and yours."
      },
      "Wallet": {
        "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 agent wallet's id."
          },
          "intentsAccountId": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "The wallet's NEAR Intents account, as 64 lowercase hex characters: the account 1Click knows it by. You need it only to read the wallet from 1Click yourself (see Get a 1Click session)."
          },
          "intentsAccount": {
            "description": "The same account with its kind. Here always `near`, with the same id as `intentsAccountId`: an Agent API wallet is read through Get wallet account.",
            "$ref": "#/components/schemas/IntentsAccount"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ],
            "description": "`active`, or `disabled` once an operator has turned the wallet off."
          },
          "provisionStatus": {
            "type": "string",
            "enum": [
              "pending",
              "ready",
              "authorization_required"
            ],
            "description": "Whether the wallet can reach its provider: `pending` before its first connection, `ready` once connected, `authorization_required` after the provider refused its session. The server reconnects it on its own a few minutes later, on the next balance read or wallet activity; nothing is needed from the user."
          },
          "ownership": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "statement": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 8192,
                    "description": "canonicalJson of the statement; the exact bytes the signature covers, minus the domain line."
                  },
                  "signature": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9+/]{86}==$",
                    "description": "The worker identity key's 64-byte Ed25519 signature in padded standard base64."
                  },
                  "workerPublicKey": {
                    "type": "string",
                    "pattern": "^ed25519:[1-9A-HJ-NP-Za-km-z]{32,44}$",
                    "description": "The worker identity key that signed, as ed25519:<base58>."
                  }
                },
                "required": [
                  "statement",
                  "signature",
                  "workerPublicKey"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "A signed ownership statement: version 1 proves owner-signed wallet creation; version 2 with basis owner_confirmation proves the owner explicitly confirmed an existing imported account, not attested key generation. Verify the version-specific signed message against your independently pinned worker key and compare the wallet and owner. Null while ownership still needs confirmation."
          },
          "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 wallet was created."
          }
        },
        "required": [
          "id",
          "intentsAccountId",
          "intentsAccount",
          "status",
          "provisionStatus",
          "ownership",
          "createdAt"
        ],
        "description": "The user's agent wallet: the wallet the agent deposits to, trades from and withdraws from."
      },
      "IntentsAccount": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(?:[0-9a-f]{64}|0x[0-9a-f]{40})$",
            "description": "The account 1Click and NEAR Intents know the wallet by: 64 lowercase hex characters for `near`, `0x` and 40 lowercase hex characters for `evm`."
          },
          "kind": {
            "type": "string",
            "enum": [
              "near",
              "evm"
            ],
            "description": "`near`: the wallet's own implicit NEAR account. `evm`: an Agent API wallet's EVM account, whose key the NEAR Intents Agent API holds for the user."
          }
        },
        "required": [
          "id",
          "kind"
        ],
        "description": "The wallet's NEAR Intents account and its kind: the account its balances are held by, which you need only to read the wallet from 1Click yourself."
      },
      "WalletSession": {
        "type": "object",
        "properties": {
          "intentsAccountId": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "The agent wallet's NEAR Intents account: the account these tokens sign in as, and the `account_id` inside them."
          },
          "intentsAccount": {
            "description": "The same account with its kind. Here always `near`: an Agent API wallet's session comes from Open a wallet account session.",
            "$ref": "#/components/schemas/IntentsAccount"
          },
          "accessToken": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8192,
            "description": "A 1Click access token for the agent wallet. Send it as `Authorization: Bearer` to 1Click's account endpoints, such as balances and history."
          },
          "accessTokenExpiresAt": {
            "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 access token expires. Then exchange `refreshToken` for a new one at 1Click's `POST /v0/auth/refresh`, as you do for your own users."
          },
          "refreshToken": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8192,
            "description": "Exchanges for new access tokens at 1Click until `refreshTokenExpiresAt`. 1Click answers a refresh with a new access token only, so keep this one."
          },
          "refreshTokenExpiresAt": {
            "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 refresh token expires. After that, or when 1Click refuses it, get a new session."
          }
        },
        "required": [
          "intentsAccountId",
          "intentsAccount",
          "accessToken",
          "accessTokenExpiresAt",
          "refreshToken",
          "refreshTokenExpiresAt"
        ],
        "description": "A 1Click session for the agent wallet, so your backend can read it from 1Click with its own code."
      },
      "WalletPortfolioSummary": {
        "type": "object",
        "properties": {
          "availableUsdCents": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 160,
                "pattern": "^(0|[1-9]\\d*)$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The available wallet balance, identical to `totalUsdCents` outside this summary; null if any held asset is unpriced."
          },
          "inOrdersUsdCents": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 160,
                "pattern": "^(0|[1-9]\\d*)$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The value of the funds resting in the user's open limit orders, at current prices. Null when an order's report is missing, more than 10 minutes old or unpriced."
          },
          "incomingUsdCents": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 160,
                "pattern": "^(0|[1-9]\\d*)$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The value of order payouts on their way to the wallet: a filled order's output or a cancelled order's refund, at the amount the order provider reports, before any settlement fee. Zero when nothing is on its way. Once a payout completes, it is part of the available balance instead."
          },
          "totalUsdCents": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 160,
                "pattern": "^(0|[1-9]\\d*)$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The account's value: available plus in orders plus incoming. Null while any part is unknown; `reasons` says which."
          },
          "pricedSubtotalUsdCents": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 160,
                "pattern": "^(0|[1-9]\\d*)$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The sum of priced available-wallet assets only, even when another wallet asset is unpriced. Excludes all order allocations and incoming funds; not a portfolio total. Null if the exact sum exceeds the supported cent-string range."
          },
          "asOf": {
            "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 available wallet balance was observed."
          },
          "complete": {
            "type": "boolean",
            "description": "Whether `totalUsdCents` is known. The total excludes positions held in separate Earn or perps accounts."
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "unpriced_wallet_assets",
                "order_allocation_unknown",
                "order_prices_unavailable",
                "order_settlement_unreconciled",
                "orders_unavailable",
                "order_observation_stale",
                "valuation_out_of_range"
              ]
            },
            "description": "Why the total is unknown; an empty list means it is known. `order_settlement_unreconciled`: an order's payout failed, or only some of its fills have been paid out, so what is still to come has no amount. `order_allocation_unknown`: an order's amounts aren't reported yet, or a funded order's deposit hasn't been seen yet. `order_observation_stale`: an order holding funds hasn't been read for over 10 minutes."
          },
          "hasAssets": {
            "description": "True when the wallet holds a positive balance or an order holds or is paying back funds, false only when both are known empty, and null when an order's funds cannot be established. Use false for an empty-state screen; a zero USD value alone does not mean empty.",
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "required": [
          "availableUsdCents",
          "inOrdersUsdCents",
          "incomingUsdCents",
          "totalUsdCents",
          "pricedSubtotalUsdCents",
          "asOf",
          "complete",
          "reasons",
          "hasAssets"
        ],
        "description": "The account's value: available wallet cash, funds in open orders and order payouts on their way, and their total."
      },
      "WalletBalances": {
        "type": "object",
        "properties": {
          "wallet": {
            "$ref": "#/components/schemas/Wallet"
          },
          "assets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "symbol": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "The asset's ticker symbol, as the provider reports it."
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "description": "The asset's display name, as the provider reports it."
                },
                "decimals": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 255
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "How many decimal places `amountRaw` carries; `null` if the provider does not name this asset."
                },
                "amountRaw": {
                  "type": "string",
                  "maxLength": 160,
                  "pattern": "^(0|[1-9]\\d*)$",
                  "description": "The held amount, as a decimal string in the asset's smallest unit, never a float; scale by `decimals` for a human amount."
                },
                "priceUsdDecimal": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 500,
                      "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The asset's price in USD, as a decimal string, never a float; `null` if the provider has no price for it."
                },
                "valueUsdCents": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 160,
                      "pattern": "^(0|[1-9]\\d*)$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "This holding's value, in US cents as a decimal integer string, never a float; `null` if `priceUsdDecimal` is `null`."
                },
                "iconUrl": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "An https icon for the asset, or `null` if the provider has none."
                },
                "assetId": {
                  "type": "string",
                  "pattern": "^asset_[a-f0-9]{64}$",
                  "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
                },
                "transferAsset": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^asset_[a-f0-9]{64}$",
                          "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
                        },
                        "network": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9-]{0,63}$",
                          "description": "The asset's native blockchain network."
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "native",
                            "token"
                          ],
                          "description": "Native currency or a token contract according to the provider catalog."
                        },
                        "contractAddress": {
                          "anyOf": [
                            {
                              "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."
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Native-chain token identifier; null for native currency."
                        },
                        "decimals": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 38,
                          "description": "Atomic-unit precision."
                        },
                        "symbol": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "description": "Display label; the asset id determines identity."
                        }
                      },
                      "required": [
                        "id",
                        "network",
                        "kind",
                        "contractAddress",
                        "decimals",
                        "symbol"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The asset as deposits and withdrawals name it; null when it is not a supported asset."
                }
              },
              "required": [
                "symbol",
                "name",
                "decimals",
                "amountRaw",
                "priceUsdDecimal",
                "valueUsdCents",
                "iconUrl",
                "assetId",
                "transferAsset"
              ]
            },
            "description": "Each asset the wallet holds, with its exact amount in the asset's smallest unit."
          },
          "totalUsdCents": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 160,
                "pattern": "^(0|[1-9]\\d*)$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The sum of every priced asset's value, in US cents as a decimal integer string, never a float; `null` if any asset's price is unknown."
          },
          "asOf": {
            "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 snapshot was read from the provider."
          },
          "portfolio": {
            "$ref": "#/components/schemas/WalletPortfolioSummary"
          },
          "depositLimit": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "maxWalletValueCents": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,17})$",
                    "description": "The most the agent wallet may be worth with a deposit added, in US cents: its value, the deposits still under way and the new one."
                  },
                  "availableCents": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,17})$",
                    "description": "How much more can be deposited right now, in US cents: the limit less the wallet's value and the deposits still under way, and 0 when the wallet is at or over its limit. A deposit worth more is refused with `deposit_limit_exceeded`, and so is a deposit address once this is 0."
                  }
                },
                "required": [
                  "maxWalletValueCents",
                  "availableCents"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The user's deposit limit, or null when none applies. Use `availableCents` to say how much the user can deposit before asking for an address; Create a deposit and Create a deposit address check it again."
          }
        },
        "required": [
          "wallet",
          "assets",
          "totalUsdCents",
          "asOf",
          "portfolio",
          "depositLimit"
        ],
        "description": "The agent wallet, what it holds right now, and how much more it can take."
      },
      "SupportedAssets": {
        "type": "object",
        "properties": {
          "networks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "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."
                },
                "rail": {
                  "type": "string",
                  "enum": [
                    "chain",
                    "intents"
                  ],
                  "description": "A native blockchain transfer or a signed transfer within an Intents ledger."
                },
                "depositWindowSeconds": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Time allowed to initiate and confirm a deposit; actual instructions contain exact deadlines."
                },
                "addressRouting": {
                  "type": "string",
                  "const": "encoded_address",
                  "description": "Recipient and refund routing must be encoded in the network address. Standalone recipient/refund memos are not accepted by this provider."
                }
              },
              "required": [
                "id",
                "rail",
                "depositWindowSeconds",
                "addressRouting"
              ]
            },
            "description": "The networks funds can arrive from and leave to: blockchains, plus the NEAR Intents and confidential NEAR Intents ledgers."
          },
          "assets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^asset_[a-f0-9]{64}$",
                  "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
                },
                "network": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9-]{0,63}$",
                  "description": "The asset's native blockchain network."
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "native",
                    "token"
                  ],
                  "description": "Native currency or a token contract according to the provider catalog."
                },
                "contractAddress": {
                  "anyOf": [
                    {
                      "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."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Native-chain token identifier; null for native currency."
                },
                "decimals": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 38,
                  "description": "Atomic-unit precision."
                },
                "symbol": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Display label; the asset id determines identity."
                }
              },
              "required": [
                "id",
                "network",
                "kind",
                "contractAddress",
                "decimals",
                "symbol"
              ]
            },
            "description": "The assets that can be deposited and withdrawn, with the `id` to use in deposit and withdrawal requests."
          }
        },
        "required": [
          "networks",
          "assets"
        ],
        "description": "The assets and networks the agent wallet can deposit and withdraw."
      },
      "Withdrawal": {
        "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 withdrawal's id."
          },
          "terms": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WithdrawalTerms"
              },
              {
                "type": "null"
              }
            ],
            "description": "The signed terms; `null` only for withdrawals made before terms were recorded."
          },
          "debit": {
            "type": "object",
            "properties": {
              "assetId": {
                "type": "string",
                "pattern": "^asset_[a-f0-9]{64}$",
                "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
              },
              "amountRaw": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "The amount taken from the agent wallet, in the asset's smallest unit."
              }
            },
            "required": [
              "assetId",
              "amountRaw"
            ],
            "description": "What leaves the agent wallet: the asset and the exact amount."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "completed",
              "refunded",
              "failed",
              "denied",
              "expired",
              "uncertain"
            ],
            "description": "`pending` until it starts, `processing` while it is sent, then `completed`, `refunded` (the funds came back to the agent wallet) or `failed` (nothing left the wallet; `failureReason` says why). `denied` and `expired` mean the request was refused or its signature ran out before it started. `uncertain` means the result could not be confirmed yet: never send a replacement, keep checking. `completed`, `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 wallet did not hold the amount when the withdrawal started. `quote_rejected`: the price at execution failed its checks or fell outside the signed limits. `quote_expired`: the quote ran out before the provider took the transfer. `unavailable`: a temporary problem stopped it before anything was sent. `not_authorized`: the signature no longer covered it when it started, or nothing could sign it then (the automation firing it ran for was not confirmed in time, or the owner's own wallet could not be resolved). `stopped`: an operator paused withdrawals or turned the wallet off. `not_executed`: the provider did not carry it out. `signing_disabled`: this deployment does not sign transfers. In every case nothing left the wallet; get a new quote to try again."
          },
          "result": {
            "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."
          },
          "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 withdrawal was requested."
          },
          "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 withdrawal 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; `null` before then."
          },
          "receipts": {
            "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 transfer's id."
                },
                "index": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Zero-based position in the withdrawal plan."
                },
                "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`."
                },
                "assetId": {
                  "type": "string",
                  "pattern": "^asset_[a-f0-9]{64}$",
                  "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
                },
                "amountRaw": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d{0,38})$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The amount actually received (or refunded), in this asset's smallest unit; `null` until a receipt confirms it."
                },
                "decimals": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 38,
                  "description": "The number of decimals of this asset's smallest unit."
                },
                "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": "Where the payout landed and its transaction ids; `null` before settlement or for older withdrawals."
                },
                "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."
                },
                "observedAt": {
                  "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 transfer's outcome was observed."
                }
              },
              "required": [
                "id",
                "index",
                "state",
                "assetId",
                "amountRaw",
                "decimals",
                "transferPayout",
                "refundReason",
                "observedAt"
              ]
            },
            "description": "The transfer the withdrawal made and what it received, as evidence."
          },
          "value": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ValueAtTime"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the debit (`debit.amountRaw`) was worth when the withdrawal ran, at the trusted price Fin checked its plan against. `null` before it has a plan, and when no price was recorded."
          }
        },
        "required": [
          "id",
          "terms",
          "debit",
          "status",
          "failureReason",
          "result",
          "createdAt",
          "startedAt",
          "reportedAt",
          "receipts",
          "value"
        ],
        "examples": [
          {
            "id": "6e15459a-6fb6-4320-85d8-a320d9e65737",
            "terms": {
              "assetId": "asset_1111111111111111111111111111111111111111111111111111111111111111",
              "amountRaw": "1000000",
              "destination": {
                "rail": "chain",
                "network": "eth",
                "assetId": "asset_2222222222222222222222222222222222222222222222222222222222222222",
                "address": "0x2222222222222222222222222222222222222222"
              },
              "minimumReceivedRaw": "975000",
              "maxFeeRaw": null,
              "maxValueLossBps": 250
            },
            "debit": {
              "assetId": "asset_1111111111111111111111111111111111111111111111111111111111111111",
              "amountRaw": "1000000"
            },
            "status": "pending",
            "failureReason": null,
            "result": null,
            "createdAt": "2026-09-22T18:00:00.000Z",
            "startedAt": null,
            "reportedAt": null,
            "receipts": [],
            "value": null
          }
        ],
        "description": "A withdrawal from the agent wallet: its terms, its `status`, and the evidence behind it."
      },
      "WithdrawalQuote": {
        "type": "object",
        "properties": {
          "terms": {
            "description": "The exact terms to show the user and send, unchanged, to Withdraw funds: the request plus the minimum the recipient receives and the most the fee can be.",
            "$ref": "#/components/schemas/WithdrawalTerms"
          },
          "quotedReceivedRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "What the recipient would receive at the current price, in the received asset's smallest unit; they receive at least `terms.minimumReceivedRaw`."
          },
          "quoteExpiresAt": {
            "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 price quote runs out. Withdraw funds prices the withdrawal again when it runs, within `terms`."
          },
          "requestKey": {
            "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": "This withdrawal's id for retries: send it as the `Idempotency-Key` of Withdraw funds, and filter List withdrawals on it after a timeout."
          },
          "authorization": {
            "description": "The message the user signs to allow exactly these terms. Call Withdraw funds before `authorization.expiresAt`.",
            "$ref": "#/components/schemas/MessageToSign"
          }
        },
        "required": [
          "terms",
          "quotedReceivedRaw",
          "quoteExpiresAt",
          "requestKey",
          "authorization"
        ],
        "description": "A priced withdrawal, the message the user signs for it, and the key to send it with."
      },
      "RunStatus": {
        "type": "string",
        "enum": [
          "running",
          "completed",
          "aborted",
          "failed",
          "paused"
        ],
        "description": "What the run is doing: `running`, or how it stopped — `completed` or `failed` once the model finished, `aborted` when stopped early, or `paused` while an approval is pending."
      },
      "Conversation": {
        "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 conversation's id."
          },
          "title": {
            "description": "The conversation's title, or null if none was set.",
            "type": [
              "string",
              "null"
            ]
          },
          "origin": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "conversation",
                    "description": "An ordinary user-started conversation."
                  }
                },
                "required": [
                  "type"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "automation",
                    "description": "A conversation an automation created."
                  },
                  "automationId": {
                    "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 automation that created this conversation."
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120,
                    "description": "The automation's name at the time this conversation started."
                  }
                },
                "required": [
                  "type",
                  "automationId",
                  "name"
                ]
              }
            ],
            "description": "Where this conversation came from: an ordinary conversation, or one an automation 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 conversation was created."
          },
          "updatedAt": {
            "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 conversation was last modified."
          },
          "deletedAt": {
            "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 user deleted the conversation; null while it exists. A deleted conversation stays readable but takes no new messages."
          },
          "summary": {
            "type": "object",
            "properties": {
              "runStatus": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "idle"
                  },
                  {
                    "$ref": "#/components/schemas/RunStatus"
                  }
                ],
                "description": "What the last run is doing: `idle` before any run, `running`, `paused` while an approval waits, then `completed`, `failed` or `aborted`."
              },
              "pendingApprovals": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "How many approvals in this conversation are waiting on the user."
              },
              "userMessages": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "How many messages the user has sent in this conversation."
              },
              "assistantMessages": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "How many messages the assistant has sent in this conversation."
              },
              "toolCalls": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "How many tool calls the conversation's runs have made."
              },
              "lastEventAt": {
                "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 last event was saved; null before the first."
              },
              "lastUserText": {
                "description": "The user's most recent message, for a list preview; null before the first.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "lastAssistantText": {
                "description": "The assistant's most recent message, for a list preview; null before the first.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "lastRunError": {
                "description": "The last run's failure message, when its most recent run failed.",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "runStatus",
              "pendingApprovals",
              "userMessages",
              "assistantMessages",
              "toolCalls",
              "lastEventAt",
              "lastUserText",
              "lastAssistantText",
              "lastRunError"
            ],
            "description": "The conversation's current status and a preview of its latest messages."
          }
        },
        "required": [
          "id",
          "title",
          "origin",
          "createdAt",
          "updatedAt",
          "deletedAt",
          "summary"
        ],
        "description": "One conversation: its title, origin, and a live summary of its last run."
      },
      "SolanaTradeRequest": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "side": {
                "type": "string",
                "const": "buy",
                "description": "Buy the token."
              },
              "buy": {
                "description": "The exact buy: the token, what it pays, its all-in loss bound and its SOL top-up cap.",
                "$ref": "#/components/schemas/SolanaBuyInput"
              }
            },
            "required": [
              "side",
              "buy"
            ]
          },
          {
            "type": "object",
            "properties": {
              "side": {
                "type": "string",
                "const": "sell",
                "description": "Sell the token."
              },
              "sell": {
                "description": "The exact sale: the token, how much of it, where the proceeds go and its all-in loss bound.",
                "$ref": "#/components/schemas/SolanaSellInput"
              }
            },
            "required": [
              "side",
              "sell"
            ]
          }
        ],
        "description": "A buy or a sale of one Solana token through the agent's own Solana account."
      },
      "PreparedSolanaTrade": {
        "type": "object",
        "properties": {
          "trade": {
            "description": "The exact trade to show the user and send, unchanged, to Place a Solana trade.",
            "$ref": "#/components/schemas/SolanaTradeRequest"
          },
          "requestKey": {
            "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": "This trade's id for retries: send it as the `Idempotency-Key` of Place a Solana trade."
          },
          "authorization": {
            "description": "The message the user signs to allow exactly this trade. Call Place a Solana trade before `authorization.expiresAt`. A trade that starts by then may take up to nine more minutes to finish; the message names that time.",
            "$ref": "#/components/schemas/MessageToSign"
          }
        },
        "required": [
          "trade",
          "requestKey",
          "authorization"
        ],
        "description": "A Solana trade's exact terms, the message the user signs for them, and the key to place it with."
      },
      "SolanaTrade": {
        "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, for Get a Solana trade."
          },
          "requestKey": {
            "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 `Idempotency-Key` it was placed under."
          },
          "trade": {
            "description": "The trade as the user signed it.",
            "$ref": "#/components/schemas/SolanaTradeRequest"
          },
          "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 Solana transaction it sent, or its transfer back to the agent wallet, has not finished. Then `completed` (the tokens bought, the proceeds of a sale or the SOL moved arrived), `partial` (part of it stands: a buy whose swap never happened after the account was funded, so the SOL is in the agent's Solana account, or a sale whose swap landed but whose transfer back did not finish, or that kept SOL, so the SOL is in the account or with 1Click until it refunds it; `solLeftLamports` says how much the account holds), `refunded` (1Click sent the funds back where they came from) or `failed` (nothing moved; `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 or the Solana account did not hold enough, the account's reserve included. `quote_rejected`: the price or the route failed its checks, the loss limit would have been crossed, or a buy was under the minimum. `unavailable`: a temporary problem stopped it before anything was sent. `not_authorized`: the approval no longer covered it, or the token is one the agent does not trade. `stopped`: an operator paused trading or turned the wallet off. `not_executed`: nothing it sent landed before it expired. `signing_disabled`: this deployment does not sign trades. In every case nothing moved."
          },
          "stage": {
            "description": "The step it is on, once it started: `funding` moves USDC from the agent wallet to the Solana account as SOL through 1Click, `swap` trades on Jupiter, `sweep` sends a sale's SOL back to the agent wallet. A higher `revision` is newer.",
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1024,
                "description": "Persisted lifecycle stage number. Ignore an older snapshot for the same operation."
              },
              "phase": {
                "type": "string",
                "enum": [
                  "funding",
                  "swap",
                  "sweep"
                ]
              },
              "state": {
                "type": "string",
                "enum": [
                  "preparing",
                  "prepared",
                  "submitting",
                  "pending",
                  "delivering",
                  "confirmed",
                  "uncertain",
                  "refunded",
                  "failed",
                  "not_executed"
                ]
              },
              "transactionIndex": {
                "description": "The stored native transaction attempt, never a funding plan leg index.",
                "type": "integer",
                "minimum": 0,
                "maximum": 5
              }
            },
            "required": [
              "revision",
              "phase",
              "state"
            ]
          },
          "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})$"
          },
          "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`."
          },
          "completeBy": {
            "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 latest it may still run, as the user signed it; its status is final by then."
          },
          "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 it was placed."
          },
          "updatedAt": {
            "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 its records last changed."
          }
        },
        "required": [
          "id",
          "requestKey",
          "trade",
          "status",
          "failureReason",
          "transactions",
          "completeBy",
          "createdAt",
          "updatedAt"
        ],
        "description": "A Solana buy or sale the user placed themselves: its status, the step it is on, and what it paid and received."
      },
      "SwapQuote": {
        "type": "object",
        "properties": {
          "terms": {
            "description": "The exact terms to show the user and send, unchanged, to Swap tokens: the request plus the least the agent wallet receives.",
            "$ref": "#/components/schemas/SwapTerms"
          },
          "quotedReceivedRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "What the swap would receive at the current price, in the bought asset's smallest unit; it receives at least `terms.minimumReceivedRaw`."
          },
          "quoteExpiresAt": {
            "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 price quote runs out. Swap tokens prices the swap again when it runs, within `terms`."
          },
          "requestKey": {
            "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": "This swap's id for retries: send it as the `Idempotency-Key` of Swap tokens, and filter List swaps on it after a timeout."
          },
          "authorization": {
            "description": "The message the user signs to allow exactly these terms. Call Swap tokens before `authorization.expiresAt`.",
            "$ref": "#/components/schemas/MessageToSign"
          }
        },
        "required": [
          "terms",
          "quotedReceivedRaw",
          "quoteExpiresAt",
          "requestKey",
          "authorization"
        ],
        "description": "A priced swap, the message the user signs for it, and the key to send it with."
      },
      "Swap": {
        "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 swap's id."
          },
          "terms": {
            "description": "The terms the user signed.",
            "$ref": "#/components/schemas/SwapTerms"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "completed",
              "refunded",
              "failed",
              "denied",
              "expired",
              "uncertain"
            ],
            "description": "`pending` until it starts, `processing` while it runs, then `completed` (the bought asset is in the agent wallet), `refunded` (the provider sent the sold asset back to the agent wallet) or `failed` (nothing was swapped; `failureReason` says why). `denied` and `expired` mean the request was refused or its signature ran out before it started. `uncertain` means the result could not be confirmed yet: never send a replacement, keep checking. `completed`, `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 wallet did not hold the amount when the swap started. `quote_rejected`: the price at execution failed its checks, or would have received less than `terms.minimumReceivedRaw` or lost more than the loss limit. `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 signature no longer covered it when it started. `stopped`: an operator paused trading 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; get a new quote to try again."
          },
          "result": {
            "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."
          },
          "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 swap was requested."
          },
          "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 swap 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; `null` before then."
          },
          "receipts": {
            "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 provider swap's id."
                },
                "index": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Zero-based position in the swap's plan."
                },
                "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`."
                },
                "assetId": {
                  "type": "string",
                  "pattern": "^asset_[a-f0-9]{64}$",
                  "description": "The asset it delivered: the bought asset, or the sold one when it was refunded."
                },
                "amountRaw": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d{0,38})$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The amount actually received (or refunded), in this asset's smallest unit; `null` until a receipt confirms it."
                },
                "decimals": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 38,
                  "description": "The number of decimals of this asset's smallest unit."
                },
                "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."
                },
                "observedAt": {
                  "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 swap's outcome was observed."
                }
              },
              "required": [
                "id",
                "index",
                "state",
                "assetId",
                "amountRaw",
                "decimals",
                "intentHashes",
                "refundReason",
                "observedAt"
              ]
            },
            "description": "The swap the provider made and what it delivered, as evidence."
          },
          "value": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ValueAtTime"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the swap sold (`terms.amountRaw`) was worth when it ran, at the trusted price Fin checked its plan against. `null` before it has a plan, and when no price was recorded."
          }
        },
        "required": [
          "id",
          "terms",
          "status",
          "failureReason",
          "result",
          "createdAt",
          "startedAt",
          "reportedAt",
          "receipts",
          "value"
        ],
        "examples": [
          {
            "id": "0d7a9d4e-1f53-4f3b-9d25-1c4e5f8b7a61",
            "terms": {
              "sellAssetId": "asset_1111111111111111111111111111111111111111111111111111111111111111",
              "amountRaw": "1000000",
              "buyAssetId": "asset_3333333333333333333333333333333333333333333333333333333333333333",
              "minimumReceivedRaw": "331250000000000000000000",
              "maxValueLossBps": 250
            },
            "status": "pending",
            "failureReason": null,
            "result": null,
            "createdAt": "2026-09-22T18:00:00.000Z",
            "startedAt": null,
            "reportedAt": null,
            "receipts": [],
            "value": null
          }
        ],
        "description": "A swap in the agent wallet: its terms, its `status`, and the evidence behind it."
      },
      "ActivityItem": {
        "oneOf": [
          {
            "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 item's id: the trade, swap, withdrawal, deposit, deposit address, Solana operation or Solana trade id, or the automation change's own id."
              },
              "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 it happened: the request, or the change. The feed is ordered by it."
              },
              "updatedAt": {
                "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 it last changed, such as a settlement or a credit."
              },
              "kind": {
                "type": "string",
                "const": "trade",
                "description": "A trade; read `trade`."
              },
              "trade": {
                "type": "object",
                "properties": {
                  "conversationId": {
                    "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 in which the agent asked for this trade."
                  },
                  "origin": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "conversation",
                            "description": "An ordinary user-started conversation."
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "automation",
                            "description": "A conversation an automation created."
                          },
                          "automationId": {
                            "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 automation that created this conversation."
                          },
                          "name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120,
                            "description": "The automation's name at the time this conversation started."
                          }
                        },
                        "required": [
                          "type",
                          "automationId",
                          "name"
                        ]
                      }
                    ],
                    "description": "Where the trade was asked for: an ordinary chat, or a conversation an automation started."
                  },
                  "title": {
                    "description": "The conversation's current title; null for an untitled conversation.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "assetIds": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "additionalProperties": {
                      "type": "string",
                      "pattern": "^asset_[a-f0-9]{64}$",
                      "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
                    },
                    "description": "Maps the explicit Intents protocol assets in this trade to opaque Fin holdings identities, for joining portfolio metadata and prices."
                  },
                  "approval": {
                    "description": "The request's exact human review, when one was required; absent when it runs under an automation's standing permission.",
                    "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 exact single-use review bound to this financial request."
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "pending",
                          "approved",
                          "denied",
                          "expired"
                        ],
                        "description": "The recorded human decision, with overdue pending reviews shown as expired; approval alone does not prove 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"
                        ]
                      },
                      "expiresAt": {
                        "description": "When the exact review ceases to authorize an execution claim.",
                        "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))$"
                      },
                      "executionRestriction": {
                        "description": "The immutable restriction that prevents automatic signing under this approval.",
                        "type": "string",
                        "const": "signing_disabled"
                      }
                    },
                    "required": [
                      "approvalId",
                      "status"
                    ]
                  },
                  "automationRunId": {
                    "description": "The automation run that asked for this trade, when one did.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "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, the same as Get a trade returns. A leg's `actionIndex` names its action, so a payout can be shown as one. `null` only for old trades recorded without it."
                  },
                  "legs": {
                    "maxItems": 16,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "index": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 15,
                          "description": "This leg's position in the frozen plan, counting from zero."
                        },
                        "actionIndex": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 15,
                          "description": "Which of the trade's `request.actions` this leg carries out, counting from zero: a swap, or a payout to the user's main wallet or to an address they approved."
                        },
                        "inputPriceUsd": {
                          "description": "The USD price of one whole input token that the plan was checked against, as plain decimal text; absent on plans that recorded none.",
                          "type": "string",
                          "maxLength": 80,
                          "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                        },
                        "outputPriceUsd": {
                          "description": "The USD price of one whole output token that the plan was checked against, as plain decimal text; absent on plans that recorded none.",
                          "type": "string",
                          "maxLength": 80,
                          "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                        },
                        "input": {
                          "description": "The frozen input asset and requested amount when that side was fixed; not measured spend.",
                          "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"
                          ]
                        },
                        "output": {
                          "description": "The frozen output asset and requested amount when that side was fixed; not measured proceeds.",
                          "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"
                          ]
                        },
                        "minimumOutputRaw": {
                          "description": "The minimum output required by an exact-input leg, in the output asset's smallest unit.",
                          "type": "string",
                          "pattern": "^(0|[1-9]\\d{0,38})$"
                        },
                        "maximumInputRaw": {
                          "description": "The maximum input permitted by an exact-output leg, in the input asset's smallest unit.",
                          "type": "string",
                          "pattern": "^(0|[1-9]\\d{0,38})$"
                        },
                        "stage": {
                          "description": "The stage derived from the persisted claim while it has no terminal receipt; absent for untouched planned legs.",
                          "type": "string",
                          "enum": [
                            "checking",
                            "retrying",
                            "quoting",
                            "signed",
                            "confirming",
                            "unresolved"
                          ]
                        },
                        "legId": {
                          "description": "The actual claim's durable ID; absent when this planned leg was never attempted.",
                          "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)$"
                        },
                        "receipt": {
                          "description": "The retained terminal evidence for the actual leg; untouched planned legs have no receipt.",
                          "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."
                                },
                                "operationId": {
                                  "description": "The durable financial request this evidence belongs to.",
                                  "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)$"
                                },
                                "occurrenceId": {
                                  "description": "The archived event's original identity, retained verbatim; current receipts use `operationId`.",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 160
                                },
                                "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."
                                },
                                "operationId": {
                                  "description": "The durable financial request this evidence belongs to.",
                                  "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)$"
                                },
                                "occurrenceId": {
                                  "description": "The archived event's original identity, retained verbatim; current receipts use `operationId`.",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 160
                                },
                                "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."
                                },
                                "operationId": {
                                  "description": "The durable financial request this evidence belongs to.",
                                  "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)$"
                                },
                                "occurrenceId": {
                                  "description": "The archived event's original identity, retained verbatim; current receipts use `operationId`.",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 160
                                },
                                "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"
                              ]
                            }
                          ]
                        }
                      },
                      "required": [
                        "index",
                        "actionIndex"
                      ]
                    },
                    "description": "Every leg of the frozen plan in plan order, including untouched legs without claims or receipts; empty before a plan exists."
                  },
                  "result": {
                    "description": "The persisted outcome, updated by conclusive receipts; absent while no outcome exists, including denied or expired preparation.",
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "completed",
                          "failed",
                          "denied",
                          "unverified",
                          "pending",
                          "partial",
                          "no_trade",
                          "settled",
                          "refunded",
                          "not_executed"
                        ],
                        "description": "The canonical financial outcome projected for display; refused requests appear as denied, pending is unresolved and partial means only part executed."
                      },
                      "reason": {
                        "description": "Present when automatic signing was disabled for the reported non-execution.",
                        "type": "string",
                        "const": "signing_disabled"
                      },
                      "stopped": {
                        "description": "Present only on a partial result whose run refused a later leg before it was claimed: the planned action it 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"
                        ]
                      },
                      "message": {
                        "description": "The host's fixed explanation for a refused request, when present; never raw provider text.",
                        "type": "string",
                        "maxLength": 280
                      },
                      "legs": {
                        "maxItems": 16,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "index": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 15,
                              "description": "The reported leg's position in the frozen plan, counting from zero."
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "claimed",
                                "signed",
                                "uncertain",
                                "settled",
                                "refunded",
                                "not_executed"
                              ],
                              "description": "The retained execution or settlement state for this reported leg."
                            }
                          },
                          "required": [
                            "index",
                            "state"
                          ]
                        },
                        "description": "The actual legs represented by this outcome; untouched planned legs are not fabricated as results."
                      }
                    },
                    "required": [
                      "status",
                      "legs"
                    ]
                  },
                  "running": {
                    "type": "boolean",
                    "description": "True when the trade has an execution claim and no current outcome; it does not prove a process is still running."
                  },
                  "ended": {
                    "type": "boolean",
                    "description": "True when no outcome is available and the trade is uncertain, denied or expired. Later receipts may resolve uncertainty; this does not assert that settlement is final."
                  }
                },
                "required": [
                  "conversationId",
                  "origin",
                  "title",
                  "assetIds",
                  "request",
                  "legs",
                  "running",
                  "ended"
                ],
                "description": "The trade the agent asked for, in a chat or in an automation's run."
              }
            },
            "required": [
              "id",
              "createdAt",
              "updatedAt",
              "kind",
              "trade"
            ]
          },
          {
            "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 item's id: the trade, swap, withdrawal, deposit, deposit address, Solana operation or Solana trade id, or the automation change's own id."
              },
              "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 it happened: the request, or the change. The feed is ordered by it."
              },
              "updatedAt": {
                "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 it last changed, such as a settlement or a credit."
              },
              "kind": {
                "type": "string",
                "const": "swap",
                "description": "A swap the user made in the agent wallet with Swap tokens; read `swap`."
              },
              "swap": {
                "$ref": "#/components/schemas/Swap"
              }
            },
            "required": [
              "id",
              "createdAt",
              "updatedAt",
              "kind",
              "swap"
            ]
          },
          {
            "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 item's id: the trade, swap, withdrawal, deposit, deposit address, Solana operation or Solana trade id, or the automation change's own id."
              },
              "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 it happened: the request, or the change. The feed is ordered by it."
              },
              "updatedAt": {
                "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 it last changed, such as a settlement or a credit."
              },
              "kind": {
                "type": "string",
                "const": "withdrawal",
                "description": "A withdrawal; read `withdrawal`."
              },
              "withdrawal": {
                "$ref": "#/components/schemas/Withdrawal"
              }
            },
            "required": [
              "id",
              "createdAt",
              "updatedAt",
              "kind",
              "withdrawal"
            ]
          },
          {
            "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 item's id: the trade, swap, withdrawal, deposit, deposit address, Solana operation or Solana trade id, or the automation change's own id."
              },
              "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 it happened: the request, or the change. The feed is ordered by it."
              },
              "updatedAt": {
                "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 it last changed, such as a settlement or a credit."
              },
              "kind": {
                "type": "string",
                "const": "deposit",
                "description": "A deposit; read `deposit`."
              },
              "deposit": {
                "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 deposit's id."
                  },
                  "requestKey": {
                    "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 `Idempotency-Key` the deposit was created with; filter List deposits on it."
                  },
                  "terms": {
                    "description": "The terms the deposit was created with.",
                    "$ref": "#/components/schemas/DepositTerms"
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "preparing",
                      "awaiting_deposit",
                      "processing",
                      "credited",
                      "refunded",
                      "unknown",
                      "expired",
                      "failed"
                    ],
                    "description": "Where the deposit is: `preparing` (getting the address), `awaiting_deposit` (waiting for the user's transfer), `processing`, then `credited` or `refunded`. `failed` means no address was issued. `expired` means the deadline passed with no transfer seen; a late transfer still moves it on. `unknown` means Fin saw something it could not confirm; it never proves that no money moved, so keep checking."
                  },
                  "instruction": {
                    "anyOf": [
                      {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "rail": {
                                "type": "string",
                                "const": "chain",
                                "description": "Payment originates on the specified native blockchain."
                              },
                              "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."
                              },
                              "asset": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "pattern": "^asset_[a-f0-9]{64}$",
                                    "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
                                  },
                                  "network": {
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                    "description": "The asset's native blockchain network."
                                  },
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "native",
                                      "token"
                                    ],
                                    "description": "Native currency or a token contract according to the provider catalog."
                                  },
                                  "contractAddress": {
                                    "anyOf": [
                                      {
                                        "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."
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ],
                                    "description": "Native-chain token identifier; null for native currency."
                                  },
                                  "decimals": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 38,
                                    "description": "Atomic-unit precision."
                                  },
                                  "symbol": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64,
                                    "description": "Display label; the asset id determines identity."
                                  }
                                },
                                "required": [
                                  "id",
                                  "network",
                                  "kind",
                                  "contractAddress",
                                  "decimals",
                                  "symbol"
                                ],
                                "description": "Exact asset and atomic-unit precision to transfer."
                              },
                              "address": {
                                "type": "string",
                                "pattern": "^[\\x21-\\x7e]{1,256}$",
                                "description": "Verified destination for this deposit request only."
                              },
                              "memo": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 256,
                                    "pattern": "^[\\x20-\\x7e]+$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "Required deposit memo or tag, exactly as returned; null means absent."
                              },
                              "amountRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9]\\d{0,38})$",
                                "description": "Exact funding amount in asset atomic units."
                              },
                              "minimumCreditRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9]\\d{0,38})$",
                                "description": "Minimum authorized wallet credit."
                              },
                              "expectedCreditRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9]\\d{0,38})$",
                                "description": "Quoted credit; the receipt records actual credit separately."
                              },
                              "sendBefore": {
                                "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": "Do not initiate another transfer after this deadline."
                              },
                              "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": "Provider deposit deadline. Late payment remains observable; expiry never proves a refund."
                              },
                              "refundAddress": {
                                "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."
                              },
                              "reusable": {
                                "type": "boolean",
                                "const": false,
                                "description": "Bound to one funding request; never reuse for a later transfer."
                              },
                              "kind": {
                                "type": "string",
                                "const": "chain_transfer",
                                "description": "The external wallet broadcasts a native-chain transfer using these instructions."
                              }
                            },
                            "required": [
                              "rail",
                              "network",
                              "asset",
                              "address",
                              "memo",
                              "amountRaw",
                              "minimumCreditRaw",
                              "expectedCreditRaw",
                              "sendBefore",
                              "expiresAt",
                              "refundAddress",
                              "reusable",
                              "kind"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "rail": {
                                "type": "string",
                                "const": "intents",
                                "description": "Payment originates on the specified public or confidential 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."
                              },
                              "asset": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "pattern": "^asset_[a-f0-9]{64}$",
                                    "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
                                  },
                                  "network": {
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                    "description": "The asset's native blockchain network."
                                  },
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "native",
                                      "token"
                                    ],
                                    "description": "Native currency or a token contract according to the provider catalog."
                                  },
                                  "contractAddress": {
                                    "anyOf": [
                                      {
                                        "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."
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ],
                                    "description": "Native-chain token identifier; null for native currency."
                                  },
                                  "decimals": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 38,
                                    "description": "Atomic-unit precision."
                                  },
                                  "symbol": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64,
                                    "description": "Display label; the asset id determines identity."
                                  }
                                },
                                "required": [
                                  "id",
                                  "network",
                                  "kind",
                                  "contractAddress",
                                  "decimals",
                                  "symbol"
                                ],
                                "description": "Exact asset and atomic-unit precision to transfer."
                              },
                              "address": {
                                "type": "string",
                                "pattern": "^[\\x21-\\x7e]{1,256}$",
                                "description": "Verified destination for this deposit request only."
                              },
                              "memo": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 256,
                                    "pattern": "^[\\x20-\\x7e]+$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "Required deposit memo or tag, exactly as returned; null means absent."
                              },
                              "amountRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9]\\d{0,38})$",
                                "description": "Exact funding amount in asset atomic units."
                              },
                              "minimumCreditRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9]\\d{0,38})$",
                                "description": "Minimum authorized wallet credit."
                              },
                              "expectedCreditRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9]\\d{0,38})$",
                                "description": "Quoted credit; the receipt records actual credit separately."
                              },
                              "sendBefore": {
                                "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": "Do not initiate another transfer after this deadline."
                              },
                              "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": "Provider deposit deadline. Late payment remains observable; expiry never proves a refund."
                              },
                              "refundAddress": {
                                "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."
                              },
                              "reusable": {
                                "type": "boolean",
                                "const": false,
                                "description": "Bound to one funding request; never reuse for a later transfer."
                              },
                              "kind": {
                                "type": "string",
                                "const": "intents_transfer",
                                "description": "The external wallet signs and submits a transfer intent on the specified ledger."
                              },
                              "protocol": {
                                "type": "object",
                                "properties": {
                                  "verifier": {
                                    "type": "string",
                                    "enum": [
                                      "intents.near",
                                      "intents.far"
                                    ],
                                    "description": "Ledger verifier for the external wallet's signed transfer intent."
                                  },
                                  "assetId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 256,
                                    "description": "Ledger protocol asset identifier, exposed only for explicit advanced Intents funding."
                                  },
                                  "depositAddress": {
                                    "type": "string",
                                    "pattern": "^[\\x21-\\x7e]{1,256}$",
                                    "description": "Quote deposit account, used by the external wallet to generate the exact signed transfer intent; identical to the instruction address."
                                  },
                                  "amountRaw": {
                                    "type": "string",
                                    "pattern": "^(0|[1-9]\\d{0,38})$",
                                    "description": "Exact signed transfer amount."
                                  }
                                },
                                "required": [
                                  "verifier",
                                  "assetId",
                                  "depositAddress",
                                  "amountRaw"
                                ],
                                "description": "The external wallet constructs and signs a transfer intent with its own authority. Fin does not sign for or hold credentials to that source wallet."
                              }
                            },
                            "required": [
                              "rail",
                              "network",
                              "asset",
                              "address",
                              "memo",
                              "amountRaw",
                              "minimumCreditRaw",
                              "expectedCreditRaw",
                              "sendBefore",
                              "expiresAt",
                              "refundAddress",
                              "reusable",
                              "kind",
                              "protocol"
                            ]
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Where and what to send; `null` until the address is issued."
                  },
                  "receipt": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "observedAt": {
                            "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 trusted provider evidence was observed."
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "credited",
                              "refunded"
                            ],
                            "description": "Provider-established terminal financial outcome."
                          },
                          "depositedRaw": {
                            "type": "string",
                            "pattern": "^(0|[1-9]\\d{0,38})$",
                            "description": "Observed source amount."
                          },
                          "creditedRaw": {
                            "type": "string",
                            "pattern": "^(0|[1-9]\\d{0,38})$",
                            "description": "Actual wallet credit; zero on full refund."
                          },
                          "refundedRaw": {
                            "type": "string",
                            "pattern": "^(0|[1-9]\\d{0,38})$",
                            "description": "Amount refunded to the approved source destination."
                          },
                          "sourceTransactionHashes": {
                            "minItems": 1,
                            "maxItems": 32,
                            "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": "Observed source transactions or ledger intent identifiers bound to the instruction."
                          },
                          "refundTransactionHashes": {
                            "maxItems": 32,
                            "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": "Observed refund transactions or ledger intent identifiers."
                          }
                        },
                        "required": [
                          "observedAt",
                          "state",
                          "depositedRaw",
                          "creditedRaw",
                          "refundedRaw",
                          "sourceTransactionHashes",
                          "refundTransactionHashes"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "What was credited or refunded; `null` until that is observed."
                  },
                  "seenAt": {
                    "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 Fin first saw the user's transfer: the first check that found it on its way, or already credited or refunded. `null` until then, and for a transfer Fin saw before it kept this."
                  },
                  "arrivedRaw": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^(0|[1-9]\\d{0,38})$"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "What 1Click reported arriving while it confirmed the transfer, in the asset's smallest unit; `null` until it reports a figure. For display while it confirms: `receipt` records what was finally credited."
                  },
                  "value": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/ValueAtTime"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "What was credited (`receipt.creditedRaw`) was worth when it was credited, at the price Fin recorded with the credit. `null` until it is credited, and when no fresh price was known then."
                  },
                  "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 deposit was created."
                  },
                  "updatedAt": {
                    "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 deposit last changed."
                  }
                },
                "required": [
                  "id",
                  "requestKey",
                  "terms",
                  "state",
                  "instruction",
                  "receipt",
                  "seenAt",
                  "arrivedRaw",
                  "value",
                  "createdAt",
                  "updatedAt"
                ],
                "description": "The deposit, as Get a deposit returns it."
              }
            },
            "required": [
              "id",
              "createdAt",
              "updatedAt",
              "kind",
              "deposit"
            ]
          },
          {
            "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 item's id: the trade, swap, withdrawal, deposit, deposit address, Solana operation or Solana trade id, or the automation change's own id."
              },
              "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 it happened: the request, or the change. The feed is ordered by it."
              },
              "updatedAt": {
                "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 it last changed, such as a settlement or a credit."
              },
              "kind": {
                "type": "string",
                "const": "deposit_address",
                "description": "A transfer to a one-time deposit address; read `depositAddress`."
              },
              "depositAddress": {
                "description": "The deposit address, as Get a deposit address returns it: what arrived is in its `receipt`.",
                "$ref": "#/components/schemas/DepositAddress"
              }
            },
            "required": [
              "id",
              "createdAt",
              "updatedAt",
              "kind",
              "depositAddress"
            ]
          },
          {
            "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 item's id: the trade, swap, withdrawal, deposit, deposit address, Solana operation or Solana trade id, or the automation change's own id."
              },
              "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 it happened: the request, or the change. The feed is ordered by it."
              },
              "updatedAt": {
                "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 it last changed, such as a settlement or a credit."
              },
              "kind": {
                "type": "string",
                "const": "automation",
                "description": "A change to an automation; read `automation`."
              },
              "automation": {
                "type": "object",
                "properties": {
                  "automationId": {
                    "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 automation that changed."
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120,
                    "description": "The automation's name."
                  },
                  "change": {
                    "type": "string",
                    "enum": [
                      "created",
                      "paused",
                      "resumed",
                      "deleted"
                    ],
                    "description": "What happened to it: `created`, `paused`, `resumed` or `deleted` (which includes an automation that finished on its own). Edits are retained privately and shown in chat receipts and automation detail, not in this feed."
                  }
                },
                "required": [
                  "automationId",
                  "name",
                  "change"
                ],
                "description": "The automation and what changed."
              }
            },
            "required": [
              "id",
              "createdAt",
              "updatedAt",
              "kind",
              "automation"
            ]
          },
          {
            "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 item's id: the trade, swap, withdrawal, deposit, deposit address, Solana operation or Solana trade id, or the automation change's own id."
              },
              "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 it happened: the request, or the change. The feed is ordered by it."
              },
              "updatedAt": {
                "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 it last changed, such as a settlement or a credit."
              },
              "kind": {
                "type": "string",
                "const": "solana",
                "description": "A buy or a sell of a Solana token through the agent's own Solana account, or SOL moved into or out of it; read `solana`."
              },
              "solana": {
                "type": "object",
                "properties": {
                  "conversationId": {
                    "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 in which the agent asked for it."
                  },
                  "origin": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "conversation",
                            "description": "An ordinary user-started conversation."
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "automation",
                            "description": "A conversation an automation created."
                          },
                          "automationId": {
                            "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 automation that created this conversation."
                          },
                          "name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120,
                            "description": "The automation's name at the time this conversation started."
                          }
                        },
                        "required": [
                          "type",
                          "automationId",
                          "name"
                        ]
                      }
                    ],
                    "description": "Where it was asked for: an ordinary chat, or a conversation an automation started."
                  },
                  "title": {
                    "description": "The conversation's current title; null for an untitled conversation.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "automationRunId": {
                    "description": "The automation run that asked for it, when one did.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "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"
                  },
                  "request": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/SolanaBuyInput"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaSellInput"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaFundInput"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaWithdrawInput"
                      }
                    ],
                    "description": "What the agent asked for, as the user approved it: a buy's, a sell's, a fund's or a withdrawal's terms, as `side` says."
                  },
                  "approval": {
                    "description": "The request's own approval, when it needed one; absent when it ran under an automation's standing permission.",
                    "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 single-use approval of this exact request."
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "pending",
                          "approved",
                          "denied",
                          "expired"
                        ],
                        "description": "The user's recorded decision, with an overdue pending approval shown as expired; an approval alone does not mean it ran."
                      },
                      "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": "When the approval stops covering a start."
                      }
                    },
                    "required": [
                      "approvalId",
                      "status",
                      "expiresAt"
                    ]
                  },
                  "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 Solana transaction it sent, or its transfer back to the agent wallet, has not finished. Then `completed` (the tokens bought, the proceeds of a sale or the SOL moved arrived), `partial` (part of it stands: a buy whose swap never happened after the account was funded, so the SOL is in the agent's Solana account, or a sale whose swap landed but whose transfer back did not finish, or that kept SOL, so the SOL is in the account or with 1Click until it refunds it; `solLeftLamports` says how much the account holds), `refunded` (1Click sent the funds back where they came from) or `failed` (nothing moved; `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 or the Solana account did not hold enough, the account's reserve included. `quote_rejected`: the price or the route failed its checks, the loss limit would have been crossed, or a buy was under the minimum. `unavailable`: a temporary problem stopped it before anything was sent. `not_authorized`: the approval no longer covered it, or the token is one the agent does not trade. `stopped`: an operator paused trading or turned the wallet off. `not_executed`: nothing it sent landed before it expired. `signing_disabled`: this deployment does not sign trades. In every case nothing moved."
                  },
                  "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})$"
                  },
                  "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`."
                  }
                },
                "required": [
                  "conversationId",
                  "origin",
                  "title",
                  "side",
                  "request",
                  "status",
                  "failureReason",
                  "transactions"
                ],
                "description": "The Solana trade or transfer the agent asked for, in a chat or in an automation's run."
              }
            },
            "required": [
              "id",
              "createdAt",
              "updatedAt",
              "kind",
              "solana"
            ]
          },
          {
            "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 item's id: the trade, swap, withdrawal, deposit, deposit address, Solana operation or Solana trade id, or the automation change's own id."
              },
              "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 it happened: the request, or the change. The feed is ordered by it."
              },
              "updatedAt": {
                "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 it last changed, such as a settlement or a credit."
              },
              "kind": {
                "type": "string",
                "const": "solana_sell_many",
                "description": "A sale of several Solana tokens under one approval, through the agent's own Solana account; read `solanaSellMany`."
              },
              "solanaSellMany": {
                "type": "object",
                "properties": {
                  "conversationId": {
                    "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 in which the agent asked for it."
                  },
                  "origin": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "conversation",
                            "description": "An ordinary user-started conversation."
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "automation",
                            "description": "A conversation an automation created."
                          },
                          "automationId": {
                            "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 automation that created this conversation."
                          },
                          "name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120,
                            "description": "The automation's name at the time this conversation started."
                          }
                        },
                        "required": [
                          "type",
                          "automationId",
                          "name"
                        ]
                      }
                    ],
                    "description": "Where it was asked for: an ordinary chat, or a conversation an automation started."
                  },
                  "title": {
                    "description": "The conversation's current title; null for an untitled conversation.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "automationRunId": {
                    "description": "The automation run that asked for it, when one did.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "approval": {
                    "description": "The request's own approval, when it needed one; absent when it ran under an automation's standing permission.",
                    "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 single-use approval of this exact request."
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "pending",
                          "approved",
                          "denied",
                          "expired"
                        ],
                        "description": "The user's recorded decision, with an overdue pending approval shown as expired; an approval alone does not mean it ran."
                      },
                      "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": "When the approval stops covering a start."
                      }
                    },
                    "required": [
                      "approvalId",
                      "status",
                      "expiresAt"
                    ]
                  },
                  "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 Solana transaction it sent, or its transfer back to the agent wallet, has not finished. Then `completed` (the tokens bought, the proceeds of a sale or the SOL moved arrived), `partial` (part of it stands: a buy whose swap never happened after the account was funded, so the SOL is in the agent's Solana account, or a sale whose swap landed but whose transfer back did not finish, or that kept SOL, so the SOL is in the account or with 1Click until it refunds it; `solLeftLamports` says how much the account holds), `refunded` (1Click sent the funds back where they came from) or `failed` (nothing moved; `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 or the Solana account did not hold enough, the account's reserve included. `quote_rejected`: the price or the route failed its checks, the loss limit would have been crossed, or a buy was under the minimum. `unavailable`: a temporary problem stopped it before anything was sent. `not_authorized`: the approval no longer covered it, or the token is one the agent does not trade. `stopped`: an operator paused trading or turned the wallet off. `not_executed`: nothing it sent landed before it expired. `signing_disabled`: this deployment does not sign trades. In every case nothing moved."
                  },
                  "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})$"
                  },
                  "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`."
                  },
                  "request": {
                    "description": "The sale as the user approved it: each coin with its exact amount and its own loss bound, in the order they sold, and what they return.",
                    "$ref": "#/components/schemas/SolanaSellManyInput"
                  },
                  "sales": {
                    "description": "Each coin in the order it ran and what became of it, once the sale's outcome is recorded; `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": [
                  "conversationId",
                  "origin",
                  "title",
                  "status",
                  "failureReason",
                  "transactions",
                  "request"
                ],
                "description": "The sale the agent asked for, in a chat or in an automation's run: each coin as approved, how the sale stands, and what became of each coin."
              }
            },
            "required": [
              "id",
              "createdAt",
              "updatedAt",
              "kind",
              "solanaSellMany"
            ]
          },
          {
            "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 item's id: the trade, swap, withdrawal, deposit, deposit address, Solana operation or Solana trade id, or the automation change's own id."
              },
              "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 it happened: the request, or the change. The feed is ordered by it."
              },
              "updatedAt": {
                "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 it last changed, such as a settlement or a credit."
              },
              "kind": {
                "type": "string",
                "const": "solana_trade",
                "description": "A buy or a sale of a Solana token the user placed themselves on its page, with Place a Solana trade; read `solanaTrade`."
              },
              "solanaTrade": {
                "description": "The trade, as Get a Solana trade returns it.",
                "$ref": "#/components/schemas/SolanaTrade"
              }
            },
            "required": [
              "id",
              "createdAt",
              "updatedAt",
              "kind",
              "solanaTrade"
            ]
          }
        ],
        "description": "One thing that happened in the user's wallet or automations. `kind` names the object it carries, which is the same object that resource's own route returns."
      },
      "Budget": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "description": "`true` while today and this month both have budget left and the budget is not frozen; while `false`, new runs are refused with `budget_exhausted`."
          },
          "frozen": {
            "type": "boolean",
            "description": "`true` when an operator froze this user's budget: nothing is left to spend."
          },
          "snapshots": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "periodKind": {
                  "type": "string",
                  "enum": [
                    "day",
                    "month"
                  ],
                  "description": "Which period this snapshot covers: `day` (the UTC calendar day) or `month` (the calendar month)."
                },
                "capCents": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "The limit for this period, in US cents, as a JSON integer."
                },
                "reservedCents": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "What running work has reserved against the limit, in US cents, as a JSON integer."
                },
                "spentCents": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "What is already spent this period, in US cents, as a JSON integer."
                }
              },
              "required": [
                "periodKind",
                "capCents",
                "reservedCents",
                "spentCents"
              ]
            },
            "description": "Today and this month, each with its limit, spend and reservations. What is left is `capCents - spentCents - reservedCents`."
          }
        },
        "required": [
          "ok",
          "frozen",
          "snapshots"
        ],
        "description": "The user's AI usage budget for today and this month: the cost of running the agent, not money in the wallet."
      },
      "AccountWallet": {
        "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 agent wallet's id."
          },
          "intentsAccount": {
            "description": "The wallet's NEAR Intents account and its kind: `near` for a Fin-held wallet, `evm` for an Agent API wallet.",
            "$ref": "#/components/schemas/IntentsAccount"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ],
            "description": "`active`, or `disabled` once an operator has turned the wallet off."
          },
          "provisionStatus": {
            "type": "string",
            "enum": [
              "pending",
              "ready",
              "authorization_required"
            ],
            "description": "Whether the wallet can reach its provider: `pending` before its first connection, `ready` once connected, `authorization_required` after the provider refused its session. The server reconnects it on its own a few minutes later, on the next balance read or wallet activity; nothing is needed from the user."
          },
          "ownership": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "statement": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 8192,
                    "description": "canonicalJson of the statement; the exact bytes the signature covers, minus the domain line."
                  },
                  "signature": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9+/]{86}==$",
                    "description": "The worker identity key's 64-byte Ed25519 signature in padded standard base64."
                  },
                  "workerPublicKey": {
                    "type": "string",
                    "pattern": "^ed25519:[1-9A-HJ-NP-Za-km-z]{32,44}$",
                    "description": "The worker identity key that signed, as ed25519:<base58>."
                  }
                },
                "required": [
                  "statement",
                  "signature",
                  "workerPublicKey"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "A signed ownership statement: version 1 proves owner-signed wallet creation; version 2 with basis owner_confirmation proves the owner explicitly confirmed an existing imported account, not attested key generation; version 3 with basis agent_api proves the owner signed an Agent API wallet's creation and names its `intentsAccount`. Verify the version-specific signed message against your independently pinned worker key and compare the wallet, account and owner. Null while ownership still needs confirmation."
          },
          "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 wallet was created."
          }
        },
        "required": [
          "id",
          "intentsAccount",
          "status",
          "provisionStatus",
          "ownership",
          "createdAt"
        ],
        "description": "The user's agent wallet, whatever its kind: the wallet the agent deposits to, trades from and withdraws from."
      },
      "AccountWalletBalances": {
        "type": "object",
        "properties": {
          "wallet": {
            "$ref": "#/components/schemas/AccountWallet"
          },
          "assets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "symbol": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "The asset's ticker symbol, as the provider reports it."
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "description": "The asset's display name, as the provider reports it."
                },
                "decimals": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 255
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "How many decimal places `amountRaw` carries; `null` if the provider does not name this asset."
                },
                "amountRaw": {
                  "type": "string",
                  "maxLength": 160,
                  "pattern": "^(0|[1-9]\\d*)$",
                  "description": "The held amount, as a decimal string in the asset's smallest unit, never a float; scale by `decimals` for a human amount."
                },
                "priceUsdDecimal": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 500,
                      "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The asset's price in USD, as a decimal string, never a float; `null` if the provider has no price for it."
                },
                "valueUsdCents": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 160,
                      "pattern": "^(0|[1-9]\\d*)$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "This holding's value, in US cents as a decimal integer string, never a float; `null` if `priceUsdDecimal` is `null`."
                },
                "iconUrl": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "An https icon for the asset, or `null` if the provider has none."
                },
                "assetId": {
                  "type": "string",
                  "pattern": "^asset_[a-f0-9]{64}$",
                  "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
                },
                "transferAsset": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^asset_[a-f0-9]{64}$",
                          "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
                        },
                        "network": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9-]{0,63}$",
                          "description": "The asset's native blockchain network."
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "native",
                            "token"
                          ],
                          "description": "Native currency or a token contract according to the provider catalog."
                        },
                        "contractAddress": {
                          "anyOf": [
                            {
                              "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."
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Native-chain token identifier; null for native currency."
                        },
                        "decimals": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 38,
                          "description": "Atomic-unit precision."
                        },
                        "symbol": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "description": "Display label; the asset id determines identity."
                        }
                      },
                      "required": [
                        "id",
                        "network",
                        "kind",
                        "contractAddress",
                        "decimals",
                        "symbol"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The asset as deposits and withdrawals name it; null when it is not a supported asset."
                }
              },
              "required": [
                "symbol",
                "name",
                "decimals",
                "amountRaw",
                "priceUsdDecimal",
                "valueUsdCents",
                "iconUrl",
                "assetId",
                "transferAsset"
              ]
            },
            "description": "Each asset the wallet holds, with its exact amount in the asset's smallest unit."
          },
          "totalUsdCents": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 160,
                "pattern": "^(0|[1-9]\\d*)$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The sum of every priced asset's value, in US cents as a decimal integer string, never a float; `null` if any asset's price is unknown."
          },
          "asOf": {
            "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 snapshot was read from the provider."
          },
          "portfolio": {
            "$ref": "#/components/schemas/WalletPortfolioSummary"
          },
          "depositLimit": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "maxWalletValueCents": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,17})$",
                    "description": "The most the agent wallet may be worth with a deposit added, in US cents: its value, the deposits still under way and the new one."
                  },
                  "availableCents": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,17})$",
                    "description": "How much more can be deposited right now, in US cents: the limit less the wallet's value and the deposits still under way, and 0 when the wallet is at or over its limit. A deposit worth more is refused with `deposit_limit_exceeded`, and so is a deposit address once this is 0."
                  }
                },
                "required": [
                  "maxWalletValueCents",
                  "availableCents"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The user's deposit limit, or null when none applies. Use `availableCents` to say how much the user can deposit before asking for an address; Create a deposit and Create a deposit address check it again."
          }
        },
        "required": [
          "wallet",
          "assets",
          "totalUsdCents",
          "asOf",
          "portfolio",
          "depositLimit"
        ],
        "description": "The agent wallet, whatever its kind, what it holds right now, and how much more it can take."
      },
      "AccountWalletSession": {
        "type": "object",
        "properties": {
          "intentsAccount": {
            "description": "The agent wallet's NEAR Intents account and its kind: the account these tokens sign in as, and the `account_id` inside them.",
            "$ref": "#/components/schemas/IntentsAccount"
          },
          "accessToken": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8192,
            "description": "A 1Click access token for the agent wallet. Send it as `Authorization: Bearer` to 1Click's account endpoints, such as balances and history."
          },
          "accessTokenExpiresAt": {
            "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 access token expires. Then exchange `refreshToken` for a new one at 1Click's `POST /v0/auth/refresh`, as you do for your own users."
          },
          "refreshToken": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8192,
            "description": "Exchanges for new access tokens at 1Click until `refreshTokenExpiresAt`. 1Click answers a refresh with a new access token only, so keep this one."
          },
          "refreshTokenExpiresAt": {
            "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 refresh token expires. After that, or when 1Click refuses it, get a new session."
          }
        },
        "required": [
          "intentsAccount",
          "accessToken",
          "accessTokenExpiresAt",
          "refreshToken",
          "refreshTokenExpiresAt"
        ],
        "description": "A 1Click session for the agent wallet, whatever its kind, so your backend can read it from 1Click with its own code."
      },
      "WalletSetupIntent": {
        "type": "object",
        "properties": {
          "standard": {
            "type": "string",
            "enum": [
              "nep366",
              "nep413",
              "eip712",
              "webauthn"
            ],
            "description": "How the user's wallet signs `payload`: `nep366` a NEAR delegate action (`signDelegateActions`), `nep413` a NEAR message (`signMessage`, with `nonce` decoded from base64 to its 32 bytes), `eip712` EVM typed data (`signTypedData`), `webauthn` a passkey assertion (`navigator.credentials.get` with `payload` as its request options)."
          },
          "payload": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "What the user's wallet signs, exactly as given: never rebuild, reorder or hash it."
          }
        },
        "required": [
          "standard",
          "payload"
        ],
        "description": "What the user's wallet or passkey signs for one wallet setup step."
      },
      "WalletSetup": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "signature_required",
              "completed"
            ],
            "description": "`signature_required`: the user signs `step.intent`, then send it to Continue wallet setup. `completed`: `wallet` is ready."
          },
          "step": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "setupId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "description": "This step's id: send it back to Continue wallet setup with the signature."
                  },
                  "step": {
                    "type": "string",
                    "enum": [
                      "agent_create",
                      "policy_update",
                      "grant_issue",
                      "grant_revoke"
                    ],
                    "description": "`agent_create`: the user creates their agent account, which they own. `grant_issue`: the user lets Fin's agent sign with it for a year; in public-key mode the summary names the signing key's thumbprint, not a token fingerprint. `grant_revoke`: after renewal, the user revokes the retired token grant. `policy_update`: the user enables limit orders through Start wallet setup, or lets their agent account pay one more address through Add a withdrawal destination."
                  },
                  "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                    "description": "When this step can no longer be signed. After it, Start wallet setup or Renew wallet access again for a fresh one."
                  },
                  "summary": {
                    "type": "string",
                    "maxLength": 4096,
                    "description": "What the user agrees to, in the Agent API's words: show it before they sign."
                  },
                  "intent": {
                    "$ref": "#/components/schemas/WalletSetupIntent"
                  },
                  "policy": {
                    "description": "For `agent_create` and `policy_update`: what the user's agent account may do once they sign, as Fin asked the Agent API for it (for `policy_update`, everything it allows after the change). Show it beside `summary`. Absent for `grant_issue`, and when Fin cannot state it for this step.",
                    "type": "object",
                    "properties": {
                      "limitOrder": {
                        "type": "boolean",
                        "description": "Whether the agent account can place confidential limit orders at market or better, with no price deviation allowed below market."
                      },
                      "maxSlippageBps": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 300,
                        "description": "The most of its value a swap or payout the agent account signs may lose in total, in basis points (300 is 3%): fees, price and slippage together, by 1Click's own USD values at the quote's minimum output."
                      },
                      "destinations": {
                        "maxItems": 512,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "network": {
                              "type": "string",
                              "maxLength": 64,
                              "description": "The network the address is on: `near-intents-confidential` for a NEAR Intents account, otherwise a network `id` such as `eth` or `near`."
                            },
                            "address": {
                              "type": "string",
                              "maxLength": 256,
                              "description": "The address, as the agent account lists it."
                            },
                            "venue": {
                              "description": "When the address is the agent's own account on a venue, which one: `perps` its Hyperliquid account, `prediction` the Polymarket bridge's deposit address for its Polymarket account, `solana` its Solana account. Fin derived it, so show it as funding the user's own account there, not as a payout. Absent for any other address.",
                              "type": "string",
                              "enum": [
                                "perps",
                                "prediction",
                                "solana"
                              ]
                            }
                          },
                          "required": [
                            "network",
                            "address"
                          ]
                        },
                        "description": "Every address the agent account may pay, and nothing else."
                      }
                    },
                    "required": [
                      "limitOrder",
                      "maxSlippageBps",
                      "destinations"
                    ]
                  },
                  "accessExpiresAt": {
                    "description": "For `grant_issue`: when the access the user gives Fin's agent ends, unless they renew it sooner (Renew wallet access). Absent for the other steps, and when Fin cannot state it for this step.",
                    "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  }
                },
                "required": [
                  "setupId",
                  "step",
                  "expiresAt",
                  "summary",
                  "intent"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "While `signature_required`: what the user signs next. Otherwise null."
          },
          "wallet": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AccountWallet"
              },
              {
                "type": "null"
              }
            ],
            "description": "Once `completed`: the agent wallet. Otherwise null."
          }
        },
        "required": [
          "status",
          "step",
          "wallet"
        ],
        "description": "Where setting up the agent wallet stands: the next step the user signs, or the wallet."
      },
      "ApprovalAuthorization": {
        "type": "object",
        "properties": {
          "purpose": {
            "type": "string",
            "const": "financial.approval",
            "description": "Always `financial.approval`: the signature approves this one money action."
          },
          "walletId": {
            "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 agent wallet the action spends from."
          },
          "requestKey": {
            "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, which the signature names, so it approves this approval and no other."
          },
          "request": {
            "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 being decided."
              },
              "fingerprint": {
                "type": "string",
                "description": "Fingerprint of the immutable approval bytes."
              },
              "tool": {
                "type": "string",
                "description": "The exact trusted tool receiving the approved terms."
              },
              "input": {
                "description": "The complete persisted tool arguments to approve.",
                "$ref": "#/components/schemas/JsonValue"
              },
              "contract": {
                "oneOf": [
                  {
                    "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"
                    ]
                  },
                  {
                    "$ref": "#/components/schemas/LimitOrderContract"
                  },
                  {
                    "$ref": "#/components/schemas/PerpsTransferContract"
                  },
                  {
                    "$ref": "#/components/schemas/PerpsOrderContract"
                  },
                  {
                    "$ref": "#/components/schemas/PerpsCancelContract"
                  },
                  {
                    "$ref": "#/components/schemas/PerpsAutomationContract"
                  },
                  {
                    "$ref": "#/components/schemas/PerpsMarginContract"
                  },
                  {
                    "$ref": "#/components/schemas/PredictionFundContract"
                  },
                  {
                    "$ref": "#/components/schemas/SolanaBuyContract"
                  },
                  {
                    "$ref": "#/components/schemas/SolanaSellContract"
                  },
                  {
                    "$ref": "#/components/schemas/SolanaFundContract"
                  },
                  {
                    "$ref": "#/components/schemas/SolanaWithdrawContract"
                  },
                  {
                    "$ref": "#/components/schemas/PredictionOrderContract"
                  },
                  {
                    "$ref": "#/components/schemas/PredictionWithdrawContract"
                  },
                  {
                    "$ref": "#/components/schemas/CompositeContract"
                  },
                  {
                    "$ref": "#/components/schemas/PredictionAutomationContract"
                  },
                  {
                    "$ref": "#/components/schemas/SolanaSellManyContract"
                  },
                  {
                    "$ref": "#/components/schemas/GridContract"
                  },
                  {
                    "$ref": "#/components/schemas/PerpsFreedWithdrawalContract"
                  },
                  {
                    "$ref": "#/components/schemas/PredictionFreedWithdrawalContract"
                  }
                ],
                "description": "Exact financial actions, quantity, allowance, validity and loss bounds authorized by this approval: swap actions, one limit order, one perps transfer/order/cancellation or margin change, one Polymarket funding/order/withdrawal, the exact Solana actions, or one grid's terms."
              },
              "policy": {
                "description": "The custody worker's exact grant for these terms; clients sign it without mutation.",
                "$ref": "#/components/schemas/PolicyApprovalMessage"
              }
            },
            "required": [
              "approvalId",
              "fingerprint",
              "tool",
              "input",
              "contract",
              "policy"
            ],
            "description": "The exact terms the signature covers, including the permission they grant. Shown for review; the signed `message` already contains them."
          },
          "message": {
            "type": "string",
            "description": "The text the user signs with their registered wallet or passkey. Sign it exactly as returned: a changed character makes the signature invalid."
          },
          "controllerId": {
            "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 user's registered wallet or passkey, the only one whose signature is accepted. Send it back unchanged beside the signature."
          },
          "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": "When the signature stops being accepted, about four and a half minutes after this was issued. Send it back unchanged beside the signature."
          },
          "recipient": {
            "description": "NEAR wallets only: the `recipient` to pass to `signMessage` together with the message.",
            "type": "string"
          }
        },
        "required": [
          "purpose",
          "walletId",
          "requestKey",
          "request",
          "message",
          "controllerId",
          "expiresAt"
        ],
        "description": "What the user signs to approve a money action. Sign `message` exactly as returned and send the signature to Approve an action with `controllerId` and `expiresAt` unchanged."
      },
      "Approval": {
        "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 approval's id."
              },
              "tool": {
                "type": "string",
                "description": "The tool the agent wants to use."
              },
              "fingerprint": {
                "type": "string",
                "description": "The SHA-256 digest, as 64 lowercase hexadecimal characters, of the tool and its exact input in canonical JSON, with the deployment's no-signing restriction when it set one: the decision applies to exactly this action, and the action that runs must match it."
              },
              "input": {
                "description": "The tool's input, exactly as it would run: show it to the user.",
                "$ref": "#/components/schemas/JsonValue"
              },
              "contract": {
                "anyOf": [
                  {
                    "oneOf": [
                      {
                        "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"
                        ]
                      },
                      {
                        "$ref": "#/components/schemas/LimitOrderContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsTransferContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsOrderContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsCancelContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsAutomationContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsMarginContract"
                      },
                      {
                        "$ref": "#/components/schemas/PredictionFundContract"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaBuyContract"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaSellContract"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaFundContract"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaWithdrawContract"
                      },
                      {
                        "$ref": "#/components/schemas/PredictionOrderContract"
                      },
                      {
                        "$ref": "#/components/schemas/PredictionWithdrawContract"
                      },
                      {
                        "$ref": "#/components/schemas/CompositeContract"
                      },
                      {
                        "$ref": "#/components/schemas/PredictionAutomationContract"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaSellManyContract"
                      },
                      {
                        "$ref": "#/components/schemas/GridContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsFreedWithdrawalContract"
                      },
                      {
                        "$ref": "#/components/schemas/PredictionFreedWithdrawalContract"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "For a money action, the amounts, assets, destinations and limits approving it allows; `null` for other actions."
              },
              "authorization": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApprovalAuthorization"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "For a money action waiting for a decision: the message the user signs to approve it, and the request it covers. `null` for other actions, once decided, and for withdrawals the user starts with Withdraw funds, which approves them itself."
              },
              "summary": {
                "type": "string",
                "description": "A short summary of what approving would do."
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "approved",
                  "denied",
                  "expired"
                ],
                "description": "`pending` while it waits for a decision, `approved` or `denied` once decided, or `expired` when nobody decided before `expiresAt`."
              },
              "reason": {
                "description": "Why it was decided, if a reason was given.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "requestedAt": {
                "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 agent asked."
              },
              "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": "When the approval expires if nobody decides it."
              },
              "decidedAt": {
                "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 it was approved or denied; null until then."
              },
              "consumedAt": {
                "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 approved action started, or `null` until then (always `null` when denied). The action can still fail afterwards: this is not proof it succeeded."
              },
              "signedBy": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 8192
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "For an approved money action, which only the user's signature approves: the sign-in wallet that signed it, by its public identifier (an EVM, Solana, Stellar or Tron address, a NEAR account, a TON public key, or a passkey's credential id). A user's sign-in wallet is fixed at their first sign-in and never replaced, so reading it now names the same wallet that signed when the action was approved. `null` for any other approval, and for a money action approved before the user's sign-in wallet was registered, when approvals took no signature."
              },
              "conversationId": {
                "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."
              },
              "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)$"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The run waiting on this approval; `null` only for old approvals."
              },
              "operationId": {
                "type": "null",
                "description": "Always `null` for an approval a run is waiting on."
              }
            },
            "required": [
              "id",
              "tool",
              "fingerprint",
              "input",
              "contract",
              "authorization",
              "summary",
              "status",
              "reason",
              "requestedAt",
              "expiresAt",
              "decidedAt",
              "consumedAt",
              "signedBy",
              "conversationId",
              "runId",
              "operationId"
            ]
          },
          {
            "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 approval's id."
              },
              "tool": {
                "type": "string",
                "description": "The tool the agent wants to use."
              },
              "fingerprint": {
                "type": "string",
                "description": "The SHA-256 digest, as 64 lowercase hexadecimal characters, of the tool and its exact input in canonical JSON, with the deployment's no-signing restriction when it set one: the decision applies to exactly this action, and the action that runs must match it."
              },
              "input": {
                "description": "The tool's input, exactly as it would run: show it to the user.",
                "$ref": "#/components/schemas/JsonValue"
              },
              "contract": {
                "anyOf": [
                  {
                    "oneOf": [
                      {
                        "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"
                        ]
                      },
                      {
                        "$ref": "#/components/schemas/LimitOrderContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsTransferContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsOrderContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsCancelContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsAutomationContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsMarginContract"
                      },
                      {
                        "$ref": "#/components/schemas/PredictionFundContract"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaBuyContract"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaSellContract"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaFundContract"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaWithdrawContract"
                      },
                      {
                        "$ref": "#/components/schemas/PredictionOrderContract"
                      },
                      {
                        "$ref": "#/components/schemas/PredictionWithdrawContract"
                      },
                      {
                        "$ref": "#/components/schemas/CompositeContract"
                      },
                      {
                        "$ref": "#/components/schemas/PredictionAutomationContract"
                      },
                      {
                        "$ref": "#/components/schemas/SolanaSellManyContract"
                      },
                      {
                        "$ref": "#/components/schemas/GridContract"
                      },
                      {
                        "$ref": "#/components/schemas/PerpsFreedWithdrawalContract"
                      },
                      {
                        "$ref": "#/components/schemas/PredictionFreedWithdrawalContract"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "For a money action, the amounts, assets, destinations and limits approving it allows; `null` for other actions."
              },
              "authorization": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApprovalAuthorization"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "For a money action waiting for a decision: the message the user signs to approve it, and the request it covers. `null` for other actions, once decided, and for withdrawals the user starts with Withdraw funds, which approves them itself."
              },
              "summary": {
                "type": "string",
                "description": "A short summary of what approving would do."
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "approved",
                  "denied",
                  "expired"
                ],
                "description": "`pending` while it waits for a decision, `approved` or `denied` once decided, or `expired` when nobody decided before `expiresAt`."
              },
              "reason": {
                "description": "Why it was decided, if a reason was given.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "requestedAt": {
                "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 agent asked."
              },
              "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": "When the approval expires if nobody decides it."
              },
              "decidedAt": {
                "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 it was approved or denied; null until then."
              },
              "consumedAt": {
                "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 approved action started, or `null` until then (always `null` when denied). The action can still fail afterwards: this is not proof it succeeded."
              },
              "signedBy": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 8192
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "For an approved money action, which only the user's signature approves: the sign-in wallet that signed it, by its public identifier (an EVM, Solana, Stellar or Tron address, a NEAR account, a TON public key, or a passkey's credential id). A user's sign-in wallet is fixed at their first sign-in and never replaced, so reading it now names the same wallet that signed when the action was approved. `null` for any other approval, and for a money action approved before the user's sign-in wallet was registered, when approvals took no signature."
              },
              "conversationId": {
                "type": "null",
                "description": "Always `null`: a withdrawal's review belongs to the withdrawal."
              },
              "runId": {
                "type": "null",
                "description": "Always `null`: a withdrawal has no run."
              },
              "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 withdrawal this review belongs to (its `id` in Get a withdrawal). Withdraw funds decides it."
              }
            },
            "required": [
              "id",
              "tool",
              "fingerprint",
              "input",
              "contract",
              "authorization",
              "summary",
              "status",
              "reason",
              "requestedAt",
              "expiresAt",
              "decidedAt",
              "consumedAt",
              "signedBy",
              "conversationId",
              "runId",
              "operationId"
            ]
          }
        ],
        "description": "An action the agent wants to take that needs the user's OK: what it would do, and whether the user decided."
      },
      "AutomationRunPerps": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "order",
                "description": "A reduce-only order on the automation's position."
              },
              "order": {
                "description": "The exact order the run placed: the coin, side, size and worst price (`entry.price`) this firing allowed.",
                "$ref": "#/components/schemas/PerpsOrderInput"
              },
              "outcome": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/PerpsOrderOutcome"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Hyperliquid's answer, with each placement's fill. Null while the order is being sent or its answer is still being checked; the run never sends it twice."
              }
            },
            "required": [
              "kind",
              "order",
              "outcome"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "margin",
                "description": "Margin moved from the agent wallet to the perps account."
              },
              "transfer": {
                "description": "The exact USDC amount the run moved, in six-decimal units, and its loss bound.",
                "$ref": "#/components/schemas/PerpsTransferInput"
              },
              "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": "How the transfer ended. Null while it is still under way."
              }
            },
            "required": [
              "kind",
              "transfer",
              "outcome"
            ]
          }
        ],
        "description": "What one run of a perps automation did on Hyperliquid: the reduce-only order it placed or the margin it added, with the answer it got."
      },
      "AutomationRunSolana": {
        "oneOf": [
          {
            "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 Solana activity item’s id, for its receipt in History."
              },
              "kind": {
                "type": "string",
                "const": "buy"
              },
              "request": {
                "$ref": "#/components/schemas/SolanaBuyInput"
              },
              "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 observed financial result. Null until there is one; an agent run completing does not prove that money moved."
              }
            },
            "required": [
              "id",
              "kind",
              "request",
              "outcome"
            ]
          },
          {
            "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 Solana activity item’s id, for its receipt in History."
              },
              "kind": {
                "type": "string",
                "const": "sell"
              },
              "request": {
                "$ref": "#/components/schemas/SolanaSellInput"
              },
              "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 observed financial result. Null until there is one; a partial result may leave SOL in the Solana account."
              }
            },
            "required": [
              "id",
              "kind",
              "request",
              "outcome"
            ]
          }
        ],
        "description": "The Solana trade this automation run admitted, with its observed financial result."
      },
      "AutomationRun": {
        "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 automation run's id."
          },
          "deliverySequence": {
            "type": "string",
            "pattern": "^[1-9]\\d*$",
            "description": "This automation run's place in delivery order across all automations, as a string so it sorts and compares exactly at any size. A paging cursor, not a count of this automation's runs: `runNumber` is that."
          },
          "automationId": {
            "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 automation's id."
          },
          "definitionVersion": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "description": "The automation definition version this automation run was recorded under."
          },
          "activationEpoch": {
            "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 activation epoch this automation run was recorded under."
          },
          "name": {
            "type": "string",
            "description": "The automation's name when this automation run was recorded."
          },
          "prompt": {
            "type": "string",
            "description": "The automation's prompt when this automation run was recorded."
          },
          "evidence": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "decision",
                  "external"
                ],
                "description": "What produced this automation run: `decision` the rule's own condition, `external` a source that decided on the engine's behalf."
              },
              "identity": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "A stable string identifying this exact decision, used to deduplicate exact replays within one activation. Reuse with changed data conflicts."
              },
              "evaluatedAt": {
                "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 decision was made."
              },
              "data": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/components/schemas/AutomationJsonValue"
                },
                "description": "The observations behind one decision, exactly as evaluated. Bounded to 256 KiB, 24 levels of nesting and 16384 entries."
              },
              "sourceChecks": {
                "description": "Recipe checks recorded for each source this decision read, when evidence review is configured.",
                "maxItems": 4,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "binding": {
                      "type": "string",
                      "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                      "description": "The binding this check was collected for."
                    },
                    "sourceId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128,
                      "description": "The source's id within its provider."
                    },
                    "eventId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128,
                      "description": "The specific event or observation this check backs."
                    },
                    "operationId": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_.-]{0,79}$",
                      "description": "The collection operation this check ran."
                    },
                    "operationVersion": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991,
                      "description": "The collection operation's version."
                    },
                    "check": {
                      "type": "object",
                      "properties": {
                        "recipe": {
                          "type": "object",
                          "properties": {
                            "version": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991,
                              "description": "The recipe description's own version, bumped when its steps change."
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 120,
                              "description": "The recipe's short label, for the reviewed catalog."
                            },
                            "summary": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 600,
                              "description": "What the recipe does, for the reviewed catalog."
                            },
                            "steps": {
                              "minItems": 1,
                              "maxItems": 12,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9_-]{0,47}$",
                                    "description": "The step's identifier, unique within its recipe."
                                  },
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "request",
                                      "validate",
                                      "calculate"
                                    ],
                                    "description": "What this step does: `request` calls the provider, `validate` checks what it returned, `calculate` derives a value from earlier steps."
                                  },
                                  "title": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 120,
                                    "description": "The step's short label, for the reviewed catalog."
                                  },
                                  "description": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 600,
                                    "description": "What this step does, for the reviewed catalog."
                                  },
                                  "api": {
                                    "type": "object",
                                    "properties": {
                                      "method": {
                                        "type": "string",
                                        "enum": [
                                          "GET",
                                          "POST",
                                          "GRAPHQL"
                                        ],
                                        "description": "The request's method or protocol."
                                      },
                                      "resource": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 160,
                                        "pattern": "^\\/?[A-Za-z0-9_{}][A-Za-z0-9_./{} -]*$",
                                        "description": "The request's path or resource name."
                                      }
                                    },
                                    "required": [
                                      "method",
                                      "resource"
                                    ],
                                    "description": "The request this step makes, when it calls the provider."
                                  }
                                },
                                "required": [
                                  "id",
                                  "kind",
                                  "title",
                                  "description"
                                ]
                              },
                              "description": "The recipe's steps, in order."
                            },
                            "limitations": {
                              "maxItems": 6,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 600
                              },
                              "description": "What the recipe does not cover, in the reviewer's own words."
                            },
                            "fingerprint": {
                              "type": "string",
                              "pattern": "^[a-f0-9]{64}$",
                              "description": "A content hash identifying this exact recipe, independent of execution or connection identity."
                            }
                          },
                          "required": [
                            "version",
                            "title",
                            "summary",
                            "steps",
                            "limitations",
                            "fingerprint"
                          ],
                          "description": "A reviewed, public description of how a source is collected: the steps a reviewer confirmed, never an executable request or a resolved private endpoint."
                        },
                        "startedAt": {
                          "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 check began."
                        },
                        "completedAt": {
                          "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 check finished."
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "completed",
                            "failed"
                          ],
                          "description": "Whether every step completed."
                        },
                        "steps": {
                          "maxItems": 12,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "stepId": {
                                "type": "string",
                                "pattern": "^[a-z][a-z0-9_-]{0,47}$",
                                "description": "The declared recipe step this check reports on."
                              },
                              "outcome": {
                                "type": "string",
                                "enum": [
                                  "completed",
                                  "failed"
                                ],
                                "description": "Whether the step completed or failed."
                              },
                              "requestCount": {
                                "description": "How many requests this step made, when it made any.",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 100000
                              },
                              "itemCount": {
                                "description": "How many items this step processed, when counting applies.",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 1000000
                              },
                              "durationMs": {
                                "description": "How long this step took, in milliseconds.",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 600000
                              },
                              "reason": {
                                "description": "Why the step failed, when it did: `not_configured` the source lacks a needed setting, `unavailable` the provider did not answer, `malformed` its answer could not be read, `oversized` the answer exceeded a bound, `stale` or `future` a timestamp was out of range, `incomplete` part of the answer was missing, `invalid` the answer failed validation, `canceled` the check was stopped before finishing.",
                                "type": "string",
                                "enum": [
                                  "not_configured",
                                  "unavailable",
                                  "malformed",
                                  "oversized",
                                  "stale",
                                  "future",
                                  "incomplete",
                                  "invalid",
                                  "canceled"
                                ]
                              }
                            },
                            "required": [
                              "stepId",
                              "outcome"
                            ],
                            "description": "One recipe step's recorded outcome: counts and a closed reason only, never a URL, body, cursor, address or error message."
                          },
                          "description": "Each step's own recorded outcome, in order."
                        }
                      },
                      "required": [
                        "recipe",
                        "startedAt",
                        "completedAt",
                        "status",
                        "steps"
                      ],
                      "description": "A recorded run of a recipe's steps against the real source, kept as evidence."
                    }
                  },
                  "required": [
                    "binding",
                    "sourceId",
                    "eventId",
                    "operationId",
                    "operationVersion",
                    "check"
                  ],
                  "description": "Frozen recipe evidence tied to the actual observation used by one decision."
                }
              }
            },
            "required": [
              "kind",
              "identity",
              "evaluatedAt",
              "data"
            ],
            "description": "Why this automation run happened: the decision, its evaluated data, and any recipe checks behind it."
          },
          "selection": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "entry",
                    "description": "This firing runs every entry action of the contract, in order."
                  }
                },
                "required": [
                  "kind"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "exit",
                    "description": "This firing runs exactly one exit action."
                  },
                  "actionIndex": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 15,
                    "description": "The zero-based index of the approved exit action this firing selected."
                  },
                  "exitKind": {
                    "type": "string",
                    "enum": [
                      "take_profit",
                      "stop_loss",
                      "harvest_every"
                    ],
                    "description": "Which guard fired: a take-profit, a stop-loss or a scheduled harvest."
                  }
                },
                "required": [
                  "kind",
                  "actionIndex",
                  "exitKind"
                ]
              }
            ],
            "description": "What this automation run's firing selected out of its contract: every entry action in order (`Scheduled buy`), or exactly one exit action (`Take-profit exit`/`Stop-loss exit`). A definition without a contract records `{ kind: \"entry\" }`."
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "deferred",
              "accepted",
              "retrying",
              "succeeded",
              "partial",
              "failed",
              "uncertain",
              "rejected",
              "canceled",
              "skipped",
              "coalesced"
            ],
            "description": "This automation run's state: `pending` waiting to start, `deferred` an admission attempt failed and is waiting to retry, `accepted` handed to an agent run, `retrying` waiting to try again before its deadline, `succeeded` it did what it was asked, `partial` only some of it went through, `failed` it moved nothing it was asked to, `uncertain` money may have moved and how it ended is not known yet, `rejected` the delivery policy refused it outright, or a non-retryable admission failure (or an exhausted retry deadline) stopped it, `canceled` stopped before starting, `skipped` an earlier automation run was still active or it was missed, `coalesced` merged into a newer match."
          },
          "reason": {
            "description": "Why the automation run is in this state, when there is one to give. A run that failed or went through only in part gives one of `unavailable`, `insufficient_funds`, `quote_rejected`, `not_authorized`, `not_executed` or `condition_passed`.",
            "type": [
              "string",
              "null"
            ]
          },
          "runNumber": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Which of its automation's runs this is, counting from 1, the number its run limit counts. Null for a run that is no scheduled or triggered firing of its own, such as an exit check selling a position. Show this, not `deliverySequence`."
          },
          "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 automation run was recorded."
          },
          "deliveryDeadline": {
            "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 latest this automation run could still start."
          },
          "deadlineAt": {
            "description": "The latest this run may still try, once it has started: the earliest of its delivery deadline, the windows its owner signed and its next firing. Null or absent for a run that never started, or one from before this field. Use it, not `deliveryDeadline`, to say how long a run had.",
            "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"
              }
            ]
          },
          "nextAttemptAt": {
            "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 next attempt to start this automation run is due."
          },
          "lastAttemptAt": {
            "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 automation run was last tried, when it has been."
          },
          "attempts": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "How many attempts to start this automation run there have been."
          },
          "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 conversation this automation run works in, once it has one."
          },
          "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)$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The agent run this automation run started, once it has one."
          },
          "runStatus": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "running",
                  "paused",
                  "completed",
                  "failed",
                  "aborted"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "That agent run's status, once it has one: `running`, `paused` while an approval waits, then `completed`, `failed` or `aborted`."
          },
          "runError": {
            "description": "Why the agent run failed, when it did.",
            "type": [
              "string",
              "null"
            ]
          },
          "pendingApprovals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "How many approvals this automation run's agent run is waiting on."
          },
          "solana": {
            "description": "For a Solana trading automation, the admitted trade and its observed result. Absent or null before it acts and for other automations. Read this result independently of runStatus.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/AutomationRunSolana"
              },
              {
                "type": "null"
              }
            ]
          },
          "perps": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AutomationRunPerps"
              },
              {
                "type": "null"
              }
            ],
            "description": "For a perps automation, the order this run placed or the margin it added, with Hyperliquid's answer. Null for any other automation, and until the run acts."
          }
        },
        "required": [
          "id",
          "deliverySequence",
          "automationId",
          "definitionVersion",
          "activationEpoch",
          "name",
          "prompt",
          "evidence",
          "selection",
          "state",
          "reason",
          "runNumber",
          "createdAt",
          "deliveryDeadline",
          "nextAttemptAt",
          "lastAttemptAt",
          "attempts",
          "conversationId",
          "runId",
          "runStatus",
          "runError",
          "pendingApprovals",
          "perps"
        ],
        "description": "One time an automation ran or was due to run: why, its delivery state, and the agent run it started, if any."
      },
      "AutomationReadings": {
        "type": "object",
        "properties": {
          "data": {
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "binding": {
                  "type": "string",
                  "description": "The reader's name in the rule, `rule.readers[].name`."
                },
                "readerId": {
                  "type": "string",
                  "description": "The source recipe it reads, as `rule.readers[].readerId` names it."
                },
                "latest": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "at": {
                          "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 source says this reading was true."
                        },
                        "data": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "$ref": "#/components/schemas/AutomationJsonValue"
                          },
                          "description": "One source observation's data, as the provider or the sender sent it. Bounded to 10 levels of nesting and 260 entries."
                        }
                      },
                      "required": [
                        "at",
                        "data"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The reader's most recent good reading in the window; null when it has none."
                },
                "fields": {
                  "maxItems": 16,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "path": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "The key path into the reading the rule compares, as in its condition."
                      },
                      "points": {
                        "maxItems": 240,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "at": {
                              "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 source says this value was true."
                            },
                            "value": {
                              "type": "string",
                              "description": "The value exactly as the source wrote it: a decimal string."
                            }
                          },
                          "required": [
                            "at",
                            "value"
                          ]
                        },
                        "description": "The field's values in the window, oldest first: at most 240, the last reading of each equal slice of the window."
                      }
                    },
                    "required": [
                      "path",
                      "points"
                    ]
                  },
                  "description": "Each field the rule's condition compares from this reader."
                }
              },
              "required": [
                "binding",
                "readerId",
                "latest",
                "fields"
              ]
            },
            "description": "One entry for each reader the automation's rule binds, in the rule's order."
          }
        },
        "required": [
          "data"
        ],
        "description": "What each source an automation reads reported over a window: its latest reading and the values of the fields its rule compares."
      },
      "AutomationSource": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_.-]{0,79}$",
            "description": "The operation's id within the catalog."
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "description": "The operation's version."
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "A short display name for this source."
          },
          "description": {
            "type": "string",
            "maxLength": 2048,
            "description": "What this source reads, in the catalog's own words."
          },
          "semanticIdentity": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048,
            "description": "What this operation actually reads, independent of its exact configuration; used to tell equivalent sources apart."
          },
          "schemaFingerprint": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "description": "A content hash of this operation's exact configuration and result field types, derived from the registry."
          },
          "configSchema": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "object",
                "description": "Always `object`: a source's configuration is a flat set of named fields."
              },
              "properties": {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
                },
                "additionalProperties": {
                  "anyOf": [
                    {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "title": {
                              "description": "A short label for this configuration field, for display.",
                              "type": "string",
                              "maxLength": 120
                            },
                            "description": {
                              "description": "Help text for this configuration field, for display.",
                              "type": "string",
                              "maxLength": 2048
                            },
                            "type": {
                              "type": "string",
                              "const": "string",
                              "description": "A text value."
                            },
                            "enum": {
                              "description": "The exact values allowed, when this field is closed to a fixed list.",
                              "minItems": 1,
                              "maxItems": 128,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "maxLength": 4096
                              }
                            },
                            "minLength": {
                              "description": "The shortest allowed length, in characters.",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 4096
                            },
                            "maxLength": {
                              "description": "The longest allowed length, in characters.",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 4096
                            },
                            "pattern": {
                              "description": "A regular expression this field's value must match, when its shape is constrained.",
                              "type": "string",
                              "maxLength": 1024
                            },
                            "default": {
                              "description": "The value used when this field is left unset.",
                              "type": "string",
                              "maxLength": 4096
                            }
                          },
                          "required": [
                            "type"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "title": {
                              "description": "A short label for this configuration field, for display.",
                              "type": "string",
                              "maxLength": 120
                            },
                            "description": {
                              "description": "Help text for this configuration field, for display.",
                              "type": "string",
                              "maxLength": 2048
                            },
                            "type": {
                              "type": "string",
                              "const": "boolean",
                              "description": "A true/false value."
                            },
                            "default": {
                              "description": "The value used when this field is left unset.",
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "type"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "title": {
                              "description": "A short label for this configuration field, for display.",
                              "type": "string",
                              "maxLength": 120
                            },
                            "description": {
                              "description": "Help text for this configuration field, for display.",
                              "type": "string",
                              "maxLength": 2048
                            },
                            "type": {
                              "type": "string",
                              "const": "integer",
                              "description": "A whole-number value."
                            },
                            "minimum": {
                              "description": "The smallest allowed value.",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "maximum": {
                              "description": "The largest allowed value.",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "enum": {
                              "description": "The exact values allowed, when this field is closed to a fixed list.",
                              "minItems": 1,
                              "maxItems": 128,
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              }
                            },
                            "default": {
                              "description": "The value used when this field is left unset.",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "type"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "title": {
                          "description": "A short label for this configuration field, for display.",
                          "type": "string",
                          "maxLength": 120
                        },
                        "description": {
                          "description": "Help text for this configuration field, for display.",
                          "type": "string",
                          "maxLength": 2048
                        },
                        "type": {
                          "type": "string",
                          "const": "array",
                          "description": "A list of scalar values."
                        },
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "description": "A short label for this configuration field, for display.",
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "description": {
                                  "description": "Help text for this configuration field, for display.",
                                  "type": "string",
                                  "maxLength": 2048
                                },
                                "type": {
                                  "type": "string",
                                  "const": "string",
                                  "description": "A text value."
                                },
                                "enum": {
                                  "description": "The exact values allowed, when this field is closed to a fixed list.",
                                  "minItems": 1,
                                  "maxItems": 128,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "maxLength": 4096
                                  }
                                },
                                "minLength": {
                                  "description": "The shortest allowed length, in characters.",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 4096
                                },
                                "maxLength": {
                                  "description": "The longest allowed length, in characters.",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 4096
                                },
                                "pattern": {
                                  "description": "A regular expression this field's value must match, when its shape is constrained.",
                                  "type": "string",
                                  "maxLength": 1024
                                },
                                "default": {
                                  "description": "The value used when this field is left unset.",
                                  "type": "string",
                                  "maxLength": 4096
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "description": "A short label for this configuration field, for display.",
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "description": {
                                  "description": "Help text for this configuration field, for display.",
                                  "type": "string",
                                  "maxLength": 2048
                                },
                                "type": {
                                  "type": "string",
                                  "const": "boolean",
                                  "description": "A true/false value."
                                },
                                "default": {
                                  "description": "The value used when this field is left unset.",
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "description": "A short label for this configuration field, for display.",
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "description": {
                                  "description": "Help text for this configuration field, for display.",
                                  "type": "string",
                                  "maxLength": 2048
                                },
                                "type": {
                                  "type": "string",
                                  "const": "integer",
                                  "description": "A whole-number value."
                                },
                                "minimum": {
                                  "description": "The smallest allowed value.",
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "maximum": {
                                  "description": "The largest allowed value.",
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "enum": {
                                  "description": "The exact values allowed, when this field is closed to a fixed list.",
                                  "minItems": 1,
                                  "maxItems": 128,
                                  "type": "array",
                                  "items": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "default": {
                                  "description": "The value used when this field is left unset.",
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          ],
                          "description": "The type each item in the list must match."
                        },
                        "minItems": {
                          "description": "The fewest items allowed.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 64
                        },
                        "maxItems": {
                          "description": "The most items allowed.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 64
                        }
                      },
                      "required": [
                        "type",
                        "items"
                      ]
                    }
                  ]
                },
                "description": "Each configuration field this source accepts, keyed by field name."
              },
              "required": {
                "default": [],
                "description": "Which configuration fields must be set.",
                "maxItems": 64,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
                }
              },
              "additionalProperties": {
                "type": "boolean",
                "const": false,
                "description": "Always `false`: no configuration field outside `properties` is accepted."
              }
            },
            "required": [
              "type",
              "properties",
              "required",
              "additionalProperties"
            ],
            "description": "This source's configuration, as a bounded JSON Schema subset the generic source editor can render."
          },
          "fields": {
            "minItems": 1,
            "maxItems": 64,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "minItems": 1,
                  "maxItems": 8,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
                  },
                  "description": "The keys to walk, in order, from an observation's top level down to this field."
                },
                "valueType": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "boolean",
                          "description": "A true/false value."
                        }
                      },
                      "required": [
                        "type"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "string",
                          "description": "A text value."
                        }
                      },
                      "required": [
                        "type"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "integer",
                          "description": "A whole-number value, compared exactly."
                        },
                        "unit": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "description": "The unit an integer or decimal value is measured in, as the source or literal declares it."
                        }
                      },
                      "required": [
                        "type",
                        "unit"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "decimal",
                          "description": "An exact decimal value, as text, compared exactly."
                        },
                        "unit": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "description": "The unit an integer or decimal value is measured in, as the source or literal declares it."
                        }
                      },
                      "required": [
                        "type",
                        "unit"
                      ]
                    }
                  ],
                  "description": "What type this field's value has, and the unit it carries when it has one."
                },
                "optional": {
                  "description": "Whether the provider may genuinely not observe this field, rather than fail to read it. When true, a missing value resolves a condition over it to `missing_field` and the rule's verdict to `unknown`, rather than zero, null or false.",
                  "type": "boolean"
                }
              },
              "required": [
                "path",
                "valueType"
              ],
              "description": "One data field an event or a source's observation carries: where it lives, and its type."
            },
            "description": "The data fields this source's observations carry."
          },
          "public": {
            "type": "boolean",
            "description": "Whether this source reads data anyone can read, rather than data scoped to the owner's own connection."
          },
          "requiredConnectionScopes": {
            "maxItems": 64,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "description": "The connection scopes a binding needs before this source is available, when it needs any."
          },
          "supportedSubjects": {
            "type": "object",
            "properties": {
              "subjects": {
                "maxItems": 64,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "description": "The subjects this source can be configured to read, when it is bounded to a known list."
              },
              "assets": {
                "maxItems": 64,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "description": "The assets this source can be configured to read, when it is bounded to a known list."
              },
              "networks": {
                "maxItems": 64,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "description": "The networks this source can be configured to read, when it is bounded to a known list."
              },
              "filters": {
                "maxItems": 64,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "description": "The other filters this source accepts, when it is bounded to a known list."
              }
            },
            "required": [
              "subjects",
              "assets",
              "networks",
              "filters"
            ],
            "description": "What this source can be configured to read, where the catalog knows the bounds; empty where any value is accepted."
          },
          "guarantees": {
            "type": "object",
            "properties": {
              "delivery": {
                "description": "Push delivery; absent means polling.",
                "type": "string",
                "const": "push"
              },
              "minCadenceSeconds": {
                "type": "integer",
                "minimum": 0,
                "maximum": 2147483,
                "description": "The shortest interval between requests the provider permits, in seconds."
              },
              "expectedLatencySeconds": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2147483
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "How stale the provider's own value may be when it answers, in seconds; null when the provider establishes no bound. A reader with a delivery deadline cannot use a source that promises nothing here."
              },
              "maxAgeSeconds": {
                "type": "integer",
                "minimum": 0,
                "maximum": 2147483,
                "description": "Maximum snapshot observation age accepted at collection. This acquisition guarantee does not shorten a reader's separately declared evaluation-age window."
              },
              "requestsPerMinute": {
                "anyOf": [
                  {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The provider's own rate limit for this source, when it publishes one."
              },
              "observationReuseSeconds": {
                "description": "How long one provider observation may serve every reader watching the same subject under the same connection, in seconds. Absent or 0 means each reader causes its own request. A reused observation keeps the provider's own `sourceTime`, so declared freshness still governs; what reuse changes is how often the provider is asked, not how old an accepted observation may be. Keep it at or below the cadence readers are expected to poll at.",
                "type": "integer",
                "minimum": 0,
                "maximum": 2147483
              },
              "batchLimit": {
                "description": "How many distinct subjects the provider can serve in one request. Absent or 1 means no batching. Only providers implementing `readBatch` may declare more: the framework cannot infer that an API accepts several subjects.",
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 1000
              }
            },
            "required": [
              "minCadenceSeconds",
              "expectedLatencySeconds",
              "maxAgeSeconds",
              "requestsPerMinute"
            ],
            "description": "What an operation promises about the snapshots it serves: cadence, freshness and how many subjects it can batch. Describes sampled state; nothing here promises that a change between two polls was seen."
          },
          "presentation": {
            "type": "object",
            "properties": {
              "subjectConfigKey": {
                "description": "Which configuration field names the subject being watched, when the editor should highlight one.",
                "type": "string",
                "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
              },
              "fields": {
                "minItems": 1,
                "maxItems": 64,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "minItems": 1,
                      "maxItems": 8,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
                      },
                      "description": "The keys to walk, in order, from an observation's top level down to this field."
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120,
                      "description": "A short display label for this field."
                    },
                    "meaning": {
                      "description": "One plain sentence on what the field means, shown to a person beside a condition on it.",
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    }
                  },
                  "required": [
                    "path",
                    "label"
                  ]
                },
                "description": "Reviewed display labels for a subset of this source's fields."
              }
            },
            "required": [
              "fields"
            ],
            "description": "Reviewed display copy for the source editor: cosmetic only, never part of an execution descriptor or a saved source pin."
          },
          "recipe": {
            "type": "object",
            "properties": {
              "version": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991,
                "description": "The recipe description's own version, bumped when its steps change."
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120,
                "description": "The recipe's short label, for the reviewed catalog."
              },
              "summary": {
                "type": "string",
                "minLength": 1,
                "maxLength": 600,
                "description": "What the recipe does, for the reviewed catalog."
              },
              "steps": {
                "minItems": 1,
                "maxItems": 12,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_-]{0,47}$",
                      "description": "The step's identifier, unique within its recipe."
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "request",
                        "validate",
                        "calculate"
                      ],
                      "description": "What this step does: `request` calls the provider, `validate` checks what it returned, `calculate` derives a value from earlier steps."
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120,
                      "description": "The step's short label, for the reviewed catalog."
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 600,
                      "description": "What this step does, for the reviewed catalog."
                    },
                    "api": {
                      "type": "object",
                      "properties": {
                        "method": {
                          "type": "string",
                          "enum": [
                            "GET",
                            "POST",
                            "GRAPHQL"
                          ],
                          "description": "The request's method or protocol."
                        },
                        "resource": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 160,
                          "pattern": "^\\/?[A-Za-z0-9_{}][A-Za-z0-9_./{} -]*$",
                          "description": "The request's path or resource name."
                        }
                      },
                      "required": [
                        "method",
                        "resource"
                      ],
                      "description": "The request this step makes, when it calls the provider."
                    }
                  },
                  "required": [
                    "id",
                    "kind",
                    "title",
                    "description"
                  ]
                },
                "description": "The recipe's steps, in order."
              },
              "limitations": {
                "maxItems": 6,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 600
                },
                "description": "What the recipe does not cover, in the reviewer's own words."
              },
              "fingerprint": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$",
                "description": "A content hash identifying this exact recipe, independent of execution or connection identity."
              }
            },
            "required": [
              "version",
              "title",
              "summary",
              "steps",
              "limitations",
              "fingerprint"
            ],
            "description": "A reviewed, public description of how a source is collected: the steps a reviewer confirmed, never an executable request or a resolved private endpoint."
          },
          "availability": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "available",
                  "needs_connection",
                  "unavailable",
                  "unknown"
                ],
                "description": "Whether this source is usable for the current owner: `available` ready to use, `needs_connection` the owner must set something up first (such as their agent wallet), `unknown` availability has not been checked yet, or an earlier check's validity window has expired. `unavailable` marks a shared source this deployment does not offer: an automation that reads it is refused, so use another source."
              },
              "configured": {
                "type": "boolean",
                "description": "Whether the owner has set up a connection for this source."
              },
              "verified": {
                "type": "boolean",
                "description": "Whether that connection has been confirmed to work."
              },
              "grantedScopes": {
                "maxItems": 64,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "description": "The connection scopes the owner has actually granted."
              },
              "checkedAt": {
                "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 availability was last checked, when it has been."
              },
              "expiresAt": {
                "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 availability check expires and must be re-checked, when it has an expiry."
              },
              "reason": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 2048
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why this source is not available, when it is not."
              }
            },
            "required": [
              "status",
              "configured",
              "verified",
              "grantedScopes",
              "checkedAt",
              "expiresAt",
              "reason"
            ],
            "description": "This owner's ability to use this source right now: whether it is connected and verified. Carries no credential, account or provider connection identifier."
          }
        },
        "required": [
          "id",
          "version",
          "label",
          "description",
          "semanticIdentity",
          "schemaFingerprint",
          "configSchema",
          "fields",
          "public",
          "requiredConnectionScopes",
          "supportedSubjects",
          "guarantees",
          "availability"
        ],
        "description": "One event source an automation may watch: its configuration schema, its data fields, and this owner's current ability to use it."
      },
      "AutomationMonitoring": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "waiting",
              "healthy",
              "stale",
              "unavailable",
              "paused",
              "completed"
            ],
            "description": "The automation's overall monitoring status: `waiting` no evaluation yet, `healthy` sources and evaluation are current, `stale` an input is older than expected, `unavailable` a source could not be reached, `paused` firing is paused, `completed` its run policy is spent. A news exit (`rule.news`) reads `healthy` while Fin's news judge checks the news for it and `unavailable` while news checks are paused for its owner."
          },
          "lastCheckedAt": {
            "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 monitoring last checked this automation's sources."
          },
          "sources": {
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "binding": {
                  "type": "string",
                  "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                  "description": "The binding name a rule or a plan gives one configured source."
                },
                "sourceId": {
                  "type": "string",
                  "description": "The source's id within its provider."
                },
                "check": {
                  "description": "The most recent recipe check against this source, when evidence review is configured.",
                  "type": "object",
                  "properties": {
                    "recipe": {
                      "type": "object",
                      "properties": {
                        "version": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991,
                          "description": "The recipe description's own version, bumped when its steps change."
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120,
                          "description": "The recipe's short label, for the reviewed catalog."
                        },
                        "summary": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 600,
                          "description": "What the recipe does, for the reviewed catalog."
                        },
                        "steps": {
                          "minItems": 1,
                          "maxItems": 12,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-z][a-z0-9_-]{0,47}$",
                                "description": "The step's identifier, unique within its recipe."
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "request",
                                  "validate",
                                  "calculate"
                                ],
                                "description": "What this step does: `request` calls the provider, `validate` checks what it returned, `calculate` derives a value from earlier steps."
                              },
                              "title": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 120,
                                "description": "The step's short label, for the reviewed catalog."
                              },
                              "description": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 600,
                                "description": "What this step does, for the reviewed catalog."
                              },
                              "api": {
                                "type": "object",
                                "properties": {
                                  "method": {
                                    "type": "string",
                                    "enum": [
                                      "GET",
                                      "POST",
                                      "GRAPHQL"
                                    ],
                                    "description": "The request's method or protocol."
                                  },
                                  "resource": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 160,
                                    "pattern": "^\\/?[A-Za-z0-9_{}][A-Za-z0-9_./{} -]*$",
                                    "description": "The request's path or resource name."
                                  }
                                },
                                "required": [
                                  "method",
                                  "resource"
                                ],
                                "description": "The request this step makes, when it calls the provider."
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "title",
                              "description"
                            ]
                          },
                          "description": "The recipe's steps, in order."
                        },
                        "limitations": {
                          "maxItems": 6,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 600
                          },
                          "description": "What the recipe does not cover, in the reviewer's own words."
                        },
                        "fingerprint": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$",
                          "description": "A content hash identifying this exact recipe, independent of execution or connection identity."
                        }
                      },
                      "required": [
                        "version",
                        "title",
                        "summary",
                        "steps",
                        "limitations",
                        "fingerprint"
                      ],
                      "description": "A reviewed, public description of how a source is collected: the steps a reviewer confirmed, never an executable request or a resolved private endpoint."
                    },
                    "startedAt": {
                      "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 check began."
                    },
                    "completedAt": {
                      "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 check finished."
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "completed",
                        "failed"
                      ],
                      "description": "Whether every step completed."
                    },
                    "steps": {
                      "maxItems": 12,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "stepId": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_-]{0,47}$",
                            "description": "The declared recipe step this check reports on."
                          },
                          "outcome": {
                            "type": "string",
                            "enum": [
                              "completed",
                              "failed"
                            ],
                            "description": "Whether the step completed or failed."
                          },
                          "requestCount": {
                            "description": "How many requests this step made, when it made any.",
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 100000
                          },
                          "itemCount": {
                            "description": "How many items this step processed, when counting applies.",
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 1000000
                          },
                          "durationMs": {
                            "description": "How long this step took, in milliseconds.",
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 600000
                          },
                          "reason": {
                            "description": "Why the step failed, when it did: `not_configured` the source lacks a needed setting, `unavailable` the provider did not answer, `malformed` its answer could not be read, `oversized` the answer exceeded a bound, `stale` or `future` a timestamp was out of range, `incomplete` part of the answer was missing, `invalid` the answer failed validation, `canceled` the check was stopped before finishing.",
                            "type": "string",
                            "enum": [
                              "not_configured",
                              "unavailable",
                              "malformed",
                              "oversized",
                              "stale",
                              "future",
                              "incomplete",
                              "invalid",
                              "canceled"
                            ]
                          }
                        },
                        "required": [
                          "stepId",
                          "outcome"
                        ],
                        "description": "One recipe step's recorded outcome: counts and a closed reason only, never a URL, body, cursor, address or error message."
                      },
                      "description": "Each step's own recorded outcome, in order."
                    }
                  },
                  "required": [
                    "recipe",
                    "startedAt",
                    "completedAt",
                    "status",
                    "steps"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "waiting",
                    "healthy",
                    "stale",
                    "unavailable"
                  ],
                  "description": "This source's health: `waiting` no observation yet, `healthy` fresh, `stale` older than expected, `unavailable` the provider could not be reached."
                },
                "sourceTime": {
                  "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 provider says the most recent observation was true."
                },
                "receivedAt": {
                  "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 engine received the most recent observation."
                },
                "reason": {
                  "description": "Why the source is not healthy, when it is not.",
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "binding",
                "sourceId",
                "status",
                "sourceTime",
                "receivedAt",
                "reason"
              ]
            },
            "description": "Each bound source's own health."
          },
          "lastEvaluation": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "verdict": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false",
                      "unknown"
                    ],
                    "description": "Whether the condition holds: `true` it matches, `false` it does not, `unknown` usable input is missing. Firing policy, delivery, admission, budget and approvals separately decide whether matching can execute."
                  },
                  "evaluatedAt": {
                    "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 evaluation ran."
                  },
                  "reasons": {
                    "maxItems": 256,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "nodePath": {
                          "maxItems": 8,
                          "type": "array",
                          "items": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "description": "The path to the condition node this reason explains, as indices into the rule tree."
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "missing_source",
                            "unavailable",
                            "gap",
                            "stale",
                            "future",
                            "missing_field",
                            "invalid_value",
                            "snapshot_skew"
                          ],
                          "description": "Why this node could not cleanly resolve: `missing_source` no binding was configured, `unavailable` the provider did not answer, `gap` a break in coverage was recorded, `stale` or `future` a timestamp was out of range, `missing_field` the observation lacked this field, `invalid_value` the value did not match its declared type, `snapshot_skew` the inputs disagreed on when they were true."
                        },
                        "binding": {
                          "type": "string",
                          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                          "description": "The binding name a rule or a plan gives one configured source."
                        }
                      },
                      "required": [
                        "nodePath",
                        "code"
                      ]
                    },
                    "description": "Why the verdict is what it is, one entry per condition node that did not cleanly resolve."
                  },
                  "inputs": {
                    "maxItems": 5,
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "binding": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                              "description": "The binding name a rule or a plan gives one configured source."
                            },
                            "sourceId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128,
                              "description": "The source's id within its provider."
                            },
                            "eventId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128,
                              "description": "The observation or event's id."
                            },
                            "receivedAt": {
                              "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 engine received this observation."
                            },
                            "maxAgeSeconds": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991,
                              "description": "How old this observation was allowed to be at evaluation, in seconds."
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "ready",
                                "unavailable",
                                "gap"
                              ],
                              "description": "Whether this input was ready to evaluate, the provider was unavailable, or a gap was recorded instead."
                            },
                            "reason": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 512
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Why the input is not ready, when it is not."
                            },
                            "kind": {
                              "type": "string",
                              "const": "snapshot",
                              "description": "A point-in-time read of current state."
                            },
                            "sourceTime": {
                              "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 provider says this snapshot was true."
                            }
                          },
                          "required": [
                            "binding",
                            "sourceId",
                            "eventId",
                            "receivedAt",
                            "maxAgeSeconds",
                            "status",
                            "reason",
                            "kind",
                            "sourceTime"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "binding": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                              "description": "The binding name a rule or a plan gives one configured source."
                            },
                            "sourceId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128,
                              "description": "The source's id within its provider."
                            },
                            "eventId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128,
                              "description": "The observation or event's id."
                            },
                            "receivedAt": {
                              "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 engine received this observation."
                            },
                            "maxAgeSeconds": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991,
                              "description": "How old this observation was allowed to be at evaluation, in seconds."
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "ready",
                                "unavailable",
                                "gap"
                              ],
                              "description": "Whether this input was ready to evaluate, the provider was unavailable, or a gap was recorded instead."
                            },
                            "reason": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 512
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Why the input is not ready, when it is not."
                            },
                            "kind": {
                              "type": "string",
                              "const": "received_event",
                              "description": "An event the source pushed, or the engine collected as it happened."
                            },
                            "sourceTime": {
                              "type": "null",
                              "description": "Not applicable to a received event; see `occurredAt` and `providerPublishedAt` instead."
                            },
                            "providerPublishedAt": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 64,
                                  "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "When the provider says it published this event, when it reports one."
                            },
                            "occurredAt": {
                              "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 event actually happened, when the provider reports that separately from when it was published."
                            },
                            "finalizedAt": {
                              "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 provider considers this event no longer subject to correction, when it reports one."
                            }
                          },
                          "required": [
                            "binding",
                            "sourceId",
                            "eventId",
                            "receivedAt",
                            "maxAgeSeconds",
                            "status",
                            "reason",
                            "kind",
                            "sourceTime",
                            "providerPublishedAt",
                            "occurredAt",
                            "finalizedAt"
                          ]
                        }
                      ]
                    },
                    "description": "Each input this evaluation read, without its raw data."
                  }
                },
                "required": [
                  "verdict",
                  "evaluatedAt",
                  "reasons",
                  "inputs"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The rule's most recent evaluation, when it has run at least once."
          },
          "webhook": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "configured": {
                    "type": "boolean",
                    "description": "Whether a webhook secret has been minted."
                  },
                  "keyId": {
                    "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 current webhook secret's id, for rotation."
                  },
                  "lastReceivedAt": {
                    "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 webhook last received a request."
                  }
                },
                "required": [
                  "configured",
                  "keyId",
                  "lastReceivedAt"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "This automation's owner webhook, when its rule has one; null for a news exit."
          },
          "reason": {
            "description": "Why status is not healthy, when it is not.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "status",
          "lastCheckedAt",
          "sources",
          "lastEvaluation",
          "webhook",
          "reason"
        ],
        "description": "An automation's current health: its sources, its most recent evaluation, and its inbound webhook, if it has one."
      },
      "Automation": {
        "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 automation's id."
          },
          "definitionVersion": {
            "description": "The saved revision number. Use it to ignore older cached reads after chat edits. This server always returns it; earlier servers may omit it.",
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "name": {
            "type": "string",
            "description": "The automation's name."
          },
          "prompt": {
            "type": "string",
            "description": "The instructions given to the model each time this automation fires."
          },
          "rule": {
            "$ref": "#/components/schemas/AutomationRule"
          },
          "missedRun": {
            "type": "string",
            "enum": [
              "skip",
              "ask"
            ],
            "description": "What happens to a run that can't go through before its deadline: `skip` counts it and keeps the schedule, `ask` pauses the automation until its owner decides. A failure only the owner can fix pauses either way."
          },
          "summary": {
            "type": "string",
            "description": "When the automation runs, in one readable sentence or two: its condition, then its schedule and run limit. Times are in UTC unless the schedule names its own time zone."
          },
          "sourcePlans": {
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "binding": {
                  "type": "string",
                  "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                  "description": "The binding name a rule or a plan gives one configured source."
                },
                "result": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "const": "ready",
                          "description": "The binding is fully planned and ready to collect."
                        },
                        "plan": {
                          "type": "object",
                          "properties": {
                            "operationId": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9_.-]{0,79}$",
                              "description": "The collection operation this plan uses."
                            },
                            "operationVersion": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991,
                              "description": "The collection operation's version."
                            },
                            "descriptorFingerprint": {
                              "type": "string",
                              "pattern": "^[a-f0-9]{64}$",
                              "description": "A content hash of the source descriptor this plan was built from."
                            },
                            "config": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/components/schemas/AutomationJsonValue"
                              },
                              "description": "Arbitrary JSON data: an event's data, a reader's configuration, or a source plan's configuration. Bounded to 16 KiB, 8 levels of nesting and 256 entries."
                            },
                            "requirement": {
                              "type": "object",
                              "properties": {
                                "maxLatencySeconds": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 2147483
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "The target delay between an observation and its delivery, in seconds; null when delivery has no target deadline."
                                },
                                "maxAgeSeconds": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 86400,
                                  "description": "Maximum acceptable input age at evaluation, matching the reader's maxAgeSeconds, measured from the provider's own observation time. The selected provider's acquisition guarantee must fit within this limit and does not reduce this evaluation window."
                                },
                                "allowDegradedLatency": {
                                  "type": "boolean",
                                  "description": "Whether delivery slower than the target delay is still accepted."
                                },
                                "maxAcceptedLatencySeconds": {
                                  "description": "The slowest delivery still accepted, in seconds, when `allowDegradedLatency` is set.",
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2147483
                                }
                              },
                              "required": [
                                "maxLatencySeconds",
                                "maxAgeSeconds",
                                "allowDegradedLatency"
                              ],
                              "description": "What a reader needs from its source: how fresh an answer must be, and whether a slower one is still acceptable."
                            },
                            "guarantees": {
                              "type": "object",
                              "properties": {
                                "delivery": {
                                  "description": "Push delivery; absent means polling.",
                                  "type": "string",
                                  "const": "push"
                                },
                                "minCadenceSeconds": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 2147483,
                                  "description": "The shortest interval between requests the provider permits, in seconds."
                                },
                                "expectedLatencySeconds": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 2147483
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "How stale the provider's own value may be when it answers, in seconds; null when the provider establishes no bound. A reader with a delivery deadline cannot use a source that promises nothing here."
                                },
                                "maxAgeSeconds": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 2147483,
                                  "description": "Maximum snapshot observation age accepted at collection. This acquisition guarantee does not shorten a reader's separately declared evaluation-age window."
                                },
                                "requestsPerMinute": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "The provider's own rate limit for this source, when it publishes one."
                                },
                                "observationReuseSeconds": {
                                  "description": "How long one provider observation may serve every reader watching the same subject under the same connection, in seconds. Absent or 0 means each reader causes its own request. A reused observation keeps the provider's own `sourceTime`, so declared freshness still governs; what reuse changes is how often the provider is asked, not how old an accepted observation may be. Keep it at or below the cadence readers are expected to poll at.",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 2147483
                                },
                                "batchLimit": {
                                  "description": "How many distinct subjects the provider can serve in one request. Absent or 1 means no batching. Only providers implementing `readBatch` may declare more: the framework cannot infer that an API accepts several subjects.",
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 1000
                                }
                              },
                              "required": [
                                "minCadenceSeconds",
                                "expectedLatencySeconds",
                                "maxAgeSeconds",
                                "requestsPerMinute"
                              ],
                              "description": "What an operation promises about the snapshots it serves: cadence, freshness and how many subjects it can batch. Describes sampled state; nothing here promises that a change between two polls was seen."
                            },
                            "scopeKind": {
                              "type": "string",
                              "enum": [
                                "public",
                                "user"
                              ],
                              "description": "Who this binding is scoped to: `public` data anyone can read, `user` data read under the owner's own connection."
                            },
                            "explanation": {
                              "type": "string",
                              "maxLength": 2048,
                              "description": "Why this plan was chosen, in the reviewer's own words."
                            },
                            "recipe": {
                              "type": "object",
                              "properties": {
                                "version": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991,
                                  "description": "The recipe description's own version, bumped when its steps change."
                                },
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 120,
                                  "description": "The recipe's short label, for the reviewed catalog."
                                },
                                "summary": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 600,
                                  "description": "What the recipe does, for the reviewed catalog."
                                },
                                "steps": {
                                  "minItems": 1,
                                  "maxItems": 12,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "pattern": "^[a-z][a-z0-9_-]{0,47}$",
                                        "description": "The step's identifier, unique within its recipe."
                                      },
                                      "kind": {
                                        "type": "string",
                                        "enum": [
                                          "request",
                                          "validate",
                                          "calculate"
                                        ],
                                        "description": "What this step does: `request` calls the provider, `validate` checks what it returned, `calculate` derives a value from earlier steps."
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 120,
                                        "description": "The step's short label, for the reviewed catalog."
                                      },
                                      "description": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 600,
                                        "description": "What this step does, for the reviewed catalog."
                                      },
                                      "api": {
                                        "type": "object",
                                        "properties": {
                                          "method": {
                                            "type": "string",
                                            "enum": [
                                              "GET",
                                              "POST",
                                              "GRAPHQL"
                                            ],
                                            "description": "The request's method or protocol."
                                          },
                                          "resource": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 160,
                                            "pattern": "^\\/?[A-Za-z0-9_{}][A-Za-z0-9_./{} -]*$",
                                            "description": "The request's path or resource name."
                                          }
                                        },
                                        "required": [
                                          "method",
                                          "resource"
                                        ],
                                        "description": "The request this step makes, when it calls the provider."
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "kind",
                                      "title",
                                      "description"
                                    ]
                                  },
                                  "description": "The recipe's steps, in order."
                                },
                                "limitations": {
                                  "maxItems": 6,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 600
                                  },
                                  "description": "What the recipe does not cover, in the reviewer's own words."
                                },
                                "fingerprint": {
                                  "type": "string",
                                  "pattern": "^[a-f0-9]{64}$",
                                  "description": "A content hash identifying this exact recipe, independent of execution or connection identity."
                                }
                              },
                              "required": [
                                "version",
                                "title",
                                "summary",
                                "steps",
                                "limitations",
                                "fingerprint"
                              ],
                              "description": "A reviewed, public description of how a source is collected: the steps a reviewer confirmed, never an executable request or a resolved private endpoint."
                            },
                            "degraded": {
                              "type": "boolean",
                              "description": "Whether this plan settled for weaker guarantees than the rule asked for."
                            }
                          },
                          "required": [
                            "operationId",
                            "operationVersion",
                            "descriptorFingerprint",
                            "config",
                            "requirement",
                            "guarantees",
                            "scopeKind",
                            "explanation",
                            "degraded"
                          ],
                          "description": "How one binding will actually be collected: the operation, its guarantees and its configuration."
                        }
                      },
                      "required": [
                        "status",
                        "plan"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "const": "needs_connection",
                          "description": "The binding is plannable but needs a connection the owner has not granted yet."
                        },
                        "candidatePlan": {
                          "type": "object",
                          "properties": {
                            "operationId": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9_.-]{0,79}$",
                              "description": "The collection operation this plan uses."
                            },
                            "operationVersion": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991,
                              "description": "The collection operation's version."
                            },
                            "descriptorFingerprint": {
                              "type": "string",
                              "pattern": "^[a-f0-9]{64}$",
                              "description": "A content hash of the source descriptor this plan was built from."
                            },
                            "config": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/components/schemas/AutomationJsonValue"
                              },
                              "description": "Arbitrary JSON data: an event's data, a reader's configuration, or a source plan's configuration. Bounded to 16 KiB, 8 levels of nesting and 256 entries."
                            },
                            "requirement": {
                              "type": "object",
                              "properties": {
                                "maxLatencySeconds": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 2147483
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "The target delay between an observation and its delivery, in seconds; null when delivery has no target deadline."
                                },
                                "maxAgeSeconds": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 86400,
                                  "description": "Maximum acceptable input age at evaluation, matching the reader's maxAgeSeconds, measured from the provider's own observation time. The selected provider's acquisition guarantee must fit within this limit and does not reduce this evaluation window."
                                },
                                "allowDegradedLatency": {
                                  "type": "boolean",
                                  "description": "Whether delivery slower than the target delay is still accepted."
                                },
                                "maxAcceptedLatencySeconds": {
                                  "description": "The slowest delivery still accepted, in seconds, when `allowDegradedLatency` is set.",
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2147483
                                }
                              },
                              "required": [
                                "maxLatencySeconds",
                                "maxAgeSeconds",
                                "allowDegradedLatency"
                              ],
                              "description": "What a reader needs from its source: how fresh an answer must be, and whether a slower one is still acceptable."
                            },
                            "guarantees": {
                              "type": "object",
                              "properties": {
                                "delivery": {
                                  "description": "Push delivery; absent means polling.",
                                  "type": "string",
                                  "const": "push"
                                },
                                "minCadenceSeconds": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 2147483,
                                  "description": "The shortest interval between requests the provider permits, in seconds."
                                },
                                "expectedLatencySeconds": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 2147483
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "How stale the provider's own value may be when it answers, in seconds; null when the provider establishes no bound. A reader with a delivery deadline cannot use a source that promises nothing here."
                                },
                                "maxAgeSeconds": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 2147483,
                                  "description": "Maximum snapshot observation age accepted at collection. This acquisition guarantee does not shorten a reader's separately declared evaluation-age window."
                                },
                                "requestsPerMinute": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "The provider's own rate limit for this source, when it publishes one."
                                },
                                "observationReuseSeconds": {
                                  "description": "How long one provider observation may serve every reader watching the same subject under the same connection, in seconds. Absent or 0 means each reader causes its own request. A reused observation keeps the provider's own `sourceTime`, so declared freshness still governs; what reuse changes is how often the provider is asked, not how old an accepted observation may be. Keep it at or below the cadence readers are expected to poll at.",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 2147483
                                },
                                "batchLimit": {
                                  "description": "How many distinct subjects the provider can serve in one request. Absent or 1 means no batching. Only providers implementing `readBatch` may declare more: the framework cannot infer that an API accepts several subjects.",
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 1000
                                }
                              },
                              "required": [
                                "minCadenceSeconds",
                                "expectedLatencySeconds",
                                "maxAgeSeconds",
                                "requestsPerMinute"
                              ],
                              "description": "What an operation promises about the snapshots it serves: cadence, freshness and how many subjects it can batch. Describes sampled state; nothing here promises that a change between two polls was seen."
                            },
                            "scopeKind": {
                              "type": "string",
                              "enum": [
                                "public",
                                "user"
                              ],
                              "description": "Who this binding is scoped to: `public` data anyone can read, `user` data read under the owner's own connection."
                            },
                            "explanation": {
                              "type": "string",
                              "maxLength": 2048,
                              "description": "Why this plan was chosen, in the reviewer's own words."
                            },
                            "recipe": {
                              "type": "object",
                              "properties": {
                                "version": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991,
                                  "description": "The recipe description's own version, bumped when its steps change."
                                },
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 120,
                                  "description": "The recipe's short label, for the reviewed catalog."
                                },
                                "summary": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 600,
                                  "description": "What the recipe does, for the reviewed catalog."
                                },
                                "steps": {
                                  "minItems": 1,
                                  "maxItems": 12,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "pattern": "^[a-z][a-z0-9_-]{0,47}$",
                                        "description": "The step's identifier, unique within its recipe."
                                      },
                                      "kind": {
                                        "type": "string",
                                        "enum": [
                                          "request",
                                          "validate",
                                          "calculate"
                                        ],
                                        "description": "What this step does: `request` calls the provider, `validate` checks what it returned, `calculate` derives a value from earlier steps."
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 120,
                                        "description": "The step's short label, for the reviewed catalog."
                                      },
                                      "description": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 600,
                                        "description": "What this step does, for the reviewed catalog."
                                      },
                                      "api": {
                                        "type": "object",
                                        "properties": {
                                          "method": {
                                            "type": "string",
                                            "enum": [
                                              "GET",
                                              "POST",
                                              "GRAPHQL"
                                            ],
                                            "description": "The request's method or protocol."
                                          },
                                          "resource": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 160,
                                            "pattern": "^\\/?[A-Za-z0-9_{}][A-Za-z0-9_./{} -]*$",
                                            "description": "The request's path or resource name."
                                          }
                                        },
                                        "required": [
                                          "method",
                                          "resource"
                                        ],
                                        "description": "The request this step makes, when it calls the provider."
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "kind",
                                      "title",
                                      "description"
                                    ]
                                  },
                                  "description": "The recipe's steps, in order."
                                },
                                "limitations": {
                                  "maxItems": 6,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 600
                                  },
                                  "description": "What the recipe does not cover, in the reviewer's own words."
                                },
                                "fingerprint": {
                                  "type": "string",
                                  "pattern": "^[a-f0-9]{64}$",
                                  "description": "A content hash identifying this exact recipe, independent of execution or connection identity."
                                }
                              },
                              "required": [
                                "version",
                                "title",
                                "summary",
                                "steps",
                                "limitations",
                                "fingerprint"
                              ],
                              "description": "A reviewed, public description of how a source is collected: the steps a reviewer confirmed, never an executable request or a resolved private endpoint."
                            },
                            "degraded": {
                              "type": "boolean",
                              "description": "Whether this plan settled for weaker guarantees than the rule asked for."
                            }
                          },
                          "required": [
                            "operationId",
                            "operationVersion",
                            "descriptorFingerprint",
                            "config",
                            "requirement",
                            "guarantees",
                            "scopeKind",
                            "explanation",
                            "degraded"
                          ],
                          "description": "The plan that would apply once the missing connection is granted."
                        },
                        "reasons": {
                          "minItems": 1,
                          "maxItems": 32,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80,
                                "description": "A machine-readable reason code."
                              },
                              "path": {
                                "description": "The field this reason is about, when it is about one.",
                                "type": "string",
                                "maxLength": 256
                              },
                              "message": {
                                "type": "string",
                                "maxLength": 2048,
                                "description": "The reason, in the reviewer's own words."
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ]
                          },
                          "description": "Why this binding could not be planned as asked."
                        }
                      },
                      "required": [
                        "status",
                        "candidatePlan",
                        "reasons"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "const": "unsupported",
                          "description": "The binding cannot be planned at all, as asked."
                        },
                        "reasons": {
                          "minItems": 1,
                          "maxItems": 32,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80,
                                "description": "A machine-readable reason code."
                              },
                              "path": {
                                "description": "The field this reason is about, when it is about one.",
                                "type": "string",
                                "maxLength": 256
                              },
                              "message": {
                                "type": "string",
                                "maxLength": 2048,
                                "description": "The reason, in the reviewer's own words."
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ]
                          },
                          "description": "Why this binding could not be planned as asked."
                        }
                      },
                      "required": [
                        "status",
                        "reasons"
                      ]
                    }
                  ],
                  "description": "Whether this binding is ready, needs a connection, or is unsupported, and why."
                }
              },
              "required": [
                "binding",
                "result"
              ]
            },
            "description": "How each of the rule's bindings will actually be collected."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether this automation is active: false while it is paused and once deleted."
          },
          "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 automation was created."
          },
          "updatedAt": {
            "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 automation was last changed."
          },
          "deletedAt": {
            "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 automation was deleted; null while it exists."
          },
          "hold": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "at": {
                    "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 hold began."
                  },
                  "reason": {
                    "description": "Why an operator placed the hold, when they gave one.",
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "at",
                  "reason"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "An operator's hold: why future work is stopped, so the owner does not read it as their own doing."
          },
          "waitingForOwner": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "add_funds",
                      "edit_automation",
                      "decide",
                      "resume"
                    ],
                    "description": "What it needs: `add_funds`, `edit_automation`, `decide` whether to act now or keep it as it is, or `resume`: it can no longer read the data it watches until the owner resumes it, which reads that data afresh."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Why it stopped, one of the reasons a run gives: see `reason` on the automation run. A `resume` gives `unavailable`."
                  },
                  "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)$"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "The automation run it paused over, or null for a `resume`, which no run caused."
                  },
                  "since": {
                    "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 it paused."
                  }
                },
                "required": [
                  "action",
                  "reason",
                  "runId",
                  "since"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "When fin paused this automation because only the owner can move it on: what it needs, and the run it stopped at when a run caused it. Null otherwise, including while the owner paused it themselves. Resuming clears it."
          },
          "runCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "How many numbered runs it has had, the number its latest numbered run's `runNumber` reached. Exits and skipped checks are not counted."
          },
          "skippedRunCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "How many of its runs were skipped: each failed, counted toward the run limit, and left the schedule as it was. A run it paused over is not one of them."
          },
          "harvestCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "How many times it has taken a gain: harvest runs that settled at least in part. A run that failed, is uncertain or found nothing to trade isn't counted. Zero for an automation that doesn't harvest."
          },
          "nextFireAt": {
            "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 automation's clock will next wake it, when it has a schedule and is enabled."
          },
          "monitoring": {
            "$ref": "#/components/schemas/AutomationMonitoring"
          },
          "activeRun": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AutomationRun"
              },
              {
                "type": "null"
              }
            ],
            "description": "The automation run in progress or waiting to start, when there is one."
          },
          "latestRun": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AutomationRun"
              },
              {
                "type": "null"
              }
            ],
            "description": "The most recent automation run, finished or not, when there has been one."
          },
          "contract": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "terms": {
                    "oneOf": [
                      {
                        "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"
                        ]
                      },
                      {
                        "$ref": "#/components/schemas/PerpsAutomationContract"
                      },
                      {
                        "$ref": "#/components/schemas/PredictionAutomationContract"
                      },
                      {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/SolanaBuyContract"
                          },
                          {
                            "$ref": "#/components/schemas/SolanaSellContract"
                          }
                        ],
                        "description": "A standing Solana grant: an exact buy, or a sale of a fraction of the holding for USDC, made exactly as approved each time the automation fires."
                      }
                    ],
                    "description": "The approved contract's exact terms."
                  },
                  "approvedAt": {
                    "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 owner approved this contract."
                  },
                  "revokedAt": {
                    "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 contract was withdrawn, when it has been."
                  },
                  "executionsUsed": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991,
                    "description": "Executions that consumed the allowance. For a transfer contract, entry plans from the plan and leg ledger: an exit plan is exempt and never counted. For a perps automation, the firings whose exact order or funding was submitted. For a Solana grant, the firings whose trade or funding got past its first claim to sign."
                  },
                  "spendUsed": {
                    "maxItems": 16,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tokenId": {
                          "type": "string",
                          "minLength": 1,
                          "description": "A capped input token of the approved contract."
                        },
                        "decimals": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 38,
                          "description": "That token's decimals, copied from the approved cap."
                        },
                        "spentRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9]\\d{0,38})$",
                          "description": "What the grant has spent of that token, raw. Claimed, signed, uncertain, settled and not-executed legs count, because a not-executed ending can follow a consumed deposit; only a refunded leg releases its part. The policy worker enforces the cap too and counts every debit it signed, refunded or not, so after a refund the room it grants can be smaller than this figure suggests."
                        }
                      },
                      "required": [
                        "tokenId",
                        "decimals",
                        "spentRaw"
                      ]
                    },
                    "description": "One entry for each capped input token, in the contract's order; empty when the contract has no total cap. The cap itself is terms.maxTotalInput, so the cap minus this is the most that is left: the policy worker, which signs, counts every debit it signed, refunded or not."
                  },
                  "settledSpend": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tokenId": {
                          "type": "string",
                          "minLength": 1,
                          "description": "A capped input token of the approved contract."
                        },
                        "decimals": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 38,
                          "description": "That token's decimals, copied from the approved cap."
                        },
                        "spentRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9]\\d{0,38})$",
                          "description": "What has settled of that token, raw. Only settled legs count: nothing in flight, uncertain or not executed. A refunded leg counts nothing, a partly refunded one included, even though part of it may have been spent."
                        }
                      },
                      "required": [
                        "tokenId",
                        "decimals",
                        "spentRaw"
                      ]
                    },
                    "description": "What has actually settled of each capped input token, in the same shape as `spendUsed`: show this as what the automation spent, and `spendUsed` for what room is left. Unlike `spendUsed` it leaves out legs still in flight, uncertain, not executed or refunded. An edited grant's figure includes what it carried over, which can hold a not-executed debit from before the edit."
                  }
                },
                "required": [
                  "terms",
                  "approvedAt",
                  "revokedAt",
                  "executionsUsed",
                  "spendUsed",
                  "settledSpend"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The standing financial authority this automation's engine-fired runs execute under; null for an automation without one."
          }
        },
        "required": [
          "id",
          "name",
          "prompt",
          "rule",
          "missedRun",
          "summary",
          "sourcePlans",
          "enabled",
          "createdAt",
          "updatedAt",
          "deletedAt",
          "hold",
          "waitingForOwner",
          "runCount",
          "skippedRunCount",
          "harvestCount",
          "nextFireAt",
          "monitoring",
          "activeRun",
          "latestRun",
          "contract"
        ],
        "description": "One automation: its rule and a readable summary of it, its current sources, its monitoring health, and its runs."
      },
      "BasketSummary": {
        "type": "object",
        "properties": {
          "basketId": {
            "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)$"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "idea": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "buying",
              "bought",
              "partly_bought",
              "not_bought"
            ],
            "description": "`draft`: proposed, not bought. `buying`: approved and its pieces are running. `bought`: every piece done, or every step that did not buy later linked to an order that stands in for it. `partly_bought`: some pieces done, others failed or skipped. `not_bought`: approved but nothing was bought, or the approval was declined or expired."
          },
          "revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "The latest revision, or the one bought."
          },
          "budgetUsdc": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,6})?$",
            "description": "An exact USDC amount as a decimal string with at most six fraction digits."
          },
          "costUsdc": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,6})?$",
                "description": "An exact USDC amount as a decimal string with at most six fraction digits."
              },
              {
                "type": "null"
              }
            ],
            "description": "The USDC the basket's executed pieces paid; null before anything was bought."
          },
          "valueUsdc": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,6})?$",
                "description": "An exact USDC amount as a decimal string with at most six fraction digits."
              },
              {
                "type": "null"
              }
            ],
            "description": "What the bought positions are worth now, at current prices, plus unused venue money; null when nothing was bought or no price is available."
          },
          "changeUsdc": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?(0|[1-9]\\d{0,17})(\\.\\d{1,6})?$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Value less cost, in USDC; negative for a loss. Null when either is null."
          },
          "allocation": {
            "maxItems": 12,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "theme": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 60
                },
                "weightBps": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "theme",
                "weightBps"
              ]
            },
            "description": "The basket's themes and their shares, in basis points."
          },
          "venues": {
            "maxItems": 3,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "intents",
                "perps",
                "polymarket"
              ],
              "description": "Where a position is bought: `intents` (crypto and tokenized stocks through NEAR Intents), `perps` (a 1x isolated long or short on Hyperliquid) or `polymarket` (an outcome bought on Polymarket)."
            }
          },
          "unused": {
            "maxItems": 2,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "venue": {
                  "type": "string",
                  "enum": [
                    "hyperliquid",
                    "polymarket"
                  ]
                },
                "amountUsdc": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,6})?$",
                  "description": "An exact USDC amount as a decimal string with at most six fraction digits."
                },
                "withdrawTool": {
                  "type": "string",
                  "enum": [
                    "perps_withdraw",
                    "prediction_withdraw"
                  ]
                }
              },
              "required": [
                "venue",
                "amountUsdc",
                "withdrawTool"
              ]
            },
            "description": "Money a funding step moved to a venue that no order used, capped by what the venue holds now; withdrawing it is a separate approval."
          },
          "unusedUnavailable": {
            "maxItems": 2,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "hyperliquid",
                "polymarket"
              ]
            },
            "description": "Venues whose unused money could not be read; unavailable never means zero."
          },
          "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))$"
          },
          "boughtAt": {
            "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"
              }
            ]
          }
        },
        "required": [
          "basketId",
          "title",
          "idea",
          "status",
          "revision",
          "budgetUsdc",
          "costUsdc",
          "valueUsdc",
          "changeUsdc",
          "allocation",
          "venues",
          "unused",
          "unusedUnavailable",
          "createdAt",
          "boughtAt"
        ]
      },
      "BasketLinkableOrder": {
        "type": "object",
        "properties": {
          "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 order's id; pass it to link the order to the step."
          },
          "quantity": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
              },
              "unit": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              }
            },
            "required": [
              "amount",
              "unit"
            ],
            "description": "What the order received: contracts of a perps market, or shares of an outcome."
          },
          "costUsdc": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,6})?$",
                "description": "An exact USDC amount as a decimal string with at most six fraction digits."
              },
              {
                "type": "null"
              }
            ],
            "description": "What it paid in USDC at its fill price; null when no price was recorded."
          },
          "placedAt": {
            "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))$"
          }
        },
        "required": [
          "operationId",
          "quantity",
          "costUsdc",
          "placedAt"
        ]
      },
      "BasketPerformance": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "estimate",
              "actual"
            ]
          },
          "asOf": {
            "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))$"
          },
          "startAt": {
            "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))$"
          },
          "endAt": {
            "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))$"
          },
          "chartPeriod": {
            "type": "string",
            "enum": [
              "7d",
              "since_bought"
            ]
          },
          "returnPctDecimal": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?(0|[1-9]\\d*)(\\.\\d+)?$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Percentage units: 4.2 means +4.2%, not 0.042. Null when coverage is incomplete."
          },
          "points": {
            "maxItems": 9,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "at": {
                  "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))$"
                },
                "returnPctDecimal": {
                  "type": "string",
                  "pattern": "^-?(0|[1-9]\\d*)(\\.\\d+)?$"
                }
              },
              "required": [
                "at",
                "returnPctDecimal"
              ]
            }
          },
          "positions": {
            "maxItems": 12,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "returnPctDecimal": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^-?(0|[1-9]\\d*)(\\.\\d+)?$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "leverageDecimal": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^-?(0|[1-9]\\d*)(\\.\\d+)?$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "stored_token_closes",
                    "hyperliquid_candles",
                    "polymarket_clob",
                    "basket_valuation"
                  ]
                }
              },
              "required": [
                "index",
                "returnPctDecimal",
                "leverageDecimal",
                "source"
              ]
            }
          },
          "fundingIncluded": {
            "type": "boolean",
            "description": "Actual inherits the valuation's recorded funding; estimates exclude funding."
          },
          "feesIncluded": {
            "type": "boolean",
            "description": "Actual inherits recorded costs and fees; estimates exclude fees."
          }
        },
        "required": [
          "mode",
          "asOf",
          "startAt",
          "endAt",
          "chartPeriod",
          "returnPctDecimal",
          "points",
          "positions",
          "fundingIncluded",
          "feesIncluded"
        ]
      },
      "Basket": {
        "type": "object",
        "properties": {
          "basketId": {
            "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)$"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "idea": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "buying",
              "bought",
              "partly_bought",
              "not_bought"
            ],
            "description": "`draft`: proposed, not bought. `buying`: approved and its pieces are running. `bought`: every piece done, or every step that did not buy later linked to an order that stands in for it. `partly_bought`: some pieces done, others failed or skipped. `not_bought`: approved but nothing was bought, or the approval was declined or expired."
          },
          "revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "The latest revision, or the one bought."
          },
          "budgetUsdc": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,6})?$",
            "description": "An exact USDC amount as a decimal string with at most six fraction digits."
          },
          "costUsdc": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,6})?$",
                "description": "An exact USDC amount as a decimal string with at most six fraction digits."
              },
              {
                "type": "null"
              }
            ],
            "description": "The USDC the basket's executed pieces paid; null before anything was bought."
          },
          "valueUsdc": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,6})?$",
                "description": "An exact USDC amount as a decimal string with at most six fraction digits."
              },
              {
                "type": "null"
              }
            ],
            "description": "What the bought positions are worth now, at current prices, plus unused venue money; null when nothing was bought or no price is available."
          },
          "changeUsdc": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?(0|[1-9]\\d{0,17})(\\.\\d{1,6})?$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Value less cost, in USDC; negative for a loss. Null when either is null."
          },
          "allocation": {
            "maxItems": 12,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "theme": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 60
                },
                "weightBps": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "theme",
                "weightBps"
              ]
            },
            "description": "The basket's themes and their shares, in basis points."
          },
          "venues": {
            "maxItems": 3,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "intents",
                "perps",
                "polymarket"
              ],
              "description": "Where a position is bought: `intents` (crypto and tokenized stocks through NEAR Intents), `perps` (a 1x isolated long or short on Hyperliquid) or `polymarket` (an outcome bought on Polymarket)."
            }
          },
          "unused": {
            "maxItems": 2,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "venue": {
                  "type": "string",
                  "enum": [
                    "hyperliquid",
                    "polymarket"
                  ]
                },
                "amountUsdc": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,6})?$",
                  "description": "An exact USDC amount as a decimal string with at most six fraction digits."
                },
                "withdrawTool": {
                  "type": "string",
                  "enum": [
                    "perps_withdraw",
                    "prediction_withdraw"
                  ]
                }
              },
              "required": [
                "venue",
                "amountUsdc",
                "withdrawTool"
              ]
            },
            "description": "Money a funding step moved to a venue that no order used, capped by what the venue holds now; withdrawing it is a separate approval."
          },
          "unusedUnavailable": {
            "maxItems": 2,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "hyperliquid",
                "polymarket"
              ]
            },
            "description": "Venues whose unused money could not be read; unavailable never means zero."
          },
          "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))$"
          },
          "boughtAt": {
            "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"
              }
            ]
          },
          "killCondition": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "cashKeptUsdc": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,6})?$",
            "description": "What the basket keeps back as cash in the agent wallet; it is not spent."
          },
          "steps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "How many steps the basket's one approval covers, funding moves included."
          },
          "approvedAt": {
            "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 owner approved the basket with one signature; null before then."
          },
          "holdings": {
            "maxItems": 12,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "theme": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 60
                },
                "venue": {
                  "type": "string",
                  "enum": [
                    "intents",
                    "perps",
                    "polymarket"
                  ],
                  "description": "Where a position is bought: `intents` (crypto and tokenized stocks through NEAR Intents), `perps` (a 1x isolated long or short on Hyperliquid) or `polymarket` (an outcome bought on Polymarket)."
                },
                "instrument": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200,
                      "description": "The instrument's exact id on its venue."
                    },
                    "symbol": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40,
                      "description": "Its short symbol, for display."
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200,
                      "description": "Its name, for display."
                    }
                  },
                  "required": [
                    "id",
                    "symbol",
                    "name"
                  ]
                },
                "outcome": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "side": {
                  "type": "string",
                  "enum": [
                    "buy",
                    "long",
                    "short"
                  ]
                },
                "weightBps": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "reason": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "bought",
                    "failed",
                    "skipped",
                    "not_bought"
                  ],
                  "description": "Whether the piece that buys this position executed."
                },
                "quantity": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "string",
                          "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                        },
                        "unit": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 40
                        }
                      },
                      "required": [
                        "amount",
                        "unit"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "What the piece received, from its recorded settlement; null when nothing was."
                },
                "costUsdc": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,6})?$",
                      "description": "An exact USDC amount as a decimal string with at most six fraction digits."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The USDC the basket's executed pieces paid; null before anything was bought."
                },
                "valueUsdc": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,6})?$",
                      "description": "An exact USDC amount as a decimal string with at most six fraction digits."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "What the bought positions are worth now, at current prices, plus unused venue money; null when nothing was bought or no price is available."
                },
                "changeUsdc": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^-?(0|[1-9]\\d{0,17})(\\.\\d{1,6})?$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Value less cost, in USDC; negative for a loss. Null when either is null."
                },
                "priceSource": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "market",
                        "cost"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "`market` when valued at a current price, `cost` when shown at what it paid because no reviewed price source is available."
                },
                "alsoHeldOutside": {
                  "type": "boolean",
                  "description": "The account holds a different amount of this instrument than the basket bought."
                },
                "linked": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "linked",
                        "finished"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Set when the basket's own step did not buy this position and an order stands in for it: `linked` when the user linked an order they placed, `finished` when an approval to finish the basket bought it. Null for a position the basket's own step bought, or one still unbought."
                }
              },
              "required": [
                "index",
                "theme",
                "venue",
                "instrument",
                "side",
                "weightBps",
                "reason",
                "state",
                "quantity",
                "costUsdc",
                "valueUsdc",
                "changeUsdc",
                "priceSource",
                "alsoHeldOutside",
                "linked"
              ]
            }
          },
          "failures": {
            "maxItems": 6,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "piece": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "description": "What the step does, in a few words."
                },
                "outcome": {
                  "type": "string",
                  "enum": [
                    "failed",
                    "skipped",
                    "not_executed"
                  ]
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 300
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "linkable": {
                  "maxItems": 10,
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BasketLinkableOrder"
                  },
                  "description": "Orders the user placed since the basket's result, for this step's instrument, side and terms, that no basket step holds yet; any of them can be linked to this step. Empty for a step no order can stand in for, such as a funding move."
                }
              },
              "required": [
                "piece",
                "label",
                "outcome",
                "reason",
                "linkable"
              ]
            },
            "description": "The buying steps that failed or were skipped, and why. A step linked to an order leaves this list."
          },
          "valuedAt": {
            "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"
              }
            ]
          },
          "performance": {
            "$ref": "#/components/schemas/BasketPerformance"
          }
        },
        "required": [
          "basketId",
          "title",
          "idea",
          "status",
          "revision",
          "budgetUsdc",
          "costUsdc",
          "valueUsdc",
          "changeUsdc",
          "allocation",
          "venues",
          "unused",
          "unusedUnavailable",
          "createdAt",
          "boughtAt",
          "killCondition",
          "cashKeptUsdc",
          "steps",
          "approvedAt",
          "holdings",
          "failures",
          "valuedAt",
          "performance"
        ]
      },
      "BasketPage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BasketSummary"
            },
            "description": "This page's rows."
          },
          "nextCursor": {
            "description": "The cursor for the next page; null once there are no more rows.",
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "description": "How many rows the list holds in all, when it is known.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "Grid": {
        "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 grid's id."
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "paused",
              "stopping",
              "stopped",
              "expired",
              "failed"
            ],
            "description": "`active`: cells place and re-arm. `paused`: no order rests and none is placed. `stopping`: its orders are being cancelled. `stopped`, `expired` and `failed` are final."
          },
          "stopReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "cancelled",
                  "expired",
                  "grant_revoked"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the grid is stopping or ended: `cancelled` by the user, `expired` at `validUntil`, or `grant_revoked`. `null` while it runs or is paused."
          },
          "terms": {
            "type": "object",
            "properties": {
              "base": {
                "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 base asset: token id and decimals."
                  }
                },
                "required": [
                  "pinned"
                ],
                "description": "The asset the grid buys low and sells high."
              },
              "quote": {
                "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 quote asset: token id and decimals."
                  }
                },
                "required": [
                  "pinned"
                ],
                "description": "The asset prices are in and buys are paid with."
              },
              "levels": {
                "minItems": 2,
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 80,
                  "pattern": "^(0|[1-9]\\d{0,38})(\\.\\d{1,38})?$"
                },
                "description": "The 2 to 20 grid prices, strictly ascending: quote units per ONE base unit, plain human decimals."
              },
              "quantityPerCell": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "The exact base amount every cell buys and sells, in the base asset's smallest unit. Fixed: profits never compound."
              },
              "cells": {
                "minItems": 1,
                "maxItems": 19,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "start": {
                      "type": "string",
                      "enum": [
                        "buy",
                        "idle"
                      ],
                      "description": "The side the cell's first order is on: buy at its low level, or idle (the cell never places)."
                    }
                  },
                  "required": [
                    "start"
                  ]
                },
                "description": "One entry per cell, lowest first (levels.length - 1 of them): cells wholly below the start price and the one straddling it buy, cells wholly above it stay idle."
              }
            },
            "required": [
              "base",
              "quote",
              "levels",
              "quantityPerCell",
              "cells"
            ],
            "description": "The exact terms the user approved; they never change."
          },
          "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 the grid ends and its last orders expire."
          },
          "cells": {
            "maxItems": 19,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 18,
                  "description": "The cell's position, lowest first."
                },
                "low": {
                  "type": "string",
                  "maxLength": 80,
                  "pattern": "^(0|[1-9]\\d{0,38})(\\.\\d{1,38})?$",
                  "description": "The level the cell buys at."
                },
                "high": {
                  "type": "string",
                  "maxLength": 80,
                  "pattern": "^(0|[1-9]\\d{0,38})(\\.\\d{1,38})?$",
                  "description": "The level the cell sells at."
                },
                "side": {
                  "type": "string",
                  "enum": [
                    "buy",
                    "sell",
                    "idle"
                  ],
                  "description": "The side the cell's next or current order is on, or `idle` for none."
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "idle",
                    "pending",
                    "placing",
                    "resting",
                    "stalled"
                  ],
                  "description": "`pending`: waits to place. `placing`: an order is being created and funded. `resting`: its order is at the provider. `idle`: places nothing. `stalled`: stopped re-placing after orders ended unfilled too often, or an ending it could not read; the rest of the grid keeps running."
                },
                "order": {
                  "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 order's `id`: read it with Get an order for its terms, fills and payouts."
                        },
                        "side": {
                          "type": "string",
                          "enum": [
                            "buy",
                            "sell"
                          ],
                          "description": "`buy`: the cell buys its quantity at its low level. `sell`: it sells it at its high level."
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "prepared",
                            "creating",
                            "created",
                            "signing",
                            "funded",
                            "unconfirmed",
                            "abandoned"
                          ],
                          "description": "Where the order is in our own lifecycle: prepared through funded, unconfirmed or abandoned."
                        },
                        "fillStatus": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "AWAITING_DEPOSIT",
                                "PENDING_CANCEL",
                                "UNTRIGGERED",
                                "OPEN",
                                "PARTIALLY_FILLED",
                                "FILLED",
                                "CANCELED",
                                "EXPIRED"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "What the provider last reported about matching, or `null` until it was read."
                        }
                      },
                      "required": [
                        "id",
                        "side",
                        "state",
                        "fillStatus"
                      ],
                      "description": "The order the cell has resting or being placed now."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The order the cell rests or is placing now, or `null` when it has none."
                },
                "cycles": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "How many times the cell bought at its low level and then sold at its high level."
                },
                "realizedQuoteRaw": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,38})$",
                  "description": "What those cycles earned, in the quote asset's smallest unit: each sale's received amount less its buy's cost."
                }
              },
              "required": [
                "index",
                "low",
                "high",
                "side",
                "state",
                "order",
                "cycles",
                "realizedQuoteRaw"
              ],
              "description": "One cell of the grid: the span between two adjacent levels."
            },
            "description": "Every cell of the grid, lowest first."
          },
          "cycles": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Completed buy-then-sell cycles across every cell."
          },
          "realizedProfit": {
            "type": "object",
            "properties": {
              "raw": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "In the quote asset's smallest unit."
              },
              "decimal": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$",
                "description": "The same amount in whole units of the asset, as an exact plain decimal."
              }
            },
            "required": [
              "raw",
              "decimal"
            ],
            "description": "What the completed cycles earned, in the quote asset."
          },
          "heldBaseRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The base the grid's filled buys hold for its sell cells, in the base asset's smallest unit. It stays in the agent wallet when the grid ends."
          },
          "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 conversation in which the user approved the grid."
          },
          "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 that created the grid."
          },
          "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 grid was created."
          },
          "updatedAt": {
            "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 grid or one of its cells last changed."
          },
          "endedAt": {
            "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 grid ended, or `null`."
          }
        },
        "required": [
          "id",
          "state",
          "stopReason",
          "terms",
          "validUntil",
          "cells",
          "cycles",
          "realizedProfit",
          "heldBaseRaw",
          "conversationId",
          "approvalId",
          "createdAt",
          "updatedAt",
          "endedAt"
        ],
        "description": "A grid of resting limit orders across a price range: its approved terms, each cell's live order, completed cycles and realized profit."
      },
      "MarketMetric": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "description": "What is measured: price, volume, total_market_cap, btc_dominance or tvl today. New names can appear: show the ones you know and skip the rest."
          },
          "value": {
            "type": "string",
            "pattern": "^-?\\d+(?:\\.\\d+)?$",
            "description": "The measured value as an exact decimal: USD for price, volume, market cap and TVL; percent for dominance."
          },
          "unit": {
            "description": "The value's unit, when this release supplies it.",
            "type": "string",
            "enum": [
              "usd",
              "percent"
            ]
          },
          "provenance": {
            "description": "The identity, providers and actual observation times behind the figure.",
            "type": "object",
            "properties": {
              "provider": {
                "description": "The provider of the current value, when known.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "referenceTokenId": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 512
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The reference token measured, when a token price is used."
              },
              "coingeckoId": {
                "description": "The CoinGecko asset identity, when applicable.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "observedAt": {
                "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 provider's observation time; null when it was not supplied."
              },
              "asOfBasis": {
                "type": "string",
                "enum": [
                  "provider",
                  "retrieval",
                  "generation"
                ],
                "description": "Whether `asOf` is a provider observation, a retrieval time or the brief's assembly time."
              },
              "comparison": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "start": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string",
                            "pattern": "^-?\\d+(?:\\.\\d+)?$",
                            "description": "USD per whole unit of the measured asset or reference token."
                          },
                          "observedAt": {
                            "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 provider's observation time."
                          },
                          "provider": {
                            "type": "string",
                            "description": "The provider that supplied this observation."
                          }
                        },
                        "required": [
                          "value",
                          "observedAt",
                          "provider"
                        ]
                      },
                      "end": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string",
                            "pattern": "^-?\\d+(?:\\.\\d+)?$",
                            "description": "USD per whole unit of the measured asset or reference token."
                          },
                          "observedAt": {
                            "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 provider's observation time."
                          },
                          "provider": {
                            "type": "string",
                            "description": "The provider that supplied this observation."
                          }
                        },
                        "required": [
                          "value",
                          "observedAt",
                          "provider"
                        ]
                      }
                    },
                    "required": [
                      "start",
                      "end"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The actual price observations used for the percentage change; null for a provider-reported change or a level."
              }
            },
            "required": [
              "provider",
              "referenceTokenId",
              "coingeckoId",
              "observedAt",
              "asOfBasis",
              "comparison"
            ]
          },
          "changePct": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+(?:\\.\\d+)?$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The change over the window, in percent; null when the source gives only a level."
          },
          "asOf": {
            "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 figure's timestamp; inspect provenance.asOfBasis to distinguish a provider observation from retrieval or assembly time."
          },
          "benchmark": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "subject": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "description": "A subject's id: `market`, `chain:<chain>`, `asset:<asset>`, `asset:<asset>@<chain>` or `stock:<TICKER>`."
                  },
                  "changePct": {
                    "type": "string",
                    "pattern": "^-?\\d+(?:\\.\\d+)?$",
                    "description": "The benchmark's change over the window, in percent."
                  },
                  "provenance": {
                    "type": "object",
                    "properties": {
                      "provider": {
                        "description": "The provider of the current value, when known.",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "referenceTokenId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 512
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "The reference token measured, when a token price is used."
                      },
                      "coingeckoId": {
                        "description": "The CoinGecko asset identity, when applicable.",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "observedAt": {
                        "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 provider's observation time; null when it was not supplied."
                      },
                      "asOfBasis": {
                        "type": "string",
                        "enum": [
                          "provider",
                          "retrieval",
                          "generation"
                        ],
                        "description": "Whether `asOf` is a provider observation, a retrieval time or the brief's assembly time."
                      },
                      "comparison": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "start": {
                                "type": "object",
                                "properties": {
                                  "value": {
                                    "type": "string",
                                    "pattern": "^-?\\d+(?:\\.\\d+)?$",
                                    "description": "USD per whole unit of the measured asset or reference token."
                                  },
                                  "observedAt": {
                                    "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 provider's observation time."
                                  },
                                  "provider": {
                                    "type": "string",
                                    "description": "The provider that supplied this observation."
                                  }
                                },
                                "required": [
                                  "value",
                                  "observedAt",
                                  "provider"
                                ]
                              },
                              "end": {
                                "type": "object",
                                "properties": {
                                  "value": {
                                    "type": "string",
                                    "pattern": "^-?\\d+(?:\\.\\d+)?$",
                                    "description": "USD per whole unit of the measured asset or reference token."
                                  },
                                  "observedAt": {
                                    "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 provider's observation time."
                                  },
                                  "provider": {
                                    "type": "string",
                                    "description": "The provider that supplied this observation."
                                  }
                                },
                                "required": [
                                  "value",
                                  "observedAt",
                                  "provider"
                                ]
                              }
                            },
                            "required": [
                              "start",
                              "end"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "The actual price observations used for the percentage change; null for a provider-reported change or a level."
                      }
                    },
                    "required": [
                      "provider",
                      "referenceTokenId",
                      "coingeckoId",
                      "observedAt",
                      "asOfBasis",
                      "comparison"
                    ]
                  }
                },
                "required": [
                  "subject",
                  "changePct"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "What the subject's price change is compared with: bitcoin for crypto, the S&P 500 ETF for stocks."
          }
        },
        "required": [
          "name",
          "value",
          "changePct",
          "asOf",
          "benchmark"
        ],
        "description": "One figure Fin measured, never one the model wrote."
      },
      "MarketMove": {
        "type": "object",
        "properties": {
          "subject": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "A subject's id: `market`, `chain:<chain>`, `asset:<asset>`, `asset:<asset>@<chain>` or `stock:<TICKER>`."
          },
          "magnitude": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "quiet",
                  "notable",
                  "large"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "How the subject's 24-hour price move compares with its usual daily move; null without enough price history."
          },
          "metrics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketMetric"
            },
            "description": "Fin's own figures for the subject."
          }
        },
        "required": [
          "subject",
          "magnitude",
          "metrics"
        ],
        "description": "What one subject did over the window."
      },
      "MarketDriver": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 300,
            "description": "One reason, in words."
          },
          "eventAt": {
            "description": "Actual event time established by a quoted passage; unknown for context.",
            "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"
              }
            ]
          },
          "classification": {
            "description": "Evidence-reviewed context or a qualified possible driver; causality is not proven.",
            "type": "string",
            "enum": [
              "possible_driver",
              "context_only"
            ]
          },
          "evidence": {
            "description": "Exact short source passages supporting this reason.",
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "sourceId": {
                  "type": "string",
                  "maxLength": 16
                },
                "quote": {
                  "type": "string",
                  "maxLength": 200
                }
              },
              "required": [
                "sourceId",
                "quote"
              ]
            }
          },
          "subjects": {
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "description": "A subject's id: `market`, `chain:<chain>`, `asset:<asset>`, `asset:<asset>@<chain>` or `stock:<TICKER>`."
            },
            "description": "The subjects this reason explains."
          },
          "sourceIds": {
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 16
            },
            "description": "The ids of the sources this reason rests on."
          }
        },
        "required": [
          "text",
          "subjects",
          "sourceIds"
        ],
        "description": "One reason a move happened, with its sources."
      },
      "MarketSource": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 16,
            "description": "The source's id within this brief."
          },
          "title": {
            "type": "string",
            "description": "The source's headline."
          },
          "publisher": {
            "description": "Who published it.",
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string",
            "maxLength": 2048,
            "description": "Where to read it."
          },
          "publishedAt": {
            "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 it was published, if known."
          },
          "publishedAtBasis": {
            "description": "How the publication clock was obtained; an estimate may instead be an update.",
            "type": [
              "string",
              "null"
            ]
          },
          "retrievedAt": {
            "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"
              }
            ]
          },
          "eventAt": {
            "description": "Actual event time when source evidence establishes it; publication alone is insufficient.",
            "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"
              }
            ]
          },
          "sourceKind": {
            "type": "string"
          },
          "evidenceLevel": {
            "type": "string",
            "enum": [
              "title_only",
              "search_excerpt",
              "provider_raw_content"
            ]
          },
          "excerpt": {
            "description": "A bounded permitted supporting passage; absent for publishers whose text cannot be relayed.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "title",
          "publisher",
          "url",
          "publishedAt"
        ],
        "description": "A news item a reason cites."
      },
      "MarketBrief": {
        "type": "object",
        "properties": {
          "headline": {
            "type": "string",
            "maxLength": 120,
            "description": "One line on what happened, in words."
          },
          "summary": {
            "type": "string",
            "maxLength": 600,
            "description": "Two or three sentences, in words."
          },
          "explained": {
            "type": "boolean",
            "description": "The brief's aggregate explanation flag, not a verdict for every subject. Use research.coverage for each subject's search and explanation outcome."
          },
          "evidence": {
            "description": "Exact quote witnesses from the assistive review of headline and summary; server-written abstention can have none.",
            "type": "object",
            "properties": {
              "headline": {
                "maxItems": 4,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "sourceId": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "quote": {
                      "type": "string",
                      "maxLength": 200
                    }
                  },
                  "required": [
                    "sourceId",
                    "quote"
                  ]
                }
              },
              "summary": {
                "maxItems": 4,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "sourceId": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "quote": {
                      "type": "string",
                      "maxLength": 200
                    }
                  },
                  "required": [
                    "sourceId",
                    "quote"
                  ]
                }
              }
            },
            "required": [
              "headline",
              "summary"
            ]
          },
          "research": {
            "description": "Whether research ran and what evidence it supplied for each subject; absent on older briefs.",
            "type": "object",
            "properties": {
              "performed": {
                "type": "boolean",
                "description": "Whether news research ran for this brief."
              },
              "skipReason": {
                "description": "Why research was skipped.",
                "type": "string",
                "const": "quiet"
              },
              "coverage": {
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "subject": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200,
                      "description": "A subject's id: `market`, `chain:<chain>`, `asset:<asset>`, `asset:<asset>@<chain>` or `stock:<TICKER>`."
                    },
                    "searchStatus": {
                      "type": "string",
                      "enum": [
                        "not_searched",
                        "complete",
                        "partial",
                        "unavailable"
                      ],
                      "description": "`complete` means the planned searches finished, not that every possible source was searched."
                    },
                    "explanationStatus": {
                      "type": "string",
                      "enum": [
                        "possible_driver",
                        "context_only",
                        "unexplained"
                      ],
                      "description": "What the reviewed evidence supports for this subject, separately from search completion."
                    },
                    "sourceIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 16
                      }
                    }
                  },
                  "required": [
                    "subject",
                    "searchStatus",
                    "explanationStatus",
                    "sourceIds"
                  ]
                }
              }
            },
            "required": [
              "performed",
              "coverage"
            ]
          },
          "moves": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketMove"
            },
            "description": "Each subject's figures, in scope order."
          },
          "drivers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketDriver"
            },
            "description": "The reasons, shared ones first."
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketSource"
            },
            "description": "Every source a reason cites."
          },
          "generatedAt": {
            "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 Fin finished the brief."
          },
          "pipelineVersion": {
            "type": "string",
            "description": "Which prompt and checks produced the brief."
          }
        },
        "required": [
          "headline",
          "summary",
          "explained",
          "moves",
          "drivers",
          "sources",
          "generatedAt",
          "pipelineVersion"
        ],
        "description": "What part of the market did over a window, and why, with sources. Every figure is Fin's; the words are a model's, checked."
      },
      "MarketBriefJob": {
        "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 brief job's id."
          },
          "scope": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "description": "A subject's id: `market`, `chain:<chain>`, `asset:<asset>`, `asset:<asset>@<chain>` or `stock:<TICKER>`."
            },
            "description": "The subjects, sorted: with `window`, a natural key to cache a brief by."
          },
          "window": {
            "type": "string",
            "enum": [
              "24h"
            ],
            "description": "The window the brief explains."
          },
          "mode": {
            "description": "The requested research mode; absent on older jobs means `auto`.",
            "type": "string",
            "enum": [
              "auto",
              "news"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "generating",
              "ready",
              "failed"
            ],
            "description": "`generating` until the brief is `ready` or the job has `failed`."
          },
          "retryAfterSeconds": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "While generating, how long to wait before reading the job again."
          },
          "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 job was created."
          },
          "completedAt": {
            "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 job finished."
          },
          "failure": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "generation_failed",
                      "brief_invalid",
                      "budget_exhausted"
                    ],
                    "description": "Why the job failed."
                  },
                  "details": {
                    "description": "A safe failure category and retry guidance, without provider error text.",
                    "type": "object",
                    "properties": {
                      "stage": {
                        "type": "string",
                        "enum": [
                          "admission",
                          "research",
                          "synthesis",
                          "validation",
                          "deadline"
                        ]
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "unavailable",
                          "invalid_output",
                          "budget_exhausted",
                          "deadline_exceeded"
                        ]
                      },
                      "retryable": {
                        "type": "boolean",
                        "description": "Whether a deliberate new request may succeed; reusing this job's key still returns this outcome."
                      }
                    },
                    "required": [
                      "stage",
                      "reason",
                      "retryable"
                    ]
                  }
                },
                "required": [
                  "code"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the job failed, once it has."
          },
          "costCents": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d+$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The settled model cost of making the brief, in integer cents, once the job finished; a quiet brief costs nothing."
          },
          "brief": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MarketBrief"
              },
              {
                "type": "null"
              }
            ],
            "description": "The brief, once ready."
          }
        },
        "required": [
          "id",
          "scope",
          "window",
          "status",
          "retryAfterSeconds",
          "createdAt",
          "completedAt",
          "failure",
          "costCents",
          "brief"
        ],
        "description": "One market brief request and its outcome, kept 30 days for the partner that created it."
      },
      "MarketSubject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "A subject's id: `market`, `chain:<chain>`, `asset:<asset>`, `asset:<asset>@<chain>` or `stock:<TICKER>`."
          },
          "kind": {
            "type": "string",
            "enum": [
              "market",
              "chain",
              "asset",
              "stock"
            ],
            "description": "What kind of subject it is."
          },
          "name": {
            "type": "string",
            "description": "Its name."
          },
          "symbol": {
            "description": "Its symbol, if it has one.",
            "type": [
              "string",
              "null"
            ]
          },
          "chains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The chains an asset trades on; the chain itself for a chain."
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Other identifiers that name it: CoinGecko ids, symbols, contract addresses, 1Click asset ids."
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "symbol",
          "chains",
          "aliases"
        ],
        "description": "Something a market brief can be about."
      },
      "MarketSubjects": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketSubject"
            },
            "description": "This page's rows."
          },
          "nextCursor": {
            "description": "The cursor for the next page; null once there are no more rows.",
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "description": "How many rows the list holds in all, when it is known.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "data",
          "nextCursor"
        ],
        "description": "Subjects market briefs cover."
      },
      "MarketNewsSubject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240,
            "pattern": "^(market|[a-z_]+:[^\\s]+)$",
            "description": "What the subject is, as `kind:id`: `asset:btc`, `stock:NVDA`, `prediction:<slug>`, `chain:solana`, or `market` for the whole crypto market."
          },
          "kind": {
            "type": "string",
            "enum": [
              "market",
              "chain",
              "asset",
              "stock",
              "launchpad",
              "venue",
              "pool",
              "instrument",
              "fund",
              "sector",
              "indicator",
              "prediction",
              "account",
              "publisher",
              "narrative"
            ],
            "description": "What kind of subject it is: `asset` (a coin), `stock`, `prediction` (a prediction market), `chain`, `market`, or a `launchpad`, `venue`, `sector` and the like."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300,
            "description": "Its name; for a prediction market, its question."
          },
          "symbol": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ],
            "description": "Its ticker or symbol, when it has one."
          },
          "coingeckoId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ],
            "description": "Its CoinGecko listing, when it has one, by its kind: a coin's (`bitcoin`, `pump-fun`), an exchange's for a venue (`binance`), a category's for a sector (`layer-1`). What its price history and its logo are found by."
          },
          "hyperliquidCoin": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "description": "The coin its Hyperliquid market trades as (`BTC`, `PUMP`), when it has one."
          },
          "defillamaId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ],
            "description": "Its DefiLlama listing, when it has one: a protocol's slug for a venue or launchpad (`uniswap-v3`, `pump.fun`), a chain's name for a chain (`Ethereum`). What its logo is found by."
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "symbol",
          "coingeckoId",
          "hyperliquidCoin",
          "defillamaId"
        ],
        "description": "Something the news is about."
      },
      "MarketNewsSource": {
        "type": "object",
        "properties": {
          "publisher": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253,
            "description": "Who published it, as their web domain."
          },
          "headline": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "description": "Its headline."
          },
          "url": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048,
            "description": "Where to read it."
          },
          "publishedAt": {
            "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 it was published, when the publisher says."
          },
          "excerpt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "description": "A short excerpt, where the publisher's licence allows one."
          }
        },
        "required": [
          "publisher",
          "headline",
          "url",
          "publishedAt",
          "excerpt"
        ],
        "description": "An article, with where to read it."
      },
      "MarketFigure": {
        "type": "object",
        "properties": {
          "subject": {
            "$ref": "#/components/schemas/MarketNewsSubject"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "What the figure is, in plain words: `Price`, `Yes odds`, `Trading volume`."
          },
          "unit": {
            "type": "string",
            "enum": [
              "usd",
              "usdt",
              "percent",
              "points",
              "count",
              "ratio",
              "index",
              "coin",
              "btc",
              "sol"
            ],
            "description": "What `value` counts."
          },
          "value": {
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d*)(\\.\\d+)?$",
            "description": "The figure now."
          },
          "window": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8,
            "description": "The window the figure and its change cover: `15m`, `4h`, `1d`, `7d`, `30d`."
          },
          "changePct": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?(0|[1-9]\\d*)(\\.\\d+)?$",
                "description": "An exact decimal number as text."
              },
              {
                "type": "null"
              }
            ],
            "description": "Its change over `window` in percent, or null when there is too little history."
          },
          "asOf": {
            "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 figure was read."
          }
        },
        "required": [
          "subject",
          "label",
          "unit",
          "value",
          "window",
          "changePct",
          "asOf"
        ],
        "description": "A market figure, as it reads now."
      },
      "MarketNewsMove": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9]\\d{0,18}$",
            "description": "The move's id; newer moves have larger ids."
          },
          "kind": {
            "type": "string",
            "enum": [
              "price",
              "market",
              "odds",
              "resolved",
              "volume",
              "share",
              "leader",
              "entrant"
            ],
            "description": "What kind of move it is."
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300,
            "description": "The move in one plain sentence: `WIF up 18.4% in 4 hours`."
          },
          "at": {
            "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 Fin spotted it."
          },
          "subjects": {
            "maxItems": 20,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketNewsSubject"
            },
            "description": "What moved, first the subject the sentence is about."
          },
          "changePct": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?(0|[1-9]\\d*)(\\.\\d+)?$",
                "description": "An exact decimal number as text."
              },
              {
                "type": "null"
              }
            ],
            "description": "The move's size in percent, for a price, market or volume move; null for the rest."
          },
          "changePoints": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?(0|[1-9]\\d*)(\\.\\d+)?$",
                "description": "An exact decimal number as text."
              },
              {
                "type": "null"
              }
            ],
            "description": "The move's size in percentage points, for odds and shares; null for the rest."
          },
          "window": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 8
              },
              {
                "type": "null"
              }
            ],
            "description": "The window the move happened over, when it has one: `15m`, `4h`, `7d`."
          }
        },
        "required": [
          "id",
          "kind",
          "text",
          "at",
          "subjects",
          "changePct",
          "changePoints",
          "window"
        ],
        "description": "A move in the market, as Fin spotted it."
      },
      "MarketStory": {
        "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 story's id."
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "The story in a few words."
          },
          "summary": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000,
            "description": "What happened, in a few sentences."
          },
          "topic": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "security",
                  "legal",
                  "regulation",
                  "governance",
                  "people",
                  "deals",
                  "funding",
                  "launches",
                  "networks",
                  "supply",
                  "economy",
                  "funds",
                  "tokenization",
                  "stablecoins",
                  "predictions",
                  "sports",
                  "ai",
                  "memecoins",
                  "defi",
                  "wallets",
                  "data",
                  "markets"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "What the story is about, as a reader would file it: `security` (hacks, exploits, scams, thefts and outages); `legal` (lawsuits, courts, criminal charges and settlements); `regulation` (rules, regulators, government policy, licences, taxes and sanctions); `governance` (a DAO's or a protocol's votes and proposals); `people` (a leader joining, leaving or being appointed); `deals` (acquisitions, mergers, sales, IPOs, bankruptcies and shutdowns); `funding` (fundraising and investment rounds); `launches` (a new product, feature, listing, integration or partnership); `networks` (a chain's upgrades, forks, client and node releases); `supply` (token burns, unlocks, airdrops, buybacks and emissions); `economy` (the wider economy: rates, inflation, jobs, central banks and tariffs); `funds` (ETF and fund flows, and companies holding crypto in their treasuries); `tokenization` (tokenized stocks, funds and other real-world assets); `stablecoins` (stablecoins and crypto payments); `predictions` (prediction markets and their odds); `sports` (sports and the markets on them); `ai` (artificial intelligence and AI agents); `memecoins` (memecoins and the launchpads they start on); `defi` (lending, exchanges, yields and other DeFi protocols); `wallets` (wallets, custody and how people sign in); `data` (data, analytics, oracles and research); `markets` (a price, volume, open-interest or liquidity move, or how traders are positioned). Draw a story by it when nothing it names has a logo; null for a story last written before topics."
          },
          "status": {
            "type": "string",
            "enum": [
              "new",
              "rising",
              "steady",
              "fading"
            ],
            "description": "How the story is doing."
          },
          "evidence": {
            "type": "string",
            "enum": [
              "measured",
              "corroborated",
              "reported",
              "unconfirmed"
            ],
            "description": "How well the story is backed."
          },
          "firstSeenAt": {
            "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 Fin first saw the story."
          },
          "updatedAt": {
            "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 story was last confirmed by a new source or figure."
          },
          "subjects": {
            "maxItems": 20,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketNewsSubject"
            },
            "description": "What the story is about: coins, stocks, prediction markets and the like."
          },
          "sourceCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "How many articles the story rests on."
          },
          "sources": {
            "maxItems": 3,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketNewsSource"
            },
            "description": "Its first 3 sources, newest first."
          }
        },
        "required": [
          "id",
          "title",
          "summary",
          "topic",
          "status",
          "evidence",
          "firstSeenAt",
          "updatedAt",
          "subjects",
          "sourceCount",
          "sources"
        ],
        "description": "A story the market is telling."
      },
      "MarketStoryDetail": {
        "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 story's id."
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "The story in a few words."
          },
          "summary": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000,
            "description": "What happened, in a few sentences."
          },
          "topic": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "security",
                  "legal",
                  "regulation",
                  "governance",
                  "people",
                  "deals",
                  "funding",
                  "launches",
                  "networks",
                  "supply",
                  "economy",
                  "funds",
                  "tokenization",
                  "stablecoins",
                  "predictions",
                  "sports",
                  "ai",
                  "memecoins",
                  "defi",
                  "wallets",
                  "data",
                  "markets"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "What the story is about, as a reader would file it: `security` (hacks, exploits, scams, thefts and outages); `legal` (lawsuits, courts, criminal charges and settlements); `regulation` (rules, regulators, government policy, licences, taxes and sanctions); `governance` (a DAO's or a protocol's votes and proposals); `people` (a leader joining, leaving or being appointed); `deals` (acquisitions, mergers, sales, IPOs, bankruptcies and shutdowns); `funding` (fundraising and investment rounds); `launches` (a new product, feature, listing, integration or partnership); `networks` (a chain's upgrades, forks, client and node releases); `supply` (token burns, unlocks, airdrops, buybacks and emissions); `economy` (the wider economy: rates, inflation, jobs, central banks and tariffs); `funds` (ETF and fund flows, and companies holding crypto in their treasuries); `tokenization` (tokenized stocks, funds and other real-world assets); `stablecoins` (stablecoins and crypto payments); `predictions` (prediction markets and their odds); `sports` (sports and the markets on them); `ai` (artificial intelligence and AI agents); `memecoins` (memecoins and the launchpads they start on); `defi` (lending, exchanges, yields and other DeFi protocols); `wallets` (wallets, custody and how people sign in); `data` (data, analytics, oracles and research); `markets` (a price, volume, open-interest or liquidity move, or how traders are positioned). Draw a story by it when nothing it names has a logo; null for a story last written before topics."
          },
          "status": {
            "type": "string",
            "enum": [
              "new",
              "rising",
              "steady",
              "fading"
            ],
            "description": "How the story is doing."
          },
          "evidence": {
            "type": "string",
            "enum": [
              "measured",
              "corroborated",
              "reported",
              "unconfirmed"
            ],
            "description": "How well the story is backed."
          },
          "firstSeenAt": {
            "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 Fin first saw the story."
          },
          "updatedAt": {
            "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 story was last confirmed by a new source or figure."
          },
          "subjects": {
            "maxItems": 20,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketNewsSubject"
            },
            "description": "What the story is about: coins, stocks, prediction markets and the like."
          },
          "sourceCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "How many articles the story rests on."
          },
          "sources": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketNewsSource"
            },
            "description": "Every article it rests on, newest first."
          },
          "figures": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketFigure"
            },
            "description": "The market figures the story states, as they read now."
          },
          "moves": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketNewsMove"
            },
            "description": "Moves Fin spotted on what the story is about since it began, newest first."
          }
        },
        "required": [
          "id",
          "title",
          "summary",
          "topic",
          "status",
          "evidence",
          "firstSeenAt",
          "updatedAt",
          "subjects",
          "sourceCount",
          "sources",
          "figures",
          "moves"
        ],
        "description": "A story the market is telling, in full."
      },
      "MarketHeadline": {
        "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 article's id."
          },
          "publisher": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253,
            "description": "Who published it, as their web domain."
          },
          "headline": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "description": "Its headline."
          },
          "url": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048,
            "description": "Where to read it."
          },
          "publishedAt": {
            "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 it was published, when the publisher says."
          },
          "excerpt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "description": "A short excerpt, where the publisher's licence allows one."
          },
          "subjects": {
            "maxItems": 8,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketNewsSubject"
            },
            "description": "The coins and stocks its headline names, in the order it names them."
          }
        },
        "required": [
          "id",
          "publisher",
          "headline",
          "url",
          "publishedAt",
          "excerpt",
          "subjects"
        ],
        "description": "An article, with what it is about."
      },
      "MarketFlow": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "market_cap",
              "alt_volume",
              "perps_open_interest",
              "stablecoin_supply",
              "dex_volume",
              "launchpad_volume"
            ],
            "description": "Which figure it is."
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "The figure in plain words."
          },
          "valueUsd": {
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d*)(\\.\\d+)?$",
            "description": "The figure in US dollars: a level for market cap, open interest and stablecoin supply; the latest day's total for a volume."
          },
          "changes": {
            "maxItems": 3,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "window": {
                  "type": "string",
                  "enum": [
                    "1d",
                    "7d",
                    "30d"
                  ],
                  "description": "The window."
                },
                "changePct": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^-?(0|[1-9]\\d*)(\\.\\d+)?$",
                      "description": "An exact decimal number as text."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The change over the window in percent, against the window before for a volume; null when there is too little history."
                }
              },
              "required": [
                "window",
                "changePct"
              ]
            },
            "description": "Its change over each window, shortest first."
          },
          "asOf": {
            "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 figure was read."
          }
        },
        "required": [
          "key",
          "label",
          "valueUsd",
          "changes",
          "asOf"
        ],
        "description": "Where money is in the crypto market, and how it moved."
      },
      "MarketStories": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketStory"
            },
            "description": "This page's rows."
          },
          "nextCursor": {
            "description": "The cursor for the next page; null once there are no more rows.",
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "description": "How many rows the list holds in all, when it is known.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "data",
          "nextCursor"
        ],
        "description": "Stories the market is telling, most recently confirmed first."
      },
      "MarketHeadlines": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketHeadline"
            },
            "description": "This page's rows."
          },
          "nextCursor": {
            "description": "The cursor for the next page; null once there are no more rows.",
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "description": "How many rows the list holds in all, when it is known.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "data",
          "nextCursor"
        ],
        "description": "Articles from reviewed publishers, newest first."
      },
      "MarketMoves": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketNewsMove"
            },
            "description": "This page's rows."
          },
          "nextCursor": {
            "description": "The cursor for the next page; null once there are no more rows.",
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "description": "How many rows the list holds in all, when it is known.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "data",
          "nextCursor"
        ],
        "description": "Moves Fin spotted in the market, newest first."
      },
      "MarketFlows": {
        "type": "object",
        "properties": {
          "data": {
            "maxItems": 6,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketFlow"
            },
            "description": "Each figure Fin has now."
          }
        },
        "required": [
          "data"
        ],
        "description": "Where money is in the crypto market and how it moved over a day, a week and a month."
      },
      "OrderRequest": {
        "type": "object",
        "properties": {
          "sellAssetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to sell from the agent wallet: an `assetId` from Get balances."
          },
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The exact amount to sell, in the sold asset's smallest unit. It leaves the agent wallet when the order is placed."
          },
          "buyAssetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset to buy: an `id` from List supported assets. What the order buys comes back to the agent wallet."
          },
          "limitPrice": {
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d{0,38})(\\.\\d{1,38})?$",
            "description": "The least the order sells at, as bought-asset units per ONE sold unit, written as a plain decimal: \"5\" means at least 5 of the bought asset for each one sold. Never scale it by decimals."
          },
          "expiresInHours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 720,
            "description": "How long the order rests before it expires, in whole hours from 1 to 720 (30 days)."
          },
          "context": {
            "type": "object",
            "properties": {
              "country": {
                "description": "The country the user is making this request from, as an uppercase ISO 3166-1 alpha-2 code such as `GB`, resolved by your server from the request (your edge's IP geolocation), never taken from the browser. A tokenized stock is traded only when this reports a country where it is available.",
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              }
            },
            "description": "What your app knows about the user as they make this request. It applies to this request only, so send it with every request that may trade a tokenized stock."
          }
        },
        "required": [
          "sellAssetId",
          "amountRaw",
          "buyAssetId",
          "limitPrice",
          "expiresInHours"
        ],
        "description": "What to sell, how much, what to buy, the least it sells at and how long it rests; preparing fills in the least the whole order receives. An order of a tokenized stock also needs `context.country`."
      },
      "PreparedOrder": {
        "type": "object",
        "properties": {
          "terms": {
            "description": "The exact terms to show the user and send, unchanged, to Place an order: the request plus the least the whole order receives at its limit price.",
            "$ref": "#/components/schemas/OrderTerms"
          },
          "requestKey": {
            "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": "This order's id for retries: send it as the `Idempotency-Key` of Place an order, and filter List orders on it after a timeout."
          },
          "authorization": {
            "description": "The message the user signs to allow exactly these terms. Call Place an order before `authorization.expiresAt`.",
            "$ref": "#/components/schemas/MessageToSign"
          }
        },
        "required": [
          "terms",
          "requestKey",
          "authorization"
        ],
        "description": "A limit order's exact terms, the message the user signs for them, and the key to place it with."
      },
      "WalletOrder": {
        "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 order's id; the provider's own id is `orderId`."
          },
          "orderId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ],
            "description": "The provider's order id, or `null` until the provider confirms the order. Treat it as opaque."
          },
          "terms": {
            "type": "object",
            "properties": {
              "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 base asset the order sells, pinned to its token id and decimals."
              },
              "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 quote asset the order buys, pinned to its token id and decimals."
              },
              "quantity": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "The exact base-asset amount to sell, in the base asset's smallest unit."
              },
              "limitPrice": {
                "type": "string",
                "maxLength": 80,
                "pattern": "^(0|[1-9]\\d{0,38})(\\.\\d{1,38})?$",
                "description": "The minimum price a fill must reach: quote-asset units per one base unit, as a plain decimal."
              },
              "deadline": {
                "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                "description": "The absolute instant the resting order expires."
              }
            },
            "required": [
              "input",
              "output",
              "quantity",
              "limitPrice",
              "deadline"
            ],
            "description": "The approved terms the order was placed with; they never change."
          },
          "state": {
            "type": "string",
            "enum": [
              "prepared",
              "creating",
              "created",
              "signing",
              "funded",
              "unconfirmed",
              "abandoned"
            ],
            "description": "Where this order is in our own lifecycle: prepared/creating/created/signing/funded, plus unconfirmed (a lost response, never retried) and abandoned (refused before any signature)."
          },
          "observation": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "orderId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "description": "The provider's opaque order id."
                  },
                  "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 base asset the order sells."
                  },
                  "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 quote asset the order buys."
                  },
                  "quantity": {
                    "type": "string",
                    "maxLength": 78,
                    "pattern": "^(0|[1-9][0-9]*)$",
                    "description": "The base-asset quantity the order rests on, in the base asset's smallest unit."
                  },
                  "limitPrice": {
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d{0,38})(\\.\\d{1,38})?$",
                    "description": "The resting limit price: quote-asset units per one base unit."
                  },
                  "deadline": {
                    "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                    "description": "The absolute instant the order expires at the provider."
                  },
                  "fillStatus": {
                    "type": "string",
                    "enum": [
                      "AWAITING_DEPOSIT",
                      "PENDING_CANCEL",
                      "UNTRIGGERED",
                      "OPEN",
                      "PARTIALLY_FILLED",
                      "FILLED",
                      "CANCELED",
                      "EXPIRED"
                    ],
                    "description": "How much matched. Independent of whether any payout arrived."
                  },
                  "payoutStatus": {
                    "type": "string",
                    "enum": [
                      "NOT_STARTED",
                      "IN_PROGRESS",
                      "COMPLETED",
                      "FAILED"
                    ],
                    "description": "Whether the output side is paying out; `COMPLETED` or `FAILED` is final, in progress is not."
                  },
                  "isPayoutStatusFinal": {
                    "type": "boolean",
                    "description": "Whether the payout axis stopped moving. True covers a failed payout and is not a success flag."
                  },
                  "depositedAmount": {
                    "type": "string",
                    "maxLength": 78,
                    "pattern": "^(0|[1-9][0-9]*)$",
                    "description": "Cumulative funded input in the base asset's smallest unit; zero until funded."
                  },
                  "filledInputRaw": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 78,
                        "pattern": "^(0|[1-9][0-9]*)$"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Successful fills' input total in atomic units, or null when an amount could not be read exactly."
                  },
                  "filledOutputRaw": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 78,
                        "pattern": "^(0|[1-9][0-9]*)$"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Successful fills' output total in atomic units, or null when unknown; a full fill with no reported fills stays null."
                  },
                  "cancelable": {
                    "type": "boolean",
                    "description": "Whether the provider may still accept a cancellation right now."
                  },
                  "observedAt": {
                    "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                    "description": "When this provider projection was last read."
                  }
                },
                "required": [
                  "orderId",
                  "input",
                  "output",
                  "quantity",
                  "limitPrice",
                  "deadline",
                  "fillStatus",
                  "payoutStatus",
                  "isPayoutStatusFinal",
                  "depositedAmount",
                  "filledInputRaw",
                  "filledOutputRaw",
                  "cancelable",
                  "observedAt"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "What the provider last reported about fills and payouts, or `null` until it has been read."
          },
          "position": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "observedAt": {
                    "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": "Time Fin observed this provider report; not a cash settlement time."
                  },
                  "basis": {
                    "type": "string",
                    "const": "provider_report",
                    "description": "Allocation reported by the bound order provider, not a wallet cash receipt."
                  },
                  "restingInputRaw": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^(0|[1-9]\\d{0,38})$"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Input atomic units still resting in the order; null when unknown, zero after matching ends."
                  },
                  "filledInputRaw": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^(0|[1-9]\\d{0,38})$"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Cumulative input atomic units in known successful fills; null when incomplete or conflicting."
                  },
                  "filledOutputRaw": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^(0|[1-9]\\d{0,38})$"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Cumulative output atomic units from successful fills; does not establish a wallet receipt or current holding."
                  },
                  "refund": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "principalRaw": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^(0|[1-9]\\d{0,38})$"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Unfilled input principal allocated to refund clearing before unknown settlement fees; not spendable cash."
                          },
                          "providerStatus": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "NOT_STARTED",
                                  "IN_PROGRESS",
                                  "COMPLETED",
                                  "FAILED"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Refund leg status, or null when no leg was reported; completion does not prove the net amount received."
                          },
                          "txHash": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 256
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Provider-reported completed refund reference; not proof of an amount received."
                          }
                        },
                        "required": [
                          "principalRaw",
                          "providerStatus",
                          "txHash"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Refund clearing claim for a terminal order, or null when none is reported."
                  },
                  "withdrawals": {
                    "maxItems": 1001,
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "const": "IN_PROGRESS",
                              "description": "The provider reports this payout is in progress."
                            }
                          },
                          "required": [
                            "status"
                          ],
                          "additionalProperties": {}
                        },
                        {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "const": "COMPLETED",
                              "description": "The provider reports completion; this does not establish the exact net amount received."
                            },
                            "txHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256,
                              "description": "The provider's payout transaction reference, not an amount or a receipt reconciliation."
                            }
                          },
                          "required": [
                            "status",
                            "txHash"
                          ],
                          "additionalProperties": {}
                        },
                        {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "const": "FAILED",
                              "description": "The provider reports this payout failed; the funds' disposition remains unresolved."
                            },
                            "reason": {
                              "description": "The provider's reason for the payout failure, when supplied.",
                              "type": "string",
                              "maxLength": 256
                            }
                          },
                          "required": [
                            "status"
                          ],
                          "additionalProperties": {}
                        }
                      ]
                    },
                    "description": "Provider payout references, deduplicated for display; no inferred cash credits."
                  },
                  "reconciliation": {
                    "type": "string",
                    "enum": [
                      "not_required",
                      "unreconciled"
                    ],
                    "description": "Not required only for proven never-funded empty orders; otherwise actual cash settlement remains unreconciled."
                  }
                },
                "required": [
                  "observedAt",
                  "basis",
                  "restingInputRaw",
                  "filledInputRaw",
                  "filledOutputRaw",
                  "refund",
                  "withdrawals",
                  "reconciliation"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Provider-reported order allocation and payout references, or null before a usable observation. Refund principal is before deductions and is not received wallet cash. Provider completion does not reconcile a payout."
          },
          "fills": {
            "anyOf": [
              {
                "maxItems": 1000,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128,
                      "description": "1Click's id for this fill. Treat it as opaque."
                    },
                    "inputRaw": {
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d{0,38})$",
                      "description": "What this fill sold, in the sold asset's smallest unit, as 1Click reported it."
                    },
                    "outputRaw": {
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d{0,38})$",
                      "description": "What this fill bought, in the bought asset's smallest unit, as 1Click reported it: not proof of what reached the wallet."
                    },
                    "filledAt": {
                      "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 1Click says the fill happened; `null` when it gave no time Fin can read."
                    },
                    "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 Fin first saw this fill in 1Click's report; `null` for a fill Fin saw before it kept this."
                    }
                  },
                  "required": [
                    "id",
                    "inputRaw",
                    "outputRaw",
                    "filledAt",
                    "reportedAt"
                  ]
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Each fill 1Click reported for this order, oldest first: what it sold and bought, when it happened and when Fin first saw it. A fill's price is `outputRaw` per `inputRaw`, each at its asset's decimals. Empty before anything fills; `null` whenever `position.filledInputRaw` is (no usable report yet, or one whose fills cannot be read exactly)."
          },
          "depositReportedAt": {
            "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 Fin first saw 1Click report that the order's funds arrived; `null` until then, and for an order whose funds arrived before Fin kept this."
          },
          "paidOutAt": {
            "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 Fin first saw 1Click report the order ended (filled, cancelled or expired) with its payouts complete and final: what filled came back as the bought asset, and what did not fill came back as the sold one. `null` until then."
          },
          "value": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ValueAtTime"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the order sells (`terms.quantity`) was worth when it was placed, at the last market price Fin kept at or before then (the prices portfolio history uses): a five-minute close from the ten minutes before the placement, else an hourly close from the two hours before it. `null` when Fin kept neither."
          },
          "cancelRequestedAt": {
            "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 user asked to cancel, or `null`. Asking is not proof the provider canceled or refunded."
          },
          "failureReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "insufficient_funds",
                  "provider_refused",
                  "verification_failed",
                  "credentials_unavailable",
                  "provider_unavailable",
                  "placement_disabled",
                  "account_busy",
                  "expired"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "When `state` is `abandoned`, why nothing was funded; otherwise `null`. `insufficient_funds`: the wallet did not hold the amount. `provider_refused`: the provider refused the order. `verification_failed`: the order or its funding transfer failed its checks, or would receive less than the minimum the user signed. `credentials_unavailable`: the wallet could not sign or reach the provider. `provider_unavailable`: NEAR Intents did not answer before the order was created, so nothing was placed; placing it again later may work. `placement_disabled`: this deployment does not sign trades. `account_busy`: another funding held the wallet. `expired`: the user's signed request ran out before the order started. Prepare and place a new order to try again."
          },
          "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 conversation in which the agent placed the order; `null` for an order the user placed with Place an order."
          },
          "approvalId": {
            "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 approval's id."
              },
              {
                "type": "null"
              }
            ],
            "description": "The approval the user gave for the order in that conversation: open the conversation at its card to show where the order was asked for. `null` for an order the user placed with Place an order."
          },
          "grid": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "gridId": {
                    "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 grid's `id`: read it with Get a grid."
                  },
                  "cell": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 18,
                    "description": "The grid cell the order was placed for, lowest first."
                  }
                },
                "required": [
                  "gridId",
                  "cell"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The grid that placed this order and the cell it rests for, or `null` for an order placed on its own."
          },
          "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 order was placed."
          },
          "updatedAt": {
            "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 order last changed."
          }
        },
        "required": [
          "id",
          "orderId",
          "terms",
          "state",
          "observation",
          "position",
          "fills",
          "depositReportedAt",
          "paidOutAt",
          "value",
          "cancelRequestedAt",
          "failureReason",
          "conversationId",
          "approvalId",
          "grid",
          "createdAt",
          "updatedAt"
        ],
        "description": "A limit order from the agent wallet: the approved terms, whether it is funded, how much has filled, and any cancellation."
      },
      "ReviewAsset": {
        "type": "object",
        "properties": {
          "assetId": {
            "type": "string",
            "pattern": "^asset_[a-f0-9]{64}$",
            "description": "The asset as Get balances and Prepare an order name it."
          },
          "symbol": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "description": "The asset's symbol: `NEAR`, `USDC`, `BTC`, `AAPL`."
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 36,
            "description": "The asset's own scale: 24 for NEAR, 6 for USDC, 8 for BTC."
          },
          "network": {
            "description": "The chain it sits on, for its badge: `near`, `base`; omitted for none.",
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$"
          }
        },
        "required": [
          "assetId",
          "symbol",
          "decimals"
        ],
        "description": "An asset a review names, as it draws and prints it."
      },
      "AssetAmount": {
        "type": "object",
        "properties": {
          "asset": {
            "$ref": "#/components/schemas/ReviewAsset"
          },
          "amountRaw": {
            "type": "string",
            "maxLength": 78,
            "pattern": "^(0|[1-9][0-9]*)$",
            "description": "In the asset's smallest unit, as a decimal integer string: `3000000` is 3 USDC."
          }
        },
        "required": [
          "asset",
          "amountRaw"
        ],
        "description": "An exact amount of one asset."
      },
      "DollarAmount": {
        "type": "object",
        "properties": {
          "usd": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$",
            "description": "Dollars of what it buys: `1` reads `$1 of NEAR`."
          }
        },
        "required": [
          "usd"
        ],
        "description": "A dollar figure an automation spends."
      },
      "RunSpend": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/AssetAmount"
          },
          {
            "$ref": "#/components/schemas/DollarAmount"
          }
        ],
        "description": "What one run of an automation spends: an exact amount of an asset (`1 USDC`), or dollars of what it buys (`$1 of NEAR`). Fin works out every figure that follows from it either way."
      },
      "ReviewSchedule": {
        "type": "object",
        "properties": {
          "cadence": {
            "type": "string",
            "enum": [
              "daily",
              "weekly",
              "monthly"
            ],
            "description": "How often it runs."
          },
          "time": {
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
            "description": "Local time of day, 24-hour: `09:00`."
          },
          "weekday": {
            "description": "A weekly schedule's day.",
            "type": "string",
            "enum": [
              "monday",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday",
              "sunday"
            ]
          },
          "dayOfMonth": {
            "description": "A monthly schedule's day.",
            "type": "integer",
            "minimum": 1,
            "maximum": 28
          },
          "timeZone": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^[A-Za-z][\\w+-]*(?:\\/[\\w+-]+)*$",
            "description": "The IANA zone it keeps: `Europe/London`."
          }
        },
        "required": [
          "cadence",
          "time",
          "timeZone"
        ],
        "description": "When a schedule runs, in the zone it keeps."
      },
      "ReviewAutomation": {
        "type": "object",
        "properties": {
          "automationId": {
            "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 automation's id."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "The automation's own name, as its owner wrote it."
          },
          "trigger": {
            "type": "string",
            "enum": [
              "schedule",
              "price-drop",
              "price-rise",
              "event"
            ],
            "description": "What starts its runs. An `event` one runs when something happens and has no price or time to draw."
          },
          "asset": {
            "description": "The asset it buys or sells.",
            "$ref": "#/components/schemas/ReviewAsset"
          },
          "schedule": {
            "description": "A scheduled one's schedule.",
            "$ref": "#/components/schemas/ReviewSchedule"
          },
          "nextRunAt": {
            "description": "When it runs next, while it is on.",
            "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))$"
          },
          "pausedAt": {
            "description": "When it was paused, when Fin can tell.",
            "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))$"
          }
        },
        "required": [
          "automationId",
          "name",
          "trigger"
        ],
        "description": "An automation a review changes."
      },
      "ReviewCoverage": {
        "type": "object",
        "properties": {
          "by": {
            "description": "The money that pays: the spendable balance.",
            "$ref": "#/components/schemas/AssetAmount"
          },
          "byDeposit": {
            "type": "boolean",
            "description": "True when that balance is there because a deposit landed since the last run."
          },
          "runsCovered": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "description": "How many of the coming runs it pays for; 0 pays for none."
          },
          "runsLeft": {
            "description": "Runs left before the automation ends.",
            "type": "integer",
            "minimum": 0,
            "maximum": 100000
          }
        },
        "required": [
          "by",
          "byDeposit",
          "runsCovered"
        ],
        "description": "What pays for a schedule's coming runs."
      },
      "OrderPriceOption": {
        "type": "object",
        "properties": {
          "limitPriceUsd": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$",
            "description": "Your price in dollars per one unit of the asset."
          },
          "toGoBps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000,
            "description": "How far the market must move to fill, from today; 0 fills at once."
          },
          "receive": {
            "description": "What the order gets at this price.",
            "$ref": "#/components/schemas/AssetAmount"
          },
          "order": {
            "description": "Prepare an order's request for this price, exactly.",
            "$ref": "#/components/schemas/OrderRequest"
          }
        },
        "required": [
          "limitPriceUsd",
          "toGoBps",
          "receive",
          "order"
        ],
        "description": "A limit order's price, with what depends on it."
      },
      "SwapReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "swap",
            "description": "Which review this is."
          },
          "balance": {
            "description": "What you hold of the asset you pay with.",
            "$ref": "#/components/schemas/AssetAmount"
          },
          "buy": {
            "$ref": "#/components/schemas/ReviewAsset"
          },
          "buyPriceUsd": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$",
            "description": "One unit of the bought asset now."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000,
            "description": "The most the swap may lose, fees and price included."
          },
          "etaSeconds": {
            "description": "Fin's estimate of how long it takes, in seconds, from a real quote; omitted without one, when the review says its usual time.",
            "type": "integer",
            "minimum": 1,
            "maximum": 86400
          },
          "amount": {
            "type": "object",
            "properties": {
              "options": {
                "minItems": 1,
                "maxItems": 25,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "pay": {
                      "description": "What Get a swap quote sells, exactly.",
                      "$ref": "#/components/schemas/AssetAmount"
                    },
                    "receive": {
                      "description": "What it gets at today's price.",
                      "$ref": "#/components/schemas/AssetAmount"
                    },
                    "receiveAtLeast": {
                      "description": "The least it gets within the loss limit.",
                      "$ref": "#/components/schemas/AssetAmount"
                    }
                  },
                  "required": [
                    "pay",
                    "receive",
                    "receiveAtLeast"
                  ]
                },
                "description": "Every value − and + can reach, lowest first, each with what follows from it."
              },
              "suggested": {
                "type": "integer",
                "minimum": 0,
                "maximum": 24,
                "description": "The option the review opens on: Fin's choice."
              }
            },
            "required": [
              "options",
              "suggested"
            ],
            "description": "How much to swap."
          }
        },
        "required": [
          "kind",
          "balance",
          "buy",
          "buyPriceUsd",
          "maxValueLossBps",
          "amount"
        ],
        "description": "Swap now: what you pay against what you get."
      },
      "LimitOrderReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "limit_order",
            "description": "Which review this is."
          },
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ],
            "description": "Whether it buys or sells the asset."
          },
          "asset": {
            "description": "The asset the order buys or sells.",
            "$ref": "#/components/schemas/ReviewAsset"
          },
          "marketPriceUsd": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$",
            "description": "One unit of the asset now."
          },
          "spend": {
            "description": "What a buy spends or a sell sells.",
            "$ref": "#/components/schemas/AssetAmount"
          },
          "holding": {
            "description": "A sell: what you hold of the asset.",
            "$ref": "#/components/schemas/AssetAmount"
          },
          "expiresInHours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 720,
            "description": "How long the order rests."
          },
          "price": {
            "type": "object",
            "properties": {
              "options": {
                "minItems": 1,
                "maxItems": 25,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/OrderPriceOption"
                },
                "description": "Every value − and + can reach, lowest first, each with what follows from it."
              },
              "suggested": {
                "type": "integer",
                "minimum": 0,
                "maximum": 24,
                "description": "The option the review opens on: Fin's choice."
              }
            },
            "required": [
              "options",
              "suggested"
            ],
            "description": "Your price."
          }
        },
        "required": [
          "kind",
          "side",
          "asset",
          "marketPriceUsd",
          "spend",
          "expiresInHours",
          "price"
        ],
        "description": "A limit buy or sell: your price against the market."
      },
      "OrderMoveReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "order_move",
            "description": "Which review this is."
          },
          "orderId": {
            "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 order's `id`, as List orders names it."
          },
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ],
            "description": "Whether it buys or sells the asset."
          },
          "asset": {
            "$ref": "#/components/schemas/ReviewAsset"
          },
          "marketPriceUsd": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$",
            "description": "One unit of the asset now."
          },
          "spend": {
            "description": "What the order spends or sells; the move keeps it.",
            "$ref": "#/components/schemas/AssetAmount"
          },
          "current": {
            "type": "object",
            "properties": {
              "limitPriceUsd": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$",
                "description": "Its price now."
              },
              "receive": {
                "description": "What it gets at that price.",
                "$ref": "#/components/schemas/AssetAmount"
              },
              "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": "When it expires as it rests now."
              }
            },
            "required": [
              "limitPriceUsd",
              "receive",
              "expiresAt"
            ],
            "description": "The order as it rests now."
          },
          "expiresInHours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 720,
            "description": "How long the new order rests."
          },
          "price": {
            "type": "object",
            "properties": {
              "options": {
                "minItems": 1,
                "maxItems": 25,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/OrderPriceOption"
                },
                "description": "Every value − and + can reach, lowest first, each with what follows from it."
              },
              "suggested": {
                "type": "integer",
                "minimum": 0,
                "maximum": 24,
                "description": "The option the review opens on: Fin's choice."
              }
            },
            "required": [
              "options",
              "suggested"
            ],
            "description": "The new price. An option at the current price renews the order as it is."
          }
        },
        "required": [
          "kind",
          "orderId",
          "side",
          "asset",
          "marketPriceUsd",
          "spend",
          "current",
          "expiresInHours",
          "price"
        ],
        "description": "Move an order: cancel it and place the same order at a new price, or at its own price to renew it."
      },
      "OrderCancelReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "order_cancel",
            "description": "Which review this is."
          },
          "orderId": {
            "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 order's `id`, as List orders names it."
          },
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ],
            "description": "Whether it buys or sells the asset."
          },
          "asset": {
            "$ref": "#/components/schemas/ReviewAsset"
          },
          "spend": {
            "description": "What the order spends or sells.",
            "$ref": "#/components/schemas/AssetAmount"
          },
          "limitPriceUsd": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$",
            "description": "Its price."
          },
          "placedAt": {
            "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 it was placed."
          },
          "filledBps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "How much has filled: 0 is nothing."
          },
          "returns": {
            "description": "What comes back to the account.",
            "$ref": "#/components/schemas/AssetAmount"
          },
          "filled": {
            "description": "What has filled and stays; omitted for none.",
            "$ref": "#/components/schemas/AssetAmount"
          },
          "etaSeconds": {
            "description": "Fin's estimate of how long it takes, in seconds, from a real quote; omitted without one, when the review says its usual time.",
            "type": "integer",
            "minimum": 1,
            "maximum": 86400
          }
        },
        "required": [
          "kind",
          "orderId",
          "side",
          "asset",
          "spend",
          "limitPriceUsd",
          "placedAt",
          "filledBps",
          "returns"
        ],
        "description": "Cancel an order: what it was, and what comes back."
      },
      "RecurringBuyReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "recurring_buy",
            "description": "Which review this is."
          },
          "asset": {
            "description": "What each run buys.",
            "$ref": "#/components/schemas/ReviewAsset"
          },
          "balance": {
            "description": "What each run spends from, and what you hold of it.",
            "$ref": "#/components/schemas/AssetAmount"
          },
          "schedule": {
            "$ref": "#/components/schemas/ReviewSchedule"
          },
          "upcoming": {
            "maxItems": 8,
            "type": "array",
            "items": {
              "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": "An instant in RFC 3339, such as `2026-11-07T09:00:00Z`."
            },
            "description": "The next runs, first first."
          },
          "maxRuns": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "description": "How many buys it makes at most."
          },
          "endsAt": {
            "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 it ends."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000,
            "description": "The most one buy may lose."
          },
          "askEachTime": {
            "type": "boolean",
            "description": "Fin's pick for asking before each buy."
          },
          "amount": {
            "type": "object",
            "properties": {
              "options": {
                "minItems": 1,
                "maxItems": 25,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "perRun": {
                      "$ref": "#/components/schemas/RunSpend"
                    },
                    "receiveEach": {
                      "description": "What each buy gets at today's price.",
                      "$ref": "#/components/schemas/AssetAmount"
                    },
                    "runsCovered": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100000,
                      "description": "How many of `upcoming` your balance pays for."
                    }
                  },
                  "required": [
                    "perRun",
                    "receiveEach",
                    "runsCovered"
                  ]
                },
                "description": "Every value − and + can reach, lowest first, each with what follows from it."
              },
              "suggested": {
                "type": "integer",
                "minimum": 0,
                "maximum": 24,
                "description": "The option the review opens on: Fin's choice."
              }
            },
            "required": [
              "options",
              "suggested"
            ],
            "description": "What each run spends."
          }
        },
        "required": [
          "kind",
          "asset",
          "balance",
          "schedule",
          "upcoming",
          "maxRuns",
          "endsAt",
          "maxValueLossBps",
          "askEachTime",
          "amount"
        ],
        "description": "A recurring buy: the runs your money covers."
      },
      "PriceRuleReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "price_rule",
            "description": "Which review this is."
          },
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ],
            "description": "Whether it buys or sells the asset."
          },
          "direction": {
            "type": "string",
            "enum": [
              "below",
              "above"
            ],
            "description": "Whether it runs once the price drops below its line or rises above it."
          },
          "asset": {
            "description": "The asset it watches and trades.",
            "$ref": "#/components/schemas/ReviewAsset"
          },
          "marketPriceUsd": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$",
            "description": "One unit of the asset now."
          },
          "spend": {
            "description": "What a buy spends or a sell sells.",
            "$ref": "#/components/schemas/AssetAmount"
          },
          "holding": {
            "description": "A sell: what you hold of the asset.",
            "$ref": "#/components/schemas/AssetAmount"
          },
          "history": {
            "type": "object",
            "properties": {
              "from": {
                "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": "An instant in RFC 3339, such as `2026-11-07T09:00:00Z`."
              },
              "to": {
                "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": "An instant in RFC 3339, such as `2026-11-07T09:00:00Z`."
              },
              "closesUsd": {
                "maxItems": 400,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$",
                  "description": "US dollars as exact decimal text, such as `4.80` or `82732`; never a float."
                },
                "description": "Daily closes, oldest first."
              }
            },
            "required": [
              "from",
              "to",
              "closesUsd"
            ],
            "description": "The chart's line."
          },
          "maxRuns": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "description": "How many times it runs: 1 runs once."
          },
          "checkEveryMinutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440,
            "description": "How often it checks the price."
          },
          "endsAt": {
            "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 it ends."
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000,
            "description": "The most it may lose when it runs."
          },
          "threshold": {
            "type": "object",
            "properties": {
              "options": {
                "minItems": 1,
                "maxItems": 25,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "thresholdUsd": {
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$",
                      "description": "The price that starts it."
                    },
                    "distanceBps": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000000,
                      "description": "How far that is from today's price."
                    },
                    "receive": {
                      "description": "A sell: the least it receives there; a buy: what it buys there.",
                      "$ref": "#/components/schemas/AssetAmount"
                    }
                  },
                  "required": [
                    "thresholdUsd",
                    "distanceBps",
                    "receive"
                  ]
                },
                "description": "Every value − and + can reach, lowest first, each with what follows from it."
              },
              "suggested": {
                "type": "integer",
                "minimum": 0,
                "maximum": 24,
                "description": "The option the review opens on: Fin's choice."
              }
            },
            "required": [
              "options",
              "suggested"
            ],
            "description": "The price line."
          }
        },
        "required": [
          "kind",
          "side",
          "direction",
          "asset",
          "marketPriceUsd",
          "spend",
          "history",
          "maxRuns",
          "checkEveryMinutes",
          "endsAt",
          "maxValueLossBps",
          "threshold"
        ],
        "description": "Buy or sell once a price crosses a line."
      },
      "SummaryReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "summary",
            "description": "Which review this is."
          },
          "schedule": {
            "$ref": "#/components/schemas/ReviewSchedule"
          },
          "preview": {
            "type": "string",
            "minLength": 1,
            "maxLength": 600,
            "description": "A sample of the first summary, written by Fin from the account: plain text."
          },
          "thread": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The page whose thread it writes in: `home`."
          },
          "time": {
            "type": "object",
            "properties": {
              "options": {
                "minItems": 1,
                "maxItems": 25,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "time": {
                      "type": "string",
                      "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
                      "description": "Local time of day, 24-hour."
                    },
                    "firstAt": {
                      "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 first one comes."
                    }
                  },
                  "required": [
                    "time",
                    "firstAt"
                  ]
                },
                "description": "Every value − and + can reach, lowest first, each with what follows from it."
              },
              "suggested": {
                "type": "integer",
                "minimum": 0,
                "maximum": 24,
                "description": "The option the review opens on: Fin's choice."
              }
            },
            "required": [
              "options",
              "suggested"
            ],
            "description": "The time of day it comes."
          }
        },
        "required": [
          "kind",
          "schedule",
          "preview",
          "thread",
          "time"
        ],
        "description": "A summary Fin writes on a schedule; no money moves."
      },
      "DepositReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "deposit",
            "description": "Which review this is."
          },
          "asset": {
            "description": "What is sent and on which chain.",
            "$ref": "#/components/schemas/ReviewAsset"
          },
          "room": {
            "description": "The deposit limit, what the account holds against it, and what is left; omitted when no limit applies.",
            "type": "object",
            "properties": {
              "limitUsd": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$",
                "description": "US dollars as exact decimal text, such as `4.80` or `82732`; never a float."
              },
              "usedUsd": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$",
                "description": "US dollars as exact decimal text, such as `4.80` or `82732`; never a float."
              },
              "leftUsd": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$",
                "description": "US dollars as exact decimal text, such as `4.80` or `82732`; never a float."
              }
            },
            "required": [
              "limitUsd",
              "usedUsd",
              "leftUsd"
            ]
          },
          "networkFeeUsd": {
            "description": "Fin's estimate of the sending chain's fee; omitted without one.",
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$"
          },
          "etaSeconds": {
            "description": "Fin's estimate of how long it takes, in seconds, from a real quote; omitted without one, when the review says its usual time.",
            "type": "integer",
            "minimum": 1,
            "maximum": 86400
          },
          "amount": {
            "type": "object",
            "properties": {
              "options": {
                "minItems": 1,
                "maxItems": 25,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "deposit": {
                      "$ref": "#/components/schemas/AssetAmount"
                    },
                    "usd": {
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$",
                      "description": "Its worth now."
                    },
                    "leftAfterUsd": {
                      "description": "What is left of the room after it; omitted when no limit applies.",
                      "type": "string",
                      "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$"
                    }
                  },
                  "required": [
                    "deposit",
                    "usd"
                  ]
                },
                "description": "Every value − and + can reach, lowest first, each with what follows from it."
              },
              "suggested": {
                "type": "integer",
                "minimum": 0,
                "maximum": 24,
                "description": "The option the review opens on: Fin's choice."
              }
            },
            "required": [
              "options",
              "suggested"
            ],
            "description": "How much to deposit."
          }
        },
        "required": [
          "kind",
          "asset",
          "amount"
        ],
        "description": "Add money from the connected wallet."
      },
      "WithdrawReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "withdraw",
            "description": "Which review this is."
          },
          "balance": {
            "description": "What you hold of the asset.",
            "$ref": "#/components/schemas/AssetAmount"
          },
          "destination": {
            "description": "Your own wallet, the only place a withdrawal goes, when Fin knows its address; otherwise your app's own connected wallet.",
            "type": "object",
            "properties": {
              "address": {
                "type": "string",
                "pattern": "^[\\x21-\\x7e]{1,256}$",
                "description": "The wallet's address on its network."
              },
              "network": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9-]{0,63}$",
                "description": "The network, as List supported assets names it."
              }
            },
            "required": [
              "address",
              "network"
            ]
          },
          "etaSeconds": {
            "description": "Fin's estimate of how long it takes, in seconds, from a real quote; omitted without one, when the review says its usual time.",
            "type": "integer",
            "minimum": 1,
            "maximum": 86400
          },
          "amount": {
            "type": "object",
            "properties": {
              "options": {
                "minItems": 1,
                "maxItems": 25,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "withdraw": {
                      "$ref": "#/components/schemas/AssetAmount"
                    },
                    "fee": {
                      "description": "The fee, from a real quote; omitted without one.",
                      "$ref": "#/components/schemas/AssetAmount"
                    },
                    "arrivesAtLeast": {
                      "description": "The least that arrives, from a real quote; omitted without one.",
                      "$ref": "#/components/schemas/AssetAmount"
                    },
                    "stays": {
                      "description": "What stays in the account.",
                      "$ref": "#/components/schemas/AssetAmount"
                    }
                  },
                  "required": [
                    "withdraw",
                    "stays"
                  ]
                },
                "description": "Every value − and + can reach, lowest first, each with what follows from it."
              },
              "suggested": {
                "type": "integer",
                "minimum": 0,
                "maximum": 24,
                "description": "The option the review opens on: Fin's choice."
              }
            },
            "required": [
              "options",
              "suggested"
            ],
            "description": "How much to withdraw."
          }
        },
        "required": [
          "kind",
          "balance",
          "amount"
        ],
        "description": "Move money back to your own wallet."
      },
      "SendReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "send",
            "description": "Which review this is."
          },
          "contactId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "Your app's contact."
          },
          "purpose": {
            "description": "What it is for, in Fin's words.",
            "type": "string",
            "maxLength": 80
          },
          "balance": {
            "$ref": "#/components/schemas/AssetAmount"
          },
          "etaSeconds": {
            "description": "Fin's estimate of how long it takes, in seconds, from a real quote; omitted without one, when the review says its usual time.",
            "type": "integer",
            "minimum": 1,
            "maximum": 86400
          },
          "amount": {
            "type": "object",
            "properties": {
              "options": {
                "minItems": 1,
                "maxItems": 25,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "send": {
                      "$ref": "#/components/schemas/AssetAmount"
                    },
                    "fee": {
                      "$ref": "#/components/schemas/AssetAmount"
                    },
                    "arrivesAtLeast": {
                      "$ref": "#/components/schemas/AssetAmount"
                    }
                  },
                  "required": [
                    "send"
                  ]
                },
                "description": "Every value − and + can reach, lowest first, each with what follows from it."
              },
              "suggested": {
                "type": "integer",
                "minimum": 0,
                "maximum": 24,
                "description": "The option the review opens on: Fin's choice."
              }
            },
            "required": [
              "options",
              "suggested"
            ],
            "description": "How much to send."
          }
        },
        "required": [
          "kind",
          "contactId",
          "balance",
          "amount"
        ],
        "description": "Send to a saved contact. Fin does not suggest it yet."
      },
      "PerpsFundReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "perps_fund",
            "description": "Which review this is."
          },
          "balance": {
            "$ref": "#/components/schemas/AssetAmount"
          },
          "etaSeconds": {
            "description": "Fin's estimate of how long it takes, in seconds, from a real quote; omitted without one, when the review says its usual time.",
            "type": "integer",
            "minimum": 1,
            "maximum": 86400
          },
          "amount": {
            "type": "object",
            "properties": {
              "options": {
                "minItems": 1,
                "maxItems": 25,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "move": {
                      "$ref": "#/components/schemas/AssetAmount"
                    }
                  },
                  "required": [
                    "move"
                  ]
                },
                "description": "Every value − and + can reach, lowest first, each with what follows from it."
              },
              "suggested": {
                "type": "integer",
                "minimum": 0,
                "maximum": 24,
                "description": "The option the review opens on: Fin's choice."
              }
            },
            "required": [
              "options",
              "suggested"
            ],
            "description": "How much to move."
          }
        },
        "required": [
          "kind",
          "balance",
          "amount"
        ],
        "description": "Move margin to the perps account."
      },
      "AutomationPauseReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "automation_pause",
            "description": "Which review this is."
          },
          "automation": {
            "$ref": "#/components/schemas/ReviewAutomation"
          },
          "upcoming": {
            "maxItems": 8,
            "type": "array",
            "items": {
              "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": "An instant in RFC 3339, such as `2026-11-07T09:00:00Z`."
            },
            "description": "The next runs it would make, all skipped while paused."
          },
          "coverage": {
            "$ref": "#/components/schemas/ReviewCoverage"
          }
        },
        "required": [
          "kind",
          "automation",
          "upcoming",
          "coverage"
        ],
        "description": "Pause an automation."
      },
      "AutomationResumeReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "automation_resume",
            "description": "Which review this is."
          },
          "automation": {
            "$ref": "#/components/schemas/ReviewAutomation"
          },
          "upcoming": {
            "maxItems": 8,
            "type": "array",
            "items": {
              "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": "An instant in RFC 3339, such as `2026-11-07T09:00:00Z`."
            },
            "description": "The next runs, first first."
          },
          "coverage": {
            "$ref": "#/components/schemas/ReviewCoverage"
          },
          "endsAt": {
            "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 its approval ends."
          },
          "runsUsed": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "description": "Runs it has made."
          },
          "maxRuns": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "description": "Runs its approval allows in all."
          }
        },
        "required": [
          "kind",
          "automation",
          "upcoming",
          "coverage",
          "endsAt",
          "runsUsed",
          "maxRuns"
        ],
        "description": "Resume a paused automation under the approval it already has."
      },
      "AutomationEndReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "automation_end",
            "description": "Which review this is."
          },
          "automation": {
            "$ref": "#/components/schemas/ReviewAutomation"
          },
          "runs": {
            "type": "object",
            "properties": {
              "done": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000,
                "description": "Runs it made."
              },
              "total": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000,
                "description": "Runs its approval allowed."
              }
            },
            "required": [
              "done",
              "total"
            ],
            "description": "Runs made of the runs approved."
          },
          "stillCovered": {
            "description": "Another automation of yours still watching the asset.",
            "type": "object",
            "properties": {
              "side": {
                "type": "string",
                "enum": [
                  "buy",
                  "sell"
                ],
                "description": "Whether it buys or sells the asset."
              },
              "direction": {
                "type": "string",
                "enum": [
                  "below",
                  "above"
                ],
                "description": "Whether it runs below its line or above it."
              },
              "thresholdUsd": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,17})(\\.\\d{1,18})?$",
                "description": "Its line."
              }
            },
            "required": [
              "side",
              "direction",
              "thresholdUsd"
            ]
          }
        },
        "required": [
          "kind",
          "automation",
          "runs"
        ],
        "description": "End an automation: its history stays, its runs stop."
      },
      "AutomationChangeReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "automation_change",
            "description": "Which review this is."
          },
          "automation": {
            "$ref": "#/components/schemas/ReviewAutomation"
          },
          "balance": {
            "description": "What each run spends from.",
            "$ref": "#/components/schemas/AssetAmount"
          },
          "maxValueLossBps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000,
            "description": "The most one run may lose."
          },
          "current": {
            "type": "object",
            "properties": {
              "perRun": {
                "$ref": "#/components/schemas/RunSpend"
              },
              "lastsRuns": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000,
                "description": "How many runs the balance pays for as it is."
              }
            },
            "required": [
              "perRun",
              "lastsRuns"
            ],
            "description": "As it runs today."
          },
          "amount": {
            "type": "object",
            "properties": {
              "options": {
                "minItems": 1,
                "maxItems": 25,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "perRun": {
                      "$ref": "#/components/schemas/RunSpend"
                    },
                    "receiveEach": {
                      "description": "What each run gets at today's price.",
                      "$ref": "#/components/schemas/AssetAmount"
                    },
                    "lastsRuns": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100000,
                      "description": "How many runs the balance pays for at this amount."
                    },
                    "lastsUntil": {
                      "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 balance runs out at this amount."
                    }
                  },
                  "required": [
                    "perRun",
                    "receiveEach",
                    "lastsRuns",
                    "lastsUntil"
                  ]
                },
                "description": "Every value − and + can reach, lowest first, each with what follows from it."
              },
              "suggested": {
                "type": "integer",
                "minimum": 0,
                "maximum": 24,
                "description": "The option the review opens on: Fin's choice."
              }
            },
            "required": [
              "options",
              "suggested"
            ],
            "description": "What each run spends."
          }
        },
        "required": [
          "kind",
          "automation",
          "balance",
          "maxValueLossBps",
          "current",
          "amount"
        ],
        "description": "Change what each run of an automation spends."
      },
      "AskReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "ask",
            "description": "Which review this is."
          },
          "question": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300,
            "description": "The question the chat opens with."
          }
        },
        "required": [
          "kind",
          "question"
        ],
        "description": "Ask Fin: opens the page's chat with the question."
      },
      "OpenReview": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "open",
            "description": "Which review this is."
          },
          "targetId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Your app's id for the form."
          },
          "amount": {
            "description": "What Fin fills in.",
            "$ref": "#/components/schemas/AssetAmount"
          }
        },
        "required": [
          "kind",
          "targetId"
        ],
        "description": "A product Fin cannot run for you: its own form, filled in. Fin does not suggest it yet."
      },
      "ReviewTerms": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/SwapReview"
          },
          {
            "$ref": "#/components/schemas/LimitOrderReview"
          },
          {
            "$ref": "#/components/schemas/OrderMoveReview"
          },
          {
            "$ref": "#/components/schemas/OrderCancelReview"
          },
          {
            "$ref": "#/components/schemas/RecurringBuyReview"
          },
          {
            "$ref": "#/components/schemas/PriceRuleReview"
          },
          {
            "$ref": "#/components/schemas/SummaryReview"
          },
          {
            "$ref": "#/components/schemas/DepositReview"
          },
          {
            "$ref": "#/components/schemas/WithdrawReview"
          },
          {
            "$ref": "#/components/schemas/SendReview"
          },
          {
            "$ref": "#/components/schemas/PerpsFundReview"
          },
          {
            "$ref": "#/components/schemas/AutomationPauseReview"
          },
          {
            "$ref": "#/components/schemas/AutomationResumeReview"
          },
          {
            "$ref": "#/components/schemas/AutomationEndReview"
          },
          {
            "$ref": "#/components/schemas/AutomationChangeReview"
          },
          {
            "$ref": "#/components/schemas/AskReview"
          },
          {
            "$ref": "#/components/schemas/OpenReview"
          }
        ],
        "description": "The exact terms a suggestion's review draws, keyed by `kind`: every id and asset the move needs, and the one figure − and + adjust."
      },
      "NotificationOption": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "The option, verb first: `Protect the rest`."
          },
          "detail": {
            "type": "string",
            "minLength": 1,
            "maxLength": 140,
            "description": "Its terms in one line: `Sell only if it falls another 5%, to $1,696.`"
          },
          "button": {
            "type": "string",
            "minLength": 1,
            "maxLength": 24,
            "description": "Its button's label: `Set it`."
          },
          "review": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AskReview"
              },
              {
                "$ref": "#/components/schemas/OpenReview"
              }
            ],
            "description": "What choosing it does: `ask` opens fin's chat with `question` as the user's message, and fin proposes and waits for the user's approval as always; `open` opens a product's own form, filled in (`targetId` `earn`: Earn, with the amount to put in)."
          }
        },
        "required": [
          "title",
          "detail",
          "button",
          "review"
        ],
        "description": "One way to act on one of fin's notices. It only opens fin's chat or a form: nothing moves until the user approves it."
      },
      "PartnerUsage": {
        "type": "object",
        "properties": {
          "periodKind": {
            "type": "string",
            "enum": [
              "day",
              "month"
            ],
            "description": "Original UTC budget period, day or calendar month."
          },
          "periodStart": {
            "type": "string",
            "format": "date",
            "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])))$",
            "description": "UTC period start date; month periods begin on day one."
          },
          "asOf": {
            "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": "UTC database snapshot time for this page and totals; later pages may see newer settlements."
          },
          "totals": {
            "type": "object",
            "properties": {
              "knownCostCents": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Exact nonnegative USD integer cents; never a floating-point amount."
              },
              "reservedCents": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Maximum cents retained for every unresolved invocation, including uncertain dispatch. Not known spend."
              },
              "uncertainReservedCents": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Subset of reservedCents whose dispatch may have incurred a charge."
              },
              "invocationCount": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Exact invocation count in this period, encoded as a decimal string."
              },
              "unresolvedCount": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Exact count without a known final charge, encoded as a decimal string."
              }
            },
            "required": [
              "knownCostCents",
              "reservedCents",
              "uncertainReservedCents",
              "invocationCount",
              "unresolvedCount"
            ],
            "description": "Canonical aggregate inference usage for this partner and original period, including its users' runs, its own runs, suggestions and voice transcriptions."
          },
          "suggestionTotals": {
            "description": "The portion of totals incurred by suggestion sets, which have no run or agent attribution. Emitted by current servers; older servers omit it.",
            "type": "object",
            "properties": {
              "knownCostCents": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Exact nonnegative USD integer cents; never a floating-point amount."
              },
              "reservedCents": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Maximum cents retained for every unresolved invocation, including uncertain dispatch. Not known spend."
              },
              "uncertainReservedCents": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Subset of reservedCents whose dispatch may have incurred a charge."
              },
              "invocationCount": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Exact invocation count in this period, encoded as a decimal string."
              },
              "unresolvedCount": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Exact count without a known final charge, encoded as a decimal string."
              }
            },
            "required": [
              "knownCostCents",
              "reservedCents",
              "uncertainReservedCents",
              "invocationCount",
              "unresolvedCount"
            ]
          },
          "voiceTotals": {
            "description": "The portion of totals incurred by voice transcriptions (Transcribe a recording), which have no run or agent attribution. Emitted by current servers; older servers omit it.",
            "type": "object",
            "properties": {
              "knownCostCents": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Exact nonnegative USD integer cents; never a floating-point amount."
              },
              "reservedCents": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Maximum cents retained for every unresolved invocation, including uncertain dispatch. Not known spend."
              },
              "uncertainReservedCents": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Subset of reservedCents whose dispatch may have incurred a charge."
              },
              "invocationCount": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Exact invocation count in this period, encoded as a decimal string."
              },
              "unresolvedCount": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Exact count without a known final charge, encoded as a decimal string."
              }
            },
            "required": [
              "knownCostCents",
              "reservedCents",
              "uncertainReservedCents",
              "invocationCount",
              "unresolvedCount"
            ]
          },
          "partnerRunTotals": {
            "description": "The portion of totals incurred by runs Fin makes for the partner itself, such as market briefs, which have no user or agent and are not in this page. Emitted by current servers; older servers omit it.",
            "type": "object",
            "properties": {
              "knownCostCents": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Exact nonnegative USD integer cents; never a floating-point amount."
              },
              "reservedCents": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Maximum cents retained for every unresolved invocation, including uncertain dispatch. Not known spend."
              },
              "uncertainReservedCents": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Subset of reservedCents whose dispatch may have incurred a charge."
              },
              "invocationCount": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Exact invocation count in this period, encoded as a decimal string."
              },
              "unresolvedCount": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Exact count without a known final charge, encoded as a decimal string."
              }
            },
            "required": [
              "knownCostCents",
              "reservedCents",
              "uncertainReservedCents",
              "invocationCount",
              "unresolvedCount"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "invocationId": {
                  "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": "Canonical model invocation UUID; export pagination advances by this identity."
                },
                "runId": {
                  "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": "Root run UUID; continuations retain this root attribution."
                },
                "userId": {
                  "type": "string",
                  "description": "Your identifier for the user whose run incurred this usage."
                },
                "agentId": {
                  "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": "Persistent admitted agent identity owned by this user."
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "reserved",
                    "dispatched",
                    "uncertain",
                    "settled",
                    "released"
                  ],
                  "description": "Retained accounting state of this model invocation."
                },
                "maximumCostCents": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$",
                  "description": "Exact nonnegative USD integer cents; never a floating-point amount."
                },
                "actualCostCents": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(0|[1-9][0-9]*)$",
                      "description": "Exact nonnegative USD integer cents; never a floating-point amount."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Known provider charge in integer USD cents; null is unknown, never zero."
                },
                "reservedCents": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$",
                  "description": "Exact nonnegative USD integer cents; never a floating-point amount."
                },
                "uncertain": {
                  "type": "boolean",
                  "description": "Whether dispatch may have incurred an unestablished charge."
                }
              },
              "required": [
                "invocationId",
                "runId",
                "userId",
                "agentId",
                "status",
                "maximumCostCents",
                "actualCostCents",
                "reservedCents",
                "uncertain"
              ]
            },
            "description": "Bounded page of the model invocation facts of your users' runs. Suggestions, voice transcriptions and the partner's own runs are included in totals, suggestionTotals, voiceTotals and partnerRunTotals, not this page. No prompt, key or raw provider payload."
          },
          "nextCursor": {
            "description": "Opaque continuation cursor; pass as cursor for the next page, or null at the end.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "periodKind",
          "periodStart",
          "asOf",
          "totals",
          "data",
          "nextCursor"
        ],
        "description": "Owner-scoped inference usage and export. Uses each invocation's original UTC budget period, including continuations. Null actual cost is unknown, never zero. No financial trading balances or customer billing are represented."
      },
      "PartnerQuotas": {
        "type": "object",
        "properties": {
          "limits": {
            "type": "object",
            "properties": {
              "requestsPerMinute": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Authenticated requests permitted in one fixed database-clock UTC minute."
              },
              "activeRuns": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Running root-run ceiling or current count; durable pauses release active capacity."
              },
              "activeStreams": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unexpired partner stream lease ceiling or current count."
              },
              "userStreams": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Concurrent stream limit for one user within the partner ceiling."
              },
              "dayCapCents": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Exact nonnegative USD integer cents; never a floating-point amount."
              },
              "monthCapCents": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$",
                "description": "Exact nonnegative USD integer cents; never a floating-point amount."
              }
            },
            "required": [
              "requestsPerMinute",
              "activeRuns",
              "activeStreams",
              "userStreams",
              "dayCapCents",
              "monthCapCents"
            ],
            "description": "Configured partner admission ceilings across all keys and replicas."
          },
          "current": {
            "type": "object",
            "properties": {
              "activeRuns": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Running root-run ceiling or current count; durable pauses release active capacity."
              },
              "activeStreams": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unexpired partner stream lease ceiling or current count."
              },
              "requestsUsed": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Accepted authenticated requests in the current fixed minute."
              }
            },
            "required": [
              "activeRuns",
              "activeStreams",
              "requestsUsed"
            ],
            "description": "Current shared utilization; observations do not reserve capacity."
          },
          "periods": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "knownCostCents": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$",
                  "description": "Exact nonnegative USD integer cents; never a floating-point amount."
                },
                "reservedCents": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$",
                  "description": "Maximum cents retained for every unresolved invocation, including uncertain dispatch. Not known spend."
                },
                "uncertainReservedCents": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$",
                  "description": "Subset of reservedCents whose dispatch may have incurred a charge."
                },
                "invocationCount": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$",
                  "description": "Exact invocation count in this period, encoded as a decimal string."
                },
                "unresolvedCount": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$",
                  "description": "Exact count without a known final charge, encoded as a decimal string."
                },
                "periodKind": {
                  "type": "string",
                  "enum": [
                    "day",
                    "month"
                  ],
                  "description": "Original UTC budget period, day or calendar month."
                },
                "periodStart": {
                  "type": "string",
                  "format": "date",
                  "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])))$",
                  "description": "UTC period start date; month periods begin on day one."
                },
                "capCents": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$",
                  "description": "Effective cap for this UTC period, including any audited operator adjustment."
                }
              },
              "required": [
                "knownCostCents",
                "reservedCents",
                "uncertainReservedCents",
                "invocationCount",
                "unresolvedCount",
                "periodKind",
                "periodStart",
                "capCents"
              ]
            },
            "description": "Current day and month effective caps with canonical usage totals."
          },
          "streamLeaseSeconds": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Shared stream lease lifetime; replicas renew or close before losing ownership."
          }
        },
        "required": [
          "limits",
          "current",
          "periods",
          "streamLeaseSeconds"
        ],
        "description": "Shared partner limits aggregate every key, user and API replica. Period caps include any audited operator adjustments; configured limits otherwise take effect when a period opens. Values are instantaneous observations, not a capacity reservation."
      },
      "PerpsPosition": {
        "type": "object",
        "properties": {
          "coin": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "The market's coin name as Hyperliquid lists it, such as `BTC`, or `xyz:TSLA` on trade.xyz."
          },
          "size": {
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
            "description": "Signed size in the coin: positive for a long position, negative for a short one."
          },
          "entryPriceUsd": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Average entry price in US dollars; null when Hyperliquid reports none, not zero."
          },
          "positionValueUsd": {
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
            "description": "What the position is worth at the mark price, in US dollars: its notional, not equity."
          },
          "unrealizedPnlUsd": {
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
            "description": "Unrealized profit (positive) or loss (negative) in US dollars, already part of `accountValueUsd`."
          },
          "fundingSinceOpenUsd": {
            "description": "Funding paid by the whole position since it opened, in US dollars; positive is paid, negative is received. Absent when the venue did not report it.",
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
          },
          "marginUsedUsd": {
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
            "description": "Margin this position holds, in US dollars."
          },
          "liquidationPriceUsd": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Price at which Hyperliquid liquidates the position; null when there is none."
          },
          "leverage": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "description": "The position's leverage multiplier."
          },
          "marginMode": {
            "type": "string",
            "enum": [
              "cross",
              "isolated"
            ],
            "description": "`cross` shares its dex's account margin with every cross position there; `isolated` holds its own."
          }
        },
        "required": [
          "coin",
          "size",
          "entryPriceUsd",
          "positionValueUsd",
          "unrealizedPnlUsd",
          "marginUsedUsd",
          "liquidationPriceUsd",
          "leverage",
          "marginMode"
        ],
        "description": "One open perpetual position, as Hyperliquid reported it with the account."
      },
      "PerpsAccountState": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "observed",
                "description": "The venue returned a valid account observation."
              },
              "observedAt": {
                "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 account state was read."
              },
              "accountValueUsd": {
                "type": "string",
                "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
                "description": "Account value in US dollars, across Hyperliquid's main dex and trade.xyz."
              },
              "withdrawableUsd": {
                "type": "string",
                "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
                "description": "Withdrawable value in US dollars, across Hyperliquid's main dex and trade.xyz."
              },
              "marginUsedUsd": {
                "type": "string",
                "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
                "description": "Margin in use in US dollars, across Hyperliquid's main dex and trade.xyz."
              },
              "positionCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "The number of positions with a nonzero size, on either dex."
              },
              "positions": {
                "maxItems": 100,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PerpsPosition"
                },
                "description": "Each open position on either dex, largest `positionValueUsd` first, at most 100; `positionCount` counts them all. Their unrealized PnL is already in `accountValueUsd`, so never add their value to it."
              }
            },
            "required": [
              "status",
              "observedAt",
              "accountValueUsd",
              "withdrawableUsd",
              "marginUsedUsd",
              "positionCount",
              "positions"
            ]
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "unavailable",
                "description": "The account state could not be observed."
              },
              "reason": {
                "type": "string",
                "enum": [
                  "provider_unavailable",
                  "invalid_response"
                ],
                "description": "Why the venue observation is unavailable."
              }
            },
            "required": [
              "status",
              "reason"
            ]
          }
        ],
        "description": "A live observation of the perps account, or why its state could not be read."
      },
      "PerpsAccount": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{40}$",
            "description": "The agent's Hyperliquid address, as lowercase hexadecimal."
          },
          "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 perps account was first opened."
          },
          "state": {
            "$ref": "#/components/schemas/PerpsAccountState"
          }
        },
        "required": [
          "address",
          "createdAt",
          "state"
        ],
        "description": "The agent's Hyperliquid perpetuals account and its current venue observation."
      },
      "PortfolioAssetRef": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "token"
              },
              "assetId": {
                "type": "string",
                "pattern": "^asset_[a-f0-9]{64}$",
                "description": "The asset's `assetId`, as Get balances and the wallet's other routes name it."
              }
            },
            "required": [
              "kind",
              "assetId"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "solana"
              },
              "mint": {
                "type": "string",
                "minLength": 32,
                "maxLength": 44,
                "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                "description": "The Solana token's mint address."
              }
            },
            "required": [
              "kind",
              "mint"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "sol",
                "description": "Native SOL in the agent's Solana account, which has no mint of its own."
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "polymarket"
              },
              "tokenId": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]{0,77})$",
                "description": "The outcome token's id, the `assetId` a prediction order and Get prediction account name."
              }
            },
            "required": [
              "kind",
              "tokenId"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "usd",
                "description": "US dollars: perps account equity, or Polymarket's pUSD."
              }
            },
            "required": [
              "kind"
            ]
          }
        ],
        "description": "Which asset a portfolio row is: `token` (an agent wallet asset), `solana` (a token by its mint), `sol` (native SOL), `polymarket` (an outcome's shares) or `usd`."
      },
      "Portfolio": {
        "type": "object",
        "properties": {
          "asOf": {
            "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 moment these figures value the portfolio at."
          },
          "totalUsdMicros": {
            "type": "string",
            "maxLength": 164,
            "pattern": "^(0|[1-9]\\d*)$",
            "description": "What every account is worth together, in millionths of a US dollar: the sum of the accounts' `valueUsdMicros`. Holdings in `excluded` are not counted. It equals the last point of Get portfolio history."
          },
          "provisional": {
            "type": "boolean",
            "description": "True when any account is: part of the total has not yet been confirmed against its custodian. Show the figure and say it is unconfirmed."
          },
          "accounts": {
            "maxItems": 6,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "account": {
                  "type": "string",
                  "enum": [
                    "wallet",
                    "orders",
                    "solana",
                    "polymarket",
                    "perps",
                    "transit"
                  ],
                  "description": "Which account: `wallet` (the agent wallet), `orders` (funds held by its open limit orders), `solana`, `polymarket`, `perps`, or `transit` (money on its way from one of these accounts to another)."
                },
                "valueUsdMicros": {
                  "type": "string",
                  "maxLength": 164,
                  "pattern": "^(0|[1-9]\\d*)$",
                  "description": "What this account's priced holdings are worth, in millionths of a US dollar."
                },
                "confirmedThrough": {
                  "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 account's holdings last matched a read from its custodian; null before the first match."
                },
                "provisional": {
                  "type": "boolean",
                  "description": "True when the value includes changes after `confirmedThrough` that the next custodian read has not yet confirmed."
                }
              },
              "required": [
                "account",
                "valueUsdMicros",
                "confirmedThrough",
                "provisional"
              ]
            },
            "description": "Each account the agent has opened, once."
          },
          "holdings": {
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "account": {
                  "type": "string",
                  "enum": [
                    "wallet",
                    "orders",
                    "solana",
                    "polymarket",
                    "perps",
                    "transit"
                  ],
                  "description": "Which account: `wallet` (the agent wallet), `orders` (funds held by its open limit orders), `solana`, `polymarket`, `perps`, or `transit` (money on its way from one of these accounts to another)."
                },
                "asset": {
                  "$ref": "#/components/schemas/PortfolioAssetRef"
                },
                "symbol": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The asset's ticker symbol; null when no source names it, as for a Polymarket outcome. Show your own label then."
                },
                "name": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The asset's name, when known."
                },
                "iconUrl": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 2048,
                      "pattern": "^(https:\\/\\/\\S+|\\/v1\\/solana\\/tokens\\/[1-9A-HJ-NP-Za-km-z]{32,44}\\/icon)$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Where to load the asset's icon: an https URL, or for a Solana token the path of Get a token icon on this API. Null when none is known; draw a placeholder."
                },
                "decimals": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 255,
                  "description": "How many decimal places `amountRaw` carries."
                },
                "amountRaw": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,38})$",
                  "description": "How much the account holds, in the asset's smallest unit; scale by `decimals` for a human amount."
                },
                "price": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "usd": {
                          "type": "string",
                          "maxLength": 80,
                          "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$",
                          "description": "The price of one whole unit, in US dollars, as an exact decimal string."
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "priced",
                            "carried",
                            "last_trade"
                          ],
                          "description": "How the price was found: `priced` (a recent market price), `carried` (the last market price, up to 24 hours old) or `last_trade` (the user's own last trade of it, when no market prices it)."
                        },
                        "pricedAt": {
                          "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 that price was observed."
                        }
                      },
                      "required": [
                        "usd",
                        "status",
                        "pricedAt"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The price this holding is valued at; null when nothing prices it, and the holding is then listed in `excluded`."
                },
                "valueUsdMicros": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 164,
                      "pattern": "^(0|[1-9]\\d*)$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "What the holding is worth, in millionths of a US dollar; null when `price` is null. A null value is left out of the total, never counted as zero."
                },
                "priceChange24hBps": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "How the price moved over the last 24 hours, in basis points; null when either price is unknown."
                },
                "averageCostUsd": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 80,
                      "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "What the units held cost on average, per whole unit, in US dollars, from the user's own buys; null when none of the holding was bought."
                }
              },
              "required": [
                "account",
                "asset",
                "symbol",
                "name",
                "iconUrl",
                "decimals",
                "amountRaw",
                "price",
                "valueUsdMicros",
                "priceChange24hBps",
                "averageCostUsd"
              ]
            },
            "description": "Each asset each account holds, most valuable first; unpriced holdings last."
          },
          "excluded": {
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "account": {
                  "type": "string",
                  "enum": [
                    "wallet",
                    "orders",
                    "solana",
                    "polymarket",
                    "perps",
                    "transit"
                  ],
                  "description": "Which account: `wallet` (the agent wallet), `orders` (funds held by its open limit orders), `solana`, `polymarket`, `perps`, or `transit` (money on its way from one of these accounts to another)."
                },
                "asset": {
                  "$ref": "#/components/schemas/PortfolioAssetRef"
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "no_price"
                  ],
                  "description": "Why it is not counted: `no_price`, nothing prices it."
                }
              },
              "required": [
                "account",
                "asset",
                "reason"
              ]
            },
            "description": "The holdings left out of the total, and why. Say the total leaves them out rather than reading them as worth zero."
          }
        },
        "required": [
          "asOf",
          "totalUsdMicros",
          "provisional",
          "accounts",
          "holdings",
          "excluded"
        ],
        "description": "Everything the agent owns right now: the total, each account, and each holding with its price and value."
      },
      "PortfolioHistory": {
        "type": "object",
        "properties": {
          "step": {
            "type": "string",
            "pattern": "^(5m|1h|4h|[1-9]\\d{0,3}d)$",
            "description": "How far apart the points are: `5m`, `1h`, `4h`, `1d`, or a number of days (such as `3d`) for a long `all`."
          },
          "points": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "at": {
                  "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 moment this point values the portfolio at."
                },
                "valueUsdMicros": {
                  "type": "string",
                  "maxLength": 164,
                  "pattern": "^(0|[1-9]\\d*)$",
                  "description": "What everything was worth then, in millionths of a US dollar, counting the holdings that had a price."
                },
                "gainUsdMicros": {
                  "type": "string",
                  "maxLength": 165,
                  "pattern": "^(0|-?[1-9]\\d*)$",
                  "description": "The gain from the range's first point through this one, in millionths of a US dollar: the change in value less money in plus money out. A holding entering or leaving the valued set is not gain."
                },
                "provisional": {
                  "type": "boolean",
                  "description": "True when this point includes changes not yet confirmed against a custodian, or values a holding at a carried price."
                },
                "marks": {
                  "description": "What changed at this point that is not gain; absent when nothing did.",
                  "maxItems": 1000,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "coverage_in",
                          "coverage_out",
                          "unexplained"
                        ],
                        "description": "`coverage_in`: a holding started being valued here; `coverage_out`: it stopped (it lost its price); `unexplained`: a change no deposit, withdrawal or trade explains landed here and counts as money in or out."
                      },
                      "asset": {
                        "$ref": "#/components/schemas/PortfolioAssetRef"
                      }
                    },
                    "required": [
                      "kind",
                      "asset"
                    ]
                  }
                }
              },
              "required": [
                "at",
                "valueUsdMicros",
                "gainUsdMicros",
                "provisional"
              ]
            },
            "description": "The value over the range, oldest first. The last point is `asOf` and equals Get portfolio's total."
          },
          "summary": {
            "type": "object",
            "properties": {
              "changeUsdMicros": {
                "type": "string",
                "maxLength": 165,
                "pattern": "^(0|-?[1-9]\\d*)$",
                "description": "How much the value changed over the range: the last point less the first, in millionths of a US dollar."
              },
              "moneyInUsdMicros": {
                "type": "string",
                "maxLength": 164,
                "pattern": "^(0|[1-9]\\d*)$",
                "description": "Money that came in from outside during the range, in millionths of a US dollar: deposits, transfers in and unexplained arrivals. Moves between the agent's own accounts are not counted."
              },
              "moneyOutUsdMicros": {
                "type": "string",
                "maxLength": 164,
                "pattern": "^(0|[1-9]\\d*)$",
                "description": "Money that left for outside during the range, in millionths of a US dollar: withdrawals, transfers out and unexplained departures. Moves between the agent's own accounts are not counted."
              },
              "gainUsdMicros": {
                "type": "string",
                "maxLength": 165,
                "pattern": "^(0|-?[1-9]\\d*)$",
                "description": "The change that was not money in or out, in millionths of a US dollar: the last point's `gainUsdMicros`."
              },
              "gainBps": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The gain as a share of the first point's value plus the money in, in basis points, truncated; 0 when both are 0."
              }
            },
            "required": [
              "changeUsdMicros",
              "moneyInUsdMicros",
              "moneyOutUsdMicros",
              "gainUsdMicros",
              "gainBps"
            ],
            "description": "The range at a glance."
          },
          "asOf": {
            "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 last moment this history represents."
          }
        },
        "required": [
          "step",
          "points",
          "summary",
          "asOf"
        ],
        "description": "Everything the agent owns, valued over a range, with how much of the change was gain."
      },
      "PredictionAccountBalance": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "observed",
                "description": "Polygon answered for the wallet's balance."
              },
              "observedAt": {
                "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 balance was read."
              },
              "pusd": {
                "type": "string",
                "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
                "description": "pUSD (Polymarket USD, backed one to one by USDC) the wallet holds, as an exact decimal."
              }
            },
            "required": [
              "status",
              "observedAt",
              "pusd"
            ]
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "unavailable",
                "description": "The balance could not be read."
              },
              "reason": {
                "type": "string",
                "enum": [
                  "provider_unavailable",
                  "invalid_response"
                ],
                "description": "Why the balance could not be read."
              }
            },
            "required": [
              "status",
              "reason"
            ]
          }
        ],
        "description": "The wallet's pUSD balance read from Polygon, or why it could not be read."
      },
      "PredictionPosition": {
        "type": "object",
        "properties": {
          "assetId": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,77})$",
            "description": "The outcome token's id, the `assetId` a prediction order names."
          },
          "marketQuestion": {
            "type": "string",
            "maxLength": 500,
            "description": "The market's question, as Polymarket titles it."
          },
          "outcome": {
            "type": "string",
            "maxLength": 200,
            "description": "The outcome these shares pay on, such as `Yes`."
          },
          "sizeSharesDecimal": {
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
            "description": "Shares held, as an exact decimal."
          },
          "averagePriceUsdDecimal": {
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
            "description": "Average price paid per share, in US dollars."
          },
          "currentPriceUsdDecimal": {
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
            "description": "Polymarket's current price per share, in US dollars."
          },
          "currentValueUsdDecimal": {
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
            "description": "What the shares are worth at the current price, in US dollars."
          },
          "costUsdDecimal": {
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
            "description": "What the shares cost, in US dollars."
          },
          "unrealizedPnlUsdDecimal": {
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
            "description": "Current value less cost, in US dollars: positive for a gain, negative for a loss."
          },
          "redeemable": {
            "type": "boolean",
            "description": "The market settled for this outcome and its winning shares await redemption."
          }
        },
        "required": [
          "assetId",
          "marketQuestion",
          "outcome",
          "sizeSharesDecimal",
          "averagePriceUsdDecimal",
          "currentPriceUsdDecimal",
          "currentValueUsdDecimal",
          "costUsdDecimal",
          "unrealizedPnlUsdDecimal",
          "redeemable"
        ],
        "description": "One Polymarket position the wallet holds, valued as Polymarket shows it."
      },
      "PredictionAccountPositions": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "observed",
                "description": "Polymarket answered for the wallet's positions."
              },
              "observedAt": {
                "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 Fin read the positions: the time of this read, or of the last one when `stale` is true."
              },
              "stale": {
                "type": "boolean",
                "description": "True when Polymarket rate-limited this read and these are the last positions Fin read within the past hour, as of `observedAt`. They may no longer be what the wallet holds: show them as last known with their time, and never size a sale or set a maximum from them."
              },
              "positions": {
                "maxItems": 100,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PredictionPosition"
                },
                "description": "Each open position, settled winners not yet redeemed included, largest `currentValueUsdDecimal` first."
              },
              "truncated": {
                "type": "boolean",
                "description": "True when the wallet holds more than the 100 positions listed, so their values do not add up to everything it holds."
              }
            },
            "required": [
              "status",
              "observedAt",
              "stale",
              "positions",
              "truncated"
            ]
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "unavailable",
                "description": "The positions could not be read."
              },
              "reason": {
                "type": "string",
                "enum": [
                  "provider_unavailable",
                  "invalid_response"
                ],
                "description": "Why the positions could not be read."
              }
            },
            "required": [
              "status",
              "reason"
            ]
          }
        ],
        "description": "The wallet's Polymarket positions, read from Polymarket's data API, or why they could not be read."
      },
      "PredictionAccount": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{40}$",
            "description": "The agent's Polymarket Deposit Wallet on Polygon, which holds its pUSD and positions."
          },
          "signer": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{40}$",
            "description": "The address of the key that controls the wallet. Fin holds the key; funds stay in the wallet."
          },
          "status": {
            "type": "string",
            "enum": [
              "opening",
              "ready"
            ],
            "description": "`opening` while Polymarket's relayer creates the wallet and sets its trading approvals; `ready` once Polygon shows both."
          },
          "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 account was first opened."
          },
          "balance": {
            "$ref": "#/components/schemas/PredictionAccountBalance"
          },
          "positions": {
            "$ref": "#/components/schemas/PredictionAccountPositions"
          }
        },
        "required": [
          "address",
          "signer",
          "status",
          "createdAt",
          "balance",
          "positions"
        ],
        "description": "The agent's Polymarket account, its live pUSD balance and its positions."
      },
      "PreparedPredictionOrder": {
        "type": "object",
        "properties": {
          "order": {
            "description": "The exact order to show the user and send, unchanged, to Place a Polymarket order.",
            "$ref": "#/components/schemas/PredictionOrderInput"
          },
          "requestKey": {
            "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": "This order's id for retries: send it as the `Idempotency-Key` of Place a Polymarket order."
          },
          "authorization": {
            "description": "The message the user signs to allow exactly this order. Call Place a Polymarket order before `authorization.expiresAt`.",
            "$ref": "#/components/schemas/MessageToSign"
          }
        },
        "required": [
          "order",
          "requestKey",
          "authorization"
        ],
        "description": "A Polymarket order's exact terms, the message the user signs for them, and the key to place it with."
      },
      "RunOutputSchemaNode": {
        "description": "A bounded node in the strict JSON Schema supported for run output.",
        "$ref": "#/components/schemas/schema0"
      },
      "RunOutputObjectSchema": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "object",
            "description": "JSON Schema type keyword: object."
          },
          "description": {
            "description": "Human-readable meaning of this schema node.",
            "type": "string"
          },
          "properties": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/RunOutputSchemaNode"
            },
            "description": "Named fields and their strict schemas."
          },
          "required": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every declared property is required exactly once."
          },
          "additionalProperties": {
            "type": "boolean",
            "const": false,
            "description": "Always false; undeclared properties are rejected."
          }
        },
        "required": [
          "type",
          "properties",
          "required",
          "additionalProperties"
        ],
        "description": "A strict object with all declared properties required and no extra properties."
      },
      "RunSteer": {
        "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 message's id; the `run.steered` event that delivers it names it."
          },
          "text": {
            "type": "string",
            "description": "The message, as the user sent it."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "delivered",
              "dropped"
            ],
            "description": "`pending` until the agent reads it at its next step; `delivered` once it has; `dropped` when the run ended before the agent read it, so it was never acted on. Send a dropped message again with Start a run."
          },
          "sentAt": {
            "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 user sent it."
          },
          "deliveredAt": {
            "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 agent read it; null until it is `delivered`."
          }
        },
        "required": [
          "id",
          "text",
          "status",
          "sentAt",
          "deliveredAt"
        ],
        "description": "A message the user sent a run while it was working, and whether the agent read it."
      },
      "RunFeedbackRating": {
        "type": "string",
        "enum": [
          "up",
          "down"
        ],
        "description": "How the user rated the reply: `up` for a thumbs-up, `down` for a thumbs-down."
      },
      "RunFeedbackReason": {
        "type": "string",
        "enum": [
          "wrong",
          "unhelpful",
          "slow",
          "unsafe",
          "other"
        ],
        "description": "Why the user rated the reply down: `wrong` it was incorrect, `unhelpful` it did not do what was asked, `slow` it took too long, `unsafe` it was risky or inappropriate, `other` none of these."
      },
      "RunFeedback": {
        "type": "object",
        "properties": {
          "rating": {
            "$ref": "#/components/schemas/RunFeedbackRating"
          },
          "reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunFeedbackReason"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the user rated it down; null when they gave no reason or rated it `up`."
          },
          "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 user first sent feedback on this run's reply."
          },
          "updatedAt": {
            "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 feedback last changed; the same as `createdAt` until it does."
          }
        },
        "required": [
          "rating",
          "reason",
          "createdAt",
          "updatedAt"
        ],
        "description": "The user's feedback on one run's reply: a thumbs-up or thumbs-down, and why."
      },
      "Run": {
        "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 run's id. It stays the same while the run pauses for approvals and resumes."
          },
          "conversationId": {
            "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."
          },
          "input": {
            "description": "The user's message that started the run; null only for old runs that did not keep it.",
            "type": [
              "string",
              "null"
            ]
          },
          "profile": {
            "type": "object",
            "properties": {
              "tools": {
                "description": "The only tools this run may reach. Absent means every registered tool.",
                "maxItems": 64,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,63}$",
                  "description": "A tool's name: lowercase, starting with a letter, letters, digits and underscores only."
                }
              },
              "outputContract": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]{0,63}$",
                    "description": "A tool's name: lowercase, starting with a letter, letters, digits and underscores only."
                  },
                  "description": {
                    "description": "Meaning of this terminal output contract.",
                    "type": "string",
                    "maxLength": 4096
                  },
                  "schema": {
                    "description": "The immutable strict object schema that the terminal output must satisfy.",
                    "$ref": "#/components/schemas/RunOutputObjectSchema"
                  }
                },
                "required": [
                  "name",
                  "schema"
                ],
                "description": "The immutable admitted output contract, readable without invoking its admission transform."
              },
              "modelId": {
                "description": "The reviewed provider model pinned by trusted admission; absent for historical default selection.",
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              }
            },
            "description": "The tools, output contract and model the run started with. They never change."
          },
          "startedAt": {
            "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 run started."
          },
          "endedAt": {
            "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 run ended; null while it is running or paused for human input or approval."
          },
          "status": {
            "$ref": "#/components/schemas/RunStatus"
          },
          "output": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "The run's terminal structured result, once it has one under its `outputContract`; null otherwise."
          },
          "response": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "The agent's full reply, never shortened."
                  },
                  "eventSeq": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991,
                    "description": "The `seq` of the event that carries the reply."
                  },
                  "completeness": {
                    "type": "string",
                    "enum": [
                      "complete",
                      "partial"
                    ],
                    "description": "`complete` when the run completed; `partial` when it was stopped or failed before finishing."
                  }
                },
                "required": [
                  "text",
                  "eventSeq",
                  "completeness"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The agent's reply since the run last started, resumed or was steered, once it has one."
          },
          "error": {
            "description": "Why the run failed or was stopped; null when neither happened.",
            "type": [
              "string",
              "null"
            ]
          },
          "failure": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "model_timeout",
                      "model_invalid_output",
                      "execution_deadline",
                      "provider_rate_limit",
                      "provider_unavailable",
                      "provider_authentication",
                      "internal_error",
                      "context_too_large",
                      "daily_budget_exhausted",
                      "monthly_budget_exhausted",
                      "budget_frozen",
                      "partner_daily_budget_exhausted",
                      "partner_monthly_budget_exhausted",
                      "unknown"
                    ],
                    "description": "Why the execution failed: `model_timeout` (the model was too slow to respond), `execution_deadline` (the run's active time limit elapsed before it finished), `provider_rate_limit` or `provider_unavailable` (classified from HTTP status or a connection/body-read failure observed by the host), `model_invalid_output` (terminal structured output still failed its required format after bounded repair), `context_too_large` (the request stayed over the model's context window after the host condensed earlier history and retried once), `daily_budget_exhausted`, `monthly_budget_exhausted` or `budget_frozen` (the user's AI budget for the UTC day or month, or an operator's freeze on it, left no room for the run's next model request), `partner_daily_budget_exhausted` or `partner_monthly_budget_exhausted` (the partner account's AI spend limit for the UTC day or month left no room for it), `internal_error` (a host-side fault), or `unknown` when nothing more specific was classified. A budget or spend-limit code means a limit stopped the run, not that the model failed; trying again fails the same way until the limit clears. A raised user budget or a lifted freeze applies at once; a raised partner limit applies from the next UTC day or month, because the open period keeps the cap it started with."
                  },
                  "stage": {
                    "type": "string",
                    "enum": [
                      "model_request",
                      "tool_execution",
                      "finalization"
                    ],
                    "description": "Which phase of the run was executing when it failed: `model_request` while calling or awaiting the model provider, `tool_execution` while running or resuming a tool call, or `finalization` while settling the run's output and accounting after the model finished."
                  },
                  "providerMessage": {
                    "description": "The model provider's own error text, when one was available: credential values are redacted and it is cut to 256 characters, but it is not a content classifier, so other sensitive detail may remain. Treat it as diagnostic context only — never branch on it, and review before showing it to an end user.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "diagnosticReference": {
                    "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": "This failed run's own id, repeated here as one field to cite when asking support to check the host's internal logs for this execution; it carries no meaning beyond that."
                  },
                  "effectWarning": {
                    "type": "string",
                    "const": "Earlier actions may have completed. Partial output does not prove success or a delivery failure. Check receipts before retrying; retrying may repeat actions.",
                    "description": "This build's fixed caution: earlier actions may already have run, so partial output alone never proves success, a delivery failure, or that retrying is free of duplicate effects."
                  }
                },
                "required": [
                  "code",
                  "stage",
                  "diagnosticReference",
                  "effectWarning"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Details of a failure, when recorded."
          },
          "pendingApprovals": {
            "type": "array",
            "items": {
              "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."
            },
            "description": "The approvals this run is waiting on, oldest first."
          },
          "pendingQuestions": {
            "type": "array",
            "items": {
              "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 questionnaire ids this run is waiting on, oldest first."
          },
          "steers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunSteer"
            },
            "description": "The messages the user sent this run while it worked, with Steer a run, oldest first; empty when they sent none."
          },
          "feedback": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunFeedback"
              },
              {
                "type": "null"
              }
            ],
            "description": "The user's feedback on this run's reply; null until they send it."
          },
          "origin": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "automationId": {
                    "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 automation's id."
                  },
                  "automationRunId": {
                    "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 automation run it carried out: its `id` in List an automation's runs."
                  },
                  "name": {
                    "type": "string",
                    "description": "The automation's name when that automation run was recorded."
                  }
                },
                "required": [
                  "automationId",
                  "automationRunId",
                  "name"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The automation that started this run; `null` for a run the user started with a message."
          },
          "reads": {
            "maxItems": 2,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "account",
                "prices"
              ]
            },
            "description": "What the agent read while it worked, told by the tools whose calls completed: `account` (the user's own balances, holdings, orders or positions) and `prices` (market prices). Empty when it read neither."
          }
        },
        "required": [
          "id",
          "conversationId",
          "input",
          "profile",
          "startedAt",
          "endedAt",
          "status",
          "output",
          "response",
          "error",
          "failure",
          "pendingApprovals",
          "pendingQuestions",
          "steers",
          "feedback",
          "origin",
          "reads"
        ],
        "description": "The agent's work on one message: its status, the agent's reply once it finishes, any approvals or questionnaires it is waiting on, the messages the user sent it while it worked, and the user's feedback on the reply."
      },
      "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."
      },
      "SolanaTokenMembership": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "meme",
              "launch_candidate",
              "other",
              "unknown"
            ],
            "description": "Confirmed meme membership, a launch awaiting classification, another token category, or insufficient classification evidence."
          },
          "basis": {
            "type": "string",
            "enum": [
              "coingecko_category",
              "jupiter_tag",
              "reviewed_mint",
              "launchpad",
              "none"
            ],
            "description": "The evidence used for classification. A name or symbol alone is never classification evidence."
          },
          "observedAt": {
            "description": "When the classification evidence was obtained.",
            "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))$"
          }
        },
        "required": [
          "kind",
          "basis"
        ]
      },
      "SolanaTokenResearch": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ready",
              "limited",
              "unavailable"
            ],
            "description": "Whether the available observations support comparative research; not a safety rating or recommendation."
          },
          "availableWindows": {
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "5m",
                "1h",
                "6h",
                "24h"
              ],
              "description": "A trailing window: the last 5 minutes, hour, 6 hours or 24 hours."
            }
          },
          "missing": {
            "maxItems": 8,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "price",
                "liquidity",
                "activity",
                "participants",
                "organic_activity",
                "concentration",
                "mint",
                "freshness"
              ]
            },
            "description": "Evidence absent or too old to support the corresponding claim."
          }
        },
        "required": [
          "status",
          "availableWindows",
          "missing"
        ]
      },
      "SolanaDiscoverySourceCoverage": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "The sampled source or feed."
          },
          "provider": {
            "type": "string",
            "enum": [
              "Jupiter",
              "CoinGecko",
              "GeckoTerminal"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ready",
              "stale",
              "unavailable",
              "pending"
            ]
          },
          "observedAt": {
            "description": "When the last successful source read completed.",
            "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))$"
          },
          "reason": {
            "description": "Why source coverage is incomplete.",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "count": {
            "description": "The number of candidates in the last successful source read.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "name",
          "status"
        ]
      },
      "SolanaTokenHolder": {
        "type": "object",
        "properties": {
          "rank": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10,
            "description": "Its place by balance, from 1."
          },
          "owner": {
            "type": "string",
            "minLength": 32,
            "maxLength": 44,
            "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
            "description": "The address that owns the balance."
          },
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "What it holds, in the token's smallest unit."
          },
          "sharePct": {
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$",
            "description": "Its share of the supply in percent, cut to two decimals: `6.12`, or `0.00` below a hundredth of a percent."
          },
          "kind": {
            "type": "string",
            "enum": [
              "wallet",
              "program"
            ],
            "description": "`wallet` for an ordinary account; `program` for one a program controls, such as a pool, a vault or a launchpad's bonding curve, so its balance is not one person's."
          },
          "venue": {
            "description": "Whose pool or bonding curve holds the balance, for a `program` holder Fin recognizes; absent for any other, which is still a pool or a vault if its `kind` is `program`.",
            "type": "string",
            "enum": [
              "pump_fun",
              "pumpswap",
              "meteora",
              "raydium",
              "orca",
              "launchlab"
            ]
          },
          "creator": {
            "type": "boolean",
            "description": "True when the owner is the wallet that created the token, as Jupiter names it."
          }
        },
        "required": [
          "rank",
          "owner",
          "amountRaw",
          "sharePct",
          "kind",
          "creator"
        ],
        "description": "One of a token's largest holders."
      },
      "SolanaTokenHolders": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "observed",
                "description": "The chain answered."
              },
              "mint": {
                "type": "string",
                "minLength": 32,
                "maxLength": 44,
                "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                "description": "The token's mint address."
              },
              "decimals": {
                "type": "integer",
                "minimum": 0,
                "maximum": 255,
                "description": "The mint's decimals."
              },
              "supplyRaw": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,38})$",
                "description": "The supply the shares are of, in the token's smallest unit."
              },
              "holders": {
                "maxItems": 10,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SolanaTokenHolder"
                },
                "description": "The largest holders, largest first, each owner once with all its accounts added up."
              },
              "holderChange": {
                "anyOf": [
                  {
                    "minItems": 1,
                    "maxItems": 3,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "window": {
                          "type": "string",
                          "enum": [
                            "1h",
                            "6h",
                            "24h"
                          ],
                          "description": "The trailing window the change is over."
                        },
                        "pct": {
                          "type": "string",
                          "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
                          "description": "How much the number of wallets holding it changed over the window, in percent: `-1.5` is down 1.5%."
                        }
                      },
                      "required": [
                        "window",
                        "pct"
                      ]
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The change in how many wallets hold it, per window, as a percent the data source states; never a count of wallets. Null when it states none."
              },
              "source": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "Solana",
                    "description": "Read from the chain itself."
                  },
                  "observedAt": {
                    "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 it was read."
                  }
                },
                "required": [
                  "name",
                  "observedAt"
                ],
                "description": "Where the holders come from and when they were read."
              }
            },
            "required": [
              "status",
              "mint",
              "decimals",
              "supplyRaw",
              "holders",
              "holderChange",
              "source"
            ]
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "unavailable",
                "description": "No holders could be read."
              },
              "mint": {
                "type": "string",
                "minLength": 32,
                "maxLength": 44,
                "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                "description": "The token's mint address."
              },
              "reason": {
                "type": "string",
                "enum": [
                  "rpc_unavailable",
                  "unreadable_mint"
                ],
                "description": "`rpc_unavailable` when the chain could not be read just now; `unreadable_mint` when the mint's account is not one Fin can read a supply from."
              }
            },
            "required": [
              "status",
              "mint",
              "reason"
            ]
          }
        ],
        "description": "A token's largest holders, read from the chain, or why there are none."
      },
      "SolanaTokenSparkline": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "mint": {
                "type": "string",
                "minLength": 32,
                "maxLength": 44,
                "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                "description": "The token's mint address."
              },
              "status": {
                "type": "string",
                "const": "observed",
                "description": "Fin sampled enough of the window to draw it."
              },
              "points": {
                "minItems": 1,
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "time": {
                      "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 Fin read this price."
                    },
                    "priceUsd": {
                      "type": "string",
                      "maxLength": 80,
                      "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$",
                      "description": "The price of one whole token in US dollars."
                    }
                  },
                  "required": [
                    "time",
                    "priceUsd"
                  ]
                },
                "description": "The sampled prices, oldest first."
              }
            },
            "required": [
              "mint",
              "status",
              "points"
            ]
          },
          {
            "type": "object",
            "properties": {
              "mint": {
                "type": "string",
                "minLength": 32,
                "maxLength": 44,
                "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                "description": "The token's mint address."
              },
              "status": {
                "type": "string",
                "const": "unavailable",
                "description": "There is no line to draw."
              },
              "reason": {
                "type": "string",
                "enum": [
                  "not_sampled",
                  "too_sparse"
                ],
                "description": "`not_sampled` when Fin read no price for it in the window; `too_sparse` when what it read would draw a misleading line: too few prices, a late start or a long gap."
              }
            },
            "required": [
              "mint",
              "status",
              "reason"
            ]
          }
        ],
        "description": "One token's price line over the window, or why it has none."
      },
      "SolanaTokenSparklines": {
        "type": "object",
        "properties": {
          "interval": {
            "type": "string",
            "enum": [
              "1h",
              "6h",
              "24h"
            ],
            "description": "How far back the line goes: the last hour, 6 hours or 24 hours."
          },
          "source": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "const": "Jupiter",
                "description": "Who the market data comes from."
              },
              "observedAt": {
                "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 it was read."
              }
            },
            "required": [
              "name",
              "observedAt"
            ],
            "description": "Where the market data comes from and when it was read."
          },
          "items": {
            "maxItems": 25,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SolanaTokenSparkline"
            },
            "description": "Each token asked for, once, in the order asked."
          }
        },
        "required": [
          "interval",
          "source",
          "items"
        ],
        "description": "Small price lines for several tokens over one window."
      },
      "SolanaTokenLaunchItem": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "mint": {
                "type": "string",
                "minLength": 32,
                "maxLength": 44,
                "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                "description": "The token's mint address."
              },
              "status": {
                "type": "string",
                "const": "curve",
                "description": "It is on its launchpad's bonding curve."
              },
              "launchpad": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "The launchpad: `pump.fun`."
              },
              "progressPct": {
                "type": "string",
                "maxLength": 80,
                "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$",
                "description": "How much of what the curve sells has been bought, in percent, cut to two decimals: `5.50`."
              },
              "observedAt": {
                "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 curve was read from the chain."
              }
            },
            "required": [
              "mint",
              "status",
              "launchpad",
              "progressPct",
              "observedAt"
            ]
          },
          {
            "type": "object",
            "properties": {
              "mint": {
                "type": "string",
                "minLength": 32,
                "maxLength": 44,
                "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                "description": "The token's mint address."
              },
              "status": {
                "type": "string",
                "const": "graduated",
                "description": "It left its launchpad's curve for an open pool."
              },
              "launchpad": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "The launchpad it left, as the venue names it, such as `pump.fun`."
              },
              "graduatedAt": {
                "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 it left, as the venue states it."
              }
            },
            "required": [
              "mint",
              "status",
              "launchpad",
              "graduatedAt"
            ]
          },
          {
            "type": "object",
            "properties": {
              "mint": {
                "type": "string",
                "minLength": 32,
                "maxLength": 44,
                "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                "description": "The token's mint address."
              },
              "status": {
                "type": "string",
                "const": "unknown",
                "description": "Fin cannot say: no launchpad is named for it, its launchpad's curve is not one Fin reads, or the chain or the venue could not be read just now."
              }
            },
            "required": [
              "mint",
              "status"
            ]
          }
        ],
        "description": "Where one token stands on its launchpad."
      },
      "SolanaTokenLaunchStatus": {
        "type": "object",
        "properties": {
          "items": {
            "maxItems": 25,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SolanaTokenLaunchItem"
            },
            "description": "Each token asked for, once, in the order asked."
          }
        },
        "required": [
          "items"
        ],
        "description": "Where several tokens stand on their launchpads."
      },
      "SolanaTokenLinks": {
        "type": "object",
        "properties": {
          "website": {
            "description": "Its own site: https, never an X, Telegram or link-shortener address.",
            "type": "string",
            "maxLength": 200,
            "pattern": "^https:\\/\\/[^\\s/?#@:]+(\\/[^\\s?#]*)?$"
          },
          "x": {
            "description": "Its X profile: `https://x.com/<handle>`.",
            "type": "string",
            "maxLength": 200,
            "pattern": "^https:\\/\\/[^\\s/?#@:]+(\\/[^\\s?#]*)?$"
          },
          "telegram": {
            "description": "Its Telegram: `https://t.me/<name>`.",
            "type": "string",
            "maxLength": 200,
            "pattern": "^https:\\/\\/[^\\s/?#@:]+(\\/[^\\s?#]*)?$"
          }
        },
        "description": "The token's own links as its listing names them, kept only where they read as a site, an X profile or a Telegram channel. They are its creator's claims, not Fin's; absent when none reads cleanly."
      },
      "SolanaTokenSummary": {
        "type": "object",
        "properties": {
          "mint": {
            "type": "string",
            "minLength": 32,
            "maxLength": 44,
            "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
            "description": "The token's mint address: its only unambiguous identity, since symbols are not unique."
          },
          "symbol": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "description": "The token's symbol as the venue lists it."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "The token's name as the venue lists it."
          },
          "iconUrl": {
            "type": "string",
            "pattern": "^\\/v1\\/solana\\/tokens\\/[1-9A-HJ-NP-Za-km-z]{32,44}\\/icon$",
            "description": "Where Fin serves the token's icon: the path of Get a token icon on this API, which answers the image, or not found when the data source's icon cannot be used. Absent when the data source lists none; draw a placeholder then."
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 255,
            "description": "The mint's decimals."
          },
          "tokenProgram": {
            "type": "string",
            "enum": [
              "spl_token",
              "token_2022"
            ],
            "description": "The program that owns the mint: `spl_token` (SPL Token) or `token_2022` (Token-2022)."
          },
          "priceUsd": {
            "description": "The price of one whole token in US dollars; absent when it has no reliable price.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "priceChange24hPct": {
            "description": "The price change over 24 hours, in percent.",
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
          },
          "liquidityUsd": {
            "description": "Liquidity across the token's pools, in US dollars.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "mcapUsd": {
            "description": "Market capitalization, in US dollars.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "createdAt": {
            "description": "When the token was created.",
            "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))$"
          },
          "launchpad": {
            "description": "The launchpad that created it, such as `pump.fun`.",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "graduated": {
            "description": "True once it left its launchpad's bonding curve for an open pool.",
            "type": "boolean"
          },
          "verified": {
            "description": "True when the venue lists it as verified.",
            "type": "boolean"
          },
          "organicScoreLabel": {
            "description": "How much of its activity the venue judges organic rather than bot-driven.",
            "type": "string",
            "enum": [
              "high",
              "medium",
              "low"
            ]
          },
          "membership": {
            "$ref": "#/components/schemas/SolanaTokenMembership"
          },
          "firstPoolAt": {
            "description": "When its first liquidity pool opened; distinct from mint creation.",
            "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))$"
          },
          "discoveredAt": {
            "description": "When Fin first recorded the token.",
            "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))$"
          },
          "marketObservedAt": {
            "description": "The market provider's own update time, or the successful read time when it supplies none.",
            "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))$"
          },
          "assessmentObservedAt": {
            "description": "When the current on-chain mint assessment was made.",
            "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))$"
          },
          "holders": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "organicScore": {
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "topHoldersPct": {
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "dataGaps": {
            "description": "Important evidence that is missing or too old; absence is never a zero value.",
            "maxItems": 16,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "research": {
            "$ref": "#/components/schemas/SolanaTokenResearch"
          },
          "stats": {
            "type": "object",
            "properties": {
              "5m": {
                "type": "object",
                "properties": {
                  "volumeUsd": {
                    "description": "Traded volume in the window, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "organicVolumeUsd": {
                    "description": "The part of that volume the venue judges organic, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "buyVolumeUsd": {
                    "description": "What buyers paid in the window, in US dollars: the buying side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "sellVolumeUsd": {
                    "description": "What sellers received in the window, in US dollars: the selling side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "traders": {
                    "description": "Distinct wallets that bought or sold in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buyers": {
                    "description": "Distinct buying wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sellers": {
                    "description": "Distinct selling wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buys": {
                    "description": "Buy transactions in the window; not distinct buyers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sells": {
                    "description": "Sell transactions in the window; not distinct sellers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "organicBuyers": {
                    "description": "Organic wallets that were net buyers in the window, as counted by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "netBuyers": {
                    "description": "Net-buying wallets in the window, as reported by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "priceChangePct": {
                    "description": "The price change over the window, in percent: `-12.5` is down 12.5%.",
                    "type": "string",
                    "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                  }
                },
                "description": "Trading activity in one window; each figure absent when the venue has none."
              },
              "1h": {
                "type": "object",
                "properties": {
                  "volumeUsd": {
                    "description": "Traded volume in the window, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "organicVolumeUsd": {
                    "description": "The part of that volume the venue judges organic, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "buyVolumeUsd": {
                    "description": "What buyers paid in the window, in US dollars: the buying side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "sellVolumeUsd": {
                    "description": "What sellers received in the window, in US dollars: the selling side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "traders": {
                    "description": "Distinct wallets that bought or sold in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buyers": {
                    "description": "Distinct buying wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sellers": {
                    "description": "Distinct selling wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buys": {
                    "description": "Buy transactions in the window; not distinct buyers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sells": {
                    "description": "Sell transactions in the window; not distinct sellers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "organicBuyers": {
                    "description": "Organic wallets that were net buyers in the window, as counted by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "netBuyers": {
                    "description": "Net-buying wallets in the window, as reported by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "priceChangePct": {
                    "description": "The price change over the window, in percent: `-12.5` is down 12.5%.",
                    "type": "string",
                    "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                  }
                },
                "description": "Trading activity in one window; each figure absent when the venue has none."
              },
              "6h": {
                "type": "object",
                "properties": {
                  "volumeUsd": {
                    "description": "Traded volume in the window, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "organicVolumeUsd": {
                    "description": "The part of that volume the venue judges organic, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "buyVolumeUsd": {
                    "description": "What buyers paid in the window, in US dollars: the buying side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "sellVolumeUsd": {
                    "description": "What sellers received in the window, in US dollars: the selling side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "traders": {
                    "description": "Distinct wallets that bought or sold in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buyers": {
                    "description": "Distinct buying wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sellers": {
                    "description": "Distinct selling wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buys": {
                    "description": "Buy transactions in the window; not distinct buyers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sells": {
                    "description": "Sell transactions in the window; not distinct sellers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "organicBuyers": {
                    "description": "Organic wallets that were net buyers in the window, as counted by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "netBuyers": {
                    "description": "Net-buying wallets in the window, as reported by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "priceChangePct": {
                    "description": "The price change over the window, in percent: `-12.5` is down 12.5%.",
                    "type": "string",
                    "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                  }
                },
                "description": "Trading activity in one window; each figure absent when the venue has none."
              },
              "24h": {
                "type": "object",
                "properties": {
                  "volumeUsd": {
                    "description": "Traded volume in the window, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "organicVolumeUsd": {
                    "description": "The part of that volume the venue judges organic, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "buyVolumeUsd": {
                    "description": "What buyers paid in the window, in US dollars: the buying side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "sellVolumeUsd": {
                    "description": "What sellers received in the window, in US dollars: the selling side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "traders": {
                    "description": "Distinct wallets that bought or sold in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buyers": {
                    "description": "Distinct buying wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sellers": {
                    "description": "Distinct selling wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buys": {
                    "description": "Buy transactions in the window; not distinct buyers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sells": {
                    "description": "Sell transactions in the window; not distinct sellers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "organicBuyers": {
                    "description": "Organic wallets that were net buyers in the window, as counted by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "netBuyers": {
                    "description": "Net-buying wallets in the window, as reported by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "priceChangePct": {
                    "description": "The price change over the window, in percent: `-12.5` is down 12.5%.",
                    "type": "string",
                    "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                  }
                },
                "description": "Trading activity in one window; each figure absent when the venue has none."
              }
            },
            "description": "Trading activity by window; a window is absent when the venue has none for it."
          },
          "risk": {
            "$ref": "#/components/schemas/SolanaRisk"
          },
          "tradable": {
            "type": "boolean",
            "description": "Whether Fin would buy it now: priced, with a risk that is neither `blocked` nor `unknown`, at most 18 decimals, and not wrapped SOL, which a buy pays with. Never propose a buy of an untradable token."
          }
        },
        "required": [
          "mint",
          "symbol",
          "name",
          "decimals",
          "tokenProgram",
          "stats",
          "risk",
          "tradable"
        ],
        "description": "One Solana token: its identity, market data and risk verdict."
      },
      "SolanaTokenDetail": {
        "type": "object",
        "properties": {
          "mint": {
            "type": "string",
            "minLength": 32,
            "maxLength": 44,
            "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
            "description": "The token's mint address: its only unambiguous identity, since symbols are not unique."
          },
          "symbol": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "description": "The token's symbol as the venue lists it."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "The token's name as the venue lists it."
          },
          "iconUrl": {
            "type": "string",
            "pattern": "^\\/v1\\/solana\\/tokens\\/[1-9A-HJ-NP-Za-km-z]{32,44}\\/icon$",
            "description": "Where Fin serves the token's icon: the path of Get a token icon on this API, which answers the image, or not found when the data source's icon cannot be used. Absent when the data source lists none; draw a placeholder then."
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 255,
            "description": "The mint's decimals."
          },
          "tokenProgram": {
            "type": "string",
            "enum": [
              "spl_token",
              "token_2022"
            ],
            "description": "The program that owns the mint: `spl_token` (SPL Token) or `token_2022` (Token-2022)."
          },
          "priceUsd": {
            "description": "The price of one whole token in US dollars; absent when it has no reliable price.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "priceChange24hPct": {
            "description": "The price change over 24 hours, in percent.",
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
          },
          "liquidityUsd": {
            "description": "Liquidity across the token's pools, in US dollars.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "mcapUsd": {
            "description": "Market capitalization, in US dollars.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "createdAt": {
            "description": "When the token was created.",
            "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))$"
          },
          "launchpad": {
            "description": "The launchpad that created it, such as `pump.fun`.",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "graduated": {
            "description": "True once it left its launchpad's bonding curve for an open pool.",
            "type": "boolean"
          },
          "verified": {
            "description": "True when the venue lists it as verified.",
            "type": "boolean"
          },
          "organicScoreLabel": {
            "description": "How much of its activity the venue judges organic rather than bot-driven.",
            "type": "string",
            "enum": [
              "high",
              "medium",
              "low"
            ]
          },
          "membership": {
            "$ref": "#/components/schemas/SolanaTokenMembership"
          },
          "firstPoolAt": {
            "description": "When its first liquidity pool opened; distinct from mint creation.",
            "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))$"
          },
          "discoveredAt": {
            "description": "When Fin first recorded the token.",
            "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))$"
          },
          "marketObservedAt": {
            "description": "The market provider's own update time, or the successful read time when it supplies none.",
            "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))$"
          },
          "assessmentObservedAt": {
            "description": "When the current on-chain mint assessment was made.",
            "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))$"
          },
          "holders": {
            "description": "How many wallets hold it.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "organicScore": {
            "description": "The venue's organic score, 0 to 100: how much of its trading comes from real wallets rather than bots.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "topHoldersPct": {
            "description": "The share of the supply its largest holders hold, in percent, as the venue counts them: how much a few wallets selling could move the price.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "dataGaps": {
            "description": "Important evidence that is missing or too old; absence is never a zero value.",
            "maxItems": 16,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "research": {
            "$ref": "#/components/schemas/SolanaTokenResearch"
          },
          "stats": {
            "type": "object",
            "properties": {
              "5m": {
                "type": "object",
                "properties": {
                  "volumeUsd": {
                    "description": "Traded volume in the window, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "organicVolumeUsd": {
                    "description": "The part of that volume the venue judges organic, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "buyVolumeUsd": {
                    "description": "What buyers paid in the window, in US dollars: the buying side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "sellVolumeUsd": {
                    "description": "What sellers received in the window, in US dollars: the selling side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "traders": {
                    "description": "Distinct wallets that bought or sold in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buyers": {
                    "description": "Distinct buying wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sellers": {
                    "description": "Distinct selling wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buys": {
                    "description": "Buy transactions in the window; not distinct buyers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sells": {
                    "description": "Sell transactions in the window; not distinct sellers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "organicBuyers": {
                    "description": "Organic wallets that were net buyers in the window, as counted by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "netBuyers": {
                    "description": "Net-buying wallets in the window, as reported by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "priceChangePct": {
                    "description": "The price change over the window, in percent: `-12.5` is down 12.5%.",
                    "type": "string",
                    "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                  }
                },
                "description": "Trading activity in one window; each figure absent when the venue has none."
              },
              "1h": {
                "type": "object",
                "properties": {
                  "volumeUsd": {
                    "description": "Traded volume in the window, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "organicVolumeUsd": {
                    "description": "The part of that volume the venue judges organic, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "buyVolumeUsd": {
                    "description": "What buyers paid in the window, in US dollars: the buying side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "sellVolumeUsd": {
                    "description": "What sellers received in the window, in US dollars: the selling side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "traders": {
                    "description": "Distinct wallets that bought or sold in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buyers": {
                    "description": "Distinct buying wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sellers": {
                    "description": "Distinct selling wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buys": {
                    "description": "Buy transactions in the window; not distinct buyers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sells": {
                    "description": "Sell transactions in the window; not distinct sellers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "organicBuyers": {
                    "description": "Organic wallets that were net buyers in the window, as counted by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "netBuyers": {
                    "description": "Net-buying wallets in the window, as reported by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "priceChangePct": {
                    "description": "The price change over the window, in percent: `-12.5` is down 12.5%.",
                    "type": "string",
                    "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                  }
                },
                "description": "Trading activity in one window; each figure absent when the venue has none."
              },
              "6h": {
                "type": "object",
                "properties": {
                  "volumeUsd": {
                    "description": "Traded volume in the window, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "organicVolumeUsd": {
                    "description": "The part of that volume the venue judges organic, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "buyVolumeUsd": {
                    "description": "What buyers paid in the window, in US dollars: the buying side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "sellVolumeUsd": {
                    "description": "What sellers received in the window, in US dollars: the selling side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "traders": {
                    "description": "Distinct wallets that bought or sold in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buyers": {
                    "description": "Distinct buying wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sellers": {
                    "description": "Distinct selling wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buys": {
                    "description": "Buy transactions in the window; not distinct buyers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sells": {
                    "description": "Sell transactions in the window; not distinct sellers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "organicBuyers": {
                    "description": "Organic wallets that were net buyers in the window, as counted by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "netBuyers": {
                    "description": "Net-buying wallets in the window, as reported by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "priceChangePct": {
                    "description": "The price change over the window, in percent: `-12.5` is down 12.5%.",
                    "type": "string",
                    "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                  }
                },
                "description": "Trading activity in one window; each figure absent when the venue has none."
              },
              "24h": {
                "type": "object",
                "properties": {
                  "volumeUsd": {
                    "description": "Traded volume in the window, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "organicVolumeUsd": {
                    "description": "The part of that volume the venue judges organic, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "buyVolumeUsd": {
                    "description": "What buyers paid in the window, in US dollars: the buying side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "sellVolumeUsd": {
                    "description": "What sellers received in the window, in US dollars: the selling side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "traders": {
                    "description": "Distinct wallets that bought or sold in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buyers": {
                    "description": "Distinct buying wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sellers": {
                    "description": "Distinct selling wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buys": {
                    "description": "Buy transactions in the window; not distinct buyers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sells": {
                    "description": "Sell transactions in the window; not distinct sellers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "organicBuyers": {
                    "description": "Organic wallets that were net buyers in the window, as counted by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "netBuyers": {
                    "description": "Net-buying wallets in the window, as reported by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "priceChangePct": {
                    "description": "The price change over the window, in percent: `-12.5` is down 12.5%.",
                    "type": "string",
                    "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                  }
                },
                "description": "Trading activity in one window; each figure absent when the venue has none."
              }
            },
            "description": "Trading activity by window; a window is absent when the venue has none for it."
          },
          "risk": {
            "$ref": "#/components/schemas/SolanaRisk"
          },
          "tradable": {
            "type": "boolean",
            "description": "Whether Fin would buy it now: priced, with a risk that is neither `blocked` nor `unknown`, at most 18 decimals, and not wrapped SOL, which a buy pays with. Never propose a buy of an untradable token."
          },
          "fdvUsd": {
            "description": "Fully diluted valuation, in US dollars.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "creatorHoldsPct": {
            "description": "The share of the supply the wallet that created it holds, in percent.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "bondingProgressPct": {
            "description": "How far along its launchpad's bonding curve it is, in percent, before it graduates.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "links": {
            "$ref": "#/components/schemas/SolanaTokenLinks"
          },
          "source": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "const": "Jupiter",
                "description": "Who the market data comes from."
              },
              "observedAt": {
                "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 it was read."
              }
            },
            "required": [
              "name",
              "observedAt"
            ],
            "description": "Where the market data comes from and when it was read."
          }
        },
        "required": [
          "mint",
          "symbol",
          "name",
          "decimals",
          "tokenProgram",
          "stats",
          "risk",
          "tradable",
          "source"
        ],
        "description": "One Solana token in full: identity, market data, activity and risk verdict."
      },
      "SolanaTokenListItem": {
        "type": "object",
        "properties": {
          "rank": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000,
            "description": "Its place in the sampled snapshot, from 1."
          },
          "mint": {
            "type": "string",
            "minLength": 32,
            "maxLength": 44,
            "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
            "description": "The token's mint address: its only unambiguous identity, since symbols are not unique."
          },
          "symbol": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "description": "The token's symbol as the venue lists it."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "The token's name as the venue lists it."
          },
          "iconUrl": {
            "type": "string",
            "pattern": "^\\/v1\\/solana\\/tokens\\/[1-9A-HJ-NP-Za-km-z]{32,44}\\/icon$",
            "description": "Where Fin serves the token's icon: the path of Get a token icon on this API, which answers the image, or not found when the data source's icon cannot be used. Absent when the data source lists none; draw a placeholder then."
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 255,
            "description": "The mint's decimals."
          },
          "tokenProgram": {
            "type": "string",
            "enum": [
              "spl_token",
              "token_2022"
            ],
            "description": "The program that owns the mint: `spl_token` (SPL Token) or `token_2022` (Token-2022)."
          },
          "priceUsd": {
            "description": "The price of one whole token in US dollars; absent when it has no reliable price.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "priceChange24hPct": {
            "description": "The price change over 24 hours, in percent.",
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
          },
          "liquidityUsd": {
            "description": "Liquidity across the token's pools, in US dollars.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "mcapUsd": {
            "description": "Market capitalization, in US dollars.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "createdAt": {
            "description": "When the token was created.",
            "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))$"
          },
          "launchpad": {
            "description": "The launchpad that created it, such as `pump.fun`.",
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "graduated": {
            "description": "True once it left its launchpad's bonding curve for an open pool.",
            "type": "boolean"
          },
          "verified": {
            "description": "True when the venue lists it as verified.",
            "type": "boolean"
          },
          "organicScoreLabel": {
            "description": "How much of its activity the venue judges organic rather than bot-driven.",
            "type": "string",
            "enum": [
              "high",
              "medium",
              "low"
            ]
          },
          "membership": {
            "$ref": "#/components/schemas/SolanaTokenMembership"
          },
          "firstPoolAt": {
            "description": "When its first liquidity pool opened; distinct from mint creation.",
            "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))$"
          },
          "discoveredAt": {
            "description": "When Fin first recorded the token.",
            "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))$"
          },
          "marketObservedAt": {
            "description": "The market provider's own update time, or the successful read time when it supplies none.",
            "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))$"
          },
          "assessmentObservedAt": {
            "description": "When the current on-chain mint assessment was made.",
            "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))$"
          },
          "holders": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "organicScore": {
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "topHoldersPct": {
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "dataGaps": {
            "description": "Important evidence that is missing or too old; absence is never a zero value.",
            "maxItems": 16,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "research": {
            "$ref": "#/components/schemas/SolanaTokenResearch"
          },
          "stats": {
            "type": "object",
            "properties": {
              "5m": {
                "type": "object",
                "properties": {
                  "volumeUsd": {
                    "description": "Traded volume in the window, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "organicVolumeUsd": {
                    "description": "The part of that volume the venue judges organic, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "buyVolumeUsd": {
                    "description": "What buyers paid in the window, in US dollars: the buying side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "sellVolumeUsd": {
                    "description": "What sellers received in the window, in US dollars: the selling side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "traders": {
                    "description": "Distinct wallets that bought or sold in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buyers": {
                    "description": "Distinct buying wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sellers": {
                    "description": "Distinct selling wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buys": {
                    "description": "Buy transactions in the window; not distinct buyers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sells": {
                    "description": "Sell transactions in the window; not distinct sellers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "organicBuyers": {
                    "description": "Organic wallets that were net buyers in the window, as counted by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "netBuyers": {
                    "description": "Net-buying wallets in the window, as reported by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "priceChangePct": {
                    "description": "The price change over the window, in percent: `-12.5` is down 12.5%.",
                    "type": "string",
                    "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                  }
                },
                "description": "Trading activity in one window; each figure absent when the venue has none."
              },
              "1h": {
                "type": "object",
                "properties": {
                  "volumeUsd": {
                    "description": "Traded volume in the window, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "organicVolumeUsd": {
                    "description": "The part of that volume the venue judges organic, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "buyVolumeUsd": {
                    "description": "What buyers paid in the window, in US dollars: the buying side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "sellVolumeUsd": {
                    "description": "What sellers received in the window, in US dollars: the selling side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "traders": {
                    "description": "Distinct wallets that bought or sold in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buyers": {
                    "description": "Distinct buying wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sellers": {
                    "description": "Distinct selling wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buys": {
                    "description": "Buy transactions in the window; not distinct buyers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sells": {
                    "description": "Sell transactions in the window; not distinct sellers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "organicBuyers": {
                    "description": "Organic wallets that were net buyers in the window, as counted by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "netBuyers": {
                    "description": "Net-buying wallets in the window, as reported by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "priceChangePct": {
                    "description": "The price change over the window, in percent: `-12.5` is down 12.5%.",
                    "type": "string",
                    "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                  }
                },
                "description": "Trading activity in one window; each figure absent when the venue has none."
              },
              "6h": {
                "type": "object",
                "properties": {
                  "volumeUsd": {
                    "description": "Traded volume in the window, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "organicVolumeUsd": {
                    "description": "The part of that volume the venue judges organic, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "buyVolumeUsd": {
                    "description": "What buyers paid in the window, in US dollars: the buying side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "sellVolumeUsd": {
                    "description": "What sellers received in the window, in US dollars: the selling side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "traders": {
                    "description": "Distinct wallets that bought or sold in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buyers": {
                    "description": "Distinct buying wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sellers": {
                    "description": "Distinct selling wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buys": {
                    "description": "Buy transactions in the window; not distinct buyers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sells": {
                    "description": "Sell transactions in the window; not distinct sellers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "organicBuyers": {
                    "description": "Organic wallets that were net buyers in the window, as counted by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "netBuyers": {
                    "description": "Net-buying wallets in the window, as reported by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "priceChangePct": {
                    "description": "The price change over the window, in percent: `-12.5` is down 12.5%.",
                    "type": "string",
                    "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                  }
                },
                "description": "Trading activity in one window; each figure absent when the venue has none."
              },
              "24h": {
                "type": "object",
                "properties": {
                  "volumeUsd": {
                    "description": "Traded volume in the window, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "organicVolumeUsd": {
                    "description": "The part of that volume the venue judges organic, in US dollars.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "buyVolumeUsd": {
                    "description": "What buyers paid in the window, in US dollars: the buying side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "sellVolumeUsd": {
                    "description": "What sellers received in the window, in US dollars: the selling side of the volume.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "traders": {
                    "description": "Distinct wallets that bought or sold in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buyers": {
                    "description": "Distinct buying wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sellers": {
                    "description": "Distinct selling wallets in the window.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "buys": {
                    "description": "Buy transactions in the window; not distinct buyers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "sells": {
                    "description": "Sell transactions in the window; not distinct sellers.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "organicBuyers": {
                    "description": "Organic wallets that were net buyers in the window, as counted by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "netBuyers": {
                    "description": "Net-buying wallets in the window, as reported by the venue.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "priceChangePct": {
                    "description": "The price change over the window, in percent: `-12.5` is down 12.5%.",
                    "type": "string",
                    "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                  }
                },
                "description": "Trading activity in one window; each figure absent when the venue has none."
              }
            },
            "description": "Trading activity by window; a window is absent when the venue has none for it."
          },
          "risk": {
            "$ref": "#/components/schemas/SolanaRisk"
          },
          "tradable": {
            "type": "boolean",
            "description": "Whether Fin would buy it now: priced, with a risk that is neither `blocked` nor `unknown`, at most 18 decimals, and not wrapped SOL, which a buy pays with. Never propose a buy of an untradable token."
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "One line on why it is listed, such as its organic volume and traders in the window."
          }
        },
        "required": [
          "rank",
          "mint",
          "symbol",
          "name",
          "decimals",
          "tokenProgram",
          "stats",
          "risk",
          "tradable",
          "reason"
        ],
        "description": "One ranked token in a list."
      },
      "SolanaTokenList": {
        "type": "object",
        "properties": {
          "lane": {
            "type": "string",
            "enum": [
              "trending",
              "traded",
              "organic",
              "new",
              "gainers"
            ],
            "description": "Which ranking: organic trading volume, total volume, organic activity, newest pools or price gain. Ranking describes observed activity, not expected returns."
          },
          "interval": {
            "type": "string",
            "enum": [
              "5m",
              "1h",
              "6h",
              "24h"
            ],
            "description": "The window the list ranks by."
          },
          "source": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "const": "Jupiter",
                "description": "Who the market data comes from."
              },
              "observedAt": {
                "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 it was read."
              }
            },
            "required": [
              "name",
              "observedAt"
            ],
            "description": "Where the market data comes from and when it was read."
          },
          "status": {
            "type": "string",
            "enum": [
              "ready",
              "stale",
              "unavailable"
            ]
          },
          "asOf": {
            "description": "When this discovery snapshot was selected.",
            "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))$"
          },
          "snapshotId": {
            "description": "The fixed catalog revision used by every page of this result.",
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "nextCursor": {
            "description": "Pass this cursor with the same filters for the next page; null means this snapshot has no more matches.",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          },
          "coverage": {
            "type": "object",
            "properties": {
              "universe": {
                "type": "string",
                "const": "sampled",
                "description": "Discovery samples provider feeds and does not claim every token on Solana."
              },
              "observedCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "eligibleCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "returnedCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "limitReached": {
                "type": "boolean",
                "description": "True when a configured collection or scan limit narrowed coverage."
              },
              "sources": {
                "maxItems": 32,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SolanaDiscoverySourceCoverage"
                }
              }
            },
            "required": [
              "universe",
              "observedCount",
              "eligibleCount",
              "returnedCount",
              "limitReached",
              "sources"
            ]
          },
          "items": {
            "maxItems": 25,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SolanaTokenListItem"
            },
            "description": "The ranked tokens, in rank order, after the list's quality gates."
          }
        },
        "required": [
          "lane",
          "interval",
          "source",
          "items"
        ],
        "description": "A ranked list of Solana tokens in one lane and window."
      },
      "SolanaTokenSearch": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "What was searched for, as normalized."
          },
          "ambiguous": {
            "type": "boolean",
            "description": "True when the query does not name one token: several candidates share the top symbol. Show them and ask; never pick by symbol alone."
          },
          "source": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "const": "Jupiter",
                "description": "Who the market data comes from."
              },
              "observedAt": {
                "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 it was read."
              }
            },
            "required": [
              "name",
              "observedAt"
            ],
            "description": "Where the market data comes from and when it was read."
          },
          "items": {
            "maxItems": 10,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SolanaTokenSummary"
            },
            "description": "The candidates, best match first; a pasted mint answers that mint alone."
          }
        },
        "required": [
          "query",
          "ambiguous",
          "source",
          "items"
        ],
        "description": "Solana tokens matching a ticker, a name or a pasted mint."
      },
      "SolanaTokenChart": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "observed",
                "description": "A pool priced the token."
              },
              "mint": {
                "type": "string",
                "minLength": 32,
                "maxLength": 44,
                "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                "description": "The token's mint address."
              },
              "interval": {
                "type": "string",
                "enum": [
                  "1m",
                  "5m",
                  "15m",
                  "1h",
                  "4h",
                  "1d"
                ],
                "description": "How wide each point is: one, five or fifteen minutes, one or four hours, or one day."
              },
              "pool": {
                "type": "string",
                "minLength": 32,
                "maxLength": 44,
                "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                "description": "The pool the prices come from: the token's deepest, by the liquidity in it."
              },
              "source": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "enum": [
                      "CoinGecko",
                      "GeckoTerminal"
                    ],
                    "description": "Who the prices come from."
                  },
                  "observedAt": {
                    "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 they were read."
                  }
                },
                "required": [
                  "name",
                  "observedAt"
                ],
                "description": "Where the prices come from and when they were read."
              },
              "coverage": {
                "description": "Actual history coverage and freshness; short or gapped history does not support a longer trend claim.",
                "type": "object",
                "properties": {
                  "firstAt": {
                    "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))$"
                  },
                  "lastAt": {
                    "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))$"
                  },
                  "sampleCount": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "coveredSeconds": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "expectedIntervalSeconds": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "completedThrough": {
                    "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))$"
                  },
                  "gaps": {
                    "type": "string",
                    "enum": [
                      "none",
                      "detected",
                      "unknown"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "ready",
                      "limited",
                      "stale"
                    ]
                  }
                },
                "required": [
                  "firstAt",
                  "lastAt",
                  "sampleCount",
                  "coveredSeconds",
                  "expectedIntervalSeconds",
                  "gaps",
                  "status"
                ]
              },
              "points": {
                "minItems": 1,
                "maxItems": 200,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "time": {
                      "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 point's period began."
                    },
                    "closeUsd": {
                      "type": "string",
                      "maxLength": 80,
                      "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$",
                      "description": "The price at the close of the period, in US dollars per whole token."
                    },
                    "ohlcv": {
                      "description": "Exact USD open/high/low and traded volume for this pool's candle, when all are valid and coherent with its close. Not token-wide volume or an execution quote. The latest candle may still be forming; use coverage.completedThrough for closed-period analysis.",
                      "type": "object",
                      "properties": {
                        "openUsd": {
                          "type": "string",
                          "maxLength": 80,
                          "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                        },
                        "highUsd": {
                          "type": "string",
                          "maxLength": 80,
                          "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                        },
                        "lowUsd": {
                          "type": "string",
                          "maxLength": 80,
                          "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                        },
                        "volumeUsd": {
                          "type": "string",
                          "maxLength": 80,
                          "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "openUsd",
                        "highUsd",
                        "lowUsd",
                        "volumeUsd"
                      ]
                    }
                  },
                  "required": [
                    "time",
                    "closeUsd"
                  ]
                },
                "description": "Closing prices with available pool OHLCV, oldest first."
              }
            },
            "required": [
              "status",
              "mint",
              "interval",
              "pool",
              "source",
              "points"
            ]
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "unavailable",
                "description": "No chart could be drawn."
              },
              "mint": {
                "type": "string",
                "minLength": 32,
                "maxLength": 44,
                "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                "description": "The token's mint address."
              },
              "interval": {
                "type": "string",
                "enum": [
                  "1m",
                  "5m",
                  "15m",
                  "1h",
                  "4h",
                  "1d"
                ],
                "description": "How wide each point is: one, five or fifteen minutes, one or four hours, or one day."
              },
              "reason": {
                "type": "string",
                "enum": [
                  "no_pool",
                  "provider_unavailable",
                  "invalid_response"
                ],
                "description": "`no_pool` when no pool prices the token; the others when the price provider could not be read."
              }
            },
            "required": [
              "status",
              "mint",
              "interval",
              "reason"
            ]
          }
        ],
        "description": "A token's recent closing prices from its deepest pool, or why there are none."
      },
      "SolanaTokenHolding": {
        "type": "object",
        "properties": {
          "assetId": {
            "type": "string",
            "pattern": "^asset_[0-9a-f]{64}$",
            "description": "The holding's stable id: `walletAssetId` of `solana:<mint>`."
          },
          "mint": {
            "type": "string",
            "minLength": 32,
            "maxLength": 44,
            "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
            "description": "The token's mint address."
          },
          "symbol": {
            "description": "Its symbol, when the venue lists it.",
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "name": {
            "description": "Its name, when the venue lists it.",
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "iconUrl": {
            "type": "string",
            "pattern": "^\\/v1\\/solana\\/tokens\\/[1-9A-HJ-NP-Za-km-z]{32,44}\\/icon$",
            "description": "Where Fin serves the token's icon: the path of Get a token icon on this API, which answers the image, or not found when the data source's icon cannot be used. Absent when the data source lists none; draw a placeholder then."
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 255,
            "description": "The mint's decimals."
          },
          "tokenProgram": {
            "type": "string",
            "enum": [
              "spl_token",
              "token_2022"
            ],
            "description": "The program that owns the mint: `spl_token` (SPL Token) or `token_2022` (Token-2022)."
          },
          "amountRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The exact amount held, in the token's smallest unit."
          },
          "priceUsd": {
            "description": "The price of one whole token in US dollars; absent when it has no reliable price.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "valueUsd": {
            "description": "What the holding is worth in US dollars; absent when it has no price.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "averageCostUsd": {
            "description": "What the agent's own settled buys of the token paid for one whole token, in USDC, with each sale taking its share of the cost: an average cost, never a market price. Absent when no buy paid in USDC can state one, as when a buy was paid in SOL.",
            "type": "string",
            "maxLength": 80,
            "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
          },
          "unrealizedPnlUsd": {
            "description": "What the holding has gained (positive) or lost (negative) against that average cost at `priceUsd`, in US dollars: (`priceUsd` − `averageCostUsd`) × the amount held. Absent without both.",
            "type": "string",
            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
          },
          "costBasisStatus": {
            "description": "How far `averageCostUsd` can be trusted. `complete`: every buy and sell of the token the agent made settled with its amounts recorded, every buy was paid in USDC, and those trades account for exactly the amount held. `partial`: one of them is still in flight or left an amount unknown, a buy was paid in SOL, or the amount held moved outside those trades, so say so wherever the average is shown. `unknown`: the agent has no settled buy of it, so there is no average cost.",
            "type": "string",
            "enum": [
              "complete",
              "partial",
              "unknown"
            ]
          }
        },
        "required": [
          "assetId",
          "mint",
          "decimals",
          "tokenProgram",
          "amountRaw"
        ],
        "description": "One recognized token the Solana account holds; it stays listed when it has no price."
      },
      "SolanaHoldings": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "observed",
                "description": "The account's balances and token recognition were read successfully."
              },
              "observedAt": {
                "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 holdings were read."
              },
              "sol": {
                "type": "object",
                "properties": {
                  "lamports": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "All the SOL the account holds, in lamports."
                  },
                  "reserveLamports": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "SOL the account always keeps for rent and network fees, so it can still sell and withdraw."
                  },
                  "spendableLamports": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,38})$",
                    "description": "SOL above the reserve, in lamports."
                  },
                  "priceUsd": {
                    "description": "The price of one SOL in US dollars; absent when it could not be read.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  },
                  "valueUsd": {
                    "description": "What the account's SOL is worth in US dollars; absent without a price.",
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
                  }
                },
                "required": [
                  "lamports",
                  "reserveLamports",
                  "spendableLamports"
                ],
                "description": "The account's SOL, which pays its network fees."
              },
              "tokens": {
                "maxItems": 1000,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SolanaTokenHolding"
                },
                "description": "Recognized token balances: canonical wrapped SOL, tokens verified by the venue without a suspicious flag whose decimals and token program match the mint on chain, or tokens this account has a confirmed landed buy of. Recognition uses exact mints, never names, symbols or prices. Recognized tokens stay listed without a price."
              },
              "valueUsd": {
                "type": "string",
                "maxLength": 80,
                "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$",
                "description": "What the SOL and priced recognized tokens are worth together, in US dollars. Unpriced recognized holdings are left out and counted in `unpricedCount`; unrecognized tokens are excluded from both."
              },
              "unpricedCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "How many recognized holdings, SOL included, have no price and are left out of `valueUsd`. Unrecognized tokens are not counted."
              }
            },
            "required": [
              "status",
              "observedAt",
              "sol",
              "tokens",
              "valueUsd",
              "unpricedCount"
            ]
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "unavailable",
                "description": "The holdings could not be read."
              },
              "reason": {
                "type": "string",
                "enum": [
                  "provider_unavailable",
                  "invalid_response"
                ],
                "description": "Why the balances or evidence needed to recognize a held token could not be read. Never a zero balance or an empty token list."
              }
            },
            "required": [
              "status",
              "reason"
            ]
          }
        ],
        "description": "A live read of the Solana account's SOL and recognized token balances, or why it could not be read."
      },
      "SolanaAccount": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "minLength": 32,
            "maxLength": 44,
            "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
            "description": "The agent's own Solana address. Fin's policy service holds its key, which is not the agent wallet's."
          },
          "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 Solana account was first opened."
          },
          "holdings": {
            "$ref": "#/components/schemas/SolanaHoldings"
          }
        },
        "required": [
          "address",
          "createdAt",
          "holdings"
        ],
        "description": "The agent's own Solana account and a live read of its SOL and recognized token balances."
      },
      "SuggestedMove": {
        "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 suggestion's id. The same move in a later read keeps it."
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "The move, verb first, with its exact terms: `Move your NEAR buy to $4.80`."
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 280,
            "description": "Why, in one sentence; Fin filled in every figure from the account."
          },
          "review": {
            "$ref": "#/components/schemas/ReviewTerms"
          },
          "surfaces": {
            "minItems": 1,
            "maxItems": 8,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^(home|orders|automations|swap|earn|asset:asset_[a-f0-9]{64})$",
              "description": "A page of your app: `home`, `orders`, `automations`, `swap`, `earn`, or one asset's page as `asset:` and its `assetId` from Get balances."
            },
            "description": "The pages it belongs on; `home` is always one."
          },
          "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": "When it stops showing, unless the account or the market moves it on sooner."
          }
        },
        "required": [
          "id",
          "title",
          "reason",
          "review",
          "surfaces",
          "expiresAt"
        ],
        "description": "One move Fin suggests on the user's own money, and the exact terms its review draws. Nothing moves until the user reviews and confirms it."
      },
      "PageSuggestions": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ready",
              "thinking",
              "failed"
            ],
            "description": "`ready` with what Fin suggests here, `thinking` while Fin reads an account it has nothing saved for yet, or `failed` when it could not look."
          },
          "updating": {
            "type": "boolean",
            "description": "Fin is reading the account again in the background; the suggestions here hold meanwhile."
          },
          "failureReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "budget_exhausted",
                  "rate_limited",
                  "model_unavailable",
                  "model_timeout",
                  "invalid_output"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Why Fin could not look, when `status` is `failed`; null otherwise."
          },
          "retryable": {
            "type": "boolean",
            "description": "Whether reading again can help. False when the user's AI spending limit or the hourly limit refused: only time resets those, so offer no Try again."
          },
          "suggestions": {
            "maxItems": 3,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SuggestedMove"
            },
            "description": "What Fin suggests for this page, best first; empty when nothing needs the user."
          },
          "calm": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "watching": {
                    "type": "object",
                    "properties": {
                      "orders": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000,
                        "description": "Resting orders."
                      },
                      "automations": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000,
                        "description": "Automations that are on."
                      }
                    },
                    "required": [
                      "orders",
                      "automations"
                    ],
                    "description": "What Fin keeps an eye on."
                  }
                },
                "required": [
                  "watching"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "When `status` is `ready` and nothing needs the user; null otherwise."
          }
        },
        "required": [
          "status",
          "updating",
          "failureReason",
          "retryable",
          "suggestions",
          "calm"
        ],
        "description": "What Fin suggests for one page of your app, from its latest read of the whole account."
      },
      "Voice": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "available",
              "disabled",
              "unavailable"
            ],
            "description": "`available`: the user can send recordings now. `disabled`: voice input is not turned on for this user. `unavailable`: this deployment has no speech model. Show a microphone only while it is `available`."
          },
          "maxSeconds": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "description": "The longest recording to send, in seconds. Stop recording when it is reached."
          },
          "formats": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "contentType": {
                  "type": "string",
                  "enum": [
                    "audio/webm",
                    "audio/mp4",
                    "audio/ogg",
                    "audio/wav"
                  ],
                  "description": "The audio type, as the `Content-Type` header names it. Codec parameters are allowed (`audio/ogg;codecs=opus`)."
                },
                "maxBytes": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991,
                  "description": "The largest recording of this type Fin accepts, in bytes: a minute of speech with room to spare. A larger one answers `413`."
                }
              },
              "required": [
                "contentType",
                "maxBytes"
              ]
            },
            "description": "The audio a recording may be sent as: the types this deployment's speech model decodes, each with its largest size. Send one of these. A browser that records another (the WebM Chrome, Edge and Safari record) converts its recording to WAV first. Empty when there is no speech model."
          }
        },
        "required": [
          "status",
          "maxSeconds",
          "formats"
        ],
        "description": "Whether the user can talk instead of type, and the limits a recording must keep to."
      },
      "Transcription": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 8192,
            "description": "What the recording says, as text. Empty when no speech was heard: say so and let the user try again."
          }
        },
        "required": [
          "text"
        ],
        "description": "The words of one recording. Nothing is sent to the agent: put them where the user writes, to read, change and send."
      },
      "DepositQuote": {
        "type": "object",
        "properties": {
          "expectedCreditRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "What the agent wallet would be credited now for `amountRaw`, in the asset's smallest unit: 1Click's own figure at the current price."
          },
          "minimumCreditRaw": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,38})$",
            "description": "The least the agent wallet is credited within `maxValueLossBps`: the amount less the loss limit, rounded up. Send it as `terms.minimumCreditRaw` to Create a deposit, which holds the deposit to it."
          },
          "quotedAt": {
            "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 1Click priced it. A preview binds nothing: Create a deposit prices the deposit again when it issues the address, so quote again if the user lingers."
          }
        },
        "required": [
          "expectedCreditRaw",
          "minimumCreditRaw",
          "quotedAt"
        ],
        "description": "What a deposit of an exact amount would credit the agent wallet now, and the least it will."
      },
      "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."
      },
      "schema0": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/RunOutputObjectSchema"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "array",
                "description": "JSON Schema type keyword: array."
              },
              "description": {
                "description": "Human-readable meaning of this schema node.",
                "type": "string"
              },
              "items": {
                "description": "Schema every array entry must satisfy.",
                "$ref": "#/components/schemas/RunOutputSchemaNode"
              },
              "minItems": {
                "description": "Inclusive minimum number of array entries.",
                "type": "number"
              },
              "maxItems": {
                "description": "Inclusive maximum number of array entries.",
                "type": "number"
              }
            },
            "required": [
              "type",
              "items"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "string",
                "description": "JSON Schema type keyword: string."
              },
              "description": {
                "description": "Human-readable meaning of this schema node.",
                "type": "string"
              },
              "enum": {
                "description": "The allowed literal values, when restricted.",
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "minLength": {
                "description": "Inclusive minimum string length.",
                "type": "number"
              },
              "maxLength": {
                "description": "Inclusive maximum string length.",
                "type": "number"
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "number",
                "description": "JSON Schema type keyword: number."
              },
              "description": {
                "description": "Human-readable meaning of this schema node.",
                "type": "string"
              },
              "enum": {
                "description": "The allowed literal values, when restricted.",
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "minimum": {
                "description": "Inclusive numeric lower bound.",
                "type": "number"
              },
              "maximum": {
                "description": "Inclusive numeric upper bound.",
                "type": "number"
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "integer",
                "description": "JSON Schema type keyword: integer."
              },
              "description": {
                "description": "Human-readable meaning of this schema node.",
                "type": "string"
              },
              "enum": {
                "description": "The allowed literal values, when restricted.",
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "minimum": {
                "description": "Inclusive numeric lower bound.",
                "type": "number"
              },
              "maximum": {
                "description": "Inclusive numeric upper bound.",
                "type": "number"
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "boolean",
                "description": "JSON Schema type keyword: boolean."
              },
              "description": {
                "description": "Human-readable meaning of this schema node.",
                "type": "string"
              },
              "enum": {
                "description": "The allowed literal values, when restricted.",
                "type": "array",
                "items": {
                  "type": "boolean"
                }
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "null",
                "description": "JSON Schema type keyword: null."
              },
              "description": {
                "description": "Human-readable meaning of this schema node.",
                "type": "string"
              }
            },
            "required": [
              "type"
            ]
          }
        ],
        "description": "One supported strict JSON Schema node: object, array, string, number, integer, boolean or null."
      }
    },
    "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"
            }
          }
        }
      },
      "PayloadTooLarge": {
        "description": "The body exceeds the size this deployment accepts.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "InvalidInputForRegistration": {
        "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",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "ForbiddenForRegistration": {
        "description": "The credentials are valid but may not do this.\n\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"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/v1/users": {
      "post": {
        "operationId": "users.create",
        "summary": "Create a user",
        "tags": [
          "users"
        ],
        "description": "Creates a user for your app, identified by your own `userId`, together with their agent and their main conversation. Safe to repeat: the same `userId` returns the same user. Call it before the user's first session. It creates no wallet; the user creates that later with a signature (Create the agent wallet).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                    "description": "Your identifier for this user: unique within your partner, 1-128 characters of letters, digits, `.`, `_`, `:` or `-`, starting with a letter or digit. It appears in URLs, so never use an email address or other personal data."
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "description": "The user's name, for display only."
                  }
                },
                "required": [
                  "userId",
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The user and their agent, with their agent wallet once they have created it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "userId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                      "description": "Your identifier for this user: unique within your partner, 1-128 characters of letters, digits, `.`, `_`, `:` or `-`, starting with a letter or digit. It appears in URLs, so never use an email address or other personal data."
                    },
                    "partnerId": {
                      "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": "Your partner id, from your API key."
                    },
                    "name": {
                      "type": "string",
                      "description": "The user's display name."
                    },
                    "agentId": {
                      "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 user's agent. Every call returns the same one."
                    },
                    "walletId": {
                      "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 agent wallet's id; null until the user creates it with their signature (Create the agent wallet)."
                    }
                  },
                  "required": [
                    "userId",
                    "partnerId",
                    "name",
                    "agentId",
                    "walletId"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInputForRegistration"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenForRegistration"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/me": {
      "get": {
        "operationId": "users.me",
        "summary": "Get the signed-in user",
        "tags": [
          "users"
        ],
        "description": "Returns the user the session token belongs to and when the session expires. Use it to check that a session is still valid.",
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The signed-in user and their session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/session-challenges": {
      "post": {
        "operationId": "users.sessionChallenge",
        "summary": "Start wallet sign-in",
        "tags": [
          "users"
        ],
        "description": "Step 1 of wallet sign-in, for apps without their own login. If your app already signed the user in, skip this and call Create a session with the wallet they used. Returns a `message` for the user to sign with their wallet or passkey. Have them sign it exactly as returned, then send `challengeId` and the signature to Create a session within 5 minutes. `origin` must be one of your registered app origins. Signing only proves who the user is; it cannot move funds. The first wallet a user signs in with becomes the one that must sign their wallet creation, withdrawals and approvals.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "controller": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "description": "An externally owned EVM signing account.",
                            "enum": [
                              "evm"
                            ]
                          },
                          "chainId": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991,
                            "description": "The EIP-155 chain identifier included in the login proof."
                          },
                          "address": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$",
                            "description": "The wallet's EVM address. It is not the agent wallet."
                          }
                        },
                        "required": [
                          "kind",
                          "chainId",
                          "address"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "description": "A registered P-256 (ES256) or Ed25519 (EdDSA) WebAuthn passkey.",
                            "enum": [
                              "webauthn"
                            ]
                          },
                          "credentialId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 8192,
                            "pattern": "^[A-Za-z0-9_-]+$",
                            "description": "The credential identifier encoded as base64url."
                          },
                          "publicKey": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 8192,
                            "pattern": "^[A-Za-z0-9_-]+$",
                            "description": "The credential's COSE public key encoded as base64url."
                          },
                          "rpId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 253,
                            "description": "The trusted relying-party hostname registered for this partner."
                          },
                          "origin": {
                            "type": "string",
                            "maxLength": 2048,
                            "format": "uri",
                            "description": "The exact trusted browser origin for the credential."
                          }
                        },
                        "required": [
                          "kind",
                          "credentialId",
                          "publicKey",
                          "rpId",
                          "origin"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "description": "A NEAR account. Any of its full-access keys may sign (NEP-413); an implicit account's key is its id.",
                            "enum": [
                              "near"
                            ]
                          },
                          "accountId": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 64,
                            "pattern": "^(([a-z\\d]+[-_])*[a-z\\d]+\\.)*([a-z\\d]+[-_])*[a-z\\d]+$",
                            "description": "The NEAR account id, lowercase."
                          }
                        },
                        "required": [
                          "kind",
                          "accountId"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "description": "A Solana wallet that signs messages (signMessage).",
                            "enum": [
                              "solana"
                            ]
                          },
                          "address": {
                            "type": "string",
                            "minLength": 32,
                            "maxLength": 44,
                            "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                            "description": "The base58 Ed25519 public key that is the Solana address."
                          }
                        },
                        "required": [
                          "kind",
                          "address"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "description": "A Stellar account that signs messages (SEP-53).",
                            "enum": [
                              "stellar"
                            ]
                          },
                          "address": {
                            "type": "string",
                            "pattern": "^G[A-Z2-7]{55}$",
                            "description": "The Stellar account id (G… strkey)."
                          }
                        },
                        "required": [
                          "kind",
                          "address"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "description": "A TON wallet that signs text through TON Connect `signData`. The wallet address arrives with each signature.",
                            "enum": [
                              "ton"
                            ]
                          },
                          "publicKey": {
                            "type": "string",
                            "pattern": "^[0-9a-f]{64}$",
                            "description": "The wallet's Ed25519 public key in lowercase hexadecimal."
                          }
                        },
                        "required": [
                          "kind",
                          "publicKey"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "description": "A Tron account that signs messages (TIP-191).",
                            "enum": [
                              "tron"
                            ]
                          },
                          "address": {
                            "type": "string",
                            "pattern": "^T[1-9A-HJ-NP-Za-km-z]{33}$",
                            "description": "The base58check Tron address (T…)."
                          }
                        },
                        "required": [
                          "kind",
                          "address"
                        ],
                        "additionalProperties": false
                      }
                    ],
                    "description": "The wallet or passkey the user will sign with."
                  },
                  "origin": {
                    "type": "string",
                    "format": "uri",
                    "description": "The browser origin the user signs in from; one of your registered app origins."
                  },
                  "createWallet": {
                    "description": "Send `true` to open the account in one signature: for a user with no agent wallet yet, the message also creates it, so after Create a session you send the same `challengeId` and `signature` to Create the agent wallet as `signIn` and the user signs nothing more. A user who already has a wallet gets the plain sign-in message. Leave it out to keep sign-in and wallet creation as two signatures.",
                    "type": "boolean"
                  }
                },
                "required": [
                  "controller",
                  "origin"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "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": []
          }
        ],
        "responses": {
          "200": {
            "description": "The message to sign.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "challengeId": {
                      "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": "This challenge's id; send it with the signature to Create a session."
                    },
                    "message": {
                      "type": "string",
                      "description": "The message the user signs, exactly as returned."
                    },
                    "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": "When the challenge expires (UTC); sign and send it before then."
                    },
                    "recipient": {
                      "description": "NEAR wallets only: the NEP-413 `recipient` to pass to `signMessage`.",
                      "type": "string"
                    },
                    "createsWallet": {
                      "type": "boolean",
                      "description": "Whether signing this message also creates the user's agent wallet. True only when you sent `createWallet` and the user has no wallet yet: after Create a session, send the same `challengeId` and `signature` to Create the agent wallet as `signIn`."
                    }
                  },
                  "required": [
                    "challengeId",
                    "message",
                    "expiresAt",
                    "createsWallet"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInputForRegistration"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenForRegistration"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/sessions": {
      "post": {
        "operationId": "users.createSession",
        "summary": "Create a session",
        "tags": [
          "users"
        ],
        "description": "Signs a user in and returns a session token for their requests. If your app has its own login, send `controller`: the wallet or passkey your login verified. Otherwise send the `challengeId` and `signature` from Start wallet sign-in. Send the returned `token` as `Authorization: Bearer …` with your API key on the user's requests. Sessions last an hour and cannot be refreshed; create a new one when it expires. The user's first session registers their wallet for good, and later sessions must name the same one. When the user just created a passkey in your app, also send `createWallet: true`: a session that answers `createsWallet: true` creates their agent wallet with an empty body to Create the agent wallet, so they confirm only the passkey's creation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "controller": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "An externally owned EVM signing account.",
                                "enum": [
                                  "evm"
                                ]
                              },
                              "chainId": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991,
                                "description": "The EIP-155 chain identifier included in the login proof."
                              },
                              "address": {
                                "type": "string",
                                "pattern": "^0x[0-9a-fA-F]{40}$",
                                "description": "The wallet's EVM address. It is not the agent wallet."
                              }
                            },
                            "required": [
                              "kind",
                              "chainId",
                              "address"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A registered P-256 (ES256) or Ed25519 (EdDSA) WebAuthn passkey.",
                                "enum": [
                                  "webauthn"
                                ]
                              },
                              "credentialId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 8192,
                                "pattern": "^[A-Za-z0-9_-]+$",
                                "description": "The credential identifier encoded as base64url."
                              },
                              "publicKey": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 8192,
                                "pattern": "^[A-Za-z0-9_-]+$",
                                "description": "The credential's COSE public key encoded as base64url."
                              },
                              "rpId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 253,
                                "description": "The trusted relying-party hostname registered for this partner."
                              },
                              "origin": {
                                "type": "string",
                                "maxLength": 2048,
                                "format": "uri",
                                "description": "The exact trusted browser origin for the credential."
                              }
                            },
                            "required": [
                              "kind",
                              "credentialId",
                              "publicKey",
                              "rpId",
                              "origin"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A NEAR account. Any of its full-access keys may sign (NEP-413); an implicit account's key is its id.",
                                "enum": [
                                  "near"
                                ]
                              },
                              "accountId": {
                                "type": "string",
                                "minLength": 2,
                                "maxLength": 64,
                                "pattern": "^(([a-z\\d]+[-_])*[a-z\\d]+\\.)*([a-z\\d]+[-_])*[a-z\\d]+$",
                                "description": "The NEAR account id, lowercase."
                              }
                            },
                            "required": [
                              "kind",
                              "accountId"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A Solana wallet that signs messages (signMessage).",
                                "enum": [
                                  "solana"
                                ]
                              },
                              "address": {
                                "type": "string",
                                "minLength": 32,
                                "maxLength": 44,
                                "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                                "description": "The base58 Ed25519 public key that is the Solana address."
                              }
                            },
                            "required": [
                              "kind",
                              "address"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A Stellar account that signs messages (SEP-53).",
                                "enum": [
                                  "stellar"
                                ]
                              },
                              "address": {
                                "type": "string",
                                "pattern": "^G[A-Z2-7]{55}$",
                                "description": "The Stellar account id (G… strkey)."
                              }
                            },
                            "required": [
                              "kind",
                              "address"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A TON wallet that signs text through TON Connect `signData`. The wallet address arrives with each signature.",
                                "enum": [
                                  "ton"
                                ]
                              },
                              "publicKey": {
                                "type": "string",
                                "pattern": "^[0-9a-f]{64}$",
                                "description": "The wallet's Ed25519 public key in lowercase hexadecimal."
                              }
                            },
                            "required": [
                              "kind",
                              "publicKey"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A Tron account that signs messages (TIP-191).",
                                "enum": [
                                  "tron"
                                ]
                              },
                              "address": {
                                "type": "string",
                                "pattern": "^T[1-9A-HJ-NP-Za-km-z]{33}$",
                                "description": "The base58check Tron address (T…)."
                              }
                            },
                            "required": [
                              "kind",
                              "address"
                            ],
                            "additionalProperties": false
                          }
                        ],
                        "description": "The wallet or passkey your login verified. The user's first session registers it for good: later sessions must name the same one, and it signs the user's withdrawals and approvals."
                      },
                      "createWallet": {
                        "description": "Send `true` when the user just created this passkey in your app, to open their account with no signature: if this session is the one that registers the passkey and the user has no agent wallet, the answer has `createsWallet: true`, and Create the agent wallet with an empty body from this session makes the wallet within 270 seconds. Creating a passkey signs nothing, so this is the one sign-up the user confirms only once. A wallet, a passkey already registered, or one whose key is no point on its curve opens nothing this way (`createsWallet: false`): the user signs the wallet's creation.",
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "controller"
                    ],
                    "additionalProperties": false,
                    "description": "Your app's own login already signed the user in (for example near.com's 1Click session): name the wallet or passkey it verified. No signature is needed."
                  },
                  {
                    "type": "object",
                    "properties": {
                      "challengeId": {
                        "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 `challengeId` from Start wallet sign-in."
                      },
                      "signature": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "An EIP-191 personal-message signature by the current controller.",
                                "enum": [
                                  "evm"
                                ]
                              },
                              "signature": {
                                "type": "string",
                                "pattern": "^0x[0-9a-fA-F]{130}$",
                                "description": "The 65-byte hexadecimal signature over the exact supplied message."
                              }
                            },
                            "required": [
                              "kind",
                              "signature"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A user-verified WebAuthn assertion over the message digest.",
                                "enum": [
                                  "webauthn"
                                ]
                              },
                              "credentialId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 8192,
                                "pattern": "^[A-Za-z0-9_-]+$",
                                "description": "The signing credential identifier encoded as base64url."
                              },
                              "clientDataJSON": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 8192,
                                "pattern": "^[A-Za-z0-9_-]+$",
                                "description": "The authenticator's client-data JSON bytes encoded as base64url."
                              },
                              "authenticatorData": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 8192,
                                "pattern": "^[A-Za-z0-9_-]+$",
                                "description": "The authenticator data bytes encoded as base64url."
                              },
                              "signature": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 8192,
                                "pattern": "^[A-Za-z0-9_-]+$",
                                "description": "The authenticator's signature encoded as base64url."
                              },
                              "userHandle": {
                                "description": "The optional authenticator user handle encoded as base64url.",
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 8192,
                                    "pattern": "^[A-Za-z0-9_-]+$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "kind",
                              "credentialId",
                              "clientDataJSON",
                              "authenticatorData",
                              "signature"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A NEP-413 `signMessage` result over `{message, nonce, recipient}`, where `recipient` is the host of Fin's audience.",
                                "enum": [
                                  "near"
                                ]
                              },
                              "publicKey": {
                                "type": "string",
                                "pattern": "^ed25519:[1-9A-HJ-NP-Za-km-z]{32,44}$",
                                "description": "The signing key as the wallet reports it (`ed25519:` then base58)."
                              },
                              "signature": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9+/]{86}==$",
                                "description": "The 64-byte Ed25519 signature in padded standard base64."
                              },
                              "nonce": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$",
                                "description": "The 32-byte nonce the caller gave the wallet, in padded standard base64."
                              }
                            },
                            "required": [
                              "kind",
                              "publicKey",
                              "signature",
                              "nonce"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A Solana `signMessage` Ed25519 signature over the exact UTF-8 message bytes.",
                                "enum": [
                                  "solana"
                                ]
                              },
                              "signature": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9+/]{86}==$",
                                "description": "The 64-byte Ed25519 signature in padded standard base64."
                              }
                            },
                            "required": [
                              "kind",
                              "signature"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A SEP-53 signature: Ed25519 over sha256(\"Stellar Signed Message:\\n\" + message).",
                                "enum": [
                                  "stellar"
                                ]
                              },
                              "signature": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9+/]{86}==$",
                                "description": "The 64-byte Ed25519 signature in padded standard base64."
                              }
                            },
                            "required": [
                              "kind",
                              "signature"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A TON Connect `signData` result for a `text` payload that is exactly the message.",
                                "enum": [
                                  "ton"
                                ]
                              },
                              "signature": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9+/]{86}==$",
                                "description": "The 64-byte Ed25519 signature in padded standard base64."
                              },
                              "address": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128,
                                "description": "The signing wallet's address exactly as the wallet returned it."
                              },
                              "domain": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 253,
                                "description": "The dApp domain the wallet attested; it must be a partner-registered origin's host."
                              },
                              "timestamp": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991,
                                "description": "The wallet's signing time in UNIX seconds; it must be within five minutes."
                              }
                            },
                            "required": [
                              "kind",
                              "signature",
                              "address",
                              "domain",
                              "timestamp"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A TIP-191 `signMessageV2` signature over the exact message.",
                                "enum": [
                                  "tron"
                                ]
                              },
                              "signature": {
                                "type": "string",
                                "pattern": "^0x[0-9a-fA-F]{130}$",
                                "description": "The 65-byte recoverable secp256k1 signature in hexadecimal."
                              }
                            },
                            "required": [
                              "kind",
                              "signature"
                            ],
                            "additionalProperties": false
                          }
                        ],
                        "description": "The user's signature of the challenge `message`."
                      }
                    },
                    "required": [
                      "challengeId",
                      "signature"
                    ],
                    "additionalProperties": false,
                    "description": "Wallet sign-in: the user signed the message from Start wallet sign-in. Use this when your app has no sign-in of its own."
                  }
                ],
                "description": "How the user signed in: through your app's own login, or with a wallet signature."
              }
            }
          },
          "description": "How the user signed in: through your app's own login, or with a wallet signature."
        },
        "parameters": [
          {
            "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": []
          }
        ],
        "responses": {
          "201": {
            "description": "The session and its token, shown only this once.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string",
                      "pattern": "^fin_session_[A-Za-z0-9_-]{43}$",
                      "description": "The session token, shown only once. Send it as `Authorization: Bearer …`; keep it on your server or in an HttpOnly cookie."
                    },
                    "session": {
                      "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 session's id; Revoke a session signs it out."
                        },
                        "partnerId": {
                          "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": "Your partner id."
                        },
                        "userId": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                          "description": "Your identifier for this user: unique within your partner, 1-128 characters of letters, digits, `.`, `_`, `:` or `-`, starting with a letter or digit. It appears in URLs, so never use an email address or other personal data."
                        },
                        "agentId": {
                          "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 user's agent."
                        },
                        "controllerId": {
                          "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 id of the wallet or passkey the user signed in with."
                        },
                        "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": "When the session expires (UTC). Create a new session after that."
                        }
                      },
                      "required": [
                        "id",
                        "partnerId",
                        "userId",
                        "agentId",
                        "controllerId",
                        "expiresAt"
                      ],
                      "description": "The session: its id, user and expiry."
                    },
                    "createsWallet": {
                      "type": "boolean",
                      "description": "Whether this session opened the user's account, so their agent wallet needs no further signature from them. After a wallet sign-in, true when the challenge had `createsWallet: true`: send its `challengeId` and `signature` to Create the agent wallet as `signIn`. After your app's own login with `createWallet`, true for a passkey this session registered: send Create the agent wallet an empty body from this session within 270 seconds. Otherwise false."
                    }
                  },
                  "required": [
                    "token",
                    "session",
                    "createsWallet"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInputForRegistration"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenForRegistration"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/sessions/{sessionId}": {
      "delete": {
        "operationId": "users.revokeSession",
        "summary": "Revoke a session",
        "tags": [
          "users"
        ],
        "description": "Signs the session out: its token stops working at once, including on open event streams. Call it when the user logs out of your app. Runs already started keep going and nothing is deleted.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "sessionId",
            "required": true,
            "description": "The session to sign out: the `id` from Create a session."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "204": {
            "description": "The session is signed out."
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/features": {
      "get": {
        "operationId": "users.listFeatures",
        "summary": "List a user's features",
        "tags": [
          "users"
        ],
        "description": "Lists the features an operator turns on or off for each user, and whether this user has each one now. Use it to show only what the user can use: while a feature is off, the user cannot start it, so its routes refuse and their runs go without it. What the user already has stays readable, and selling, withdrawing and stopping never depend on a feature. Read it again when the user comes back, because an operator can change it at any time.",
        "parameters": [
          {
            "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": "Every feature and whether this user has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserFeatures"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/partner/usage": {
      "get": {
        "operationId": "partner.usage",
        "summary": "Get partner usage",
        "tags": [
          "partner"
        ],
        "description": "Exports attributed run model invocations and exact known costs, reserved maximums and uncertain exposure for an original UTC budget period. Totals include your users' runs, the partner's own runs, suggestions and voice transcriptions; suggestionTotals and voiceTotals identify the portions without a run, and partnerRunTotals the portion of runs Fin makes for the partner itself (market briefs), which the page leaves out. Page rows and totals share one database snapshot. Contains no prompts, credentials, trading balances or customer billing.",
        "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",
              "enum": [
                "day",
                "month"
              ]
            },
            "in": "query",
            "name": "periodKind",
            "required": true,
            "description": "Original UTC budget period, day or calendar month."
          },
          {
            "schema": {
              "type": "string",
              "format": "date",
              "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])))$"
            },
            "in": "query",
            "name": "periodStart",
            "required": true,
            "description": "UTC date. Month periods must start on the first day."
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Exact inference costs and a bounded export page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerUsage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenForRegistration"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/partner/quotas": {
      "get": {
        "operationId": "partner.quotas",
        "summary": "Get partner quotas",
        "tags": [
          "partner"
        ],
        "description": "Returns configured request, run, stream and inference limits shared by every key and user of this partner, with current utilization and effective budget-period caps, including any operator adjustments. Use periods[].capCents for the current period's allowance; limits contains the configuration for future periods. Reading this snapshot does not reserve capacity.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current configured limits and observed capacity.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerQuotas"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInputForRegistration"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenForRegistration"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/partner/features": {
      "get": {
        "operationId": "partner.features",
        "summary": "List partner features",
        "tags": [
          "partner"
        ],
        "description": "Lists the features an operator turns on or off for your key rather than for each user, such as `market_briefs` or `disable_invite_code_requirements`, and whether your key has each one now. Use it for what your app offers before anyone signs in; for what one signed-in user can use, call List a user's features. Read it each time you need the answer, because an operator can change it at any time.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every partner feature and whether your key has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerFeatures"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInputForRegistration"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenForRegistration"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/market/subjects": {
      "get": {
        "operationId": "market.subjects.list",
        "summary": "List market subjects",
        "tags": [
          "market"
        ],
        "description": "Lists what a market brief can be about: the market, chains, assets, an asset's copy on one chain, and stocks, each with the identifiers that also name it. Pass `alias` to find the subjects a CoinGecko id, symbol, contract address or 1Click asset id names, and `kind` for one kind.",
        "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",
              "enum": [
                "market",
                "chain",
                "asset",
                "stock"
              ]
            },
            "in": "query",
            "name": "kind",
            "required": false,
            "description": "Only subjects of this kind."
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "in": "query",
            "name": "alias",
            "required": false,
            "description": "Only the subjects this identifier names."
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The subjects market briefs cover.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketSubjects"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The credentials are valid but may not do this.\n\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\n- `market_briefs_disabled` — market briefs are not turned on for your partner key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/market/briefs": {
      "post": {
        "operationId": "market.briefs.create",
        "summary": "Create a market brief",
        "tags": [
          "market"
        ],
        "description": "Starts a brief on what the scope did over the window, with possible explanations and sources. Use `mode: news` to research a quiet price move; the default `auto` mode may answer a quiet scope at once with `status: ready`, free. A researched job answers 202 `generating`; read it with Get a market brief until it is `ready` or `failed`. Research is charged to your partner. Cache by `scope`, `window` and `mode`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMarketBriefInputInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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)$"
            },
            "example": "d5565100-9342-4bc6-a803-b387a20cb536",
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "description": "A UUID you generate for this request. Send the same key and the same body to retry it safely: you get the original result back, never a second one. A different body under the same key is refused with `request_key_conflict`."
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The brief, finished at once.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketBriefJob"
                }
              }
            }
          },
          "202": {
            "description": "The brief job, generating.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketBriefJob"
                }
              }
            }
          },
          "400": {
            "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- `scope_invalid` — a subject in the scope is not a subject id, or appears twice",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The credentials are valid but may not do this.\n\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\n- `market_briefs_disabled` — market briefs are not turned on for your partner key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.\n\n- `subject_unsupported` — a subject in the scope is not one market briefs cover; list them with List market subjects",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `request_key_conflict` — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "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\n- `briefs_busy` — your market briefs are at their limit of briefs generating at once; retry after `Retry-After`\n- `budget_exhausted` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/market/briefs/{id}": {
      "get": {
        "operationId": "market.briefs.get",
        "summary": "Get a market brief",
        "tags": [
          "market"
        ],
        "description": "Answers a brief job your partner key created: `generating`, then `ready` with the brief, or `failed` with why.",
        "parameters": [
          {
            "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": "path",
            "name": "id",
            "required": true,
            "description": "The brief job's id."
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The brief job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketBriefJob"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInputForRegistration"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The credentials are valid but may not do this.\n\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\n- `market_briefs_disabled` — market briefs are not turned on for your partner key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.\n\n- `brief_not_found` — no market brief job with this id was created with your partner key",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/market/stories": {
      "get": {
        "operationId": "market.stories.list",
        "summary": "List market stories",
        "tags": [
          "market"
        ],
        "description": "Lists the stories the crypto market is telling now, most recently confirmed first: each a few sentences on what happened, what it is about, how well it is backed and its newest sources. Use it for a news feed or a home page; pass `evidence: reported` to leave out stories only one unreviewed source tells, and `subject` for one coin, stock or market. Open a story with Get a market story for all its sources, its figures and the moves on what it is about. A page can hold fewer stories than `limit` while `nextCursor` is set: keep paging until it is null.",
        "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",
              "minLength": 1,
              "maxLength": 240,
              "pattern": "^(market|[a-z_]+:[^\\s]+)$"
            },
            "in": "query",
            "name": "subject",
            "required": false,
            "description": "Only stories about this subject: `asset:btc`, `stock:NVDA`."
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "measured",
                "corroborated",
                "reported",
                "unconfirmed"
              ]
            },
            "in": "query",
            "name": "evidence",
            "required": false,
            "description": "Only stories backed at least this well: `reported` leaves out `unconfirmed`."
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "A page of stories.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketStories"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenForRegistration"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/market/stories/{storyId}": {
      "get": {
        "operationId": "market.stories.get",
        "summary": "Get a market story",
        "tags": [
          "market"
        ],
        "description": "Returns one story in full: every article it rests on, newest first, the market figures it states as they read now, and the moves Fin spotted on what it is about since the story began. Use it when a reader opens a story from List market stories. A story Fin no longer shows, because its sources were withdrawn or its figures can no longer be read, answers `404 story_not_found`: drop it from what you show.",
        "parameters": [
          {
            "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": "path",
            "name": "storyId",
            "required": true,
            "description": "The story's id."
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The story in full.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketStoryDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInputForRegistration"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenForRegistration"
          },
          "404": {
            "description": "The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.\n\n- `story_not_found` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/market/headlines": {
      "get": {
        "operationId": "market.headlines.list",
        "summary": "List market headlines",
        "tags": [
          "market"
        ],
        "description": "Lists the latest articles from reviewed newsrooms and official sources, newest first, each with where to read it and the coins and stocks its headline names. Use it for a column of the latest news beside the stories; posts, project announcements and unreviewed sites are left out. Pass `subject` for the articles naming one coin or stock: that reads the newest 300 articles only, so it lists recent coverage, not an archive.",
        "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",
              "minLength": 1,
              "maxLength": 240,
              "pattern": "^(market|[a-z_]+:[^\\s]+)$"
            },
            "in": "query",
            "name": "subject",
            "required": false,
            "description": "Only articles naming this coin or stock, of the newest 300: `asset:btc`, `stock:NVDA`."
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "A page of articles.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketHeadlines"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenForRegistration"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/market/moves": {
      "get": {
        "operationId": "market.moves.list",
        "summary": "List market moves",
        "tags": [
          "market"
        ],
        "description": "Lists the moves Fin spotted in the market, newest first, each as one plain sentence with its size and window: a coin's price, the whole market, a prediction market's odds or its resolution, a venue's volume, a launchpad's share, a new leader or a newcomer to a top list. Use it for a live ticker of what is moving; narrow it with `kind` or `subject`. Each market has one line per kind and each leaderboard one line of lead changes, a newer move replacing the older one on its line, so poll the first page rather than keeping every move; a page can hold fewer moves than `limit` while `nextCursor` is set.",
        "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",
              "minLength": 1,
              "maxLength": 240,
              "pattern": "^(market|[a-z_]+:[^\\s]+)$"
            },
            "in": "query",
            "name": "subject",
            "required": false,
            "description": "Only moves on this subject."
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "price",
                "market",
                "odds",
                "resolved",
                "volume",
                "share",
                "leader",
                "entrant"
              ]
            },
            "in": "query",
            "name": "kind",
            "required": false,
            "description": "Only moves of this kind."
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "A page of moves.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketMoves"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenForRegistration"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/market/flows": {
      "get": {
        "operationId": "market.flows.get",
        "summary": "Get market flows",
        "tags": [
          "market"
        ],
        "description": "Returns where money is in the crypto market: total market cap, alt trading volume, perps open interest, stablecoin supply, DEX volume and launchpad volume, each with its change over a day, a week and a month. Use it as the backdrop beside the stories. A figure Fin does not have right now is left out, so show the rows you get.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The market's money flows.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketFlows"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInputForRegistration"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenForRegistration"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/budget": {
      "get": {
        "operationId": "budgets.get",
        "summary": "Get AI usage budget",
        "tags": [
          "budgets"
        ],
        "description": "Returns the user's AI usage budget for today and this month: the limit, what is spent, what running work has reserved, and what is left. When nothing is left, new runs are refused with `budget_exhausted` until the next day or month. This is the cost of running the agent, not the money in the user's wallet.",
        "parameters": [
          {
            "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": "The user's AI usage budget.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Budget"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet": {
      "get": {
        "operationId": "wallets.get",
        "summary": "Get the agent wallet",
        "tags": [
          "wallets"
        ],
        "description": "Returns the user's agent wallet: the wallet the agent deposits to, trades from and withdraws from. Until the user creates it, `wallet` is `null` and `creation` carries the message they sign to create it. If an existing wallet needs its owner's confirmation, `confirmation` carries the exact message to sign for Confirm wallet ownership; it grants no spending permission.",
        "parameters": [
          {
            "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": "The agent wallet, or the message that creates it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "wallet": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Wallet"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The user's agent wallet, or `null` until the user creates it."
                    },
                    "creation": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/MessageToSign"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "While `wallet` is `null`: the message the user signs to create the wallet (Create the agent wallet). `null` once the wallet exists."
                    },
                    "confirmation": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/MessageToSign"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "For an existing wallet whose ownership has not been confirmed: the exact message its owner signs for Confirm wallet ownership. It names the existing wallet and account and grants no spending permission. Otherwise null."
                    }
                  },
                  "required": [
                    "wallet",
                    "creation",
                    "confirmation"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `wallet_account_unsupported` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "wallets.create",
        "summary": "Create the agent wallet",
        "tags": [
          "wallets"
        ],
        "description": "Creates the user's agent wallet. The user signs `creation.message` from Get the agent wallet with their registered wallet; send the signature in `authorization`. If the user signed in with an account-opening message (Start wallet sign-in with `createWallet`, answered `createsWallet: true`), send that sign-in's `challengeId` and `signature` in `signIn` instead, within its five minutes, and the user signs nothing more. If your app's own login opened the session for a passkey the user just created (Create a session with `createWallet`, answered `createsWallet: true`), send an empty body from that session within 270 seconds of opening it. Safe to repeat: an existing wallet is returned as it is. Needed before any deposit; chat works without it.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWalletInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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": "The agent wallet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Wallet"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `signature_required` — creating the agent wallet needs the user's signature: send the user's signature of `creation.message` from Get the agent wallet as `authorization`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `wallet_account_unsupported` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/confirm": {
      "post": {
        "operationId": "wallets.confirm",
        "summary": "Confirm wallet ownership",
        "tags": [
          "wallets"
        ],
        "description": "Confirms the user's ownership of their existing agent wallet. Use it when Get the agent wallet returns a confirmation message: show the existing account, have the user sign that exact message, and send the signature here. Returns the same wallet with its signed ownership receipt. Safe to repeat; this creates no wallet, moves no funds and grants no spending permission.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmWalletInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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": "The same wallet with its ownership receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Wallet"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `wallet_account_unsupported` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/account": {
      "get": {
        "operationId": "wallets.getAccount",
        "summary": "Get wallet account",
        "tags": [
          "wallets"
        ],
        "description": "Returns the user's agent wallet, whatever its kind, named by `intentsAccount`: its NEAR Intents account and whether that is the wallet's own NEAR account (`near`) or an Agent API wallet's EVM account (`evm`). Use it instead of Get the agent wallet once your partner is enabled for Agent API wallets, or to read `intentsAccount` the same way for every wallet; Get the agent wallet refuses an Agent API wallet with `wallet_account_unsupported`. Until the user has a wallet, `creation` carries the message they sign for Start wallet setup; for an Agent API wallet, `renewal` carries the message they sign for Renew wallet access.",
        "parameters": [
          {
            "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": "The agent wallet, or the message that creates it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "wallet": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/AccountWallet"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The user's agent wallet, or `null` until the user creates it."
                    },
                    "creation": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/MessageToSign"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "While `wallet` is `null`: the message the user signs to create the wallet (Start wallet setup, or Create the agent wallet). `null` once the wallet exists."
                    },
                    "confirmation": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/MessageToSign"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "For an existing wallet whose ownership has not been confirmed: the exact message its owner signs for Confirm wallet ownership. It names the existing wallet and account and grants no spending permission. Otherwise null."
                    },
                    "renewal": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/MessageToSign"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "For an active Agent API wallet (`intentsAccount.kind` is `evm`): the message its owner signs for Renew wallet access, when the agent's access is about to run out or was lost. Otherwise null."
                    }
                  },
                  "required": [
                    "wallet",
                    "creation",
                    "confirmation",
                    "renewal"
                  ]
                }
              }
            }
          },
          "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": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/account/balances": {
      "get": {
        "operationId": "wallets.getAccountBalances",
        "summary": "Get wallet account balances",
        "tags": [
          "wallets"
        ],
        "description": "Returns what the agent wallet holds, exactly as Get balances does, with the wallet named by `intentsAccount` whatever its kind. Use it instead of Get balances once your partner is enabled for Agent API wallets, which Get balances refuses with `wallet_account_unsupported`.",
        "parameters": [
          {
            "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": "The agent wallet and what it holds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountWalletBalances"
                }
              }
            }
          },
          "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": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/account/sessions": {
      "post": {
        "operationId": "wallets.openAccountSession",
        "summary": "Open a wallet account session",
        "tags": [
          "wallets"
        ],
        "description": "Creates a 1Click session for the agent wallet, exactly as Get a 1Click session does, naming the account it signs in as by `intentsAccount` whatever the wallet's kind. Use it instead of Get a 1Click session once your partner is enabled for Agent API wallets, which that route refuses with `wallet_account_unsupported`. Keep both tokens on your server, refresh the access token with 1Click, and call this again after `refreshTokenExpiresAt`. Every call is a separate session that cannot be revoked.",
        "parameters": [
          {
            "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 new 1Click session for the agent wallet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountWalletSession"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/setup": {
      "post": {
        "operationId": "wallets.startSetup",
        "summary": "Start wallet setup",
        "tags": [
          "wallets"
        ],
        "description": "Sets up the user's agent wallet with the same consent Create the agent wallet takes (`authorization` over `creation.message`, `signIn`, or an empty body from the session that opened the account with a new passkey). Use it instead of Create the agent wallet when your app can show the user a wallet setup step: where your partner is enabled for Agent API wallets, the wallet is an agent the user owns in the NEAR Intents Agent API, and the answer is `signature_required` with the first `step` to sign; send the signature to Continue wallet setup. Otherwise it creates the wallet exactly as Create the agent wallet does and answers `completed`. For an existing Agent API wallet, send an empty body: if its policy needs limit orders enabled, the answer is a `policy_update` step for the user to sign; all other policy settings stay unchanged. The wallet it answers is named by `intentsAccount`: read it afterwards with Get wallet account. Safe to repeat: a setup under way answers its current step, and an up-to-date wallet answers `completed`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWalletInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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": "The next step the user signs, or the wallet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletSetup"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `signature_required` — creating the agent wallet needs the user's signature: send the user's signature of `creation.message` from Get the agent wallet as `authorization`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "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\n- `policy_change_throttled` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/setup/continue": {
      "post": {
        "operationId": "wallets.continueSetup",
        "summary": "Continue wallet setup",
        "tags": [
          "wallets"
        ],
        "description": "Sends the user's signature of a wallet setup step from Start wallet setup, Renew wallet access or a previous call: have their wallet or passkey sign `step.intent.payload` unchanged as `step.intent.standard` says, then send `step.setupId` and the intent with their wallet's output added. Answers the next step to sign, or `completed` with the wallet. A step past its `expiresAt` answers a fresh step to sign instead. If the call times out, send it again unchanged; `provider_unavailable` means the step is still landing, so try again in a few seconds.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContinueWalletSetupInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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": "The next step the user signs, or the wallet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletSetup"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/access/renew": {
      "post": {
        "operationId": "wallets.renewAccess",
        "summary": "Renew wallet access",
        "tags": [
          "wallets"
        ],
        "description": "Renews the agent's access to the user's Agent API wallet, which lasts a year from setup. Use it when Get wallet account answers a `renewal` message and the access is close to running out, or the agent can no longer act: the user signs `renewal.message`, send it here, then have them sign the answered step and send it to Continue wallet setup. The wallet and its funds stay as they are; nothing moves.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenewWalletAccessInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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": "The step the user signs to renew the access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletSetup"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/destinations": {
      "post": {
        "operationId": "wallets.addDestination",
        "summary": "Add a withdrawal destination",
        "tags": [
          "wallets"
        ],
        "description": "Lets the user's Agent API wallet pay one more address, which only the user's own signature can allow: a withdrawal, a send or a venue account's funding to it. Name the address by `network` and `address`, or name a `venue` (`perps`, `prediction`, `solana`) to allow the agent's own account there that funding the venue pays: Fin names its exact address and chain, opening the account first when it is new. The answer is `signature_required` with the step they sign (`step.intent`, shown with `step.summary`); send their signature to Continue wallet setup, which answers `completed` once the address is allowed. An address already allowed answers `completed` at once. Use it when a transfer from an Agent API wallet is refused with `destination_not_allowed` (a venue funding's refusal names its venue), or before the user's first funding of a venue; from setup the wallet may pay only the user's own sign-in wallet and their own NEAR Intents account. A venue the user cannot trade is refused with its own reason (`perps_disabled`, `prediction_disabled`, `solana_disabled`), and a Polymarket account still opening with `no_account`: ask again within a minute. A wallet can change what it allows once every few minutes: sooner, this refuses with `policy_change_throttled` and `Retry-After`, and nothing is asked or signed.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddWalletDestinationInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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": "The step the user signs, or the wallet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletSetup"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `perps_disabled` — perps is not enabled for this user\n- `prediction_disabled` — prediction-market trading is not enabled for this user\n- `solana_disabled` — Solana trading is not enabled for this user",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.\n\n- `no_account` — the user has not opened the account this call reads; open it first",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "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\n- `policy_change_throttled` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/sessions": {
      "post": {
        "operationId": "wallets.createSession",
        "summary": "Get a 1Click session",
        "tags": [
          "wallets"
        ],
        "description": "Creates a 1Click session for the agent wallet, so your backend can read its balances, history and orders from 1Click with the code you already use for your own users. Call it when you hold no usable refresh token for the agent: after the user signs in, or once 1Click refuses the refresh token. Keep both tokens the way you keep your own 1Click tokens, on your server or in HttpOnly cookies, refresh the access token with 1Click, and call this again after `refreshTokenExpiresAt`. Every call is a separate session that cannot be revoked, so delete yours when the user signs out.",
        "parameters": [
          {
            "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 new 1Click session for the agent wallet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletSession"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `wallet_account_unsupported` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/balances": {
      "get": {
        "operationId": "wallets.balances",
        "summary": "Get balances",
        "tags": [
          "wallets"
        ],
        "description": "Returns what the agent wallet holds: each asset with its amount, price and USD value, and the available-wallet total, read from the provider on every call. Use `portfolio` for separately qualified wallet and order figures: its combined total is null when allocation or settlement evidence cannot prevent counting funds twice. Show the available balance while that total is unknown. When a deposit limit applies, `depositLimit` says how much more the user can deposit right now.",
        "parameters": [
          {
            "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": "The agent wallet and what it holds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletBalances"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `wallet_account_unsupported` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/withdrawals/quote": {
      "post": {
        "operationId": "wallets.quoteWithdrawal",
        "summary": "Get a withdrawal quote",
        "tags": [
          "wallets"
        ],
        "description": "Step 1 of a withdrawal. Prices a withdrawal from the agent wallet and returns the exact `terms` (amount, fees and the minimum the recipient will receive), `authorization.message` for the user to sign, and the `requestKey` to send as the `Idempotency-Key`. Nothing is reserved or sent. Call Withdraw funds before `authorization.expiresAt`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WithdrawalQuoteRequestInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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": "The quoted terms, the message to sign and the request key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WithdrawalQuote"
                }
              }
            }
          },
          "400": {
            "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\n- `quote_refused` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `asset_not_withdrawable` — tokenized stocks cannot be withdrawn; sell them first\n- `agent_slippage_exceeded` — 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- `destination_not_allowed` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `withdrawal_changed` — the request key already binds different withdrawal terms, or the current balance cannot cover the requested amount",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/withdrawals": {
      "post": {
        "operationId": "wallets.withdraw",
        "summary": "Withdraw funds",
        "tags": [
          "wallets"
        ],
        "description": "Step 2 of a withdrawal. Sends funds from the agent wallet to an external address or a NEAR Intents account. Send the quote's `terms`, the user's signature of its `authorization.message`, and its `requestKey` as the `Idempotency-Key` header. Returns the withdrawal; poll Get a withdrawal until its `status` is final. If this call times out, send it again unchanged: you get the same withdrawal back, never a second payout.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WithdrawInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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."
          },
          {
            "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)$"
            },
            "example": "d5565100-9342-4bc6-a803-b387a20cb536",
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "description": "The quote's `requestKey`, which the user's signature names. Send the same key and body again to retry safely: you get the same withdrawal back, never a second payout. A different body under the same key is refused with `request_key_conflict`."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The withdrawal and its current status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Withdrawal"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `asset_not_withdrawable` — tokenized stocks cannot be withdrawn; sell them first\n- `agent_slippage_exceeded` — 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- `destination_not_allowed` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `withdrawal_changed` — the request key already binds different withdrawal terms, or the current balance cannot cover the requested amount\n- `request_key_conflict` — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "wallets.listWithdrawals",
        "summary": "List withdrawals",
        "tags": [
          "wallets"
        ],
        "description": "Lists the user's withdrawals, newest first, with their status. After a timed-out request, find its withdrawal by filtering on `requestKey`.",
        "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": "requestKey",
            "required": false,
            "description": "Only the withdrawal sent with this `Idempotency-Key`: how to find it after a request timed out."
          },
          {
            "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 withdrawals.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Withdrawal"
                      },
                      "description": "This page's rows."
                    },
                    "nextCursor": {
                      "description": "The cursor for the next page; null once there are no more rows.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "description": "How many rows the list holds in all, when it is known.",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/withdrawals/{withdrawalId}": {
      "get": {
        "operationId": "wallets.getWithdrawal",
        "summary": "Get a withdrawal",
        "tags": [
          "wallets"
        ],
        "description": "Returns a withdrawal and its `status`: `pending` until it starts, `processing` while it is sent, then `completed`, `refunded` (the funds came back to the agent wallet) or `failed` (nothing left the wallet; `failureReason` says why). `denied` and `expired` mean the request was refused or its signature ran out before it started. `uncertain` means the result could not be confirmed yet: never send a replacement, keep checking.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "withdrawalId",
            "required": true,
            "description": "The withdrawal's id, as Withdraw funds returned it."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The withdrawal and its status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Withdrawal"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/supported-assets": {
      "get": {
        "operationId": "wallets.supportedAssets",
        "summary": "List supported assets",
        "tags": [
          "wallets"
        ],
        "description": "Lists the assets and networks the agent wallet can deposit and withdraw, with the ids to use in deposit and withdrawal requests. A listed asset can still be unavailable for a particular amount; the quote tells you.",
        "parameters": [
          {
            "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": "The supported assets and networks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportedAssets"
                }
              }
            }
          },
          "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": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/deposits/quote": {
      "post": {
        "operationId": "wallets.quoteDeposit",
        "summary": "Get a deposit quote",
        "tags": [
          "wallets"
        ],
        "description": "Prices a deposit of an exact amount before it is created: what the agent wallet would be credited now, and the least it will be credited within the loss limit. Use it while the user chooses an amount. Nothing is reserved and no address is issued. Then call Create a deposit with the same amount and `terms.minimumCreditRaw` set to `minimumCreditRaw`; it prices the deposit again when it issues the address. `provider_unavailable` also means 1Click cannot price it within the loss limit right now.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DepositQuoteRequestInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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": "What the deposit would credit now, and the least it will.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositQuote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/deposits": {
      "post": {
        "operationId": "wallets.createDeposit",
        "summary": "Create a deposit",
        "tags": [
          "wallets"
        ],
        "description": "Creates a deposit of an exact amount into the agent wallet and returns where to send it. The user sends that amount from their own wallet before `sendBefore`. Each address belongs to this deposit only; never reuse it. Poll Get a deposit to see it credited. When the amount isn't known yet, such as a withdrawal from an exchange, use Create a deposit address instead. When a deposit limit applies, a deposit that would take the agent wallet past it is refused with `deposit_limit_exceeded` and nothing is recorded: Get balances says how much fits in `depositLimit.availableCents`. Requires an `Idempotency-Key` header: the same key returns the same deposit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDepositInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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."
          },
          {
            "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)$"
            },
            "example": "d5565100-9342-4bc6-a803-b387a20cb536",
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "description": "A UUID you generate for this request. Send the same key and the same body to retry it safely: you get the original result back, never a second one. A different body under the same key is refused with `request_key_conflict`."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The deposit and where to send the funds.",
            "content": {
              "application/json": {
                "schema": {
                  "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 deposit's id."
                    },
                    "requestKey": {
                      "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 `Idempotency-Key` the deposit was created with; filter List deposits on it."
                    },
                    "terms": {
                      "$ref": "#/components/schemas/DepositTerms"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "preparing",
                        "awaiting_deposit",
                        "processing",
                        "credited",
                        "refunded",
                        "unknown",
                        "expired",
                        "failed"
                      ],
                      "description": "Where the deposit is: `preparing` (getting the address), `awaiting_deposit` (waiting for the user's transfer), `processing`, then `credited` or `refunded`. `failed` means no address was issued. `expired` means the deadline passed with no transfer seen; a late transfer still moves it on. `unknown` means Fin saw something it could not confirm; it never proves that no money moved, so keep checking."
                    },
                    "instruction": {
                      "anyOf": [
                        {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "rail": {
                                  "type": "string",
                                  "description": "Payment originates on the specified native blockchain.",
                                  "enum": [
                                    "chain"
                                  ]
                                },
                                "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."
                                },
                                "asset": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "pattern": "^asset_[a-f0-9]{64}$",
                                      "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
                                    },
                                    "network": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                      "description": "The asset's native blockchain network."
                                    },
                                    "kind": {
                                      "type": "string",
                                      "enum": [
                                        "native",
                                        "token"
                                      ],
                                      "description": "Native currency or a token contract according to the provider catalog."
                                    },
                                    "contractAddress": {
                                      "anyOf": [
                                        {
                                          "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."
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ],
                                      "description": "Native-chain token identifier; null for native currency."
                                    },
                                    "decimals": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 38,
                                      "description": "Atomic-unit precision."
                                    },
                                    "symbol": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 64,
                                      "description": "Display label; the asset id determines identity."
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "network",
                                    "kind",
                                    "contractAddress",
                                    "decimals",
                                    "symbol"
                                  ],
                                  "description": "Exact asset and atomic-unit precision to transfer."
                                },
                                "address": {
                                  "type": "string",
                                  "pattern": "^[\\x21-\\x7e]{1,256}$",
                                  "description": "Verified destination for this deposit request only."
                                },
                                "memo": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256,
                                      "pattern": "^[\\x20-\\x7e]+$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "Required deposit memo or tag, exactly as returned; null means absent."
                                },
                                "amountRaw": {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$",
                                  "description": "Exact funding amount in asset atomic units."
                                },
                                "minimumCreditRaw": {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$",
                                  "description": "Minimum authorized wallet credit."
                                },
                                "expectedCreditRaw": {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$",
                                  "description": "Quoted credit; the receipt records actual credit separately."
                                },
                                "sendBefore": {
                                  "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": "Do not initiate another transfer after this deadline."
                                },
                                "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": "Provider deposit deadline. Late payment remains observable; expiry never proves a refund."
                                },
                                "refundAddress": {
                                  "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."
                                },
                                "reusable": {
                                  "type": "boolean",
                                  "description": "Bound to one funding request; never reuse for a later transfer.",
                                  "enum": [
                                    false
                                  ]
                                },
                                "kind": {
                                  "type": "string",
                                  "description": "The external wallet broadcasts a native-chain transfer using these instructions.",
                                  "enum": [
                                    "chain_transfer"
                                  ]
                                }
                              },
                              "required": [
                                "rail",
                                "network",
                                "asset",
                                "address",
                                "memo",
                                "amountRaw",
                                "minimumCreditRaw",
                                "expectedCreditRaw",
                                "sendBefore",
                                "expiresAt",
                                "refundAddress",
                                "reusable",
                                "kind"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "rail": {
                                  "type": "string",
                                  "description": "Payment originates on the specified public or confidential Intents ledger.",
                                  "enum": [
                                    "intents"
                                  ]
                                },
                                "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."
                                },
                                "asset": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "pattern": "^asset_[a-f0-9]{64}$",
                                      "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
                                    },
                                    "network": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                      "description": "The asset's native blockchain network."
                                    },
                                    "kind": {
                                      "type": "string",
                                      "enum": [
                                        "native",
                                        "token"
                                      ],
                                      "description": "Native currency or a token contract according to the provider catalog."
                                    },
                                    "contractAddress": {
                                      "anyOf": [
                                        {
                                          "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."
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ],
                                      "description": "Native-chain token identifier; null for native currency."
                                    },
                                    "decimals": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 38,
                                      "description": "Atomic-unit precision."
                                    },
                                    "symbol": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 64,
                                      "description": "Display label; the asset id determines identity."
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "network",
                                    "kind",
                                    "contractAddress",
                                    "decimals",
                                    "symbol"
                                  ],
                                  "description": "Exact asset and atomic-unit precision to transfer."
                                },
                                "address": {
                                  "type": "string",
                                  "pattern": "^[\\x21-\\x7e]{1,256}$",
                                  "description": "Verified destination for this deposit request only."
                                },
                                "memo": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256,
                                      "pattern": "^[\\x20-\\x7e]+$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "Required deposit memo or tag, exactly as returned; null means absent."
                                },
                                "amountRaw": {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$",
                                  "description": "Exact funding amount in asset atomic units."
                                },
                                "minimumCreditRaw": {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$",
                                  "description": "Minimum authorized wallet credit."
                                },
                                "expectedCreditRaw": {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$",
                                  "description": "Quoted credit; the receipt records actual credit separately."
                                },
                                "sendBefore": {
                                  "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": "Do not initiate another transfer after this deadline."
                                },
                                "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": "Provider deposit deadline. Late payment remains observable; expiry never proves a refund."
                                },
                                "refundAddress": {
                                  "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."
                                },
                                "reusable": {
                                  "type": "boolean",
                                  "description": "Bound to one funding request; never reuse for a later transfer.",
                                  "enum": [
                                    false
                                  ]
                                },
                                "kind": {
                                  "type": "string",
                                  "description": "The external wallet signs and submits a transfer intent on the specified ledger.",
                                  "enum": [
                                    "intents_transfer"
                                  ]
                                },
                                "protocol": {
                                  "type": "object",
                                  "properties": {
                                    "verifier": {
                                      "type": "string",
                                      "enum": [
                                        "intents.near",
                                        "intents.far"
                                      ],
                                      "description": "Ledger verifier for the external wallet's signed transfer intent."
                                    },
                                    "assetId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256,
                                      "description": "Ledger protocol asset identifier, exposed only for explicit advanced Intents funding."
                                    },
                                    "depositAddress": {
                                      "type": "string",
                                      "pattern": "^[\\x21-\\x7e]{1,256}$",
                                      "description": "Quote deposit account, used by the external wallet to generate the exact signed transfer intent; identical to the instruction address."
                                    },
                                    "amountRaw": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,38})$",
                                      "description": "Exact signed transfer amount."
                                    }
                                  },
                                  "required": [
                                    "verifier",
                                    "assetId",
                                    "depositAddress",
                                    "amountRaw"
                                  ],
                                  "description": "The external wallet constructs and signs a transfer intent with its own authority. Fin does not sign for or hold credentials to that source wallet."
                                }
                              },
                              "required": [
                                "rail",
                                "network",
                                "asset",
                                "address",
                                "memo",
                                "amountRaw",
                                "minimumCreditRaw",
                                "expectedCreditRaw",
                                "sendBefore",
                                "expiresAt",
                                "refundAddress",
                                "reusable",
                                "kind",
                                "protocol"
                              ]
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Where and what to send; `null` until the address is issued."
                    },
                    "receipt": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "observedAt": {
                              "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 trusted provider evidence was observed."
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "credited",
                                "refunded"
                              ],
                              "description": "Provider-established terminal financial outcome."
                            },
                            "depositedRaw": {
                              "type": "string",
                              "pattern": "^(0|[1-9]\\d{0,38})$",
                              "description": "Observed source amount."
                            },
                            "creditedRaw": {
                              "type": "string",
                              "pattern": "^(0|[1-9]\\d{0,38})$",
                              "description": "Actual wallet credit; zero on full refund."
                            },
                            "refundedRaw": {
                              "type": "string",
                              "pattern": "^(0|[1-9]\\d{0,38})$",
                              "description": "Amount refunded to the approved source destination."
                            },
                            "sourceTransactionHashes": {
                              "minItems": 1,
                              "maxItems": 32,
                              "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": "Observed source transactions or ledger intent identifiers bound to the instruction."
                            },
                            "refundTransactionHashes": {
                              "maxItems": 32,
                              "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": "Observed refund transactions or ledger intent identifiers."
                            }
                          },
                          "required": [
                            "observedAt",
                            "state",
                            "depositedRaw",
                            "creditedRaw",
                            "refundedRaw",
                            "sourceTransactionHashes",
                            "refundTransactionHashes"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "What was credited or refunded; `null` until that is observed."
                    },
                    "seenAt": {
                      "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 Fin first saw the user's transfer: the first check that found it on its way, or already credited or refunded. `null` until then, and for a transfer Fin saw before it kept this."
                    },
                    "arrivedRaw": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^(0|[1-9]\\d{0,38})$"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "What 1Click reported arriving while it confirmed the transfer, in the asset's smallest unit; `null` until it reports a figure. For display while it confirms: `receipt` records what was finally credited."
                    },
                    "value": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ValueAtTime"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "What was credited (`receipt.creditedRaw`) was worth when it was credited, at the price Fin recorded with the credit. `null` until it is credited, and when no fresh price was known then."
                    },
                    "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 deposit was created."
                    },
                    "updatedAt": {
                      "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 deposit last changed."
                    }
                  },
                  "required": [
                    "id",
                    "requestKey",
                    "terms",
                    "state",
                    "instruction",
                    "receipt",
                    "seenAt",
                    "arrivedRaw",
                    "value",
                    "createdAt",
                    "updatedAt"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `request_key_conflict` — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "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\n- `deposit_limit_exceeded` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "wallets.listDeposits",
        "summary": "List deposits",
        "tags": [
          "wallets"
        ],
        "description": "Lists the user's deposits, newest first. After a timed-out request, find its deposit by filtering on `requestKey` (the `Idempotency-Key` you sent).",
        "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": "requestKey",
            "required": false,
            "description": "Only the deposit created with this `Idempotency-Key`: how to find it after a request timed out."
          },
          {
            "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 deposits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "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 deposit's id."
                          },
                          "requestKey": {
                            "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 `Idempotency-Key` the deposit was created with; filter List deposits on it."
                          },
                          "terms": {
                            "$ref": "#/components/schemas/DepositTerms"
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "preparing",
                              "awaiting_deposit",
                              "processing",
                              "credited",
                              "refunded",
                              "unknown",
                              "expired",
                              "failed"
                            ],
                            "description": "Where the deposit is: `preparing` (getting the address), `awaiting_deposit` (waiting for the user's transfer), `processing`, then `credited` or `refunded`. `failed` means no address was issued. `expired` means the deadline passed with no transfer seen; a late transfer still moves it on. `unknown` means Fin saw something it could not confirm; it never proves that no money moved, so keep checking."
                          },
                          "instruction": {
                            "anyOf": [
                              {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "rail": {
                                        "type": "string",
                                        "description": "Payment originates on the specified native blockchain.",
                                        "enum": [
                                          "chain"
                                        ]
                                      },
                                      "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."
                                      },
                                      "asset": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^asset_[a-f0-9]{64}$",
                                            "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
                                          },
                                          "network": {
                                            "type": "string",
                                            "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                            "description": "The asset's native blockchain network."
                                          },
                                          "kind": {
                                            "type": "string",
                                            "enum": [
                                              "native",
                                              "token"
                                            ],
                                            "description": "Native currency or a token contract according to the provider catalog."
                                          },
                                          "contractAddress": {
                                            "anyOf": [
                                              {
                                                "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."
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ],
                                            "description": "Native-chain token identifier; null for native currency."
                                          },
                                          "decimals": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 38,
                                            "description": "Atomic-unit precision."
                                          },
                                          "symbol": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 64,
                                            "description": "Display label; the asset id determines identity."
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "network",
                                          "kind",
                                          "contractAddress",
                                          "decimals",
                                          "symbol"
                                        ],
                                        "description": "Exact asset and atomic-unit precision to transfer."
                                      },
                                      "address": {
                                        "type": "string",
                                        "pattern": "^[\\x21-\\x7e]{1,256}$",
                                        "description": "Verified destination for this deposit request only."
                                      },
                                      "memo": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 256,
                                            "pattern": "^[\\x20-\\x7e]+$"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ],
                                        "description": "Required deposit memo or tag, exactly as returned; null means absent."
                                      },
                                      "amountRaw": {
                                        "type": "string",
                                        "pattern": "^(0|[1-9]\\d{0,38})$",
                                        "description": "Exact funding amount in asset atomic units."
                                      },
                                      "minimumCreditRaw": {
                                        "type": "string",
                                        "pattern": "^(0|[1-9]\\d{0,38})$",
                                        "description": "Minimum authorized wallet credit."
                                      },
                                      "expectedCreditRaw": {
                                        "type": "string",
                                        "pattern": "^(0|[1-9]\\d{0,38})$",
                                        "description": "Quoted credit; the receipt records actual credit separately."
                                      },
                                      "sendBefore": {
                                        "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": "Do not initiate another transfer after this deadline."
                                      },
                                      "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": "Provider deposit deadline. Late payment remains observable; expiry never proves a refund."
                                      },
                                      "refundAddress": {
                                        "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."
                                      },
                                      "reusable": {
                                        "type": "boolean",
                                        "description": "Bound to one funding request; never reuse for a later transfer.",
                                        "enum": [
                                          false
                                        ]
                                      },
                                      "kind": {
                                        "type": "string",
                                        "description": "The external wallet broadcasts a native-chain transfer using these instructions.",
                                        "enum": [
                                          "chain_transfer"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "rail",
                                      "network",
                                      "asset",
                                      "address",
                                      "memo",
                                      "amountRaw",
                                      "minimumCreditRaw",
                                      "expectedCreditRaw",
                                      "sendBefore",
                                      "expiresAt",
                                      "refundAddress",
                                      "reusable",
                                      "kind"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "rail": {
                                        "type": "string",
                                        "description": "Payment originates on the specified public or confidential Intents ledger.",
                                        "enum": [
                                          "intents"
                                        ]
                                      },
                                      "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."
                                      },
                                      "asset": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^asset_[a-f0-9]{64}$",
                                            "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
                                          },
                                          "network": {
                                            "type": "string",
                                            "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                            "description": "The asset's native blockchain network."
                                          },
                                          "kind": {
                                            "type": "string",
                                            "enum": [
                                              "native",
                                              "token"
                                            ],
                                            "description": "Native currency or a token contract according to the provider catalog."
                                          },
                                          "contractAddress": {
                                            "anyOf": [
                                              {
                                                "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."
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ],
                                            "description": "Native-chain token identifier; null for native currency."
                                          },
                                          "decimals": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 38,
                                            "description": "Atomic-unit precision."
                                          },
                                          "symbol": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 64,
                                            "description": "Display label; the asset id determines identity."
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "network",
                                          "kind",
                                          "contractAddress",
                                          "decimals",
                                          "symbol"
                                        ],
                                        "description": "Exact asset and atomic-unit precision to transfer."
                                      },
                                      "address": {
                                        "type": "string",
                                        "pattern": "^[\\x21-\\x7e]{1,256}$",
                                        "description": "Verified destination for this deposit request only."
                                      },
                                      "memo": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 256,
                                            "pattern": "^[\\x20-\\x7e]+$"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ],
                                        "description": "Required deposit memo or tag, exactly as returned; null means absent."
                                      },
                                      "amountRaw": {
                                        "type": "string",
                                        "pattern": "^(0|[1-9]\\d{0,38})$",
                                        "description": "Exact funding amount in asset atomic units."
                                      },
                                      "minimumCreditRaw": {
                                        "type": "string",
                                        "pattern": "^(0|[1-9]\\d{0,38})$",
                                        "description": "Minimum authorized wallet credit."
                                      },
                                      "expectedCreditRaw": {
                                        "type": "string",
                                        "pattern": "^(0|[1-9]\\d{0,38})$",
                                        "description": "Quoted credit; the receipt records actual credit separately."
                                      },
                                      "sendBefore": {
                                        "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": "Do not initiate another transfer after this deadline."
                                      },
                                      "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": "Provider deposit deadline. Late payment remains observable; expiry never proves a refund."
                                      },
                                      "refundAddress": {
                                        "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."
                                      },
                                      "reusable": {
                                        "type": "boolean",
                                        "description": "Bound to one funding request; never reuse for a later transfer.",
                                        "enum": [
                                          false
                                        ]
                                      },
                                      "kind": {
                                        "type": "string",
                                        "description": "The external wallet signs and submits a transfer intent on the specified ledger.",
                                        "enum": [
                                          "intents_transfer"
                                        ]
                                      },
                                      "protocol": {
                                        "type": "object",
                                        "properties": {
                                          "verifier": {
                                            "type": "string",
                                            "enum": [
                                              "intents.near",
                                              "intents.far"
                                            ],
                                            "description": "Ledger verifier for the external wallet's signed transfer intent."
                                          },
                                          "assetId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 256,
                                            "description": "Ledger protocol asset identifier, exposed only for explicit advanced Intents funding."
                                          },
                                          "depositAddress": {
                                            "type": "string",
                                            "pattern": "^[\\x21-\\x7e]{1,256}$",
                                            "description": "Quote deposit account, used by the external wallet to generate the exact signed transfer intent; identical to the instruction address."
                                          },
                                          "amountRaw": {
                                            "type": "string",
                                            "pattern": "^(0|[1-9]\\d{0,38})$",
                                            "description": "Exact signed transfer amount."
                                          }
                                        },
                                        "required": [
                                          "verifier",
                                          "assetId",
                                          "depositAddress",
                                          "amountRaw"
                                        ],
                                        "description": "The external wallet constructs and signs a transfer intent with its own authority. Fin does not sign for or hold credentials to that source wallet."
                                      }
                                    },
                                    "required": [
                                      "rail",
                                      "network",
                                      "asset",
                                      "address",
                                      "memo",
                                      "amountRaw",
                                      "minimumCreditRaw",
                                      "expectedCreditRaw",
                                      "sendBefore",
                                      "expiresAt",
                                      "refundAddress",
                                      "reusable",
                                      "kind",
                                      "protocol"
                                    ]
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Where and what to send; `null` until the address is issued."
                          },
                          "receipt": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "observedAt": {
                                    "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 trusted provider evidence was observed."
                                  },
                                  "state": {
                                    "type": "string",
                                    "enum": [
                                      "credited",
                                      "refunded"
                                    ],
                                    "description": "Provider-established terminal financial outcome."
                                  },
                                  "depositedRaw": {
                                    "type": "string",
                                    "pattern": "^(0|[1-9]\\d{0,38})$",
                                    "description": "Observed source amount."
                                  },
                                  "creditedRaw": {
                                    "type": "string",
                                    "pattern": "^(0|[1-9]\\d{0,38})$",
                                    "description": "Actual wallet credit; zero on full refund."
                                  },
                                  "refundedRaw": {
                                    "type": "string",
                                    "pattern": "^(0|[1-9]\\d{0,38})$",
                                    "description": "Amount refunded to the approved source destination."
                                  },
                                  "sourceTransactionHashes": {
                                    "minItems": 1,
                                    "maxItems": 32,
                                    "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": "Observed source transactions or ledger intent identifiers bound to the instruction."
                                  },
                                  "refundTransactionHashes": {
                                    "maxItems": 32,
                                    "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": "Observed refund transactions or ledger intent identifiers."
                                  }
                                },
                                "required": [
                                  "observedAt",
                                  "state",
                                  "depositedRaw",
                                  "creditedRaw",
                                  "refundedRaw",
                                  "sourceTransactionHashes",
                                  "refundTransactionHashes"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "What was credited or refunded; `null` until that is observed."
                          },
                          "seenAt": {
                            "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 Fin first saw the user's transfer: the first check that found it on its way, or already credited or refunded. `null` until then, and for a transfer Fin saw before it kept this."
                          },
                          "arrivedRaw": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^(0|[1-9]\\d{0,38})$"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "What 1Click reported arriving while it confirmed the transfer, in the asset's smallest unit; `null` until it reports a figure. For display while it confirms: `receipt` records what was finally credited."
                          },
                          "value": {
                            "anyOf": [
                              {
                                "$ref": "#/components/schemas/ValueAtTime"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "What was credited (`receipt.creditedRaw`) was worth when it was credited, at the price Fin recorded with the credit. `null` until it is credited, and when no fresh price was known then."
                          },
                          "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 deposit was created."
                          },
                          "updatedAt": {
                            "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 deposit last changed."
                          }
                        },
                        "required": [
                          "id",
                          "requestKey",
                          "terms",
                          "state",
                          "instruction",
                          "receipt",
                          "seenAt",
                          "arrivedRaw",
                          "value",
                          "createdAt",
                          "updatedAt"
                        ]
                      },
                      "description": "This page's rows."
                    },
                    "nextCursor": {
                      "description": "The cursor for the next page; null once there are no more rows.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "description": "How many rows the list holds in all, when it is known.",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/deposits/{depositId}": {
      "get": {
        "operationId": "wallets.getDeposit",
        "summary": "Get a deposit",
        "tags": [
          "wallets"
        ],
        "description": "Returns a deposit and its status: waiting for funds, credited or refunded. Each read checks the provider for news.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "depositId",
            "required": true,
            "description": "The deposit's id, as Create a deposit returned it."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The deposit and its status.",
            "content": {
              "application/json": {
                "schema": {
                  "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 deposit's id."
                    },
                    "requestKey": {
                      "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 `Idempotency-Key` the deposit was created with; filter List deposits on it."
                    },
                    "terms": {
                      "$ref": "#/components/schemas/DepositTerms"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "preparing",
                        "awaiting_deposit",
                        "processing",
                        "credited",
                        "refunded",
                        "unknown",
                        "expired",
                        "failed"
                      ],
                      "description": "Where the deposit is: `preparing` (getting the address), `awaiting_deposit` (waiting for the user's transfer), `processing`, then `credited` or `refunded`. `failed` means no address was issued. `expired` means the deadline passed with no transfer seen; a late transfer still moves it on. `unknown` means Fin saw something it could not confirm; it never proves that no money moved, so keep checking."
                    },
                    "instruction": {
                      "anyOf": [
                        {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "rail": {
                                  "type": "string",
                                  "description": "Payment originates on the specified native blockchain.",
                                  "enum": [
                                    "chain"
                                  ]
                                },
                                "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."
                                },
                                "asset": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "pattern": "^asset_[a-f0-9]{64}$",
                                      "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
                                    },
                                    "network": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                      "description": "The asset's native blockchain network."
                                    },
                                    "kind": {
                                      "type": "string",
                                      "enum": [
                                        "native",
                                        "token"
                                      ],
                                      "description": "Native currency or a token contract according to the provider catalog."
                                    },
                                    "contractAddress": {
                                      "anyOf": [
                                        {
                                          "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."
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ],
                                      "description": "Native-chain token identifier; null for native currency."
                                    },
                                    "decimals": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 38,
                                      "description": "Atomic-unit precision."
                                    },
                                    "symbol": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 64,
                                      "description": "Display label; the asset id determines identity."
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "network",
                                    "kind",
                                    "contractAddress",
                                    "decimals",
                                    "symbol"
                                  ],
                                  "description": "Exact asset and atomic-unit precision to transfer."
                                },
                                "address": {
                                  "type": "string",
                                  "pattern": "^[\\x21-\\x7e]{1,256}$",
                                  "description": "Verified destination for this deposit request only."
                                },
                                "memo": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256,
                                      "pattern": "^[\\x20-\\x7e]+$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "Required deposit memo or tag, exactly as returned; null means absent."
                                },
                                "amountRaw": {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$",
                                  "description": "Exact funding amount in asset atomic units."
                                },
                                "minimumCreditRaw": {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$",
                                  "description": "Minimum authorized wallet credit."
                                },
                                "expectedCreditRaw": {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$",
                                  "description": "Quoted credit; the receipt records actual credit separately."
                                },
                                "sendBefore": {
                                  "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": "Do not initiate another transfer after this deadline."
                                },
                                "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": "Provider deposit deadline. Late payment remains observable; expiry never proves a refund."
                                },
                                "refundAddress": {
                                  "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."
                                },
                                "reusable": {
                                  "type": "boolean",
                                  "description": "Bound to one funding request; never reuse for a later transfer.",
                                  "enum": [
                                    false
                                  ]
                                },
                                "kind": {
                                  "type": "string",
                                  "description": "The external wallet broadcasts a native-chain transfer using these instructions.",
                                  "enum": [
                                    "chain_transfer"
                                  ]
                                }
                              },
                              "required": [
                                "rail",
                                "network",
                                "asset",
                                "address",
                                "memo",
                                "amountRaw",
                                "minimumCreditRaw",
                                "expectedCreditRaw",
                                "sendBefore",
                                "expiresAt",
                                "refundAddress",
                                "reusable",
                                "kind"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "rail": {
                                  "type": "string",
                                  "description": "Payment originates on the specified public or confidential Intents ledger.",
                                  "enum": [
                                    "intents"
                                  ]
                                },
                                "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."
                                },
                                "asset": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "pattern": "^asset_[a-f0-9]{64}$",
                                      "description": "Opaque stable Fin asset identity returned by balances and the transfer catalog."
                                    },
                                    "network": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                      "description": "The asset's native blockchain network."
                                    },
                                    "kind": {
                                      "type": "string",
                                      "enum": [
                                        "native",
                                        "token"
                                      ],
                                      "description": "Native currency or a token contract according to the provider catalog."
                                    },
                                    "contractAddress": {
                                      "anyOf": [
                                        {
                                          "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."
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ],
                                      "description": "Native-chain token identifier; null for native currency."
                                    },
                                    "decimals": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 38,
                                      "description": "Atomic-unit precision."
                                    },
                                    "symbol": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 64,
                                      "description": "Display label; the asset id determines identity."
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "network",
                                    "kind",
                                    "contractAddress",
                                    "decimals",
                                    "symbol"
                                  ],
                                  "description": "Exact asset and atomic-unit precision to transfer."
                                },
                                "address": {
                                  "type": "string",
                                  "pattern": "^[\\x21-\\x7e]{1,256}$",
                                  "description": "Verified destination for this deposit request only."
                                },
                                "memo": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256,
                                      "pattern": "^[\\x20-\\x7e]+$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "Required deposit memo or tag, exactly as returned; null means absent."
                                },
                                "amountRaw": {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$",
                                  "description": "Exact funding amount in asset atomic units."
                                },
                                "minimumCreditRaw": {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$",
                                  "description": "Minimum authorized wallet credit."
                                },
                                "expectedCreditRaw": {
                                  "type": "string",
                                  "pattern": "^(0|[1-9]\\d{0,38})$",
                                  "description": "Quoted credit; the receipt records actual credit separately."
                                },
                                "sendBefore": {
                                  "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": "Do not initiate another transfer after this deadline."
                                },
                                "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": "Provider deposit deadline. Late payment remains observable; expiry never proves a refund."
                                },
                                "refundAddress": {
                                  "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."
                                },
                                "reusable": {
                                  "type": "boolean",
                                  "description": "Bound to one funding request; never reuse for a later transfer.",
                                  "enum": [
                                    false
                                  ]
                                },
                                "kind": {
                                  "type": "string",
                                  "description": "The external wallet signs and submits a transfer intent on the specified ledger.",
                                  "enum": [
                                    "intents_transfer"
                                  ]
                                },
                                "protocol": {
                                  "type": "object",
                                  "properties": {
                                    "verifier": {
                                      "type": "string",
                                      "enum": [
                                        "intents.near",
                                        "intents.far"
                                      ],
                                      "description": "Ledger verifier for the external wallet's signed transfer intent."
                                    },
                                    "assetId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256,
                                      "description": "Ledger protocol asset identifier, exposed only for explicit advanced Intents funding."
                                    },
                                    "depositAddress": {
                                      "type": "string",
                                      "pattern": "^[\\x21-\\x7e]{1,256}$",
                                      "description": "Quote deposit account, used by the external wallet to generate the exact signed transfer intent; identical to the instruction address."
                                    },
                                    "amountRaw": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9]\\d{0,38})$",
                                      "description": "Exact signed transfer amount."
                                    }
                                  },
                                  "required": [
                                    "verifier",
                                    "assetId",
                                    "depositAddress",
                                    "amountRaw"
                                  ],
                                  "description": "The external wallet constructs and signs a transfer intent with its own authority. Fin does not sign for or hold credentials to that source wallet."
                                }
                              },
                              "required": [
                                "rail",
                                "network",
                                "asset",
                                "address",
                                "memo",
                                "amountRaw",
                                "minimumCreditRaw",
                                "expectedCreditRaw",
                                "sendBefore",
                                "expiresAt",
                                "refundAddress",
                                "reusable",
                                "kind",
                                "protocol"
                              ]
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Where and what to send; `null` until the address is issued."
                    },
                    "receipt": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "observedAt": {
                              "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 trusted provider evidence was observed."
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "credited",
                                "refunded"
                              ],
                              "description": "Provider-established terminal financial outcome."
                            },
                            "depositedRaw": {
                              "type": "string",
                              "pattern": "^(0|[1-9]\\d{0,38})$",
                              "description": "Observed source amount."
                            },
                            "creditedRaw": {
                              "type": "string",
                              "pattern": "^(0|[1-9]\\d{0,38})$",
                              "description": "Actual wallet credit; zero on full refund."
                            },
                            "refundedRaw": {
                              "type": "string",
                              "pattern": "^(0|[1-9]\\d{0,38})$",
                              "description": "Amount refunded to the approved source destination."
                            },
                            "sourceTransactionHashes": {
                              "minItems": 1,
                              "maxItems": 32,
                              "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": "Observed source transactions or ledger intent identifiers bound to the instruction."
                            },
                            "refundTransactionHashes": {
                              "maxItems": 32,
                              "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": "Observed refund transactions or ledger intent identifiers."
                            }
                          },
                          "required": [
                            "observedAt",
                            "state",
                            "depositedRaw",
                            "creditedRaw",
                            "refundedRaw",
                            "sourceTransactionHashes",
                            "refundTransactionHashes"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "What was credited or refunded; `null` until that is observed."
                    },
                    "seenAt": {
                      "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 Fin first saw the user's transfer: the first check that found it on its way, or already credited or refunded. `null` until then, and for a transfer Fin saw before it kept this."
                    },
                    "arrivedRaw": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^(0|[1-9]\\d{0,38})$"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "What 1Click reported arriving while it confirmed the transfer, in the asset's smallest unit; `null` until it reports a figure. For display while it confirms: `receipt` records what was finally credited."
                    },
                    "value": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ValueAtTime"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "What was credited (`receipt.creditedRaw`) was worth when it was credited, at the price Fin recorded with the credit. `null` until it is credited, and when no fresh price was known then."
                    },
                    "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 deposit was created."
                    },
                    "updatedAt": {
                      "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 deposit last changed."
                    }
                  },
                  "required": [
                    "id",
                    "requestKey",
                    "terms",
                    "state",
                    "instruction",
                    "receipt",
                    "seenAt",
                    "arrivedRaw",
                    "value",
                    "createdAt",
                    "updatedAt"
                  ]
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/deposit-addresses": {
      "post": {
        "operationId": "wallets.createDepositAddress",
        "summary": "Create a deposit address",
        "tags": [
          "wallets"
        ],
        "description": "Creates a one-time address that takes one transfer of any amount into the agent wallet. Use it instead of Create a deposit when the amount isn't known yet, such as a withdrawal from an exchange: name the asset and the network the user sends on, and nothing else, since whatever can't be credited, such as a transfer below `instruction.minimumDepositRaw`, is refunded to the agent wallet itself. Show `instruction.address` (with `memo` when set), then poll Get a deposit address to see the transfer credited; Report a deposit transaction finds it sooner. When a deposit limit applies, the address is refused with `deposit_limit_exceeded` once the wallet has no room left, and nothing is recorded. When 1Click won't make an address for the asset on that network, such as a network it doesn't quote right now, it is refused with `quote_refused` and no address is issued: offer another network. Nothing caps what the user sends to an address, so tell them how much fits from Get balances' `depositLimit.availableCents`. Requires an `Idempotency-Key` header: the same key returns the same address.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDepositAddressInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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."
          },
          {
            "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)$"
            },
            "example": "d5565100-9342-4bc6-a803-b387a20cb536",
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "description": "A UUID you generate for this request. Send the same key and the same body to retry it safely: you get the original result back, never a second one. A different body under the same key is refused with `request_key_conflict`."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The deposit address and what to send to it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositAddress"
                }
              }
            }
          },
          "400": {
            "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\n- `quote_refused` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `request_key_conflict` — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "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\n- `deposit_limit_exceeded` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/deposit-addresses/{depositAddressId}": {
      "get": {
        "operationId": "wallets.getDepositAddress",
        "summary": "Get a deposit address",
        "tags": [
          "wallets"
        ],
        "description": "Returns a deposit address and how its transfer is going: waiting for it, below the minimum, credited or refunded to the agent wallet. Each read checks the provider for news, so poll it while the address is on screen.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "depositAddressId",
            "required": true,
            "description": "The deposit address's id, as Create a deposit address returned it."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The deposit address and its status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositAddress"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/deposit-addresses/{depositAddressId}/transactions": {
      "post": {
        "operationId": "wallets.reportDepositTransaction",
        "summary": "Report a deposit transaction",
        "tags": [
          "wallets"
        ],
        "description": "Tells Fin the transaction that paid a deposit address, as the user's wallet or exchange shows it, so the transfer is found sooner than by watching the address alone. It is optional: the address is watched either way. Returns the deposit address as it stands after the report. A hash that isn't a transfer to this address is refused with `invalid_input`. Safe to repeat.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportDepositTransactionInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "depositAddressId",
            "required": true,
            "description": "The deposit address's id, as Create a deposit address returned it."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The deposit address and its status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositAddress"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/earn-vaults": {
      "get": {
        "operationId": "wallets.listEarnVaults",
        "summary": "List earn vaults",
        "tags": [
          "wallets"
        ],
        "description": "Lists the curated yield vaults (near.com's Earn vaults) the agent wallet can deposit into, each with the yearly rate its provider states now, its total value locked, its payment asset and the user's own position in it. Use it to show a vault's current rate beside a deposit or a scheduled harvest, and what a position has earned; a deposit is a swap from the vault's payment asset into its `assetId`, and a withdrawal the swap back. A rate is the provider's variable figure, read at most every five minutes, never a promise: `rate` is null when the provider could not be read just now, so show no figure rather than an old one. A position states what its trades paid and returned in the payment asset, never a price: work out what it earned as what its shares are worth in that asset now, plus `withdrawnRaw`, less `depositedRaw`, and only while its `costBasisStatus` is `complete`.",
        "parameters": [
          {
            "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": "The curated vaults, the rate each provider states now and the user's position in each.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "assetId": {
                            "type": "string",
                            "minLength": 1,
                            "description": "The vault share token's exact 1Click asset id, as the vault table names it."
                          },
                          "symbol": {
                            "type": "string",
                            "minLength": 1,
                            "description": "The share token's symbol, e.g. `gtUSDCp`."
                          },
                          "name": {
                            "type": "string",
                            "minLength": 1,
                            "description": "The vault's name, e.g. `Gauntlet USDC`."
                          },
                          "provider": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Who manages the vault's strategy."
                          },
                          "rate": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "percent": {
                                    "type": "string",
                                    "pattern": "^(0|[1-9]\\d{0,17})(?:\\.\\d{1,18})?$",
                                    "description": "The yearly rate in percent, as the provider states it: `5.4017` is 5.4017%."
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "APY",
                                      "APR"
                                    ],
                                    "description": "`APY` compounds within the year; `APR` does not. The provider says which."
                                  },
                                  "source": {
                                    "type": "string",
                                    "enum": [
                                      "yield_xyz",
                                      "taler"
                                    ],
                                    "description": "Who states the rate: Yield.xyz, or Taler's own vault API."
                                  },
                                  "observedAt": {
                                    "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 Fin read the rate from that source."
                                  }
                                },
                                "required": [
                                  "percent",
                                  "type",
                                  "source",
                                  "observedAt"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "The provider's current rate, or null when it could not be read now; never a guess."
                          },
                          "tvlUsd": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^(0|[1-9]\\d{0,17})(?:\\.\\d{1,18})?$"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "The vault's total value locked in US dollars, as its provider states it."
                          },
                          "payment": {
                            "type": "object",
                            "properties": {
                              "assetId": {
                                "type": "string",
                                "minLength": 1,
                                "description": "Its exact 1Click asset id."
                              },
                              "symbol": {
                                "type": "string",
                                "minLength": 1,
                                "description": "Its symbol, e.g. `USDC`."
                              },
                              "decimals": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991,
                                "description": "How many decimals its raw amounts carry."
                              }
                            },
                            "required": [
                              "assetId",
                              "symbol",
                              "decimals"
                            ],
                            "description": "The asset a deposit into the vault pays with and a withdrawal returns."
                          },
                          "position": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "sharesRaw": {
                                    "type": "string",
                                    "pattern": "^(0|[1-9]\\d{0,38})$",
                                    "description": "The shares the agent holds now, in the share token's smallest unit, those set aside for a resting order included."
                                  },
                                  "firstDepositAt": {
                                    "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 share balance last rose from zero: when this position began."
                                  },
                                  "depositedRaw": {
                                    "type": "string",
                                    "pattern": "^(0|[1-9]\\d{0,38})$",
                                    "description": "What buying the shares paid, fees included, in the payment asset's smallest unit."
                                  },
                                  "withdrawnRaw": {
                                    "type": "string",
                                    "pattern": "^(0|[1-9]\\d{0,38})$",
                                    "description": "What selling shares returned, in the payment asset's smallest unit."
                                  },
                                  "costBasisStatus": {
                                    "type": "string",
                                    "enum": [
                                      "complete",
                                      "partial"
                                    ],
                                    "description": "`complete` when trades in the payment asset explain every share held; `partial` when shares also moved another way (transferred in or out, or traded for another asset), so the two amounts do not tell what the shares cost and no earned figure can be worked out from them."
                                  }
                                },
                                "required": [
                                  "sharesRaw",
                                  "firstDepositAt",
                                  "depositedRaw",
                                  "withdrawnRaw",
                                  "costBasisStatus"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "The user's own position in the vault; null when the agent's records show no shares of it."
                          }
                        },
                        "required": [
                          "assetId",
                          "symbol",
                          "name",
                          "provider",
                          "rate",
                          "tvlUsd",
                          "payment",
                          "position"
                        ]
                      },
                      "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"
          }
        }
      }
    },
    "/v1/users/{userId}/portfolio": {
      "get": {
        "operationId": "portfolio.get",
        "summary": "Get portfolio",
        "tags": [
          "portfolio"
        ],
        "description": "Returns what the agent owns across every account right now: the total, each account, and each holding with its amount, price and how it was found, value, 24-hour change and average cost. Use it for any figure you show; use Get balances for the amounts a deposit or withdrawal can use. A holding no market prices is left out of the total and listed in `excluded`, never counted as zero. Figures after an account's last check against its custodian are `provisional`: show the value, and say it is unconfirmed. Opening it also asks for fresh reads of accounts last read more than two minutes ago, so calling it again shortly may confirm them.",
        "parameters": [
          {
            "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": "Everything the agent owns right now, by account and by holding.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Portfolio"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/portfolio/history": {
      "get": {
        "operationId": "portfolio.history",
        "summary": "Get portfolio history",
        "tags": [
          "portfolio"
        ],
        "description": "Returns the value of everything the agent owns over a range, one point per step, with the gain and a summary of the money that came in and went out. Use it to draw the portfolio chart; its last point is always Get portfolio's total. `marks` say where a holding entered or left the valued set, or where a change no record explains landed; neither counts as gain. Pass `step` for coarser points, such as `1d` over `1M`; a step finer than the range is kept at is refused.",
        "parameters": [
          {
            "schema": {
              "default": "1D",
              "type": "string",
              "enum": [
                "1D",
                "1W",
                "1M",
                "3M",
                "1Y",
                "all"
              ]
            },
            "in": "query",
            "name": "range",
            "required": false,
            "description": "How far back to draw: `1D` (the default, a point every 5 minutes), `1W` (hourly), `1M` (every 4 hours), `3M` and `1Y` (daily), or `all`, daily from the first activity, a few days apart once that is more than 400 days ago."
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "5m",
                "1h",
                "1d"
              ]
            },
            "in": "query",
            "name": "step",
            "required": false,
            "description": "Space the points this far apart instead: `5m`, `1h` or `1d`. It cannot be finer than the range is kept at: `5m` only on `1D`, `1h` on `1D`, `1W` and `1M`, and `1d` on any range."
          },
          {
            "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": "The value over the range, its gain, and the money in and out.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioHistory"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/swaps/quote": {
      "post": {
        "operationId": "wallets.quoteSwap",
        "summary": "Get a swap quote",
        "tags": [
          "wallets"
        ],
        "description": "Step 1 of a swap. Prices swapping one asset the agent wallet holds for another and returns the exact `terms` (what it sells, what it buys and the least it receives), `authorization.message` for the user to sign, and the `requestKey` to send as the `Idempotency-Key`. Use it for a swap the user makes from your own screen; the agent proposes its own trades in chat. Nothing is reserved or swapped. Call Swap tokens before `authorization.expiresAt`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SwapQuoteRequestInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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": "The quoted terms, the message to sign and the request key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SwapQuote"
                }
              }
            }
          },
          "400": {
            "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\n- `quote_refused` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `asset_not_swappable` — 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- `agent_slippage_exceeded` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `swap_changed` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/swaps": {
      "post": {
        "operationId": "wallets.swap",
        "summary": "Swap tokens",
        "tags": [
          "wallets"
        ],
        "description": "Step 2 of a swap. Swaps one asset in the agent wallet for another within the quote's terms; what it buys stays in the agent wallet. Send the quote's `terms`, the user's signature of its `authorization.message`, and its `requestKey` as the `Idempotency-Key` header. Returns the swap; poll Get a swap until its `status` is final. If this call times out, send it again unchanged: you get the same swap back, never a second one.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SwapTokensInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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."
          },
          {
            "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)$"
            },
            "example": "d5565100-9342-4bc6-a803-b387a20cb536",
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "description": "The quote's `requestKey`, which the user's signature names. Send the same key and body again to retry safely: you get the same swap back, never a second one. A different body under the same key is refused with `request_key_conflict`."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The swap and its current status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Swap"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `asset_not_swappable` — 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- `agent_slippage_exceeded` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `swap_changed` — 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- `request_key_conflict` — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "wallets.listSwaps",
        "summary": "List swaps",
        "tags": [
          "wallets"
        ],
        "description": "Lists the swaps the user made with Swap tokens, newest first, with their status. The agent's own trades are in List trades. After a timed-out request, find its swap by filtering on `requestKey`.",
        "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": "requestKey",
            "required": false,
            "description": "Only the swap sent with this `Idempotency-Key`: how to find it after a request timed out."
          },
          {
            "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 swaps.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Swap"
                      },
                      "description": "This page's rows."
                    },
                    "nextCursor": {
                      "description": "The cursor for the next page; null once there are no more rows.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "description": "How many rows the list holds in all, when it is known.",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/swaps/{swapId}": {
      "get": {
        "operationId": "wallets.getSwap",
        "summary": "Get a swap",
        "tags": [
          "wallets"
        ],
        "description": "Returns a swap and its `status`: `pending` until it starts, `processing` while it runs, then `completed` (the bought asset is in the agent wallet), `refunded` (the sold asset came back) or `failed` (nothing was swapped; `failureReason` says why). `denied` and `expired` mean the request was refused or its signature ran out before it started. `uncertain` means the result could not be confirmed yet: never send a replacement, keep checking.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "swapId",
            "required": true,
            "description": "The swap's id, as Swap tokens returned it."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The swap and its status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Swap"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/perps/account": {
      "post": {
        "operationId": "perps.openAccount",
        "summary": "Open a perps account",
        "tags": [
          "perps"
        ],
        "description": "Opens the user's Hyperliquid perpetuals account. Use it after creating the agent wallet and enabling perps for the user to have the account ready before any trade; no additional signature is needed because opening moves no funds. The agent's first deposit or opening order in chat opens it too, so calling this is optional. Returns the same account on every repeat, with a live balance observation when available. Send an `Idempotency-Key` for retries, then use Get a perps account to refresh its state.",
        "parameters": [
          {
            "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."
          },
          {
            "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)$"
            },
            "example": "d5565100-9342-4bc6-a803-b387a20cb536",
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "description": "A UUID you generate for this request. Send the same key and the same body to retry it safely: you get the original result back, never a second one. A different body under the same key is refused with `request_key_conflict`."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The user's perps account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PerpsAccount"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `perps_disabled` — perps is not enabled for this user",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `agent_wallet_required` — create the agent wallet before opening a perps, prediction-market or Solana account",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "perps.getAccount",
        "summary": "Get a perps account",
        "tags": [
          "perps"
        ],
        "description": "Returns the user's Hyperliquid perpetuals account, its current balance observation and each open position. Use it to refresh an account opened with Open a perps account or by the agent's first deposit or opening order; before opening it, the response is not found. An unavailable state means the balance could not be read, not that the account disappeared. The positions' unrealized PnL is already in the account value, so never add the positions to it.",
        "parameters": [
          {
            "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": "The user's perps account and its live state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PerpsAccount"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/prediction/account": {
      "post": {
        "operationId": "prediction.openAccount",
        "summary": "Open a prediction-market account",
        "tags": [
          "prediction"
        ],
        "description": "Opens the user's Polymarket account: a Deposit Wallet on Polygon that holds the agent's pUSD and positions, controlled by a key Fin holds. Use it once, after creating the agent wallet and enabling prediction-market trading for the user, to have the account ready before any trade; no additional signature is needed because opening moves no funds. The agent's first funding or order opens it too, so calling this is optional; that first attempt is refused while the account finishes opening. The first call answers with the account, its `status` `opening`; Fin then has Polymarket's relayer create the wallet and set its trading approvals without another call, so poll Get a prediction-market account until `status` is `ready`. A repeat with the same `Idempotency-Key` returns the same account.",
        "parameters": [
          {
            "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."
          },
          {
            "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)$"
            },
            "example": "d5565100-9342-4bc6-a803-b387a20cb536",
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "description": "A UUID you generate for this request. Send the same key and the same body to retry it safely: you get the original result back, never a second one. A different body under the same key is refused with `request_key_conflict`."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The user's prediction-market account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PredictionAccount"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `prediction_disabled` — prediction-market trading is not enabled for this user",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `agent_wallet_required` — create the agent wallet before opening a perps, prediction-market or Solana account",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "prediction.getAccount",
        "summary": "Get a prediction-market account",
        "tags": [
          "prediction"
        ],
        "description": "Returns the user's Polymarket account, whether it is still opening or ready, its live pUSD balance and the positions it holds. Use it to follow an account opened with Open a prediction-market account or by the agent's first funding or order; before opening it, the response is not found. An opening account becomes ready on its own, so poll this route rather than opening again. An unavailable balance or positions read means Polygon or Polymarket could not be read, not that the wallet is empty.",
        "parameters": [
          {
            "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": "The user's prediction-market account, its live balance and its positions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PredictionAccount"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/prediction/orders/prepare": {
      "post": {
        "operationId": "prediction.prepareOrder",
        "summary": "Prepare a Polymarket order",
        "tags": [
          "prediction"
        ],
        "description": "Step 1 of placing a Polymarket order the user makes themselves. Checks the order against the user's prediction-market account and returns it as the exact `order` to show and sign, with `authorization.message` for the user to sign and the `requestKey` to send as the `Idempotency-Key`. Use it for an order the user places from your own screen; the agent proposes its own orders in chat. Nothing is reserved or placed. Call Place a Polymarket order before `authorization.expiresAt`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PredictionOrderInputInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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": "The order, the message to sign and the request key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreparedPredictionOrder"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `prediction_disabled` — prediction-market trading is not enabled for this user",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.\n\n- `no_account` — the user has not opened the account this call reads; open it first",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/prediction/orders": {
      "post": {
        "operationId": "prediction.placeOrder",
        "summary": "Place a Polymarket order",
        "tags": [
          "prediction"
        ],
        "description": "Step 2 of placing a Polymarket order the user makes themselves. Places the prepared order from the user's prediction-market account, after the custody worker checks it against the live market and its signed fee and spend caps. Send the prepared `order`, the user's signature of its `authorization.message`, and its `requestKey` as the `Idempotency-Key` header. Returns the order and its latest fills, as Get a prediction order does; an `uncertain` order may already exist at Polymarket, so keep reading it rather than placing a replacement. If this call times out, send it again unchanged: you get the same order back, never a second one.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlacePredictionOrderInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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."
          },
          {
            "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)$"
            },
            "example": "d5565100-9342-4bc6-a803-b387a20cb536",
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "description": "The prepared order's `requestKey`, which the user's signature names. Send the same key and body again to retry safely: you get the same order back, never a second one. A different body under the same key is refused with `request_key_conflict`."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The order and its latest fills.",
            "content": {
              "application/json": {
                "schema": {
                  "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)$"
                    },
                    "order": {
                      "$ref": "#/components/schemas/PredictionOrderInput"
                    },
                    "observation": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "live",
                            "partially_filled",
                            "matched",
                            "filled",
                            "cancelled",
                            "expired",
                            "rejected",
                            "uncertain"
                          ]
                        },
                        "originalSizeRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9][0-9]{0,77})$"
                        },
                        "matchedSizeRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9][0-9]{0,77})$"
                        },
                        "remainingSizeRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9][0-9]{0,77})$"
                        },
                        "trades": {
                          "maxItems": 1000,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "tradeId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "MATCHED",
                                  "MINED",
                                  "CONFIRMED",
                                  "RETRYING",
                                  "FAILED"
                                ]
                              },
                              "sizeRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9][0-9]{0,77})$"
                              },
                              "transactionHash": {
                                "type": "string",
                                "pattern": "^0x[0-9a-f]{64}$"
                              }
                            },
                            "required": [
                              "tradeId",
                              "status",
                              "sizeRaw"
                            ]
                          }
                        },
                        "observedAtMs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "settledCollateralRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9][0-9]{0,77})$"
                        },
                        "settledFeeRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9][0-9]{0,77})$"
                        },
                        "cancelRequested": {
                          "type": "boolean"
                        },
                        "polymarketError": {
                          "description": "What Polymarket answered when the order was sent, when it answered with an error: kept with the order for good. Absent when Polymarket gave no reason.",
                          "type": "object",
                          "properties": {
                            "httpStatus": {
                              "description": "The HTTP status Polymarket answered with, when it answered with an error status.",
                              "type": "integer",
                              "minimum": 100,
                              "maximum": 599
                            },
                            "message": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 300,
                              "description": "Polymarket's own words, exactly as it answered, cut to their first 300 characters."
                            }
                          },
                          "required": [
                            "message"
                          ]
                        },
                        "venueOrderId": {
                          "type": "string",
                          "pattern": "^0x[0-9a-f]{64}$"
                        }
                      },
                      "required": [
                        "status",
                        "originalSizeRaw",
                        "matchedSizeRaw",
                        "remainingSizeRaw",
                        "trades",
                        "observedAtMs",
                        "venueOrderId"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "order",
                    "observation"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `prediction_disabled` — prediction-market trading is not enabled for this user",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.\n\n- `no_account` — the user has not opened the account this call reads; open it first",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `prediction_order_changed` — 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- `request_key_conflict` — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "prediction.listOrders",
        "summary": "List prediction orders",
        "tags": [
          "prediction"
        ],
        "description": "Lists your prediction orders and their latest fills. Follow nextCursor to read more. A match may still be awaiting settlement; open an order to follow it or request cancellation. Existing orders remain readable when trading is disabled.",
        "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",
              "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 prediction orders.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "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)$"
                          },
                          "order": {
                            "$ref": "#/components/schemas/PredictionOrderInput"
                          },
                          "observation": {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "enum": [
                                  "live",
                                  "partially_filled",
                                  "matched",
                                  "filled",
                                  "cancelled",
                                  "expired",
                                  "rejected",
                                  "uncertain"
                                ]
                              },
                              "originalSizeRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9][0-9]{0,77})$"
                              },
                              "matchedSizeRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9][0-9]{0,77})$"
                              },
                              "remainingSizeRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9][0-9]{0,77})$"
                              },
                              "trades": {
                                "maxItems": 1000,
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "tradeId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "status": {
                                      "type": "string",
                                      "enum": [
                                        "MATCHED",
                                        "MINED",
                                        "CONFIRMED",
                                        "RETRYING",
                                        "FAILED"
                                      ]
                                    },
                                    "sizeRaw": {
                                      "type": "string",
                                      "pattern": "^(0|[1-9][0-9]{0,77})$"
                                    },
                                    "transactionHash": {
                                      "type": "string",
                                      "pattern": "^0x[0-9a-f]{64}$"
                                    }
                                  },
                                  "required": [
                                    "tradeId",
                                    "status",
                                    "sizeRaw"
                                  ]
                                }
                              },
                              "observedAtMs": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "settledCollateralRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9][0-9]{0,77})$"
                              },
                              "settledFeeRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9][0-9]{0,77})$"
                              },
                              "cancelRequested": {
                                "type": "boolean"
                              },
                              "polymarketError": {
                                "description": "What Polymarket answered when the order was sent, when it answered with an error: kept with the order for good. Absent when Polymarket gave no reason.",
                                "type": "object",
                                "properties": {
                                  "httpStatus": {
                                    "description": "The HTTP status Polymarket answered with, when it answered with an error status.",
                                    "type": "integer",
                                    "minimum": 100,
                                    "maximum": 599
                                  },
                                  "message": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 300,
                                    "description": "Polymarket's own words, exactly as it answered, cut to their first 300 characters."
                                  }
                                },
                                "required": [
                                  "message"
                                ]
                              },
                              "venueOrderId": {
                                "type": "string",
                                "pattern": "^0x[0-9a-f]{64}$"
                              }
                            },
                            "required": [
                              "status",
                              "originalSizeRaw",
                              "matchedSizeRaw",
                              "remainingSizeRaw",
                              "trades",
                              "observedAtMs",
                              "venueOrderId"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "order",
                          "observation"
                        ]
                      },
                      "description": "This page's rows."
                    },
                    "nextCursor": {
                      "description": "The cursor for the next page; null once there are no more rows.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "description": "How many rows the list holds in all, when it is known.",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/prediction/orders/{orderId}": {
      "get": {
        "operationId": "prediction.getOrder",
        "summary": "Get a prediction order",
        "tags": [
          "prediction"
        ],
        "description": "Returns your prediction order and its latest fills. An uncertain submission may already exist at Polymarket: keep reading this order rather than placing a replacement. Cancellation stops only future matches.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "orderId",
            "required": true
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The prediction order and its current fills.",
            "content": {
              "application/json": {
                "schema": {
                  "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)$"
                    },
                    "order": {
                      "$ref": "#/components/schemas/PredictionOrderInput"
                    },
                    "observation": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "live",
                            "partially_filled",
                            "matched",
                            "filled",
                            "cancelled",
                            "expired",
                            "rejected",
                            "uncertain"
                          ]
                        },
                        "originalSizeRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9][0-9]{0,77})$"
                        },
                        "matchedSizeRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9][0-9]{0,77})$"
                        },
                        "remainingSizeRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9][0-9]{0,77})$"
                        },
                        "trades": {
                          "maxItems": 1000,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "tradeId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "MATCHED",
                                  "MINED",
                                  "CONFIRMED",
                                  "RETRYING",
                                  "FAILED"
                                ]
                              },
                              "sizeRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9][0-9]{0,77})$"
                              },
                              "transactionHash": {
                                "type": "string",
                                "pattern": "^0x[0-9a-f]{64}$"
                              }
                            },
                            "required": [
                              "tradeId",
                              "status",
                              "sizeRaw"
                            ]
                          }
                        },
                        "observedAtMs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "settledCollateralRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9][0-9]{0,77})$"
                        },
                        "settledFeeRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9][0-9]{0,77})$"
                        },
                        "cancelRequested": {
                          "type": "boolean"
                        },
                        "polymarketError": {
                          "description": "What Polymarket answered when the order was sent, when it answered with an error: kept with the order for good. Absent when Polymarket gave no reason.",
                          "type": "object",
                          "properties": {
                            "httpStatus": {
                              "description": "The HTTP status Polymarket answered with, when it answered with an error status.",
                              "type": "integer",
                              "minimum": 100,
                              "maximum": 599
                            },
                            "message": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 300,
                              "description": "Polymarket's own words, exactly as it answered, cut to their first 300 characters."
                            }
                          },
                          "required": [
                            "message"
                          ]
                        },
                        "venueOrderId": {
                          "type": "string",
                          "pattern": "^0x[0-9a-f]{64}$"
                        }
                      },
                      "required": [
                        "status",
                        "originalSizeRaw",
                        "matchedSizeRaw",
                        "remainingSizeRaw",
                        "trades",
                        "observedAtMs",
                        "venueOrderId"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "order",
                    "observation"
                  ]
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/prediction/orders/{orderId}/cancel": {
      "post": {
        "operationId": "prediction.cancelOrder",
        "summary": "Cancel a prediction order",
        "tags": [
          "prediction"
        ],
        "description": "Requests cancellation of your prediction order without another approval. Available even when trading is disabled. Fills can race cancellation and remain visible; read this order until cancellation and any matched trades settle.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "orderId",
            "required": true
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The order after requesting cancellation.",
            "content": {
              "application/json": {
                "schema": {
                  "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)$"
                    },
                    "order": {
                      "$ref": "#/components/schemas/PredictionOrderInput"
                    },
                    "observation": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "live",
                            "partially_filled",
                            "matched",
                            "filled",
                            "cancelled",
                            "expired",
                            "rejected",
                            "uncertain"
                          ]
                        },
                        "originalSizeRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9][0-9]{0,77})$"
                        },
                        "matchedSizeRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9][0-9]{0,77})$"
                        },
                        "remainingSizeRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9][0-9]{0,77})$"
                        },
                        "trades": {
                          "maxItems": 1000,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "tradeId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "MATCHED",
                                  "MINED",
                                  "CONFIRMED",
                                  "RETRYING",
                                  "FAILED"
                                ]
                              },
                              "sizeRaw": {
                                "type": "string",
                                "pattern": "^(0|[1-9][0-9]{0,77})$"
                              },
                              "transactionHash": {
                                "type": "string",
                                "pattern": "^0x[0-9a-f]{64}$"
                              }
                            },
                            "required": [
                              "tradeId",
                              "status",
                              "sizeRaw"
                            ]
                          }
                        },
                        "observedAtMs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "settledCollateralRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9][0-9]{0,77})$"
                        },
                        "settledFeeRaw": {
                          "type": "string",
                          "pattern": "^(0|[1-9][0-9]{0,77})$"
                        },
                        "cancelRequested": {
                          "type": "boolean"
                        },
                        "polymarketError": {
                          "description": "What Polymarket answered when the order was sent, when it answered with an error: kept with the order for good. Absent when Polymarket gave no reason.",
                          "type": "object",
                          "properties": {
                            "httpStatus": {
                              "description": "The HTTP status Polymarket answered with, when it answered with an error status.",
                              "type": "integer",
                              "minimum": 100,
                              "maximum": 599
                            },
                            "message": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 300,
                              "description": "Polymarket's own words, exactly as it answered, cut to their first 300 characters."
                            }
                          },
                          "required": [
                            "message"
                          ]
                        },
                        "venueOrderId": {
                          "type": "string",
                          "pattern": "^0x[0-9a-f]{64}$"
                        }
                      },
                      "required": [
                        "status",
                        "originalSizeRaw",
                        "matchedSizeRaw",
                        "remainingSizeRaw",
                        "trades",
                        "observedAtMs",
                        "venueOrderId"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "order",
                    "observation"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/solana/trades/prepare": {
      "post": {
        "operationId": "solana.prepareTrade",
        "summary": "Prepare a Solana trade",
        "tags": [
          "solana"
        ],
        "description": "Step 1 of a Solana buy or sale the user makes themselves from a token's page, with no agent run. Checks the trade as the agent's own buys and sales are checked (a buy needs the `solana` feature, a sale the opened Solana account, and the token must be one Fin trades) and returns it as the exact `trade` to show and sign, with `authorization.message` for the user to sign and the `requestKey` to send as the `Idempotency-Key`. Nothing is reserved or moved. A USDC buy from an Agent API wallet first funds the Solana account, which its agent pays only once the user allowed it: until then this refuses `destination_not_allowed`, and Add a withdrawal destination with venue `solana` allows it with one signature (naming the account opens it, which moves nothing). Call Place a Solana trade before `authorization.expiresAt`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SolanaTradeRequestInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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": "The trade, the message to sign and the request key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreparedSolanaTrade"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `solana_disabled` — Solana trading is not enabled for this user\n- `solana_token_not_tradable` — 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- `destination_not_allowed` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.\n\n- `no_account` — the user has not opened the account this call reads; open it first",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `solana_trade_changed` — 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- `agent_wallet_required` — create the agent wallet before opening a perps, prediction-market or Solana account",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/solana/trades": {
      "post": {
        "operationId": "solana.placeTrade",
        "summary": "Place a Solana trade",
        "tags": [
          "solana"
        ],
        "description": "Step 2 of a Solana buy or sale the user makes themselves. Starts the prepared trade from the agent's own Solana account: a USDC buy first moves its USDC to that account as SOL through 1Click, then swaps on Jupiter; a sale swaps, then sends its proceeds back to the agent wallet unless they stay as SOL. Send the prepared `trade`, the user's signature of its `authorization.message`, and its `requestKey` as the `Idempotency-Key` header. Returns the trade, its `status` `processing` while it runs, for up to nine minutes past the signature; follow it with Get a Solana trade until its status is final. One trade runs at a time per user. If this call times out, send it again unchanged: you get the same trade back, never a second one.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaceSolanaTradeInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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."
          },
          {
            "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)$"
            },
            "example": "d5565100-9342-4bc6-a803-b387a20cb536",
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "description": "The prepared trade's `requestKey`, which the user's signature names. Send the same key and body again to retry safely: you get the same trade back, never a second one. A different body under the same key is refused with `request_key_conflict`."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "201": {
            "description": "The trade, as Get a Solana trade returns it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SolanaTrade"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `solana_disabled` — Solana trading is not enabled for this user\n- `solana_token_not_tradable` — 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- `destination_not_allowed` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.\n\n- `no_account` — the user has not opened the account this call reads; open it first",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `solana_trade_changed` — 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- `agent_wallet_required` — create the agent wallet before opening a perps, prediction-market or Solana account\n- `request_key_conflict` — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/solana/trades/{tradeId}": {
      "get": {
        "operationId": "solana.getTrade",
        "summary": "Get a Solana trade",
        "tags": [
          "solana"
        ],
        "description": "Returns a Solana trade the user placed themselves: its status and why it failed, the step it is on while it runs, what it paid and received, and every transaction it signed. A trade's status is final by its `completeBy`; poll this route until then rather than placing it again. Trades placed here are not in the activity feed, which lists what the agent did.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "tradeId",
            "required": true
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The Solana trade.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SolanaTrade"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/solana/account": {
      "post": {
        "operationId": "solana.openAccount",
        "summary": "Open a Solana account",
        "tags": [
          "solana"
        ],
        "description": "Opens the agent's own Solana account: a Solana address controlled by a key Fin holds, separate from the agent wallet's. Use it after creating the agent wallet and enabling Solana trading for the user; no additional signature is needed because opening moves no funds. Returns the same account on every repeat, with a live read of its SOL and recognized token balances. Send an `Idempotency-Key` for retries, then use Get a Solana account to refresh it.",
        "parameters": [
          {
            "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."
          },
          {
            "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)$"
            },
            "example": "d5565100-9342-4bc6-a803-b387a20cb536",
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "description": "A UUID you generate for this request. Send the same key and the same body to retry it safely: you get the original result back, never a second one. A different body under the same key is refused with `request_key_conflict`."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The user's Solana account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SolanaAccount"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `solana_disabled` — Solana trading is not enabled for this user",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `agent_wallet_required` — create the agent wallet before opening a perps, prediction-market or Solana account",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "solana.getAccount",
        "summary": "Get a Solana account",
        "tags": [
          "solana"
        ],
        "description": "Returns the agent's Solana account, its SOL reserve and recognized token balances with exact amounts and available prices. Use it to refresh an account already opened with Open a Solana account; before opening it, the response is not found (`no_account`). Recognized tokens are canonical wrapped SOL, venue-verified tokens without a suspicious flag whose mint facts match the chain, or tokens this account has a confirmed landed buy of. A recognized token without a price remains listed and counted in `unpricedCount`; unrecognized tokens contribute to neither the list nor its totals. A `holdings` status of `unavailable` means balances or recognition evidence could not be read, never an empty account.",
        "parameters": [
          {
            "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": "The user's Solana account and what it holds now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SolanaAccount"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.\n\n- `no_account` — the user has not opened the account this call reads; open it first",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/solana/tokens/search": {
      "get": {
        "operationId": "solana.searchTokens",
        "summary": "Search Solana tokens",
        "tags": [
          "solana"
        ],
        "description": "Finds Solana tokens by ticker, name or a pasted mint address, best match first, each with Fin's risk verdict. Use it to turn what a person says into a mint. A ticker is not unique on Solana: when `ambiguous` is true several candidates share the top symbol, so show them and let the person choose by mint, never pick by symbol alone. A pasted mint answers that token alone. Needs the Solana feature to be on for the user.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "in": "query",
            "name": "query",
            "required": true,
            "description": "A ticker, a name or a pasted mint address. A leading `$` is ignored."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The candidates for the query, best first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SolanaTokenSearch"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `solana_disabled` — Solana trading is not enabled for this user",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/solana/tokens": {
      "get": {
        "operationId": "solana.listTokens",
        "summary": "List Solana tokens",
        "tags": [
          "solana"
        ],
        "description": "Lists sampled Solana candidates by activity ranking, token membership and optional liquidity, capitalization, age or launchpad filters. Use the default meme membership for positively identified memecoins, or the new lane for recent launches whose category may be unconfirmed. Returns the ranking reason, evidence gaps, source coverage and a nextCursor; pass that cursor with the same filters for the next page of the fixed snapshot. Young or thin tokens remain visible with warnings unless your filters exclude them. Needs the Solana feature to be on for the user.",
        "parameters": [
          {
            "schema": {
              "default": "trending",
              "type": "string",
              "enum": [
                "trending",
                "traded",
                "organic",
                "new",
                "gainers"
              ]
            },
            "in": "query",
            "name": "lane",
            "required": false,
            "description": "How to rank observed candidates: organic volume, volume, organic score, newest pools or price gain. Defaults to `trending`."
          },
          {
            "schema": {
              "default": "1h",
              "type": "string",
              "enum": [
                "5m",
                "1h",
                "6h",
                "24h"
              ]
            },
            "in": "query",
            "name": "interval",
            "required": false,
            "description": "The trailing window the list ranks by: 5m, 1h, 6h or 24h. Defaults to 1h."
          },
          {
            "schema": {
              "default": 10,
              "type": "integer",
              "minimum": 1,
              "maximum": 25
            },
            "in": "query",
            "name": "limit",
            "required": false,
            "description": "How many tokens to list, at most 25. Defaults to 10."
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            },
            "in": "query",
            "name": "cursor",
            "required": false,
            "description": "The nextCursor from the previous page with these same filters."
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "meme",
                "launches",
                "all"
              ]
            },
            "in": "query",
            "name": "membership",
            "required": false,
            "description": "Confirmed memes, recent launch candidates, or all sampled tokens. Defaults to memes, except the new lane defaults to launches."
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 80,
              "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
            },
            "in": "query",
            "name": "minLiquidityUsd",
            "required": false,
            "description": "Minimum pool liquidity in US dollars; no minimum unless supplied."
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 80,
              "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
            },
            "in": "query",
            "name": "maxLiquidityUsd",
            "required": false,
            "description": "Maximum pool liquidity in US dollars."
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 80,
              "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
            },
            "in": "query",
            "name": "minMarketCapUsd",
            "required": false,
            "description": "Minimum reported market capitalization in US dollars; FDV is not substituted."
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 80,
              "pattern": "^(0|[1-9]\\d*)(\\.\\d+)?$"
            },
            "in": "query",
            "name": "maxMarketCapUsd",
            "required": false,
            "description": "Maximum reported market capitalization in US dollars."
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 87600
            },
            "in": "query",
            "name": "maxAgeHours",
            "required": false,
            "description": "Maximum hours since the first pool opened; missing pool age does not match."
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "in": "query",
            "name": "launchpad",
            "required": false,
            "description": "A launchpad name reported by the source."
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "in": "query",
            "name": "tradableOnly",
            "required": false,
            "description": "Limit results to tokens the current mint and price reads permit buying. Defaults to false."
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "rank",
                "liquidity",
                "market_cap",
                "age",
                "change",
                "move"
              ]
            },
            "in": "query",
            "name": "sort",
            "required": false,
            "description": "Order by ranking, liquidity, capitalization, age, window price change, or `move`: the size of that change, up or down, largest first."
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            },
            "in": "query",
            "name": "direction",
            "required": false,
            "description": "The selected sort direction; defaults follow the selected ranking."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The ranked tokens of the lane.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SolanaTokenList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `solana_disabled` — Solana trading is not enabled for this user",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/solana/tokens/sparklines": {
      "get": {
        "operationId": "solana.listTokenSparklines",
        "summary": "List token sparklines",
        "tags": [
          "solana"
        ],
        "description": "Returns a small price line for each token named, over the last hour, 6 hours or 24 hours: at most 32 prices, oldest first, from what Fin itself sampled from the data source. Use it to draw a line beside each row of a token list, in one read for the page; use Get a token chart for one token's full chart. A token with no line says why: `not_sampled` when Fin read no price for it in the window, `too_sparse` when what it read would mislead. Leave the line out then, rather than draw what there is. Needs the Solana feature to be on for the user.",
        "parameters": [
          {
            "schema": {
              "default": "1h",
              "type": "string",
              "enum": [
                "1h",
                "6h",
                "24h"
              ]
            },
            "in": "query",
            "name": "interval",
            "required": false,
            "description": "How far back each line goes: 1h, 6h or 24h. Defaults to 1h."
          },
          {
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 32,
                  "maxLength": 44,
                  "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                  "description": "A Solana address: base58 text of a 32-byte public key."
                },
                {
                  "minItems": 1,
                  "maxItems": 25,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 32,
                    "maxLength": 44,
                    "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                    "description": "A Solana address: base58 text of a 32-byte public key."
                  }
                }
              ]
            },
            "in": "query",
            "name": "mint",
            "required": true,
            "description": "The tokens' mint addresses, one `mint` for each, at most 25."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Each token's line, or why it has none.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SolanaTokenSparklines"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `solana_disabled` — Solana trading is not enabled for this user",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/solana/tokens/launch-status": {
      "get": {
        "operationId": "solana.listTokenLaunchStatus",
        "summary": "List token launch status",
        "tags": [
          "solana"
        ],
        "description": "Says where each token named stands on its launchpad: `curve` with how far along a bonding curve it is, `graduated` with when it left for an open pool, or `unknown`. Use it to show launch progress beside a list of tokens, in one read for the page; Get a Solana token's `bondingProgressPct` states the same progress for one token. Only pump.fun's curve can be read, so a token on another launchpad's curve is `unknown`, as is any token while the chain or the data source cannot be read: its `launchpad` and `graduated` on a token read still say where it launched. Needs the Solana feature to be on for the user.",
        "parameters": [
          {
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 32,
                  "maxLength": 44,
                  "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                  "description": "A Solana address: base58 text of a 32-byte public key."
                },
                {
                  "minItems": 1,
                  "maxItems": 25,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 32,
                    "maxLength": 44,
                    "pattern": "^[1-9A-HJ-NP-Za-km-z]+$",
                    "description": "A Solana address: base58 text of a 32-byte public key."
                  }
                }
              ]
            },
            "in": "query",
            "name": "mint",
            "required": true,
            "description": "The tokens' mint addresses, one `mint` for each, at most 25."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Where each token stands on its launchpad.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SolanaTokenLaunchStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `solana_disabled` — Solana trading is not enabled for this user",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/solana/tokens/{mint}": {
      "get": {
        "operationId": "solana.getToken",
        "summary": "Get a Solana token",
        "tags": [
          "solana"
        ],
        "description": "Returns one Solana token by mint with market activity, classification, evidence sufficiency and the mint's risk verdict. Use it to research a discovered token or check one before a trade; resolve an ambiguous name with Search Solana tokens first. Returns missing evidence explicitly, and tradable reports current buy eligibility rather than a recommendation. Read Get a token chart for history appropriate to the token's age. Needs no feature flag, so existing holdings remain readable while buying is off; an address that is not a token is not found.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 32,
              "maxLength": 44,
              "pattern": "^[1-9A-HJ-NP-Za-km-z]+$"
            },
            "in": "path",
            "name": "mint",
            "required": true,
            "description": "The token's mint address. Symbols are not unique, so find the mint with Search Solana tokens."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The token and Fin's verdict on it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SolanaTokenDetail"
                }
              }
            }
          },
          "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": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/solana/tokens/{mint}/chart": {
      "get": {
        "operationId": "solana.getTokenChart",
        "summary": "Get a token chart",
        "tags": [
          "solana"
        ],
        "description": "Returns up to 200 recent closing prices from a token's deepest pool, oldest first, with their actual coverage and freshness. Use minute intervals to inspect a young launch and longer intervals for established history. Returns unavailable with no_pool when no pool prices the token; source failures carry their reason and are not zero prices. Needs no feature flag.",
        "parameters": [
          {
            "schema": {
              "default": "1h",
              "type": "string",
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ]
            },
            "in": "query",
            "name": "interval",
            "required": false,
            "description": "How wide each point is: 1m, 5m, 15m, 1h, 4h or 1d. The chart shows the latest 200 points. Defaults to 1h."
          },
          {
            "schema": {
              "type": "string",
              "minLength": 32,
              "maxLength": 44,
              "pattern": "^[1-9A-HJ-NP-Za-km-z]+$"
            },
            "in": "path",
            "name": "mint",
            "required": true,
            "description": "The token's mint address. Symbols are not unique, so find the mint with Search Solana tokens."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The token's closing prices, or why there are none.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SolanaTokenChart"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/solana/tokens/{mint}/holders": {
      "get": {
        "operationId": "solana.getTokenHolders",
        "summary": "Get a token's holders",
        "tags": [
          "solana"
        ],
        "description": "Lists a Solana token's ten largest holders, read from the chain: each owner once with all its accounts added up, its share of the supply, whether a program controls it rather than a person (a pool, a vault or a launchpad's bonding curve) and, where Fin recognizes it, whose pool that is, and whether it is the wallet that created the token. The answer also carries how much the number of wallets holding it changed, as a percent per window, where the data source states it. Use it to see how concentrated a token is before a trade; Get a Solana token's `topHoldersPct` is the venue's own summary of the same. Answers `unavailable`, never an error, when the chain cannot be read just now; an address that is not a token is not found. Needs no feature flag.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 32,
              "maxLength": 44,
              "pattern": "^[1-9A-HJ-NP-Za-km-z]+$"
            },
            "in": "path",
            "name": "mint",
            "required": true,
            "description": "The token's mint address. Symbols are not unique, so find the mint with Search Solana tokens."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The token's largest holders, or why there are none.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SolanaTokenHolders"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/solana/tokens/{mint}/icon": {
      "get": {
        "operationId": "solana.getTokenIcon",
        "summary": "Get a token icon",
        "tags": [
          "solana"
        ],
        "description": "Answers a Solana token's icon as an image: the picture the data source lists for it, fetched by Fin rather than by the person's browser, and served only as a PNG, JPEG, WebP or GIF, with the type its own bytes show. Use the `iconUrl` a token read gives, and draw a placeholder when it answers not found: the data source lists no icon, or its icon is unreachable, too large or another kind of file. It needs no feature flag.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 32,
              "maxLength": 44,
              "pattern": "^[1-9A-HJ-NP-Za-km-z]+$"
            },
            "in": "path",
            "name": "mint",
            "required": true,
            "description": "The token's mint address. Symbols are not unique, so find the mint with Search Solana tokens."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The icon's bytes, as `Content-Type` names them.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/gif": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "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": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/conversations/main": {
      "get": {
        "operationId": "conversations.main",
        "summary": "Get the main conversation",
        "tags": [
          "conversations"
        ],
        "description": "Returns the user's main conversation: the default chat thread every user has, created with the user. Send messages here in a single-chat app. It stays the main conversation when the user creates others. Deleting it gives the user a new, empty main conversation, so read this again rather than keeping its id forever.",
        "parameters": [
          {
            "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": "The main conversation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/conversations": {
      "post": {
        "operationId": "conversations.create",
        "summary": "Create a conversation",
        "tags": [
          "conversations"
        ],
        "description": "Creates a new conversation for the user, optionally with a title. Most apps use the main conversation (Get the main conversation) and create more only for separate topics. Send an `Idempotency-Key` header to make a retry safe: the same key returns the same conversation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "default": {},
                "type": "object",
                "properties": {
                  "title": {
                    "description": "A title for the conversation; omit to leave it untitled.",
                    "type": "string",
                    "maxLength": 120
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "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."
          },
          {
            "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)$"
            },
            "example": "d5565100-9342-4bc6-a803-b387a20cb536",
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "description": "Optional. A UUID you generate for this request. Send the same key and the same body to retry it safely: you get the original result back, never a second one. Without it, a retry creates a second one."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "201": {
            "description": "The new conversation; the same conversation again when this `Idempotency-Key` already created one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `request_key_conflict` — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "get": {
        "operationId": "conversations.list",
        "summary": "List conversations",
        "tags": [
          "conversations"
        ],
        "description": "Lists the user's conversations, newest first. By default only chats the user started; `origin=automation` or `all` adds conversations automations started. `order=recent` sorts by latest activity, and `activity=active` keeps only those with a run in progress or an approval waiting.",
        "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": {
              "default": "conversation",
              "type": "string",
              "enum": [
                "conversation",
                "automation",
                "all"
              ]
            },
            "in": "query",
            "name": "origin",
            "required": false,
            "description": "Which conversations: `conversation` (the default) for chats the user started, `automation` for those automations started, `all` for both."
          },
          {
            "schema": {
              "default": "all",
              "type": "string",
              "enum": [
                "all",
                "active",
                "inactive"
              ]
            },
            "in": "query",
            "name": "activity",
            "required": false,
            "description": "`active` keeps conversations with a run in progress or an approval waiting, `inactive` the rest; `all` (the default) keeps both."
          },
          {
            "schema": {
              "default": "created",
              "type": "string",
              "enum": [
                "created",
                "recent"
              ]
            },
            "in": "query",
            "name": "order",
            "required": false,
            "description": "`created` (the default) sorts newest first by creation; `recent` by latest activity, where a conversation with none counts from its creation."
          },
          {
            "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 the caller's conversations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Conversation"
                      },
                      "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"
          }
        }
      }
    },
    "/v1/users/{userId}/conversations/{conversationId}": {
      "get": {
        "operationId": "conversations.get",
        "summary": "Get a conversation",
        "tags": [
          "conversations"
        ],
        "description": "Returns one conversation with a summary of its latest activity: last messages, run status and waiting approvals.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "conversationId",
            "required": true,
            "description": "The conversation's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The conversation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "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"
          }
        }
      },
      "delete": {
        "operationId": "conversations.delete",
        "summary": "Delete a conversation",
        "tags": [
          "conversations"
        ],
        "description": "Removes a conversation from the user's list. Its history stays readable by id, with `deletedAt` set, but it takes no new messages. Deleting the main conversation gives the user a new, empty one; read Get the main conversation again for its id. Stop a run first: a conversation with a run in progress or an approval waiting is refused. Safe to repeat.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "conversationId",
            "required": true,
            "description": "The conversation's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "204": {
            "description": "The conversation is deleted."
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `run_active` — a run already holds this conversation",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/conversations/{conversationId}/events": {
      "get": {
        "operationId": "events.list",
        "summary": "List a conversation's events",
        "tags": [
          "events"
        ],
        "description": "Returns a conversation's saved events, oldest first: messages, runs, approvals and trade updates. Use it to load history or catch up after being offline; pass `nextCursor` back as `cursor` to continue. For live updates use Stream a conversation's events.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "in": "query",
            "name": "cursor",
            "required": false,
            "description": "An `after` cursor from the previous page; omit to read from the beginning."
          },
          {
            "schema": {
              "default": 500,
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            },
            "in": "query",
            "name": "limit",
            "required": false,
            "description": "How many events to answer, at most 1000"
          },
          {
            "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."
          },
          {
            "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": "path",
            "name": "conversationId",
            "required": true,
            "description": "The conversation's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "A page of the conversation's saved events.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FinEvent"
                      },
                      "description": "This page's events, oldest first."
                    },
                    "nextCursor": {
                      "description": "The cursor for the next page, or null at the end as of this read; a live conversation may append more.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/activity": {
      "get": {
        "operationId": "activity.list",
        "summary": "List activity",
        "tags": [
          "activity"
        ],
        "description": "Lists what happened in the user's wallet and automations, newest first: the agent's trades, its Solana trades and transfers, the user's own swaps, withdrawals, deposits, transfers to deposit addresses and changes to automations. Each item carries the same object its own route returns, so render it by `kind`. Narrow it with `type` and `origin`, and pass `nextCursor` back as `cursor` for older items. A deposit or deposit address appears once the user is expected to send to it; one that expired unpaid is only in List deposits or Get a deposit address.",
        "parameters": [
          {
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            },
            "in": "query",
            "name": "limit",
            "required": false,
            "description": "How many items to return, at most 50."
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "in": "query",
            "name": "cursor",
            "required": false,
            "description": "The `nextCursor` from the previous page; omit for the newest items."
          },
          {
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "trade",
                    "swap",
                    "withdrawal",
                    "deposit",
                    "deposit_address",
                    "automation",
                    "solana",
                    "solana_sell_many",
                    "solana_trade"
                  ]
                },
                {
                  "minItems": 1,
                  "maxItems": 9,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "trade",
                      "swap",
                      "withdrawal",
                      "deposit",
                      "deposit_address",
                      "automation",
                      "solana",
                      "solana_sell_many",
                      "solana_trade"
                    ]
                  }
                }
              ]
            },
            "in": "query",
            "name": "type",
            "required": false,
            "description": "Keep only these kinds of item; repeat it for several (`type=trade&type=deposit`). Omit for every kind."
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "conversation",
                "automation"
              ]
            },
            "in": "query",
            "name": "origin",
            "required": false,
            "description": "Keep only trades, and Solana trades and transfers, the agent asked for in a chat (`conversation`) or in an automation's run (`automation`, which also keeps changes to automations). The user's own swaps, deposits, deposit addresses and withdrawals are left out when this is set."
          },
          {
            "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 activity, and how many approvals are waiting.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "maxItems": 50,
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ActivityItem"
                      },
                      "description": "This page of activity, newest first."
                    },
                    "nextCursor": {
                      "description": "Pass it back as `cursor` for older items; null at the end.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pendingApprovals": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991,
                      "description": "How many approvals are waiting for the user, across every conversation."
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "pendingApprovals"
                  ]
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/notifications": {
      "get": {
        "operationId": "notifications.list",
        "summary": "List notifications",
        "tags": [
          "notifications"
        ],
        "description": "Lists what Fin told the user, newest first, with each notification's text ready to show: approvals and questions waiting for them, automation reports, money that moved, problems with their automations and fin's replies in chats they left. Show it as an inbox, use `unreadCount` for a badge, and open each notification's `subject` when the user taps it. Narrow it with `unread` or `conversationId`, and pass `nextCursor` back as `cursor` for older ones. Mark notifications read once the user has seen them.",
        "parameters": [
          {
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            },
            "in": "query",
            "name": "limit",
            "required": false,
            "description": "How many notifications to return, at most 50."
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "in": "query",
            "name": "cursor",
            "required": false,
            "description": "The `nextCursor` from the previous page; omit for the newest notifications."
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "unread",
            "required": false,
            "description": "Only unread notifications when true."
          },
          {
            "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 notifications about this conversation: its approvals, questions and replies."
          },
          {
            "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 notifications, and how many are unread.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "maxItems": 50,
                      "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 notification's id."
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "approval",
                              "question",
                              "automation_report",
                              "trade",
                              "order_filled",
                              "deposit",
                              "withdrawal",
                              "automation_attention",
                              "reply",
                              "holding_move",
                              "market_story",
                              "weekly_look"
                            ],
                            "description": "What happened: an `approval` or `question` waiting for the user, an `automation_report`, a `trade` that ended (one an automation made, one the agent made in chat, the user's own swap, or a Solana buy or sale, the user's own on the token's page included), an `order_filled` (a limit order or a Polymarket order), a `deposit`, a `withdrawal`, an `automation_attention` problem with an automation, fin's `reply` in a chat the user left, or one of fin's own notices about what it noticed: a `holding_move` (a coin that is a real part of the user's money fell far more than it usually does, or their whole money fell 5% in a day), a `market_story` (big news about a coin they hold) or a `weekly_look` (fin's look at their week). Fin may add kinds: show one you do not know by its `title` and `body`."
                          },
                          "category": {
                            "type": "string",
                            "enum": [
                              "needs_you",
                              "alerts_and_reports",
                              "money_moved",
                              "automation_problems",
                              "replies",
                              "big_news",
                              "big_moves",
                              "weekly_look"
                            ],
                            "description": "Which of the user's notification settings it falls under, if your app lets them choose: `needs_you`, `alerts_and_reports`, `money_moved`, `automation_problems`, `replies`, or, for fin's own notices, `big_news`, `big_moves` and `weekly_look`. Fin's notices are new to the user: leave their push off until the user turns it on."
                          },
                          "tone": {
                            "type": "string",
                            "enum": [
                              "needs_you",
                              "problem",
                              "resolved",
                              "neutral"
                            ],
                            "description": "How it reads, to tint its icon: `needs_you` while an approval or a question waits for the user, when fin paused an automation until its owner acts, or when an automation's approval ends in three days; `problem` when something went wrong (a trade or a withdrawal that didn't go through, a refunded deposit, an automation that can't check its data or run, a reply that failed) or fin noticed a fall in the user's money; `resolved` when an automation's problem is over; `neutral` otherwise."
                          },
                          "title": {
                            "type": "string",
                            "description": "The title to show, plain text."
                          },
                          "body": {
                            "type": "string",
                            "description": "One line under the title, plain text."
                          },
                          "withoutAmounts": {
                            "type": "object",
                            "properties": {
                              "title": {
                                "type": "string",
                                "description": "The notification's title, plain text."
                              },
                              "body": {
                                "type": "string",
                                "description": "One line under the title, plain text."
                              }
                            },
                            "required": [
                              "title",
                              "body"
                            ],
                            "description": "The same notification without amounts, for a lock screen or anywhere the user asked you not to show them."
                          },
                          "subject": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "An approval waiting for the user.",
                                    "enum": [
                                      "approval"
                                    ]
                                  },
                                  "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."
                                  },
                                  "conversationId": {
                                    "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 the approval is in."
                                  }
                                },
                                "required": [
                                  "type",
                                  "approvalId",
                                  "conversationId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A question fin asked the user.",
                                    "enum": [
                                      "question"
                                    ]
                                  },
                                  "questionId": {
                                    "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 question's id."
                                  },
                                  "conversationId": {
                                    "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 the question is in."
                                  }
                                },
                                "required": [
                                  "type",
                                  "questionId",
                                  "conversationId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A run an automation started.",
                                    "enum": [
                                      "automation_run"
                                    ]
                                  },
                                  "automationId": {
                                    "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 automation's id."
                                  },
                                  "automationRunId": {
                                    "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, as Get an automation run takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "automationId",
                                  "automationRunId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A trade the agent made.",
                                    "enum": [
                                      "trade"
                                    ]
                                  },
                                  "tradeId": {
                                    "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, as Get a trade takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "tradeId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A swap the user made in the agent wallet.",
                                    "enum": [
                                      "swap"
                                    ]
                                  },
                                  "swapId": {
                                    "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 swap's id, as Get a swap takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "swapId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A buy or a sale of a Solana token, by the user on its page or by the agent.",
                                    "enum": [
                                      "solana_trade"
                                    ]
                                  },
                                  "tradeId": {
                                    "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": "For a trade the user placed on the token's page, its id as Get a Solana trade takes it; for one the agent made, the id of its `solana` item in List activity."
                                  }
                                },
                                "required": [
                                  "type",
                                  "tradeId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A Polymarket order.",
                                    "enum": [
                                      "prediction_order"
                                    ]
                                  },
                                  "orderId": {
                                    "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 order's id, as Get a prediction order takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "orderId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A limit order.",
                                    "enum": [
                                      "order"
                                    ]
                                  },
                                  "orderId": {
                                    "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 order's id, as Get a limit order takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "orderId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A deposit into the agent wallet.",
                                    "enum": [
                                      "deposit"
                                    ]
                                  },
                                  "depositId": {
                                    "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 deposit's id, as Get a deposit takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "depositId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A transfer to a deposit address.",
                                    "enum": [
                                      "deposit_address"
                                    ]
                                  },
                                  "depositAddressId": {
                                    "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 deposit address's id, as Get a deposit address takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "depositAddressId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A withdrawal from the agent wallet.",
                                    "enum": [
                                      "withdrawal"
                                    ]
                                  },
                                  "withdrawalId": {
                                    "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 withdrawal's id, as Get a withdrawal takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "withdrawalId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "An automation as a whole.",
                                    "enum": [
                                      "automation"
                                    ]
                                  },
                                  "automationId": {
                                    "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 automation's id."
                                  }
                                },
                                "required": [
                                  "type",
                                  "automationId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "fin's reply in a conversation.",
                                    "enum": [
                                      "conversation"
                                    ]
                                  },
                                  "conversationId": {
                                    "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."
                                  },
                                  "runId": {
                                    "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 that replied."
                                  }
                                },
                                "required": [
                                  "type",
                                  "conversationId",
                                  "runId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A market story fin's news desk is carrying.",
                                    "enum": [
                                      "story"
                                    ]
                                  },
                                  "storyId": {
                                    "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 story's id, as Get a market story takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "storyId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A coin or token the user holds.",
                                    "enum": [
                                      "asset"
                                    ]
                                  },
                                  "assetId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 256,
                                    "description": "The asset's NEAR Intents asset id, or `solana:<mint>` for a Solana token."
                                  }
                                },
                                "required": [
                                  "type",
                                  "assetId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "The user's money over one week, as fin looked at it.",
                                    "enum": [
                                      "week"
                                    ]
                                  },
                                  "weekOf": {
                                    "type": "string",
                                    "format": "date",
                                    "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])))$",
                                    "description": "The Monday the week began, as an ISO date."
                                  }
                                },
                                "required": [
                                  "type",
                                  "weekOf"
                                ]
                              }
                            ],
                            "description": "What the notification is about. Open its page when the user opens the notification."
                          },
                          "tokenId": {
                            "description": "The token the notification is about, to draw its icon beside the text: what a trade or order bought (or sold, when it received dollars), or what a deposit brought or a withdrawal sent. A NEAR Intents asset id, or `solana:<mint>` for a Solana token. Absent for the other kinds, and when Fin cannot name the token.",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256
                          },
                          "status": {
                            "description": "For an approval or a question: `waiting` while the user can still answer, `expired` once it ran out, `done` once it was answered. `waiting` also marks an `automation_attention` for an automation fin paused until its owner acts, which has no `expiresAt` and reads `done` once they have. Absent otherwise.",
                            "type": "string",
                            "enum": [
                              "waiting",
                              "expired",
                              "done"
                            ]
                          },
                          "action": {
                            "description": "On an automation fin paused for its owner (`status` `waiting`), what moves it on: `add_funds` or `edit_automation`. Absent when the owner moves it on from the automation's page, by a choice or by resuming it, and on every other notification.",
                            "type": "string",
                            "enum": [
                              "add_funds",
                              "edit_automation"
                            ]
                          },
                          "expiresAt": {
                            "description": "For an approval or a question that is waiting: when it runs out.",
                            "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))$"
                          },
                          "options": {
                            "description": "Ways to act on one of fin's own notices (`holding_move`, `market_story`, `weekly_look`), best first. Show them where the user opens the notification, never in a push or on a lock screen, under a line saying they are options, not recommendations, and that doing nothing is fine. Absent on every other notification.",
                            "minItems": 1,
                            "maxItems": 3,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/NotificationOption"
                            }
                          },
                          "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 it happened."
                          },
                          "readAt": {
                            "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 user read it, or when its approval or question was answered or ran out; null while unread."
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "category",
                          "tone",
                          "title",
                          "body",
                          "withoutAmounts",
                          "subject",
                          "createdAt",
                          "readAt"
                        ]
                      },
                      "description": "This page of notifications, newest first."
                    },
                    "nextCursor": {
                      "description": "Pass it back as `cursor` for older notifications; null at the end.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "unreadCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991,
                      "description": "How many of the user's notifications are unread, for a badge."
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "unreadCount"
                  ]
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/notifications/read": {
      "post": {
        "operationId": "notifications.markRead",
        "summary": "Mark notifications read",
        "tags": [
          "notifications"
        ],
        "description": "Marks the user's notifications read once they have seen them, on every device: name them in `notificationIds`, or send `through` with the newest one the user saw to mark it and everything older, so one that arrived since stays unread. Answers the newest 100 notifications this call changed and the new `unreadCount`; a `through` request still marks every older notification, so refresh the inbox for the rest. Safe to repeat: a notification already read is left as it was. An approval or a question counts as read on its own once it is answered or runs out.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "notificationIds": {
                        "minItems": 1,
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "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 notifications to mark read, at most 100."
                      }
                    },
                    "required": [
                      "notificationIds"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "through": {
                        "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": "Mark this notification and every older one read: send the newest one the user saw, so one that arrived since stays unread."
                      }
                    },
                    "required": [
                      "through"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "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": "The notifications this call marked read, and how many are unread now.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "maxItems": 100,
                      "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 notification's id."
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "approval",
                              "question",
                              "automation_report",
                              "trade",
                              "order_filled",
                              "deposit",
                              "withdrawal",
                              "automation_attention",
                              "reply",
                              "holding_move",
                              "market_story",
                              "weekly_look"
                            ],
                            "description": "What happened: an `approval` or `question` waiting for the user, an `automation_report`, a `trade` that ended (one an automation made, one the agent made in chat, the user's own swap, or a Solana buy or sale, the user's own on the token's page included), an `order_filled` (a limit order or a Polymarket order), a `deposit`, a `withdrawal`, an `automation_attention` problem with an automation, fin's `reply` in a chat the user left, or one of fin's own notices about what it noticed: a `holding_move` (a coin that is a real part of the user's money fell far more than it usually does, or their whole money fell 5% in a day), a `market_story` (big news about a coin they hold) or a `weekly_look` (fin's look at their week). Fin may add kinds: show one you do not know by its `title` and `body`."
                          },
                          "category": {
                            "type": "string",
                            "enum": [
                              "needs_you",
                              "alerts_and_reports",
                              "money_moved",
                              "automation_problems",
                              "replies",
                              "big_news",
                              "big_moves",
                              "weekly_look"
                            ],
                            "description": "Which of the user's notification settings it falls under, if your app lets them choose: `needs_you`, `alerts_and_reports`, `money_moved`, `automation_problems`, `replies`, or, for fin's own notices, `big_news`, `big_moves` and `weekly_look`. Fin's notices are new to the user: leave their push off until the user turns it on."
                          },
                          "tone": {
                            "type": "string",
                            "enum": [
                              "needs_you",
                              "problem",
                              "resolved",
                              "neutral"
                            ],
                            "description": "How it reads, to tint its icon: `needs_you` while an approval or a question waits for the user, when fin paused an automation until its owner acts, or when an automation's approval ends in three days; `problem` when something went wrong (a trade or a withdrawal that didn't go through, a refunded deposit, an automation that can't check its data or run, a reply that failed) or fin noticed a fall in the user's money; `resolved` when an automation's problem is over; `neutral` otherwise."
                          },
                          "title": {
                            "type": "string",
                            "description": "The title to show, plain text."
                          },
                          "body": {
                            "type": "string",
                            "description": "One line under the title, plain text."
                          },
                          "withoutAmounts": {
                            "type": "object",
                            "properties": {
                              "title": {
                                "type": "string",
                                "description": "The notification's title, plain text."
                              },
                              "body": {
                                "type": "string",
                                "description": "One line under the title, plain text."
                              }
                            },
                            "required": [
                              "title",
                              "body"
                            ],
                            "description": "The same notification without amounts, for a lock screen or anywhere the user asked you not to show them."
                          },
                          "subject": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "An approval waiting for the user.",
                                    "enum": [
                                      "approval"
                                    ]
                                  },
                                  "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."
                                  },
                                  "conversationId": {
                                    "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 the approval is in."
                                  }
                                },
                                "required": [
                                  "type",
                                  "approvalId",
                                  "conversationId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A question fin asked the user.",
                                    "enum": [
                                      "question"
                                    ]
                                  },
                                  "questionId": {
                                    "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 question's id."
                                  },
                                  "conversationId": {
                                    "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 the question is in."
                                  }
                                },
                                "required": [
                                  "type",
                                  "questionId",
                                  "conversationId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A run an automation started.",
                                    "enum": [
                                      "automation_run"
                                    ]
                                  },
                                  "automationId": {
                                    "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 automation's id."
                                  },
                                  "automationRunId": {
                                    "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, as Get an automation run takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "automationId",
                                  "automationRunId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A trade the agent made.",
                                    "enum": [
                                      "trade"
                                    ]
                                  },
                                  "tradeId": {
                                    "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, as Get a trade takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "tradeId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A swap the user made in the agent wallet.",
                                    "enum": [
                                      "swap"
                                    ]
                                  },
                                  "swapId": {
                                    "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 swap's id, as Get a swap takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "swapId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A buy or a sale of a Solana token, by the user on its page or by the agent.",
                                    "enum": [
                                      "solana_trade"
                                    ]
                                  },
                                  "tradeId": {
                                    "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": "For a trade the user placed on the token's page, its id as Get a Solana trade takes it; for one the agent made, the id of its `solana` item in List activity."
                                  }
                                },
                                "required": [
                                  "type",
                                  "tradeId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A Polymarket order.",
                                    "enum": [
                                      "prediction_order"
                                    ]
                                  },
                                  "orderId": {
                                    "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 order's id, as Get a prediction order takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "orderId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A limit order.",
                                    "enum": [
                                      "order"
                                    ]
                                  },
                                  "orderId": {
                                    "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 order's id, as Get a limit order takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "orderId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A deposit into the agent wallet.",
                                    "enum": [
                                      "deposit"
                                    ]
                                  },
                                  "depositId": {
                                    "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 deposit's id, as Get a deposit takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "depositId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A transfer to a deposit address.",
                                    "enum": [
                                      "deposit_address"
                                    ]
                                  },
                                  "depositAddressId": {
                                    "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 deposit address's id, as Get a deposit address takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "depositAddressId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A withdrawal from the agent wallet.",
                                    "enum": [
                                      "withdrawal"
                                    ]
                                  },
                                  "withdrawalId": {
                                    "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 withdrawal's id, as Get a withdrawal takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "withdrawalId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "An automation as a whole.",
                                    "enum": [
                                      "automation"
                                    ]
                                  },
                                  "automationId": {
                                    "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 automation's id."
                                  }
                                },
                                "required": [
                                  "type",
                                  "automationId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "fin's reply in a conversation.",
                                    "enum": [
                                      "conversation"
                                    ]
                                  },
                                  "conversationId": {
                                    "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."
                                  },
                                  "runId": {
                                    "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 that replied."
                                  }
                                },
                                "required": [
                                  "type",
                                  "conversationId",
                                  "runId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A market story fin's news desk is carrying.",
                                    "enum": [
                                      "story"
                                    ]
                                  },
                                  "storyId": {
                                    "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 story's id, as Get a market story takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "storyId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A coin or token the user holds.",
                                    "enum": [
                                      "asset"
                                    ]
                                  },
                                  "assetId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 256,
                                    "description": "The asset's NEAR Intents asset id, or `solana:<mint>` for a Solana token."
                                  }
                                },
                                "required": [
                                  "type",
                                  "assetId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "The user's money over one week, as fin looked at it.",
                                    "enum": [
                                      "week"
                                    ]
                                  },
                                  "weekOf": {
                                    "type": "string",
                                    "format": "date",
                                    "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])))$",
                                    "description": "The Monday the week began, as an ISO date."
                                  }
                                },
                                "required": [
                                  "type",
                                  "weekOf"
                                ]
                              }
                            ],
                            "description": "What the notification is about. Open its page when the user opens the notification."
                          },
                          "tokenId": {
                            "description": "The token the notification is about, to draw its icon beside the text: what a trade or order bought (or sold, when it received dollars), or what a deposit brought or a withdrawal sent. A NEAR Intents asset id, or `solana:<mint>` for a Solana token. Absent for the other kinds, and when Fin cannot name the token.",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256
                          },
                          "status": {
                            "description": "For an approval or a question: `waiting` while the user can still answer, `expired` once it ran out, `done` once it was answered. `waiting` also marks an `automation_attention` for an automation fin paused until its owner acts, which has no `expiresAt` and reads `done` once they have. Absent otherwise.",
                            "type": "string",
                            "enum": [
                              "waiting",
                              "expired",
                              "done"
                            ]
                          },
                          "action": {
                            "description": "On an automation fin paused for its owner (`status` `waiting`), what moves it on: `add_funds` or `edit_automation`. Absent when the owner moves it on from the automation's page, by a choice or by resuming it, and on every other notification.",
                            "type": "string",
                            "enum": [
                              "add_funds",
                              "edit_automation"
                            ]
                          },
                          "expiresAt": {
                            "description": "For an approval or a question that is waiting: when it runs out.",
                            "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))$"
                          },
                          "options": {
                            "description": "Ways to act on one of fin's own notices (`holding_move`, `market_story`, `weekly_look`), best first. Show them where the user opens the notification, never in a push or on a lock screen, under a line saying they are options, not recommendations, and that doing nothing is fine. Absent on every other notification.",
                            "minItems": 1,
                            "maxItems": 3,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/NotificationOption"
                            }
                          },
                          "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 it happened."
                          },
                          "readAt": {
                            "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 user read it, or when its approval or question was answered or ran out; null while unread."
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "category",
                          "tone",
                          "title",
                          "body",
                          "withoutAmounts",
                          "subject",
                          "createdAt",
                          "readAt"
                        ]
                      },
                      "description": "The newest notifications this call marked read, at most 100. A through request can mark more; refresh the inbox to read their current state."
                    },
                    "unreadCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991,
                      "description": "How many are unread now."
                    }
                  },
                  "required": [
                    "data",
                    "unreadCount"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/partner/notifications": {
      "get": {
        "operationId": "partner.notifications",
        "summary": "List notifications to deliver",
        "tags": [
          "partner"
        ],
        "description": "Lists every notification of your users, oldest first, for you to deliver to their devices: each one names its user by your own `userId` for them and says with `push` whether to show it now. Poll it from your server every few seconds with your partner key alone, keep the `nextCursor` it answers, even from an empty page, and pass it back as `after`, including after a restart. A notification takes its place here once it is committed and its short wait has passed, so a cursor never skips one. Approvals, questions and replies wait a little first, in case the user sees them in the app.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "in": "query",
            "name": "after",
            "required": false,
            "description": "The `nextCursor` from your previous call; omit to start from the beginning."
          },
          {
            "schema": {
              "default": 100,
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            },
            "in": "query",
            "name": "limit",
            "required": false,
            "description": "How many notifications to return, at most 500."
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Your users' notifications after your cursor, and where this page ended.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "maxItems": 500,
                      "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 notification's id."
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "approval",
                              "question",
                              "automation_report",
                              "trade",
                              "order_filled",
                              "deposit",
                              "withdrawal",
                              "automation_attention",
                              "reply",
                              "holding_move",
                              "market_story",
                              "weekly_look"
                            ],
                            "description": "What happened: an `approval` or `question` waiting for the user, an `automation_report`, a `trade` that ended (one an automation made, one the agent made in chat, the user's own swap, or a Solana buy or sale, the user's own on the token's page included), an `order_filled` (a limit order or a Polymarket order), a `deposit`, a `withdrawal`, an `automation_attention` problem with an automation, fin's `reply` in a chat the user left, or one of fin's own notices about what it noticed: a `holding_move` (a coin that is a real part of the user's money fell far more than it usually does, or their whole money fell 5% in a day), a `market_story` (big news about a coin they hold) or a `weekly_look` (fin's look at their week). Fin may add kinds: show one you do not know by its `title` and `body`."
                          },
                          "category": {
                            "type": "string",
                            "enum": [
                              "needs_you",
                              "alerts_and_reports",
                              "money_moved",
                              "automation_problems",
                              "replies",
                              "big_news",
                              "big_moves",
                              "weekly_look"
                            ],
                            "description": "Which of the user's notification settings it falls under, if your app lets them choose: `needs_you`, `alerts_and_reports`, `money_moved`, `automation_problems`, `replies`, or, for fin's own notices, `big_news`, `big_moves` and `weekly_look`. Fin's notices are new to the user: leave their push off until the user turns it on."
                          },
                          "tone": {
                            "type": "string",
                            "enum": [
                              "needs_you",
                              "problem",
                              "resolved",
                              "neutral"
                            ],
                            "description": "How it reads, to tint its icon: `needs_you` while an approval or a question waits for the user, when fin paused an automation until its owner acts, or when an automation's approval ends in three days; `problem` when something went wrong (a trade or a withdrawal that didn't go through, a refunded deposit, an automation that can't check its data or run, a reply that failed) or fin noticed a fall in the user's money; `resolved` when an automation's problem is over; `neutral` otherwise."
                          },
                          "title": {
                            "type": "string",
                            "description": "The title to show, plain text."
                          },
                          "body": {
                            "type": "string",
                            "description": "One line under the title, plain text."
                          },
                          "withoutAmounts": {
                            "type": "object",
                            "properties": {
                              "title": {
                                "type": "string",
                                "description": "The notification's title, plain text."
                              },
                              "body": {
                                "type": "string",
                                "description": "One line under the title, plain text."
                              }
                            },
                            "required": [
                              "title",
                              "body"
                            ],
                            "description": "The same notification without amounts, for a lock screen or anywhere the user asked you not to show them."
                          },
                          "subject": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "An approval waiting for the user.",
                                    "enum": [
                                      "approval"
                                    ]
                                  },
                                  "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."
                                  },
                                  "conversationId": {
                                    "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 the approval is in."
                                  }
                                },
                                "required": [
                                  "type",
                                  "approvalId",
                                  "conversationId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A question fin asked the user.",
                                    "enum": [
                                      "question"
                                    ]
                                  },
                                  "questionId": {
                                    "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 question's id."
                                  },
                                  "conversationId": {
                                    "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 the question is in."
                                  }
                                },
                                "required": [
                                  "type",
                                  "questionId",
                                  "conversationId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A run an automation started.",
                                    "enum": [
                                      "automation_run"
                                    ]
                                  },
                                  "automationId": {
                                    "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 automation's id."
                                  },
                                  "automationRunId": {
                                    "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, as Get an automation run takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "automationId",
                                  "automationRunId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A trade the agent made.",
                                    "enum": [
                                      "trade"
                                    ]
                                  },
                                  "tradeId": {
                                    "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, as Get a trade takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "tradeId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A swap the user made in the agent wallet.",
                                    "enum": [
                                      "swap"
                                    ]
                                  },
                                  "swapId": {
                                    "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 swap's id, as Get a swap takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "swapId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A buy or a sale of a Solana token, by the user on its page or by the agent.",
                                    "enum": [
                                      "solana_trade"
                                    ]
                                  },
                                  "tradeId": {
                                    "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": "For a trade the user placed on the token's page, its id as Get a Solana trade takes it; for one the agent made, the id of its `solana` item in List activity."
                                  }
                                },
                                "required": [
                                  "type",
                                  "tradeId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A Polymarket order.",
                                    "enum": [
                                      "prediction_order"
                                    ]
                                  },
                                  "orderId": {
                                    "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 order's id, as Get a prediction order takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "orderId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A limit order.",
                                    "enum": [
                                      "order"
                                    ]
                                  },
                                  "orderId": {
                                    "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 order's id, as Get a limit order takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "orderId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A deposit into the agent wallet.",
                                    "enum": [
                                      "deposit"
                                    ]
                                  },
                                  "depositId": {
                                    "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 deposit's id, as Get a deposit takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "depositId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A transfer to a deposit address.",
                                    "enum": [
                                      "deposit_address"
                                    ]
                                  },
                                  "depositAddressId": {
                                    "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 deposit address's id, as Get a deposit address takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "depositAddressId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A withdrawal from the agent wallet.",
                                    "enum": [
                                      "withdrawal"
                                    ]
                                  },
                                  "withdrawalId": {
                                    "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 withdrawal's id, as Get a withdrawal takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "withdrawalId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "An automation as a whole.",
                                    "enum": [
                                      "automation"
                                    ]
                                  },
                                  "automationId": {
                                    "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 automation's id."
                                  }
                                },
                                "required": [
                                  "type",
                                  "automationId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "fin's reply in a conversation.",
                                    "enum": [
                                      "conversation"
                                    ]
                                  },
                                  "conversationId": {
                                    "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."
                                  },
                                  "runId": {
                                    "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 that replied."
                                  }
                                },
                                "required": [
                                  "type",
                                  "conversationId",
                                  "runId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A market story fin's news desk is carrying.",
                                    "enum": [
                                      "story"
                                    ]
                                  },
                                  "storyId": {
                                    "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 story's id, as Get a market story takes it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "storyId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "A coin or token the user holds.",
                                    "enum": [
                                      "asset"
                                    ]
                                  },
                                  "assetId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 256,
                                    "description": "The asset's NEAR Intents asset id, or `solana:<mint>` for a Solana token."
                                  }
                                },
                                "required": [
                                  "type",
                                  "assetId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "description": "The user's money over one week, as fin looked at it.",
                                    "enum": [
                                      "week"
                                    ]
                                  },
                                  "weekOf": {
                                    "type": "string",
                                    "format": "date",
                                    "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])))$",
                                    "description": "The Monday the week began, as an ISO date."
                                  }
                                },
                                "required": [
                                  "type",
                                  "weekOf"
                                ]
                              }
                            ],
                            "description": "What the notification is about. Open its page when the user opens the notification."
                          },
                          "tokenId": {
                            "description": "The token the notification is about, to draw its icon beside the text: what a trade or order bought (or sold, when it received dollars), or what a deposit brought or a withdrawal sent. A NEAR Intents asset id, or `solana:<mint>` for a Solana token. Absent for the other kinds, and when Fin cannot name the token.",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256
                          },
                          "status": {
                            "description": "For an approval or a question: `waiting` while the user can still answer, `expired` once it ran out, `done` once it was answered. `waiting` also marks an `automation_attention` for an automation fin paused until its owner acts, which has no `expiresAt` and reads `done` once they have. Absent otherwise.",
                            "type": "string",
                            "enum": [
                              "waiting",
                              "expired",
                              "done"
                            ]
                          },
                          "action": {
                            "description": "On an automation fin paused for its owner (`status` `waiting`), what moves it on: `add_funds` or `edit_automation`. Absent when the owner moves it on from the automation's page, by a choice or by resuming it, and on every other notification.",
                            "type": "string",
                            "enum": [
                              "add_funds",
                              "edit_automation"
                            ]
                          },
                          "expiresAt": {
                            "description": "For an approval or a question that is waiting: when it runs out.",
                            "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))$"
                          },
                          "options": {
                            "description": "Ways to act on one of fin's own notices (`holding_move`, `market_story`, `weekly_look`), best first. Show them where the user opens the notification, never in a push or on a lock screen, under a line saying they are options, not recommendations, and that doing nothing is fine. Absent on every other notification.",
                            "minItems": 1,
                            "maxItems": 3,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/NotificationOption"
                            }
                          },
                          "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 it happened."
                          },
                          "readAt": {
                            "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 user read it, or when its approval or question was answered or ran out; null while unread."
                          },
                          "userId": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                            "description": "Your identifier for this user: unique within your partner, 1-128 characters of letters, digits, `.`, `_`, `:` or `-`, starting with a letter or digit. It appears in URLs, so never use an email address or other personal data."
                          },
                          "push": {
                            "type": "boolean",
                            "description": "Whether to show it on the user's devices now: true unless the user already saw it, or its approval or question was answered or ran out while it waited."
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "category",
                          "tone",
                          "title",
                          "body",
                          "withoutAmounts",
                          "subject",
                          "createdAt",
                          "readAt",
                          "userId",
                          "push"
                        ]
                      },
                      "description": "Your users' notifications, oldest first."
                    },
                    "nextCursor": {
                      "type": "string",
                      "description": "Where this page ended. Keep it, and pass it back as `after` on your next call, even when this page was empty."
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenForRegistration"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/suggestions": {
      "get": {
        "operationId": "suggestions.list",
        "summary": "List suggestions",
        "tags": [
          "suggestions"
        ],
        "description": "Returns what Fin suggests for one page of your app, best first: moves on the user's own orders, automations and money, each with the exact terms its review draws. Fin reads the whole account in the background whenever it changes, so this answers at once and never waits on the model: `thinking` means Fin is reading an account it has nothing saved for yet, so read again in a few seconds; `updating` means a newer read is under way while these still hold. Send `timeZone`, `country` and `perpsAllowed` with every read; they apply to this read only. When `status` is `failed` and `retryable` is false, the user's AI spending limit or the hourly limit stopped Fin from looking: say so, and offer no Try again.",
        "parameters": [
          {
            "schema": {
              "default": "home",
              "type": "string",
              "pattern": "^(home|orders|automations|swap|earn|asset:asset_[a-f0-9]{64})$"
            },
            "in": "query",
            "name": "surface",
            "required": false,
            "description": "The page asking; `home` by default."
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 64,
              "pattern": "^[A-Za-z][\\w+-]*(?:\\/[\\w+-]+)*$"
            },
            "in": "query",
            "name": "timeZone",
            "required": false,
            "description": "The user's time zone as an IANA name, such as `America/New_York`: dates in titles, reasons and new schedules read in it. Without it they read in UTC, and Fin suggests no new schedule."
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            },
            "in": "query",
            "name": "country",
            "required": false,
            "description": "The country the user is reading from, as an uppercase ISO 3166-1 alpha-2 code your server resolved, never the browser's word. A move on a tokenized stock shows only where stocks are available; without it, none shows."
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "in": "query",
            "name": "perpsAllowed",
            "required": false,
            "description": "`true` when your app lets this user fund perpetuals where they are now; without it, no perps move shows."
          },
          {
            "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": "What Fin suggests for this page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageSuggestions"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/suggestions/{suggestionId}/review": {
      "get": {
        "operationId": "suggestions.review",
        "summary": "Get a suggestion's review",
        "tags": [
          "suggestions"
        ],
        "description": "Checks one suggestion again against the account as it is now and returns it with fresh review terms. Call it when the user opens a suggestion's review, then draw the review from `review` and confirm the move through the routes that make it. When the suggestion no longer holds (the account or the price moved, the user set it aside, or it cannot be made where the user is now), it answers `409 suggestion_changed`: say it changed since Fin suggested it, and read the page's suggestions again.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "maxLength": 64,
              "pattern": "^[A-Za-z][\\w+-]*(?:\\/[\\w+-]+)*$"
            },
            "in": "query",
            "name": "timeZone",
            "required": false,
            "description": "The user's time zone as an IANA name, such as `America/New_York`: dates in titles, reasons and new schedules read in it. Without it they read in UTC, and Fin suggests no new schedule."
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            },
            "in": "query",
            "name": "country",
            "required": false,
            "description": "The country the user is reading from, as an uppercase ISO 3166-1 alpha-2 code your server resolved, never the browser's word. A move on a tokenized stock shows only where stocks are available; without it, none shows."
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "in": "query",
            "name": "perpsAllowed",
            "required": false,
            "description": "`true` when your app lets this user fund perpetuals where they are now; without it, no perps move shows."
          },
          {
            "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."
          },
          {
            "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": "path",
            "name": "suggestionId",
            "required": true,
            "description": "The suggestion's `id`, from List suggestions."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The suggestion, checked again, with fresh terms.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuggestedMove"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `suggestion_changed` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/suggestions/{suggestionId}/dismiss": {
      "post": {
        "operationId": "suggestions.dismiss",
        "summary": "Dismiss a suggestion",
        "tags": [
          "suggestions"
        ],
        "description": "Sets a suggestion aside when the user picks Not now: Fin stops suggesting that kind of move on that order, automation or asset until it changes or seven days pass, and its next reads leave it out. Safe to repeat.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "suggestionId",
            "required": true,
            "description": "The suggestion's `id`, from List suggestions."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "204": {
            "description": "The suggestion is set aside."
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/trades/{tradeId}/remaining-actions": {
      "get": {
        "operationId": "wallets.getRemainingTradeActions",
        "summary": "Read current remaining actions",
        "tags": [
          "wallets"
        ],
        "description": "Reads current proof-backed recovery candidates after settlement observations change. Indices are local frozen-leg positions. A recovery child's existing original-action map identifies its root. This read reserves nothing, creates no review and moves no funds; fresh proposal preparation rechecks all proof under lock.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "tradeId",
            "required": true,
            "description": "The trade's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current recovery candidates for this owned trade.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "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)$"
                    },
                    "candidates": {
                      "maxItems": 16,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 15
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "unclaimed",
                              "refunded",
                              "not_executed"
                            ]
                          }
                        },
                        "required": [
                          "index",
                          "kind"
                        ]
                      }
                    }
                  },
                  "required": [
                    "operationId",
                    "candidates"
                  ]
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/trades/{tradeId}/remaining-proposal": {
      "post": {
        "operationId": "wallets.prepareRemainingTrade",
        "summary": "Review remaining actions",
        "tags": [
          "wallets"
        ],
        "description": "Prepares a fresh review of unfinished actions in this root trade's original conversation. A fresh Idempotency-Key permits a new business attempt only after conclusive refund or non-execution proof; an already settled or uncertain action is never repeated. Selection includes unfinished prerequisites and descendants while independent successful branches stay excluded. Show every returned action and obtain its fresh signature. Different terms conflict while a review is active. Exact-input debits and exact-output swap targets stay fixed; current prices can change receive amounts or input ceilings. Explicit payout minimums stay enforced. The original grant and its spent signatures never change.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "originalIndices": {
                    "description": "Original frozen plan positions, zero-based. Omit to review every eligible unfinished branch. A selected failed node includes its unfinished dependencies and descendants. A prior claim is eligible only with conclusive not-executed or final-refund evidence; settled or unresolved claims cannot be replaced. The new proposal rechecks current funds and requires fresh approval.",
                    "minItems": 1,
                    "maxItems": 16,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 15
                    }
                  },
                  "maxValueLossBps": {
                    "description": "An explicitly chosen all-in loss limit for the new review, in basis points as an integer string. It must be at least the original limit. A higher limit replaces only the original derived price floor; an explicitly requested minimum receive remains enforced. The returned approval still needs the user's signature.",
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "tradeId",
            "required": true,
            "description": "The trade's id."
          },
          {
            "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)$"
            },
            "example": "d5565100-9342-4bc6-a803-b387a20cb536",
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "description": "A UUID for this fresh review intent. Retry the same key and body to get its original proposal; a changed body is refused. Choose a new key for a new review after a prior review closes. Without a key, matching active or claimed selections retain the older replay behavior."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "202": {
            "description": "The complete remaining-action proposal and its fresh approval run.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "proposalId": {
                      "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)$"
                    },
                    "originalTradeId": {
                      "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)$"
                    },
                    "originalIndices": {
                      "minItems": 1,
                      "maxItems": 16,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "fingerprint": {
                      "type": "string"
                    },
                    "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))$"
                    },
                    "request": {
                      "type": "object",
                      "properties": {
                        "actions": {
                          "minItems": 1,
                          "maxItems": 16,
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "description": "Exchange one asset for another; custody never leaves the agent wallet.",
                                    "enum": [
                                      "swap"
                                    ]
                                  },
                                  "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",
                                            "description": "Spend an exact amount of the input token.",
                                            "enum": [
                                              "exact_input_tokens"
                                            ]
                                          },
                                          "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",
                                            "description": "Spend a USD-denominated value of the input token.",
                                            "enum": [
                                              "exact_input_value_usd"
                                            ]
                                          },
                                          "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",
                                            "description": "Receive an exact amount of the output token.",
                                            "enum": [
                                              "exact_output_tokens"
                                            ]
                                          },
                                          "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",
                                            "description": "Spend everything the agent wallet holds of the input asset.",
                                            "enum": [
                                              "all_of_input"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "kind"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "kind": {
                                            "type": "string",
                                            "description": "Spend a fraction of the input asset.",
                                            "enum": [
                                              "fraction_of_input"
                                            ]
                                          },
                                          "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",
                                            "description": "Sell a fraction of this automation's own position in the input asset.",
                                            "enum": [
                                              "fraction_of_position"
                                            ]
                                          },
                                          "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",
                                            "description": "Sell only the gain on this automation's own position in the input asset.",
                                            "enum": [
                                              "gain_of_position"
                                            ]
                                          }
                                        },
                                        "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",
                                    "description": "Return an asset to the account that owns the agent wallet.",
                                    "enum": [
                                      "withdraw_to_owner"
                                    ]
                                  },
                                  "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",
                                            "description": "Spend an exact amount of the input token.",
                                            "enum": [
                                              "exact_input_tokens"
                                            ]
                                          },
                                          "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",
                                            "description": "Spend a USD-denominated value of the input token.",
                                            "enum": [
                                              "exact_input_value_usd"
                                            ]
                                          },
                                          "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",
                                            "description": "Receive an exact amount of the output token.",
                                            "enum": [
                                              "exact_output_tokens"
                                            ]
                                          },
                                          "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",
                                            "description": "Spend everything the agent wallet holds of the input asset.",
                                            "enum": [
                                              "all_of_input"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "kind"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "kind": {
                                            "type": "string",
                                            "description": "Spend a fraction of the input asset.",
                                            "enum": [
                                              "fraction_of_input"
                                            ]
                                          },
                                          "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",
                                            "description": "Sell a fraction of this automation's own position in the input asset.",
                                            "enum": [
                                              "fraction_of_position"
                                            ]
                                          },
                                          "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",
                                            "description": "Sell only the gain on this automation's own position in the input asset.",
                                            "enum": [
                                              "gain_of_position"
                                            ]
                                          }
                                        },
                                        "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",
                                    "description": "Pay the exact approved destination through the provider’s chain or Intents transfer route.",
                                    "enum": [
                                      "withdraw_transfer"
                                    ]
                                  },
                                  "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",
                                            "description": "Spend an exact amount of the input token.",
                                            "enum": [
                                              "exact_input_tokens"
                                            ]
                                          },
                                          "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",
                                            "description": "Spend a USD-denominated value of the input token.",
                                            "enum": [
                                              "exact_input_value_usd"
                                            ]
                                          },
                                          "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",
                                            "description": "Receive an exact amount of the output token.",
                                            "enum": [
                                              "exact_output_tokens"
                                            ]
                                          },
                                          "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",
                                            "description": "Spend everything the agent wallet holds of the input asset.",
                                            "enum": [
                                              "all_of_input"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "kind"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "kind": {
                                            "type": "string",
                                            "description": "Spend a fraction of the input asset.",
                                            "enum": [
                                              "fraction_of_input"
                                            ]
                                          },
                                          "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",
                                            "description": "Sell a fraction of this automation's own position in the input asset.",
                                            "enum": [
                                              "fraction_of_position"
                                            ]
                                          },
                                          "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",
                                            "description": "Sell only the gain on this automation's own position in the input asset.",
                                            "enum": [
                                              "gain_of_position"
                                            ]
                                          }
                                        },
                                        "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",
                                  "enum": [
                                    "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"
                      ]
                    },
                    "run": {
                      "$ref": "#/components/schemas/Run"
                    }
                  },
                  "required": [
                    "proposalId",
                    "originalTradeId",
                    "originalIndices",
                    "fingerprint",
                    "expiresAt",
                    "request",
                    "run"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `trade_not_recoverable` — 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- `request_key_conflict` — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request\n- `run_active` — a run already holds this conversation",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "410": {
            "description": "The resource still exists and stays readable, but can no longer take this request.\n\n- `conversation_deleted` — the conversation was deleted; its history stays readable",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "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\n- `budget_exhausted` — 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- `execution_capacity` — no capacity is free to run this right now; honour `Retry-After`\n- `partner_run_capacity` — this partner's active run quota is full; honour Retry-After and reuse the same request identity",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `execution_unavailable` — the service that runs the agent could not take the work; `retryable` says whether to try again\n- `deployment_paused` — an operator paused this kind of work for the deployment; try again later",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/trades": {
      "get": {
        "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"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/trades/{tradeId}": {
      "get": {
        "operationId": "wallets.getTrade",
        "summary": "Get a trade",
        "tags": [
          "wallets"
        ],
        "description": "Returns a trade and its `status`: what the agent asked for, who approved it, the plan it ran and the result of each step. A finished run or a granted approval does not mean the trade settled; its `status` does. While it is `pending`, `processing` or `uncertain` it can still change: check again, and never ask the agent for a replacement.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "tradeId",
            "required": true,
            "description": "The trade's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The trade and its status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletTrade"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/orders/prepare": {
      "post": {
        "operationId": "wallets.prepareOrder",
        "summary": "Prepare an order",
        "tags": [
          "wallets"
        ],
        "description": "Step 1 of placing a limit order. Checks the order against the agent wallet and returns its exact `terms`: what it sells, what it buys, the least it sells at, how long it rests, and `minimumReceivedRaw`, the least the whole order receives at its limit price. Also returns `authorization.message` for the user to sign and the `requestKey` to send as the `Idempotency-Key`. Use it for an order the user places from your own screen; the agent proposes its own orders in chat. Nothing is reserved or placed. Call Place an order before `authorization.expiresAt`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderRequestInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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": "The order's terms, the message to sign and the request key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreparedOrder"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `asset_not_tradable` — 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- `limit_orders_disabled` — limit orders are not enabled for this user\n- `agent_api_orders_unavailable` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `order_changed` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/orders": {
      "post": {
        "operationId": "wallets.placeOrder",
        "summary": "Place an order",
        "tags": [
          "wallets"
        ],
        "description": "Step 2 of placing a limit order. Places the prepared order in the agent wallet, funded with the amount it sells: it rests until it fills at the limit price or better, expires or is cancelled, and what it buys comes back to the agent wallet. Send the prepared `terms`, the user's signature of its `authorization.message`, and its `requestKey` as the `Idempotency-Key` header. Returns the order: `funded` once it rests, or `abandoned` with a `failureReason` when nothing was placed. Follow its fills with Get a limit order. If this call times out, send it again unchanged: you get the same order back, never a second one.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaceOrderInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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."
          },
          {
            "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)$"
            },
            "example": "d5565100-9342-4bc6-a803-b387a20cb536",
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "description": "The prepared order's `requestKey`, which the user's signature names. Send the same key and body again to retry safely: you get the same order back, never a second one. A different body under the same key is refused with `request_key_conflict`."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The order and its current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletOrder"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `asset_not_tradable` — 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- `limit_orders_disabled` — limit orders are not enabled for this user\n- `agent_api_orders_unavailable` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `order_changed` — 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- `request_key_conflict` — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "wallets.listOrders",
        "summary": "List limit orders",
        "tags": [
          "wallets"
        ],
        "description": "Lists the user's limit orders, newest first: the approved terms, whether the order is funded, how much has filled, and any cancellation. After a timed-out Place an order, find its order by filtering on `requestKey`.",
        "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": "requestKey",
            "required": false,
            "description": "Only the order placed with this `Idempotency-Key`: how to find it after Place an order timed out."
          },
          {
            "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 limit orders.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WalletOrder"
                      },
                      "description": "This page's rows."
                    },
                    "nextCursor": {
                      "description": "The cursor for the next page; null once there are no more rows.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "description": "How many rows the list holds in all, when it is known.",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/orders/{orderId}": {
      "get": {
        "operationId": "wallets.getOrder",
        "summary": "Get a limit order",
        "tags": [
          "wallets"
        ],
        "description": "Returns a limit order and its current state. `unconfirmed` means the provider's answer was lost; never place a replacement, keep checking.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "orderId",
            "required": true,
            "description": "The order's `id` (not the provider's `orderId`)."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The limit order.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletOrder"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/orders/{orderId}/cancel": {
      "post": {
        "operationId": "wallets.cancelOrder",
        "summary": "Cancel a limit order",
        "tags": [
          "wallets"
        ],
        "description": "Asks 1Click to cancel one of the user's limit orders, for a cancel button on your own orders screen; the agent cancels through an approval in chat instead. Returns the order with `cancelRequestedAt` set: what filled stays filled, and cancellation can race a final fill. Read the order for its terminal fill status and `position`: canceled or expired input stops resting, while refund principal and provider payout completion remain separate from net wallet reconciliation. Asking again is safe, and answers the order as it stands.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "orderId",
            "required": true,
            "description": "The order's `id` (not the provider's `orderId`)."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The order, with the cancellation requested.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletOrder"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `order_not_cancelable` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/grids": {
      "get": {
        "operationId": "wallets.listGrids",
        "summary": "List grids",
        "tags": [
          "wallets"
        ],
        "description": "Lists the user's grids, newest first: each grid's state, the terms the user approved, every cell's current order, completed buy-then-sell cycles and realized profit. A grid starts when the user approves one in chat; follow a single grid with Get a grid.",
        "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",
              "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 grids.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Grid"
                      },
                      "description": "This page's rows."
                    },
                    "nextCursor": {
                      "description": "The cursor for the next page; null once there are no more rows.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "description": "How many rows the list holds in all, when it is known.",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/grids/{gridId}": {
      "get": {
        "operationId": "wallets.getGrid",
        "summary": "Get a grid",
        "tags": [
          "wallets"
        ],
        "description": "Returns one grid as it stands: its state, approved terms, cells with their current orders, cycles, realized profit and the base it holds. Each cell order's `id` reads with Get a limit order for its fills and payouts.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "gridId",
            "required": true,
            "description": "The grid's `id`."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The grid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Grid"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/grids/{gridId}/pause": {
      "post": {
        "operationId": "wallets.pauseGrid",
        "summary": "Pause a grid",
        "tags": [
          "wallets"
        ],
        "description": "Stops a running grid placing orders and cancels the orders its cells rest, keeping its approval and each cell's side, so Resume a grid can start it again. Only an `active` grid can be paused. Cancellation is asynchronous: a last order may still fill, and the grid's cells show each order until it ends.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "gridId",
            "required": true,
            "description": "The grid's `id`."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The grid, updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Grid"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `grid_not_active` — the grid is not running, so it cannot be paused: it is already paused, stopping or ended. Read the grid for where it stands",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "410": {
            "description": "The resource still exists and stays readable, but can no longer take this request.\n\n- `grid_ended` — the grid stopped, expired or failed; it stays readable but takes no command. A new grid needs the user's approval in chat",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/grids/{gridId}/resume": {
      "post": {
        "operationId": "wallets.resumeGrid",
        "summary": "Resume a grid",
        "tags": [
          "wallets"
        ],
        "description": "Starts a paused grid again under the approval it already has: each cell places its order again on the side it was on, until the grid's original end. Only a `paused` grid with at least an hour left can be resumed, and only while grid trading is on for the user.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "gridId",
            "required": true,
            "description": "The grid's `id`."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The grid, updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Grid"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `grid_trading_disabled` — grid trading is not enabled for this user, so a paused grid cannot be resumed; pausing and cancelling a grid are never gated",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `grid_not_paused` — the grid is not paused, so there is nothing to resume. Read the grid for where it stands",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "410": {
            "description": "The resource still exists and stays readable, but can no longer take this request.\n\n- `grid_ended` — the grid stopped, expired or failed; it stays readable but takes no command. A new grid needs the user's approval in chat",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/wallet/grids/{gridId}/cancel": {
      "post": {
        "operationId": "wallets.cancelGrid",
        "summary": "Cancel a grid",
        "tags": [
          "wallets"
        ],
        "description": "Stops a grid for good: cancels every order its cells rest and withdraws its approval. Nothing is sold; what it bought stays in the agent wallet. The grid answers `stopping` until its last order ends, then `stopped`. Cancelling a grid the user already cancelled answers it as it stands, so asking again is safe. A changed grid is a new approval in chat.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "gridId",
            "required": true,
            "description": "The grid's `id`."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The grid, updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Grid"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `grid_not_active` — the grid is not running, so it cannot be paused: it is already paused, stopping or ended. Read the grid for where it stands",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "410": {
            "description": "The resource still exists and stays readable, but can no longer take this request.\n\n- `grid_ended` — the grid stopped, expired or failed; it stays readable but takes no command. A new grid needs the user's approval in chat",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/conversations/{conversationId}/stream": {
      "get": {
        "operationId": "events.stream",
        "summary": "Stream a conversation's events",
        "tags": [
          "events"
        ],
        "description": "Opens a server-sent events stream for one conversation. It first replays saved events after `cursor` (`0` for all of them), then sends new events as they happen, including the agent's reply as it is written. After a disconnect, reconnect with the last event id in `Last-Event-ID` or `?cursor=`. Live text (`agent.text_delta`) is not saved: replace it with the final message when `agent.entry` arrives.",
        "parameters": [
          {
            "schema": {
              "default": 0,
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "in": "query",
            "name": "cursor",
            "required": false,
            "description": "Replay saved events after this `seq`; omit it or send 0 to replay all of them. A `Last-Event-ID` header takes precedence on reconnect."
          },
          {
            "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."
          },
          {
            "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": "path",
            "name": "conversationId",
            "required": true,
            "description": "The conversation's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "A `text/event-stream` of conversation events. Each frame's SSE `id` is the event's `seq` (saved events only), `event` is the `FinEvent` type, and `data` is `{ delivery, seq, payload }`: `delivery: \"durable\"` for a saved event (with `seq` and `requestId`), or `delivery: \"live\"` for live-only text such as `agent.text_delta` (no `seq`, never replayed). Resume with the `Last-Event-ID` header or `?cursor=`.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "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\n- `stream_capacity` — the partner, user or replica has no free stream capacity; honour `Retry-After`",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/runs": {
      "post": {
        "operationId": "runs.start",
        "summary": "Start a run",
        "tags": [
          "runs"
        ],
        "description": "Sends the user's message to the agent in a conversation and starts it working. Answers `202` with the run at once; the agent works in the background. Follow it on the conversation's event stream, or poll Get a run until `status` is `completed`, `failed` or `aborted`. If the agent needs the user's approval for an action, the run pauses (`paused`) until you approve or deny it. Send an `Idempotency-Key` header to make a retry safe: the same key returns the same run instead of starting another.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "conversationId": {
                    "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 to send the message to."
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 32768,
                    "description": "The user's message to the agent, up to 32768 characters."
                  },
                  "profile": {
                    "type": "object",
                    "properties": {
                      "tools": {
                        "description": "The only tools this run may reach. Absent means every registered tool.",
                        "maxItems": 64,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_]{0,63}$",
                          "description": "A tool's name: lowercase, starting with a letter, letters, digits and underscores only."
                        }
                      },
                      "outputContract": {
                        "description": "The strict terminal output contract validated and frozen during admission.",
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_]{0,63}$",
                            "description": "A tool's name: lowercase, starting with a letter, letters, digits and underscores only."
                          },
                          "description": {
                            "description": "What the terminal result means, shown beside the run's output.",
                            "type": "string",
                            "maxLength": 4096
                          },
                          "schema": {
                            "description": "A bounded, strict JSON Schema object (`type: \"object\"`, `additionalProperties: false`) the run's terminal output must satisfy."
                          }
                        },
                        "required": [
                          "name",
                          "schema"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false,
                    "description": "Bounds on this run beyond its seed text: which tools it may reach, and its terminal output contract."
                  },
                  "context": {
                    "type": "object",
                    "properties": {
                      "timeZone": {
                        "description": "The user's time zone as an IANA name, such as `America/New_York`: in a browser, `Intl.DateTimeFormat().resolvedOptions().timeZone`. The agent reads times in this message, like 9am, in this zone; without it, the agent asks the user.",
                        "type": "string",
                        "maxLength": 64,
                        "pattern": "^[A-Za-z][\\w+-]*(?:\\/[\\w+-]+)*$"
                      },
                      "renders": {
                        "description": "What your app draws itself from this conversation, so the agent leaves those facts to it instead of repeating them: `receipts` for trades from `intents.settlement` events, `automations` for an automation from the automation tools' results, `balances` for the agent wallet from `intents_balances` results, `orders` for limit orders from the order tools' results, `contacts` for the user's saved contacts from `contacts_list` results, `grids` for grids from the `grid_create` and `intents_grids` results, and `research` for the research reads (`market_sentiment`, `market_derivatives`, `market_news`, `market_screen`, `macro_series` and `protocol_fundamentals`) from their results. Add `placement` when your app draws a read's card only where the reply places it: the agent then writes each finding as soon as it has it and puts a `[card r7k2q]` line after the sentence the card supports, naming the card from that read's call id (`replyCardName`), at most three a turn. Add `show` when your app draws a read's card where the agent's `show_cards` call stands instead (as `threadTurns` does): the agent is then offered `show_cards`, which names up to three cards a turn by the same names and writes no card line; a message that carries `show` ignores `placement`. Add `solana_sell_many` when your app draws a multi-coin Solana sale's approval card and outcome: only then is the agent offered the `solana_sell_many` tool, which sells two to six Solana coins under one approval; without it the agent proposes one `solana_sell` per coin. Add `deposit` when your app draws a deposit the user can make in place from a `deposit_request` result (what is missing for their request: `purpose`, `symbol`, `needed`, `held`, `short`): only then is the agent offered `deposit_request`, which it calls when the agent wallet cannot cover what the user asked for; without it the agent says what is missing in words. Add `share` when your app lets the user share an answer publicly: the agent then ends an answer that reports what it read with a `share` fenced block of up to three lines a stranger can read with only the question beside them (the finding first, then what backs it with its figures, never the user's own), which `splitReplyNextSteps` returns as `shareLines` and leaves out of the body. Leave `placement` and `show` out when your app shows only the agent's text: the agent then sums each one up in a line or two.",
                        "maxItems": 12,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "receipts",
                            "automations",
                            "balances",
                            "orders",
                            "contacts",
                            "research",
                            "placement",
                            "show",
                            "solana_sell_many",
                            "deposit",
                            "share",
                            "grids"
                          ]
                        }
                      },
                      "contacts": {
                        "description": "The user's saved contacts, up to 200 and 64 KiB, so the agent can find \"Alice\" when the user asks to pay her. Send them from your server with every message: the agent reads only this message's contacts, and without them it asks the user for an address. Names and addresses are user-entered and treated as untrusted data. A contact authorizes nothing: the user still approves the exact address and network on the approval card.",
                        "maxItems": 200,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128,
                              "pattern": "^[\\x21-\\x7e]+$",
                              "description": "Your app's id for this contact."
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "description": "The name the user saved, up to 64 characters."
                            },
                            "address": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128,
                              "pattern": "^[\\x21-\\x7e]+$",
                              "description": "The saved address, exactly as stored, such as `alice.near` or `0x…`."
                            },
                            "network": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 32,
                              "pattern": "^[a-z0-9][a-z0-9_-]*$",
                              "description": "The network the address is on, as your app names it: `eth`, `base`, `near`, `solana` or `near_intents`."
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "address",
                            "network"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "perpsAllowed": {
                        "description": "Whether your app allows this user to open or increase perpetuals exposure in their current region. Send a boolean with each message that may fund perpetuals; without true, funding is refused. Exits remain available. The latest reported value is saved per user, and a retry must send the original value.",
                        "type": "boolean"
                      },
                      "country": {
                        "description": "The country the user is sending this message from, as an uppercase ISO 3166-1 alpha-2 code such as `GB`, resolved by your server from the request (your edge's IP geolocation), never taken from the browser. Tokenized stocks are offered only to a message that reports a country where they are available; without it the agent cannot trade them.",
                        "type": "string",
                        "pattern": "^[A-Z]{2}$"
                      }
                    },
                    "additionalProperties": false,
                    "description": "What the user's app knows about the user as they send this message. It applies to this message only, so send it with every message."
                  }
                },
                "required": [
                  "conversationId",
                  "text"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "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."
          },
          {
            "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)$"
            },
            "example": "d5565100-9342-4bc6-a803-b387a20cb536",
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "description": "Optional. A UUID you generate for this request. Send the same key and the same body to retry it safely: you get the original result back, never a second one. Without it, a retry creates a second one."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "202": {
            "description": "The run, just started; the same run again when this `Idempotency-Key` already started one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                }
              }
            }
          },
          "400": {
            "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\n- `profile_unknown_tool` — `profile.tools` names a tool this deployment does not have",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `request_key_conflict` — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request\n- `run_active` — a run already holds this conversation\n- `stop_pending` — a stop is already in progress and its cleanup is not yet confirmed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "410": {
            "description": "The resource still exists and stays readable, but can no longer take this request.\n\n- `conversation_deleted` — the conversation was deleted; its history stays readable",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "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\n- `budget_exhausted` — 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- `execution_capacity` — no capacity is free to run this right now; honour `Retry-After`\n- `partner_run_capacity` — this partner's active run quota is full; honour Retry-After and reuse the same request identity",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `execution_unavailable` — the service that runs the agent could not take the work; `retryable` says whether to try again\n- `deployment_paused` — an operator paused this kind of work for the deployment; try again later",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "runs.list",
        "summary": "List runs",
        "tags": [
          "runs"
        ],
        "description": "Lists the user's runs, newest first. Filter by `conversationId` for one conversation's runs. Each run carries the user's `feedback` on its reply, so one call shows a thread's feedback.",
        "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": "conversationId",
            "required": false,
            "description": "Only this conversation's runs; omit for all of the user's runs."
          },
          {
            "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 runs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Run"
                      },
                      "description": "This page's rows."
                    },
                    "nextCursor": {
                      "description": "The cursor for the next page; null once there are no more rows.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "description": "How many rows the list holds in all, when it is known.",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/runs/{runId}": {
      "get": {
        "operationId": "runs.get",
        "summary": "Get a run",
        "tags": [
          "runs"
        ],
        "description": "Returns a run's status, reply, pending approvals, and pending questions, and the user's `feedback` on the reply once they have sent it. A run keeps its id while it pauses for input or approval and resumes.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "runId",
            "required": true,
            "description": "The run's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/runs/{runId}/steer": {
      "post": {
        "operationId": "runs.steer",
        "summary": "Steer a run",
        "tags": [
          "runs"
        ],
        "description": "Sends the user's new message to a run that is still working, so the agent reads it at its next step instead of after the run ends. Use it for a correction or an addition while the agent works; once a run has ended, send the next message with Start a run. Answers `202` with the run: the message is in `steers` as `pending`, and the `run.steered` event marks where the agent read it. If the run is waiting on an approval or a questionnaire, the message declines or skips it and the run continues with the message; it never approves anything. A run that ended or is finishing answers `409 run_not_active` and the message is dropped: send it with Start a run instead. Send an `Idempotency-Key` header to make a retry safe.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 32768,
                    "description": "The user's new message for the working agent, up to 32768 characters."
                  }
                },
                "required": [
                  "text"
                ],
                "additionalProperties": false
              },
              "example": {
                "text": "Use 50 USDC instead of 100."
              }
            }
          }
        },
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "runId",
            "required": true,
            "description": "The run's id."
          },
          {
            "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)$"
            },
            "example": "d5565100-9342-4bc6-a803-b387a20cb536",
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "description": "Optional. A UUID you generate for this request. Send the same key and the same body to retry it safely: you get the original result back, never a second one. Without it, a retry creates a second one."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "202": {
            "description": "The run, with the message in its `steers`; the same run again when this `Idempotency-Key` already sent it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `steering_disabled` — steering a working run is not turned on for this user; send the message with Start a run once the run ends",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `run_not_active` — the run named in the path is not the conversation's live run\n- `request_key_conflict` — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "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\n- `execution_capacity` — no capacity is free to run this right now; honour `Retry-After`\n- `partner_run_capacity` — this partner's active run quota is full; honour Retry-After and reuse the same request identity",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `execution_unavailable` — the service that runs the agent could not take the work; `retryable` says whether to try again\n- `deployment_paused` — an operator paused this kind of work for the deployment; try again later",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/runs/{runId}/cancel": {
      "post": {
        "operationId": "runs.cancel",
        "summary": "Cancel a run",
        "tags": [
          "runs"
        ],
        "description": "Stops a run that is in progress or paused, and returns it once it has stopped. Its status is then `aborted`, or the status it reached first if it finished at the same moment. A run that has already ended cannot be cancelled and answers `409 run_not_active`.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "runId",
            "required": true,
            "description": "The run's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The run, stopped.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `run_not_active` — the run named in the path is not the conversation's live run\n- `stop_pending` — a stop is already in progress and its cleanup is not yet confirmed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `execution_unavailable` — the service that runs the agent could not take the work; `retryable` says whether to try again",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/runs/{runId}/feedback": {
      "put": {
        "operationId": "runs.sendFeedback",
        "summary": "Send run feedback",
        "tags": [
          "runs"
        ],
        "description": "Sends the user's feedback on a run's reply: `up` for a thumbs-up, or `down` for a thumbs-down with an optional `reason` from a fixed list. Call it when the user taps a thumb, once the run has ended (`completed`, `failed` or `aborted`); a run still working or waiting answers `409 run_active`. Sending again replaces the earlier feedback, so it is also how the user changes it, and a retry is safe. Answers the feedback, which Get a run returns as `feedback` from then on; Delete run feedback removes it. A `reason` goes with `down` only: with `up` the request is refused with `400 invalid_input`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rating": {
                    "$ref": "#/components/schemas/RunFeedbackRatingInput"
                  },
                  "reason": {
                    "$ref": "#/components/schemas/RunFeedbackReasonInput"
                  }
                },
                "required": [
                  "rating"
                ],
                "additionalProperties": false
              },
              "example": {
                "rating": "down",
                "reason": "wrong"
              }
            }
          }
        },
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "runId",
            "required": true,
            "description": "The run's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The feedback as it now stands.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunFeedback"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `run_active` — a run already holds this conversation",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "delete": {
        "operationId": "runs.deleteFeedback",
        "summary": "Delete run feedback",
        "tags": [
          "runs"
        ],
        "description": "Deletes the user's feedback on a run's reply, so `feedback` on Get a run is `null` again. Call it when the user taps the thumb they already chose. Safe to repeat: a run with no feedback answers the same way.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "runId",
            "required": true,
            "description": "The run's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "204": {
            "description": "The feedback is deleted."
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/voice": {
      "get": {
        "operationId": "voice.get",
        "summary": "Get voice input",
        "tags": [
          "voice"
        ],
        "description": "Says whether the user can talk to their agent instead of typing, and the limits a recording keeps to: its longest length, its largest size and the audio types it may be. Use it before showing a microphone: show one only while `status` is `available`, record at most `maxSeconds`, then send the recording to Transcribe a recording.",
        "parameters": [
          {
            "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": "Whether the user can send recordings now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Voice"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/voice/transcriptions": {
      "post": {
        "operationId": "voice.transcribe",
        "summary": "Transcribe a recording",
        "tags": [
          "voice"
        ],
        "description": "Turns one recording of the user speaking, up to 60 seconds, into text, on the deployment's own model provider. Send the audio's bytes as the body, typed by `Content-Type` with one of the formats Get voice input lists and no larger than that format's `maxBytes` (a larger one answers `413`). Fin waits up to a minute for the speech model, so give the call 75 seconds before giving up: one abandoned sooner is still charged. Put the `text` it answers where the user writes, for them to read, change and send with Start a run or Steer a run: nothing reaches the agent until they do. An empty `text` means no speech was heard. Each transcription is charged to the user's AI usage budget and counted against their hourly and daily transcription limits; Fin keeps neither the audio nor the text.",
        "requestBody": {
          "required": true,
          "content": {
            "audio/webm": {
              "schema": {
                "type": "string",
                "format": "binary",
                "description": "The recording's bytes, in one of the formats Get voice input lists, named by `Content-Type` and at most that format's `maxBytes`."
              }
            },
            "audio/mp4": {
              "schema": {
                "type": "string",
                "format": "binary",
                "description": "The recording's bytes, in one of the formats Get voice input lists, named by `Content-Type` and at most that format's `maxBytes`."
              }
            },
            "audio/ogg": {
              "schema": {
                "type": "string",
                "format": "binary",
                "description": "The recording's bytes, in one of the formats Get voice input lists, named by `Content-Type` and at most that format's `maxBytes`."
              }
            },
            "audio/wav": {
              "schema": {
                "type": "string",
                "format": "binary",
                "description": "The recording's bytes, in one of the formats Get voice input lists, named by `Content-Type` and at most that format's `maxBytes`."
              }
            }
          },
          "description": "The recording's bytes, in one of the formats Get voice input lists, named by `Content-Type` and at most that format's `maxBytes`."
        },
        "parameters": [
          {
            "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": "The recording's words.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transcription"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `voice_disabled` — voice input is not turned on for this user; let them type instead",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "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\n- `budget_exhausted` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `voice_unavailable` — this deployment has no speech model, so it cannot transcribe recordings; let the user type instead\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/approvals": {
      "get": {
        "operationId": "approvals.list",
        "summary": "List approvals",
        "tags": [
          "approvals"
        ],
        "description": "Lists the user's approvals, newest first. By default only those waiting for a decision; pass `status` for decided or expired ones, or `all`, and `conversationId` for the approvals asked for in one conversation.",
        "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": {
              "default": "pending",
              "type": "string",
              "enum": [
                "pending",
                "approved",
                "denied",
                "expired",
                "all"
              ]
            },
            "in": "query",
            "name": "status",
            "required": false,
            "description": "Which approvals to list: `pending` (the default: the only ones you can decide), `approved`, `denied`, `expired`, or `all`."
          },
          {
            "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 the approvals asked for in this conversation; omit for all of the user's."
          },
          {
            "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 the user's approvals.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Approval"
                      },
                      "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"
          }
        }
      }
    },
    "/v1/users/{userId}/approvals/{approvalId}": {
      "get": {
        "operationId": "approvals.get",
        "summary": "Get an approval",
        "tags": [
          "approvals"
        ],
        "description": "Returns an action the agent wants to take that needs the user's OK, with the exact amounts, assets and limits to show them before they decide. For a money action it also carries `authorization.message`: the text the user signs with their wallet to approve it.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "approvalId",
            "required": true,
            "description": "The approval's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The approval.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Approval"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/approvals/{approvalId}/approve": {
      "post": {
        "operationId": "approvals.approve",
        "summary": "Approve an action",
        "tags": [
          "approvals"
        ],
        "description": "Records the user's approval and resumes the paused run, which then carries out the action. Returns the approval. For a money action, send `authorization` with the user's signature of `authorization.message` from Get an approval. Approving does not mean the action succeeded: follow the run, or the trade (Get a trade), for the result.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "authorization": {
                    "description": "For a money action: the user's signature of `authorization.message` from Get an approval, with its `controllerId` and `expiresAt` unchanged. Not needed for other actions.",
                    "type": "object",
                    "properties": {
                      "controllerId": {
                        "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 `controllerId` returned with the message, unchanged: the wallet that signed."
                      },
                      "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 `expiresAt` returned with the message, unchanged, character for character."
                      },
                      "signature": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "An EIP-191 personal-message signature by the current controller.",
                                "enum": [
                                  "evm"
                                ]
                              },
                              "signature": {
                                "type": "string",
                                "pattern": "^0x[0-9a-fA-F]{130}$",
                                "description": "The 65-byte hexadecimal signature over the exact supplied message."
                              }
                            },
                            "required": [
                              "kind",
                              "signature"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A user-verified WebAuthn assertion over the message digest.",
                                "enum": [
                                  "webauthn"
                                ]
                              },
                              "credentialId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 8192,
                                "pattern": "^[A-Za-z0-9_-]+$",
                                "description": "The signing credential identifier encoded as base64url."
                              },
                              "clientDataJSON": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 8192,
                                "pattern": "^[A-Za-z0-9_-]+$",
                                "description": "The authenticator's client-data JSON bytes encoded as base64url."
                              },
                              "authenticatorData": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 8192,
                                "pattern": "^[A-Za-z0-9_-]+$",
                                "description": "The authenticator data bytes encoded as base64url."
                              },
                              "signature": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 8192,
                                "pattern": "^[A-Za-z0-9_-]+$",
                                "description": "The authenticator's signature encoded as base64url."
                              },
                              "userHandle": {
                                "description": "The optional authenticator user handle encoded as base64url.",
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 8192,
                                    "pattern": "^[A-Za-z0-9_-]+$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "kind",
                              "credentialId",
                              "clientDataJSON",
                              "authenticatorData",
                              "signature"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A NEP-413 `signMessage` result over `{message, nonce, recipient}`, where `recipient` is the host of Fin's audience.",
                                "enum": [
                                  "near"
                                ]
                              },
                              "publicKey": {
                                "type": "string",
                                "pattern": "^ed25519:[1-9A-HJ-NP-Za-km-z]{32,44}$",
                                "description": "The signing key as the wallet reports it (`ed25519:` then base58)."
                              },
                              "signature": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9+/]{86}==$",
                                "description": "The 64-byte Ed25519 signature in padded standard base64."
                              },
                              "nonce": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$",
                                "description": "The 32-byte nonce the caller gave the wallet, in padded standard base64."
                              }
                            },
                            "required": [
                              "kind",
                              "publicKey",
                              "signature",
                              "nonce"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A Solana `signMessage` Ed25519 signature over the exact UTF-8 message bytes.",
                                "enum": [
                                  "solana"
                                ]
                              },
                              "signature": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9+/]{86}==$",
                                "description": "The 64-byte Ed25519 signature in padded standard base64."
                              }
                            },
                            "required": [
                              "kind",
                              "signature"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A SEP-53 signature: Ed25519 over sha256(\"Stellar Signed Message:\\n\" + message).",
                                "enum": [
                                  "stellar"
                                ]
                              },
                              "signature": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9+/]{86}==$",
                                "description": "The 64-byte Ed25519 signature in padded standard base64."
                              }
                            },
                            "required": [
                              "kind",
                              "signature"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A TON Connect `signData` result for a `text` payload that is exactly the message.",
                                "enum": [
                                  "ton"
                                ]
                              },
                              "signature": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9+/]{86}==$",
                                "description": "The 64-byte Ed25519 signature in padded standard base64."
                              },
                              "address": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128,
                                "description": "The signing wallet's address exactly as the wallet returned it."
                              },
                              "domain": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 253,
                                "description": "The dApp domain the wallet attested; it must be a partner-registered origin's host."
                              },
                              "timestamp": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991,
                                "description": "The wallet's signing time in UNIX seconds; it must be within five minutes."
                              }
                            },
                            "required": [
                              "kind",
                              "signature",
                              "address",
                              "domain",
                              "timestamp"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "description": "A TIP-191 `signMessageV2` signature over the exact message.",
                                "enum": [
                                  "tron"
                                ]
                              },
                              "signature": {
                                "type": "string",
                                "pattern": "^0x[0-9a-fA-F]{130}$",
                                "description": "The 65-byte recoverable secp256k1 signature in hexadecimal."
                              }
                            },
                            "required": [
                              "kind",
                              "signature"
                            ],
                            "additionalProperties": false
                          }
                        ],
                        "description": "The user's signature of the `message`, exactly as the API returned it."
                      }
                    },
                    "required": [
                      "controllerId",
                      "expiresAt",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  "reason": {
                    "description": "Why the call was approved, for the record.",
                    "type": "string",
                    "maxLength": 1024
                  },
                  "attestation": {
                    "description": "A partner-side confirmation reference, recorded on the journal event; never verified by fin.",
                    "type": "object",
                    "properties": {
                      "reference": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "description": "The partner's own reference for this confirmation."
                      }
                    },
                    "required": [
                      "reference"
                    ],
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "approvalId",
            "required": true,
            "description": "The approval's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The approval, now approved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Approval"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `approval_not_pending` — the approval was already decided or has expired, or its id does not exist or belongs to a different conversation\n- `run_active` — a run already holds this conversation\n- `stop_pending` — a stop is already in progress and its cleanup is not yet confirmed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "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\n- `execution_capacity` — no capacity is free to run this right now; honour `Retry-After`\n- `partner_run_capacity` — this partner's active run quota is full; honour Retry-After and reuse the same request identity",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `execution_unavailable` — the service that runs the agent could not take the work; `retryable` says whether to try again\n- `provider_unavailable` — an external provider the call depends on did not answer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/approvals/{approvalId}/deny": {
      "post": {
        "operationId": "approvals.deny",
        "summary": "Deny an action",
        "tags": [
          "approvals"
        ],
        "description": "Records the user's refusal and resumes the paused run, which carries on without the action. Returns the approval.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "description": "Why the call was denied, for the record.",
                    "type": "string",
                    "maxLength": 1024
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "approvalId",
            "required": true,
            "description": "The approval's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The approval, now denied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Approval"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `approval_not_pending` — the approval was already decided or has expired, or its id does not exist or belongs to a different conversation\n- `run_active` — a run already holds this conversation\n- `stop_pending` — a stop is already in progress and its cleanup is not yet confirmed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "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\n- `execution_capacity` — no capacity is free to run this right now; honour `Retry-After`\n- `partner_run_capacity` — this partner's active run quota is full; honour Retry-After and reuse the same request identity",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `execution_unavailable` — the service that runs the agent could not take the work; `retryable` says whether to try again",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/questions/{questionId}": {
      "get": {
        "operationId": "questions.get",
        "summary": "Get a question",
        "tags": [
          "questions"
        ],
        "description": "Gets a questionnaire the agent is waiting for. Use this route to restore the questions and their current status after reconnecting; submit an answer with Answer a question.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "questionId",
            "required": true,
            "description": "The questionnaire's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The questionnaire and its current answer, if one was accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "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 questionnaire's unique id."
                    },
                    "conversationId": {
                      "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 containing this questionnaire."
                    },
                    "runId": {
                      "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 waiting for this questionnaire."
                    },
                    "callId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256,
                      "description": "The tool call that opened this questionnaire."
                    },
                    "questions": {
                      "minItems": 1,
                      "maxItems": 5,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64,
                            "description": "The stable id used to match this question with its answer."
                          },
                          "label": {
                            "description": "Optional short title for this question.",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "prompt": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512,
                            "description": "The question text shown to the user."
                          },
                          "options": {
                            "minItems": 2,
                            "maxItems": 6,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "value": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128,
                                  "description": "The stable value returned when this option is selected."
                                },
                                "label": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512,
                                  "description": "The text shown to the user for this option."
                                },
                                "description": {
                                  "description": "Optional explanation shown with this option.",
                                  "type": "string",
                                  "maxLength": 512
                                },
                                "recommended": {
                                  "description": "Whether this is the option the agent recommends: at most one per question, with why in its description.",
                                  "type": "boolean"
                                },
                                "picture": {
                                  "description": "A small drawing an app may show over this choice: `schedule` for buying on a regular schedule, `dip` for buying only after a fall, `once` for one buy now. Absent when none fits; an app that draws none shows the choice without it.",
                                  "type": "string",
                                  "enum": [
                                    "schedule",
                                    "dip",
                                    "once"
                                  ]
                                }
                              },
                              "required": [
                                "value",
                                "label"
                              ],
                              "description": "One choice presented for a question."
                            },
                            "description": "The choices shown for this question."
                          },
                          "multiple": {
                            "description": "Whether the user may select more than one choice.",
                            "type": "boolean"
                          },
                          "amount": {
                            "type": "object",
                            "properties": {
                              "min": {
                                "type": "string",
                                "maxLength": 40,
                                "pattern": "^(0|[1-9]\\d{0,20})(\\.\\d{1,18})?$",
                                "description": "The smallest amount the slider offers, as a decimal string."
                              },
                              "max": {
                                "type": "string",
                                "maxLength": 40,
                                "pattern": "^(0|[1-9]\\d{0,20})(\\.\\d{1,18})?$",
                                "description": "The largest amount the slider offers, as a decimal string."
                              },
                              "step": {
                                "type": "string",
                                "maxLength": 40,
                                "pattern": "^(0|[1-9]\\d{0,20})(\\.\\d{1,18})?$",
                                "description": "How far one slider step moves, as a decimal string."
                              },
                              "unit": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 16,
                                "description": "What the amount counts: \"usd\" for dollars, or a token symbol such as \"USDC\"."
                              }
                            },
                            "required": [
                              "min",
                              "max",
                              "step",
                              "unit"
                            ],
                            "description": "Asks for one amount on a slider. The options are its presets, each value a decimal string within min and max; an amount between them is answered as customText."
                          }
                        },
                        "required": [
                          "id",
                          "prompt",
                          "options"
                        ],
                        "description": "One question and its available choices."
                      },
                      "description": "The questions and choices shown to the user."
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "answered",
                        "skipped",
                        "expired",
                        "cancelled"
                      ],
                      "description": "The current questionnaire status."
                    },
                    "answer": {
                      "anyOf": [
                        {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "description": "The questionnaire was answered.",
                                  "enum": [
                                    "answered"
                                  ]
                                },
                                "answers": {
                                  "minItems": 1,
                                  "maxItems": 5,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 64,
                                        "description": "The id of the question this answer corresponds to."
                                      },
                                      "values": {
                                        "maxItems": 6,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 128
                                        },
                                        "description": "Selected option values; empty when customText is supplied."
                                      },
                                      "customText": {
                                        "description": "Optional user-supplied text in place of selected options.",
                                        "type": "string",
                                        "maxLength": 2048
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "values"
                                    ],
                                    "description": "The user's answer to one question."
                                  },
                                  "description": "The selected options or custom text for each question the user answered. A question they skipped has no answer."
                                }
                              },
                              "required": [
                                "status",
                                "answers"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "description": "The questionnaire was skipped.",
                                  "enum": [
                                    "skipped"
                                  ]
                                }
                              },
                              "required": [
                                "status"
                              ]
                            }
                          ],
                          "description": "The result of answering or skipping a questionnaire."
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The accepted answers or skip result, or null when none was accepted."
                    },
                    "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 questionnaire was created."
                    },
                    "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": "When the questionnaire expires if unanswered."
                    },
                    "resolvedAt": {
                      "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 questionnaire was answered, skipped, expired, or cancelled; null while pending."
                    }
                  },
                  "required": [
                    "id",
                    "conversationId",
                    "runId",
                    "callId",
                    "questions",
                    "status",
                    "answer",
                    "createdAt",
                    "expiresAt",
                    "resolvedAt"
                  ],
                  "description": "The questionnaire resource and its current status."
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/questions/{questionId}/answer": {
      "post": {
        "operationId": "questions.answer",
        "summary": "Answer a question",
        "tags": [
          "questions"
        ],
        "description": "Submits the user's answers to a questionnaire, leaving out any question they skipped, or skips it whole. Use this route when a run is waiting for user input; it returns the questionnaire after the answer is accepted. Send the same `Idempotency-Key` and body again to safely retry; a changed body under the same key is refused with `request_key_conflict`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "description": "Submit the user's answers.",
                        "enum": [
                          "answers"
                        ]
                      },
                      "answers": {
                        "minItems": 1,
                        "maxItems": 5,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "description": "The id of the question this answer corresponds to."
                            },
                            "values": {
                              "maxItems": 6,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "description": "Selected option values; empty when customText is supplied."
                            },
                            "customText": {
                              "description": "Optional user-supplied text in place of selected options.",
                              "type": "string",
                              "maxLength": 2048
                            }
                          },
                          "required": [
                            "id",
                            "values"
                          ],
                          "additionalProperties": false,
                          "description": "The user's answer to one question."
                        },
                        "description": "The user's answer to each question they answered. Leave out a question they skipped."
                      }
                    },
                    "required": [
                      "kind",
                      "answers"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "description": "Skip the entire questionnaire.",
                        "enum": [
                          "skip"
                        ]
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  }
                ],
                "description": "Answers to the questionnaire or a request to skip it."
              }
            }
          },
          "description": "Answers to the questionnaire or a request to skip it."
        },
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "questionId",
            "required": true,
            "description": "The questionnaire's id."
          },
          {
            "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)$"
            },
            "example": "d5565100-9342-4bc6-a803-b387a20cb536",
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "description": "A UUID you generate for this request. Send the same key and the same body to retry it safely: you get the original result back, never a second one. A different body under the same key is refused with `request_key_conflict`."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The questionnaire after its answer was accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "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 questionnaire's unique id."
                    },
                    "conversationId": {
                      "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 containing this questionnaire."
                    },
                    "runId": {
                      "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 waiting for this questionnaire."
                    },
                    "callId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256,
                      "description": "The tool call that opened this questionnaire."
                    },
                    "questions": {
                      "minItems": 1,
                      "maxItems": 5,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64,
                            "description": "The stable id used to match this question with its answer."
                          },
                          "label": {
                            "description": "Optional short title for this question.",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "prompt": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512,
                            "description": "The question text shown to the user."
                          },
                          "options": {
                            "minItems": 2,
                            "maxItems": 6,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "value": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128,
                                  "description": "The stable value returned when this option is selected."
                                },
                                "label": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512,
                                  "description": "The text shown to the user for this option."
                                },
                                "description": {
                                  "description": "Optional explanation shown with this option.",
                                  "type": "string",
                                  "maxLength": 512
                                },
                                "recommended": {
                                  "description": "Whether this is the option the agent recommends: at most one per question, with why in its description.",
                                  "type": "boolean"
                                },
                                "picture": {
                                  "description": "A small drawing an app may show over this choice: `schedule` for buying on a regular schedule, `dip` for buying only after a fall, `once` for one buy now. Absent when none fits; an app that draws none shows the choice without it.",
                                  "type": "string",
                                  "enum": [
                                    "schedule",
                                    "dip",
                                    "once"
                                  ]
                                }
                              },
                              "required": [
                                "value",
                                "label"
                              ],
                              "description": "One choice presented for a question."
                            },
                            "description": "The choices shown for this question."
                          },
                          "multiple": {
                            "description": "Whether the user may select more than one choice.",
                            "type": "boolean"
                          },
                          "amount": {
                            "type": "object",
                            "properties": {
                              "min": {
                                "type": "string",
                                "maxLength": 40,
                                "pattern": "^(0|[1-9]\\d{0,20})(\\.\\d{1,18})?$",
                                "description": "The smallest amount the slider offers, as a decimal string."
                              },
                              "max": {
                                "type": "string",
                                "maxLength": 40,
                                "pattern": "^(0|[1-9]\\d{0,20})(\\.\\d{1,18})?$",
                                "description": "The largest amount the slider offers, as a decimal string."
                              },
                              "step": {
                                "type": "string",
                                "maxLength": 40,
                                "pattern": "^(0|[1-9]\\d{0,20})(\\.\\d{1,18})?$",
                                "description": "How far one slider step moves, as a decimal string."
                              },
                              "unit": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 16,
                                "description": "What the amount counts: \"usd\" for dollars, or a token symbol such as \"USDC\"."
                              }
                            },
                            "required": [
                              "min",
                              "max",
                              "step",
                              "unit"
                            ],
                            "description": "Asks for one amount on a slider. The options are its presets, each value a decimal string within min and max; an amount between them is answered as customText."
                          }
                        },
                        "required": [
                          "id",
                          "prompt",
                          "options"
                        ],
                        "description": "One question and its available choices."
                      },
                      "description": "The questions and choices shown to the user."
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "answered",
                        "skipped",
                        "expired",
                        "cancelled"
                      ],
                      "description": "The current questionnaire status."
                    },
                    "answer": {
                      "anyOf": [
                        {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "description": "The questionnaire was answered.",
                                  "enum": [
                                    "answered"
                                  ]
                                },
                                "answers": {
                                  "minItems": 1,
                                  "maxItems": 5,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 64,
                                        "description": "The id of the question this answer corresponds to."
                                      },
                                      "values": {
                                        "maxItems": 6,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 128
                                        },
                                        "description": "Selected option values; empty when customText is supplied."
                                      },
                                      "customText": {
                                        "description": "Optional user-supplied text in place of selected options.",
                                        "type": "string",
                                        "maxLength": 2048
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "values"
                                    ],
                                    "description": "The user's answer to one question."
                                  },
                                  "description": "The selected options or custom text for each question the user answered. A question they skipped has no answer."
                                }
                              },
                              "required": [
                                "status",
                                "answers"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "description": "The questionnaire was skipped.",
                                  "enum": [
                                    "skipped"
                                  ]
                                }
                              },
                              "required": [
                                "status"
                              ]
                            }
                          ],
                          "description": "The result of answering or skipping a questionnaire."
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The accepted answers or skip result, or null when none was accepted."
                    },
                    "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 questionnaire was created."
                    },
                    "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": "When the questionnaire expires if unanswered."
                    },
                    "resolvedAt": {
                      "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 questionnaire was answered, skipped, expired, or cancelled; null while pending."
                    }
                  },
                  "required": [
                    "id",
                    "conversationId",
                    "runId",
                    "callId",
                    "questions",
                    "status",
                    "answer",
                    "createdAt",
                    "expiresAt",
                    "resolvedAt"
                  ],
                  "description": "The questionnaire resource and its current status."
                }
              }
            }
          },
          "400": {
            "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\n- `invalid_question_answer` — the questionnaire answer does not match its questions or allowed choices",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `request_key_conflict` — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request\n- `question_not_pending` — the questionnaire has already been answered, closed, or is not awaiting this submission\n- `run_active` — a run already holds this conversation",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "410": {
            "description": "The resource still exists and stays readable, but can no longer take this request.\n\n- `question_closed` — the questionnaire expired or was cancelled",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "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\n- `execution_capacity` — no capacity is free to run this right now; honour `Retry-After`\n- `partner_run_capacity` — this partner's active run quota is full; honour Retry-After and reuse the same request identity",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "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\n- `execution_unavailable` — the service that runs the agent could not take the work; `retryable` says whether to try again",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{userId}/automation-sources": {
      "get": {
        "operationId": "automations.listSources",
        "summary": "List automation data sources",
        "tags": [
          "automations"
        ],
        "description": "Lists what an automation can watch (for example prices or incoming webhooks), the settings each takes, and whether this user can use it.",
        "parameters": [
          {
            "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": "The data sources an automation can watch.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AutomationSource"
                      },
                      "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"
          }
        }
      }
    },
    "/v1/users/{userId}/automations": {
      "get": {
        "operationId": "automations.list",
        "summary": "List automations",
        "tags": [
          "automations"
        ],
        "description": "Lists the user's automations with their status, next run and latest run. `filter=current` hides deleted ones. Automations are created by chatting with the agent; there is no create route.",
        "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": {
              "default": "all",
              "type": "string",
              "enum": [
                "all",
                "current",
                "enabled",
                "paused",
                "deleted"
              ]
            },
            "in": "query",
            "name": "filter",
            "required": false,
            "description": "Which automations to list: `all` every one, `current` every one not deleted, `enabled` active ones, `paused` paused ones, `deleted` deleted ones."
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 120
            },
            "in": "query",
            "name": "query",
            "required": false,
            "description": "Distinctive search words, not the whole user request. Every word must match a whole token in the name, instructions or reviewed rule description; matching is case-insensitive. Omit to browse."
          },
          {
            "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": "The user's automations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Automation"
                      },
                      "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"
          }
        }
      }
    },
    "/v1/users/{userId}/automations/{automationId}": {
      "get": {
        "operationId": "automations.get",
        "summary": "Get an automation",
        "tags": [
          "automations"
        ],
        "description": "Returns an automation: its name, its instructions, a readable `summary` of when it runs, its status and its latest run.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "automationId",
            "required": true,
            "description": "The automation's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The automation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Automation"
                }
              }
            }
          },
          "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"
          }
        }
      },
      "delete": {
        "operationId": "automations.delete",
        "summary": "Delete an automation",
        "tags": [
          "automations"
        ],
        "description": "Stops an automation for good. Its history stays readable. Safe to repeat.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "automationId",
            "required": true,
            "description": "The automation's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "204": {
            "description": "The automation is deleted."
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `automation_changed` — the automation changed while this request was handled; read it again and retry",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/automations/{automationId}/pause": {
      "post": {
        "operationId": "automations.pause",
        "summary": "Pause an automation",
        "tags": [
          "automations"
        ],
        "description": "Stops the automation until you resume it and cancels runs waiting to start. Runs already going finish, but a run that started before the pause cannot trade. If it may trade on its own (it has a `contract`), it keeps that permission, so resuming needs no new signature.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "automationId",
            "required": true,
            "description": "The automation's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The automation, updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Automation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `automation_changed` — the automation changed while this request was handled; read it again and retry",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "410": {
            "description": "The resource still exists and stays readable, but can no longer take this request.\n\n- `automation_deleted` — the automation was deleted",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/automations/{automationId}/resume": {
      "post": {
        "operationId": "automations.resume",
        "summary": "Resume an automation",
        "tags": [
          "automations"
        ],
        "description": "Starts a paused automation again, under the trading permission it already has. Refused once that permission has been revoked; the user then sets the automation up again. For one fin paused for its owner, pass `countMissedRun=true` when the owner lets the missed run go, so it counts toward the run limit.",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "countMissedRun",
            "required": false,
            "description": "Whether the owner let the run fin paused over go, so it counts toward the run limit. Leave it out to keep watching: the run goes back to the limit, and the automation carries on. It runs nothing it missed."
          },
          {
            "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."
          },
          {
            "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": "path",
            "name": "automationId",
            "required": true,
            "description": "The automation's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The automation, updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Automation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `automation_held` — an operator holds the automation; it fires again when released\n- `automation_invalid` — the automation's definition cannot run as written\n- `automation_changed` — the automation changed while this request was handled; read it again and retry",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "410": {
            "description": "The resource still exists and stays readable, but can no longer take this request.\n\n- `automation_deleted` — the automation was deleted",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/automations/{automationId}/runs": {
      "get": {
        "operationId": "automations.listRuns",
        "summary": "List an automation's runs",
        "tags": [
          "automations"
        ],
        "description": "Lists each time the automation ran or was due to run, newest first, with the outcome and the agent run it started.",
        "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",
              "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."
          },
          {
            "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": "path",
            "name": "automationId",
            "required": true,
            "description": "The automation's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The automation's runs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AutomationRun"
                      },
                      "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"
          }
        }
      }
    },
    "/v1/users/{userId}/automations/{automationId}/runs/{automationRunId}": {
      "get": {
        "operationId": "automations.getRun",
        "summary": "Get an automation run",
        "tags": [
          "automations"
        ],
        "description": "Returns one time the automation ran: when and why, whether it started or was skipped, and the agent run and approvals involved.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "automationId",
            "required": true,
            "description": "The automation's id."
          },
          {
            "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": "path",
            "name": "automationRunId",
            "required": true,
            "description": "The automation run's `id`, from List an automation's runs."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The automation run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRun"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/automations/{automationId}/readings": {
      "get": {
        "operationId": "automations.listReadings",
        "summary": "List automation readings",
        "tags": [
          "automations"
        ],
        "description": "Lists what each source the automation reads reported over a window: the source's latest reading, and the values over time of each field the rule compares, so you can draw them against the rule's thresholds. Covers the last 30 days unless you pass `since` and `until`, at most 90 days apart. Each field returns at most 240 points, the last reading of each equal slice of the window.",
        "parameters": [
          {
            "schema": {
              "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))$"
            },
            "in": "query",
            "name": "since",
            "required": false,
            "description": "The earliest reading to return. Defaults to 30 days before `until`."
          },
          {
            "schema": {
              "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))$"
            },
            "in": "query",
            "name": "until",
            "required": false,
            "description": "The latest reading to return. Defaults to now."
          },
          {
            "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."
          },
          {
            "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": "path",
            "name": "automationId",
            "required": true,
            "description": "The automation's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The automation's readings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationReadings"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/v1/users/{userId}/automations/{automationId}/rotate-webhook-secret": {
      "post": {
        "operationId": "automations.rotateWebhookSecret",
        "summary": "Rotate the webhook secret",
        "tags": [
          "automations"
        ],
        "description": "Creates a new secret for the automation's webhook and returns it with the webhook's path. The old secret stops working at once. The secret is shown only once. Only for an active automation that runs on incoming events.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "automationId",
            "required": true,
            "description": "The automation's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The new webhook secret and where it is received.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "secret": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{43}$",
                      "description": "The new webhook secret. Shown once; it cannot be read back later."
                    },
                    "keyId": {
                      "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 new secret's id."
                    },
                    "path": {
                      "type": "string",
                      "description": "The path this automation's webhook receives requests on."
                    },
                    "definitionVersion": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991,
                      "description": "The definition version this secret was minted for."
                    }
                  },
                  "required": [
                    "secret",
                    "keyId",
                    "path",
                    "definitionVersion"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `automation_paused` — the automation is paused; resume it first\n- `automation_has_no_webhook` — the automation does not run on incoming events, so it has no webhook\n- `automation_changed` — the automation changed while this request was handled; read it again and retry",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "410": {
            "description": "The resource still exists and stays readable, but can no longer take this request.\n\n- `automation_deleted` — the automation was deleted",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/baskets": {
      "get": {
        "operationId": "baskets.list",
        "summary": "List baskets",
        "tags": [
          "baskets"
        ],
        "description": "Lists the user's idea baskets, newest first, with estimated values and allocation. Pass nextCursor unchanged to read the next page. Available only to enabled partners.",
        "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",
              "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": "The user's baskets and the next page's cursor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasketPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `baskets_disabled` — idea baskets are not turned on for this user; hide the Ideas pages and their baskets",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/baskets/{basketId}": {
      "get": {
        "operationId": "baskets.get",
        "summary": "Get a basket",
        "tags": [
          "baskets"
        ],
        "description": "Returns an idea basket with its bought quantities, estimated values, failed buying steps and unused venue money. Use it to show the idea's details after listing baskets. Holdings are shared with the rest of the account, not reserved for this basket.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "basketId",
            "required": true,
            "description": "The basket's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The basket and its estimated position values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Basket"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `baskets_disabled` — idea baskets are not turned on for this user; hide the Ideas pages and their baskets",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "delete": {
        "operationId": "baskets.delete",
        "summary": "Delete a basket",
        "tags": [
          "baskets"
        ],
        "description": "Removes an idea basket from the user's ideas, for a draft or a basket already bought. It moves nothing: anything the basket bought stays in the user's accounts, and money left on a venue stays there to withdraw. Refused while the basket is buying (`basket_buying`) or while an approval to buy it is open (`basket_awaiting_approval`). Its history stays in the conversation. Not gated by the baskets feature, so a user can always remove their own basket.",
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "basketId",
            "required": true,
            "description": "The basket's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "204": {
            "description": "The basket is deleted."
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `basket_buying` — the basket is still buying, so it cannot be deleted yet; try again once its result is in\n- `basket_awaiting_approval` — an approval to buy this basket is still open; decline it in the chat, then delete the basket",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/baskets/{basketId}/links": {
      "post": {
        "operationId": "baskets.link",
        "summary": "Link an order to a basket step",
        "tags": [
          "baskets"
        ],
        "description": "Links an order the user placed to a step of a partly bought basket that did not buy, so the basket shows and values that order in the step's place. Use it after the user bought what a failed step would have bought with an order of their own: pick one of the step's `failures[].linkable` orders from Get a basket. It moves nothing and asks for no approval. A link is permanent; repeating the same link answers the basket again. Once every step that did not buy is linked, the basket is `bought`. Refused when the step bought or the basket is not partly bought (`basket_step_not_failed`), when another order is linked to the step (`basket_step_linked`), or when the order is not one the step can take (`basket_order_not_linkable`).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BasketLinkInputInput"
              }
            }
          }
        },
        "parameters": [
          {
            "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."
          },
          {
            "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": "path",
            "name": "basketId",
            "required": true,
            "description": "The basket's id."
          }
        ],
        "security": [
          {
            "apiKey": [],
            "userToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "The basket with the order in the step's place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Basket"
                }
              }
            }
          },
          "400": {
            "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\n- `basket_order_not_linkable` — 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",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "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\n- `baskets_disabled` — idea baskets are not turned on for this user; hide the Ideas pages and their baskets",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `basket_step_not_failed` — 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` — another order is already linked to this step; a link is permanent, so read the basket again",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/users/{userId}/automations/backtest": {
      "post": {
        "operationId": "automations.backtest",
        "summary": "Backtest an automation",
        "tags": [
          "automations"
        ],
        "description": "Estimates how a draft or saved automation would have behaved over a historical range. Use it before creating or changing an automation; inspect the returned status, limitations and timing changes before using the estimate. Historical prices do not establish executable fills.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "draft"
                            ]
                          },
                          "definition": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 120
                              },
                              "prompt": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 8192,
                                "description": "Only the user's instructions for each later run, preserved exactly with their constraints; monitoring conditions belong in rule."
                              },
                              "rule": {
                                "$ref": "#/components/schemas/AutomationRuleInput"
                              },
                              "contract": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "description": "Which contract template this is.",
                                        "enum": [
                                          "near_intents_transfer"
                                        ]
                                      },
                                      "actions": {
                                        "minItems": 1,
                                        "maxItems": 16,
                                        "type": "array",
                                        "items": {
                                          "oneOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "kind": {
                                                  "type": "string",
                                                  "description": "Exchange one asset for another; custody never leaves the agent wallet.",
                                                  "enum": [
                                                    "swap"
                                                  ]
                                                },
                                                "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"
                                                          ],
                                                          "additionalProperties": false,
                                                          "description": "The exact token this asset is pinned to."
                                                        }
                                                      },
                                                      "required": [
                                                        "pinned"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "any": {
                                                          "type": "boolean",
                                                          "description": "Any token the agent wallet holds; the executor picks one at execution.",
                                                          "enum": [
                                                            true
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "any"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  ],
                                                  "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",
                                                          "description": "Spend an exact amount of the input token.",
                                                          "enum": [
                                                            "exact_input_tokens"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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",
                                                          "description": "Spend a USD-denominated value of the input token.",
                                                          "enum": [
                                                            "exact_input_value_usd"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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",
                                                          "description": "Receive an exact amount of the output token.",
                                                          "enum": [
                                                            "exact_output_tokens"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "description": "An exact quantity of the output token, scaled by its verified decimals; the host calculates the input."
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "kind": {
                                                          "type": "string",
                                                          "description": "Spend everything the agent wallet holds of the input asset.",
                                                          "enum": [
                                                            "all_of_input"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "kind"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "kind": {
                                                          "type": "string",
                                                          "description": "Spend a fraction of the input asset.",
                                                          "enum": [
                                                            "fraction_of_input"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "kind": {
                                                          "type": "string",
                                                          "description": "Sell a fraction of this automation's own position in the input asset.",
                                                          "enum": [
                                                            "fraction_of_position"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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",
                                                          "description": "Sell only the gain on this automation's own position in the input asset.",
                                                          "enum": [
                                                            "gain_of_position"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "kind"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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"
                                                          ],
                                                          "additionalProperties": false,
                                                          "description": "The exact token this asset is pinned to."
                                                        }
                                                      },
                                                      "required": [
                                                        "pinned"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "any": {
                                                          "type": "boolean",
                                                          "description": "Any token the agent wallet holds; the executor picks one at execution.",
                                                          "enum": [
                                                            true
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "any"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  ],
                                                  "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",
                                                          "description": "Sell when the asset is this far ABOVE the automation's average cost.",
                                                          "enum": [
                                                            "take_profit"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "description": "A take-profit exit: sell once the price is up this much on average cost."
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "kind": {
                                                          "type": "string",
                                                          "description": "Sell when the asset is this far BELOW the automation's average cost.",
                                                          "enum": [
                                                            "stop_loss"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "description": "A stop-loss exit: sell once the price is down this much on average cost."
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "kind": {
                                                          "type": "string",
                                                          "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.",
                                                          "enum": [
                                                            "harvest_every"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "kind": {
                                                  "type": "string",
                                                  "description": "Return an asset to the account that owns the agent wallet.",
                                                  "enum": [
                                                    "withdraw_to_owner"
                                                  ]
                                                },
                                                "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"
                                                          ],
                                                          "additionalProperties": false,
                                                          "description": "The exact token this asset is pinned to."
                                                        }
                                                      },
                                                      "required": [
                                                        "pinned"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "any": {
                                                          "type": "boolean",
                                                          "description": "Any token the agent wallet holds; the executor picks one at execution.",
                                                          "enum": [
                                                            true
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "any"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  ],
                                                  "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",
                                                          "description": "Spend an exact amount of the input token.",
                                                          "enum": [
                                                            "exact_input_tokens"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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",
                                                          "description": "Spend a USD-denominated value of the input token.",
                                                          "enum": [
                                                            "exact_input_value_usd"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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",
                                                          "description": "Receive an exact amount of the output token.",
                                                          "enum": [
                                                            "exact_output_tokens"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "description": "An exact quantity of the output token, scaled by its verified decimals; the host calculates the input."
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "kind": {
                                                          "type": "string",
                                                          "description": "Spend everything the agent wallet holds of the input asset.",
                                                          "enum": [
                                                            "all_of_input"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "kind"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "kind": {
                                                          "type": "string",
                                                          "description": "Spend a fraction of the input asset.",
                                                          "enum": [
                                                            "fraction_of_input"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "kind": {
                                                          "type": "string",
                                                          "description": "Sell a fraction of this automation's own position in the input asset.",
                                                          "enum": [
                                                            "fraction_of_position"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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",
                                                          "description": "Sell only the gain on this automation's own position in the input asset.",
                                                          "enum": [
                                                            "gain_of_position"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "kind"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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"
                                                          ],
                                                          "additionalProperties": false,
                                                          "description": "The exact token this asset is pinned to."
                                                        }
                                                      },
                                                      "required": [
                                                        "pinned"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "any": {
                                                          "type": "boolean",
                                                          "description": "Any token the agent wallet holds; the executor picks one at execution.",
                                                          "enum": [
                                                            true
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "any"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  ],
                                                  "description": "The asset this action produces: pinned to one token, or left open."
                                                }
                                              },
                                              "required": [
                                                "kind",
                                                "input",
                                                "quantity",
                                                "output"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "kind": {
                                                  "type": "string",
                                                  "description": "Pay the exact approved destination through the provider’s chain or Intents transfer route.",
                                                  "enum": [
                                                    "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"
                                                          ],
                                                          "additionalProperties": false,
                                                          "description": "The exact token this asset is pinned to."
                                                        }
                                                      },
                                                      "required": [
                                                        "pinned"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "any": {
                                                          "type": "boolean",
                                                          "description": "Any token the agent wallet holds; the executor picks one at execution.",
                                                          "enum": [
                                                            true
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "any"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  ],
                                                  "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",
                                                          "description": "Spend an exact amount of the input token.",
                                                          "enum": [
                                                            "exact_input_tokens"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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",
                                                          "description": "Spend a USD-denominated value of the input token.",
                                                          "enum": [
                                                            "exact_input_value_usd"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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",
                                                          "description": "Receive an exact amount of the output token.",
                                                          "enum": [
                                                            "exact_output_tokens"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "description": "An exact quantity of the output token, scaled by its verified decimals; the host calculates the input."
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "kind": {
                                                          "type": "string",
                                                          "description": "Spend everything the agent wallet holds of the input asset.",
                                                          "enum": [
                                                            "all_of_input"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "kind"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "kind": {
                                                          "type": "string",
                                                          "description": "Spend a fraction of the input asset.",
                                                          "enum": [
                                                            "fraction_of_input"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "kind": {
                                                          "type": "string",
                                                          "description": "Sell a fraction of this automation's own position in the input asset.",
                                                          "enum": [
                                                            "fraction_of_position"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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",
                                                          "description": "Sell only the gain on this automation's own position in the input asset.",
                                                          "enum": [
                                                            "gain_of_position"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "kind"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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"
                                                          ],
                                                          "additionalProperties": false,
                                                          "description": "The exact token this asset is pinned to."
                                                        }
                                                      },
                                                      "required": [
                                                        "pinned"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "any": {
                                                          "type": "boolean",
                                                          "description": "Any token the agent wallet holds; the executor picks one at execution.",
                                                          "enum": [
                                                            true
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "any"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  ],
                                                  "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"
                                                  ],
                                                  "additionalProperties": false,
                                                  "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"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "kind": {
                                                  "type": "string",
                                                  "description": "Not executable, and refused in new contracts: pay an address with withdraw_transfer.",
                                                  "enum": [
                                                    "send"
                                                  ]
                                                },
                                                "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"
                                                          ],
                                                          "additionalProperties": false,
                                                          "description": "The exact token this asset is pinned to."
                                                        }
                                                      },
                                                      "required": [
                                                        "pinned"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "any": {
                                                          "type": "boolean",
                                                          "description": "Any token the agent wallet holds; the executor picks one at execution.",
                                                          "enum": [
                                                            true
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "any"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  ],
                                                  "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",
                                                          "description": "Spend an exact amount of the input token.",
                                                          "enum": [
                                                            "exact_input_tokens"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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",
                                                          "description": "Spend a USD-denominated value of the input token.",
                                                          "enum": [
                                                            "exact_input_value_usd"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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",
                                                          "description": "Receive an exact amount of the output token.",
                                                          "enum": [
                                                            "exact_output_tokens"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "description": "An exact quantity of the output token, scaled by its verified decimals; the host calculates the input."
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "kind": {
                                                          "type": "string",
                                                          "description": "Spend everything the agent wallet holds of the input asset.",
                                                          "enum": [
                                                            "all_of_input"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "kind"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "kind": {
                                                          "type": "string",
                                                          "description": "Spend a fraction of the input asset.",
                                                          "enum": [
                                                            "fraction_of_input"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "kind": {
                                                          "type": "string",
                                                          "description": "Sell a fraction of this automation's own position in the input asset.",
                                                          "enum": [
                                                            "fraction_of_position"
                                                          ]
                                                        },
                                                        "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"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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",
                                                          "description": "Sell only the gain on this automation's own position in the input asset.",
                                                          "enum": [
                                                            "gain_of_position"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "kind"
                                                      ],
                                                      "additionalProperties": false,
                                                      "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"
                                                          ],
                                                          "additionalProperties": false,
                                                          "description": "The exact token this asset is pinned to."
                                                        }
                                                      },
                                                      "required": [
                                                        "pinned"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "any": {
                                                          "type": "boolean",
                                                          "description": "Any token the agent wallet holds; the executor picks one at execution.",
                                                          "enum": [
                                                            true
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "any"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  ],
                                                  "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"
                                                  ],
                                                  "additionalProperties": false,
                                                  "description": "The pinned destination this action pays."
                                                }
                                              },
                                              "required": [
                                                "kind",
                                                "input",
                                                "quantity",
                                                "output",
                                                "recipient"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        },
                                        "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"
                                          ],
                                          "additionalProperties": false,
                                          "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"
                                        ],
                                        "additionalProperties": false,
                                        "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"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "enum": [
                                                  "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"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "actions",
                                      "validUntil",
                                      "maxExecutions",
                                      "bounds"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "$ref": "#/components/schemas/PerpsAutomationContractInput"
                                  },
                                  {
                                    "$ref": "#/components/schemas/PredictionAutomationContractInput"
                                  },
                                  {
                                    "oneOf": [
                                      {
                                        "$ref": "#/components/schemas/SolanaBuyContractInput"
                                      },
                                      {
                                        "$ref": "#/components/schemas/SolanaSellContractInput"
                                      }
                                    ],
                                    "description": "A standing Solana grant: an exact buy, or a sale of a fraction of the holding for USDC, made exactly as approved each time the automation fires."
                                  }
                                ],
                                "description": "Standing authority for the runs this automation fires: a NEAR Intents transfer contract, a perps automation that opens, reduces or adds margin to the agent's own Hyperliquid position, a Polymarket buy or sale of one outcome, or a Solana buy or sell made exactly as approved."
                              },
                              "maxSigningDelaySeconds": {
                                "description": "Required with a contract and omitted without one: the owner's approved maximum delay after a firing during which its run may obtain signatures, in seconds; separate from delivery lateness and signature lifetime.",
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 86400
                              },
                              "missedRun": {
                                "type": "string",
                                "enum": [
                                  "skip",
                                  "ask"
                                ],
                                "description": "What happens to a run that can't go through before its deadline: `skip` counts it and keeps the schedule, `ask` pauses the automation until its owner decides. A failure only the owner can fix pauses either way."
                              }
                            },
                            "required": [
                              "name",
                              "prompt",
                              "rule"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind",
                          "definition"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "saved"
                            ]
                          },
                          "automationId": {
                            "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 automation's id."
                          },
                          "definitionVersion": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "kind",
                          "automationId"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "startAt": {
                    "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  "endAt": {
                    "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  "resolution": {
                    "type": "string",
                    "enum": [
                      "hourly",
                      "daily"
                    ]
                  },
                  "timing": {
                    "type": "string",
                    "enum": [
                      "preserved",
                      "sampled"
                    ]
                  },
                  "execution": {
                    "type": "string",
                    "enum": [
                      "contract_terms",
                      "triggers_only"
                    ],
                    "description": "Select triggers_only for a discretionary prompt whose concrete trades are unresolved. contract_terms hypothetically executes the fixed proposed trade terms; it does not simulate model decisions or discretionary instructions."
                  },
                  "initialHoldings": {
                    "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})$"
                        }
                      },
                      "required": [
                        "tokenId",
                        "decimals",
                        "amountRaw"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "funding": {
                    "description": "Select strategy_budget to set aside a finite starting budget from entry sizes and run limits at opening historical prices. Requires empty initialHoldings and cannot be combined with contributeInputs: true. Omit both automatic options to use an explicitly supplied starting portfolio. No live wallet balance is read.",
                    "type": "string",
                    "enum": [
                      "strategy_budget"
                    ]
                  },
                  "contributeInputs": {
                    "description": "When true, start empty and hypothetically supply the input assets for each successfully modeled fixed purchase, valued at its fill time. Requires empty initialHoldings and omitted funding. Contributions are capital, not profit; exits receive no new capital. False or omission leaves the existing funding or explicit portfolio behavior unchanged.",
                    "type": "boolean"
                  },
                  "costBps": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 300
                  }
                },
                "required": [
                  "target",
                  "startAt",
                  "endAt",
                  "resolution",
                  "timing",
                  "execution",
                  "initialHoldings",
                  "costBps"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "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": "The historical estimate and its data limitations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "estimated",
                        "trigger_only",
                        "unavailable",
                        "incomplete"
                      ]
                    },
                    "reason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 4096
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "metrics": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "startingValueUsdDecimal": {
                              "type": "string",
                              "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                            },
                            "contributedValueUsdDecimal": {
                              "description": "Total external input contributions valued at their modeled fills; contributions are excluded from profit.",
                              "type": "string",
                              "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                            },
                            "endingValueUsdDecimal": {
                              "type": "string",
                              "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                            },
                            "pnlUsdDecimal": {
                              "type": "string",
                              "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                            },
                            "returnPercentDecimal": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Net profit divided by starting value plus total contributed value, times 100. Null when no capital was invested; this is not an annualized or time-weighted return."
                            },
                            "maxDrawdownPercentDecimal": {
                              "type": "string",
                              "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
                              "description": "Largest sampled peak-to-trough fall. Contribution-funded estimates use a flow-adjusted index rounded down at each mark to 36 decimal places; financial amounts and trade decisions remain exact."
                            },
                            "holdValueUsdDecimal": {
                              "type": "string",
                              "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                            },
                            "totalCostUsdDecimal": {
                              "type": "string",
                              "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                            }
                          },
                          "required": [
                            "startingValueUsdDecimal",
                            "endingValueUsdDecimal",
                            "pnlUsdDecimal",
                            "returnPercentDecimal",
                            "maxDrawdownPercentDecimal",
                            "holdValueUsdDecimal",
                            "totalCostUsdDecimal"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "evaluations": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 250000
                        },
                        "firings": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 250000
                        },
                        "filledLegs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 1000
                        },
                        "skipped": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 250000
                        },
                        "unknown": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 250000
                        }
                      },
                      "required": [
                        "evaluations",
                        "firings",
                        "filledLegs",
                        "skipped",
                        "unknown"
                      ]
                    },
                    "throughAt": {
                      "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "limitations": {
                      "maxItems": 128,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 4096
                      }
                    },
                    "scenario": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "prompt": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 8192,
                          "description": "Only the user's instructions for each later run, preserved exactly with their constraints; monitoring conditions belong in rule."
                        },
                        "rule": {
                          "$ref": "#/components/schemas/AutomationRule"
                        },
                        "contract": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "description": "Which contract template this is.",
                                  "enum": [
                                    "near_intents_transfer"
                                  ]
                                },
                                "actions": {
                                  "minItems": 1,
                                  "maxItems": 16,
                                  "type": "array",
                                  "items": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "kind": {
                                            "type": "string",
                                            "description": "Exchange one asset for another; custody never leaves the agent wallet.",
                                            "enum": [
                                              "swap"
                                            ]
                                          },
                                          "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",
                                                    "description": "Any token the agent wallet holds; the executor picks one at execution.",
                                                    "enum": [
                                                      true
                                                    ]
                                                  }
                                                },
                                                "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",
                                                    "description": "Spend an exact amount of the input token.",
                                                    "enum": [
                                                      "exact_input_tokens"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Spend a USD-denominated value of the input token.",
                                                    "enum": [
                                                      "exact_input_value_usd"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Receive an exact amount of the output token.",
                                                    "enum": [
                                                      "exact_output_tokens"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Spend everything the agent wallet holds of the input asset.",
                                                    "enum": [
                                                      "all_of_input"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "kind"
                                                ]
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "kind": {
                                                    "type": "string",
                                                    "description": "Spend a fraction of the input asset.",
                                                    "enum": [
                                                      "fraction_of_input"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Sell a fraction of this automation's own position in the input asset.",
                                                    "enum": [
                                                      "fraction_of_position"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Sell only the gain on this automation's own position in the input asset.",
                                                    "enum": [
                                                      "gain_of_position"
                                                    ]
                                                  }
                                                },
                                                "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",
                                                    "description": "Any token the agent wallet holds; the executor picks one at execution.",
                                                    "enum": [
                                                      true
                                                    ]
                                                  }
                                                },
                                                "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",
                                                    "description": "Sell when the asset is this far ABOVE the automation's average cost.",
                                                    "enum": [
                                                      "take_profit"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Sell when the asset is this far BELOW the automation's average cost.",
                                                    "enum": [
                                                      "stop_loss"
                                                    ]
                                                  },
                                                  "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",
                                                    "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.",
                                                    "enum": [
                                                      "harvest_every"
                                                    ]
                                                  },
                                                  "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",
                                            "description": "Return an asset to the account that owns the agent wallet.",
                                            "enum": [
                                              "withdraw_to_owner"
                                            ]
                                          },
                                          "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",
                                                    "description": "Any token the agent wallet holds; the executor picks one at execution.",
                                                    "enum": [
                                                      true
                                                    ]
                                                  }
                                                },
                                                "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",
                                                    "description": "Spend an exact amount of the input token.",
                                                    "enum": [
                                                      "exact_input_tokens"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Spend a USD-denominated value of the input token.",
                                                    "enum": [
                                                      "exact_input_value_usd"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Receive an exact amount of the output token.",
                                                    "enum": [
                                                      "exact_output_tokens"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Spend everything the agent wallet holds of the input asset.",
                                                    "enum": [
                                                      "all_of_input"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "kind"
                                                ]
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "kind": {
                                                    "type": "string",
                                                    "description": "Spend a fraction of the input asset.",
                                                    "enum": [
                                                      "fraction_of_input"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Sell a fraction of this automation's own position in the input asset.",
                                                    "enum": [
                                                      "fraction_of_position"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Sell only the gain on this automation's own position in the input asset.",
                                                    "enum": [
                                                      "gain_of_position"
                                                    ]
                                                  }
                                                },
                                                "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",
                                                    "description": "Any token the agent wallet holds; the executor picks one at execution.",
                                                    "enum": [
                                                      true
                                                    ]
                                                  }
                                                },
                                                "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",
                                            "description": "Pay the exact approved destination through the provider’s chain or Intents transfer route.",
                                            "enum": [
                                              "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",
                                                    "description": "Any token the agent wallet holds; the executor picks one at execution.",
                                                    "enum": [
                                                      true
                                                    ]
                                                  }
                                                },
                                                "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",
                                                    "description": "Spend an exact amount of the input token.",
                                                    "enum": [
                                                      "exact_input_tokens"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Spend a USD-denominated value of the input token.",
                                                    "enum": [
                                                      "exact_input_value_usd"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Receive an exact amount of the output token.",
                                                    "enum": [
                                                      "exact_output_tokens"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Spend everything the agent wallet holds of the input asset.",
                                                    "enum": [
                                                      "all_of_input"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "kind"
                                                ]
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "kind": {
                                                    "type": "string",
                                                    "description": "Spend a fraction of the input asset.",
                                                    "enum": [
                                                      "fraction_of_input"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Sell a fraction of this automation's own position in the input asset.",
                                                    "enum": [
                                                      "fraction_of_position"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Sell only the gain on this automation's own position in the input asset.",
                                                    "enum": [
                                                      "gain_of_position"
                                                    ]
                                                  }
                                                },
                                                "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",
                                                    "description": "Any token the agent wallet holds; the executor picks one at execution.",
                                                    "enum": [
                                                      true
                                                    ]
                                                  }
                                                },
                                                "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",
                                            "description": "Not executable, and refused in new contracts: pay an address with withdraw_transfer.",
                                            "enum": [
                                              "send"
                                            ]
                                          },
                                          "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",
                                                    "description": "Any token the agent wallet holds; the executor picks one at execution.",
                                                    "enum": [
                                                      true
                                                    ]
                                                  }
                                                },
                                                "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",
                                                    "description": "Spend an exact amount of the input token.",
                                                    "enum": [
                                                      "exact_input_tokens"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Spend a USD-denominated value of the input token.",
                                                    "enum": [
                                                      "exact_input_value_usd"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Receive an exact amount of the output token.",
                                                    "enum": [
                                                      "exact_output_tokens"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Spend everything the agent wallet holds of the input asset.",
                                                    "enum": [
                                                      "all_of_input"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "kind"
                                                ]
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "kind": {
                                                    "type": "string",
                                                    "description": "Spend a fraction of the input asset.",
                                                    "enum": [
                                                      "fraction_of_input"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Sell a fraction of this automation's own position in the input asset.",
                                                    "enum": [
                                                      "fraction_of_position"
                                                    ]
                                                  },
                                                  "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",
                                                    "description": "Sell only the gain on this automation's own position in the input asset.",
                                                    "enum": [
                                                      "gain_of_position"
                                                    ]
                                                  }
                                                },
                                                "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",
                                                    "description": "Any token the agent wallet holds; the executor picks one at execution.",
                                                    "enum": [
                                                      true
                                                    ]
                                                  }
                                                },
                                                "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",
                                          "enum": [
                                            "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"
                              ]
                            },
                            {
                              "$ref": "#/components/schemas/PerpsAutomationContract"
                            },
                            {
                              "$ref": "#/components/schemas/PredictionAutomationContract"
                            },
                            {
                              "oneOf": [
                                {
                                  "$ref": "#/components/schemas/SolanaBuyContract"
                                },
                                {
                                  "$ref": "#/components/schemas/SolanaSellContract"
                                }
                              ],
                              "description": "A standing Solana grant: an exact buy, or a sale of a fraction of the holding for USDC, made exactly as approved each time the automation fires."
                            }
                          ],
                          "description": "Standing authority for the runs this automation fires: a NEAR Intents transfer contract, a perps automation that opens, reduces or adds margin to the agent's own Hyperliquid position, a Polymarket buy or sale of one outcome, or a Solana buy or sell made exactly as approved."
                        },
                        "maxSigningDelaySeconds": {
                          "description": "Required with a contract and omitted without one: the owner's approved maximum delay after a firing during which its run may obtain signatures, in seconds; separate from delivery lateness and signature lifetime.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 86400
                        },
                        "missedRun": {
                          "type": "string",
                          "enum": [
                            "skip",
                            "ask"
                          ],
                          "description": "What happens to a run that can't go through before its deadline: `skip` counts it and keeps the schedule, `ask` pauses the automation until its owner decides. A failure only the owner can fix pauses either way."
                        },
                        "startAt": {
                          "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                        },
                        "endAt": {
                          "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                        },
                        "resolution": {
                          "type": "string",
                          "enum": [
                            "hourly",
                            "daily"
                          ]
                        },
                        "timing": {
                          "type": "string",
                          "enum": [
                            "preserved",
                            "sampled"
                          ]
                        },
                        "execution": {
                          "type": "string",
                          "enum": [
                            "contract_terms",
                            "triggers_only"
                          ],
                          "description": "Select triggers_only for a discretionary prompt whose concrete trades are unresolved. contract_terms hypothetically executes the fixed proposed trade terms; it does not simulate model decisions or discretionary instructions."
                        },
                        "initialHoldings": {
                          "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})$"
                              }
                            },
                            "required": [
                              "tokenId",
                              "decimals",
                              "amountRaw"
                            ]
                          }
                        },
                        "funding": {
                          "description": "Select strategy_budget to set aside a finite starting budget from entry sizes and run limits at opening historical prices. Requires empty initialHoldings and cannot be combined with contributeInputs: true. Omit both automatic options to use an explicitly supplied starting portfolio. No live wallet balance is read.",
                          "type": "string",
                          "enum": [
                            "strategy_budget"
                          ]
                        },
                        "contributeInputs": {
                          "description": "When true, start empty and hypothetically supply the input assets for each successfully modeled fixed purchase, valued at its fill time. Requires empty initialHoldings and omitted funding. Contributions are capital, not profit; exits receive no new capital. False or omission leaves the existing funding or explicit portfolio behavior unchanged.",
                          "type": "boolean"
                        },
                        "costBps": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 300
                        },
                        "automationId": {
                          "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 automation's id."
                        },
                        "definitionVersion": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "name",
                        "prompt",
                        "rule",
                        "startAt",
                        "endAt",
                        "resolution",
                        "timing",
                        "execution",
                        "initialHoldings",
                        "costBps"
                      ]
                    },
                    "scenarioHash": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$"
                    },
                    "dataHash": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[0-9a-f]{64}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "engineVersion": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    "timingChanges": {
                      "maxItems": 128,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "path": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "before": {
                            "type": "string",
                            "maxLength": 4096
                          },
                          "after": {
                            "type": "string",
                            "maxLength": 4096
                          }
                        },
                        "required": [
                          "path",
                          "before",
                          "after"
                        ]
                      }
                    },
                    "manifest": {
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "string",
                          "enum": [
                            "coingecko"
                          ]
                        },
                        "resolution": {
                          "type": "string",
                          "enum": [
                            "hourly",
                            "daily"
                          ]
                        },
                        "availabilityAssumption": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 4096
                        },
                        "assetIds": {
                          "maxItems": 16,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128,
                            "pattern": "^(?!(?:constructor|prototype|__proto__)$)[a-z0-9][a-z0-9._-]*$"
                          }
                        },
                        "tokenMappings": {
                          "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."
                              },
                              "assetId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128,
                                "pattern": "^(?!(?:constructor|prototype|__proto__)$)[a-z0-9][a-z0-9._-]*$"
                              }
                            },
                            "required": [
                              "tokenId",
                              "decimals",
                              "assetId"
                            ]
                          }
                        },
                        "firstAt": {
                          "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "lastAt": {
                          "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "source",
                        "resolution",
                        "availabilityAssumption",
                        "assetIds",
                        "tokenMappings",
                        "firstAt",
                        "lastAt"
                      ]
                    },
                    "skippedByReason": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "additionalProperties": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "holdings": {
                      "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})$"
                          }
                        },
                        "required": [
                          "tokenId",
                          "decimals",
                          "amountRaw"
                        ]
                      }
                    },
                    "trades": {
                      "maxItems": 1000,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "plannedAt": {
                            "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                          },
                          "filledAt": {
                            "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                          },
                          "actionIndex": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 15
                          },
                          "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})$"
                              }
                            },
                            "required": [
                              "tokenId",
                              "decimals",
                              "amountRaw"
                            ]
                          },
                          "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})$"
                              }
                            },
                            "required": [
                              "tokenId",
                              "decimals",
                              "amountRaw"
                            ]
                          },
                          "costUsdDecimal": {
                            "type": "string",
                            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                          }
                        },
                        "required": [
                          "plannedAt",
                          "filledAt",
                          "actionIndex",
                          "input",
                          "output",
                          "costUsdDecimal"
                        ]
                      }
                    },
                    "contributions": {
                      "maxItems": 1000,
                      "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})$"
                          },
                          "at": {
                            "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                            "description": "When the modeled input contribution and purchase settle together."
                          },
                          "actionIndex": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 15
                          },
                          "valueUsdDecimal": {
                            "type": "string",
                            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$",
                            "description": "Historical USD value of the contributed input tokens at the modeled fill, before trading costs."
                          }
                        },
                        "required": [
                          "tokenId",
                          "decimals",
                          "amountRaw",
                          "at",
                          "actionIndex",
                          "valueUsdDecimal"
                        ]
                      }
                    },
                    "equity": {
                      "maxItems": 1000,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "at": {
                            "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                          },
                          "valueUsdDecimal": {
                            "type": "string",
                            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                          },
                          "contributedValueUsdDecimal": {
                            "description": "Cumulative external contributions through this point, present for contribution-funded estimates. Subtract it and the starting value from portfolio value to chart profit.",
                            "type": "string",
                            "pattern": "^-?(0|[1-9]\\d{0,77})(\\.\\d{1,36})?$"
                          }
                        },
                        "required": [
                          "at",
                          "valueUsdDecimal"
                        ]
                      }
                    }
                  },
                  "required": [
                    "status",
                    "reason",
                    "metrics",
                    "counts",
                    "throughAt",
                    "limitations",
                    "scenario",
                    "scenarioHash",
                    "dataHash",
                    "engineVersion",
                    "timingChanges",
                    "manifest",
                    "skippedByReason",
                    "holdings",
                    "trades",
                    "equity"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidInput"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The operation lost to the current state.\n\n- `automation_changed` — the automation changed while this request was handled; read it again and retry",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/automations/{id}/webhook": {
      "post": {
        "operationId": "automations.receiveEvent",
        "summary": "Send an automation event",
        "tags": [
          "automations"
        ],
        "description": "Delivers an event from your system to an automation that runs on incoming events. Authenticate with its webhook secret in `X-Automation-Key` (not your API key). Answers `202` when the event is recorded and `200` when you already sent the same event `id`, so resending is safe. Events must be under 5 minutes old and at most 16 KiB.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$",
                    "description": "A caller-chosen id for this event, used to deduplicate exact replays within one activation. Reuse with changed data conflicts."
                  },
                  "type": {
                    "type": "string",
                    "pattern": "^[A-Za-z][A-Za-z0-9_.:-]{0,79}$",
                    "description": "This event's own `type`, as the sender reports it."
                  },
                  "occurredAt": {
                    "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 event happened, as the sender reports it."
                  },
                  "data": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "$ref": "#/components/schemas/AutomationJsonValueInput"
                    },
                    "description": "Arbitrary JSON data: an event's data, a reader's configuration, or a source plan's configuration. Bounded to 16 KiB, 8 levels of nesting and 256 entries."
                  }
                },
                "required": [
                  "id",
                  "type",
                  "occurredAt",
                  "data"
                ],
                "additionalProperties": false,
                "description": "One event, shaped as an automation's inbound webhook receives it: an id, a type, when it happened, and its data."
              }
            }
          },
          "description": "One event, shaped as an automation's inbound webhook receives it: an id, a type, when it happened, and its data."
        },
        "parameters": [
          {
            "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": "path",
            "name": "id",
            "required": true,
            "description": "The automation's id."
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{43}$"
            },
            "in": "header",
            "name": "x-automation-key",
            "required": true,
            "description": "The current automation source credential returned once by owner-authorized rotation. It permits ingestion only, never user reads, commands or financial consent."
          }
        ],
        "security": [
          {
            "automationSourceKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The identical event was already retained.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "recorded",
                        "duplicate"
                      ],
                      "description": "`recorded` when the event is new; `duplicate` when the same event `id` with the same content was already received."
                    },
                    "inputId": {
                      "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 id the event was recorded under, for your logs. Recording an event does not mean its condition matched or that anything ran."
                    }
                  },
                  "required": [
                    "status",
                    "inputId"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "The source event was durably retained for evaluation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "recorded",
                        "duplicate"
                      ],
                      "description": "`recorded` when the event is new; `duplicate` when the same event `id` with the same content was already received."
                    },
                    "inputId": {
                      "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 id the event was recorded under, for your logs. Recording an event does not mean its condition matched or that anything ran."
                    }
                  },
                  "required": [
                    "status",
                    "inputId"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The authenticated event is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized",
                        "automation completed",
                        "invalid event",
                        "event id conflict",
                        "too many events"
                      ],
                      "description": "A source-ingress refusal. Source credential validation precedes event validation; changed event bytes under an existing identity conflict."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The source credential is absent, invalid or no longer current.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized",
                        "automation completed",
                        "invalid event",
                        "event id conflict",
                        "too many events"
                      ],
                      "description": "A source-ingress refusal. Source credential validation precedes event validation; changed event bytes under an existing identity conflict."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "The event id already identifies different content.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized",
                        "automation completed",
                        "invalid event",
                        "event id conflict",
                        "too many events"
                      ],
                      "description": "A source-ingress refusal. Source credential validation precedes event validation; changed event bytes under an existing identity conflict."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "410": {
            "description": "The automation's firing policy is complete.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized",
                        "automation completed",
                        "invalid event",
                        "event id conflict",
                        "too many events"
                      ],
                      "description": "A source-ingress refusal. Source credential validation precedes event validation; changed event bytes under an existing identity conflict."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "413": {
            "description": "The request exceeds the maximum body size.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "The source rate limit refused this event; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized",
                        "automation completed",
                        "invalid event",
                        "event id conflict",
                        "too many events"
                      ],
                      "description": "A source-ingress refusal. Source credential validation precedes event validation; changed event bytes under an existing identity conflict."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "users",
      "description": "Create users and sign them in.",
      "x-displayName": "Users"
    },
    {
      "name": "conversations",
      "description": "Chat threads between a user and their agent, including the main conversation.",
      "x-displayName": "Conversations"
    },
    {
      "name": "events",
      "description": "A conversation's events, as pages or as a live stream.",
      "x-displayName": "Events"
    },
    {
      "name": "runs",
      "description": "The agent's work on one message: start, follow and cancel it, and send feedback on its reply.",
      "x-displayName": "Runs"
    },
    {
      "name": "voice",
      "description": "Talking instead of typing: a recording turned into text for the user to send.",
      "x-displayName": "Voice"
    },
    {
      "name": "questions",
      "description": "Questionnaires the agent is waiting for a user to answer.",
      "x-displayName": "Questions"
    },
    {
      "name": "approvals",
      "description": "Actions the agent is waiting for the user to approve.",
      "x-displayName": "Approvals"
    },
    {
      "name": "wallets",
      "description": "The agent wallet: creating it, balances, deposits, withdrawals, trades and limit orders.",
      "x-displayName": "Agent wallet"
    },
    {
      "name": "perps",
      "description": "The agent's Hyperliquid perpetuals account and its live balance state.",
      "x-displayName": "perps"
    },
    {
      "name": "prediction",
      "description": "The agent's Polymarket account on Polygon and its live pUSD balance.",
      "x-displayName": "prediction"
    },
    {
      "name": "solana",
      "description": "The agent's own Solana account and what it holds, and Solana tokens to look up.",
      "x-displayName": "solana"
    },
    {
      "name": "activity",
      "description": "One feed of the user's trades and withdrawals.",
      "x-displayName": "Activity"
    },
    {
      "name": "notifications",
      "description": "What Fin told the user: their inbox, and marking it read.",
      "x-displayName": "Notifications"
    },
    {
      "name": "suggestions",
      "description": "What Fin suggests for each page of your app: moves on the user's own orders, automations and money, with the terms their review draws.",
      "x-displayName": "suggestions"
    },
    {
      "name": "budgets",
      "description": "The user's AI usage budget for today and this month.",
      "x-displayName": "Budget"
    },
    {
      "name": "partner",
      "description": "Your AI usage and rate limits, and your users' notifications to deliver.",
      "x-displayName": "Your usage"
    },
    {
      "name": "market",
      "description": "Market briefs: what part of the market did and why, with sources, for a partner key alone.",
      "x-displayName": "Market briefs"
    },
    {
      "name": "automations",
      "description": "Tasks the agent runs on a schedule or when an event arrives.",
      "x-displayName": "Automations"
    },
    {
      "name": "baskets",
      "description": "Idea baskets, their bought positions and estimated values, for enabled partners.",
      "x-displayName": "baskets"
    }
  ],
  "x-fin-reasons": [
    {
      "reason": "run_active",
      "status": 409,
      "meaning": "a run already holds this conversation"
    },
    {
      "reason": "budget_exhausted",
      "status": 429,
      "meaning": "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"
    },
    {
      "reason": "approval_not_pending",
      "status": 409,
      "meaning": "the approval was already decided or has expired, or its id does not exist or belongs to a different conversation"
    },
    {
      "reason": "execution_capacity",
      "status": 429,
      "meaning": "no capacity is free to run this right now; honour `Retry-After`"
    },
    {
      "reason": "execution_unavailable",
      "status": 503,
      "meaning": "the service that runs the agent could not take the work; `retryable` says whether to try again"
    },
    {
      "reason": "stop_pending",
      "status": 409,
      "meaning": "a stop is already in progress and its cleanup is not yet confirmed"
    },
    {
      "reason": "automation_changed",
      "status": 409,
      "meaning": "the automation changed while this request was handled; read it again and retry"
    },
    {
      "reason": "automation_held",
      "status": 409,
      "meaning": "an operator holds the automation; it fires again when released"
    },
    {
      "reason": "automation_invalid",
      "status": 409,
      "meaning": "the automation's definition cannot run as written"
    },
    {
      "reason": "automation_paused",
      "status": 409,
      "meaning": "the automation is paused; resume it first"
    },
    {
      "reason": "automation_has_no_webhook",
      "status": 409,
      "meaning": "the automation does not run on incoming events, so it has no webhook"
    },
    {
      "reason": "automation_limit",
      "status": 409,
      "meaning": "the user already has as many automations as the deployment allows"
    },
    {
      "reason": "profile_unknown_tool",
      "status": 400,
      "meaning": "`profile.tools` names a tool this deployment does not have"
    },
    {
      "reason": "deployment_paused",
      "status": 503,
      "meaning": "an operator paused this kind of work for the deployment; try again later"
    },
    {
      "reason": "run_not_active",
      "status": 409,
      "meaning": "the run named in the path is not the conversation's live run"
    },
    {
      "reason": "withdrawal_changed",
      "status": 409,
      "meaning": "the request key already binds different withdrawal terms, or the current balance cannot cover the requested amount"
    },
    {
      "reason": "swap_changed",
      "status": 409,
      "meaning": "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"
    },
    {
      "reason": "order_changed",
      "status": 409,
      "meaning": "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"
    },
    {
      "reason": "prediction_order_changed",
      "status": 409,
      "meaning": "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"
    },
    {
      "reason": "solana_trade_changed",
      "status": 409,
      "meaning": "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"
    },
    {
      "reason": "trade_not_recoverable",
      "status": 409,
      "meaning": "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"
    },
    {
      "reason": "order_not_cancelable",
      "status": 409,
      "meaning": "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"
    },
    {
      "reason": "grid_not_active",
      "status": 409,
      "meaning": "the grid is not running, so it cannot be paused: it is already paused, stopping or ended. Read the grid for where it stands"
    },
    {
      "reason": "grid_not_paused",
      "status": 409,
      "meaning": "the grid is not paused, so there is nothing to resume. Read the grid for where it stands"
    },
    {
      "reason": "suggestion_changed",
      "status": 409,
      "meaning": "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"
    },
    {
      "reason": "request_key_conflict",
      "status": 409,
      "meaning": "the request identity already binds different terms; retrieve the original resource or use a new identity for a new request"
    },
    {
      "reason": "question_not_pending",
      "status": 409,
      "meaning": "the questionnaire has already been answered, closed, or is not awaiting this submission"
    },
    {
      "reason": "flag_changed",
      "status": 409,
      "meaning": "the flag's targeting changed since you read it; read it again and retry"
    },
    {
      "reason": "group_changed",
      "status": 409,
      "meaning": "the group changed or was deleted since you read it; read it again and retry"
    },
    {
      "reason": "group_in_use",
      "status": 409,
      "meaning": "a flag's rules still name this group; take it out of those rules first"
    },
    {
      "reason": "group_name_taken",
      "status": 409,
      "meaning": "another group already has this name"
    },
    {
      "reason": "agent_wallet_required",
      "status": 409,
      "meaning": "create the agent wallet before opening a perps, prediction-market or Solana account"
    },
    {
      "reason": "wallet_account_unsupported",
      "status": 409,
      "meaning": "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"
    },
    {
      "reason": "conversation_deleted",
      "status": 410,
      "meaning": "the conversation was deleted; its history stays readable"
    },
    {
      "reason": "automation_deleted",
      "status": 410,
      "meaning": "the automation was deleted"
    },
    {
      "reason": "grid_ended",
      "status": 410,
      "meaning": "the grid stopped, expired or failed; it stays readable but takes no command. A new grid needs the user's approval in chat"
    },
    {
      "reason": "credential_expired",
      "status": 401,
      "meaning": "the user token has expired; obtain a fresh one"
    },
    {
      "reason": "account_disabled",
      "status": 403,
      "meaning": "an operator disabled the account"
    },
    {
      "reason": "perps_disabled",
      "status": 403,
      "meaning": "perps is not enabled for this user"
    },
    {
      "reason": "prediction_disabled",
      "status": 403,
      "meaning": "prediction-market trading is not enabled for this user"
    },
    {
      "reason": "solana_disabled",
      "status": 403,
      "meaning": "Solana trading is not enabled for this user"
    },
    {
      "reason": "no_account",
      "status": 404,
      "meaning": "the user has not opened the account this call reads; open it first"
    },
    {
      "reason": "not_available_in_region",
      "status": 403,
      "meaning": "perps funding is unavailable in the user's region for this request; withdrawals remain available"
    },
    {
      "reason": "steering_disabled",
      "status": 403,
      "meaning": "steering a working run is not turned on for this user; send the message with Start a run once the run ends"
    },
    {
      "reason": "baskets_disabled",
      "status": 403,
      "meaning": "idea baskets are not turned on for this user; hide the Ideas pages and their baskets"
    },
    {
      "reason": "basket_buying",
      "status": 409,
      "meaning": "the basket is still buying, so it cannot be deleted yet; try again once its result is in"
    },
    {
      "reason": "basket_awaiting_approval",
      "status": 409,
      "meaning": "an approval to buy this basket is still open; decline it in the chat, then delete the basket"
    },
    {
      "reason": "basket_step_not_failed",
      "status": 409,
      "meaning": "the step bought, or the basket is not partly bought, so no order can be linked to it; read the basket again"
    },
    {
      "reason": "basket_step_linked",
      "status": 409,
      "meaning": "another order is already linked to this step; a link is permanent, so read the basket again"
    },
    {
      "reason": "basket_order_not_linkable",
      "status": 400,
      "meaning": "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"
    },
    {
      "reason": "voice_disabled",
      "status": 403,
      "meaning": "voice input is not turned on for this user; let them type instead"
    },
    {
      "reason": "voice_unavailable",
      "status": 503,
      "meaning": "this deployment has no speech model, so it cannot transcribe recordings; let the user type instead"
    },
    {
      "reason": "provider_unavailable",
      "status": 503,
      "meaning": "an external provider the call depends on did not answer"
    },
    {
      "reason": "quote_refused",
      "status": 400,
      "meaning": "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"
    },
    {
      "reason": "invalid_input",
      "status": 400,
      "meaning": "the body or query failed validation; `issues` names each field"
    },
    {
      "reason": "internal",
      "status": 500,
      "meaning": "a fault on our side; quote `requestId` when reporting it"
    },
    {
      "reason": "partner_key_required",
      "status": 401,
      "meaning": "no `X-Api-Key` header was sent"
    },
    {
      "reason": "partner_key_invalid",
      "status": 401,
      "meaning": "the `X-Api-Key` is unknown or revoked"
    },
    {
      "reason": "subject_mismatch",
      "status": 403,
      "meaning": "the `{userId}` in the path is not the token's user"
    },
    {
      "reason": "origin_rejected",
      "status": 403,
      "meaning": "a browser `Origin` other than the configured web origin"
    },
    {
      "reason": "permission_required",
      "status": 403,
      "meaning": "the verified credential is not permitted to make this call"
    },
    {
      "reason": "signature_required",
      "status": 403,
      "meaning": "creating the agent wallet needs the user's signature: send the user's signature of `creation.message` from Get the agent wallet as `authorization`"
    },
    {
      "reason": "asset_not_withdrawable",
      "status": 403,
      "meaning": "tokenized stocks cannot be withdrawn; sell them first"
    },
    {
      "reason": "asset_not_swappable",
      "status": 403,
      "meaning": "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"
    },
    {
      "reason": "asset_not_tradable",
      "status": 403,
      "meaning": "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"
    },
    {
      "reason": "solana_token_not_tradable",
      "status": 403,
      "meaning": "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"
    },
    {
      "reason": "limit_orders_disabled",
      "status": 403,
      "meaning": "limit orders are not enabled for this user"
    },
    {
      "reason": "grid_trading_disabled",
      "status": 403,
      "meaning": "grid trading is not enabled for this user, so a paused grid cannot be resumed; pausing and cancelling a grid are never gated"
    },
    {
      "reason": "deposit_limit_exceeded",
      "status": 429,
      "meaning": "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"
    },
    {
      "reason": "policy_change_throttled",
      "status": 429,
      "meaning": "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"
    },
    {
      "reason": "agent_slippage_exceeded",
      "status": 403,
      "meaning": "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"
    },
    {
      "reason": "agent_api_orders_unavailable",
      "status": 403,
      "meaning": "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"
    },
    {
      "reason": "destination_not_allowed",
      "status": 403,
      "meaning": "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"
    },
    {
      "reason": "rate_limited",
      "status": 429,
      "meaning": "the per-key or per-user limit is spent; honour `Retry-After`"
    },
    {
      "reason": "partner_request_capacity",
      "status": 429,
      "meaning": "this partner's request quota across all keys and replicas is spent; honour Retry-After"
    },
    {
      "reason": "partner_run_capacity",
      "status": 429,
      "meaning": "this partner's active run quota is full; honour Retry-After and reuse the same request identity"
    },
    {
      "reason": "stream_capacity",
      "status": 429,
      "meaning": "the partner, user or replica has no free stream capacity; honour `Retry-After`"
    },
    {
      "reason": "invalid_cursor",
      "status": 400,
      "meaning": "the `cursor` is not one this list minted"
    },
    {
      "reason": "invalid_question_answer",
      "status": 400,
      "meaning": "the questionnaire answer does not match its questions or allowed choices"
    },
    {
      "reason": "question_closed",
      "status": 410,
      "meaning": "the questionnaire expired or was cancelled"
    },
    {
      "reason": "unknown_target",
      "status": 400,
      "meaning": "a rule names a partner, group or user that does not exist, or a user outside the partners the same rule names"
    },
    {
      "reason": "scope_invalid",
      "status": 400,
      "meaning": "a subject in the scope is not a subject id, or appears twice"
    },
    {
      "reason": "subject_unsupported",
      "status": 404,
      "meaning": "a subject in the scope is not one market briefs cover; list them with List market subjects"
    },
    {
      "reason": "brief_not_found",
      "status": 404,
      "meaning": "no market brief job with this id was created with your partner key"
    },
    {
      "reason": "briefs_busy",
      "status": 429,
      "meaning": "your market briefs are at their limit of briefs generating at once; retry after `Retry-After`"
    },
    {
      "reason": "market_briefs_disabled",
      "status": 403,
      "meaning": "market briefs are not turned on for your partner key"
    },
    {
      "reason": "story_not_found",
      "status": 404,
      "meaning": "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"
    }
  ],
  "servers": [
    {
      "url": "https://{host}",
      "variables": {
        "host": {
          "default": "api.example.test",
          "description": "The Fin deployment your key belongs to."
        }
      }
    }
  ]
}
