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

# Propose a transaction

> Simulates the input, checks the wallet's limits, then runs the judge against the wallet's mandate. An autonomous wallet executes an ALLOW with a clean, verifiable simulation. Everything else that is not blocked waits for the owner at `approvalUrl`. One credit when the judge runs; a proposal the limits block first is free.



## OpenAPI

````yaml /openapi.json post /api/v1/wallets/{id}/propose
openapi: 3.0.3
info:
  title: Chance API
  version: 1.0.0
  description: >-
    Verify an agent's proposed action against its rules, manage escrow wallets,
    and buy credits. Every verification returns a signed, hash-chained receipt.
servers:
  - url: https://harness.chance.cc
    description: Production
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Verification
    description: Check an action against its rules and fetch past verdicts.
  - name: Credits
    description: Balance and x402 top-ups.
  - name: Escrow wallets
    description: Wallets that only move funds through a verified proposal.
  - name: Trader
    description: Liveness reports from trader containers.
  - name: Gas sponsorship
    description: Sponsored gas for trader instances on Polygon.
  - name: Status
    description: Public deployment facts for checking receipts.
paths:
  /api/v1/wallets/{id}/propose:
    post:
      tags:
        - Escrow wallets
      summary: Propose a transaction
      description: >-
        Simulates the input, checks the wallet's limits, then runs the judge
        against the wallet's mandate. An autonomous wallet executes an ALLOW
        with a clean, verifiable simulation. Everything else that is not blocked
        waits for the owner at `approvalUrl`. One credit when the judge runs; a
        proposal the limits block first is free.
      operationId: proposeTransaction
      parameters:
        - name: id
          in: path
          required: true
          description: The wallet's id (UUID) or its name.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProposeRequest'
            examples:
              transfer:
                summary: Named transfer
                value:
                  input:
                    kind: transfer
                    chain: base
                    transfer:
                      asset: USDC
                      amount: '25'
                      to: '0x1111111111111111111111111111111111111111'
                  note: Monthly payment to the design contractor.
              evm_transaction:
                summary: One EVM transaction
                value:
                  input:
                    kind: evm_transaction
                    caip2: eip155:8453
                    transaction:
                      to: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
                      value: '0'
                      data: >-
                        0xa9059cbb000000000000000000000000111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000017d7840
              evm_calls:
                summary: EVM batch
                value:
                  input:
                    kind: evm_calls
                    chain: base
                    calls:
                      - to: 0x…
                        data: 0x…
                      - to: 0x…
                        data: 0x…
              solana_transaction:
                summary: Solana transaction
                value:
                  input:
                    kind: solana_transaction
                    chain: solana
                    transaction: AQAAAA…
              starknet_calls:
                summary: Starknet multicall
                value:
                  input:
                    kind: starknet_calls
                    chain: starknet
                    calls:
                      - contractAddress: 0x…
                        entrypoint: transfer
                        calldata:
                          - 0x…
                          - '1000000'
                          - '0'
      responses:
        '200':
          description: The proposal outcome.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProposalResult'
        '400':
          description: >-
            Invalid body or input, or an action this wallet cannot take. No
            credit charged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                e0:
                  summary: invalid JSON body
                  value:
                    error: invalid JSON body
                e1:
                  summary: input is required
                  value:
                    error: input is required
                e2:
                  summary: invalid_input
                  value:
                    error: invalid_input
                    message: >-
                      input.transfer.amount must be a plain decimal string in
                      whole token units (e.g. "1.5"); got "1e3"
                e3:
                  summary: propose_failed
                  value:
                    error: propose_failed
                    message: action targets Base but this wallet is on Starknet
        '401':
          description: No API key, or the key is unknown or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                e0:
                  summary: missing API key (send x-api-key)
                  value:
                    error: missing API key (send x-api-key)
                e1:
                  summary: invalid or revoked API key
                  value:
                    error: invalid or revoked API key
        '402':
          description: Out of credits. The proposal is recorded as blocked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: propose_failed
                message: No credits remaining. …
        '404':
          description: No such wallet on this account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: not_found
        '409':
          description: >-
            The wallet cannot transact: archived, or a safe wallet from before
            self-custodial safe mode.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: propose_failed
                message: wallet is not active
        '500':
          description: Unexpected failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: propose_failed
                message: …
        '502':
          description: >-
            The judge run failed. The credit was refunded and the proposal is
            blocked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: propose_failed
                message: …
