@ledgerhq/coin-icon
Version:
Ledger Icon Coin integration
17 lines • 575 B
JavaScript
import getEstimatedFees from "./getFeesForTransaction";
const sameFees = (a, b) => (!a || !b ? a === b : a.eq(b));
/**
* Prepare transaction before checking status
*
* @param {IconAccount} account
* @param {Transaction} transaction
*/
export const prepareTransaction = async (account, transaction) => {
let fees = transaction.fees;
fees = await getEstimatedFees({ account, transaction });
if (fees && !sameFees(fees, transaction.fees)) {
return { ...transaction, fees };
}
return transaction;
};
//# sourceMappingURL=prepareTransaction.js.map