@ledgerhq/coin-aptos 2.0.0-nightly.3 → 2.0.0-nightly.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +17 -0
  3. package/lib/__tests__/api/index.test.js +5 -61
  4. package/lib/__tests__/api/index.test.js.map +1 -1
  5. package/lib/__tests__/bridge/buildTransaction.test.js +2 -57
  6. package/lib/__tests__/bridge/buildTransaction.test.js.map +1 -1
  7. package/lib/__tests__/bridge/getFeesForTransaction.test.js +8 -109
  8. package/lib/__tests__/bridge/getFeesForTransaction.test.js.map +1 -1
  9. package/lib/__tests__/bridge/getTransactionStatus.test.js +37 -175
  10. package/lib/__tests__/bridge/getTransactionStatus.test.js.map +1 -1
  11. package/lib/__tests__/bridge/logic.test.js +115 -889
  12. package/lib/__tests__/bridge/logic.test.js.map +1 -1
  13. package/lib/__tests__/bridge/signOperation.test.js +2 -128
  14. package/lib/__tests__/bridge/signOperation.test.js.map +1 -1
  15. package/lib/__tests__/bridge/synchronisation.test.js +67 -1214
  16. package/lib/__tests__/bridge/synchronisation.test.js.map +1 -1
  17. package/lib/api/graphql/queries.js +6 -6
  18. package/lib/api/graphql/types.d.ts +9 -9
  19. package/lib/api/graphql/types.d.ts.map +1 -1
  20. package/lib/api/index.d.ts +2 -5
  21. package/lib/api/index.d.ts.map +1 -1
  22. package/lib/api/index.js +4 -30
  23. package/lib/api/index.js.map +1 -1
  24. package/lib/bridge/bridge.fixture.d.ts +0 -2
  25. package/lib/bridge/bridge.fixture.d.ts.map +1 -1
  26. package/lib/bridge/bridge.fixture.js +13 -85
  27. package/lib/bridge/bridge.fixture.js.map +1 -1
  28. package/lib/bridge/buildTransaction.d.ts.map +1 -1
  29. package/lib/bridge/buildTransaction.js +3 -29
  30. package/lib/bridge/buildTransaction.js.map +1 -1
  31. package/lib/bridge/estimateMaxSpendable.js +1 -1
  32. package/lib/bridge/estimateMaxSpendable.js.map +1 -1
  33. package/lib/bridge/getFeesForTransaction.d.ts.map +1 -1
  34. package/lib/bridge/getFeesForTransaction.js +7 -12
  35. package/lib/bridge/getFeesForTransaction.js.map +1 -1
  36. package/lib/bridge/getTransactionStatus.d.ts.map +1 -1
  37. package/lib/bridge/getTransactionStatus.js +14 -28
  38. package/lib/bridge/getTransactionStatus.js.map +1 -1
  39. package/lib/bridge/logic.d.ts +8 -13
  40. package/lib/bridge/logic.d.ts.map +1 -1
  41. package/lib/bridge/logic.js +54 -152
  42. package/lib/bridge/logic.js.map +1 -1
  43. package/lib/bridge/prepareTransaction.d.ts.map +1 -1
  44. package/lib/bridge/prepareTransaction.js +2 -2
  45. package/lib/bridge/prepareTransaction.js.map +1 -1
  46. package/lib/bridge/signOperation.d.ts.map +1 -1
  47. package/lib/bridge/signOperation.js +3 -17
  48. package/lib/bridge/signOperation.js.map +1 -1
  49. package/lib/bridge/synchronisation.d.ts +0 -15
  50. package/lib/bridge/synchronisation.d.ts.map +1 -1
  51. package/lib/bridge/synchronisation.js +4 -127
  52. package/lib/bridge/synchronisation.js.map +1 -1
  53. package/lib/constants.d.ts +1 -5
  54. package/lib/constants.d.ts.map +1 -1
  55. package/lib/constants.js +2 -6
  56. package/lib/constants.js.map +1 -1
  57. package/lib/test/bot-specs.d.ts.map +1 -1
  58. package/lib/test/bot-specs.js +1 -40
  59. package/lib/test/bot-specs.js.map +1 -1
  60. package/lib/test/bridgeDatasetTest.d.ts.map +1 -1
  61. package/lib/test/bridgeDatasetTest.js +62 -43
  62. package/lib/test/bridgeDatasetTest.js.map +1 -1
  63. package/lib/test/speculos-deviceActions.d.ts +0 -1
  64. package/lib/test/speculos-deviceActions.d.ts.map +1 -1
  65. package/lib/test/speculos-deviceActions.js +5 -37
  66. package/lib/test/speculos-deviceActions.js.map +1 -1
  67. package/lib/types/index.d.ts +7 -18
  68. package/lib/types/index.d.ts.map +1 -1
  69. package/lib-es/__tests__/api/index.test.js +5 -61
  70. package/lib-es/__tests__/api/index.test.js.map +1 -1
  71. package/lib-es/__tests__/bridge/buildTransaction.test.js +3 -58
  72. package/lib-es/__tests__/bridge/buildTransaction.test.js.map +1 -1
  73. package/lib-es/__tests__/bridge/getFeesForTransaction.test.js +9 -110
  74. package/lib-es/__tests__/bridge/getFeesForTransaction.test.js.map +1 -1
  75. package/lib-es/__tests__/bridge/getTransactionStatus.test.js +39 -177
  76. package/lib-es/__tests__/bridge/getTransactionStatus.test.js.map +1 -1
  77. package/lib-es/__tests__/bridge/logic.test.js +117 -891
  78. package/lib-es/__tests__/bridge/logic.test.js.map +1 -1
  79. package/lib-es/__tests__/bridge/signOperation.test.js +2 -128
  80. package/lib-es/__tests__/bridge/signOperation.test.js.map +1 -1
  81. package/lib-es/__tests__/bridge/synchronisation.test.js +69 -1213
  82. package/lib-es/__tests__/bridge/synchronisation.test.js.map +1 -1
  83. package/lib-es/api/graphql/queries.js +6 -6
  84. package/lib-es/api/graphql/types.d.ts +9 -9
  85. package/lib-es/api/graphql/types.d.ts.map +1 -1
  86. package/lib-es/api/index.d.ts +2 -5
  87. package/lib-es/api/index.d.ts.map +1 -1
  88. package/lib-es/api/index.js +4 -30
  89. package/lib-es/api/index.js.map +1 -1
  90. package/lib-es/bridge/bridge.fixture.d.ts +0 -2
  91. package/lib-es/bridge/bridge.fixture.d.ts.map +1 -1
  92. package/lib-es/bridge/bridge.fixture.js +12 -82
  93. package/lib-es/bridge/bridge.fixture.js.map +1 -1
  94. package/lib-es/bridge/buildTransaction.d.ts.map +1 -1
  95. package/lib-es/bridge/buildTransaction.js +4 -30
  96. package/lib-es/bridge/buildTransaction.js.map +1 -1
  97. package/lib-es/bridge/estimateMaxSpendable.js +1 -1
  98. package/lib-es/bridge/estimateMaxSpendable.js.map +1 -1
  99. package/lib-es/bridge/getFeesForTransaction.d.ts.map +1 -1
  100. package/lib-es/bridge/getFeesForTransaction.js +8 -13
  101. package/lib-es/bridge/getFeesForTransaction.js.map +1 -1
  102. package/lib-es/bridge/getTransactionStatus.d.ts.map +1 -1
  103. package/lib-es/bridge/getTransactionStatus.js +14 -28
  104. package/lib-es/bridge/getTransactionStatus.js.map +1 -1
  105. package/lib-es/bridge/logic.d.ts +8 -13
  106. package/lib-es/bridge/logic.d.ts.map +1 -1
  107. package/lib-es/bridge/logic.js +52 -146
  108. package/lib-es/bridge/logic.js.map +1 -1
  109. package/lib-es/bridge/prepareTransaction.d.ts.map +1 -1
  110. package/lib-es/bridge/prepareTransaction.js +2 -2
  111. package/lib-es/bridge/prepareTransaction.js.map +1 -1
  112. package/lib-es/bridge/signOperation.d.ts.map +1 -1
  113. package/lib-es/bridge/signOperation.js +3 -17
  114. package/lib-es/bridge/signOperation.js.map +1 -1
  115. package/lib-es/bridge/synchronisation.d.ts +0 -15
  116. package/lib-es/bridge/synchronisation.d.ts.map +1 -1
  117. package/lib-es/bridge/synchronisation.js +3 -123
  118. package/lib-es/bridge/synchronisation.js.map +1 -1
  119. package/lib-es/constants.d.ts +1 -5
  120. package/lib-es/constants.d.ts.map +1 -1
  121. package/lib-es/constants.js +1 -5
  122. package/lib-es/constants.js.map +1 -1
  123. package/lib-es/test/bot-specs.d.ts.map +1 -1
  124. package/lib-es/test/bot-specs.js +2 -41
  125. package/lib-es/test/bot-specs.js.map +1 -1
  126. package/lib-es/test/bridgeDatasetTest.d.ts.map +1 -1
  127. package/lib-es/test/bridgeDatasetTest.js +59 -43
  128. package/lib-es/test/bridgeDatasetTest.js.map +1 -1
  129. package/lib-es/test/speculos-deviceActions.d.ts +0 -1
  130. package/lib-es/test/speculos-deviceActions.d.ts.map +1 -1
  131. package/lib-es/test/speculos-deviceActions.js +4 -36
  132. package/lib-es/test/speculos-deviceActions.js.map +1 -1
  133. package/lib-es/types/index.d.ts +7 -18
  134. package/lib-es/types/index.d.ts.map +1 -1
  135. package/package.json +5 -6
  136. package/src/__tests__/api/index.test.ts +5 -75
  137. package/src/__tests__/bridge/buildTransaction.test.ts +3 -85
  138. package/src/__tests__/bridge/getFeesForTransaction.test.ts +9 -144
  139. package/src/__tests__/bridge/getTransactionStatus.test.ts +38 -217
  140. package/src/__tests__/bridge/logic.test.ts +118 -922
  141. package/src/__tests__/bridge/signOperation.test.ts +2 -141
  142. package/src/__tests__/bridge/synchronisation.test.ts +71 -1265
  143. package/src/api/graphql/queries.ts +6 -6
  144. package/src/api/graphql/types.ts +9 -9
  145. package/src/api/index.ts +5 -32
  146. package/src/bridge/bridge.fixture.ts +12 -91
  147. package/src/bridge/buildTransaction.ts +6 -39
  148. package/src/bridge/estimateMaxSpendable.ts +1 -1
  149. package/src/bridge/getFeesForTransaction.ts +9 -14
  150. package/src/bridge/getTransactionStatus.ts +13 -35
  151. package/src/bridge/logic.ts +63 -202
  152. package/src/bridge/prepareTransaction.ts +3 -4
  153. package/src/bridge/signOperation.ts +3 -19
  154. package/src/bridge/synchronisation.ts +3 -170
  155. package/src/constants.ts +1 -12
  156. package/src/test/bot-specs.ts +3 -63
  157. package/src/test/bridgeDatasetTest.ts +59 -45
  158. package/src/test/speculos-deviceActions.ts +4 -40
  159. package/src/types/index.ts +1 -15
