Get Unsigned Liquidity PSBT
Obtaining an Unsigned PSBT for Adding Liquidity (BRC20)
Upon successful pre-add/create request, obtain the unsigned PSBT. Some of the request parameters will be from the pre-add/create request's return result.
POST
/brc20swap/v2/create_add_liquid_psbt
export interface PoolPsbtBody {
tick1: string;
tick2: string;
coin_type_1: string;
coin_type_2: string;
amount_1: string;
amount_2: string;
slipper: string;
tick_1_inscription_ids: string[];
tick_2_inscription_ids: string[];
payer_ord_addr: string;
fee_rate: string;
payer_btc_addr: string;
payer_pub_key: string;
check_sum: string; // 上面预请求接口返回
vins: string[]; // 上面预请求接口返回
}
{
"tick1": "bqbq",
"coin_type_1": "brc20",
"amount_1": "1000",
"tick_1_inscription_ids": [
"f34bf7166ce48a78b21f9b42746756b559bdab93f8e77509b505944b2efbfbe3i0"
],
"tick2": "BTC",
"coin_type_2": "btc",
"amount_2": "17999",
"tick_2_inscription_ids": [],
"fee_rate": "11",
"slipper": "12",
"payer_ord_addr": "tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e",
"payer_btc_addr": "tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e",
"payer_pub_key": "02d3ac7452920b1cc4653516dd4f4381a2df0a8c0aac6e3446e633a73ea63eee81:02d3ac7452920b1cc4653516dd4f4381a2df0a8c0aac6e3446e633a73ea63eee81",
"net_fee": 2904,
"check_sum": "0315F88065651C629D6086DBC0C45AF5",
"tx_size": 264,
"usr_cnt": 9,
"vins": [
"65438ea5e96b6ef3269d1f049fe366a06fb4d8552cf3255ab52bda718758f592:1",
"43ad62ec174298da01a371421ac50571eb7b5769d3c48aae66b27630bb736c27:2",
"32763c19d1dffadf8cc0eb5579b9abd6ccd4ff33a8cfec0cfbc691709702b612:1",
"5fa54486e3065284126874f72ab31c18e4a5aec31de4d9154a996327e708d86d:1",
"23d21302ac6f781a4f7ce7603f28c95a0152c901c50aafb4a18fc1c732cd661d:1",
"7f859bf89296c32a8c44934d452915d68e8f2d773ff0d9669cb1cc0a8e62a283:1",
"a71660079a51b2279c3d5e06a1f652b5cc46ffbc57fcc43694306eb0f19c8632:1",
"cc1541efb5d47ca47d7e82ae024532e64ba9dc44209997d7ee42200d19bdb5fa:3",
"6ed3fd9bb6f007ff8ecf549d12586608d7327b5ea1efe9a8545dc826d1272277:1"
]
}
curl 'https://test-api-proxy.ddpurse.com/brc20swap/v2/create_add_liquid_psbt' \
-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://192.168.10.66:56651' \
-H 'Pragma: no-cache' \
-H 'Referer: http://192.168.10.66: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/121.0.0.0 Safari/537.36' \
-H 'sec-ch-ua: "Not A(Brand";v="99", "Google Chrome";v="121", "Chromium";v="121"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
--data-raw '{"tick1":"bqbq","coin_type_1":"brc20","amount_1":"1000","tick_1_inscription_ids":["f34bf7166ce48a78b21f9b42746756b559bdab93f8e77509b505944b2efbfbe3i0"],"tick2":"BTC","coin_type_2":"btc","amount_2":"17999","tick_2_inscription_ids":[],"fee_rate":"11","slipper":"12","payer_ord_addr":"tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e","payer_btc_addr":"tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e","payer_pub_key":"02d3ac7452920b1cc4653516dd4f4381a2df0a8c0aac6e3446e633a73ea63eee81:02d3ac7452920b1cc4653516dd4f4381a2df0a8c0aac6e3446e633a73ea63eee81","net_fee":2904,"check_sum":"0315F88065651C629D6086DBC0C45AF5","tx_size":264,"usr_cnt":9,"vins":["65438ea5e96b6ef3269d1f049fe366a06fb4d8552cf3255ab52bda718758f592:1","43ad62ec174298da01a371421ac50571eb7b5769d3c48aae66b27630bb736c27:2","32763c19d1dffadf8cc0eb5579b9abd6ccd4ff33a8cfec0cfbc691709702b612:1","5fa54486e3065284126874f72ab31c18e4a5aec31de4d9154a996327e708d86d:1","23d21302ac6f781a4f7ce7603f28c95a0152c901c50aafb4a18fc1c732cd661d:1","7f859bf89296c32a8c44934d452915d68e8f2d773ff0d9669cb1cc0a8e62a283:1","a71660079a51b2279c3d5e06a1f652b5cc46ffbc57fcc43694306eb0f19c8632:1","cc1541efb5d47ca47d7e82ae024532e64ba9dc44209997d7ee42200d19bdb5fa:3","6ed3fd9bb6f007ff8ecf549d12586608d7327b5ea1efe9a8545dc826d1272277:1"]}' \
--compressed
Important Notes:
Use the same address for both
payer_ord_addr
andpayer_btc_addr
.
Last updated