# Deny an action

Records the user's refusal and resumes the paused run, which carries on without the action. Returns the approval.

`POST /v1/users/{userId}/approvals/{approvalId}/deny`

## Authentication

Both headers are required.

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

## Path parameters



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


## Request body



```json
{
  "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
      }
    }
  }
}
```


## Request example

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

```sh
curl --request POST 'https://api.example.test/v1/users/YOUR_USER_ID/approvals/YOUR_APPROVAL_ID/deny' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Authorization: Bearer YOUR_USER_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{}'
```

## Responses

### 200

The approval, now denied.



```json
{
  "description": "The approval, now denied.",
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/Approval"
      }
    }
  }
}
```


### 400

The request could not be read as this operation expects.

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



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


### 401

A credential is missing, invalid or expired.

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



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


### 403

The credentials are valid but may not do this.

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



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


### 404

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



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


### 409

The operation lost to the current state.

- `approval_not_pending` — the approval was already decided or has expired, or its id does not exist or belongs to a different conversation
- `run_active` — a run already holds this conversation
- `stop_pending` — a stop is already in progress and its cleanup is not yet confirmed



```json
{
  "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

The body exceeds the size this deployment accepts.



```json
{
  "description": "The body exceeds the size this deployment accepts.",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 429

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

- `rate_limited` — the per-key or per-user limit is spent; honour `Retry-After`
- `partner_request_capacity` — this partner's request quota across all keys and replicas is spent; honour Retry-After
- `execution_capacity` — no capacity is free to run this right now; honour `Retry-After`
- `partner_run_capacity` — this partner's active run quota is full; honour Retry-After and reuse the same request identity



```json
{
  "description": "A limit refused the request; wait for `Retry-After` when it is sent.\n\n- `rate_limited` — the per-key or per-user limit is spent; honour `Retry-After`\n- `partner_request_capacity` — this partner's request quota across all keys and replicas is spent; honour Retry-After\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

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

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



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


### 503

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

- `internal` — a fault on our side; quote `requestId` when reporting it
- `execution_unavailable` — the service that runs the agent could not take the work; `retryable` says whether to try again



```json
{
  "description": "The service cannot take this right now (draining, a dependency did not answer, or an operator paused the work); `retryable` says whether to try again.\n\n- `internal` — a fault on our side; quote `requestId` when reporting it\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"
      }
    }
  }
}
```


## Complete OpenAPI definition

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



```json
{
  "operation": {
    "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"
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "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."
      },
      "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"
            }
          }
        ]
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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"
        ]
      },
      "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"
        ]
      },
      "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"
        ]
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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."
      },
      "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"
            }
          }
        ]
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The kind of problem as a URN, `urn:fin:error:<kind>`; stable, compare against it"
          },
          "title": {
            "type": "string",
            "description": "The kind's human title, for logs; never parse it"
          },
          "status": {
            "type": "integer",
            "minimum": 400,
            "maximum": 599,
            "description": "The HTTP status, repeated in the body"
          },
          "reason": {
            "description": "The machine-readable why. One of:\n\n- `run_active` (409) — a run already holds this conversation\n- `budget_exhausted` (429) — the user's AI usage budget, or your partner account's AI spend limit, is used up until the next day or month, or an operator froze it\n- `approval_not_pending` (409) — the approval was already decided or has expired, or its id does not exist or belongs to a different conversation\n- `execution_capacity` (429) — no capacity is free to run this right now; honour `Retry-After`\n- `execution_unavailable` (503) — the service that runs the agent could not take the work; `retryable` says whether to try again\n- `stop_pending` (409) — a stop is already in progress and its cleanup is not yet confirmed\n- `automation_changed` (409) — the automation changed while this request was handled; read it again and retry\n- `automation_held` (409) — an operator holds the automation; it fires again when released\n- `automation_invalid` (409) — the automation's definition cannot run as written\n- `automation_paused` (409) — the automation is paused; resume it first\n- `automation_has_no_webhook` (409) — the automation does not run on incoming events, so it has no webhook\n- `automation_limit` (409) — the user already has as many automations as the deployment allows\n- `profile_unknown_tool` (400) — `profile.tools` names a tool this deployment does not have\n- `deployment_paused` (503) — an operator paused this kind of work for the deployment; try again later\n- `run_not_active` (409) — the run named in the path is not the conversation's live run\n- `withdrawal_changed` (409) — the request key already binds different withdrawal terms, or the current balance cannot cover the requested amount\n- `swap_changed` (409) — the swap cannot be made as asked: an asset is no longer available or the current balance cannot cover the amount; get a new quote\n- `order_changed` (409) — the order can no longer be placed as prepared: the agent wallet no longer holds the amount, an asset is no longer offered, or its minimum no longer matches the assets' precision; prepare it again\n- `prediction_order_changed` (409) — the Polymarket order can no longer be placed as signed: the market closed or stopped taking orders, its price is off the market's tick or its size off Polymarket's minimum, its fee or cost would exceed the signed caps, the Polymarket account cannot cover it, or the signature lapsed before it was placed. Nothing was placed; prepare it again\n- `solana_trade_changed` (409) — the Solana trade can no longer run as signed: the token's decimals or program changed, the agent's Solana account or holdings no longer fit it, another Solana trade is running, or the signature lapsed before it started. Nothing moved; prepare it again\n- `trade_not_recoverable` (409) — the original trade or a recovery attempt remains active or uncertain, its unfinished actions lack conclusive recovery proof, or its remaining proposal can no longer be used\n- `order_not_cancelable` (409) — the limit order can no longer be cancelled: it filled or expired, or the swap provider never took it. Read the order for where it stands\n- `grid_not_active` (409) — the grid is not running, so it cannot be paused: it is already paused, stopping or ended. Read the grid for where it stands\n- `grid_not_paused` (409) — the grid is not paused, so there is nothing to resume. Read the grid for where it stands\n- `suggestion_changed` (409) — the suggestion no longer holds: the account or the market moved since fin made it, the user set it aside, or it cannot be made where the user is now. Say it changed, and read the page's suggestions again\n- `request_key_conflict` (409) — the request identity already binds different terms; retrieve the original resource or use a new identity for a new request\n- `question_not_pending` (409) — the questionnaire has already been answered, closed, or is not awaiting this submission\n- `flag_changed` (409) — the flag's targeting changed since you read it; read it again and retry\n- `group_changed` (409) — the group changed or was deleted since you read it; read it again and retry\n- `group_in_use` (409) — a flag's rules still name this group; take it out of those rules first\n- `group_name_taken` (409) — another group already has this name\n- `agent_wallet_required` (409) — create the agent wallet before opening a perps, prediction-market or Solana account\n- `wallet_account_unsupported` (409) — the user's wallet is an Agent API wallet, whose Intents account is a 0x address this route cannot name; read it with Get wallet account, Get wallet account balances and Open a wallet account session instead\n- `conversation_deleted` (410) — the conversation was deleted; its history stays readable\n- `automation_deleted` (410) — the automation was deleted\n- `grid_ended` (410) — the grid stopped, expired or failed; it stays readable but takes no command. A new grid needs the user's approval in chat\n- `credential_expired` (401) — the user token has expired; obtain a fresh one\n- `account_disabled` (403) — an operator disabled the account\n- `perps_disabled` (403) — perps is not enabled for this user\n- `prediction_disabled` (403) — prediction-market trading is not enabled for this user\n- `solana_disabled` (403) — Solana trading is not enabled for this user\n- `no_account` (404) — the user has not opened the account this call reads; open it first\n- `not_available_in_region` (403) — perps funding is unavailable in the user's region for this request; withdrawals remain available\n- `steering_disabled` (403) — steering a working run is not turned on for this user; send the message with Start a run once the run ends\n- `baskets_disabled` (403) — idea baskets are not turned on for this user; hide the Ideas pages and their baskets\n- `basket_buying` (409) — the basket is still buying, so it cannot be deleted yet; try again once its result is in\n- `basket_awaiting_approval` (409) — an approval to buy this basket is still open; decline it in the chat, then delete the basket\n- `basket_step_not_failed` (409) — the step bought, or the basket is not partly bought, so no order can be linked to it; read the basket again\n- `basket_step_linked` (409) — another order is already linked to this step; a link is permanent, so read the basket again\n- `basket_order_not_linkable` (400) — the order cannot stand in for this step: it is not one of the step's `failures[].linkable` orders, or another basket step already holds it\n- `voice_disabled` (403) — voice input is not turned on for this user; let them type instead\n- `voice_unavailable` (503) — this deployment has no speech model, so it cannot transcribe recordings; let the user type instead\n- `provider_unavailable` (503) — an external provider the call depends on did not answer\n- `quote_refused` (400) — 1Click would not quote this request, usually an amount below what it routes or a pair it does not offer; nothing was reserved. Change the amount or the assets and quote again; for a deposit address, no address was issued, so offer another network\n- `invalid_input` (400) — the body or query failed validation; `issues` names each field\n- `internal` (500) — a fault on our side; quote `requestId` when reporting it\n- `partner_key_required` (401) — no `X-Api-Key` header was sent\n- `partner_key_invalid` (401) — the `X-Api-Key` is unknown or revoked\n- `subject_mismatch` (403) — the `{userId}` in the path is not the token's user\n- `origin_rejected` (403) — a browser `Origin` other than the configured web origin\n- `permission_required` (403) — the verified credential is not permitted to make this call\n- `signature_required` (403) — creating the agent wallet needs the user's signature: send the user's signature of `creation.message` from Get the agent wallet as `authorization`\n- `asset_not_withdrawable` (403) — tokenized stocks cannot be withdrawn; sell them first\n- `asset_not_swappable` (403) — the swap names an asset this user cannot buy or trade with this request: a tokenized stock with no `context.country`, or one where tokenized stocks are not available, or bought while buying them is not enabled for the user; or a yield vault's share token bought while the user's `earn` flag is off\n- `asset_not_tradable` (403) — the order names an asset this user cannot buy or trade with this request: a tokenized stock with no `context.country`, or one where tokenized stocks are not available, or bought while buying them is not enabled for the user; or a yield vault's share token bought while the user's `earn` flag is off\n- `solana_token_not_tradable` (403) — Fin won't trade this token: its mint lets someone freeze, move or charge for holdings or pause transfers, it can't be sold back, Fin couldn't read its mint, it has no reliable price, or it is wrapped SOL. A sale is refused only for what would stop it landing\n- `limit_orders_disabled` (403) — limit orders are not enabled for this user\n- `grid_trading_disabled` (403) — grid trading is not enabled for this user, so a paused grid cannot be resumed; pausing and cancelling a grid are never gated\n- `deposit_limit_exceeded` (429) — the deposit would take the agent wallet past the user's deposit limit, or, for a deposit address, the wallet has no room left under it; nothing was recorded. Read `depositLimit.availableCents` from Get balances for how much fits now, and deposit no more than that\n- `policy_change_throttled` (429) — the user's Agent API wallet changed what it allows a few minutes ago, and the NEAR Intents Agent API lets it change again only after a cooldown; nothing was asked or signed, so call again once `Retry-After` has passed\n- `agent_slippage_exceeded` (403) — the user's wallet is an Agent API wallet whose agent signs only trades that lose at most the share of their value its owner allowed (`max_slippage_bps`): fees, price and slippage together, by 1Click's own USD values at the quote's minimum output. This trade's quote loses more, states no USD value, or, before there is a quote, its loss bound is already quoted with more slippage than that (half the bound, plus 1Click's fee at the most it has been seen to take, 20 basis points, before an approval). Very small trades lose more to fixed fees; nothing was signed, so ask again with a larger amount or a smaller loss bound\n- `agent_api_orders_unavailable` (403) — the user's Agent API wallet needs wallet setup to enable limit orders, or the order exceeds this wallet's 168-hour maximum; finish wallet setup or choose at most 168 hours before trying again; nothing was approved or signed\n- `destination_not_allowed` (403) — the user's wallet is an Agent API wallet, whose agent pays a deposit only to itself, to a NEAR Intents account its owner listed (on the confidential ledger) or to an address on a chain its owner listed; allow this one with Add a withdrawal destination (one owner signature), then ask again. A public NEAR Intents account, or an address with no valid spelling on its chain, cannot be paid at all; nothing was signed\n- `rate_limited` (429) — the per-key or per-user limit is spent; honour `Retry-After`\n- `partner_request_capacity` (429) — this partner's request quota across all keys and replicas is spent; honour Retry-After\n- `partner_run_capacity` (429) — this partner's active run quota is full; honour Retry-After and reuse the same request identity\n- `stream_capacity` (429) — the partner, user or replica has no free stream capacity; honour `Retry-After`\n- `invalid_cursor` (400) — the `cursor` is not one this list minted\n- `invalid_question_answer` (400) — the questionnaire answer does not match its questions or allowed choices\n- `question_closed` (410) — the questionnaire expired or was cancelled\n- `unknown_target` (400) — a rule names a partner, group or user that does not exist, or a user outside the partners the same rule names\n- `scope_invalid` (400) — a subject in the scope is not a subject id, or appears twice\n- `subject_unsupported` (404) — a subject in the scope is not one market briefs cover; list them with List market subjects\n- `brief_not_found` (404) — no market brief job with this id was created with your partner key\n- `briefs_busy` (429) — your market briefs are at their limit of briefs generating at once; retry after `Retry-After`\n- `market_briefs_disabled` (403) — market briefs are not turned on for your partner key\n- `story_not_found` (404) — no market story with this id is current: it never was one, or Fin no longer shows it because its sources were withdrawn or its figures can no longer be read",
            "type": "string",
            "enum": [
              "run_active",
              "budget_exhausted",
              "approval_not_pending",
              "execution_capacity",
              "execution_unavailable",
              "stop_pending",
              "automation_changed",
              "automation_held",
              "automation_invalid",
              "automation_paused",
              "automation_has_no_webhook",
              "automation_limit",
              "profile_unknown_tool",
              "deployment_paused",
              "run_not_active",
              "withdrawal_changed",
              "swap_changed",
              "order_changed",
              "prediction_order_changed",
              "solana_trade_changed",
              "trade_not_recoverable",
              "order_not_cancelable",
              "grid_not_active",
              "grid_not_paused",
              "suggestion_changed",
              "request_key_conflict",
              "question_not_pending",
              "flag_changed",
              "group_changed",
              "group_in_use",
              "group_name_taken",
              "agent_wallet_required",
              "wallet_account_unsupported",
              "conversation_deleted",
              "automation_deleted",
              "grid_ended",
              "credential_expired",
              "account_disabled",
              "perps_disabled",
              "prediction_disabled",
              "solana_disabled",
              "no_account",
              "not_available_in_region",
              "steering_disabled",
              "baskets_disabled",
              "basket_buying",
              "basket_awaiting_approval",
              "basket_step_not_failed",
              "basket_step_linked",
              "basket_order_not_linkable",
              "voice_disabled",
              "voice_unavailable",
              "provider_unavailable",
              "quote_refused",
              "invalid_input",
              "internal",
              "partner_key_required",
              "partner_key_invalid",
              "subject_mismatch",
              "origin_rejected",
              "permission_required",
              "signature_required",
              "asset_not_withdrawable",
              "asset_not_swappable",
              "asset_not_tradable",
              "solana_token_not_tradable",
              "limit_orders_disabled",
              "grid_trading_disabled",
              "deposit_limit_exceeded",
              "policy_change_throttled",
              "agent_slippage_exceeded",
              "agent_api_orders_unavailable",
              "destination_not_allowed",
              "rate_limited",
              "partner_request_capacity",
              "partner_run_capacity",
              "stream_capacity",
              "invalid_cursor",
              "invalid_question_answer",
              "question_closed",
              "unknown_target",
              "scope_invalid",
              "subject_unsupported",
              "brief_not_found",
              "briefs_busy",
              "market_briefs_disabled",
              "story_not_found"
            ]
          },
          "requestId": {
            "type": "string",
            "description": "The id Fin used for this request; quote it when reporting a problem"
          },
          "retryable": {
            "type": "boolean",
            "description": "Whether repeating the same request later can succeed without changing it"
          },
          "detail": {
            "description": "Only on `invalid_input`: which part of the request failed validation",
            "type": "string"
          },
          "issues": {
            "description": "Only on `invalid_input`: one entry per failing field",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "description": "The JSON pointer of the failing field; empty for the root object"
                },
                "message": {
                  "type": "string",
                  "description": "Why the field failed"
                }
              },
              "required": [
                "path",
                "message"
              ]
            }
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "requestId",
          "retryable"
        ],
        "description": "RFC 9457 problem details: what every error response carries. Never a provider's message, a query or a stack."
      }
    },
    "responses": {
      "InvalidInput": {
        "description": "The request could not be read as this operation expects.\n\n- `invalid_input` — the body or query failed validation; `issues` names each field\n- `invalid_cursor` — the `cursor` is not one this list minted",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "A credential is missing, invalid or expired.\n\n- `partner_key_required` — no `X-Api-Key` header was sent\n- `partner_key_invalid` — the `X-Api-Key` is unknown or revoked\n- `credential_expired` — the user token has expired; obtain a fresh one",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The credentials are valid but may not do this.\n\n- `subject_mismatch` — the `{userId}` in the path is not the token's user\n- `account_disabled` — an operator disabled the account\n- `origin_rejected` — a browser `Origin` other than the configured web origin\n- `permission_required` — the verified credential is not permitted to make this call",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "NotFound": {
        "description": "The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "PayloadTooLarge": {
        "description": "The body exceeds the size this deployment accepts.",
        "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"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key"
      },
      "userToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "fin_session_<opaque>",
        "description": "A user's session token, from Create a session."
      }
    }
  }
}
```

