@ledgerhq/coin-aptos 1.9.6-next.0 → 1.10.0-nightly.0

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 (158) hide show
  1. package/CHANGELOG.md +13 -4
  2. package/lib/__tests__/api/index.test.js +61 -5
  3. package/lib/__tests__/api/index.test.js.map +1 -1
  4. package/lib/__tests__/bridge/buildTransaction.test.js +57 -2
  5. package/lib/__tests__/bridge/buildTransaction.test.js.map +1 -1
  6. package/lib/__tests__/bridge/getFeesForTransaction.test.js +109 -8
  7. package/lib/__tests__/bridge/getFeesForTransaction.test.js.map +1 -1
  8. package/lib/__tests__/bridge/getTransactionStatus.test.js +175 -37
  9. package/lib/__tests__/bridge/getTransactionStatus.test.js.map +1 -1
  10. package/lib/__tests__/bridge/logic.test.js +889 -115
  11. package/lib/__tests__/bridge/logic.test.js.map +1 -1
  12. package/lib/__tests__/bridge/signOperation.test.js +128 -2
  13. package/lib/__tests__/bridge/signOperation.test.js.map +1 -1
  14. package/lib/__tests__/bridge/synchronisation.test.js +1214 -67
  15. package/lib/__tests__/bridge/synchronisation.test.js.map +1 -1
  16. package/lib/api/graphql/queries.js +6 -6
  17. package/lib/api/graphql/types.d.ts +9 -9
  18. package/lib/api/graphql/types.d.ts.map +1 -1
  19. package/lib/api/index.d.ts +5 -2
  20. package/lib/api/index.d.ts.map +1 -1
  21. package/lib/api/index.js +30 -4
  22. package/lib/api/index.js.map +1 -1
  23. package/lib/bridge/bridge.fixture.d.ts +2 -0
  24. package/lib/bridge/bridge.fixture.d.ts.map +1 -1
  25. package/lib/bridge/bridge.fixture.js +85 -13
  26. package/lib/bridge/bridge.fixture.js.map +1 -1
  27. package/lib/bridge/buildTransaction.d.ts.map +1 -1
  28. package/lib/bridge/buildTransaction.js +29 -3
  29. package/lib/bridge/buildTransaction.js.map +1 -1
  30. package/lib/bridge/estimateMaxSpendable.js +1 -1
  31. package/lib/bridge/estimateMaxSpendable.js.map +1 -1
  32. package/lib/bridge/getFeesForTransaction.d.ts.map +1 -1
  33. package/lib/bridge/getFeesForTransaction.js +12 -7
  34. package/lib/bridge/getFeesForTransaction.js.map +1 -1
  35. package/lib/bridge/getTransactionStatus.d.ts.map +1 -1
  36. package/lib/bridge/getTransactionStatus.js +28 -14
  37. package/lib/bridge/getTransactionStatus.js.map +1 -1
  38. package/lib/bridge/logic.d.ts +13 -8
  39. package/lib/bridge/logic.d.ts.map +1 -1
  40. package/lib/bridge/logic.js +152 -54
  41. package/lib/bridge/logic.js.map +1 -1
  42. package/lib/bridge/prepareTransaction.d.ts.map +1 -1
  43. package/lib/bridge/prepareTransaction.js +2 -2
  44. package/lib/bridge/prepareTransaction.js.map +1 -1
  45. package/lib/bridge/signOperation.d.ts.map +1 -1
  46. package/lib/bridge/signOperation.js +17 -3
  47. package/lib/bridge/signOperation.js.map +1 -1
  48. package/lib/bridge/synchronisation.d.ts +15 -0
  49. package/lib/bridge/synchronisation.d.ts.map +1 -1
  50. package/lib/bridge/synchronisation.js +127 -4
  51. package/lib/bridge/synchronisation.js.map +1 -1
  52. package/lib/constants.d.ts +5 -1
  53. package/lib/constants.d.ts.map +1 -1
  54. package/lib/constants.js +6 -2
  55. package/lib/constants.js.map +1 -1
  56. package/lib/test/bot-specs.d.ts.map +1 -1
  57. package/lib/test/bot-specs.js +40 -1
  58. package/lib/test/bot-specs.js.map +1 -1
  59. package/lib/test/bridgeDatasetTest.d.ts.map +1 -1
  60. package/lib/test/bridgeDatasetTest.js +44 -62
  61. package/lib/test/bridgeDatasetTest.js.map +1 -1
  62. package/lib/test/speculos-deviceActions.d.ts +1 -0
  63. package/lib/test/speculos-deviceActions.d.ts.map +1 -1
  64. package/lib/test/speculos-deviceActions.js +37 -5
  65. package/lib/test/speculos-deviceActions.js.map +1 -1
  66. package/lib/types/index.d.ts +18 -7
  67. package/lib/types/index.d.ts.map +1 -1
  68. package/lib-es/__tests__/api/index.test.js +61 -5
  69. package/lib-es/__tests__/api/index.test.js.map +1 -1
  70. package/lib-es/__tests__/bridge/buildTransaction.test.js +58 -3
  71. package/lib-es/__tests__/bridge/buildTransaction.test.js.map +1 -1
  72. package/lib-es/__tests__/bridge/getFeesForTransaction.test.js +110 -9
  73. package/lib-es/__tests__/bridge/getFeesForTransaction.test.js.map +1 -1
  74. package/lib-es/__tests__/bridge/getTransactionStatus.test.js +177 -39
  75. package/lib-es/__tests__/bridge/getTransactionStatus.test.js.map +1 -1
  76. package/lib-es/__tests__/bridge/logic.test.js +891 -117
  77. package/lib-es/__tests__/bridge/logic.test.js.map +1 -1
  78. package/lib-es/__tests__/bridge/signOperation.test.js +128 -2
  79. package/lib-es/__tests__/bridge/signOperation.test.js.map +1 -1
  80. package/lib-es/__tests__/bridge/synchronisation.test.js +1213 -69
  81. package/lib-es/__tests__/bridge/synchronisation.test.js.map +1 -1
  82. package/lib-es/api/graphql/queries.js +6 -6
  83. package/lib-es/api/graphql/types.d.ts +9 -9
  84. package/lib-es/api/graphql/types.d.ts.map +1 -1
  85. package/lib-es/api/index.d.ts +5 -2
  86. package/lib-es/api/index.d.ts.map +1 -1
  87. package/lib-es/api/index.js +30 -4
  88. package/lib-es/api/index.js.map +1 -1
  89. package/lib-es/bridge/bridge.fixture.d.ts +2 -0
  90. package/lib-es/bridge/bridge.fixture.d.ts.map +1 -1
  91. package/lib-es/bridge/bridge.fixture.js +82 -12
  92. package/lib-es/bridge/bridge.fixture.js.map +1 -1
  93. package/lib-es/bridge/buildTransaction.d.ts.map +1 -1
  94. package/lib-es/bridge/buildTransaction.js +30 -4
  95. package/lib-es/bridge/buildTransaction.js.map +1 -1
  96. package/lib-es/bridge/estimateMaxSpendable.js +1 -1
  97. package/lib-es/bridge/estimateMaxSpendable.js.map +1 -1
  98. package/lib-es/bridge/getFeesForTransaction.d.ts.map +1 -1
  99. package/lib-es/bridge/getFeesForTransaction.js +13 -8
  100. package/lib-es/bridge/getFeesForTransaction.js.map +1 -1
  101. package/lib-es/bridge/getTransactionStatus.d.ts.map +1 -1
  102. package/lib-es/bridge/getTransactionStatus.js +28 -14
  103. package/lib-es/bridge/getTransactionStatus.js.map +1 -1
  104. package/lib-es/bridge/logic.d.ts +13 -8
  105. package/lib-es/bridge/logic.d.ts.map +1 -1
  106. package/lib-es/bridge/logic.js +146 -52
  107. package/lib-es/bridge/logic.js.map +1 -1
  108. package/lib-es/bridge/prepareTransaction.d.ts.map +1 -1
  109. package/lib-es/bridge/prepareTransaction.js +2 -2
  110. package/lib-es/bridge/prepareTransaction.js.map +1 -1
  111. package/lib-es/bridge/signOperation.d.ts.map +1 -1
  112. package/lib-es/bridge/signOperation.js +17 -3
  113. package/lib-es/bridge/signOperation.js.map +1 -1
  114. package/lib-es/bridge/synchronisation.d.ts +15 -0
  115. package/lib-es/bridge/synchronisation.d.ts.map +1 -1
  116. package/lib-es/bridge/synchronisation.js +123 -3
  117. package/lib-es/bridge/synchronisation.js.map +1 -1
  118. package/lib-es/constants.d.ts +5 -1
  119. package/lib-es/constants.d.ts.map +1 -1
  120. package/lib-es/constants.js +5 -1
  121. package/lib-es/constants.js.map +1 -1
  122. package/lib-es/test/bot-specs.d.ts.map +1 -1
  123. package/lib-es/test/bot-specs.js +41 -2
  124. package/lib-es/test/bot-specs.js.map +1 -1
  125. package/lib-es/test/bridgeDatasetTest.d.ts.map +1 -1
  126. package/lib-es/test/bridgeDatasetTest.js +44 -59
  127. package/lib-es/test/bridgeDatasetTest.js.map +1 -1
  128. package/lib-es/test/speculos-deviceActions.d.ts +1 -0
  129. package/lib-es/test/speculos-deviceActions.d.ts.map +1 -1
  130. package/lib-es/test/speculos-deviceActions.js +36 -4
  131. package/lib-es/test/speculos-deviceActions.js.map +1 -1
  132. package/lib-es/types/index.d.ts +18 -7
  133. package/lib-es/types/index.d.ts.map +1 -1
  134. package/package.json +9 -8
  135. package/src/__tests__/api/index.test.ts +75 -5
  136. package/src/__tests__/bridge/buildTransaction.test.ts +85 -3
  137. package/src/__tests__/bridge/getFeesForTransaction.test.ts +144 -9
  138. package/src/__tests__/bridge/getTransactionStatus.test.ts +217 -38
  139. package/src/__tests__/bridge/logic.test.ts +922 -118
  140. package/src/__tests__/bridge/signOperation.test.ts +141 -2
  141. package/src/__tests__/bridge/synchronisation.test.ts +1265 -71
  142. package/src/api/graphql/queries.ts +6 -6
  143. package/src/api/graphql/types.ts +9 -9
  144. package/src/api/index.ts +32 -5
  145. package/src/bridge/bridge.fixture.ts +91 -12
  146. package/src/bridge/buildTransaction.ts +39 -6
  147. package/src/bridge/estimateMaxSpendable.ts +1 -1
  148. package/src/bridge/getFeesForTransaction.ts +14 -9
  149. package/src/bridge/getTransactionStatus.ts +35 -13
  150. package/src/bridge/logic.ts +202 -63
  151. package/src/bridge/prepareTransaction.ts +4 -3
  152. package/src/bridge/signOperation.ts +19 -3
  153. package/src/bridge/synchronisation.ts +170 -3
  154. package/src/constants.ts +12 -1
  155. package/src/test/bot-specs.ts +63 -3
  156. package/src/test/bridgeDatasetTest.ts +46 -59
  157. package/src/test/speculos-deviceActions.ts +40 -4
  158. package/src/types/index.ts +15 -1
