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..."
}
'import requests
url = "https://api.leokit.dev/deposit-address"
payload = {
"quote_id": "01936b4a-7c8e-7890-abcd-ef1234567890",
"from_address": "bc1qsourceaddr...",
"to_address": "0xRecipient..."
}
headers = {
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
quote_id: '01936b4a-7c8e-7890-abcd-ef1234567890',
from_address: 'bc1qsourceaddr...',
to_address: '0xRecipient...'
})
};
fetch('https://api.leokit.dev/deposit-address', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leokit.dev/deposit-address",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quote_id' => '01936b4a-7c8e-7890-abcd-ef1234567890',
'from_address' => 'bc1qsourceaddr...',
'to_address' => '0xRecipient...'
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.leokit.dev/deposit-address"
payload := strings.NewReader("{\n \"quote_id\": \"01936b4a-7c8e-7890-abcd-ef1234567890\",\n \"from_address\": \"bc1qsourceaddr...\",\n \"to_address\": \"0xRecipient...\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.leokit.dev/deposit-address")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quote_id\": \"01936b4a-7c8e-7890-abcd-ef1234567890\",\n \"from_address\": \"bc1qsourceaddr...\",\n \"to_address\": \"0xRecipient...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.leokit.dev/deposit-address")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quote_id\": \"01936b4a-7c8e-7890-abcd-ef1234567890\",\n \"from_address\": \"bc1qsourceaddr...\",\n \"to_address\": \"0xRecipient...\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}
}{
"message": "<string>",
"code": "<string>"
}Endpoint Details
Deposit Address
Get a deposit address with QR code for Chainflip or NEAR protocols (auto-selected if not specified)
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..."
}
'import requests
url = "https://api.leokit.dev/deposit-address"
payload = {
"quote_id": "01936b4a-7c8e-7890-abcd-ef1234567890",
"from_address": "bc1qsourceaddr...",
"to_address": "0xRecipient..."
}
headers = {
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
quote_id: '01936b4a-7c8e-7890-abcd-ef1234567890',
from_address: 'bc1qsourceaddr...',
to_address: '0xRecipient...'
})
};
fetch('https://api.leokit.dev/deposit-address', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leokit.dev/deposit-address",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quote_id' => '01936b4a-7c8e-7890-abcd-ef1234567890',
'from_address' => 'bc1qsourceaddr...',
'to_address' => '0xRecipient...'
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.leokit.dev/deposit-address"
payload := strings.NewReader("{\n \"quote_id\": \"01936b4a-7c8e-7890-abcd-ef1234567890\",\n \"from_address\": \"bc1qsourceaddr...\",\n \"to_address\": \"0xRecipient...\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.leokit.dev/deposit-address")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quote_id\": \"01936b4a-7c8e-7890-abcd-ef1234567890\",\n \"from_address\": \"bc1qsourceaddr...\",\n \"to_address\": \"0xRecipient...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.leokit.dev/deposit-address")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quote_id\": \"01936b4a-7c8e-7890-abcd-ef1234567890\",\n \"from_address\": \"bc1qsourceaddr...\",\n \"to_address\": \"0xRecipient...\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}
}{
"message": "<string>",
"code": "<string>"
}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
| Header | Value |
|---|---|
Content-Type | application/json |
Api-Key | Your API key |
Body
| Field | Type | Required | Description |
|---|---|---|---|
quote_id | string | Yes | Quote ID from /leokit/quote or /leokit/streaming-quotes |
protocol | string | No | chainflip or near. If omitted, auto-selects the best offer |
selected_protocol | string | No | Alias for protocol |
type | string | No | Sub-protocol variant (e.g. Chainflip DCA). Default: regular swap |
from_address | string | No | Override refund/source address (for wallet-less swaps) |
to_address | string | No | Override 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
| Field | Description |
|---|---|
deposit_address | Address the user must send funds to |
amount | Decimal amount in source-asset units |
amount_raw | Same amount in base units (wei, sats, etc.) as a string |
decimals | Source-asset decimals |
network | Source chain code (BTC, ETH, THOR, etc.) |
protocol | Selected protocol (chainflip or near) |
chainflip_channel_id | Chainflip swap-channel ID (Chainflip only — null for NEAR) |
payment_uri | Wallet-scannable URI (BIP-21, EIP-681, Solana Pay, etc.) |
qr_url | CDN URL of a PNG QR code encoding the payment_uri |
expires_at | ISO-8601 timestamp after which the quote/channel expires |
Wallet-less Swap Flow
For applications without a connected wallet (e.g. embedded swap widgets), passfrom_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..."
}'
amount from the wallet of their choice to deposit_address.
Errors
| Status | Code | Description |
|---|---|---|
400 | SELECTED_QUOTE_IS_NOT_SET | quote_id missing or empty |
400 | NO_DEPOSIT_ADDRESS_PROTOCOL | Auto-selection failed: no chainflip/near quote in the offer set |
400 | UNSUPPORTED_PROTOCOL | protocol is not chainflip or near |
400 | Validation | Quote validation failed (expired, malformed, etc.) |
401 | INVALID_API_KEY | Missing or invalid API key |
502 | MISSING_DEPOSIT_ADDRESS | NEAR could not return a deposit address (live re-fetch failed) |
See Also
- Generate Deposit — for protocols that return unsigned transactions
- Simple Swap — single-call quote + deposit-address for chainflip/near
- QR Code Enrichment
Authorizations
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.
Optional. Auto-selected if omitted.
Available options:
chainflip, near Alias for protocol.
Sub-protocol variant (e.g. Chainflip DCA).
Override refund/source address (wallet-less swap flows).
Override recipient/destination address (wallet-less swap flows).