@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
24 lines • 839 B
JavaScript
;
// TODO: to remove once live-app-sdk is depreciated and removed from LL
Object.defineProperty(exports, "__esModule", { value: true });
const CAN_EDIT_FEES = true;
const areFeesProvided = (tx) => !!tx.feePerByte;
const convertToLiveTransaction = (tx) => {
const hasFeesProvided = areFeesProvided(tx);
const liveTx = {
...tx,
amount: tx.amount,
recipient: tx.recipient,
feePerByte: tx.feePerByte,
};
return hasFeesProvided ? { ...liveTx, feesStrategy: null } : liveTx;
};
const getPlatformTransactionSignFlowInfos = (tx) => {
return {
canEditFees: CAN_EDIT_FEES,
liveTx: convertToLiveTransaction(tx),
hasFeesProvided: areFeesProvided(tx),
};
};
exports.default = { getPlatformTransactionSignFlowInfos };
//# sourceMappingURL=platformAdapter.js.map