UNPKG

@ledgerhq/coin-mina

Version:
67 lines 2.56 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.acceptTransaction = void 0; const specs_1 = require("@ledgerhq/coin-framework/bot/specs"); const formatCurrencyUnit_1 = require("@ledgerhq/coin-framework/lib/currencies/formatCurrencyUnit"); exports.acceptTransaction = (0, specs_1.deviceActionFlow)({ steps: [ { title: "Sign", button: specs_1.SpeculosButton.RIGHT, }, { title: "Type", button: specs_1.SpeculosButton.RIGHT, expectedValue: () => "Payment", }, { title: "Sender", button: specs_1.SpeculosButton.RIGHT, expectedValue: ({ account }) => account.freshAddress, }, { title: "Receiver", button: specs_1.SpeculosButton.RIGHT, expectedValue: ({ transaction }) => transaction.recipient, }, { title: "Amount", button: specs_1.SpeculosButton.RIGHT, expectedValue: ({ transaction, account }) => `MINA ${(0, formatCurrencyUnit_1.formatCurrencyUnit)(account.currency.units[0], transaction.amount, { dynamicSignificantDigits: 11, staticSignificantDigits: 11, })}`, }, { title: "Fee", button: specs_1.SpeculosButton.RIGHT, expectedValue: ({ transaction, account }) => `MINA ${(0, formatCurrencyUnit_1.formatCurrencyUnit)(account.currency.units[0], transaction.fees.fee, { dynamicSignificantDigits: 11, staticSignificantDigits: 11, })}`, }, { title: "Total", button: specs_1.SpeculosButton.RIGHT, expectedValue: ({ transaction, account }) => `MINA ${(0, formatCurrencyUnit_1.formatCurrencyUnit)(account.currency.units[0], transaction.fees.fee.plus(transaction.amount), { dynamicSignificantDigits: 11, staticSignificantDigits: 11, })}`, }, { title: "Memo", button: specs_1.SpeculosButton.RIGHT, expectedValue: ({ transaction }) => transaction.memo ?? "", }, { title: "Nonce", button: specs_1.SpeculosButton.RIGHT, expectedValue: ({ transaction }) => transaction.nonce.toString(), }, { title: "Approve", button: specs_1.SpeculosButton.BOTH, }, ], }); //# sourceMappingURL=bot-deviceActions.js.map