Skip to main content

POST /leokit/deposit

Generate unsigned transaction(s) for executing a swap based on a previously obtained quote.

Request Body

Validation Rules

  1. Quote Existence - Quote must exist in database
  2. Client Ownership - Quote must belong to requesting client (API key match)
  3. Protocol Availability - Selected protocol must be in quote’s available protocols
  4. Quote Expiry - Quote must not be expired (protocol-specific rules)
  5. Ecosystem Support - Blockchain ecosystem must be supported

Response Formats by Ecosystem

The response format varies based on the source blockchain ecosystem.

UTXO Chains (Bitcoin, Litecoin, Dogecoin, Dash)

Supported Chains: BTC, LTC, DOGE, DASH

PSBT Format (BTC, LTC, DOGE)

Raw Transaction Format (DASH)

For DASH, raw_unsigned_tx is provided instead of psbt_hex:

Key Features

  • PSBT Format: Bitcoin, Litecoin, Dogecoin use Partially Signed Bitcoin Transaction format
  • OP_RETURN Memo: Embedded in transaction for THORChain/MAYA swaps
  • UTXO Selection: Automatic selection with fee estimation
  • Change Outputs: Only created if above dust threshold (546 sats for BTC/LTC, 1 DOGE for DOGE)

Memo Length Limits

  • BTC/LTC: 150 bytes (OP_RETURN limit: 80 bytes)
  • DOGE: 80 bytes

EVM Chains (Ethereum, BSC, Arbitrum, etc.)

Supported Chains: ETH, BSC, ARB, AVAX, BASE, POLYGON, OPTIMISM, FANTOM

Native Token Transfer (ETH, BNB, etc.)

ERC20 Token Transfer with Approval

Key Features

  • Multiple Transactions: ERC20 swaps require approval + deposit transactions
  • USDT Special Case: Allowance reset to 0 before setting new amount
  • Nonce Sequencing: Sequential nonce for each transaction in array
  • EIP-1559: Supports both legacy (gasPrice) and EIP-1559 (maxFeePerGas) formats
  • Router Contracts: THORChain/MAYA use depositWithExpiry function
  • Direct Transfers: Chainflip and NEAR use simple transfers to deposit addresses

QR Code Enrichment (Chainflip & NEAR)

When the selected protocol is chainflip or near, the deposit response is automatically enriched with a deposit_address, payment_uri, and qr_url. These allow users to complete swaps by scanning a QR code from any wallet app.
These fields are only present for chainflip and near protocols. Other protocols (thorchain, relay, etc.) do not include them.

NEAR Protocol

Native NEAR Transfer

NEP-141 Token Transfer

Key Features

  • YoctoNEAR: All amounts in yoctoNEAR (10^24 for native NEAR)
  • Fixed Gas: 30 TGas for ft_transfer calls
  • Attached Deposit: 1 yoctoNEAR required for token transfers
  • Contract Parsing: Extracts contract address from asset format

Cosmos Chains

Supported Chains: Cosmos Hub, Kujira, THORChain (native RUNE)

MsgSend (Standard Cosmos Transfer)

MsgDeposit (THOR.RUNE Native Swaps)

Key Features

  • Gas Simulation: Real-time estimation with 30% buffer
  • Dynamic Fees: Based on recommended_gas_rate from inbound_addresses API
  • Account Lookup: Fetches sequence and account number automatically
  • Fixed RUNE Fee: 0.02 RUNE for THORChain transactions

Other Ecosystems

TRON

Cardano

XRP