@ledgerhq/live-common 21.21.1 → 21.22.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.
- 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.d.ts.map +1 -1
- package/lib/env.js +2 -3
- 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/polkadot/api/sidecar.types.d.ts +2 -1
- package/lib/families/polkadot/api/sidecar.types.d.ts.map +1 -1
- package/lib/families/tezos/bridge/js.d.ts.map +1 -1
- package/lib/families/tezos/bridge/js.js +84 -49
- 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 -3
- package/src/families/ethereum/signOperation.ts +2 -2
- package/src/families/polkadot/api/sidecar.types.ts +3 -1
- package/src/families/tezos/bridge/js.ts +72 -35
- 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
|
@@ -117,7 +117,12 @@ var getAccountShape = function (infoInput) { return __awaiter(void 0, void 0, vo
|
|
|
117
117
|
return [2 /*return*/, {
|
|
118
118
|
id: accountId,
|
|
119
119
|
blockHeight: blockHeight,
|
|
120
|
-
lastSyncDate: new Date()
|
|
120
|
+
lastSyncDate: new Date(),
|
|
121
|
+
tezosResources: {
|
|
122
|
+
revealed: false,
|
|
123
|
+
counter: 0,
|
|
124
|
+
publicKey: ""
|
|
125
|
+
}
|
|
121
126
|
}];
|
|
122
127
|
}
|
|
123
128
|
(0, invariant_1["default"])(apiAccount.type === "user", "unsupported account of type ", apiAccount.type);
|
|
@@ -252,9 +257,7 @@ var txToOp = function (_a) {
|
|
|
252
257
|
blockHash: blockHash,
|
|
253
258
|
accountId: accountId,
|
|
254
259
|
date: new Date(timestamp),
|
|
255
|
-
extra: {
|
|
256
|
-
id: id
|
|
257
|
-
},
|
|
260
|
+
extra: { id: id },
|
|
258
261
|
hasFailed: hasFailed
|
|
259
262
|
};
|
|
260
263
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"synchronisation.js","sourceRoot":"","sources":["../../../src/families/tezos/synchronisation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,wDAAkC;AAClC,6CAAyC;AACzC,uCAAqC;AACrC,yCAAgD;AAChD,oDAAkD;AAElD,6CAAoD;AACpD,yCAAwE;AAExE,oDAA6B;AAE7B,wDAAwD;AACxD,+DAA0E;AAC1E,wCAA4D;AAE5D,SAAS,gBAAgB,CACvB,SAAiB,EACjB,cAAmC,EACnC,IAAI;IAEJ,IAAI,SAAS;QAAE,OAAO,SAAS,CAAC;IAChC,IAAI,cAAc,EAAE;QACV,IAAA,cAAc,GAAK,cAAc,eAAnB,CAAoB;QAC1C,IAAI,cAAc,EAAE;YAClB,OAAO,cAAc,CAAC,SAAS,CAAC;SACjC;QACO,IAAA,aAAa,GAAK,IAAA,yBAAe,EAAC,cAAc,CAAC,EAAE,CAAC,cAAvC,CAAwC;QAC7D,IAAI,aAAa;YAAE,OAAO,aAAa,CAAC;KACzC;IACD,IAA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,KAAA,EAHK,UAAU,QAAA,EAAE,WAAW,QAAA;gBAK9B,IAAI,UAAU,CAAC,IAAI,KAAK,OAAO,EAAE;oBAC/B,sBAAO;4BACL,EAAE,EAAE,SAAS;4BACb,WAAW,aAAA;4BACX,YAAY,EAAE,IAAI,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"synchronisation.js","sourceRoot":"","sources":["../../../src/families/tezos/synchronisation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,wDAAkC;AAClC,6CAAyC;AACzC,uCAAqC;AACrC,yCAAgD;AAChD,oDAAkD;AAElD,6CAAoD;AACpD,yCAAwE;AAExE,oDAA6B;AAE7B,wDAAwD;AACxD,+DAA0E;AAC1E,wCAA4D;AAE5D,SAAS,gBAAgB,CACvB,SAAiB,EACjB,cAAmC,EACnC,IAAI;IAEJ,IAAI,SAAS;QAAE,OAAO,SAAS,CAAC;IAChC,IAAI,cAAc,EAAE;QACV,IAAA,cAAc,GAAK,cAAc,eAAnB,CAAoB;QAC1C,IAAI,cAAc,EAAE;YAClB,OAAO,cAAc,CAAC,SAAS,CAAC;SACjC;QACO,IAAA,aAAa,GAAK,IAAA,yBAAe,EAAC,cAAc,CAAC,EAAE,CAAC,cAAvC,CAAwC;QAC7D,IAAI,aAAa;YAAE,OAAO,aAAa,CAAC;KACzC;IACD,IAAA,sBAAS,EAAC,IAAI,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC;IACzD,OAAO,IAAA,kBAAU,EACf,IAAA,yBAAiB,EACf,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,EAClC,8BAAc,CAAC,OAAO,CACvB,EACD,cAAM,CAAC,cAAM,CAAC,IAAI,CAAC,CACpB,CAAC;AACJ,CAAC;AAEM,IAAM,eAAe,GAAoB,UAAO,SAAS;;;;;gBACtD,OAAO,GAAqD,SAAS,QA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AAA;YACV,WAAW,aAAA;YACX,SAAS,WAAA;YACT,SAAS,WAAA;YACT,IAAI,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC;YACzB,KAAK,EAAE,EAAE,EAAE,IAAA,EAAE;YACb,SAAS,WAAA;SACV,CAAC;IACJ,CAAC;AArHD,CAqHC,CAAC;AAEJ,IAAM,oBAAoB,GAAG,UAC3B,OAAe,EACf,MAAe;;;;;gBAEX,GAAG,GAAmB,EAAE,CAAC;gBACzB,YAAY,GAAG,EAAE,CAAC;;oBAGV,qBAAM,iBAAG,CAAC,oBAAoB,CAAC,OAAO,EAAE,EAAE,MAAM,QAAA,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAA;;gBAAhE,CAAC,GAAG,SAA4D;gBACtE,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;oBAAE,sBAAO,GAAG,EAAC;gBAC/B,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBACd,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;gBACjC,IAAI,CAAC,IAAI;oBAAE,sBAAO,GAAG,EAAC;gBACtB,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;gBACjB,IAAI,CAAC,MAAM,EAAE;oBACX,IAAA,UAAG,EAAC,OAAO,EAAE,aAAa,CAAC,CAAC;oBAC5B,sBAAO,GAAG,EAAC;iBACZ;;;oBACM,EAAE,YAAY;;oBACvB,sBAAO,GAAG,EAAC;;;KACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"synchronisation.test.d.ts","sourceRoot":"","sources":["../../../src/families/tezos/synchronisation.test.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"synchronisation.test.d.ts","sourceRoot":"","sources":["../../../src/families/tezos/synchronisation.test.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAsDvD,wBAAgB,WAAW,CACzB,OAAO,EAAE,OAAO,EAChB,UAAU,GAAE,UAA8B,GACzC,OAAO,CAAC,OAAO,CAAC,CAIlB"}
|
|
@@ -46,8 +46,6 @@ var operation_1 = require("../../operation");
|
|
|
46
46
|
var jsHelpers_1 = require("../../bridge/jsHelpers");
|
|
47
47
|
var synchronisation_1 = require("./synchronisation");
|
|
48
48
|
var accounts = [
|
|
49
|
-
// "tz1cf8diKsP1WoeucTQm1BcVfdyrmaBnL4nC", // FIXME
|
|
50
|
-
// "tz1ZshTmtorFVkcZ7CpceCAxCn7HBJqTfmpk", // FIXME
|
|
51
49
|
"tz1ZL36Xw6LJ9RK6tb7QW85o7SVYfFKSMw8c",
|
|
52
50
|
"tz1VacAyLcnHU3pEY3VNNK45F1CvVyTYXA3z",
|
|
53
51
|
"tz1hpWkvAVVgftPy4CW8rD3u6tdVd8g1RU58",
|
|
@@ -61,7 +59,6 @@ var accounts = [
|
|
|
61
59
|
"tz1PTxfn1fge2tJwGGpW9zNuYf6BseM3GJXt",
|
|
62
60
|
"tz1SBHto1BasGvxojr48r5PFiGb1Wq4cynGY",
|
|
63
61
|
"tz1fAfYNSkgci3ko2xikDtYtcSf1X1YdAKoK",
|
|
64
|
-
"tz1hobi4RsAeswm9JA7mHB96vqc1eAWRzxDc",
|
|
65
62
|
];
|
|
66
63
|
jest.setTimeout(30 * 1000);
|
|
67
64
|
accounts.forEach(function (address) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"synchronisation.test.js","sourceRoot":"","sources":["../../../src/families/tezos/synchronisation.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,6CAAyC;AACzC,4CAAwC;AAExC,+CAAyD;AACzD,yCAAkD;AAClD,6CAAwE;AACxE,oDAAkD;AAClD,qDAAoD;AAEpD,IAAM,QAAQ,GAAG;IACf,
|
|
1
|
+
{"version":3,"file":"synchronisation.test.js","sourceRoot":"","sources":["../../../src/families/tezos/synchronisation.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,6CAAyC;AACzC,4CAAwC;AAExC,+CAAyD;AACzD,yCAAkD;AAClD,6CAAwE;AACxE,oDAAkD;AAClD,qDAAoD;AAEpD,IAAM,QAAQ,GAAG;IACf,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;CACvC,CAAC;AAEF,IAAI,CAAC,UAAU,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;AAE3B,QAAQ,CAAC,OAAO,CAAC,UAAC,OAAO;IACvB,QAAQ,CAAC,OAAO,GAAG,gBAAgB,EAAE;QACnC,IAAI,CAAC,uBAAuB,EAAE;;;;4BACZ,qBAAM,WAAW,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAAA;;wBAAvD,OAAO,GAAG,SAA6C;wBAC7D,uBAAuB,CAAC,OAAO,CAAC,CAAC;;;;aAClC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,IAAM,KAAK,GAAG,IAAA,kCAAqB,EAAC,OAAO,CAAC,CAAC;AAE7C,SAAS,uBAAuB,CAAC,OAAO;IACtC,MAAM,CACJ,OAAO,CAAC,UAAU;SACf,MAAM,CACL,UAAC,GAAG,EAAE,EAAE,IAAK,OAAA,IAAA,iDAAqC,EAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAnD,CAAmD,EAChE,IAAI,wBAAS,CAAC,CAAC,CAAC,CACjB;SACA,QAAQ,EAAE,CACd,CAAC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zB,YAAY,EAAE,IAAI,IAAI,EAAE;QACxB,mBAAmB,EAAE,2BAAiB;KACvC,CAAC;AACJ,CAAC"}
|
|
@@ -6,7 +6,7 @@ export declare const accountTZrevealedDelegating: {
|
|
|
6
6
|
name: string;
|
|
7
7
|
derivationMode: any;
|
|
8
8
|
index: number;
|
|
9
|
-
freshAddress:
|
|
9
|
+
freshAddress: any;
|
|
10
10
|
freshAddressPath: string;
|
|
11
11
|
freshAddresses: never[];
|
|
12
12
|
blockHeight: number;
|
|
@@ -16,7 +16,7 @@ export declare const accountTZrevealedDelegating: {
|
|
|
16
16
|
unitMagnitude: number;
|
|
17
17
|
lastSyncDate: string;
|
|
18
18
|
balance: string;
|
|
19
|
-
xpub:
|
|
19
|
+
xpub: string;
|
|
20
20
|
subAccounts: never[];
|
|
21
21
|
};
|
|
22
22
|
declare const dataset: DatasetTest<Transaction>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-dataset.d.ts","sourceRoot":"","sources":["../../../src/families/tezos/test-dataset.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"test-dataset.d.ts","sourceRoot":"","sources":["../../../src/families/tezos/test-dataset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAM3C,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;CAIvC,CAAC;AA+BF,QAAA,MAAM,OAAO,EAAE,WAAW,CAAC,WAAW,CA6CrC,CAAC;AACF,eAAe,OAAO,CAAC"}
|
|
@@ -1,356 +1,82 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
2
|
exports.__esModule = true;
|
|
17
3
|
exports.accountTZrevealedDelegating = void 0;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
4
|
+
// TODO restore
|
|
5
|
+
// import tezosScanAccounts1 from "./datasets/tezos.scanAccounts.1";
|
|
6
|
+
// FIXME these accounts no longer reflect their expected states..
|
|
7
|
+
exports.accountTZrevealedDelegating = makeAccount("TZrevealedDelegating", "tz1boBHAVpwcvKkNFAQHYr7mjxAz1PpVgKq7", "tezbox");
|
|
8
|
+
/*
|
|
9
|
+
const accountTZwithKT = makeAccount(
|
|
10
|
+
"TZwithKT",
|
|
11
|
+
"tz1T72nyqnJWwxad6RQnh7imKQz7mzToamWd",
|
|
12
|
+
"tezbox"
|
|
13
|
+
);
|
|
14
|
+
*/
|
|
15
|
+
var accountTZnew = makeAccount("TZnew", "tz1VSichevvJSNkSSntgwKDKikWNB6iqNJii", "tezbox");
|
|
16
|
+
var accountTZnotRevealed = makeAccount("TZnotRevealed", "tz1PWFt4Ym6HedY78MgUP2kVDtSampGwprs5", "tezosbip44h");
|
|
17
|
+
var accountTZRevealedNoDelegate = makeAccount("TZRevealedNoDelegate", "tz1YkAjh5mm5gJ5u3VbFLEtpAG7cFo7PfCux", "tezosbip44h");
|
|
18
|
+
/*
|
|
19
|
+
const accountTZemptyWithKT = makeAccount(
|
|
20
|
+
"TZemptyWithKT",
|
|
21
|
+
"tz1TeawWFnUmeP1qQLf4JWe5D7LaNp1qxgMW",
|
|
22
|
+
"tezbox"
|
|
23
|
+
);
|
|
24
|
+
*/
|
|
37
25
|
var dataset = {
|
|
38
|
-
implementations: ["
|
|
39
|
-
|
|
40
|
-
currencies: {} || {
|
|
26
|
+
implementations: ["js"],
|
|
27
|
+
currencies: {
|
|
41
28
|
tezos: {
|
|
42
29
|
FIXME_ignoreOperationFields: ["blockHeight"],
|
|
43
|
-
scanAccounts: [
|
|
30
|
+
// scanAccounts: [tezosScanAccounts1],
|
|
31
|
+
scanAccounts: [],
|
|
44
32
|
accounts: [
|
|
45
33
|
{
|
|
46
|
-
FIXME_tests: [
|
|
47
|
-
"balance is sum of ops", // https://ledgerhq.atlassian.net/browse/LLC-591
|
|
48
|
-
],
|
|
49
34
|
raw: exports.accountTZrevealedDelegating,
|
|
50
|
-
transactions: [
|
|
51
|
-
{
|
|
52
|
-
name: "send max to new account (explicit)",
|
|
53
|
-
transaction: (0, transaction_1.fromTransactionRaw)({
|
|
54
|
-
amount: "0",
|
|
55
|
-
recipient: addressTZnew,
|
|
56
|
-
useAllAmount: true,
|
|
57
|
-
family: "tezos",
|
|
58
|
-
mode: "send",
|
|
59
|
-
networkInfo: {
|
|
60
|
-
family: "tezos",
|
|
61
|
-
fees: "3075"
|
|
62
|
-
},
|
|
63
|
-
fees: "3075",
|
|
64
|
-
gasLimit: "10600",
|
|
65
|
-
storageLimit: "300",
|
|
66
|
-
taquitoError: null
|
|
67
|
-
}),
|
|
68
|
-
expectedStatus: function (account) { return ({
|
|
69
|
-
errors: {},
|
|
70
|
-
warnings: {
|
|
71
|
-
amount: new errors_1.RecommendUndelegation()
|
|
72
|
-
},
|
|
73
|
-
estimatedFees: new bignumber_js_1.BigNumber("3075"),
|
|
74
|
-
amount: account.balance
|
|
75
|
-
.minus(reservedAmountForStorageLimit("300"))
|
|
76
|
-
.minus("3075"),
|
|
77
|
-
totalSpent: account.balance
|
|
78
|
-
}); }
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: "overflow send to new account",
|
|
82
|
-
transaction: function (t, account) { return (__assign(__assign({}, t), { amount: account.balance.minus(t.fees || 0).minus("1000"), recipient: addressTZnew })); },
|
|
83
|
-
expectedStatus: {
|
|
84
|
-
errors: {
|
|
85
|
-
amount: new errors_1.NotEnoughBalance()
|
|
86
|
-
},
|
|
87
|
-
warnings: {}
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
name: "send max to new account (dynamic)",
|
|
92
|
-
transaction: function (t) { return (__assign(__assign({}, t), { recipient: addressTZnew, useAllAmount: true })); },
|
|
93
|
-
expectedStatus: function (account, _a) {
|
|
94
|
-
var storageLimit = _a.storageLimit, fees = _a.fees;
|
|
95
|
-
return ((0, invariant_1["default"])(fees, "fees are required"),
|
|
96
|
-
{
|
|
97
|
-
errors: {},
|
|
98
|
-
warnings: {
|
|
99
|
-
amount: new errors_1.RecommendUndelegation()
|
|
100
|
-
},
|
|
101
|
-
estimatedFees: fees,
|
|
102
|
-
amount: account.balance
|
|
103
|
-
.minus(reservedAmountForStorageLimit(storageLimit))
|
|
104
|
-
.minus(fees),
|
|
105
|
-
totalSpent: account.balance
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: "send max to existing account",
|
|
111
|
-
transaction: function (t) { return (__assign(__assign({}, t), { recipient: addressTZregular, useAllAmount: true })); },
|
|
112
|
-
expectedStatus: function (account, _a) {
|
|
113
|
-
var fees = _a.fees;
|
|
114
|
-
return ((0, invariant_1["default"])(fees, "fees are required"),
|
|
115
|
-
{
|
|
116
|
-
errors: {},
|
|
117
|
-
warnings: {
|
|
118
|
-
amount: new errors_1.RecommendUndelegation()
|
|
119
|
-
},
|
|
120
|
-
estimatedFees: fees,
|
|
121
|
-
amount: account.balance.minus(fees),
|
|
122
|
-
totalSpent: account.balance
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
name: "self tx forbidden",
|
|
128
|
-
transaction: function (t) { return (__assign(__assign({}, t), { recipient: addressAccountTZrevealedDelegating, amount: new bignumber_js_1.BigNumber(0.1) })); },
|
|
129
|
-
expectedStatus: {
|
|
130
|
-
errors: {
|
|
131
|
-
recipient: new errors_1.InvalidAddressBecauseDestinationIsAlsoSource()
|
|
132
|
-
},
|
|
133
|
-
warnings: {}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
name: "undelegate",
|
|
138
|
-
transaction: function (t) { return (__assign(__assign({}, t), { mode: "undelegate" })); },
|
|
139
|
-
expectedStatus: function (account, _a) {
|
|
140
|
-
var fees = _a.fees;
|
|
141
|
-
return ((0, invariant_1["default"])(fees, "fees are required"),
|
|
142
|
-
{
|
|
143
|
-
errors: {},
|
|
144
|
-
warnings: {},
|
|
145
|
-
amount: new bignumber_js_1.BigNumber(0),
|
|
146
|
-
estimatedFees: fees
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
]
|
|
35
|
+
transactions: []
|
|
151
36
|
},
|
|
152
37
|
{
|
|
153
|
-
FIXME_tests: [
|
|
154
|
-
"balance is sum of ops", // https://ledgerhq.atlassian.net/browse/LLC-591
|
|
155
|
-
],
|
|
156
38
|
raw: accountTZRevealedNoDelegate,
|
|
157
|
-
transactions: [
|
|
158
|
-
{
|
|
159
|
-
name: "send max to new account",
|
|
160
|
-
transaction: function (t) { return (__assign(__assign({}, t), { recipient: addressTZnew, useAllAmount: true })); },
|
|
161
|
-
expectedStatus: function (account, _a) {
|
|
162
|
-
var storageLimit = _a.storageLimit, fees = _a.fees;
|
|
163
|
-
return ((0, invariant_1["default"])(fees, "fees are required"),
|
|
164
|
-
{
|
|
165
|
-
errors: {},
|
|
166
|
-
warnings: {},
|
|
167
|
-
estimatedFees: fees,
|
|
168
|
-
amount: account.balance
|
|
169
|
-
.minus(reservedAmountForStorageLimit(storageLimit))
|
|
170
|
-
.minus(fees),
|
|
171
|
-
totalSpent: account.balance
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
name: "send max to existing account",
|
|
177
|
-
transaction: function (t) { return (__assign(__assign({}, t), { recipient: addressTZregular, useAllAmount: true })); },
|
|
178
|
-
expectedStatus: function (account, _a) {
|
|
179
|
-
var fees = _a.fees;
|
|
180
|
-
return ((0, invariant_1["default"])(fees, "fees are required"),
|
|
181
|
-
{
|
|
182
|
-
errors: {},
|
|
183
|
-
warnings: {},
|
|
184
|
-
estimatedFees: fees,
|
|
185
|
-
amount: account.balance.minus(fees),
|
|
186
|
-
totalSpent: account.balance
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
name: "delegate",
|
|
192
|
-
transaction: function (t) { return (__assign(__assign({}, t), { recipient: addressDelegator, mode: "delegate" })); },
|
|
193
|
-
expectedStatus: function (account, _a) {
|
|
194
|
-
var fees = _a.fees;
|
|
195
|
-
return ((0, invariant_1["default"])(fees, "fees are required"),
|
|
196
|
-
{
|
|
197
|
-
errors: {},
|
|
198
|
-
warnings: {},
|
|
199
|
-
amount: new bignumber_js_1.BigNumber(0),
|
|
200
|
-
estimatedFees: fees
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
]
|
|
39
|
+
transactions: []
|
|
205
40
|
},
|
|
206
41
|
{
|
|
207
42
|
raw: accountTZnotRevealed,
|
|
208
|
-
|
|
209
|
-
"balance is sum of ops", // https://ledgerhq.atlassian.net/browse/LLC-591
|
|
210
|
-
],
|
|
211
|
-
transactions: [
|
|
212
|
-
{
|
|
213
|
-
name: "send 10% to KT",
|
|
214
|
-
transaction: function (t, account) { return (__assign(__assign({}, t), { recipient: addressKT, amount: account.balance.div(10) })); },
|
|
215
|
-
expectedStatus: {
|
|
216
|
-
errors: {
|
|
217
|
-
recipient: new errors_1.NotSupportedLegacyAddress()
|
|
218
|
-
},
|
|
219
|
-
warnings: {}
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
name: "send 10% to existing tz",
|
|
224
|
-
transaction: function (t, account) { return (__assign(__assign({}, t), { recipient: addressTZnew, amount: account.balance.div(10) })); },
|
|
225
|
-
expectedStatus: function (account, _a) {
|
|
226
|
-
var fees = _a.fees;
|
|
227
|
-
return ((0, invariant_1["default"])(fees, "fees are required"),
|
|
228
|
-
{
|
|
229
|
-
errors: {},
|
|
230
|
-
warnings: {},
|
|
231
|
-
estimatedFees: fees.times(2),
|
|
232
|
-
amount: account.balance.div(10),
|
|
233
|
-
totalSpent: account.balance
|
|
234
|
-
.div(10)
|
|
235
|
-
.plus(fees.times(2))
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
]
|
|
43
|
+
transactions: []
|
|
240
44
|
},
|
|
241
45
|
{
|
|
242
46
|
raw: accountTZnew,
|
|
243
47
|
test: function (expect, account) {
|
|
244
48
|
expect(account.operations).toEqual([]);
|
|
245
49
|
},
|
|
246
|
-
transactions: [
|
|
247
|
-
{
|
|
248
|
-
name: "send 10% to existing tz",
|
|
249
|
-
transaction: function (t) { return (__assign(__assign({}, t), { recipient: addressTZregular, useAllAmount: true })); },
|
|
250
|
-
expectedStatus: {
|
|
251
|
-
errors: {
|
|
252
|
-
amount: new errors_1.NotEnoughBalance()
|
|
253
|
-
},
|
|
254
|
-
warnings: {}
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
]
|
|
50
|
+
transactions: []
|
|
258
51
|
},
|
|
52
|
+
// FIXME these accounts have issue
|
|
53
|
+
/*
|
|
259
54
|
{
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
"from KT 2, send max to existing account",
|
|
264
|
-
],
|
|
265
|
-
raw: accountTZwithKT,
|
|
266
|
-
transactions: [
|
|
267
|
-
{
|
|
268
|
-
name: "from KT 1, send max to new account",
|
|
269
|
-
transaction: function (t, account) {
|
|
270
|
-
var _a;
|
|
271
|
-
return ((0, invariant_1["default"])(account.subAccounts, "subAccounts"), __assign(__assign({}, t), { subAccountId: (_a = account.subAccounts) === null || _a === void 0 ? void 0 : _a[0].id, recipient: addressTZnew, useAllAmount: true }));
|
|
272
|
-
},
|
|
273
|
-
expectedStatus: function (_a, _b) {
|
|
274
|
-
var subAccounts = _a.subAccounts;
|
|
275
|
-
var storageLimit = _b.storageLimit, fees = _b.fees;
|
|
276
|
-
return ((0, invariant_1["default"])(fees && subAccounts, "fees are required"),
|
|
277
|
-
{
|
|
278
|
-
errors: {},
|
|
279
|
-
warnings: {},
|
|
280
|
-
estimatedFees: fees,
|
|
281
|
-
amount: subAccounts === null || subAccounts === void 0 ? void 0 : subAccounts[0].balance.minus(reservedAmountForStorageLimit(storageLimit)),
|
|
282
|
-
totalSpent: subAccounts === null || subAccounts === void 0 ? void 0 : subAccounts[0].balance
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
name: "from KT 2, send max to existing account",
|
|
288
|
-
transaction: function (t, account) {
|
|
289
|
-
var _a;
|
|
290
|
-
return ((0, invariant_1["default"])(account.subAccounts && account.subAccounts[1], "subAccounts"), __assign(__assign({}, t), { subAccountId: (_a = account.subAccounts) === null || _a === void 0 ? void 0 : _a[1].id, recipient: addressTZnew, useAllAmount: true }));
|
|
291
|
-
},
|
|
292
|
-
expectedStatus: function (_a, _b) {
|
|
293
|
-
var subAccounts = _a.subAccounts;
|
|
294
|
-
var fees = _b.fees, storageLimit = _b.storageLimit;
|
|
295
|
-
return ((0, invariant_1["default"])(subAccounts && fees && storageLimit, "fees are required"),
|
|
296
|
-
{
|
|
297
|
-
errors: {},
|
|
298
|
-
warnings: {},
|
|
299
|
-
estimatedFees: fees,
|
|
300
|
-
amount: subAccounts === null || subAccounts === void 0 ? void 0 : subAccounts[1].balance,
|
|
301
|
-
totalSpent: subAccounts === null || subAccounts === void 0 ? void 0 : subAccounts[1].balance
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
},
|
|
305
|
-
]
|
|
55
|
+
raw: accountTZwithKT,
|
|
56
|
+
transactions: [
|
|
57
|
+
],
|
|
306
58
|
},
|
|
59
|
+
*/
|
|
60
|
+
/*
|
|
307
61
|
{
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
raw: accountTZemptyWithKT,
|
|
312
|
-
transactions: [
|
|
313
|
-
{
|
|
314
|
-
name: "from KT 1, send max",
|
|
315
|
-
transaction: function (t, account) {
|
|
316
|
-
var _a;
|
|
317
|
-
return ((0, invariant_1["default"])(account.subAccounts, "subAccounts"), __assign(__assign({}, t), { subAccountId: (_a = account.subAccounts) === null || _a === void 0 ? void 0 : _a[0].id, recipient: addressTZregular, useAllAmount: true }));
|
|
318
|
-
},
|
|
319
|
-
expectedStatus: {
|
|
320
|
-
errors: {
|
|
321
|
-
amount: new errors_1.NotEnoughBalanceInParentAccount()
|
|
322
|
-
},
|
|
323
|
-
warnings: {}
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
name: "from KT 1, send 10%",
|
|
328
|
-
transaction: function (t, account) {
|
|
329
|
-
var _a;
|
|
330
|
-
return ((0, invariant_1["default"])(account.subAccounts, "subAccounts"), __assign(__assign({}, t), { subAccountId: (_a = account.subAccounts) === null || _a === void 0 ? void 0 : _a[0].id, amount: account.balance.div(10), recipient: addressTZregular }));
|
|
331
|
-
},
|
|
332
|
-
expectedStatus: {
|
|
333
|
-
errors: {
|
|
334
|
-
amount: new errors_1.NotEnoughBalanceInParentAccount()
|
|
335
|
-
},
|
|
336
|
-
warnings: {}
|
|
337
|
-
}
|
|
338
|
-
},
|
|
339
|
-
]
|
|
62
|
+
raw: accountTZemptyWithKT,
|
|
63
|
+
transactions: [
|
|
64
|
+
],
|
|
340
65
|
},
|
|
66
|
+
*/
|
|
341
67
|
]
|
|
342
68
|
}
|
|
343
69
|
}
|
|
344
70
|
};
|
|
345
71
|
exports["default"] = dataset;
|
|
346
|
-
function makeAccount(name,
|
|
72
|
+
function makeAccount(name, address, derivationMode) {
|
|
347
73
|
return {
|
|
348
|
-
id: "
|
|
349
|
-
seedIdentifier:
|
|
74
|
+
id: "js:2:tezos:".concat(address, ":").concat(derivationMode),
|
|
75
|
+
seedIdentifier: address,
|
|
350
76
|
name: "Tezos " + name,
|
|
351
77
|
derivationMode: derivationMode,
|
|
352
78
|
index: 0,
|
|
353
|
-
freshAddress:
|
|
79
|
+
freshAddress: address,
|
|
354
80
|
freshAddressPath: "",
|
|
355
81
|
freshAddresses: [],
|
|
356
82
|
blockHeight: 0,
|
|
@@ -360,7 +86,7 @@ function makeAccount(name, pubKey, derivationMode) {
|
|
|
360
86
|
unitMagnitude: 6,
|
|
361
87
|
lastSyncDate: "",
|
|
362
88
|
balance: "0",
|
|
363
|
-
xpub:
|
|
89
|
+
xpub: "",
|
|
364
90
|
subAccounts: []
|
|
365
91
|
};
|
|
366
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-dataset.js","sourceRoot":"","sources":["../../../src/families/tezos/test-dataset.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"test-dataset.js","sourceRoot":"","sources":["../../../src/families/tezos/test-dataset.ts"],"names":[],"mappings":";;;AAGA,eAAe;AACf,oEAAoE;AAEpE,iEAAiE;AACpD,QAAA,2BAA2B,GAAG,WAAW,CACpD,sBAAsB,EACtB,sCAAsC,EACtC,QAAQ,CACT,CAAC;AACF;;;;;;EAME;AACF,IAAM,YAAY,GAAG,WAAW,CAC9B,OAAO,EACP,sCAAsC,EACtC,QAAQ,CACT,CAAC;AACF,IAAM,oBAAoB,GAAG,WAAW,CACtC,eAAe,EACf,sCAAsC,EACtC,aAAa,CACd,CAAC;AACF,IAAM,2BAA2B,GAAG,WAAW,CAC7C,sBAAsB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AAW,EAAE,EAAE;KAChB,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Transaction, TransactionRaw } from "./types";
|
|
2
2
|
import type { Account } from "../../types";
|
|
3
|
-
export declare const formatTransaction: ({ mode, subAccountId, amount, recipient, gasLimit, storageLimit, fees, useAllAmount, }: Transaction, mainAccount: Account) => string;
|
|
3
|
+
export declare const formatTransaction: ({ mode, subAccountId, amount, recipient, gasLimit, storageLimit, fees, useAllAmount, estimatedFees, }: Transaction, mainAccount: Account) => string;
|
|
4
4
|
export declare const fromTransactionRaw: (tr: TransactionRaw) => Transaction;
|
|
5
5
|
export declare const toTransactionRaw: (t: Transaction) => TransactionRaw;
|
|
6
6
|
declare const _default: {
|
|
7
|
-
formatTransaction: ({ mode, subAccountId, amount, recipient, gasLimit, storageLimit, fees, useAllAmount, }: Transaction, mainAccount: Account) => string;
|
|
7
|
+
formatTransaction: ({ mode, subAccountId, amount, recipient, gasLimit, storageLimit, fees, useAllAmount, estimatedFees, }: Transaction, mainAccount: Account) => string;
|
|
8
8
|
fromTransactionRaw: (tr: TransactionRaw) => Transaction;
|
|
9
9
|
toTransactionRaw: (t: Transaction) => TransactionRaw;
|
|
10
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/families/tezos/transaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAK3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/families/tezos/transaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAK3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,eAAO,MAAM,iBAAiB,0GAWzB,WAAW,eACD,OAAO,KACnB,MAqBF,CAAC;AACF,eAAO,MAAM,kBAAkB,OAAQ,cAAc,KAAG,WAiBvD,CAAC;AACF,eAAO,MAAM,gBAAgB,MAAO,WAAW,KAAG,cAiBjD,CAAC;;;;;;AACF,wBAIE"}
|
|
@@ -17,7 +17,7 @@ var common_1 = require("../../transaction/common");
|
|
|
17
17
|
var account_1 = require("../../account");
|
|
18
18
|
var currencies_1 = require("../../currencies");
|
|
19
19
|
var formatTransaction = function (_a, mainAccount) {
|
|
20
|
-
var mode = _a.mode, subAccountId = _a.subAccountId, amount = _a.amount, recipient = _a.recipient, gasLimit = _a.gasLimit, storageLimit = _a.storageLimit, fees = _a.fees, useAllAmount = _a.useAllAmount;
|
|
20
|
+
var mode = _a.mode, subAccountId = _a.subAccountId, amount = _a.amount, recipient = _a.recipient, gasLimit = _a.gasLimit, storageLimit = _a.storageLimit, fees = _a.fees, useAllAmount = _a.useAllAmount, estimatedFees = _a.estimatedFees;
|
|
21
21
|
var account = (subAccountId &&
|
|
22
22
|
(mainAccount.subAccounts || []).find(function (a) { return a.id === subAccountId; })) ||
|
|
23
23
|
mainAccount;
|
|
@@ -26,7 +26,7 @@ var formatTransaction = function (_a, mainAccount) {
|
|
|
26
26
|
: (0, currencies_1.formatCurrencyUnit)((0, account_1.getAccountUnit)(account), amount, {
|
|
27
27
|
showCode: true,
|
|
28
28
|
disableRounding: true
|
|
29
|
-
}), "\nTO ").concat(recipient, "\nwith fees=").concat(!fees ? "?" : (0, currencies_1.formatCurrencyUnit)(mainAccount.unit, fees), "\nwith gasLimit=").concat(!gasLimit ? "?" : gasLimit.toString(), "\nwith storageLimit=").concat(!storageLimit ? "?" : storageLimit.toString());
|
|
29
|
+
}), "\nTO ").concat(recipient, "\nwith fees=").concat(!fees ? "?" : (0, currencies_1.formatCurrencyUnit)(mainAccount.unit, fees), "\nwith gasLimit=").concat(!gasLimit ? "?" : gasLimit.toString(), "\nwith storageLimit=").concat(!storageLimit ? "?" : storageLimit.toString(), "\n(estimatedFees ").concat(!estimatedFees ? "?" : (0, currencies_1.formatCurrencyUnit)(mainAccount.unit, estimatedFees), ")");
|
|
30
30
|
};
|
|
31
31
|
exports.formatTransaction = formatTransaction;
|
|
32
32
|
var fromTransactionRaw = function (tr) {
|
|
@@ -35,7 +35,7 @@ var fromTransactionRaw = function (tr) {
|
|
|
35
35
|
return __assign(__assign({}, common), { family: tr.family, mode: tr.mode, networkInfo: networkInfo && {
|
|
36
36
|
family: networkInfo.family,
|
|
37
37
|
fees: new bignumber_js_1.BigNumber(networkInfo.fees)
|
|
38
|
-
}, fees: tr.fees ? new bignumber_js_1.BigNumber(tr.fees) : null, gasLimit: tr.gasLimit ? new bignumber_js_1.BigNumber(tr.gasLimit) : null, storageLimit: tr.storageLimit ? new bignumber_js_1.BigNumber(tr.storageLimit) : null, taquitoError: tr.taquitoError });
|
|
38
|
+
}, fees: tr.fees ? new bignumber_js_1.BigNumber(tr.fees) : null, gasLimit: tr.gasLimit ? new bignumber_js_1.BigNumber(tr.gasLimit) : null, storageLimit: tr.storageLimit ? new bignumber_js_1.BigNumber(tr.storageLimit) : null, estimatedFees: tr.estimatedFees ? new bignumber_js_1.BigNumber(tr.estimatedFees) : null, taquitoError: tr.taquitoError });
|
|
39
39
|
};
|
|
40
40
|
exports.fromTransactionRaw = fromTransactionRaw;
|
|
41
41
|
var toTransactionRaw = function (t) {
|
|
@@ -44,7 +44,7 @@ var toTransactionRaw = function (t) {
|
|
|
44
44
|
return __assign(__assign({}, common), { family: t.family, mode: t.mode, networkInfo: networkInfo && {
|
|
45
45
|
family: networkInfo.family,
|
|
46
46
|
fees: networkInfo.fees.toString()
|
|
47
|
-
}, fees: t.fees ? t.fees.toString() : null, gasLimit: t.gasLimit ? t.gasLimit.toString() : null, storageLimit: t.storageLimit ? t.storageLimit.toString() : null, taquitoError: t.taquitoError });
|
|
47
|
+
}, fees: t.fees ? t.fees.toString() : null, gasLimit: t.gasLimit ? t.gasLimit.toString() : null, storageLimit: t.storageLimit ? t.storageLimit.toString() : null, estimatedFees: t.estimatedFees ? t.estimatedFees.toString() : null, taquitoError: t.taquitoError });
|
|
48
48
|
};
|
|
49
49
|
exports.toTransactionRaw = toTransactionRaw;
|
|
50
50
|
exports["default"] = {
|