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.

POST /brc20swap/get_swap_psbt

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;
  ins: string[];
  user_public_key: string;
  tx_size: number;
  checksum: number; // 预请求接口返回,这个字段注意,get_swap_psbt_txsize拿到的是check_sum,这边需要使用checksum
  vins: string[]; // 预请求接口返回
  usr_cnt: number;
}

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