@@ -5,9 +5,8 @@ import BigNumber from "bignumber.js";
5
5
  import type { Transaction } from "../types";
6
6
  import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
7
7
  import { genericTestDestination, pickSiblings, botTest } from "@ledgerhq/coin-framework/bot/specs";
8
- import type { AppSpec, TransactionTestInput } from "@ledgerhq/coin-framework/bot/types";
9
- import { acceptTokenTransaction, acceptTransaction } from "./speculos-deviceActions";
10
- import { Account, TokenAccount } from "@ledgerhq/types-live";
8
+ import type { AppSpec } from "@ledgerhq/coin-framework/bot/types";
9
+ import { acceptTransaction } from "./speculos-deviceActions";
11
10
 
12
11
  const MIN_SAFE = new BigNumber(0.0001);
13
12
  const maxAccount = 6;
@@ -20,7 +19,7 @@ const aptosSpecs: AppSpec<Transaction> = {
20
19
  appName: "Aptos",
21
20
  },
22
21
  genericDeviceAction: acceptTransaction,
23
- testTimeout: 2 * 60 * 1000,
22
+ testTimeout: 6 * 60 * 1000,
24
23
  minViableAmount: MIN_SAFE,
25
24
  transactionCheck: ({ maxSpendable }) => {
26
25
  invariant(maxSpendable.gt(MIN_SAFE), "balance is too low");
@@ -85,68 +84,9 @@ const aptosSpecs: AppSpec<Transaction> = {
85
84
  );
86
85
  },
