获取兑换待签名 PSBT
获取待签名 PSBT(RUNES)
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
}
{
"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"
}
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"}'
1、获取到待签名 PSBT 之后,用户必须在 30 秒内签名
2、btc_address
和 address
传同一个地址即可
3、user_public_key
传参方法为只有一个地址的钱包 public_key
:public_key
,有两个地址的钱包 btc_public_key
:ordi_public_key
4、 token
从 /swap-info
获取,token 只能使用一次
Last updated