@ledgerhq/coin-internet_computer
Version:
Ledger Internet Computer integration
11 lines • 446 B
JavaScript
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