获取兑换待签名 PSBT

brc20获取兑换待签名psbt

post
Header parameters
AuthorizationstringOptional

token

User-IdstringOptional
Body
send_coin_typestringRequired
send_tickstringRequired
send_amountstringRequired
receive_coin_typestringRequired
receive_tickstringRequired
receive_amountstringRequired
addressstringRequired
slipperstringRequired
fee_rateintegerRequired
insstring[]Required

用brc20兑换的时候才需要输入

user_public_keystringRequired
tx_sizeintegerRequired

从get_swap_psbt_txsize接口获得

checksumintegerRequired

从get_swap_psbt_txsize接口获得

vinsstring[]Required

从get_swap_psbt_txsize接口获得

usr_cntintegerRequired

从get_swap_psbt_txsize接口获得

chlstringRequired
methodstringRequired

非跨池swap,跨池pools_swap, 只需传pools_swap即可

Responses
200
成功
application/json
post
POST /brc20swap/get_swap_psbt HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 307

{
  "send_coin_type": "text",
  "send_tick": "text",
  "send_amount": "text",
  "receive_coin_type": "text",
  "receive_tick": "text",
  "receive_amount": "text",
  "address": "text",
  "slipper": "text",
  "fee_rate": 1,
  "ins": [
    "text"
  ],
  "user_public_key": "text",
  "tx_size": 1,
  "checksum": 1,
  "vins": [
    "text"
  ],
  "usr_cnt": 1,
  "chl": "text",
  "method": "text"
}
{
  "code": 1,
  "msg": "text",
  "data": {
    "order_id": "text",
    "psbt": "text",
    "check_sign_only": true
  }
}

预兑换请求成功,获取待签名 PSBT。其中,部分请求参数为预兑换返回结果。

1、获取到待签名 PSBT 之后,用户必须在 30 秒内签名

2、注意 checksum 字段,值是从上个接口获取,但是字段名称有差异

1、获取到待签名 PSBT 之后,用户必须在 30 秒内签名

2、btc_addressaddress 传同一个地址即可

3、user_public_key 传参方法为只有一个地址的钱包 public_key:public_key,有两个地址的钱包 btc_public_key:ordi_public_key

Last updated