Pre-Swap Request

When selecting a token pair and clicking swap, if it is a BRC20 token, a pre-swap request is required.

POST /brc20swap/get_swap_psbt_txsize

export interface SwapPsbtTxsizeBody {
  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; // 最大值为12
  fee_rate: number;
  ins: string[]; //铭文块id即inscription_id数组。当使用btc兑换brc20代币时,直接给空数据即可
}
  1. Use the same address for both address and btc_address.

  2. The response from this endpoint should be passed as is to the get_swap_psbt endpoint.

  3. The current slipper (slippage) limit is 12%.

Last updated