import type { Transaction, TransactionStatus } from "./types"; import type { CommonDeviceTransactionField as DeviceTransactionField } from "@ledgerhq/ledger-wallet-framework/transaction/common"; import type { Account, AccountLike } from "@ledgerhq/types-live"; async function getDeviceTransactionConfig({ status: { amount, estimatedFees, opReturnData }, }: { account: AccountLike; parentAccount: Account | null | undefined; transaction: Transaction; status: TransactionStatus; }): Promise> { const fields: Array<{ label: string; type: string }> = []; if (!amount.isZero()) { fields.push({ type: "amount", label: "Amount", }); } if (estimatedFees && !estimatedFees.isZero()) { fields.push({ type: "fees", label: "Fees", }); } if (opReturnData) { fields.push({ type: "opReturnData", label: "OP_RETURN", }); } return fields as Array; } export default getDeviceTransactionConfig;