import { IBbcTxData } from '../../types'; import { isBscAddress } from '../../utils'; import { BbcSdk } from '../prepareForBbc/bbcSdk'; import { IFeeResponse } from './types'; export const getBbcFee = async (txData: IBbcTxData): Promise => { const { network } = txData; const isBsc = isBscAddress(txData.to); const fee = await (async () => { if (txData.fee) return txData.fee; const bbc = new BbcSdk({ network }); const fees = await bbc.getGasPrice(); return isBsc ? fees.transferToBsc : fees.transfer; })(); return { fee, gasPrice: '', gasLimit: '', }; };