@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
12 lines • 389 B
JavaScript
import { DAPP_SELECTORS } from "@ledgerhq/hw-app-eth";
const fallback = "transfer";
export const getTxType = (tx) => {
if (!tx || !tx.data)
return fallback;
const txSelector = `0x${tx.data.toString("hex").substring(0, 8)}`;
const type = DAPP_SELECTORS[txSelector];
if (!type)
return fallback;
return type;
};
//# sourceMappingURL=txTrackingHelper.js.map