components:
  schemas:
    ProposeRequest:
      type: object
      required:
        - input
      properties:
        input:
          $ref: '#/components/schemas/ProposalInput'
        note:
          type: string
          description: >-
            Context for the judge, treated as untrusted narration. Cut at 2,000
            characters.
    ProposalResult:
      type: object
      properties:
        txId:
          type: string
          description: >-
            Escrow transaction id. Poll it at
            `/api/v1/escrow-transactions/{id}`.
        status:
          type: string
          enum:
            - blocked
            - awaiting_user
            - executing
            - executed
            - failed
        verdict:
          type: string
          nullable: true
          description: >-
            ALLOW, BLOCK or ESCALATE. `BLOCK` without a `scanId` means the
            wallet's limits refused it before the judge ran.
        reasoning:
          type: string
          nullable: true
        requestHash:
          type: string
          description: >-
            Hash of the canonical payload the wallet will sign. Execution
            recomputes it and refuses on a mismatch.
        simulation:
          type: object
          allOf:
            - $ref: '#/components/schemas/SimulationReport'
          nullable: true
        approvalUrl:
          type: string
          nullable: true
          description: >-
            Set when the proposal waits for the owner. Send it to them; an API
            key cannot confirm.
        txHash:
          type: string
          nullable: true
          description: Set when the proposal executed.
        scanId:
          type: string
          nullable: true
          description: Verification id. Null when no judge ran.
        creditsRemaining:
          type: integer
          nullable: true
          description: Null when no credit was charged.
        proof:
          type: object
          allOf:
            - $ref: '#/components/schemas/CreatedProof'
          nullable: true
          description: Null when no judge ran.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: >-
            An error code (for example `out_of_credits`) or a short sentence
            (for example `intent is required`).
        message:
          type: string
          description: Detail, when present.
    ProposalInput:
      description: One proposal. Send `caip2` or `chain`. `x402_payment` is refused here.
      oneOf:
        - $ref: '#/components/schemas/EvmTransactionInput'
        - $ref: '#/components/schemas/EvmCallsInput'
        - $ref: '#/components/schemas/SolanaTransactionInput'
        - $ref: '#/components/schemas/StarknetCallsInput'
        - $ref: '#/components/schemas/TransferInput'
      discriminator:
        propertyName: kind
        mapping:
          evm_transaction:
            $ref: '#/components/schemas/EvmTransactionInput'
          evm_calls:
            $ref: '#/components/schemas/EvmCallsInput'
          solana_transaction:
            $ref: '#/components/schemas/SolanaTransactionInput'
          starknet_calls:
            $ref: '#/components/schemas/StarknetCallsInput'
          transfer:
            $ref: '#/components/schemas/TransferInput'
    SimulationReport:
      type: object
      properties:
        ok:
          type: boolean
        status:
          type: string
          enum:
            - clean
            - reverted
            - unavailable
          description: Only `clean` can execute without the owner.
        declared:
          type: boolean
          description: >-
            True when the effects come from a named transfer rather than a
            trace.
        wouldRevert:
          type: boolean
          nullable: true
        error:
          type: string
          nullable: true
        caip2:
          type: string
        changes:
          type: array
          items:
            $ref: '#/components/schemas/AssetChange'
        totalUsdOut:
          type: number
          nullable: true
        totalUsdIn:
          type: number
          nullable: true
        gasUsed:
          type: string
          nullable: true
        logsExcerpt:
          type: array
          items:
            type: string
        warnings:
          type: array
          items:
            type: string
        simulatedAt:
          type: string
          format: date-time
        provider:
          type: string
          nullable: true
          enum:
            - tatum
            - alchemy
            - starknet-rpc
            - null
    CreatedProof:
      type: object
      properties:
        transcriptRoot:
          type: string
          nullable: true
          description: Head of the transcript hash chain.
        outputHash:
          type: string
          nullable: true
          description: keccak256 of the judge's full output text.
        signature:
          type: string
          nullable: true
          description: EIP-191 signature by the judge key over the run digest.
        judge:
          type: string
          nullable: true
          description: Address of the judge key.
        attested:
          type: boolean
          description: True when the signing key's attestation mode is Azure SEV-SNP.
        anchorTx:
          type: string
          nullable: true
          description: Anchor transaction hash. Null when anchoring was skipped or failed.
        anchorVerified:
          type: boolean
          description: >-
            True when the registry confirmed the record after the anchor
            transaction.
        transcriptUri:
          type: string
          description: >-
            `/api/runs/{runId}/transcript`. Owner-only: send the owning
            account's API key, or open `/verify/{runId}` signed in.
        explorerTx:
          type: string
          nullable: true
          description: >-
            Explorer link for the anchor: basescan.org for Base, voyager.online
            for Starknet.
    EvmTransactionInput:
      type: object
      required:
        - kind
        - transaction
      properties:
        kind:
          type: string
          enum:
            - evm_transaction
        caip2:
          type: string
          enum:
            - eip155:1
            - eip155:8453
            - solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
            - starknet:SN_MAIN
          description: Target chain. Must be the wallet's chain.
        chain:
          type: string
          enum:
            - ethereum
            - base
            - solana
            - starknet
          description: Alternative to `caip2`.
        transaction:
          type: object
          additionalProperties: true
          description: >-
            `{to, value?, data?}`. `from`, if sent, must be the wallet. `value`
            may be decimal or hex. Fee fields above 1 ETH are refused.
    EvmCallsInput:
      type: object
      required:
        - kind
        - calls
      properties:
        kind:
          type: string
          enum:
            - evm_calls
        caip2:
          type: string
          enum:
            - eip155:1
            - eip155:8453
            - solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
            - starknet:SN_MAIN
          description: Target chain. Must be the wallet's chain.
        chain:
          type: string
          enum:
            - ethereum
            - base
            - solana
            - starknet
          description: Alternative to `caip2`.
        calls:
          type: array
          minItems: 1
          items:
            type: object
            additionalProperties: true
          description: Batch of `{to, value?, data?}` executed together.
    SolanaTransactionInput:
      type: object
      required:
        - kind
        - transaction
      properties:
        kind:
          type: string
          enum:
            - solana_transaction
        caip2:
          type: string
          enum:
            - eip155:1
            - eip155:8453
            - solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
            - starknet:SN_MAIN
          description: Target chain. Must be the wallet's chain.
        chain:
          type: string
          enum:
            - ethereum
            - base
            - solana
            - starknet
          description: Alternative to `caip2`.
        transaction:
          type: string
          description: Base64 serialized Solana transaction.
    StarknetCallsInput:
      type: object
      required:
        - kind
        - calls
      properties:
        kind:
          type: string
          enum:
            - starknet_calls
        caip2:
          type: string
          enum:
            - eip155:1
            - eip155:8453
            - solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
            - starknet:SN_MAIN
          description: Target chain. Must be the wallet's chain.
        chain:
          type: string
          enum:
            - ethereum
            - base
            - solana
            - starknet
          description: Alternative to `caip2`.
        calls:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/StarknetCall'
          description: Executed as one multicall.
        proof:
          type: object
          required:
            - facts
            - data
          description: >-
            STRK20 proof, only for calls to the privacy pool's `apply_actions`.
            Not stored and not part of `requestHash`.
          properties:
            facts:
              type: array
              minItems: 1
              maxItems: 64
              items:
                type: string
              description: Hex felts.
            data:
              type: string
              description: Base64 proof, under 4 MB.
    TransferInput:
      type: object
      required:
        - kind
        - transfer
      properties:
        kind:
          type: string
          enum:
            - transfer
        caip2:
          type: string
          enum:
            - eip155:1
            - eip155:8453
            - solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
            - starknet:SN_MAIN
          description: Target chain. Must be the wallet's chain.
        chain:
          type: string
          enum:
            - ethereum
            - base
            - solana
            - starknet
          description: Alternative to `caip2`.
        transfer:
          type: object
          required:
            - asset
            - amount
            - to
          properties:
            asset:
              type: string
              description: >-
                Symbol, for example `USDC`. On Starknet: STRK, ETH, USDC or
                USDT.
            amount:
              type: string
              description: >-
                Plain decimal in whole token units, greater than zero, for
                example `"1.5"`.
            to:
              type: string
              description: Recipient address.
    AssetChange:
      type: object
      properties:
        direction:
          type: string
          enum:
            - in
            - out
        assetType:
          type: string
          enum:
            - native
            - erc20
            - erc721
            - erc1155
            - spl
        changeType:
          type: string
          nullable: true
          enum:
            - transfer
            - approve
            - null
        symbol:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        contractAddress:
          type: string
          nullable: true
        rawAmount:
          type: string
        decimals:
          type: integer
          nullable: true
        amount:
          type: string
          nullable: true
        usdValue:
          type: number
          nullable: true
        counterparty:
          type: string
          nullable: true
        logoUrl:
          type: string
          nullable: true
    StarknetCall:
      type: object
      required:
        - contractAddress
        - entrypoint
      properties:
        contractAddress:
          type: string
        entrypoint:
          type: string
        calldata:
          type: array
          items:
            type: string
          description: Felts as 0x hex or decimal strings.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: An API key (`chance_sk_live_…`) from https://harness.chance.cc/keys.
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        The same API key sent as `Authorization: Bearer <key>`. If both headers
        are sent, `x-api-key` is used.

````