@ledgerhq/coin-icon
Version:
Ledger Icon Coin integration
44 lines • 1.62 kB
JavaScript
;
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");
const confirmWording = {
send: "transfer",
};
exports.acceptTransaction = (0, specs_1.deviceActionFlow)({
steps: [
{
title: "Confirm",
button: specs_1.SpeculosButton.RIGHT,
expectedValue: ({ transaction }) => confirmWording[transaction.mode],
},
{
title: "Amount",
button: specs_1.SpeculosButton.RIGHT,
expectedValue: ({ transaction, account }) => (0, index_1.formatCurrencyUnit)((0, index_2.getAccountCurrency)(account).units[0], transaction.amount, {
disableRounding: true,
}),
},
{
title: "Address",
button: specs_1.SpeculosButton.RIGHT,
expectedValue: ({ transaction }) => {
return transaction.recipient;
},
},
{
title: "Fees",
button: specs_1.SpeculosButton.RIGHT,
expectedValue: ({ account, status }) => (0, index_1.formatCurrencyUnit)((0, index_2.getAccountCurrency)(account).units[0], status.estimatedFees, {
disableRounding: true,
}),
},
{
title: "Accept",
button: specs_1.SpeculosButton.BOTH,
},
],
});
//# sourceMappingURL=speculos-deviceActions.js.map