Getting an Unsigned PSBT for Swapping (Runes)
Parameters Request Body cURL Example
Copy export interface SwapPsbtBody {
send_coin_type : string ;
send_tick : string ;
send_amount : string ;
receive_coin_type : string ;
receive_tick : string ;
receive_amount : string ;
address : string ;
btc_address : string ;
slipper : string ;
fee_rate : number ;
user_public_key : string ;
token : string ; // swap-info拿到的token
}
Copy {
"receive_amount" : "0.004" ,
"receive_coin_type" : "runes" ,
"receive_tick" : "BEVMRUNESTONET" ,
"send_amount" : "100000" ,
"send_coin_type" : "btc" ,
"send_tick" : "BTC" ,
"slipper" : 9 ,
"fee_rate" : 57 ,
"ins" : [] ,
"token" : "d7eb91e4f000000:0" ,
"user_public_key": "02d3ac7452920b1cc4653516dd4f4381a2df0a8c0aac6e3446e633a73ea63eee81:02d3ac7452920b1cc4653516dd4f4381a2df0a8c0aac6e3446e633a73ea63eee81",
"address" : "tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e" ,
"btc_address" : "tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e"
}
Copy curl 'https://test-api-proxy.ddpurse.com/brc20swap/get_swap_psbt2' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Accept-Language: en' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
-H 'Origin: http://localhost:56651' \
-H 'Pragma: no-cache' \
-H 'Referer: http://localhost:56651/' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: cross-site' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36' \
-H 'sec-ch-ua: "Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
--data-raw '{"receive_amount":"0.004","receive_coin_type":"runes","receive_tick":"BEVMRUNESTONET","send_amount":"100000","send_coin_type":"btc","send_tick":"BTC","slipper":9,"fee_rate":57,"ins":[],"token":"d7eb91e4f000000:0","user_public_key":"02d3ac7452920b1cc4653516dd4f4381a2df0a8c0aac6e3446e633a73ea63eee81:02d3ac7452920b1cc4653516dd4f4381a2df0a8c0aac6e3446e633a73ea63eee81","address":"tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e","btc_address":"tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e"}'