87
86
  },
88
- {
89
- name: "Send ~50% of token amount",
90
- feature: "tokens",
91
- maxRun: 1,
92
- deviceAction: acceptTokenTransaction,
93
- transaction: ({ account, bridge, siblings, maxSpendable }) => {
94
- invariant(maxSpendable.gt(MIN_SAFE), "Balance is too low");
95
-
96
- const senderTokenAcc = findTokenSubAccountWithBalance(account);
97
- invariant(senderTokenAcc, "Sender token account with available balance not found");
98
-
99
- const sibling = pickSiblings(siblings, maxAccount);
100
-
101
- const recipientTokenAcc = findTokenSubAccountWithBalance(sibling);
102
- invariant(recipientTokenAcc, "Receiver token account with available balance not found");
103
-
104
- const amount = senderTokenAcc.spendableBalance.div(2).integerValue();
105
- const recipient = sibling.freshAddress;
106
- const transaction = bridge.createTransaction(account);
107
- const subAccountId = senderTokenAcc.id;
108
-
109
- return {
110
- transaction,
111
- updates: [{ subAccountId }, { recipient }, { amount }],
112
- };
113
- },
114
- test: input => {
115
- expectTokenAccountCorrectBalanceChange(input);
116
- },
117
- },
118
87
  ],
