Skip to main content
POST
/
deposit-address
Get deposit address (Chainflip / NEAR)
curl --request POST \
  --url https://api.leokit.dev/deposit-address \
  --header 'Api-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "quote_id": "01936b4a-7c8e-7890-abcd-ef1234567890",
  "from_address": "bc1qsourceaddr...",
  "to_address": "0xRecipient..."
}
'
{
  "status": 123,
  "data": {
    "deposit_address": "<string>",
    "amount": "<string>",
    "amount_raw": "<string>",
    "decimals": 123,
    "from_asset": "<string>",
    "to_asset": "<string>",
    "network": "<string>",
    "protocol": "chainflip",
    "payment_uri": "<string>",
    "qr_url": "<string>",
    "chainflip_channel_id": 123,
    "expires_at": "2023-11-07T05:31:56Z"
  }
}

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.

Overview

/leokit/deposit-address returns a deposit address (plus payment URI and QR code) for protocols that don’t require a signed transaction from the user — currently Chainflip and NEAR. The user simply sends funds to the address; the protocol handles the rest. This endpoint is similar to /leokit/deposit but specialized for address-based protocols. It also accepts from_address and to_address overrides for wallet-less swap flows (e.g. paid-on-receipt apps where the user has no connected wallet). If protocol is omitted, the best available chainflip/near quote is auto-selected by expected_amount_out.

Endpoint

POST /leokit/deposit-address

Request

Headers

HeaderValue
Content-Typeapplication/json
Api-KeyYour API key

Body

FieldTypeRequiredDescription
quote_idstringYesQuote ID from /leokit/quote or /leokit/streaming-quotes
protocolstringNochainflip or near. If omitted, auto-selects the best offer
selected_protocolstringNoAlias for protocol
typestringNoSub-protocol variant (e.g. Chainflip DCA). Default: regular swap
from_addressstringNoOverride refund/source address (for wallet-less swaps)
to_addressstringNoOverride destination/recipient address (for wallet-less swaps)

Response

Success (200)

{
  "data": {
    "deposit_address": "bc1q...",
    "amount": "0.01",
    "amount_raw": "1000000",
    "decimals": 8,
    "from_asset": "BTC.BTC",
    "to_asset": "ETH.ETH",
    "network": "BTC",
    "protocol": "chainflip",
    "chainflip_channel_id": 12345,
    "payment_uri": "bitcoin:bc1q...?amount=0.01",
    "qr_url": "https://cdn.leokit.dev/qr/01953c9a-....png",
    "expires_at": "2026-04-28T12:30:00.000Z"
  },
  "status": 200
}

Field Reference

FieldDescription
deposit_addressAddress the user must send funds to
amountDecimal amount in source-asset units
amount_rawSame amount in base units (wei, sats, etc.) as a string
decimalsSource-asset decimals
networkSource chain code (BTC, ETH, THOR, etc.)
protocolSelected protocol (chainflip or near)
chainflip_channel_idChainflip swap-channel ID (Chainflip only — null for NEAR)
payment_uriWallet-scannable URI (BIP-21, EIP-681, Solana Pay, etc.)
qr_urlCDN URL of a PNG QR code encoding the payment_uri
expires_atISO-8601 timestamp after which the quote/channel expires

Wallet-less Swap Flow

For applications without a connected wallet (e.g. embedded swap widgets), pass from_address and to_address directly:
curl -X POST https://api.leokit.dev/leokit/deposit-address \
  -H "Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "quote_id": "01953c9a-...",
    "from_address": "bc1qsourceaddr...",
    "to_address": "0xRecipient..."
  }'
The user is then expected to send amount from the wallet of their choice to deposit_address.

Errors

StatusCodeDescription
400SELECTED_QUOTE_IS_NOT_SETquote_id missing or empty
400NO_DEPOSIT_ADDRESS_PROTOCOLAuto-selection failed: no chainflip/near quote in the offer set
400UNSUPPORTED_PROTOCOLprotocol is not chainflip or near
400ValidationQuote validation failed (expired, malformed, etc.)
401INVALID_API_KEYMissing or invalid API key
502MISSING_DEPOSIT_ADDRESSNEAR could not return a deposit address (live re-fetch failed)
See the error codes catalog for the full list.

See Also

Authorizations

Api-Key
string
header
required

Demo API-Key (Sandbox): 7037d2b3-9c76-4f62-b730-c544f7570fa4

Body

application/json

Request body for /deposit-address. If protocol is omitted, the best chainflip/near quote is auto-selected.

quote_id
string<uuid>
required
protocol
enum<string>

Optional. Auto-selected if omitted.

Available options:
chainflip,
near
selected_protocol
string

Alias for protocol.

type
string

Sub-protocol variant (e.g. Chainflip DCA).

from_address
string

Override refund/source address (wallet-less swap flows).

to_address
string

Override recipient/destination address (wallet-less swap flows).

Response

Deposit address with QR code and payment URI.

status
integer
required
data
object
required