> ## Documentation Index
> Fetch the complete documentation index at: https://docs.near-intents.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Move a confidential balance back to public

> Refused. Every request, whatever its body (`dry` included), is answered 400 `public_balance_exit_only` before anything is read or sent. The agent's account is its confidential balance, and the legacy public balance can only be emptied: shield moves it to the confidential balance and a withdrawal with `confidential: false` pays it out. Unshields recorded earlier still read and settle through `GET /v1/status` and history. The agent's account is its confidential balance. It, and the transfers and swaps made from it, live on `intents.far`, the NEAR Intents confidential deployment on FAR: a permissioned NEAR-protocol chain run by a small validator set with no public RPC. That keeps them off the public NEAR chain. It is access control, not cryptography, and the API cannot prove it: FAR's operators and Defuse can read confidential state and grant others access, the 1Click solver layer sees each intent in plaintext, shielding and unshielding appear on the public chain, cross-chain deposits and withdrawals are public on their own chains and can be matched by amount and timing, and the agent has one confidential identity, its custody wallet. Wherever `X-Grant-Token` is required, a `public_key` grant may send `X-Grant-Proof` instead (never both): a JWT its key signs for this grant ID and request (URL, method, body and Idempotency-Key). The proof is spent on first use. A retry signs a new proof for the same grant ID and Idempotency-Key. A refused proof reads `grant_proof_invalid`.



## OpenAPI

````yaml https://api.agentsonintents.com/openapi.json post /v1/agents/{agent_id}/unshield
openapi: 3.1.0
info:
  title: NEAR Intents Agent API
  version: 1.0.0
  description: >-
    Backend API for AI agents that trade on NEAR Intents under an owner-signed
    policy.


    The Agent API is an experimental, mainnet-only beta. You and your users may
    lose all assets used with it, or lose access to them. It is operated by NEAR
    Technologies Limited.


    Before an owner signs `agent_create`, show the Owner Terms, OutLayer's terms
    and the required risk notice, and keep evidence of acceptance. Show the
    notice again before the owner funds the wallet. `preview.summary` ends with
    the notice.


    Authenticate with `X-API-Key`. Create and revoke keys at
    partners.near-intents.org; each expires after 365 days. Keep the key on your
    backend.


    Owner actions use generate-intent → owner wallet signs `intent.payload`
    unchanged → submit-intent → GET /v1/status. Agent actions (swap, withdraw,
    transfer, …) need no owner signature, only `X-Grant-Token` for a live owner
    grant (who may act), or `X-Grant-Proof` signed by a `public_key` grant's key
    for each request; the account policy decides what every grant may do, and
    return a `correlation_id` for GET /v1/status.


    The agent's account is its confidential balance: swaps, limit orders,
    transfers, deposit addresses, withdrawals and balance reads use it by
    default. The legacy public balance can only be emptied, by shield or a
    withdrawal with `confidential: false`; any other request on it is refused
    with `public_balance_exit_only`.


    Errors are JSON:API documents. Every field, parameter and error code is
    snake_case. Branch on `errors[].code`, never on `title`. `UNCERTAIN` means
    the outcome is not yet proven: keep polling the same `correlation_id` and
    never resubmit under a new `Idempotency-Key`. `PENDING_DEPOSIT` is a deposit
    address waiting for funds; a withdrawal's bridge leg reads `PROCESSING`.
    `NEEDS_REVIEW` stops routine polling: inspect `details.reason`, never retry,
    then use `refresh=true` after provider/manual resolution.
servers:
  - url: https://api.agentsonintents.com
security: []
tags:
  - name: Owner intents
  - name: Status
  - name: Agents
  - name: Policy
  - name: Grants
  - name: Approvals
  - name: Executions
  - name: Native accounts
  - name: Meta