119
88
  };
120
89
 
121
- function findTokenSubAccountWithBalance(account: Account) {
122
- return account.subAccounts?.find(acc => acc.type === "TokenAccount" && acc.balance.gt(0)) as
123
- | TokenAccount
124
- | undefined;
125
- }
126
-
127
- function expectTokenAccountCorrectBalanceChange({
128
- account,
129
- accountBeforeTransaction,
130
- status,
131
- transaction,
132
- }: TransactionTestInput<Transaction>) {
133
- const tokenAccId = transaction.subAccountId;
134
- if (!tokenAccId) throw new Error("Wrong subAccountId");
135
-
136
- const tokenAccAfterTx = account.subAccounts?.find(acc => acc.id === tokenAccId);
137
- const tokenAccBeforeTx = accountBeforeTransaction.subAccounts?.find(acc => acc.id === tokenAccId);
138
-
139
- if (!tokenAccAfterTx || !tokenAccBeforeTx) {
140
- throw new Error("Token sub accounts not found!");
141
- }
142
-
143
- botTest("Token balance decreased with operation", () =>
144
- expect(tokenAccAfterTx.balance.toString()).toBe(
145
- tokenAccBeforeTx.balance.minus(status.amount).toString(),
146
- ),
147
- );
148
- }
149
-
150
90
  export default {
151
91
  aptosSpecs,
152
92
  };
@@ -1,4 +1,6 @@
1
1
  import { CurrenciesData, DatasetTest } from "@ledgerhq/types-live";
2
+ import BigNumber from "bignumber.js";
3
+ import { fromTransactionRaw } from "../bridge/transaction";
2
4
  import { Transaction } from "../types";
3
5
 
