Get Unsigned Swap PSBT

Getting an Unsigned PSBT for Swapping (Runes)

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;
  token: string; // swap-info拿到的token
}

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.

Last updated