@ledgerhq/coin-casper
Version:
Ledger Casper integration
12 lines • 580 B
JavaScript
import { updateTransaction } from "@ledgerhq/coin-framework/bridge/jsHelpers";
import { getEstimatedFees } from "./bridgeHelpers/fee";
export const prepareTransaction = async (account, transaction) => {
// log("debug", "[prepareTransaction] start fn");
const fees = getEstimatedFees();
const amount = transaction.useAllAmount
? account.spendableBalance.minus(fees)
: transaction.amount;
// log("debug", "[prepareTransaction] finish fn");
return updateTransaction(transaction, { fees, amount });
};
//# sourceMappingURL=prepareTransaction.js.map