@ledgerhq/live-common 21.21.2 → 21.22.1
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.
- package/lib/api/Ethereum.d.ts.map +1 -1
- package/lib/api/Ethereum.js +2 -1
- package/lib/api/Ethereum.js.map +1 -1
- package/lib/apps/polyfill.d.ts.map +1 -1
- package/lib/apps/polyfill.js +1 -0
- package/lib/apps/polyfill.js.map +1 -1
- package/lib/bot/engine.js +1 -1
- package/lib/bot/engine.js.map +1 -1
- package/lib/bot/specs.d.ts +1 -0
- package/lib/bot/specs.d.ts.map +1 -1
- package/lib/bot/specs.js +3 -1
- package/lib/bot/specs.js.map +1 -1
- package/lib/env.js +2 -2
- package/lib/env.js.map +1 -1
- package/lib/families/ethereum/signOperation.d.ts.map +1 -1
- package/lib/families/ethereum/signOperation.js +2 -2
- package/lib/families/ethereum/signOperation.js.map +1 -1
- package/lib/families/tezos/bridge/js.d.ts.map +1 -1
- package/lib/families/tezos/bridge/js.js +90 -50
- package/lib/families/tezos/bridge/js.js.map +1 -1
- package/lib/families/tezos/bridge/libcore.d.ts.map +1 -1
- package/lib/families/tezos/bridge/libcore.js +2 -1
- package/lib/families/tezos/bridge/libcore.js.map +1 -1
- package/lib/families/tezos/bridge/mock.d.ts.map +1 -1
- package/lib/families/tezos/bridge/mock.js +2 -1
- package/lib/families/tezos/bridge/mock.js.map +1 -1
- package/lib/families/tezos/signOperation.d.ts.map +1 -1
- package/lib/families/tezos/signOperation.js +28 -19
- package/lib/families/tezos/signOperation.js.map +1 -1
- package/lib/families/tezos/specs.d.ts.map +1 -1
- package/lib/families/tezos/specs.js +8 -4
- package/lib/families/tezos/specs.js.map +1 -1
- package/lib/families/tezos/speculos-deviceActions.js +6 -7
- package/lib/families/tezos/speculos-deviceActions.js.map +1 -1
- package/lib/families/tezos/synchronisation.d.ts.map +1 -1
- package/lib/families/tezos/synchronisation.js +7 -4
- package/lib/families/tezos/synchronisation.js.map +1 -1
- package/lib/families/tezos/synchronisation.test.d.ts.map +1 -1
- package/lib/families/tezos/synchronisation.test.js +0 -3
- package/lib/families/tezos/synchronisation.test.js.map +1 -1
- package/lib/families/tezos/test-dataset.d.ts +2 -2
- package/lib/families/tezos/test-dataset.d.ts.map +1 -1
- package/lib/families/tezos/test-dataset.js +45 -319
- package/lib/families/tezos/test-dataset.js.map +1 -1
- package/lib/families/tezos/transaction.d.ts +2 -2
- package/lib/families/tezos/transaction.d.ts.map +1 -1
- package/lib/families/tezos/transaction.js +4 -4
- package/lib/families/tezos/transaction.js.map +1 -1
- package/lib/families/tezos/types.d.ts +2 -0
- package/lib/families/tezos/types.d.ts.map +1 -1
- package/lib/families/tezos/types.js.map +1 -1
- package/lib/generated/transaction.d.ts +1 -1
- package/package.json +9 -9
- package/src/api/Ethereum.ts +3 -1
- package/src/apps/polyfill.ts +1 -0
- package/src/bot/engine.ts +1 -1
- package/src/bot/specs.ts +7 -1
- package/src/env.ts +2 -2
- package/src/families/ethereum/signOperation.ts +2 -2
- package/src/families/tezos/bridge/js.ts +77 -36
- package/src/families/tezos/bridge/libcore.ts +1 -0
- package/src/families/tezos/bridge/mock.ts +1 -0
- package/src/families/tezos/signOperation.ts +19 -8
- package/src/families/tezos/specs.ts +16 -5
- package/src/families/tezos/speculos-deviceActions.ts +5 -5
- package/src/families/tezos/synchronisation.test.ts +0 -3
- package/src/families/tezos/synchronisation.ts +6 -3
- package/src/families/tezos/test-dataset.ts +33 -363
- package/src/families/tezos/transaction.ts +7 -1
- package/src/families/tezos/types.ts +2 -0
|
@@ -1,431 +1,101 @@
|
|
|
1
|
-
import invariant from "invariant";
|
|
2
|
-
import {
|
|
3
|
-
NotEnoughBalance,
|
|
4
|
-
NotEnoughBalanceInParentAccount,
|
|
5
|
-
InvalidAddressBecauseDestinationIsAlsoSource,
|
|
6
|
-
RecommendUndelegation,
|
|
7
|
-
NotSupportedLegacyAddress,
|
|
8
|
-
} from "@ledgerhq/errors";
|
|
9
|
-
import { BigNumber } from "bignumber.js";
|
|
10
|
-
import { fromTransactionRaw } from "./transaction";
|
|
11
1
|
import type { DatasetTest } from "../../types";
|
|
12
2
|
import type { Transaction } from "./types";
|
|
13
|
-
|
|
3
|
+
|
|
4
|
+
// TODO restore
|
|
5
|
+
// import tezosScanAccounts1 from "./datasets/tezos.scanAccounts.1";
|
|
6
|
+
|
|
7
|
+
// FIXME these accounts no longer reflect their expected states..
|
|
14
8
|
export const accountTZrevealedDelegating = makeAccount(
|
|
15
9
|
"TZrevealedDelegating",
|
|
16
|
-
"
|
|
10
|
+
"tz1boBHAVpwcvKkNFAQHYr7mjxAz1PpVgKq7",
|
|
17
11
|
"tezbox"
|
|
18
12
|
);
|
|
13
|
+
/*
|
|
19
14
|
const accountTZwithKT = makeAccount(
|
|
20
15
|
"TZwithKT",
|
|
21
|
-
"
|
|
16
|
+
"tz1T72nyqnJWwxad6RQnh7imKQz7mzToamWd",
|
|
22
17
|
"tezbox"
|
|
23
18
|
);
|
|
19
|
+
*/
|
|
24
20
|
const accountTZnew = makeAccount(
|
|
25
21
|
"TZnew",
|
|
26
|
-
"
|
|
22
|
+
"tz1VSichevvJSNkSSntgwKDKikWNB6iqNJii",
|
|
27
23
|
"tezbox"
|
|
28
24
|
);
|
|
29
25
|
const accountTZnotRevealed = makeAccount(
|
|
30
26
|
"TZnotRevealed",
|
|
31
|
-
"
|
|
27
|
+
"tz1PWFt4Ym6HedY78MgUP2kVDtSampGwprs5",
|
|
32
28
|
"tezosbip44h"
|
|
33
29
|
);
|
|
34
30
|
const accountTZRevealedNoDelegate = makeAccount(
|
|
35
31
|
"TZRevealedNoDelegate",
|
|
36
|
-
"
|
|
32
|
+
"tz1YkAjh5mm5gJ5u3VbFLEtpAG7cFo7PfCux",
|
|
37
33
|
"tezosbip44h"
|
|
38
34
|
);
|
|
35
|
+
/*
|
|
39
36
|
const accountTZemptyWithKT = makeAccount(
|
|
40
37
|
"TZemptyWithKT",
|
|
41
|
-
"
|
|
38
|
+
"tz1TeawWFnUmeP1qQLf4JWe5D7LaNp1qxgMW",
|
|
42
39
|
"tezbox"
|
|
43
40
|
);
|
|
44
|
-
|
|
45
|
-
"tz1boBHAVpwcvKkNFAQHYr7mjxAz1PpVgKq7";
|
|
46
|
-
const addressTZregular = "tz1T72nyqnJWwxad6RQnh7imKQz7mzToamWd";
|
|
47
|
-
const addressTZnew = "tz1VSichevvJSNkSSntgwKDKikWNB6iqNJii";
|
|
48
|
-
const addressKT = "KT1V99vDN5DHNpU9swVXg1cAT2ji981cccXC";
|
|
49
|
-
const addressDelegator = "tz1WCd2jm4uSt4vntk4vSuUWoZQGhLcDuR9q";
|
|
50
|
-
|
|
51
|
-
const reservedAmountForStorageLimit = (storageLimit) =>
|
|
52
|
-
new BigNumber(storageLimit || 0).times("1000");
|
|
41
|
+
*/
|
|
53
42
|
|
|
54
43
|
const dataset: DatasetTest<Transaction> = {
|
|
55
|
-
implementations: ["
|
|
56
|
-
|
|
57
|
-
currencies: {} || {
|
|
44
|
+
implementations: ["js"],
|
|
45
|
+
currencies: {
|
|
58
46
|
tezos: {
|
|
59
47
|
FIXME_ignoreOperationFields: ["blockHeight"],
|
|
60
|
-
scanAccounts: [tezosScanAccounts1],
|
|
48
|
+
// scanAccounts: [tezosScanAccounts1],
|
|
49
|
+
scanAccounts: [],
|
|
61
50
|
accounts: [
|
|
62
51
|
{
|
|
63
|
-
FIXME_tests: [
|
|
64
|
-
"balance is sum of ops", // https://ledgerhq.atlassian.net/browse/LLC-591
|
|
65
|
-
],
|
|
66
52
|
raw: accountTZrevealedDelegating,
|
|
67
|
-
transactions: [
|
|
68
|
-
{
|
|
69
|
-
name: "send max to new account (explicit)",
|
|
70
|
-
transaction: fromTransactionRaw({
|
|
71
|
-
amount: "0",
|
|
72
|
-
recipient: addressTZnew,
|
|
73
|
-
useAllAmount: true,
|
|
74
|
-
family: "tezos",
|
|
75
|
-
mode: "send",
|
|
76
|
-
networkInfo: {
|
|
77
|
-
family: "tezos",
|
|
78
|
-
fees: "3075",
|
|
79
|
-
},
|
|
80
|
-
fees: "3075",
|
|
81
|
-
gasLimit: "10600",
|
|
82
|
-
storageLimit: "300",
|
|
83
|
-
taquitoError: null,
|
|
84
|
-
}),
|
|
85
|
-
expectedStatus: (account) => ({
|
|
86
|
-
errors: {},
|
|
87
|
-
warnings: {
|
|
88
|
-
amount: new RecommendUndelegation(),
|
|
89
|
-
},
|
|
90
|
-
estimatedFees: new BigNumber("3075"),
|
|
91
|
-
amount: account.balance
|
|
92
|
-
.minus(reservedAmountForStorageLimit("300"))
|
|
93
|
-
.minus("3075"),
|
|
94
|
-
totalSpent: account.balance,
|
|
95
|
-
}),
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
name: "overflow send to new account",
|
|
99
|
-
transaction: (t, account) => ({
|
|
100
|
-
...t,
|
|
101
|
-
amount: account.balance.minus(t.fees || 0).minus("1000"),
|
|
102
|
-
recipient: addressTZnew,
|
|
103
|
-
}),
|
|
104
|
-
expectedStatus: {
|
|
105
|
-
errors: {
|
|
106
|
-
amount: new NotEnoughBalance(),
|
|
107
|
-
},
|
|
108
|
-
warnings: {},
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
name: "send max to new account (dynamic)",
|
|
113
|
-
transaction: (t) => ({
|
|
114
|
-
...t,
|
|
115
|
-
recipient: addressTZnew,
|
|
116
|
-
useAllAmount: true,
|
|
117
|
-
}),
|
|
118
|
-
expectedStatus: (account, { storageLimit, fees }) => (
|
|
119
|
-
invariant(fees, "fees are required"),
|
|
120
|
-
{
|
|
121
|
-
errors: {},
|
|
122
|
-
warnings: {
|
|
123
|
-
amount: new RecommendUndelegation(),
|
|
124
|
-
},
|
|
125
|
-
estimatedFees: fees,
|
|
126
|
-
amount: account.balance
|
|
127
|
-
.minus(reservedAmountForStorageLimit(storageLimit))
|
|
128
|
-
.minus(fees as BigNumber),
|
|
129
|
-
totalSpent: account.balance,
|
|
130
|
-
}
|
|
131
|
-
),
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
name: "send max to existing account",
|
|
135
|
-
transaction: (t) => ({
|
|
136
|
-
...t,
|
|
137
|
-
recipient: addressTZregular,
|
|
138
|
-
useAllAmount: true,
|
|
139
|
-
}),
|
|
140
|
-
expectedStatus: (account, { fees }) => (
|
|
141
|
-
invariant(fees, "fees are required"),
|
|
142
|
-
{
|
|
143
|
-
errors: {},
|
|
144
|
-
warnings: {
|
|
145
|
-
amount: new RecommendUndelegation(),
|
|
146
|
-
},
|
|
147
|
-
estimatedFees: fees,
|
|
148
|
-
amount: account.balance.minus(fees as BigNumber),
|
|
149
|
-
totalSpent: account.balance,
|
|
150
|
-
}
|
|
151
|
-
),
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
name: "self tx forbidden",
|
|
155
|
-
transaction: (t) => ({
|
|
156
|
-
...t,
|
|
157
|
-
recipient: addressAccountTZrevealedDelegating,
|
|
158
|
-
amount: new BigNumber(0.1),
|
|
159
|
-
}),
|
|
160
|
-
expectedStatus: {
|
|
161
|
-
errors: {
|
|
162
|
-
recipient: new InvalidAddressBecauseDestinationIsAlsoSource(),
|
|
163
|
-
},
|
|
164
|
-
warnings: {},
|
|
165
|
-
},
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
name: "undelegate",
|
|
169
|
-
transaction: (t) => ({ ...t, mode: "undelegate" }),
|
|
170
|
-
expectedStatus: (account, { fees }) => (
|
|
171
|
-
invariant(fees, "fees are required"),
|
|
172
|
-
{
|
|
173
|
-
errors: {},
|
|
174
|
-
warnings: {},
|
|
175
|
-
amount: new BigNumber(0),
|
|
176
|
-
estimatedFees: fees,
|
|
177
|
-
}
|
|
178
|
-
),
|
|
179
|
-
},
|
|
180
|
-
],
|
|
53
|
+
transactions: [],
|
|
181
54
|
},
|
|
182
55
|
{
|
|
183
|
-
FIXME_tests: [
|
|
184
|
-
"balance is sum of ops", // https://ledgerhq.atlassian.net/browse/LLC-591
|
|
185
|
-
],
|
|
186
56
|
raw: accountTZRevealedNoDelegate,
|
|
187
|
-
transactions: [
|
|
188
|
-
{
|
|
189
|
-
name: "send max to new account",
|
|
190
|
-
transaction: (t) => ({
|
|
191
|
-
...t,
|
|
192
|
-
recipient: addressTZnew,
|
|
193
|
-
useAllAmount: true,
|
|
194
|
-
}),
|
|
195
|
-
expectedStatus: (account, { storageLimit, fees }) => (
|
|
196
|
-
invariant(fees, "fees are required"),
|
|
197
|
-
{
|
|
198
|
-
errors: {},
|
|
199
|
-
warnings: {},
|
|
200
|
-
estimatedFees: fees,
|
|
201
|
-
amount: account.balance
|
|
202
|
-
.minus(reservedAmountForStorageLimit(storageLimit))
|
|
203
|
-
.minus(fees as BigNumber),
|
|
204
|
-
totalSpent: account.balance,
|
|
205
|
-
}
|
|
206
|
-
),
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
name: "send max to existing account",
|
|
210
|
-
transaction: (t) => ({
|
|
211
|
-
...t,
|
|
212
|
-
recipient: addressTZregular,
|
|
213
|
-
useAllAmount: true,
|
|
214
|
-
}),
|
|
215
|
-
expectedStatus: (account, { fees }) => (
|
|
216
|
-
invariant(fees, "fees are required"),
|
|
217
|
-
{
|
|
218
|
-
errors: {},
|
|
219
|
-
warnings: {},
|
|
220
|
-
estimatedFees: fees,
|
|
221
|
-
amount: account.balance.minus(fees as BigNumber),
|
|
222
|
-
totalSpent: account.balance,
|
|
223
|
-
}
|
|
224
|
-
),
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
name: "delegate",
|
|
228
|
-
transaction: (t) => ({
|
|
229
|
-
...t,
|
|
230
|
-
recipient: addressDelegator,
|
|
231
|
-
mode: "delegate",
|
|
232
|
-
}),
|
|
233
|
-
expectedStatus: (account, { fees }) => (
|
|
234
|
-
invariant(fees, "fees are required"),
|
|
235
|
-
{
|
|
236
|
-
errors: {},
|
|
237
|
-
warnings: {},
|
|
238
|
-
amount: new BigNumber(0),
|
|
239
|
-
estimatedFees: fees,
|
|
240
|
-
}
|
|
241
|
-
),
|
|
242
|
-
},
|
|
243
|
-
],
|
|
57
|
+
transactions: [],
|
|
244
58
|
},
|
|
245
59
|
{
|
|
246
60
|
raw: accountTZnotRevealed,
|
|
247
|
-
|
|
248
|
-
"balance is sum of ops", // https://ledgerhq.atlassian.net/browse/LLC-591
|
|
249
|
-
],
|
|
250
|
-
transactions: [
|
|
251
|
-
{
|
|
252
|
-
name: "send 10% to KT",
|
|
253
|
-
transaction: (t, account) => ({
|
|
254
|
-
...t,
|
|
255
|
-
recipient: addressKT,
|
|
256
|
-
amount: account.balance.div(10),
|
|
257
|
-
}),
|
|
258
|
-
expectedStatus: {
|
|
259
|
-
errors: {
|
|
260
|
-
recipient: new NotSupportedLegacyAddress(),
|
|
261
|
-
},
|
|
262
|
-
warnings: {},
|
|
263
|
-
},
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
name: "send 10% to existing tz",
|
|
267
|
-
transaction: (t, account) => ({
|
|
268
|
-
...t,
|
|
269
|
-
recipient: addressTZnew,
|
|
270
|
-
amount: account.balance.div(10),
|
|
271
|
-
}),
|
|
272
|
-
expectedStatus: (account, { fees }) => (
|
|
273
|
-
invariant(fees, "fees are required"),
|
|
274
|
-
{
|
|
275
|
-
errors: {},
|
|
276
|
-
warnings: {},
|
|
277
|
-
estimatedFees: (fees as BigNumber).times(2),
|
|
278
|
-
amount: account.balance.div(10),
|
|
279
|
-
totalSpent: account.balance
|
|
280
|
-
.div(10)
|
|
281
|
-
.plus((fees as BigNumber).times(2)),
|
|
282
|
-
}
|
|
283
|
-
),
|
|
284
|
-
},
|
|
285
|
-
],
|
|
61
|
+
transactions: [],
|
|
286
62
|
},
|
|
287
63
|
{
|
|
288
64
|
raw: accountTZnew,
|
|
289
65
|
test: (expect, account) => {
|
|
290
66
|
expect(account.operations).toEqual([]);
|
|
291
67
|
},
|
|
292
|
-
transactions: [
|
|
293
|
-
{
|
|
294
|
-
name: "send 10% to existing tz",
|
|
295
|
-
transaction: (t) => ({
|
|
296
|
-
...t,
|
|
297
|
-
recipient: addressTZregular,
|
|
298
|
-
useAllAmount: true,
|
|
299
|
-
}),
|
|
300
|
-
expectedStatus: {
|
|
301
|
-
errors: {
|
|
302
|
-
amount: new NotEnoughBalance(),
|
|
303
|
-
},
|
|
304
|
-
warnings: {},
|
|
305
|
-
},
|
|
306
|
-
},
|
|
307
|
-
],
|
|
68
|
+
transactions: [],
|
|
308
69
|
},
|
|
70
|
+
// FIXME these accounts have issue
|
|
71
|
+
/*
|
|
309
72
|
{
|
|
310
|
-
FIXME_tests: [
|
|
311
|
-
"balance is sum of ops", // https://ledgerhq.atlassian.net/browse/LLC-503
|
|
312
|
-
// because of prev bug we have bug on:
|
|
313
|
-
"from KT 2, send max to existing account",
|
|
314
|
-
],
|
|
315
73
|
raw: accountTZwithKT,
|
|
316
74
|
transactions: [
|
|
317
|
-
{
|
|
318
|
-
name: "from KT 1, send max to new account",
|
|
319
|
-
transaction: (t, account) => (
|
|
320
|
-
invariant(account.subAccounts, "subAccounts"),
|
|
321
|
-
{
|
|
322
|
-
...t,
|
|
323
|
-
subAccountId: account.subAccounts?.[0].id,
|
|
324
|
-
recipient: addressTZnew,
|
|
325
|
-
useAllAmount: true,
|
|
326
|
-
}
|
|
327
|
-
),
|
|
328
|
-
expectedStatus: ({ subAccounts }, { storageLimit, fees }) => (
|
|
329
|
-
invariant(fees && subAccounts, "fees are required"),
|
|
330
|
-
{
|
|
331
|
-
errors: {},
|
|
332
|
-
warnings: {},
|
|
333
|
-
estimatedFees: fees,
|
|
334
|
-
amount: subAccounts?.[0].balance.minus(
|
|
335
|
-
reservedAmountForStorageLimit(storageLimit)
|
|
336
|
-
),
|
|
337
|
-
totalSpent: subAccounts?.[0].balance,
|
|
338
|
-
}
|
|
339
|
-
),
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
name: "from KT 2, send max to existing account",
|
|
343
|
-
transaction: (t, account) => (
|
|
344
|
-
invariant(
|
|
345
|
-
account.subAccounts && account.subAccounts[1],
|
|
346
|
-
"subAccounts"
|
|
347
|
-
),
|
|
348
|
-
{
|
|
349
|
-
...t,
|
|
350
|
-
subAccountId: account.subAccounts?.[1].id,
|
|
351
|
-
recipient: addressTZnew,
|
|
352
|
-
useAllAmount: true,
|
|
353
|
-
}
|
|
354
|
-
),
|
|
355
|
-
expectedStatus: ({ subAccounts }, { fees, storageLimit }) => (
|
|
356
|
-
invariant(
|
|
357
|
-
subAccounts && fees && storageLimit,
|
|
358
|
-
"fees are required"
|
|
359
|
-
),
|
|
360
|
-
{
|
|
361
|
-
errors: {},
|
|
362
|
-
warnings: {},
|
|
363
|
-
estimatedFees: fees,
|
|
364
|
-
amount: subAccounts?.[1].balance,
|
|
365
|
-
totalSpent: subAccounts?.[1].balance,
|
|
366
|
-
}
|
|
367
|
-
),
|
|
368
|
-
},
|
|
369
75
|
],
|
|
370
76
|
},
|
|
77
|
+
*/
|
|
78
|
+
/*
|
|
371
79
|
{
|
|
372
|
-
FIXME_tests: [
|
|
373
|
-
"balance is sum of ops", // https://ledgerhq.atlassian.net/browse/LLC-591
|
|
374
|
-
],
|
|
375
80
|
raw: accountTZemptyWithKT,
|
|
376
81
|
transactions: [
|
|
377
|
-
{
|
|
378
|
-
name: "from KT 1, send max",
|
|
379
|
-
transaction: (t, account) => (
|
|
380
|
-
invariant(account.subAccounts, "subAccounts"),
|
|
381
|
-
{
|
|
382
|
-
...t,
|
|
383
|
-
subAccountId: account.subAccounts?.[0].id,
|
|
384
|
-
recipient: addressTZregular,
|
|
385
|
-
useAllAmount: true,
|
|
386
|
-
}
|
|
387
|
-
),
|
|
388
|
-
expectedStatus: {
|
|
389
|
-
errors: {
|
|
390
|
-
amount: new NotEnoughBalanceInParentAccount(),
|
|
391
|
-
},
|
|
392
|
-
warnings: {},
|
|
393
|
-
},
|
|
394
|
-
},
|
|
395
|
-
{
|
|
396
|
-
name: "from KT 1, send 10%",
|
|
397
|
-
transaction: (t, account) => (
|
|
398
|
-
invariant(account.subAccounts, "subAccounts"),
|
|
399
|
-
{
|
|
400
|
-
...t,
|
|
401
|
-
subAccountId: account.subAccounts?.[0].id,
|
|
402
|
-
amount: account.balance.div(10),
|
|
403
|
-
recipient: addressTZregular,
|
|
404
|
-
}
|
|
405
|
-
),
|
|
406
|
-
expectedStatus: {
|
|
407
|
-
errors: {
|
|
408
|
-
amount: new NotEnoughBalanceInParentAccount(),
|
|
409
|
-
},
|
|
410
|
-
warnings: {},
|
|
411
|
-
},
|
|
412
|
-
},
|
|
413
82
|
],
|
|
414
83
|
},
|
|
84
|
+
*/
|
|
415
85
|
],
|
|
416
86
|
},
|
|
417
87
|
},
|
|
418
88
|
};
|
|
419
89
|
export default dataset;
|
|
420
90
|
|
|
421
|
-
function makeAccount(name,
|
|
91
|
+
function makeAccount(name, address, derivationMode) {
|
|
422
92
|
return {
|
|
423
|
-
id: `
|
|
424
|
-
seedIdentifier:
|
|
93
|
+
id: `js:2:tezos:${address}:${derivationMode}`,
|
|
94
|
+
seedIdentifier: address,
|
|
425
95
|
name: "Tezos " + name,
|
|
426
96
|
derivationMode,
|
|
427
97
|
index: 0,
|
|
428
|
-
freshAddress:
|
|
98
|
+
freshAddress: address,
|
|
429
99
|
freshAddressPath: "",
|
|
430
100
|
freshAddresses: [],
|
|
431
101
|
blockHeight: 0,
|
|
@@ -435,7 +105,7 @@ function makeAccount(name, pubKey, derivationMode) {
|
|
|
435
105
|
unitMagnitude: 6,
|
|
436
106
|
lastSyncDate: "",
|
|
437
107
|
balance: "0",
|
|
438
|
-
xpub:
|
|
108
|
+
xpub: "",
|
|
439
109
|
subAccounts: [],
|
|
440
110
|
};
|
|
441
111
|
}
|
|
@@ -17,6 +17,7 @@ export const formatTransaction = (
|
|
|
17
17
|
storageLimit,
|
|
18
18
|
fees,
|
|
19
19
|
useAllAmount,
|
|
20
|
+
estimatedFees,
|
|
20
21
|
}: Transaction,
|
|
21
22
|
mainAccount: Account
|
|
22
23
|
): string => {
|
|
@@ -36,7 +37,10 @@ ${mode.toUpperCase()} ${
|
|
|
36
37
|
TO ${recipient}
|
|
37
38
|
with fees=${!fees ? "?" : formatCurrencyUnit(mainAccount.unit, fees)}
|
|
38
39
|
with gasLimit=${!gasLimit ? "?" : gasLimit.toString()}
|
|
39
|
-
with storageLimit=${!storageLimit ? "?" : storageLimit.toString()}
|
|
40
|
+
with storageLimit=${!storageLimit ? "?" : storageLimit.toString()}
|
|
41
|
+
(estimatedFees ${
|
|
42
|
+
!estimatedFees ? "?" : formatCurrencyUnit(mainAccount.unit, estimatedFees)
|
|
43
|
+
})`;
|
|
40
44
|
};
|
|
41
45
|
export const fromTransactionRaw = (tr: TransactionRaw): Transaction => {
|
|
42
46
|
const common = fromTransactionCommonRaw(tr);
|
|
@@ -52,6 +56,7 @@ export const fromTransactionRaw = (tr: TransactionRaw): Transaction => {
|
|
|
52
56
|
fees: tr.fees ? new BigNumber(tr.fees) : null,
|
|
53
57
|
gasLimit: tr.gasLimit ? new BigNumber(tr.gasLimit) : null,
|
|
54
58
|
storageLimit: tr.storageLimit ? new BigNumber(tr.storageLimit) : null,
|
|
59
|
+
estimatedFees: tr.estimatedFees ? new BigNumber(tr.estimatedFees) : null,
|
|
55
60
|
taquitoError: tr.taquitoError,
|
|
56
61
|
};
|
|
57
62
|
};
|
|
@@ -69,6 +74,7 @@ export const toTransactionRaw = (t: Transaction): TransactionRaw => {
|
|
|
69
74
|
fees: t.fees ? t.fees.toString() : null,
|
|
70
75
|
gasLimit: t.gasLimit ? t.gasLimit.toString() : null,
|
|
71
76
|
storageLimit: t.storageLimit ? t.storageLimit.toString() : null,
|
|
77
|
+
estimatedFees: t.estimatedFees ? t.estimatedFees.toString() : null,
|
|
72
78
|
taquitoError: t.taquitoError,
|
|
73
79
|
};
|
|
74
80
|
};
|
|
@@ -136,6 +136,7 @@ export type Transaction = TransactionCommon & {
|
|
|
136
136
|
fees: BigNumber | null | undefined;
|
|
137
137
|
gasLimit: BigNumber | null | undefined;
|
|
138
138
|
storageLimit: BigNumber | null | undefined;
|
|
139
|
+
estimatedFees: BigNumber | null | undefined;
|
|
139
140
|
taquitoError: string | null | undefined;
|
|
140
141
|
};
|
|
141
142
|
export type TransactionRaw = TransactionCommonRaw & {
|
|
@@ -145,6 +146,7 @@ export type TransactionRaw = TransactionCommonRaw & {
|
|
|
145
146
|
fees: string | null | undefined;
|
|
146
147
|
gasLimit: string | null | undefined;
|
|
147
148
|
storageLimit: string | null | undefined;
|
|
149
|
+
estimatedFees: string | null | undefined;
|
|
148
150
|
taquitoError: string | null | undefined;
|
|
149
151
|
};
|
|
150
152
|
export const reflect = (declare: (arg0: string, arg1: Spec) => void) => {
|