@ledgerhq/coin-near
Version:
14 lines • 596 B
JavaScript
import { updateTransaction } from "@ledgerhq/coin-framework/bridge/jsHelpers";
import getEstimatedFees from "./getFeesForTransaction";
import estimateMaxSpendable from "./estimateMaxSpendable";
export const prepareTransaction = async (account, transaction) => {
const amount = transaction.useAllAmount
? await estimateMaxSpendable({
account,
transaction,
})
: transaction.amount;
const fees = await getEstimatedFees(transaction);
return updateTransaction(transaction, { fees, amount });
};
//# sourceMappingURL=prepareTransaction.js.map