From a4aacc37926a2a630d21baa66516c8d738caf993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Guimar=C3=A3es?= Date: Fri, 17 Jan 2025 14:23:54 +0000 Subject: [PATCH] fix: update aptos bot test --- .../families/aptos/speculos-deviceActions.ts | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 libs/ledger-live-common/src/families/aptos/speculos-deviceActions.ts diff --git a/libs/ledger-live-common/src/families/aptos/speculos-deviceActions.ts b/libs/ledger-live-common/src/families/aptos/speculos-deviceActions.ts new file mode 100644 index 00000000000..1491f253ab2 --- /dev/null +++ b/libs/ledger-live-common/src/families/aptos/speculos-deviceActions.ts @@ -0,0 +1,49 @@ +import type { DeviceAction } from "../../bot/types"; +import type { Transaction } from "./types"; +import { deviceActionFlow, formatDeviceAmount, SpeculosButton } from "../../bot/specs"; +import { State } from "@ledgerhq/coin-framework/bot/types"; + +export const acceptTransaction: DeviceAction> = deviceActionFlow({ + steps: [ + { + title: "Review", + button: SpeculosButton.RIGHT, + }, + { + title: "Transaction Type", + button: SpeculosButton.RIGHT, + }, + { + title: "Function", + button: SpeculosButton.RIGHT, + }, + { + title: "Coin Type", + button: SpeculosButton.RIGHT, + }, + { + title: "Receiver (1/2)", + button: SpeculosButton.RIGHT, + }, + { + title: "Receiver (2/2)", + button: SpeculosButton.RIGHT, + }, + { + title: "Amount", + button: SpeculosButton.RIGHT, + expectedValue: ({ account, status }) => + formatDeviceAmount(account.currency, status.amount, { + forceFloating: true, + }), + }, + { + title: "Gas Fee", + button: SpeculosButton.RIGHT, + }, + { + title: "Accept", + button: SpeculosButton.BOTH, + }, + ], +});