@ledgerhq/coin-hedera
Version:
Ledger Hedera Coin integration
65 lines • 2.33 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.acceptTransaction = void 0;
const index_1 = require("@ledgerhq/coin-module-framework/currencies/index");
const index_2 = require("@ledgerhq/ledger-wallet-framework/account/index");
const specs_1 = require("@ledgerhq/ledger-wallet-framework/bot/specs");
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