Get Unsigned Swap PSBT

Obtaining a Swap Unsigned PSBT

After a successful pre-swap request, obtain the unsigned PSBT. Some request parameters will be from the pre-swap response.

Get unsigned swap PSBT BRC20

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

Only required for BRC20 swaps

user_public_keystringRequired
tx_sizeintegerRequired

Obtaind from get_swap_psbt_txsize

checksumintegerRequired

Obtaind from get_swap_psbt_txsize

vinsstring[]Required

Obtaind from get_swap_psbt_txsize

usr_cntintegerRequired

Obtaind from get_swap_psbt_txsize

chlstringRequired
methodstringRequired

Use swap for non-routing, pools_swap for routing. Default pools_swap

Responses
200
Success
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
  }
}

Important Notes

  1. After obtaining the unsigned PSBT, the user must sign it within 30 seconds.

  2. The checksum field should use the value from the previous request, even though the field name may differ.

  3. Use the same address for both btc_address and address.

  4. For user_public_key, provide the parameter as public_key:public_key for a wallet with one address, or btc_public_key:ordi_public_key for a wallet with two addresses.

Last updated