UNPKG

@ledgerhq/coin-internet_computer

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