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

# Generate Deposit

> Prepare unsigned transactions for cross-chain swaps

## QR Code Enrichment

When using **Chainflip** or **NEAR** as the selected protocol, the deposit response is automatically enriched with:

| Field             | Type   | Description                                                    |
| ----------------- | ------ | -------------------------------------------------------------- |
| `deposit_address` | string | The generated deposit address (Chainflip channel or NEAR)      |
| `payment_uri`     | string | Chain-specific payment URI (BIP-21, EIP-681, Solana Pay, etc.) |
| `qr_url`          | string | CDN URL of a QR code PNG encoding the `payment_uri`            |

These fields allow users to complete swaps by scanning a QR code from any wallet app, without needing to manually copy the deposit address.

<Note>
  These fields are only present for `chainflip` and `near` protocols. Other protocols (thorchain, mayachain, relay, etc.) return only `unsigned_transactions`.
</Note>

## Payment URI Standards

The `payment_uri` follows the wallet standard for the source chain:

| Source Chain                 | Standard   | Example                                              |
| ---------------------------- | ---------- | ---------------------------------------------------- |
| BTC, LTC, DOGE, DASH         | BIP-21     | `bitcoin:bc1q...?amount=0.5`                         |
| ETH, ARB, BASE (native)      | EIP-681    | `ethereum:0x...@1?value=500000000000000000`          |
| ETH, ARB, BASE (ERC20)       | EIP-681    | `ethereum:0xTOKEN@1/transfer?address=0x...&uint256=` |
| SOL (native)                 | Solana Pay | `solana:So1...?amount=2`                             |
| ZEC (transparent / shielded) | ZIP-321    | `zcash:t1...?amount=0.5` / `zcash:zs1...?amount=0.5` |
| Other                        | Fallback   | Plain deposit address                                |

## Chainflip Boost

For Chainflip swaps, you can opt into the **Boost Pool** to get faster confirmation in exchange for a tip.

| Field       | Type   | Required | Description                                                                                |
| ----------- | ------ | -------- | ------------------------------------------------------------------------------------------ |
| `boost_fee` | number | No       | Maximum boost fee (basis points). Common values: `5`, `10`, `30`. `0` (default) = no boost |

When `boost_fee > 0`, the deposit response includes a boost-channel ID. The user's deposit is fronted by liquidity providers as soon as it's seen in the mempool, instead of waiting for full chain confirmation.

```json theme={null}
{
  "quote_id": "01953c9a-...",
  "selected_protocol": "chainflip",
  "boost_fee": 10
}
```

