@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
46 lines • 1.53 kB
JavaScript
import { deviceActionFlow, formatDeviceAmount, SpeculosButton, } from "@ledgerhq/ledger-wallet-framework/bot/specs";
export const acceptTransaction = deviceActionFlow({
steps: [
{
title: "Transaction Type",
button: SpeculosButton.RIGHT,
expectedValue: () => "Payment",
},
{
title: "Amount",
button: SpeculosButton.RIGHT,
expectedValue: ({ account, status }) => formatDeviceAmount(account.currency, status.amount),
},
{
title: "Fee",
button: SpeculosButton.RIGHT,
expectedValue: ({ account, status }) => formatDeviceAmount(account.currency, status.estimatedFees),
},
{
title: "Destination Tag",
button: SpeculosButton.RIGHT,
expectedValue: ({ transaction }) => String(transaction.tag),
},
{
title: "Destination",
button: SpeculosButton.RIGHT,
trimValue: true,
expectedValue: ({ transaction }) => transaction.recipient,
},
{
title: "Account",
button: SpeculosButton.RIGHT,
trimValue: true,
expectedValue: ({ account }) => account.freshAddress,
},
{
title: "Accept",
button: SpeculosButton.BOTH,
},
{
title: "Sign transaction",
button: SpeculosButton.BOTH,
},
],
});
//# sourceMappingURL=deviceActions.js.map