paths:
  /v1/agents/{agent_id}/unshield:
    post:
      tags:
        - Executions
      summary: Move a confidential balance back to public
      description: >-
        Refused. Every request, whatever its body (`dry` included), is answered
        400 `public_balance_exit_only` before anything is read or sent. The
        agent's account is its confidential balance, and the legacy public
        balance can only be emptied: shield moves it to the confidential balance
        and a withdrawal with `confidential: false` pays it out. Unshields
        recorded earlier still read and settle through `GET /v1/status` and
        history. The agent's account is its confidential balance. It, and the
        transfers and swaps made from it, live on `intents.far`, the NEAR
        Intents confidential deployment on FAR: a permissioned NEAR-protocol
        chain run by a small validator set with no public RPC. That keeps them
        off the public NEAR chain. It is access control, not cryptography, and
        the API cannot prove it: FAR's operators and Defuse can read
        confidential state and grant others access, the 1Click solver layer sees
        each intent in plaintext, shielding and unshielding appear on the public
        chain, cross-chain deposits and withdrawals are public on their own
        chains and can be matched by amount and timing, and the agent has one
        confidential identity, its custody wallet. Wherever `X-Grant-Token` is
        required, a `public_key` grant may send `X-Grant-Proof` instead (never
        both): a JWT its key signs for this grant ID and request (URL, method,
        body and Idempotency-Key). The proof is spent on first use. A retry
        signs a new proof for the same grant ID and Idempotency-Key. A refused
        proof reads `grant_proof_invalid`.
      operationId: unshield
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9a-f]{64}$
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            Stable key for one logical request. Replays with the same key and
            body return the original result; a different body is refused with
            `idempotency_conflict`.
          schema:
            type: string
            minLength: 8
            maxLength: 128
            pattern: ^[A-Za-z0-9._:-]+$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                asset:
                  type: string
                  minLength: 1
                  maxLength: 256
                amount:
                  type: string
                  pattern: ^(?!0+$)[0-9]{1,78}$
              required:
                - asset
                - amount
              additionalProperties: false
      responses:
        '202':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusResponse'
        '400':
          description: >-
            Error document. Documented codes: `agent_grant_required`,
            `grant_proof_invalid`, `policy_action_denied`,
            `policy_asset_denied`, `policy_transaction_limit_exceeded`,
            `policy_limit_exceeded`, `policy_action_limit_exceeded`,
            `policy_usage_unavailable`, `policy_destination_denied`,
            `policy_schedule_denied`, `policy_not_ready`, `policy_denied`,
            `insufficient_balance`, `amount_too_low`, `route_unavailable`,
            `provider_refused`, `provider_unavailable`, `unsupported_chain`,
            `unsupported_token`, `invalid_address`, `refund_address_required`,
            `provider_limit_reached`, `wallet_busy`, `wallet_frozen`,
            `idempotency_conflict`, `authorization_stale`,
            `public_balance_exit_only`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDocument'
        '401':
          description: >-
            Error document. Documented codes: `agent_grant_required`,
            `grant_proof_invalid`, `policy_action_denied`,
            `policy_asset_denied`, `policy_transaction_limit_exceeded`,
            `policy_limit_exceeded`, `policy_action_limit_exceeded`,
            `policy_usage_unavailable`, `policy_destination_denied`,
            `policy_schedule_denied`, `policy_not_ready`, `policy_denied`,
            `insufficient_balance`, `amount_too_low`, `route_unavailable`,
            `provider_refused`, `provider_unavailable`, `unsupported_chain`,
            `unsupported_token`, `invalid_address`, `refund_address_required`,
            `provider_limit_reached`, `wallet_busy`, `wallet_frozen`,
            `idempotency_conflict`, `authorization_stale`,
            `public_balance_exit_only`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDocument'
        '403':
          description: >-
            Error document. Documented codes: `agent_grant_required`,
            `grant_proof_invalid`, `policy_action_denied`,
            `policy_asset_denied`, `policy_transaction_limit_exceeded`,
            `policy_limit_exceeded`, `policy_action_limit_exceeded`,
            `policy_usage_unavailable`, `policy_destination_denied`,
            `policy_schedule_denied`, `policy_not_ready`, `policy_denied`,
            `insufficient_balance`, `amount_too_low`, `route_unavailable`,
            `provider_refused`, `provider_unavailable`, `unsupported_chain`,
            `unsupported_token`, `invalid_address`, `refund_address_required`,
            `provider_limit_reached`, `wallet_busy`, `wallet_frozen`,
            `idempotency_conflict`, `authorization_stale`,
            `public_balance_exit_only`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDocument'
        '404':
          description: >-
            Error document. Documented codes: `agent_grant_required`,
            `grant_proof_invalid`, `policy_action_denied`,
            `policy_asset_denied`, `policy_transaction_limit_exceeded`,
            `policy_limit_exceeded`, `policy_action_limit_exceeded`,
            `policy_usage_unavailable`, `policy_destination_denied`,
            `policy_schedule_denied`, `policy_not_ready`, `policy_denied`,
            `insufficient_balance`, `amount_too_low`, `route_unavailable`,
            `provider_refused`, `provider_unavailable`, `unsupported_chain`,
            `unsupported_token`, `invalid_address`, `refund_address_required`,
            `provider_limit_reached`, `wallet_busy`, `wallet_frozen`,
            `idempotency_conflict`, `authorization_stale`,
            `public_balance_exit_only`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDocument'
        '409':
          description: >-
            Error document. Documented codes: `agent_grant_required`,
            `grant_proof_invalid`, `policy_action_denied`,
            `policy_asset_denied`, `policy_transaction_limit_exceeded`,
            `policy_limit_exceeded`, `policy_action_limit_exceeded`,
            `policy_usage_unavailable`, `policy_destination_denied`,
            `policy_schedule_denied`, `policy_not_ready`, `policy_denied`,
            `insufficient_balance`, `amount_too_low`, `route_unavailable`,
            `provider_refused`, `provider_unavailable`, `unsupported_chain`,
            `unsupported_token`, `invalid_address`, `refund_address_required`,
            `provider_limit_reached`, `wallet_busy`, `wallet_frozen`,
            `idempotency_conflict`, `authorization_stale`,
            `public_balance_exit_only`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDocument'
        '410':
          description: >-
            Error document. Documented codes: `agent_grant_required`,
            `grant_proof_invalid`, `policy_action_denied`,
            `policy_asset_denied`, `policy_transaction_limit_exceeded`,
            `policy_limit_exceeded`, `policy_action_limit_exceeded`,
            `policy_usage_unavailable`, `policy_destination_denied`,
            `policy_schedule_denied`, `policy_not_ready`, `policy_denied`,
            `insufficient_balance`, `amount_too_low`, `route_unavailable`,
            `provider_refused`, `provider_unavailable`, `unsupported_chain`,
            `unsupported_token`, `invalid_address`, `refund_address_required`,
            `provider_limit_reached`, `wallet_busy`, `wallet_frozen`,
            `idempotency_conflict`, `authorization_stale`,
            `public_balance_exit_only`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDocument'
        '429':
          description: >-
            Error document. Documented codes: `agent_grant_required`,
            `grant_proof_invalid`, `policy_action_denied`,
            `policy_asset_denied`, `policy_transaction_limit_exceeded`,
            `policy_limit_exceeded`, `policy_action_limit_exceeded`,
            `policy_usage_unavailable`, `policy_destination_denied`,
            `policy_schedule_denied`, `policy_not_ready`, `policy_denied`,
            `insufficient_balance`, `amount_too_low`, `route_unavailable`,
            `provider_refused`, `provider_unavailable`, `unsupported_chain`,
            `unsupported_token`, `invalid_address`, `refund_address_required`,
            `provider_limit_reached`, `wallet_busy`, `wallet_frozen`,
            `idempotency_conflict`, `authorization_stale`,
            `public_balance_exit_only`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDocument'
        '502':
          description: >-
            Error document. Documented codes: `agent_grant_required`,
            `grant_proof_invalid`, `policy_action_denied`,
            `policy_asset_denied`, `policy_transaction_limit_exceeded`,
            `policy_limit_exceeded`, `policy_action_limit_exceeded`,
            `policy_usage_unavailable`, `policy_destination_denied`,
            `policy_schedule_denied`, `policy_not_ready`, `policy_denied`,
            `insufficient_balance`, `amount_too_low`, `route_unavailable`,
            `provider_refused`, `provider_unavailable`, `unsupported_chain`,
            `unsupported_token`, `invalid_address`, `refund_address_required`,
            `provider_limit_reached`, `wallet_busy`, `wallet_frozen`,
            `idempotency_conflict`, `authorization_stale`,
            `public_balance_exit_only`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDocument'
        '503':
          description: >-
            Error document. Documented codes: `agent_grant_required`,
            `grant_proof_invalid`, `policy_action_denied`,
            `policy_asset_denied`, `policy_transaction_limit_exceeded`,
            `policy_limit_exceeded`, `policy_action_limit_exceeded`,
            `policy_usage_unavailable`, `policy_destination_denied`,
            `policy_schedule_denied`, `policy_not_ready`, `policy_denied`,
            `insufficient_balance`, `amount_too_low`, `route_unavailable`,
            `provider_refused`, `provider_unavailable`, `unsupported_chain`,
            `unsupported_token`, `invalid_address`, `refund_address_required`,
            `provider_limit_reached`, `wallet_busy`, `wallet_frozen`,
            `idempotency_conflict`, `authorization_stale`,
            `public_balance_exit_only`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDocument'
      security:
        - ApiKey: []
          GrantToken: []
        - ApiKey: []
          GrantProof: []
