BRC20
When selecting a token pair and clicking swap, if it is a BRC20 token, a pre-swap request is required.
Body
send_coin_typestringRequired
send_tickstringRequired
send_amountstringRequired
receive_coin_typestringRequired
receive_tickstringRequired
receive_amountstringRequired
addressstringRequired
slipperstringRequired
fee_rateintegerRequired
insstring[]Required
Only needed when exchanging with BRC20
methodstringRequired
Non-cross-pool swap, cross-pool pools_swap, just pass 'pools_swap'
Responses
200Success
application/json
x-200:Success
application/json
post
/brc20swap/get_swap_psbt_txsizeBody
send_coin_typestringRequired
send_tickstringRequired
send_amountstringRequired
receive_coin_typestringRequired
receive_tickstringRequired
receive_amountstringRequired
addressstringRequired
slipperstringRequired
fee_rateintegerRequired
insstring[]Required
Only needed when exchanging with BRC20
user_public_keystringRequired
tx_sizeintegerRequired
Obtained from the get_swap_psbt_txsize interface
checksumintegerRequired
Obtained from the get_swap_psbt_txsize interface
vinsstring[]Required
Obtained from the get_swap_psbt_txsize interface
usr_cntintegerRequired
Obtained from the get_swap_psbt_txsize interface
chlstringRequired
methodstringRequired
Non-cross-pool swap, cross-pool pools_swap, just pass 'pools_swap'
Responses
200Success
application/json
x-200:Success
application/json
post
/brc20swap/get_swap_psbtAfter a successful pre-swap request, obtain the unsigned PSBT. Some request parameters will be from the pre-swap response.
Important Notes
Finally, send the signed PSBT. If the response indicates success, the swap is successful.
Last updated