@ledgerhq/coin-hedera
Version:
Ledger Hedera Coin integration
62 lines • 2.13 kB
JavaScript
import { formatCurrencyUnit } from "@ledgerhq/coin-module-framework/currencies/index";
import { getAccountCurrency } from "@ledgerhq/ledger-wallet-framework/account/index";
import { deviceActionFlow, SpeculosButton } from "@ledgerhq/ledger-wallet-framework/bot/specs";
export const acceptTransaction = deviceActionFlow({
steps: [
{
title: "Transfer",
},
{
title: "with Key #0?",
button: SpeculosButton.RIGHT,
},
{
title: "Operator",
button: SpeculosButton.RIGHT,
expectedValue: ({ account }) => account.freshAddress,
},
{
title: "Sender",
button: SpeculosButton.RIGHT,
expectedValue: ({ account }) => account.freshAddress,
},
{
title: "Recipient",
button: SpeculosButton.RIGHT,
expectedValue: ({ transaction }) => transaction.recipient,
},
{
title: "Amount",
button: SpeculosButton.RIGHT,
expectedValue: ({ account, status: { amount } }) => {
return (formatCurrencyUnit(getAccountCurrency(account).units[0], amount, {
disableRounding: true,
showAllDigits: true,
}) + " hbar");
},
},
{
title: "Fee",
button: SpeculosButton.RIGHT,
expectedValue: ({ account, status: { estimatedFees } }) => formatCurrencyUnit(getAccountCurrency(account).units[0], estimatedFees, {
disableRounding: true,
showAllDigits: true,
}) + " hbar",
},
{
title: "Max Fee",
button: SpeculosButton.RIGHT,
expectedValue: () => "1 hbar",
},
{
title: "Memo",
button: SpeculosButton.RIGHT,
expectedValue: ({ transaction }) => transaction.memo,
},
{
title: "Confirm",
button: SpeculosButton.BOTH,
},
],
});
//# sourceMappingURL=speculos-deviceActions.js.map