components:
  schemas:
    StatusResponse:
      oneOf:
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: agent_create
            details:
              type: object
              properties:
                revision:
                  anyOf:
                    - type: integer
                      exclusiveMinimum: 0
                      maximum: 9007199254740991
                    - type: 'null'
                policy_hash:
                  type:
                    - string
                    - 'null'
                transaction_hash:
                  type:
                    - string
                    - 'null'
                agent_id:
                  type: string
                  pattern: ^[0-9a-f]{64}$
              required:
                - revision
                - policy_hash
                - transaction_hash
                - agent_id
              additionalProperties: false
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: policy_update
            details:
              type: object
              properties:
                revision:
                  anyOf:
                    - type: integer
                      exclusiveMinimum: 0
                      maximum: 9007199254740991
                    - type: 'null'
                policy_hash:
                  type:
                    - string
                    - 'null'
                transaction_hash:
                  type:
                    - string
                    - 'null'
              required:
                - revision
                - policy_hash
                - transaction_hash
              additionalProperties: false
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: agent_freeze
            details:
              type: object
              properties:
                revision:
                  anyOf:
                    - type: integer
                      exclusiveMinimum: 0
                      maximum: 9007199254740991
                    - type: 'null'
                policy_hash:
                  type:
                    - string
                    - 'null'
                transaction_hash:
                  type:
                    - string
                    - 'null'
              required:
                - revision
                - policy_hash
                - transaction_hash
              additionalProperties: false
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: agent_unfreeze
            details:
              type: object
              properties:
                revision:
                  anyOf:
                    - type: integer
                      exclusiveMinimum: 0
                      maximum: 9007199254740991
                    - type: 'null'
                policy_hash:
                  type:
                    - string
                    - 'null'
                transaction_hash:
                  type:
                    - string
                    - 'null'
              required:
                - revision
                - policy_hash
                - transaction_hash
              additionalProperties: false
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: grant_issue
            details:
              type: object
              properties:
                grant:
                  anyOf:
                    - $ref: '#/components/schemas/GrantView'
                    - type: 'null'
              required:
                - grant
              additionalProperties: false
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: grant_revoke
            details:
              type: object
              properties:
                grant_id:
                  type:
                    - string
                    - 'null'
                committed_correlation_ids:
                  anyOf:
                    - type: array
                      items:
                        type: string
                        pattern: ^op_[A-Za-z0-9_-]{43}$
                    - type: 'null'
                committed_cancellations:
                  anyOf:
                    - maxItems: 100
                      type: array
                      items:
                        type: object
                        properties:
                          order_id:
                            type:
                              - string
                              - 'null'
                          committed_at:
                            type: string
                        required:
                          - order_id
                          - committed_at
                        additionalProperties: false
                    - type: 'null'
                committed_truncated:
                  type:
                    - boolean
                    - 'null'
              required:
                - grant_id
                - committed_correlation_ids
                - committed_cancellations
                - committed_truncated
              additionalProperties: false
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: execution_cancel
            details:
              type: object
              properties:
                cancelled_correlation_id:
                  anyOf:
                    - type: string
                      pattern: ^op_[A-Za-z0-9_-]{43}$
                    - type: 'null'
              required:
                - cancelled_correlation_id
              additionalProperties: false
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: agent_archive
            details:
              type: object
              properties:
                archived:
                  type:
                    - boolean
                    - 'null'
              required:
                - archived
              additionalProperties: false
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: agent_restore
            details:
              type: object
              properties:
                archived:
                  type:
                    - boolean
                    - 'null'
              required:
                - archived
              additionalProperties: false
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: agent_delete
            details:
              $ref: '#/components/schemas/ExecutionDetails'
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: approval_vote
            details:
              type: object
              properties:
                approval_id:
                  type:
                    - string
                    - 'null'
                verdict:
                  anyOf:
                    - type: string
                      enum:
                        - approve
                        - reject
                    - type: 'null'
                repeat_required:
                  type:
                    - boolean
                    - 'null'
                confirmation:
                  type: string
                  const: cancellation_observed
              required:
                - approval_id
                - verdict
                - repeat_required
              additionalProperties: false
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: swap
            details:
              $ref: '#/components/schemas/ExecutionDetails'
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: limit_order
            details:
              $ref: '#/components/schemas/ExecutionDetails'
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: withdraw
            details:
              $ref: '#/components/schemas/ExecutionDetails'
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: transfer
            details:
              $ref: '#/components/schemas/ExecutionDetails'
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: shield
            details:
              $ref: '#/components/schemas/ExecutionDetails'
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: unshield
            details:
              $ref: '#/components/schemas/ExecutionDetails'
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: deposit
            details:
              $ref: '#/components/schemas/ExecutionDetails'
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
        - type: object
          properties:
            correlation_id:
              anyOf:
                - type: string
                  pattern: ^op_[A-Za-z0-9_-]{43}$
                - type: string
                  pattern: ^intent_[A-Za-z0-9_-]{43}$
            agent_id:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: 'null'
            status:
              type: string
              enum:
                - PENDING_SIGNATURE
                - QUEUED
                - PENDING_APPROVAL
                - PENDING_DEPOSIT
                - PROCESSING
                - SUCCESS
                - REFUNDED
                - FAILED
                - UNCERTAIN
                - NEEDS_REVIEW
            failure_code:
              type:
                - string
                - 'null'
            created_at:
              type: string
            updated_at:
              type: string
            dispatch_committed_at:
              type:
                - string
                - 'null'
            grant:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    label:
                      type: string
                  required:
                    - id
                    - label
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: native
            details:
              type: object
              properties:
                method:
                  type: string
                  enum:
                    - near_sign_message
                    - near_transfer
                    - near_call
                    - evm_sign_typed_data
                    - evm_sign_message
                    - evm_sign_intent
                    - evm_sign_transaction
                    - solana_sign_in
                    - solana_sign_message
                    - solana_sign_intent
                    - solana_sign_transfer
                    - solana_sign_transaction
                chain:
                  type: string
                  enum:
                    - near
                    - ethereum
                    - polygon
                    - base
                    - arbitrum
                    - optimism
                    - bsc
                    - avalanche
                    - hyperevm
                    - hood
                    - solana
                account_id:
                  type:
                    - string
                    - 'null'
                target:
                  type:
                    - string
                    - 'null'
                amount:
                  type:
                    - string
                    - 'null'
                method_name:
                  type:
                    - string
                    - 'null'
                primary_type:
                  type:
                    - string
                    - 'null'
                domain:
                  anyOf:
                    - type: object
                      properties:
                        name:
                          type: string
                          minLength: 1
                          maxLength: 128
                        version:
                          type: string
                          minLength: 1
                          maxLength: 64
                        chain_id:
                          type: integer
                          minimum: 0
                          maximum: 9007199254740991
                        verifying_contract:
                          type: string
                          pattern: ^0x[0-9a-f]{40}$
                        salt:
                          type: string
                          pattern: ^0x[0-9a-f]{64}$
                      additionalProperties: false
                    - type: 'null'
                message_json:
                  anyOf:
                    - type: string
                      maxLength: 65536
                    - type: 'null'
                request_sha256:
                  type: string
                signature:
                  type:
                    - string
                    - 'null'
                tx_hash:
                  type:
                    - string
                    - 'null'
                provider_request_id:
                  type:
                    - string
                    - 'null'
                provider_status:
                  type:
                    - string
                    - 'null'
                failure_reason:
                  type:
                    - string
                    - 'null'
              required:
                - method
                - chain
                - account_id
                - target
                - amount
                - method_name
                - primary_type
                - domain
                - message_json
                - request_sha256
                - signature
                - tx_hash
                - provider_request_id
                - provider_status
                - failure_reason
              additionalProperties: false
          required:
            - correlation_id
            - agent_id
            - status
            - failure_code
            - created_at
            - updated_at
            - dispatch_committed_at
            - grant
            - type
            - details
          additionalProperties: false
    ErrorDocument:
      type: object
      properties:
        errors:
          minItems: 1
          type: array
          items:
            type: object
            properties:
              status:
                type: string
                pattern: ^[1-5][0-9]{2}$
              code:
                type: string
                pattern: ^[a-z0-9]+(?:_[a-z0-9]+)*$
              layer:
                type: string
                enum:
                  - request
                  - auth
                  - grant
                  - policy
                  - budget
                  - balance
                  - provider
                  - api
              title:
                type: string
              detail:
                type: string
              source:
                type: object
                properties:
                  pointer:
                    type: string
                required:
                  - pointer
                additionalProperties: false
              meta:
                type: object
                properties:
                  retryable:
                    type: boolean
                  available_at:
                    type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                  min_amount:
                    type: string
                    pattern: ^[0-9]{1,78}$
                  available_amount:
                    type: string
                    pattern: ^[0-9]{1,78}$
                required:
                  - retryable
                additionalProperties: false
            required:
              - status
              - code
              - layer
              - title
            additionalProperties: false
        meta:
          type: object
          properties:
            request_id:
              type: string
          additionalProperties: false
      required:
        - errors
        - meta
      additionalProperties: false
    GrantView:
      type: object
      properties:
        grant_id:
          type: string
          pattern: ^[0-9a-f]{64}$
        agent_id:
          type: string
          pattern: ^[0-9a-f]{64}$
        wallet_id:
          type: string
        label:
          type: string
        issued_at:
          type: string
        expires_at:
          type: string
        revoked_at:
          type:
            - string
            - 'null'
        revoked_reason:
          type:
            - string
            - 'null'
        owner_epoch:
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
        credential_type:
          type: string
          enum:
            - token
            - oidc
            - public_key
        owner_message:
          type: object
          properties:
            domain:
              type: string
              const: near-intents-agent-api.agent-grant.v6
            owner:
              $ref: '#/components/schemas/OwnerWallet'
            tenant_id:
              type: string
              minLength: 1
              maxLength: 64
            agent_id:
              type: string
              pattern: ^[0-9a-f]{64}$
            wallet_id:
              type: string
              minLength: 1
              maxLength: 256
            label:
              type: string
              minLength: 1
              maxLength: 64
              pattern: ^[^\p{Cc}]+$
            credential:
              anyOf:
                - type: string
                  pattern: ^[0-9a-f]{64}$
                - type: object
                  properties:
                    type:
                      type: string
                      const: oidc
                    issuer:
                      type: string
                      minLength: 1
                      maxLength: 256
                      allOf:
                        - pattern: ^[\x20-\x7e]+$
                        - pattern: ^https:\/\/[!-~]+$
                    audience:
                      type: string
                      minLength: 1
                      maxLength: 512
                      pattern: ^[\x20-\x7e]+$
                    claims:
                      type: object
                      propertyNames:
                        type: string
                        maxLength: 128
                        pattern: >-
                          ^(?:[A-Za-z_][A-Za-z0-9_]{0,63}|(?:\/(?:[!-.0-}]|~[01])+){1,4})$
                      additionalProperties:
                        type: string
                        minLength: 1
                        maxLength: 256
                        pattern: ^[\x20-\x7e]+$
                    jwks:
                      type: object
                      properties:
                        keys:
                          minItems: 1
                          maxItems: 4
                          type: array
                          items:
                            oneOf:
                              - type: object
                                properties:
                                  kty:
                                    type: string
                                    const: RSA
                                  'n':
                                    type: string
                                    pattern: ^[A-Za-z0-9_-]{342,1366}$
                                  e:
                                    type: string
                                    pattern: ^[A-Za-z0-9_-]{1,8}$
                                  alg:
                                    type: string
                                    enum:
                                      - RS256
                                      - RS384
                                      - RS512
                                      - PS256
                                      - PS384
                                      - PS512
                                  kid:
                                    type: string
                                    minLength: 1
                                    maxLength: 128
                                    pattern: ^[\x20-\x7e]+$
                                  use:
                                    type: string
                                    const: sig
                                required:
                                  - kty
                                  - 'n'
                                  - e
                                additionalProperties: false
                              - type: object
                                properties:
                                  kty:
                                    type: string
                                    const: EC
                                  crv:
                                    type: string
                                    enum:
                                      - P-256
                                      - P-384
                                  x:
                                    type: string
                                    pattern: ^[A-Za-z0-9_-]{43,64}$
                                  'y':
                                    type: string
                                    pattern: ^[A-Za-z0-9_-]{43,64}$
                                  alg:
                                    type: string
                                    enum:
                                      - ES256
                                      - ES384
                                  kid:
                                    type: string
                                    minLength: 1
                                    maxLength: 128
                                    pattern: ^[\x20-\x7e]+$
                                  use:
                                    type: string
                                    const: sig
                                required:
                                  - kty
                                  - crv
                                  - x
                                  - 'y'
                                additionalProperties: false
                              - type: object
                                properties:
                                  kty:
                                    type: string
                                    const: OKP
                                  crv:
                                    type: string
                                    const: Ed25519
                                  x:
                                    type: string
                                    pattern: ^[A-Za-z0-9_-]{43,43}$
                                  alg:
                                    type: string
                                    enum:
                                      - EdDSA
                                      - Ed25519
                                  kid:
                                    type: string
                                    minLength: 1
                                    maxLength: 128
                                    pattern: ^[\x20-\x7e]+$
                                  use:
                                    type: string
                                    const: sig
                                required:
                                  - kty
                                  - crv
                                  - x
                                additionalProperties: false
                      required:
                        - keys
                      additionalProperties: false
                  required:
                    - type
                    - issuer
                    - audience
                    - claims
                  additionalProperties: false
                - type: object
                  properties:
                    type:
                      type: string
                      const: public_key
                    jwk:
                      oneOf:
                        - type: object
                          properties:
                            kty:
                              type: string
                              const: OKP
                            crv:
                              type: string
                              const: Ed25519
                            x:
                              type: string
                              pattern: ^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$
                          required:
                            - kty
                            - crv
                            - x
                          additionalProperties: false
                        - type: object
                          properties:
                            kty:
                              type: string
                              const: EC
                            crv:
                              type: string
                              const: P-256
                            x:
                              type: string
                              pattern: ^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$
                            'y':
                              type: string
                              pattern: ^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$
                          required:
                            - kty
                            - crv
                            - x
                            - 'y'
                          additionalProperties: false
                  required:
                    - type
                    - jwk
                  additionalProperties: false
            network:
              type: string
              const: mainnet
            issued_at_ms:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            expires_at_ms:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            owner_epoch:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            nonce:
              type: string
              minLength: 16
              maxLength: 64
            recipient:
              type: string
              minLength: 1
              maxLength: 253
          required:
            - domain
            - owner
            - tenant_id
            - agent_id
            - wallet_id
            - label
            - credential
            - network
            - issued_at_ms
            - expires_at_ms
            - owner_epoch
            - nonce
            - recipient
          additionalProperties: false
      required:
        - grant_id
        - agent_id
        - wallet_id
        - label
        - issued_at
        - expires_at
        - revoked_at
        - revoked_reason
        - owner_epoch
        - credential_type
        - owner_message
      additionalProperties: false
    ExecutionDetails:
      type: object
      properties:
        action:
          type: string
        request:
          type: object
          properties:
            origin_asset:
              type: string
              maxLength: 256
            destination_asset:
              type: string
              maxLength: 256
            asset:
              type: string
              maxLength: 256
            amount:
              type: string
              pattern: ^[0-9]{1,78}$
            min_amount_out:
              type: string
              pattern: ^[0-9]{1,78}$
            chain:
              type: string
              maxLength: 64
            recipient:
              type: string
              maxLength: 128
            memo:
              type: string
              maxLength: 256
            reference:
              type: string
              pattern: ^[\x21-\x7e]{1,128}$
            note:
              type: string
              pattern: ^[^\p{Cc}\p{Cs}\p{Zl}\p{Zp}]{1,500}$
            side:
              type: string
              enum:
                - sell
                - buy
            price:
              type: string
              maxLength: 40
            quantity:
              type: string
              pattern: ^[0-9]{1,78}$
            deadline:
              type: string
              maxLength: 40
            confidential:
              type: boolean
          additionalProperties: false
        near_account_id:
          type: string
        provider_request_id:
          type:
            - string
            - 'null'
        provider_status:
          type: string
        confidential:
          type: boolean
        chain:
          type: string
        execute_after:
          type: string
        delay_ms:
          type: number
        approval_id:
          type:
            - string
            - 'null'
        intent_hash:
          type:
            - string
            - 'null'
        tx_hash:
          type:
            - string
            - 'null'
        destination_tx_hash:
          type:
            - string
            - 'null'
        amount_out:
          type:
            - string
            - 'null'
        expected_amount_out:
          type: string
        deposit_address:
          type:
            - string
            - 'null'
        memo:
          type:
            - string
            - 'null'
        available_amount:
          type: string
        min_amount:
          type:
            - string
            - 'null'
        min_amount_out:
          type:
            - string
            - 'null'
        requested_min_amount_out:
          type: string
        requested_asset:
          type: string
        usd_value:
          type: string
          pattern: ^[0-9]{1,24}\.[0-9]{6}$
        order_id:
          type:
            - string
            - 'null'
        delivered:
          type:
            - string
            - 'null'
        expires_at:
          type:
            - string
            - 'null'
        refund_to:
          type:
            - string
            - 'null'
        deposit_seen_at:
          type: string
        refund_tx_hash:
          type:
            - string
            - 'null'
        failure_reason:
          type:
            - string
            - 'null'
        policy_record:
          type: object
          properties:
            status:
              type: string
              enum:
                - pending
                - deleted
                - absent
                - kept
                - unknown
            transaction_hash:
              type:
                - string
                - 'null'
            refund_to:
              type:
                - string
                - 'null'
            storage_deposit_yocto:
              type:
                - string
                - 'null'
            reason:
              type: string
          required:
            - status
            - transaction_hash
            - refund_to
            - storage_deposit_yocto
          additionalProperties: false
      required:
        - action
      additionalProperties: {}
    OwnerWallet:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              const: near
            account_id:
              type: string
              minLength: 2
              maxLength: 64
            public_key:
              type: string
              pattern: ^ed25519:[1-9A-HJ-NP-Za-km-z]{32,44}$
          required:
            - type
            - account_id
            - public_key
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: evm
            address:
              type: string
              pattern: ^0x[0-9a-f]{40}$
            chain_id:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            public_key:
              type: string
              pattern: ^0x[0-9a-f]{128}$
          required:
            - type
            - address
            - chain_id
            - public_key
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: passkey
            credential_id:
              type: string
              pattern: ^[A-Za-z0-9_-]+$
            public_key:
              type: string
              pattern: ^MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE[A-Za-z0-9_-]{85}[AQgw]$
            rp_id:
              type: string
              minLength: 1
              maxLength: 253
            origin:
              type: string
              format: uri
          required:
            - type
            - credential_id
            - public_key
            - rp_id
            - origin
          additionalProperties: false
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key
    GrantToken:
      type: apiKey
      in: header
      name: X-Grant-Token
      description: >-
        Token of the owner grant a delegated request runs under. The partner
        creates it and the owner signs its commitment; keep it on your backend.
    GrantProof:
      type: apiKey
      in: header
      name: X-Grant-Proof
      description: >-
        For a `public_key` grant, instead of `X-Grant-Token`: a JWT (compact
        JWS) the grant's key signs for this one request, so no bearer token
        crosses the wire. `alg` is `EdDSA` for an Ed25519 key, `ES256` for
        P-256; `iss` and `sub` are the key's RFC 9278 thumbprint URI; `grant_id`
        is the exact live grant ID, kept fixed on retries; `aud` is this API's
        origin plus the request path, without query or fragment, as one string;
        `htm` is the method, uppercase; `body_sha256` is the lowercase hex
        SHA-256 of the exact body bytes (of zero bytes when there is no body);
        `idempotency_key` is the request's `Idempotency-Key` exactly as sent,
        and absent when it sends none; `exp` is at most five minutes after
        `iat`; `jti` is 16 to 256 characters and spent on first use. Refusals
        read `grant_proof_invalid` (401).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.