Runes

Get the unsigned PSBT for exchange

post
/brc20swap/get_swap_psbt2
Body
send_coin_typestringRequired
send_tickstringRequired
send_amountstringRequired
receive_coin_typestringRequired
receive_tickstringRequired
receive_amountstringRequired
addressstringRequired
slipperintegerRequired
fee_rateintegerRequired
user_public_keystringRequired
chlstringRequired
methodstringOptional

Non-cross-pool swap, cross-pool pools_swap, just pass 'pools_swap'

tokenstringRequired
btc_addressstringRequired
Responses
200Success
application/json
post
/brc20swap/get_swap_psbt2

Important Notes:

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

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

  3. 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.

  4. The token must be retrieved from the /swap-info endpoint and can only be used once.

Send the signed PSBT for exchange

post
/brc20swap/send_swap_psbt
Body
order_idstringRequired
psbtstringRequired
Responses
200Success
application/json
post
/brc20swap/send_swap_psbt

After sending the signed PSBT, a successful response indicates that the swap was successful.

Extending Signing Duration

If you are using a hardware wallet, the signing process might take longer. To help us identify it being a hardware wallet, you can add the following header to the API requests:

For example:

Last updated