4
6
  const aptos: CurrenciesData<Transaction> = {
@@ -20,73 +22,85 @@ const aptos: CurrenciesData<Transaction> = {
20
22
  accounts: [
21
23
  {
22
24
  raw: {
23
- id: "js:2:aptos:d1a8c6a1cdd52dd40c7ea61ee4571fb51fcae440a594c1eca18636928f1d3956:aptos",
25
+ id: "js:2:aptos:d1a8c6a1cdd52dd40c7ea61ee4571fb51fcae440a594c1eca18636928f1d3956:",
24
26
  seedIdentifier: "d6816f4f22f867b56cf9304b776f452a16d107835d73ee8a33c4ced210300583",
25
27
  used: true,
26
- derivationMode: "aptos",
28
+ derivationMode: "",
27
29
  index: 0,
28
30
  freshAddress: "0x445fa0013887abd1a0c14acdec6e48090e0ad3fed3e08202aac15ca14f3be26b",
29
31
  freshAddressPath: "44'/637'/0'/0'/0'",
30
- blockHeight: 302459501,
32
+ blockHeight: 286066372,
31
33
  creationDate: "2024-12-18T12:26:31.070Z",
32
- operationsCount: 6,
34
+ operationsCount: 5,
33
35
  operations: [],
34
36
  pendingOperations: [],
35
37
  currencyId: "aptos",
36
- lastSyncDate: "2025-03-12T10:42:53.570Z",
37
- balance: "19949100",
38
- spendableBalance: "19949100",
38
+ lastSyncDate: "2025-02-04T14:00:46.693Z",
39
+ balance: "30100",
40
+ spendableBalance: "30100",
39
41
  balanceHistoryCache: {
40
42
  HOUR: {
41
43
  balances: [
42
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
43
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
44
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
45
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
46
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
47
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
48
- 0, 19949100, 19949100, 19949100, 19949100, 19949100, 19949100, 19949100, 19949100,
49
- 19949100, 19949100, 19949100, 19949100, 19949100, 19949100, 19949100, 19949100,
50
- 19949100, 19949100,
44
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
45
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
46
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
47
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
48
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
49
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
50
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
51
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
52
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
53
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
54
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
55
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
56
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
57
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
58
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
59
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
60
+ 30100,
51
61
  ],
52
- latestDate: 1741773600000,
62
+ latestDate: 1738677600000,
53
63
  },
54
64
  DAY: {
55
65
  balances: [
56
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
57
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
58
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
59
- 19949100,
66
+ 0, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
67
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
68
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
69
+ 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100, 30100,
60
70
  ],
61
- latestDate: 1741737600000,
71
+ latestDate: 1738627200000,
72
+ },
73
+ WEEK: {
74
+ balances: [0, 30100, 30100, 30100, 30100, 30100, 30100, 30100],
75
+ latestDate: 1738454400000,
62
76
  },
63
- WEEK: { balances: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], latestDate: 1741478400000 },
64
77
  },
65
78
  xpub: "d1a8c6a1cdd52dd40c7ea61ee4571fb51fcae440a594c1eca18636928f1d3956",
66
- subAccounts: [
67
- {
68
- type: "TokenAccountRaw",
69
- id: "js:2:aptos:d1a8c6a1cdd52dd40c7ea61ee4571fb51fcae440a594c1eca18636928f1d3956:aptos+aptos%2Fcoin%2Fdstapt~!underscore!~0xd11107bdf0d6d7040c6c0bfbdecb6545191fdf13e8d8d259952f53e1713f61b5%3A%3Astaked~!underscore!~coin%3A%3Astakedaptos",
70
- parentId:
71
- "js:2:aptos:d1a8c6a1cdd52dd40c7ea61ee4571fb51fcae440a594c1eca18636928f1d3956:aptos",
72
- tokenId:
73
- "aptos/coin/dstapt_0xd11107bdf0d6d7040c6c0bfbdecb6545191fdf13e8d8d259952f53e1713f61b5::staked_coin::stakedaptos",
74
- balance: "30000000",
75
- spendableBalance: "30000000",
76
- balanceHistoryCache: {
77
- HOUR: { latestDate: null, balances: [] },
78
- DAY: { latestDate: null, balances: [] },
79
- WEEK: { latestDate: null, balances: [] },
80
- },
81
- creationDate: "2025-03-12T10:42:53.570Z",
82
- operationsCount: 2,
83
- operations: [],
84
- pendingOperations: [],
85
- swapHistory: [],
86
- },
87
- ],
88
79
  swapHistory: [],
89
80
  },
81
+ transactions: [
82
+ {
83
+ name: "NO_NAME",
84
+ transaction: fromTransactionRaw({
85
+ amount: "1000",
86
+ recipient: "0xd20fa44192f94ba086ab16bfdf57e43ff118ada69b4c66fa9b9a9223cbc068c1",
87
+ useAllAmount: false,
88
+ subAccountId: null,
89
+ family: "aptos",
90
+ mode: "send",
91
+ fees: "900",
92
+ options: '{"maxGasAmount":"9","gasUnitPrice":"100"}',
93
+ errors: "{}",
94
+ }),
95
+ expectedStatus: () =>
96
+ // you can use account and transaction for smart logic. drop the =>fn otherwise
97
+ ({
98
+ errors: {},
99
+ warnings: {},
100
+ amount: BigNumber("1000"),
101
+ }),
102
+ },
103
+ ],
90
104
  },
91
105
  ],
92
106
  };
