RUNES
dotswap V3 Transaction request flow

dotswap V3 Swap interface
Apifox/1.0.0 (https://apifox.com)
application/json
with a minimum of 1, used to filter pools with no available UTXOs.
POST /dotswap/api/swap/quote HTTP/1.1
Host: test-api-proxy.ddpurse.com
Authorization: text
User-Id: text
User-Agent: text
Content-Type: application/json
Accept: */*
Content-Length: 2
{}
{
"code": 1,
"msg": "text",
"data": {
"quote_id": "text",
"from_amount": "text",
"to_amount": "text",
"swap_method": "text",
"pool_infos": [
{
"service_fee": 1,
"name": "text",
"third_party_id": 1,
"third_party_address": "text",
"pool_id": 1,
"third_pool_id": 1,
"pool_url": "text",
"icon": "text",
"from_tick": {
"coin_type": "text",
"tick": "text",
"token_id": "text"
},
"to_tick": {
"coin_type": "text",
"tick": "text",
"token_id": "text"
},
"from_tick_address": "text",
"to_tick_address": "text",
"from_balance": "text",
"to_balance": "text",
"from_margin": "text",
"to_margin": "text",
"from_to_fee_ratio": "text",
"to_from_fee_ratio": "text",
"dex_margin_percent": "text",
"pool_type": "text",
"sqrt_price": "text",
"liquidity": null,
"ServiceFeeRatio": 1,
"deltaAmount": "text"
}
]
},
"req_id": "text"
}
Use this interface to obtain the available swap amount.
For example, if you want to check how much
YKO•KKK•KKK•KKK•KKK
you can get for0.1 BTC
, then setfrom_token
tobtc
andto_token
torunes
. Input the value offrom_token.amount
, and the interface will returnto_amount
, which represents the amount ofYKO•KKK•KKK•KKK•KKK
.
Apifox/1.0.0 (https://apifox.com)
application/json
obtained from the calculation interface
with a minimum of 1, used for transaction construction.
required only for BRC20.
POST /dotswap/api/swap/create_psbt HTTP/1.1
Host: test-api-proxy.ddpurse.com
Authorization: text
User-Id: text
User-Agent: text
Content-Type: application/json
Accept: */*
Content-Length: 372
"{\n \"Address\":\n \"from_token\": {\n \"coin_type\": \"btc\",\n \"tick\": \"btc\",\n \"token_id\": \"72\",\n \"amount\": \"10000000\"\n },\n \"to_token\": {\n \"coin_type\": \"runes\",\n \"tick\": \"BITCOIN•TESTNET\",\n \"token_id\": \"35\",\n \"amount\": \"4944080\"\n },\n \"fee_rate\": 1\n}"
{
"code": 1,
"msg": "text",
"data": {
"request_id": "text",
"psbts": [
"text"
]
},
"req_id": "text"
}
1、The
quote_id
in this interface is the return value obtained from the quotation interface.2、Please set
use_bitcoin_channel
tofalse
by default, and setinscription
to an empty array[]
.
Apifox/1.0.0 (https://apifox.com)
application/json
obtained from the PSBT creation
false:hex true:base64
POST /dotswap/api/swap/submit_psbt HTTP/1.1
Host: test-api-proxy.ddpurse.com
Authorization: text
User-Id: text
User-Agent: text
Content-Type: application/json
Accept: */*
Content-Length: 372
"{\n \"Address\":\n \"from_token\": {\n \"coin_type\": \"btc\",\n \"tick\": \"btc\",\n \"token_id\": \"72\",\n \"amount\": \"10000000\"\n },\n \"to_token\": {\n \"coin_type\": \"runes\",\n \"tick\": \"BITCOIN•TESTNET\",\n \"token_id\": \"35\",\n \"amount\": \"4944080\"\n },\n \"fee_rate\": 1\n}"
{
"code": 1,
"msg": "text",
"data": {
"order_id": "text",
"tx_id": "text"
},
"req_id": "text"
}
The
request_id
is obtained from thecreate_psbt
response.Please set
psbt_is_base64
according to your signing result; by default, it is usuallyfalse
.
Last updated
Was this helpful?