Get Unsigned Swap PSBT

Obtaining an Unsigned PSBT for ARC20 Swap

If it is an ARC20 token, you can directly obtain the unsigned PSBT without a pre-request.

POST/brc20swap/get_swap_psbt2

export interface SwapPsbtBody {
  send_coin_type: string;
  send_tick: string;
  send_amount: string;
  receive_coin_type: string;
  receive_tick: string;
  receive_amount: string;
  address: string;
  btc_address: string;
  slipper: string;
  fee_rate: number;
  user_public_key: string;
}

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. Unlike BRC20, no pre-request is needed.

  5. When swapping BTC for ARC20, the amount of ARC20 to be received plus the ARC20 already in the user's wallet must not be less than 546.

  6. When swapping ARC20 for BTC, the remaining amount of the ARC20 token in the user's wallet after the swap must not be less than 546.

Last updated