@@ -10,7 +10,7 @@ export const acceptTransaction: DeviceAction<Transaction, State<Transaction>> =
10
10
  button: SpeculosButton.RIGHT,
11
11
  },
12
12
  {
13
- title: "Transaction Type",
13
+ title: "Transaction",
14
14
  button: SpeculosButton.RIGHT,
15
15
  },
16
16
  {
@@ -18,57 +18,21 @@ export const acceptTransaction: DeviceAction<Transaction, State<Transaction>> =
18
18
  button: SpeculosButton.RIGHT,
19
19
  },
20
20
  {
21
- title: "Amount",
22
- button: SpeculosButton.RIGHT,
23
- },
24
- {
25
- title: "To (1/2)",
26
- button: SpeculosButton.RIGHT,
27
- },
28
- {
29
- title: "To (2/2)",
30
- button: SpeculosButton.RIGHT,
31
- },
32
- {
33
- title: "Gas Fee",
34
- button: SpeculosButton.RIGHT,
35
- },
36
- {
37
- title: "Approve",
38
- button: SpeculosButton.BOTH,
39
- },
40
- ],
41
- });
42
-
43
- export const acceptTokenTransaction: DeviceAction<
44
- Transaction,
45
- State<Transaction>
46
- > = deviceActionFlow({
47
- steps: [
48
- {
49
- title: "Review",
21
+ title: "Coin Type",
50
22
  button: SpeculosButton.RIGHT,
51
23
  },
52
24
  {
53
- title: "Transaction Type",
25
+ title: "Receiver (1/2)",
54
26
  button: SpeculosButton.RIGHT,
55
27
  },
56
28
  {
57
- title: "Function",
29
+ title: "Receiver (2/2)",
58
30
  button: SpeculosButton.RIGHT,
59
31
  },
60
32
  {
61
33
  title: "Amount",
62
34
  button: SpeculosButton.RIGHT,
63
35
  },
64
- {
65
- title: "To (1/2)",
66
- button: SpeculosButton.RIGHT,
67
- },
68
- {
69
- title: "To (2/2)",
70
- button: SpeculosButton.RIGHT,
71
- },
72
36
  {
73
37
  title: "Gas Fee",
74
38
  button: SpeculosButton.RIGHT,
@@ -69,20 +69,6 @@ export type TransactionRaw = TransactionCommonRaw & {
69
69
  errors?: string;
70
70
  };
71
71
 
72
- export type AptosFungibleStoreResourceData = {
73
- balance: BigNumber;
74
- frozen: boolean;
75
- metadata: { inner: string };
76
- };
77
-
78
- export type AptosFungibleoObjectCoreResourceData = {
79
- owner: string;
80
- };
81
-
82
- export type AptosMoveResourceData = {
83
- guid: { id: { addr: string; creation_num: string } };
84
- };
85
-
86
72
  export type AptosMoveResource = {
87
- [key: string]: AptosMoveResourceData;
73
+ [key: string]: { guid: { id: { addr: string; creation_num: string } } };
88
74
  };