UNPKG

@ledgerhq/coin-internet_computer

Version:
11 lines 446 B
import BigNumber from "bignumber.js"; import { getEstimatedFees } from "./bridgeHelpers/fee"; export const estimateMaxSpendable = async ({ account, transaction, }) => { const balance = account.balance; let maxSpendable = balance.minus(transaction?.fees ?? getEstimatedFees()); if (maxSpendable.isLessThan(0)) { maxSpendable = new BigNumber(0); } return maxSpendable; }; //# sourceMappingURL=estimateMaxSpendable.js.map