UNPKG

@ledgerhq/coin-ton

Version:
54 lines 1.58 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const index_1 = require("@ledgerhq/coin-framework/account/index"); const constants_1 = require("./constants"); function getDeviceTransactionConfig(input) { const fields = []; const tokenTransfer = Boolean(input.account && (0, index_1.isTokenAccount)(input.account)); fields.push({ type: "address", label: "To", address: input.transaction.recipient, }); if (tokenTransfer) { fields.push({ type: "text", label: "Jetton units", value: input.transaction.amount.toString(), }); fields.push({ type: "text", label: "Amount", value: constants_1.TOKEN_TRANSFER_MAX_FEE, }); } else { if (input.transaction.useAllAmount) { fields.push({ type: "text", label: "Amount", value: "ALL YOUR TONs", }); } else { fields.push({ type: "amount", label: "Amount", }); } fields.push({ type: "fees", label: "Fee", }); } if (!input.transaction.comment.isEncrypted && input.transaction.comment.text) { fields.push({ type: "text", label: "Comment", value: input.transaction.comment.text, }); } return fields; } exports.default = getDeviceTransactionConfig; //# sourceMappingURL=deviceTransactionConfig.js.map