Refer to the Chainflip [Boost Pools documentation](https://docs.chainflip.io/) for the latest tier structure and capacity. The `boost_fee` parameter is silently ignored for non-Chainflip protocols.


## OpenAPI

````yaml /api-reference/openapi.json POST /deposit
openapi: 3.0.3
info:
  title: Leokit API
  version: 1.0.0
  description: API reference for Leokit
servers:
  - url: https://api.leokit.dev
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /deposit:
    post:
      summary: Create deposit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DepositRequest'
            example:
              quote_id: 019b4c96-e47b-7000-afd4-17252097b092
              protocol: thorchain
      responses:
        '200':
          description: >-
            Deposit created. For Chainflip and NEAR protocols, the response
            includes `deposit_address`, `payment_uri`, and `qr_url`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepositResponse'
              examples:
                evm-thorchain:
                  summary: EVM deposit (THORChain)
                  value:
                    type: EVM
                    protocol: mayachain
                    quote_id: 019b4c96-e47b-7000-afd4-17252097b092
                    details:
                      from_asset: ETH.ETH
                      to_asset: BTC.BTC
                      from_address: '0xacd9a974065de9c7a19873f95af7595e1d632167'
                      to_address: bc1q2hk2q3zy7pdh0tp4awzn4k5lyetedaue5zt88r
                      amount: '1'
                      network: ETH
                      decimals: 18
                    unsigned_transactions:
                      - to: '0xe3985e6b61b814f7cdb188766562ba71b446b46d'
                        from: '0xacd9a974065de9c7a19873f95af7595e1d632167'
                        data: 0x44bc937b...
                        value: '1000000000000000000'
                        gasLimit: 180000
                        type: 2
                        maxFeePerGas: '1580264892'
                        maxPriorityFeePerGas: '1500000000'
                        chainId: 1
                        nonce: 245
                evm-chainflip-qr:
                  summary: EVM deposit (Chainflip) with QR
                  value:
                    type: EVM
                    protocol: chainflip
                    quote_id: 01936b4a-7c8e-7890-abcd-ef1234567890
                    details:
                      from_asset: ETH.ETH
                      to_asset: ARB.USDC-0xaf88d065e77c8cC2239327C5EDb3A432268e5831
                      from_address: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0'
                      to_address: '0x1234567890AbcdEF1234567890aBcdef12345678'
                      amount: '0.5'
                      network: ETH
                      decimals: 18
                    unsigned_transactions:
                      - to: '0x8a3c1f2d4e5f67890abcdef1234567890abcdef1'
                        from: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0'
                        value: '500000000000000000'
                        gasLimit: 21000
                        type: 2
                        chainId: 1
                        nonce: 42
                    deposit_address: '0x8a3c1f2d4e5f67890abcdef1234567890abcdef1'
                    payment_uri: >-
                      ethereum:0x8a3c1f2d4e5f67890abcdef1234567890abcdef1@1?value=500000000000000000
                    qr_url: >-
                      https://cdn.leokit.dev/qr/01936b4a-7c8e-7890-abcd-ef1234567890.png
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  schemas:
    DepositRequest:
      type: object
      description: Request body for /deposit.
      required:
        - quote_id
        - protocol
      properties:
        quote_id:
          type: string
          format: uuid
          description: Quote identifier returned from /quote.
          default: 019b4c96-e47b-7000-afd4-17252097b092
          example: 019b4c96-e47b-7000-afd4-17252097b092
        protocol:
          type: string
          description: Protocol to use for deposit generation.
          default: thorchain
          example: thorchain
    DepositResponse:
      type: object
      description: >-
        Deposit generation response containing unsigned transactions to sign per
        network type.
      required:
        - type
        - protocol
        - quote_id
        - details
        - unsigned_transactions
      properties:
        type:
          type: string
          enum:
            - EVM
            - COSMOS
            - UTXO
          description: Network family used for signing/broadcasting.
        protocol:
          type: string
          description: Protocol selected for execution (e.g., mayachain).
        quote_id:
          type: string
          format: uuid
          description: Quote identifier used to generate this deposit.
        details:
          $ref: '#/components/schemas/DepositDetails'
        unsigned_transactions:
          type: array
          description: >-
            Prepared raw transaction(s) you must sign and broadcast. The item
            shape depends on `type`.
          items:
            oneOf:
              - $ref: '#/components/schemas/EvmUnsignedTransaction'
              - $ref: '#/components/schemas/CosmosUnsignedTransaction'
              - $ref: '#/components/schemas/UtxoUnsignedTransaction'
        deposit_address:
          type: string
          description: >-
            Generated deposit address. Only present for Chainflip and NEAR
            protocols.
          nullable: true
        payment_uri:
          type: string
          description: >-
            Chain-specific payment URI (BIP-21, EIP-681, or Solana Pay). Only
            present for Chainflip and NEAR protocols.
          nullable: true
        qr_url:
          type: string
          description: >-
            CDN URL of a QR code PNG encoding the payment_uri. Only present for
            Chainflip and NEAR protocols.
          nullable: true
    DepositDetails:
      type: object
      description: Normalized deposit context used to construct unsigned transactions.
      required:
        - from_asset
        - to_asset
        - from_address
        - to_address
        - amount
        - network
        - decimals
      properties:
        from_asset:
          type: string
          description: Source asset (e.g., ETH.ETH).
        to_asset:
          type: string
          description: Destination asset (e.g., BTC.BTC).
        from_address:
          type: string
          description: Sender address on the origin network.
        to_address:
          type: string
          description: Recipient address on the destination network.
        amount:
          type: string
          description: Human-readable amount to deposit (stringified numeric).
        network:
          type: string
          description: Origin network (e.g., ETH).
        decimals:
          type: integer
          description: Decimals for the origin asset.
    EvmUnsignedTransaction:
      type: object
      description: Prepared EVM transaction object to sign and broadcast.
      properties:
        to:
          type: string
          description: Recipient contract or address.
        from:
          type: string
          description: Sender address.
        data:
          type: string
          description: Calldata (hex).
        value:
          type: string
          description: Value in wei (stringified integer).
        gasLimit:
          type: integer
          description: Gas limit.
        type:
          type: integer
          description: EIP-2718 transaction type (e.g., 2).
        maxFeePerGas:
          type: string
          description: Max fee per gas in wei (stringified integer).
        maxPriorityFeePerGas:
          type: string
          description: Max priority fee per gas in wei (stringified integer).
        chainId:
          type: integer
          description: EVM chain id.
        nonce:
          type: integer
          description: Account nonce.
      additionalProperties: true
    CosmosUnsignedTransaction:
      type: object
      description: >-
        Prepared Cosmos transaction payload to sign. The exact shape depends on
        the chain.
      additionalProperties: true
    UtxoUnsignedTransaction:
      type: object
      description: >-
        Prepared UTXO transaction payload to sign. The exact shape depends on
        the chain/wallet.
      additionalProperties: true
    Error:
      type: object
      description: Generic error payload.
      properties:
        message:
          type: string
        code:
          type: string
  responses:
    ErrorResponse:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Api-Key
      description: 'Demo API-Key (Sandbox): 7037d2b3-9c76-4f62-b730-c544f7570fa4'

````