UNPKG

@ledgerhq/coin-hedera

Version:
65 lines 2.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.acceptTransaction = void 0; const index_1 = require("@ledgerhq/coin-framework/currencies/index"); const specs_1 = require("@ledgerhq/coin-framework/bot/specs"); const index_2 = require("@ledgerhq/coin-framework/account/index"); exports.acceptTransaction = (0, specs_1.deviceActionFlow)({ steps: [ { title: "Transfer", }, { title: "with Key #0?", button: specs_1.SpeculosButton.RIGHT, }, { title: "Operator", button: specs_1.SpeculosButton.RIGHT, expectedValue: ({ account }) => account.freshAddress, }, { title: "Sender", button: specs_1.SpeculosButton.RIGHT, expectedValue: ({ account }) => account.freshAddress, }, { title: "Recipient", button: specs_1.SpeculosButton.RIGHT, expectedValue: ({ transaction }) => transaction.recipient, }, { title: "Amount", button: specs_1.SpeculosButton.RIGHT, expectedValue: ({ account, status: { amount } }) => { return ((0, index_1.formatCurrencyUnit)((0, index_2.getAccountCurrency)(account).units[0], amount, { disableRounding: true, showAllDigits: true, }) + " hbar"); }, }, { title: "Fee", button: specs_1.SpeculosButton.RIGHT, expectedValue: ({ account, status: { estimatedFees } }) => (0, index_1.formatCurrencyUnit)((0, index_2.getAccountCurrency)(account).units[0], estimatedFees, { disableRounding: true, showAllDigits: true, }) + " hbar", }, { title: "Max Fee", button: specs_1.SpeculosButton.RIGHT, expectedValue: () => "1 hbar", }, { title: "Memo", button: specs_1.SpeculosButton.RIGHT, expectedValue: ({ transaction }) => transaction.memo, }, { title: "Confirm", button: specs_1.SpeculosButton.BOTH, }, ], }); //# sourceMappingURL=speculos-deviceActions.js.map