数据查询
查询挖矿积分
可通过这个接口查询用户流动池份额(lp),挖矿积分(integral)等数据。
POST
/brc20swap/manage_liquid_info
{
"page": 1,
"page_size": 15,
"address": "tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e"
}
curl 'https://test-api-proxy.ddpurse.com/brc20swap/manage_liquid_info' \
-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 '{"page":1,"page_size":15,"address":"tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e"}' \
--compressed
1、返回值新增 protocol 字段,可用于标识当前是哪种池子(brc20、arc20)
查询流动性操作记录
可通过这个接口查询用户增加创建,增加,移除流动池的历史记录。其中 txid 可用于 mempool 中查询链上交易状态。
POST
/brc20swap/liquid_history
{
"page": 1,
"page_size": 15,
"address": "tb1qlphav0389832xt8deme0hx2unvw3cjt7fsfuyx"
}
curl 'https://test-api-proxy.ddpurse.com/brc20swap/liquid_history' \
-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/122.0.0.0 Safari/537.36' \
-H 'sec-ch-ua: "Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
--data-raw '{"page":1,"page_size":15,"address":"tb1qlphav0389832xt8deme0hx2unvw3cjt7fsfuyx"}'
1、列表中会返回数组 txs
,其中包括的 txid 字段为交易哈希,可用于查询交易状态。status
除了 confirmed,其他都是未确认
流动池信息列表
可通过这个接口查询池子的 TVL
POST
/brc20swap/stat/trade_info_list
{
"page": 1,
"page_size": 8,
"crypto_type": "btc"
}
curl 'https://test-api-proxy.ddpurse.com/brc20swap/stat/trade_info_list' \
-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/123.0.0.0 Safari/537.36' \
-H 'sec-ch-ua: "Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
--data-raw '{"page":1,"page_size":8,"crypto_type":"btc"}'
1、列表中会返回的字段中,带_btc 的值计算单位是 btc,否则返回的值单位是美元
2、TVL 字段 pool_locked_amount_btc 和 pool_locked_amount
根据币对获取流动池地址
POST
/brc20swap/get_liquid_address
{
"tick1": "btc",
"tick2": "yydd",
"coin_type_1": "btc",
"coin_type_2": "brc20"
}
curl --location --request POST 'https://test-api-proxy.ddpurse.com/brc20swap/get_liquid_address' \
--header 'Authorization;' \
--header 'User-Id;' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Host: test-api-proxy.ddpurse.com' \
--header 'Connection: keep-alive' \
--data-raw '{
"tick1": "btc",
"tick2": "yydd",
"coin_type_1": "btc",
"coin_type_2": "brc20"
}'
获取池子 apr
POST
/brc20swap/external/pool/apr
{
"coin_type_1":"btc",
"coin_type_2" : "runes",
"tick1":"btc",
"tick2" :"MOLLY•GAME•N•B•C"
}
curl --location --request POST 'https://test-api-proxy.ddpurse.com/brc20swap/external/pool/apr' \
--header 'Pragma: no-cache' \
--header 'Authorization;' \
--header 'User-Id;' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Accept: */*' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Host: test-api-proxy.ddpurse.com' \
--data-raw '{
"coin_type_1":"btc",
"coin_type_2" : "runes",
"tick1":"btc",
"tick2" :"MOLLY•GAME•N•B•C"
}'
流动池持有数量
可查询某时刻用户在某个流动池中的持有数量
POST
/brc20swap/external/pool/amount/latest
{
"pool_address":"tb1pjgsdd4r7jjczg349ftw4lmjyexttrkvv70n8hs0n7na9yd060aeqvwkfm9", // 官方池子地址,需与官方联系获取
"height" : 2868942, // 快照高度
"timestamp": 1721979869, //快照时间戳(单位秒)
"user_address" : ["tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e"]
}
curl --location --request POST 'https://test-api-proxy.ddpurse.com/brc20swap/external/pool/amount/latest' \
--header 'Pragma: no-cache' \
--header 'Authorization;' \
--header 'User-Id;' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Accept: */*' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Host: test-api-proxy.ddpurse.com' \
--data-raw '{
"pool_address":"tb1pjgsdd4r7jjczg349ftw4lmjyexttrkvv70n8hs0n7na9yd060aeqvwkfm9",
"height" : 2868942,
"timestamp": 0,
"user_address" : ["tb1qge80xavle7c7k0tk7vceaavwcgpsr3jchl0w3e"]
}'
1、参数 height 与 timestamp 可二选一,如果同时存在,则 timestamp 优先
Last updated