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

# Sign transaction

> Signs (and, where applicable, sponsors and submits) a transaction from a derived wallet identified by `addressIndex`. **Asynchronous by default**, like transfers: sponsored signs are validated, recorded, and answered `202` with the `PENDING` transaction while the relay executes on-chain. Poll [Get transaction by id](/api-reference/wallet/get-transaction-by-id) or pass `webhookUrl` to be notified of the outcome (see [Transfer lifecycle](/api-reference/wallet/overview#transfer-lifecycle-and-outcome-delivery)). Pass `waitForCompletion: true` for the legacy synchronous mode, which holds the request open and answers `200` with the relay result (`txHash`, `gasUsed`, `feeWei`). Local-only signing (a non-EVM chain with `addressIndex`; nothing is broadcast) always answers `200` with the signed transaction. Requires the `wallet.hd.sign` capability and an `Idempotency-Key` header. See [Idempotency](/getting-started/conventions#idempotency).



## OpenAPI

````yaml POST /v1/wallet/hd/sign
openapi: 3.1.0
info:
  title: Convexity Infra API
  version: 1.0.0
  description: >-
    REST API reference for Convexity Infra: the backend services your business
    integrates to build and operate on-chain products. Every response is wrapped
    in a `{ status, message, data }` envelope and authorized with an OAuth 2.0
    bearer token minted by Auth-Edge.
  contact:
    name: Convexity Infra
    url: https://withconvexity.com
    email: infra@withconvexity.com
servers:
  - url: https://dev.api.withconvexity.com
    description: Development
security:
  - bearerAuth: []
tags:
  - name: Auth-Edge
    description: >-
      OAuth 2.0 token issuance. Exchange a project API key for a short-lived
      bearer token that authorizes every other Infra API call.
  - name: Projects
    description: >-
      Manage the calling project itself: rotate its API key pair and control
      which IP addresses may authenticate with it.
  - name: Payments
    description: >-
      List project and subscription payments, and mint virtual bank accounts
      (via KoraPay) for wallet top-ups and subscriptions.
  - name: Products
    description: >-
      Browse the products and capabilities available to your project. Each
      product maps to a plan and a set of capability keys.
  - name: Subscriptions
    description: List available plans and manage your project's subscriptions.
  - name: Wallet
    description: >-
      HD wallet lifecycle, balances, transfers, transaction signing, and
      supported-chain discovery. Wallets are scoped to the business in your
      token: accessing another business's wallet returns `403`.


      **Capabilities**: each operation is gated on a capability granted by your
      plan; a missing one returns `403: Missing required capability:
      <capability>`.


      | Capability | Grants |

      |---|---|

      | `wallet.hd.generate` | Generate wallets. |

      | `wallet.hd.read` | List and read wallets, counts, and HD status. |

      | `wallet.hd.sign` | Sign transactions. |

      | `wallet.hd.deactivate` | Deactivate a wallet. |

      | `wallet.transfer.create` | Initiate transfers. |

      | `wallet.transfer.read` | Read transaction history and records. |

      | `wallet.balance.read` | Read the USD balance. |
  - name: Indexer
    description: >-
      Subscribe to decoded on-chain events, receive signed webhooks, and inspect
      or replay delivery logs. Every endpoint requires a token with project +
      business context and a per-operation capability.
  - name: Tokenization
    description: >-
      Issue and manage tokenized real-world assets: create tokens, mint, burn,
      transfer, manage holders and registered wallets, and run yield operations
      (coupons, distributions, claims, and principal redemption).
paths:
  /v1/wallet/hd/sign:
    post:
      tags:
        - Wallet
      summary: Sign transaction
      description: >-
        Signs (and, where applicable, sponsors and submits) a transaction from a
        derived wallet identified by `addressIndex`. **Asynchronous by
        default**, like transfers: sponsored signs are validated, recorded, and
        answered `202` with the `PENDING` transaction while the relay executes
        on-chain. Poll [Get transaction by
        id](/api-reference/wallet/get-transaction-by-id) or pass `webhookUrl` to
        be notified of the outcome (see [Transfer
        lifecycle](/api-reference/wallet/overview#transfer-lifecycle-and-outcome-delivery)).
        Pass `waitForCompletion: true` for the legacy synchronous mode, which
        holds the request open and answers `200` with the relay result
        (`txHash`, `gasUsed`, `feeWei`). Local-only signing (a non-EVM chain
        with `addressIndex`; nothing is broadcast) always answers `200` with the
        signed transaction. Requires the `wallet.hd.sign` capability and an
        `Idempotency-Key` header. See
        [Idempotency](/getting-started/conventions#idempotency).
      operationId: signTransaction
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
          example: 0c1d2e3f-4a5b-6c7d-8e9f-001122334455
          description: >-
            Unique client-generated key (use a UUID) that makes this request
            safe to retry. A retry sent with the same key returns the original
            result instead of submitting again. See
            [Idempotency](/getting-started/conventions#idempotency).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - chainType
                - addressIndex
                - transaction
              properties:
                chainType:
                  type: string
                  enum:
                    - EVM
                    - SOLANA
                addressIndex:
                  type: integer
                  description: HD index of the signing wallet.
                chainId:
                  type: integer
                  description: Target chain id (e.g. `8453`). Required for EVM.
                network:
                  type: string
                  enum:
                    - MAINNET
                    - TESTNET
                transaction:
                  type: object
                  required:
                    - to
                  properties:
                    to:
                      type: string
                      description: Recipient address.
                    value:
                      type: string
                      description: Native value in smallest unit.
                    data:
                      type: string
                      description: Calldata (hex).
                waitForCompletion:
                  type: boolean
                  description: >-
                    Optional. `true` = legacy synchronous mode: hold the request
                    open for the relay outcome (`200` with `txHash`) instead of
                    `202` + poll. Defaults to `false`.
                webhookUrl:
                  type: string
                  format: uri
                  maxLength: 2048
                  description: >-
                    Optional. POST the final transaction here once execution
                    settles (`wallet.sign.completed` / `wallet.sign.failed`).
                    HTTPS only in production; private/internal hosts rejected.
                    Delivery is signed and retried. See [Outcome
                    webhook](/api-reference/wallet/overview#outcome-webhook).
                webhookSecret:
                  type: string
                  minLength: 16
                  maxLength: 256
                  description: >-
                    Optional (requires `webhookUrl`). Your own HMAC key for the
                    webhook signature: verify deliveries with the value you
                    sent. Held in memory only; never persisted or logged.
            examples:
              asyncWithWebhook:
                summary: Sponsored sign (async + webhook)
                value:
                  chainType: EVM
                  chainId: 8453
                  addressIndex: 12
                  transaction:
                    to: '0x2222222222222222222222222222222222222222'
                    value: '0'
                    data: 0xa9059cbb…
                  webhookUrl: https://example.com/hooks/wallet
                  webhookSecret: a-secret-you-generate-and-keep
              waitForCompletion:
                summary: Legacy synchronous mode
                value:
                  chainType: EVM
                  chainId: 8453
                  addressIndex: 12
                  transaction:
                    to: '0x2222222222222222222222222222222222222222'
                    value: '0'
                    data: 0xa9059cbb…
                  waitForCompletion: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
              example:
                status: true
                message: Transaction signed successfully
                data:
                  signedTransaction: 0x02f8b18221058084...c0a0e1
        '202':
          description: >-
            Accepted (default for sponsored signs): the sign is recorded and
            relaying. Poll `GET /v1/wallet/transaction/{transactionId}` until
            `status` is `COMPLETED` or `FAILED`, or receive the outcome at
            `webhookUrl`.
          content:
            application/json:
              example:
                status: true
                message: Sign accepted
                data:
                  id: 9a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9
                  type: CONTRACT_CALL
                  chainType: EVM
                  network: MAINNET
                  chainId: 8453
                  signerType: BUSINESS_HD
                  fromAddress: '0x71C7656EC7ab88b098defB751B7401B5f6d8976F'
                  addressIndex: 12
                  toAddress: '0x2222222222222222222222222222222222222222'
                  amount: null
                  tokenAddress: null
                  data: 0xa9059cbb…
                  value: '0'
                  txHash: null
                  status: PENDING
                  gasUsed: null
                  feeWei: null
                  explorerUrl: https://basescan.org
                  explorerTxUrl: null
                  createdAt: '2026-07-12T10:00:00.000Z'
                  updatedAt: '2026-07-12T10:00:00.000Z'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
              example:
                status: false
                message: 'chainId: chainId is required when addressIndex is provided'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
              example:
                status: false
                message: Authorization token is missing or malformed.
        '402':
          description: Payment required
          content:
            application/json:
              schema:
                type: object
              example:
                status: false
                message: No subscription found for this product's plan
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
              examples:
                403_Forbidden_test_token:
                  summary: 403 Forbidden – test token
                  value:
                    status: false
                    message: Test tokens are not allowed, please use your live api key.
                403_Forbidden_capability_not_granted:
                  summary: 403 Forbidden – capability not granted
                  value:
                    status: false
                    message: Capability wallet.hd.sign not granted
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                type: object
              example:
                status: false
                message: Too many requests. Please try again later.
                retryAfter: 60
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth 2.0 access token from Auth-Edge.

````