@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
28 lines (22 loc) • 717 B
text/typescript
// TODO: to remove once live-app-sdk is depreciated and removed from LL
import { PolkadotTransaction as PlatformTransaction } from "@ledgerhq/live-app-sdk";
import { Transaction } from "./types";
const CAN_EDIT_FEES = false;
const convertToLiveTransaction = (tx: PlatformTransaction): Partial<Transaction> => ({
...tx,
era: tx.era ? `${tx.era}` : undefined,
});
const getPlatformTransactionSignFlowInfos = (
tx: PlatformTransaction,
): {
canEditFees: boolean;
hasFeesProvided: boolean;
liveTx: Partial<Transaction>;
} => {
return {
canEditFees: CAN_EDIT_FEES,
liveTx: convertToLiveTransaction(tx),
hasFeesProvided: false,
};
};
export default { getPlatformTransactionSignFlowInfos };