@@ -1,5 +1,10 @@
1
1
  import BigNumber from "bignumber.js";
2
- import { createFixtureAccount, createFixtureTransaction } from "../../bridge/bridge.fixture";
2
+ import {
3
+ createFixtureAccount,
4
+ createFixtureAccountWithSubAccount,
5
+ createFixtureTransaction,
6
+ createFixtureTransactionWithSubAccount,
7
+ } from "../../bridge/bridge.fixture";
3
8
  import getTransactionStatus from "../../bridge/getTransactionStatus";
4
9
  import {
5
10
  AmountRequired,
@@ -7,15 +12,16 @@ import {
7
12
  InvalidAddress,
8
13
  InvalidAddressBecauseDestinationIsAlsoSource,
9
14
  NotEnoughBalance,
15
+ NotEnoughBalanceFees,
10
16
  RecipientRequired,
11
17
  } from "@ledgerhq/errors";
12
18
 
13
19
  describe("getTransactionStatus Test", () => {
14
- it("should return errors for AmountRequired", async () => {
20
+ it("should return error for AmountRequired", async () => {
15
21
  const account = createFixtureAccount();
16
22
  const transaction = createFixtureTransaction();
17
23
 
18
- transaction.fees = new BigNumber(2);
24
+ transaction.fees = BigNumber(2);
19
25
  transaction.recipient = "0x" + "0".repeat(64);
20
26
 
21
27
  const result = await getTransactionStatus(account, transaction);
@@ -25,21 +31,21 @@ describe("getTransactionStatus Test", () => {
25
31
  amount: new AmountRequired(),
26
32
  },
27
33
  warnings: {},
28
- estimatedFees: new BigNumber(2),
29
- amount: new BigNumber(0),
30
- totalSpent: new BigNumber(2),
34
+ estimatedFees: BigNumber(2),
35
+ amount: BigNumber(0),
36
+ totalSpent: BigNumber(2),
31
37
  };
32
38
 
33
39
  expect(result).toEqual(expected);
34
40
  });
35
41
 
36
- it("should return errors for FeeNotLoaded", async () => {
42
+ it("should return error for FeeNotLoaded", async () => {
37
43
  const account = createFixtureAccount();
38
- account.balance = new BigNumber(10);
44
+ account.spendableBalance = BigNumber(10);
39
45
 
40
46
  const transaction = createFixtureTransaction();
41
47
  transaction.fees = null;
42
- transaction.amount = new BigNumber(2);
48
+ transaction.amount = BigNumber(2);
43
49
  transaction.recipient = "0x" + "0".repeat(64);
44
50
 
45
51
  const result = await getTransactionStatus(account, transaction);
@@ -49,22 +55,71 @@ describe("getTransactionStatus Test", () => {
49
55
  fees: new FeeNotLoaded(),
50
56
  },
51
57
  warnings: {},
52
- estimatedFees: new BigNumber(0),
53
- amount: new BigNumber(2),
54
- totalSpent: new BigNumber(2),
58
+ estimatedFees: BigNumber(0),
59
+ amount: BigNumber(2),
60
+ totalSpent: BigNumber(2),
61
+ };
62
+
63
+ expect(result).toEqual(expected);
64
+ });
65
+
66
+ it("should return error for NotEnoughBalance", async () => {
67
+ const account = createFixtureAccount();
68
+ account.spendableBalance = BigNumber(1);
69
+
70
+ const transaction = createFixtureTransaction();
71
+ transaction.recipient = "0x" + "0".repeat(64);
72
+ transaction.amount = BigNumber(2);
73
+ transaction.fees = BigNumber(2);
74
+
75
+ const result = await getTransactionStatus(account, transaction);
76
+
77
+ const expected = {
78
+ errors: {
79
+ amount: new NotEnoughBalance(),
80
+ },
81
+ warnings: {},
82
+ estimatedFees: BigNumber(2),
83
+ amount: BigNumber(2),
84
+ totalSpent: BigNumber(4),
55
85
  };
56
86
 
57
87
  expect(result).toEqual(expected);
58
88
  });
59
89
 
60
- it("should return errors for NotEnoughBalance", async () => {
90
+ it("should return error for NotEnoughBalance and amount equal to zero with use all amount option", async () => {
61
91
  const account = createFixtureAccount();
62
- account.balance = new BigNumber(1);
92
+ account.spendableBalance = BigNumber(1);
63
93
 
64
94
  const transaction = createFixtureTransaction();
65
95
  transaction.recipient = "0x" + "0".repeat(64);
66
- transaction.amount = new BigNumber(2);
67
- transaction.fees = new BigNumber(2);
96
+ transaction.amount = BigNumber(2);
97
+ transaction.fees = BigNumber(2);
98
+ transaction.useAllAmount = true;
99
+
100
+ const result = await getTransactionStatus(account, transaction);
101
+
102
+ const expected = {
103
+ errors: {
104
+ amount: new NotEnoughBalance(),
105
+ },
106
+ warnings: {},
107
+ estimatedFees: BigNumber(2),
108
+ amount: BigNumber(0),
109
+ totalSpent: BigNumber(2),
110
+ };
111
+
112
+ expect(result).toEqual(expected);
113
+ });
114
+
115
+ it("should return error for NotEnoughBalance for token account when not enough tokens", async () => {
116
+ const account = createFixtureAccountWithSubAccount("coin");
117
+ account.spendableBalance = BigNumber(300);
118
+
119
+ const transaction = createFixtureTransactionWithSubAccount();
120
+ transaction.recipient = "0x" + "0".repeat(64);
121
+ transaction.amount = BigNumber(2000);
122
+ transaction.fees = BigNumber(200);
68
123
 
69
124
  const result = await getTransactionStatus(account, transaction);
70
125
 
@@ -73,21 +128,97 @@ describe("getTransactionStatus Test", () => {
73
128
  amount: new NotEnoughBalance(),
74
129
  },
75
130
  warnings: {},
76
- estimatedFees: new BigNumber(2),
77
- amount: new BigNumber(2),
78
- totalSpent: new BigNumber(4),
131
+ estimatedFees: BigNumber(200),
132
+ amount: BigNumber(2000),
133
+ totalSpent: BigNumber(2000),
79
134
  };
80
135
 
81
136
  expect(result).toEqual(expected);
82
137
  });
83
138
 
84
- it("should return errors for RecipientRequired", async () => {
139
+ it("should return error for NotEnoughBalance with use all amount option", async () => {
85
140
  const account = createFixtureAccount();
86
- account.balance = new BigNumber(10);
141
+ account.spendableBalance = BigNumber(1);
87
142
 
88
143
  const transaction = createFixtureTransaction();
89
- transaction.amount = new BigNumber(2);
90
- transaction.fees = new BigNumber(2);
144
+ transaction.recipient = "0x" + "0".repeat(64);
145
+ transaction.amount = BigNumber(2);
146
+ transaction.fees = BigNumber(2);
147
+ transaction.useAllAmount = true;
148
+
149
+ const result = await getTransactionStatus(account, transaction);
150
+
151
+ const expected = {
152
+ errors: {
153
+ amount: new NotEnoughBalance(),
154
+ },
155
+ warnings: {},
156
+ estimatedFees: BigNumber(2),
157
+ amount: BigNumber(0),
158
+ totalSpent: BigNumber(2),
159
+ };
160
+
161
+ expect(result).toEqual(expected);
162
+ });
163
+
164
+ it("should return error for NotEnoughBalance for token account with use all amount option when not enough fees", async () => {
165
+ const account = createFixtureAccountWithSubAccount("coin");
166
+ account.spendableBalance = BigNumber(10);
167
+
168
+ const transaction = createFixtureTransactionWithSubAccount();
169
+ transaction.recipient = "0x" + "0".repeat(64);
170
+ transaction.amount = BigNumber(2000);
171
+ transaction.fees = BigNumber(200);
172
+ transaction.useAllAmount = true;
173
+
174
+ const result = await getTransactionStatus(account, transaction);
175
+
176
+ const expected = {
177
+ errors: {
178
+ amount: new NotEnoughBalance(),
179
+ },
180
+ warnings: {},
181
+ estimatedFees: BigNumber(200),
182
+ amount: BigNumber(1000),
183
+ totalSpent: BigNumber(1000),
184
+ };
185
+
186
+ expect(result).toEqual(expected);
187
+ });
188
+
189
+ it("should return error for NotEnoughBalanceFees", async () => {
190
+ const account = createFixtureAccountWithSubAccount("coin");
191
+ account.spendableBalance = BigNumber(1);
192
+
193
+ const transaction = createFixtureTransactionWithSubAccount();
194
+ transaction.recipient = "0x" + "0".repeat(64);
195
+ transaction.amount = BigNumber(2);
196
+ transaction.fees = BigNumber(0);
197
+ transaction.errors = { maxGasAmount: "GasInsufficientBalance" };
198
+
199
+ const result = await getTransactionStatus(account, transaction);
200
+
201
+ const expected = {
202
+ errors: {
203
+ amount: new NotEnoughBalanceFees(),
204
+ },
205
+ warnings: {},
206
+ estimatedFees: BigNumber(0),
207
+ amount: BigNumber(2),
208
+ totalSpent: BigNumber(2),
209
+ };
210
+
211
+ expect(result).toEqual(expected);
212
+ });
213
+
214
+ it("should return error for RecipientRequired", async () => {
215
+ const account = createFixtureAccount();
216
+ account.spendableBalance = BigNumber(10);
217
+
218
+ const transaction = createFixtureTransaction();
219
+ transaction.amount = BigNumber(2);
220
+ transaction.fees = BigNumber(2);
221
+ transaction.recipient = "";
91
222
 
92
223
  const result = await getTransactionStatus(account, transaction);
93
224
 
@@ -96,20 +227,20 @@ describe("getTransactionStatus Test", () => {
96
227
  recipient: new RecipientRequired(),
97
228
  },
98
229
  warnings: {},
99
- estimatedFees: new BigNumber(2),
100
- amount: new BigNumber(2),
101
- totalSpent: new BigNumber(4),
230
+ estimatedFees: BigNumber(2),
231
+ amount: BigNumber(2),
232
+ totalSpent: BigNumber(4),
102
233
  };
103
234
 
104
235
  expect(result).toEqual(expected);
105
236
  });
106
237
 
107
- it("should return errors for InvalidAddress", async () => {
238
+ it("should return error for InvalidAddress", async () => {
108
239
  const account = createFixtureAccount();
109
240
  const transaction = createFixtureTransaction();
110
241
 
111
- transaction.amount = new BigNumber(2);
112
- transaction.fees = new BigNumber(2);
242
+ transaction.amount = BigNumber(2);
243
+ transaction.fees = BigNumber(2);
113
244
  transaction.recipient = "0x";
114
245
 
115
246
  const result = await getTransactionStatus(account, transaction);
@@ -120,20 +251,20 @@ describe("getTransactionStatus Test", () => {
120
251
  amount: new NotEnoughBalance(),
121
252
  },
122
253
  warnings: {},
123
- estimatedFees: new BigNumber(2),
124
- amount: new BigNumber(2),
125
- totalSpent: new BigNumber(4),
254
+ estimatedFees: BigNumber(2),
255
+ amount: BigNumber(2),
256
+ totalSpent: BigNumber(4),
126
257
  };
127
258
 
128
259
  expect(result).toEqual(expected);
129
260
  });
130
261
 
131
- it("should return errors for InvalidAddressBecauseDestinationIsAlsoSource", async () => {
262
+ it("should return error for InvalidAddressBecauseDestinationIsAlsoSource", async () => {
132
263
  const account = createFixtureAccount();
133
264
  const transaction = createFixtureTransaction();
134
265
 
135
- transaction.amount = new BigNumber(2);
136
- transaction.fees = new BigNumber(2);
266
+ transaction.amount = BigNumber(2);
267
+ transaction.fees = BigNumber(2);
137
268
  transaction.recipient = "0x" + "0".repeat(64);
138
269
  account.freshAddress = transaction.recipient;
139
270
 
@@ -145,9 +276,57 @@ describe("getTransactionStatus Test", () => {
145
276
  amount: new NotEnoughBalance(),
146
277
  },
147
278
  warnings: {},
148
- estimatedFees: new BigNumber(2),
149
- amount: new BigNumber(2),
150
- totalSpent: new BigNumber(4),
279
+ estimatedFees: BigNumber(2),
280
+ amount: BigNumber(2),
281
+ totalSpent: BigNumber(4),
282
+ };
283
+
284
+ expect(result).toEqual(expected);
285
+ });
286
+
287
+ it("should return error for RecipientRequired", async () => {
288
+ const account = createFixtureAccount();
289
+ const transaction = createFixtureTransaction();
290
+
291
+ transaction.amount = BigNumber(2);
292
+ transaction.fees = BigNumber(2);
293
+ transaction.recipient = "";
294
+ account.freshAddress = transaction.recipient;
295
+
296
+ const result = await getTransactionStatus(account, transaction);
297
+
298
+ const expected = {
299
+ errors: {
300
+ recipient: new RecipientRequired(),
301
+ amount: new NotEnoughBalance(),
302
+ },
303
+ warnings: {},
304
+ estimatedFees: BigNumber(2),
305
+ amount: BigNumber(2),
306
+ totalSpent: BigNumber(4),
307
+ };
308
+
309
+ expect(result).toEqual(expected);
310
+ });
311
+
312
+ it("should return right amount and total spent with use all amount option", async () => {
313
+ const account = createFixtureAccount();
314
+ account.spendableBalance = BigNumber(10);
315
+
316
+ const transaction = createFixtureTransaction();
317
+ transaction.recipient = "0x" + "0".repeat(64);
318
+ transaction.amount = BigNumber(2);
319
+ transaction.fees = BigNumber(2);
320
+ transaction.useAllAmount = true;
321
+
322
+ const result = await getTransactionStatus(account, transaction);
323
+
324
+ const expected = {
325
+ errors: {},
326
+ warnings: {},
327
+ estimatedFees: BigNumber(2),
328
+ amount: BigNumber(8),
329
+ totalSpent: BigNumber(10),
151
330
  };
152
331
 
153
332
  expect(result).toEqual(expected);