UNPKG

@ledgerhq/coin-internet_computer

Version:
38 lines 1.26 kB
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies"; import { log } from "@ledgerhq/logs"; import { formatCurrencyUnit } from "@ledgerhq/coin-framework/currencies/index"; import { methodToString } from "../common-logic/utils"; const currency = getCryptoCurrencyById("internet_computer"); function getDeviceTransactionConfig({ transaction, }) { const fields = []; fields.push({ type: "text", label: "Transaction Type", value: methodToString(0), }); fields.push({ type: "text", label: "Payment (ICP)", value: formatCurrencyUnit(currency.units[0], transaction.amount, { showCode: false, disableRounding: true, }), }); fields.push({ type: "text", label: "Maximum fee (ICP)", value: formatCurrencyUnit(currency.units[0], transaction.fees, { showCode: false, disableRounding: true, }), }); fields.push({ type: "text", label: "Memo", value: transaction.memo ?? "0", }); log("debug", `Transaction config ${JSON.stringify(fields)}`); return fields; } export default getDeviceTransactionConfig; //# sourceMappingURL=deviceTransactionConfig.js.map