@fuel-ts/account 0.0.0-rc-1889-20240322122653 → 0.0.0-rc-1815-20240322131329
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.
Potentially problematic release.
This version of @fuel-ts/account might be problematic. Click here for more details.
- package/dist/account.d.ts +184 -0
- package/dist/account.d.ts.map +1 -0
- package/dist/configs.d.ts +2 -3
- package/dist/configs.d.ts.map +1 -0
- package/dist/connectors/fuel-connector.d.ts +198 -0
- package/dist/connectors/fuel-connector.d.ts.map +1 -0
- package/dist/connectors/fuel.d.ts +133 -0
- package/dist/connectors/fuel.d.ts.map +1 -0
- package/dist/connectors/index.d.ts +5 -0
- package/dist/connectors/index.d.ts.map +1 -0
- package/dist/connectors/types/connector-metadata.d.ts +12 -0
- package/dist/connectors/types/connector-metadata.d.ts.map +1 -0
- package/dist/connectors/types/connector-types.d.ts +34 -0
- package/dist/connectors/types/connector-types.d.ts.map +1 -0
- package/dist/connectors/types/data-type.d.ts +34 -0
- package/dist/connectors/types/data-type.d.ts.map +1 -0
- package/dist/connectors/types/events.d.ts +111 -0
- package/dist/connectors/types/events.d.ts.map +1 -0
- package/dist/connectors/types/index.d.ts +7 -0
- package/dist/connectors/types/index.d.ts.map +1 -0
- package/dist/connectors/types/local-storage.d.ts +11 -0
- package/dist/connectors/types/local-storage.d.ts.map +1 -0
- package/dist/connectors/types/target-object.d.ts +14 -0
- package/dist/connectors/types/target-object.d.ts.map +1 -0
- package/dist/connectors/utils/cache.d.ts +14 -0
- package/dist/connectors/utils/cache.d.ts.map +1 -0
- package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts +7 -0
- package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts.map +1 -0
- package/dist/connectors/utils/index.d.ts +4 -0
- package/dist/connectors/utils/index.d.ts.map +1 -0
- package/dist/connectors/utils/promises.d.ts +8 -0
- package/dist/connectors/utils/promises.d.ts.map +1 -0
- package/dist/hdwallet/hdwallet.d.ts +58 -0
- package/dist/hdwallet/hdwallet.d.ts.map +1 -0
- package/dist/hdwallet/index.d.ts +2 -0
- package/dist/hdwallet/index.d.ts.map +1 -0
- package/dist/index.d.ts +13 -904
- package/dist/index.d.ts.map +1 -0
- package/dist/index.global.js +520 -391
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +314 -208
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +316 -208
- package/dist/index.mjs.map +1 -1
- package/dist/mnemonic/index.d.ts +3 -0
- package/dist/mnemonic/index.d.ts.map +1 -0
- package/dist/mnemonic/mnemonic.d.ts +85 -0
- package/dist/mnemonic/mnemonic.d.ts.map +1 -0
- package/dist/mnemonic/utils.d.ts +8 -0
- package/dist/mnemonic/utils.d.ts.map +1 -0
- package/dist/predicate/index.d.ts +3 -0
- package/dist/predicate/index.d.ts.map +1 -0
- package/dist/predicate/predicate.d.ts +94 -0
- package/dist/predicate/predicate.d.ts.map +1 -0
- package/dist/predicate/utils/getPredicateRoot.d.ts +12 -0
- package/dist/predicate/utils/getPredicateRoot.d.ts.map +1 -0
- package/dist/predicate/utils/index.d.ts +2 -0
- package/dist/predicate/utils/index.d.ts.map +1 -0
- package/dist/providers/__generated__/operations.d.ts +3477 -0
- package/dist/providers/__generated__/operations.d.ts.map +1 -0
- package/dist/providers/assets/index.d.ts +5 -0
- package/dist/providers/assets/index.d.ts.map +1 -0
- package/dist/providers/assets/types.d.ts +36 -0
- package/dist/providers/assets/types.d.ts.map +1 -0
- package/dist/providers/assets/utils/index.d.ts +4 -0
- package/dist/providers/assets/utils/index.d.ts.map +1 -0
- package/dist/providers/assets/utils/network.d.ts +33 -0
- package/dist/providers/assets/utils/network.d.ts.map +1 -0
- package/dist/providers/assets/utils/resolveIconPaths.d.ts +14 -0
- package/dist/providers/assets/utils/resolveIconPaths.d.ts.map +1 -0
- package/dist/providers/assets/utils/url.d.ts +2 -0
- package/dist/providers/assets/utils/url.d.ts.map +1 -0
- package/dist/providers/chains.d.ts +11 -0
- package/dist/providers/chains.d.ts.map +1 -0
- package/dist/providers/coin-quantity.d.ts +21 -0
- package/dist/providers/coin-quantity.d.ts.map +1 -0
- package/dist/providers/coin.d.ts +15 -0
- package/dist/providers/coin.d.ts.map +1 -0
- package/dist/providers/fuel-graphql-subscriber.d.ts +23 -0
- package/dist/providers/fuel-graphql-subscriber.d.ts.map +1 -0
- package/dist/providers/index.d.ts +13 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/memory-cache.d.ts +11 -0
- package/dist/providers/memory-cache.d.ts.map +1 -0
- package/dist/providers/message.d.ts +60 -0
- package/dist/providers/message.d.ts.map +1 -0
- package/dist/providers/provider.d.ts +523 -0
- package/dist/providers/provider.d.ts.map +1 -0
- package/dist/providers/resource.d.ts +37 -0
- package/dist/providers/resource.d.ts.map +1 -0
- package/dist/providers/transaction-request/create-transaction-request.d.ts +73 -0
- package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -0
- package/dist/providers/transaction-request/errors.d.ts +25 -0
- package/dist/providers/transaction-request/errors.d.ts.map +1 -0
- package/dist/providers/transaction-request/hash-transaction.d.ts +9 -0
- package/dist/providers/transaction-request/hash-transaction.d.ts.map +1 -0
- package/dist/providers/transaction-request/index.d.ts +10 -0
- package/dist/providers/transaction-request/index.d.ts.map +1 -0
- package/dist/providers/transaction-request/input.d.ts +59 -0
- package/dist/providers/transaction-request/input.d.ts.map +1 -0
- package/dist/providers/transaction-request/output.d.ts +39 -0
- package/dist/providers/transaction-request/output.d.ts.map +1 -0
- package/dist/providers/transaction-request/script-transaction-request.d.ts +106 -0
- package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -0
- package/dist/providers/transaction-request/scripts.d.ts +6 -0
- package/dist/providers/transaction-request/scripts.d.ts.map +1 -0
- package/dist/providers/transaction-request/storage-slot.d.ts +10 -0
- package/dist/providers/transaction-request/storage-slot.d.ts.map +1 -0
- package/dist/providers/transaction-request/transaction-request.d.ts +278 -0
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -0
- package/dist/providers/transaction-request/types.d.ts +10 -0
- package/dist/providers/transaction-request/types.d.ts.map +1 -0
- package/dist/providers/transaction-request/utils.d.ts +4 -0
- package/dist/providers/transaction-request/utils.d.ts.map +1 -0
- package/dist/providers/transaction-request/witness.d.ts +5 -0
- package/dist/providers/transaction-request/witness.d.ts.map +1 -0
- package/dist/providers/transaction-response/getDecodedLogs.d.ts +5 -0
- package/dist/providers/transaction-response/getDecodedLogs.d.ts.map +1 -0
- package/dist/providers/transaction-response/index.d.ts +3 -0
- package/dist/providers/transaction-response/index.d.ts.map +1 -0
- package/dist/providers/transaction-response/transaction-response.d.ts +106 -0
- package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -0
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +20 -0
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -0
- package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts +21 -0
- package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts.map +1 -0
- package/dist/providers/transaction-summary/call.d.ts +18 -0
- package/dist/providers/transaction-summary/call.d.ts.map +1 -0
- package/dist/providers/transaction-summary/get-transaction-summary.d.ts +31 -0
- package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -0
- package/dist/providers/transaction-summary/index.d.ts +10 -0
- package/dist/providers/transaction-summary/index.d.ts.map +1 -0
- package/dist/providers/transaction-summary/input.d.ts +21 -0
- package/dist/providers/transaction-summary/input.d.ts.map +1 -0
- package/dist/providers/transaction-summary/operations.d.ts +40 -0
- package/dist/providers/transaction-summary/operations.d.ts.map +1 -0
- package/dist/providers/transaction-summary/output.d.ts +15 -0
- package/dist/providers/transaction-summary/output.d.ts.map +1 -0
- package/dist/providers/transaction-summary/receipt.d.ts +7 -0
- package/dist/providers/transaction-summary/receipt.d.ts.map +1 -0
- package/dist/providers/transaction-summary/status.d.ts +9 -0
- package/dist/providers/transaction-summary/status.d.ts.map +1 -0
- package/dist/providers/transaction-summary/types.d.ts +146 -0
- package/dist/providers/transaction-summary/types.d.ts.map +1 -0
- package/dist/providers/utils/auto-retry-fetch.d.ts +36 -0
- package/dist/providers/utils/auto-retry-fetch.d.ts.map +1 -0
- package/dist/providers/utils/block-explorer.d.ts +14 -0
- package/dist/providers/utils/block-explorer.d.ts.map +1 -0
- package/dist/providers/utils/gas.d.ts +38 -0
- package/dist/providers/utils/gas.d.ts.map +1 -0
- package/dist/providers/utils/index.d.ts +6 -0
- package/dist/providers/utils/index.d.ts.map +1 -0
- package/dist/providers/utils/json.d.ts +7 -0
- package/dist/providers/utils/json.d.ts.map +1 -0
- package/dist/providers/utils/merge-quantities.d.ts +3 -0
- package/dist/providers/utils/merge-quantities.d.ts.map +1 -0
- package/dist/providers/utils/receipts.d.ts +10 -0
- package/dist/providers/utils/receipts.d.ts.map +1 -0
- package/dist/providers/utils/sleep.d.ts +3 -0
- package/dist/providers/utils/sleep.d.ts.map +1 -0
- package/dist/signer/index.d.ts +2 -0
- package/dist/signer/index.d.ts.map +1 -0
- package/dist/signer/signer.d.ts +64 -0
- package/dist/signer/signer.d.ts.map +1 -0
- package/dist/test-utils/generateTestWallet.d.ts +4 -0
- package/dist/test-utils/generateTestWallet.d.ts.map +1 -0
- package/dist/test-utils/index.d.ts +4 -0
- package/dist/test-utils/index.d.ts.map +1 -0
- package/dist/{test-utils.d.ts → test-utils/launchNode.d.ts} +12 -24
- package/dist/test-utils/launchNode.d.ts.map +1 -0
- package/dist/test-utils/seedTestWallet.d.ts +4 -0
- package/dist/test-utils/seedTestWallet.d.ts.map +1 -0
- package/dist/test-utils.global.js +386 -295
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +179 -108
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +181 -108
- package/dist/test-utils.mjs.map +1 -1
- package/dist/utils/formatTransferToContractScriptData.d.ts +14 -0
- package/dist/utils/formatTransferToContractScriptData.d.ts.map +1 -0
- package/dist/wallet/base-wallet-unlocked.d.ts +73 -0
- package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -0
- package/dist/wallet/index.d.ts +4 -0
- package/dist/wallet/index.d.ts.map +1 -0
- package/dist/wallet/keystore-wallet.d.ts +38 -0
- package/dist/wallet/keystore-wallet.d.ts.map +1 -0
- package/dist/wallet/wallet.d.ts +68 -0
- package/dist/wallet/wallet.d.ts.map +1 -0
- package/dist/wallet/wallets.d.ts +76 -0
- package/dist/wallet/wallets.d.ts.map +1 -0
- package/dist/wallet-manager/index.d.ts +6 -0
- package/dist/wallet-manager/index.d.ts.map +1 -0
- package/dist/wallet-manager/storages/memory-storage.d.ts +9 -0
- package/dist/wallet-manager/storages/memory-storage.d.ts.map +1 -0
- package/dist/wallet-manager/types.d.ts +42 -0
- package/dist/wallet-manager/types.d.ts.map +1 -0
- package/dist/wallet-manager/vaults/mnemonic-vault.d.ts +29 -0
- package/dist/wallet-manager/vaults/mnemonic-vault.d.ts.map +1 -0
- package/dist/wallet-manager/vaults/privatekey-vault.d.ts +29 -0
- package/dist/wallet-manager/vaults/privatekey-vault.d.ts.map +1 -0
- package/dist/wallet-manager/wallet-manager.d.ts +104 -0
- package/dist/wallet-manager/wallet-manager.d.ts.map +1 -0
- package/dist/wordlists/index.d.ts +5 -0
- package/dist/wordlists/index.d.ts.map +1 -0
- package/dist/wordlists/words/english.d.ts +2 -0
- package/dist/wordlists/words/english.d.ts.map +1 -0
- package/package.json +25 -21
- package/dist/account-E9nGNf5X.d.mts +0 -3837
- package/dist/account-E9nGNf5X.d.ts +0 -3837
- package/dist/configs.d.mts +0 -3
- package/dist/index.d.mts +0 -904
- package/dist/test-utils.d.mts +0 -66
package/dist/index.global.js
CHANGED
@@ -6,12 +6,13 @@
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
9
10
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
10
11
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
11
12
|
}) : x)(function(x) {
|
12
13
|
if (typeof require !== "undefined")
|
13
14
|
return require.apply(this, arguments);
|
14
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
15
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
15
16
|
});
|
16
17
|
var __esm = (fn, res) => function __init() {
|
17
18
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
@@ -40,6 +41,32 @@
|
|
40
41
|
mod2
|
41
42
|
));
|
42
43
|
var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2);
|
44
|
+
var __publicField = (obj, key, value) => {
|
45
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
46
|
+
return value;
|
47
|
+
};
|
48
|
+
var __accessCheck = (obj, member, msg) => {
|
49
|
+
if (!member.has(obj))
|
50
|
+
throw TypeError("Cannot " + msg);
|
51
|
+
};
|
52
|
+
var __privateGet = (obj, member, getter) => {
|
53
|
+
__accessCheck(obj, member, "read from private field");
|
54
|
+
return getter ? getter.call(obj) : member.get(obj);
|
55
|
+
};
|
56
|
+
var __privateAdd = (obj, member, value) => {
|
57
|
+
if (member.has(obj))
|
58
|
+
throw TypeError("Cannot add the same private member more than once");
|
59
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
60
|
+
};
|
61
|
+
var __privateSet = (obj, member, value, setter) => {
|
62
|
+
__accessCheck(obj, member, "write to private field");
|
63
|
+
setter ? setter.call(obj, value) : member.set(obj, value);
|
64
|
+
return value;
|
65
|
+
};
|
66
|
+
var __privateMethod = (obj, member, method) => {
|
67
|
+
__accessCheck(obj, member, "access private method");
|
68
|
+
return method;
|
69
|
+
};
|
43
70
|
|
44
71
|
// ../../node_modules/.pnpm/bech32@2.0.0/node_modules/bech32/dist/index.js
|
45
72
|
var require_dist = __commonJS({
|
@@ -210,7 +237,6 @@
|
|
210
237
|
// ../../node_modules/.pnpm/bn.js@5.2.1/node_modules/bn.js/lib/bn.js
|
211
238
|
var require_bn = __commonJS({
|
212
239
|
"../../node_modules/.pnpm/bn.js@5.2.1/node_modules/bn.js/lib/bn.js"(exports, module) {
|
213
|
-
"use strict";
|
214
240
|
(function(module2, exports2) {
|
215
241
|
"use strict";
|
216
242
|
function assert4(val, msg) {
|
@@ -5528,7 +5554,6 @@
|
|
5528
5554
|
var import_stream, import_http, import_url, import_whatwg_url, import_https, import_zlib, Readable, BUFFER, TYPE, Blob2, convert, INTERNALS, PassThrough, invalidTokenRegex, invalidHeaderCharRegex, MAP, Headers2, INTERNAL, HeadersIteratorPrototype, INTERNALS$1, STATUS_CODES, Response2, INTERNALS$2, URL, parse_url, format_url, streamDestructionSupported, Request, URL$1, PassThrough$1, isDomainOrSubdomain, isSameProtocol, lib_default;
|
5529
5555
|
var init_lib = __esm({
|
5530
5556
|
"../../node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.mjs"() {
|
5531
|
-
"use strict";
|
5532
5557
|
import_stream = __toESM(__require("stream"), 1);
|
5533
5558
|
import_http = __toESM(__require("http"), 1);
|
5534
5559
|
import_url = __toESM(__require("url"), 1);
|
@@ -5538,7 +5563,7 @@
|
|
5538
5563
|
Readable = import_stream.default.Readable;
|
5539
5564
|
BUFFER = Symbol("buffer");
|
5540
5565
|
TYPE = Symbol("type");
|
5541
|
-
Blob2 = class
|
5566
|
+
Blob2 = class {
|
5542
5567
|
constructor() {
|
5543
5568
|
this[TYPE] = "";
|
5544
5569
|
const blobParts = arguments[0];
|
@@ -5557,7 +5582,7 @@
|
|
5557
5582
|
buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
|
5558
5583
|
} else if (element instanceof ArrayBuffer) {
|
5559
5584
|
buffer = Buffer.from(element);
|
5560
|
-
} else if (element instanceof
|
5585
|
+
} else if (element instanceof Blob2) {
|
5561
5586
|
buffer = element[BUFFER];
|
5562
5587
|
} else {
|
5563
5588
|
buffer = Buffer.from(typeof element === "string" ? element : String(element));
|
@@ -5619,7 +5644,7 @@
|
|
5619
5644
|
const span = Math.max(relativeEnd - relativeStart, 0);
|
5620
5645
|
const buffer = this[BUFFER];
|
5621
5646
|
const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
|
5622
|
-
const blob = new
|
5647
|
+
const blob = new Blob2([], { type: arguments[2] });
|
5623
5648
|
blob[BUFFER] = slicedBuffer;
|
5624
5649
|
return blob;
|
5625
5650
|
}
|
@@ -5746,7 +5771,7 @@
|
|
5746
5771
|
invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
|
5747
5772
|
invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
|
5748
5773
|
MAP = Symbol("map");
|
5749
|
-
Headers2 = class
|
5774
|
+
Headers2 = class {
|
5750
5775
|
/**
|
5751
5776
|
* Headers class
|
5752
5777
|
*
|
@@ -5756,7 +5781,7 @@
|
|
5756
5781
|
constructor() {
|
5757
5782
|
let init = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0;
|
5758
5783
|
this[MAP] = /* @__PURE__ */ Object.create(null);
|
5759
|
-
if (init instanceof
|
5784
|
+
if (init instanceof Headers2) {
|
5760
5785
|
const rawHeaders = init.raw();
|
5761
5786
|
const headerNames = Object.keys(rawHeaders);
|
5762
5787
|
for (const headerName of headerNames) {
|
@@ -5974,7 +5999,7 @@
|
|
5974
5999
|
});
|
5975
6000
|
INTERNALS$1 = Symbol("Response internals");
|
5976
6001
|
STATUS_CODES = import_http.default.STATUS_CODES;
|
5977
|
-
Response2 = class
|
6002
|
+
Response2 = class {
|
5978
6003
|
constructor() {
|
5979
6004
|
let body = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
|
5980
6005
|
let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
@@ -6022,7 +6047,7 @@
|
|
6022
6047
|
* @return Response
|
6023
6048
|
*/
|
6024
6049
|
clone() {
|
6025
|
-
return new
|
6050
|
+
return new Response2(clone(this), {
|
6026
6051
|
url: this.url,
|
6027
6052
|
status: this.status,
|
6028
6053
|
statusText: this.statusText,
|
@@ -6053,7 +6078,7 @@
|
|
6053
6078
|
parse_url = import_url.default.parse;
|
6054
6079
|
format_url = import_url.default.format;
|
6055
6080
|
streamDestructionSupported = "destroy" in import_stream.default.Readable.prototype;
|
6056
|
-
Request = class
|
6081
|
+
Request = class {
|
6057
6082
|
constructor(input) {
|
6058
6083
|
let init = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
6059
6084
|
let parsedURL;
|
@@ -6123,7 +6148,7 @@
|
|
6123
6148
|
* @return Request
|
6124
6149
|
*/
|
6125
6150
|
clone() {
|
6126
|
-
return new
|
6151
|
+
return new Request(this);
|
6127
6152
|
}
|
6128
6153
|
};
|
6129
6154
|
Body.mixIn(Request.prototype);
|
@@ -6167,7 +6192,6 @@
|
|
6167
6192
|
// ../../node_modules/.pnpm/cross-fetch@4.0.0/node_modules/cross-fetch/dist/node-ponyfill.js
|
6168
6193
|
var require_node_ponyfill = __commonJS({
|
6169
6194
|
"../../node_modules/.pnpm/cross-fetch@4.0.0/node_modules/cross-fetch/dist/node-ponyfill.js"(exports, module) {
|
6170
|
-
"use strict";
|
6171
6195
|
var nodeFetch = (init_lib(), __toCommonJS(lib_exports));
|
6172
6196
|
var realFetch = nodeFetch.default || nodeFetch;
|
6173
6197
|
var fetch3 = function(url, options) {
|
@@ -6333,7 +6357,7 @@
|
|
6333
6357
|
}
|
6334
6358
|
return firstArg;
|
6335
6359
|
}
|
6336
|
-
var GraphQLError2 = class
|
6360
|
+
var GraphQLError2 = class extends Error {
|
6337
6361
|
/**
|
6338
6362
|
* An array of `{ line, column }` locations within the source GraphQL document
|
6339
6363
|
* which correspond to this error.
|
@@ -6422,7 +6446,7 @@
|
|
6422
6446
|
configurable: true
|
6423
6447
|
});
|
6424
6448
|
} else if (Error.captureStackTrace) {
|
6425
|
-
Error.captureStackTrace(this,
|
6449
|
+
Error.captureStackTrace(this, GraphQLError2);
|
6426
6450
|
} else {
|
6427
6451
|
Object.defineProperty(this, "stack", {
|
6428
6452
|
value: Error().stack,
|
@@ -9819,7 +9843,6 @@ spurious results.`);
|
|
9819
9843
|
// ../../node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js
|
9820
9844
|
var require_delayed_stream = __commonJS({
|
9821
9845
|
"../../node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js"(exports, module) {
|
9822
|
-
"use strict";
|
9823
9846
|
var Stream2 = __require("stream").Stream;
|
9824
9847
|
var util = __require("util");
|
9825
9848
|
module.exports = DelayedStream;
|
@@ -9911,7 +9934,6 @@ spurious results.`);
|
|
9911
9934
|
// ../../node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js
|
9912
9935
|
var require_combined_stream = __commonJS({
|
9913
9936
|
"../../node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js"(exports, module) {
|
9914
|
-
"use strict";
|
9915
9937
|
var util = __require("util");
|
9916
9938
|
var Stream2 = __require("stream").Stream;
|
9917
9939
|
var DelayedStream = require_delayed_stream();
|
@@ -18608,7 +18630,6 @@ spurious results.`);
|
|
18608
18630
|
// ../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js
|
18609
18631
|
var require_mime_db = __commonJS({
|
18610
18632
|
"../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js"(exports, module) {
|
18611
|
-
"use strict";
|
18612
18633
|
module.exports = require_db();
|
18613
18634
|
}
|
18614
18635
|
});
|
@@ -18707,7 +18728,6 @@ spurious results.`);
|
|
18707
18728
|
// ../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/defer.js
|
18708
18729
|
var require_defer = __commonJS({
|
18709
18730
|
"../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/defer.js"(exports, module) {
|
18710
|
-
"use strict";
|
18711
18731
|
module.exports = defer;
|
18712
18732
|
function defer(fn) {
|
18713
18733
|
var nextTick = typeof setImmediate == "function" ? setImmediate : typeof process == "object" && typeof process.nextTick == "function" ? process.nextTick : null;
|
@@ -18723,7 +18743,6 @@ spurious results.`);
|
|
18723
18743
|
// ../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/async.js
|
18724
18744
|
var require_async = __commonJS({
|
18725
18745
|
"../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/async.js"(exports, module) {
|
18726
|
-
"use strict";
|
18727
18746
|
var defer = require_defer();
|
18728
18747
|
module.exports = async;
|
18729
18748
|
function async(callback) {
|
@@ -18747,7 +18766,6 @@ spurious results.`);
|
|
18747
18766
|
// ../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/abort.js
|
18748
18767
|
var require_abort = __commonJS({
|
18749
18768
|
"../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/abort.js"(exports, module) {
|
18750
|
-
"use strict";
|
18751
18769
|
module.exports = abort;
|
18752
18770
|
function abort(state) {
|
18753
18771
|
Object.keys(state.jobs).forEach(clean.bind(state));
|
@@ -18764,7 +18782,6 @@ spurious results.`);
|
|
18764
18782
|
// ../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/iterate.js
|
18765
18783
|
var require_iterate = __commonJS({
|
18766
18784
|
"../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/iterate.js"(exports, module) {
|
18767
|
-
"use strict";
|
18768
18785
|
var async = require_async();
|
18769
18786
|
var abort = require_abort();
|
18770
18787
|
module.exports = iterate;
|
@@ -18798,7 +18815,6 @@ spurious results.`);
|
|
18798
18815
|
// ../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/state.js
|
18799
18816
|
var require_state = __commonJS({
|
18800
18817
|
"../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/state.js"(exports, module) {
|
18801
|
-
"use strict";
|
18802
18818
|
module.exports = state;
|
18803
18819
|
function state(list, sortMethod) {
|
18804
18820
|
var isNamedList = !Array.isArray(list), initState = {
|
@@ -18821,7 +18837,6 @@ spurious results.`);
|
|
18821
18837
|
// ../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/terminator.js
|
18822
18838
|
var require_terminator = __commonJS({
|
18823
18839
|
"../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/terminator.js"(exports, module) {
|
18824
|
-
"use strict";
|
18825
18840
|
var abort = require_abort();
|
18826
18841
|
var async = require_async();
|
18827
18842
|
module.exports = terminator;
|
@@ -18839,7 +18854,6 @@ spurious results.`);
|
|
18839
18854
|
// ../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/parallel.js
|
18840
18855
|
var require_parallel = __commonJS({
|
18841
18856
|
"../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/parallel.js"(exports, module) {
|
18842
|
-
"use strict";
|
18843
18857
|
var iterate = require_iterate();
|
18844
18858
|
var initState = require_state();
|
18845
18859
|
var terminator = require_terminator();
|
@@ -18867,7 +18881,6 @@ spurious results.`);
|
|
18867
18881
|
// ../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serialOrdered.js
|
18868
18882
|
var require_serialOrdered = __commonJS({
|
18869
18883
|
"../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serialOrdered.js"(exports, module) {
|
18870
|
-
"use strict";
|
18871
18884
|
var iterate = require_iterate();
|
18872
18885
|
var initState = require_state();
|
18873
18886
|
var terminator = require_terminator();
|
@@ -18902,7 +18915,6 @@ spurious results.`);
|
|
18902
18915
|
// ../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serial.js
|
18903
18916
|
var require_serial = __commonJS({
|
18904
18917
|
"../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serial.js"(exports, module) {
|
18905
|
-
"use strict";
|
18906
18918
|
var serialOrdered = require_serialOrdered();
|
18907
18919
|
module.exports = serial;
|
18908
18920
|
function serial(list, iterator, callback) {
|
@@ -18914,7 +18926,6 @@ spurious results.`);
|
|
18914
18926
|
// ../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/index.js
|
18915
18927
|
var require_asynckit = __commonJS({
|
18916
18928
|
"../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/index.js"(exports, module) {
|
18917
|
-
"use strict";
|
18918
18929
|
module.exports = {
|
18919
18930
|
parallel: require_parallel(),
|
18920
18931
|
serial: require_serial(),
|
@@ -18926,7 +18937,6 @@ spurious results.`);
|
|
18926
18937
|
// ../../node_modules/.pnpm/form-data@3.0.1/node_modules/form-data/lib/populate.js
|
18927
18938
|
var require_populate = __commonJS({
|
18928
18939
|
"../../node_modules/.pnpm/form-data@3.0.1/node_modules/form-data/lib/populate.js"(exports, module) {
|
18929
|
-
"use strict";
|
18930
18940
|
module.exports = function(dst, src) {
|
18931
18941
|
Object.keys(src).forEach(function(prop) {
|
18932
18942
|
dst[prop] = dst[prop] || src[prop];
|
@@ -18939,7 +18949,6 @@ spurious results.`);
|
|
18939
18949
|
// ../../node_modules/.pnpm/form-data@3.0.1/node_modules/form-data/lib/form_data.js
|
18940
18950
|
var require_form_data = __commonJS({
|
18941
18951
|
"../../node_modules/.pnpm/form-data@3.0.1/node_modules/form-data/lib/form_data.js"(exports, module) {
|
18942
|
-
"use strict";
|
18943
18952
|
var CombinedStream = require_combined_stream();
|
18944
18953
|
var util = __require("util");
|
18945
18954
|
var path = __require("path");
|
@@ -19381,7 +19390,7 @@ spurious results.`);
|
|
19381
19390
|
var require_types = __commonJS({
|
19382
19391
|
"../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/types.js"(exports) {
|
19383
19392
|
"use strict";
|
19384
|
-
var __extends = exports && exports.__extends ||
|
19393
|
+
var __extends = exports && exports.__extends || function() {
|
19385
19394
|
var extendStatics = function(d, b) {
|
19386
19395
|
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
19387
19396
|
d2.__proto__ = b2;
|
@@ -22371,10 +22380,10 @@ spurious results.`);
|
|
22371
22380
|
return RegId.__wrap(ret3);
|
22372
22381
|
}
|
22373
22382
|
};
|
22374
|
-
var CompareArgs = class
|
22383
|
+
var CompareArgs = class {
|
22375
22384
|
static __wrap(ptr) {
|
22376
22385
|
ptr = ptr >>> 0;
|
22377
|
-
const obj = Object.create(
|
22386
|
+
const obj = Object.create(CompareArgs.prototype);
|
22378
22387
|
obj.__wbg_ptr = ptr;
|
22379
22388
|
return obj;
|
22380
22389
|
}
|
@@ -22435,7 +22444,7 @@ spurious results.`);
|
|
22435
22444
|
_assertClass(bits, Imm06);
|
22436
22445
|
var ptr0 = bits.__destroy_into_raw();
|
22437
22446
|
const ret3 = wasm$1.compareargs_from_imm(ptr0);
|
22438
|
-
return ret3 === 0 ? void 0 :
|
22447
|
+
return ret3 === 0 ? void 0 : CompareArgs.__wrap(ret3);
|
22439
22448
|
}
|
22440
22449
|
};
|
22441
22450
|
var DIV = class {
|
@@ -22973,10 +22982,10 @@ spurious results.`);
|
|
22973
22982
|
return RegId.__wrap(ret3);
|
22974
22983
|
}
|
22975
22984
|
};
|
22976
|
-
var GM = class
|
22985
|
+
var GM = class {
|
22977
22986
|
static __wrap(ptr) {
|
22978
22987
|
ptr = ptr >>> 0;
|
22979
|
-
const obj = Object.create(
|
22988
|
+
const obj = Object.create(GM.prototype);
|
22980
22989
|
obj.__wbg_ptr = ptr;
|
22981
22990
|
return obj;
|
22982
22991
|
}
|
@@ -23029,7 +23038,7 @@ spurious results.`);
|
|
23029
23038
|
_assertClass(ra, RegId);
|
23030
23039
|
var ptr0 = ra.__destroy_into_raw();
|
23031
23040
|
const ret3 = wasm$1.gm_from_args(ptr0, args);
|
23032
|
-
return
|
23041
|
+
return GM.__wrap(ret3);
|
23033
23042
|
}
|
23034
23043
|
};
|
23035
23044
|
var GT = class {
|
@@ -23084,10 +23093,10 @@ spurious results.`);
|
|
23084
23093
|
return RegId.__wrap(ret3);
|
23085
23094
|
}
|
23086
23095
|
};
|
23087
|
-
var GTF = class
|
23096
|
+
var GTF = class {
|
23088
23097
|
static __wrap(ptr) {
|
23089
23098
|
ptr = ptr >>> 0;
|
23090
|
-
const obj = Object.create(
|
23099
|
+
const obj = Object.create(GTF.prototype);
|
23091
23100
|
obj.__wbg_ptr = ptr;
|
23092
23101
|
return obj;
|
23093
23102
|
}
|
@@ -23154,13 +23163,13 @@ spurious results.`);
|
|
23154
23163
|
_assertClass(rb, RegId);
|
23155
23164
|
var ptr1 = rb.__destroy_into_raw();
|
23156
23165
|
const ret3 = wasm$1.gtf_from_args(ptr0, ptr1, args);
|
23157
|
-
return
|
23166
|
+
return GTF.__wrap(ret3);
|
23158
23167
|
}
|
23159
23168
|
};
|
23160
|
-
var Imm06 = class
|
23169
|
+
var Imm06 = class {
|
23161
23170
|
static __wrap(ptr) {
|
23162
23171
|
ptr = ptr >>> 0;
|
23163
|
-
const obj = Object.create(
|
23172
|
+
const obj = Object.create(Imm06.prototype);
|
23164
23173
|
obj.__wbg_ptr = ptr;
|
23165
23174
|
return obj;
|
23166
23175
|
}
|
@@ -23174,10 +23183,10 @@ spurious results.`);
|
|
23174
23183
|
wasm$1.__wbg_imm06_free(ptr);
|
23175
23184
|
}
|
23176
23185
|
};
|
23177
|
-
var Imm12 = class
|
23186
|
+
var Imm12 = class {
|
23178
23187
|
static __wrap(ptr) {
|
23179
23188
|
ptr = ptr >>> 0;
|
23180
|
-
const obj = Object.create(
|
23189
|
+
const obj = Object.create(Imm12.prototype);
|
23181
23190
|
obj.__wbg_ptr = ptr;
|
23182
23191
|
return obj;
|
23183
23192
|
}
|
@@ -23191,10 +23200,10 @@ spurious results.`);
|
|
23191
23200
|
wasm$1.__wbg_imm12_free(ptr);
|
23192
23201
|
}
|
23193
23202
|
};
|
23194
|
-
var Imm18 = class
|
23203
|
+
var Imm18 = class {
|
23195
23204
|
static __wrap(ptr) {
|
23196
23205
|
ptr = ptr >>> 0;
|
23197
|
-
const obj = Object.create(
|
23206
|
+
const obj = Object.create(Imm18.prototype);
|
23198
23207
|
obj.__wbg_ptr = ptr;
|
23199
23208
|
return obj;
|
23200
23209
|
}
|
@@ -23208,10 +23217,10 @@ spurious results.`);
|
|
23208
23217
|
wasm$1.__wbg_imm18_free(ptr);
|
23209
23218
|
}
|
23210
23219
|
};
|
23211
|
-
var Imm24 = class
|
23220
|
+
var Imm24 = class {
|
23212
23221
|
static __wrap(ptr) {
|
23213
23222
|
ptr = ptr >>> 0;
|
23214
|
-
const obj = Object.create(
|
23223
|
+
const obj = Object.create(Imm24.prototype);
|
23215
23224
|
obj.__wbg_ptr = ptr;
|
23216
23225
|
return obj;
|
23217
23226
|
}
|
@@ -23225,10 +23234,10 @@ spurious results.`);
|
|
23225
23234
|
wasm$1.__wbg_imm24_free(ptr);
|
23226
23235
|
}
|
23227
23236
|
};
|
23228
|
-
var Instruction = class
|
23237
|
+
var Instruction = class {
|
23229
23238
|
static __wrap(ptr) {
|
23230
23239
|
ptr = ptr >>> 0;
|
23231
|
-
const obj = Object.create(
|
23240
|
+
const obj = Object.create(Instruction.prototype);
|
23232
23241
|
obj.__wbg_ptr = ptr;
|
23233
23242
|
return obj;
|
23234
23243
|
}
|
@@ -25421,10 +25430,10 @@ spurious results.`);
|
|
25421
25430
|
return RegId.__wrap(ret3);
|
25422
25431
|
}
|
25423
25432
|
};
|
25424
|
-
var RegId = class
|
25433
|
+
var RegId = class {
|
25425
25434
|
static __wrap(ptr) {
|
25426
25435
|
ptr = ptr >>> 0;
|
25427
|
-
const obj = Object.create(
|
25436
|
+
const obj = Object.create(RegId.prototype);
|
25428
25437
|
obj.__wbg_ptr = ptr;
|
25429
25438
|
return obj;
|
25430
25439
|
}
|
@@ -25446,7 +25455,7 @@ spurious results.`);
|
|
25446
25455
|
*/
|
25447
25456
|
static new_checked(u) {
|
25448
25457
|
const ret3 = wasm$1.regid_new_checked(u);
|
25449
|
-
return ret3 === 0 ? void 0 :
|
25458
|
+
return ret3 === 0 ? void 0 : RegId.__wrap(ret3);
|
25450
25459
|
}
|
25451
25460
|
/**
|
25452
25461
|
* Received balance for this context.
|
@@ -25454,7 +25463,7 @@ spurious results.`);
|
|
25454
25463
|
*/
|
25455
25464
|
static bal() {
|
25456
25465
|
const ret3 = wasm$1.regid_bal();
|
25457
|
-
return
|
25466
|
+
return RegId.__wrap(ret3);
|
25458
25467
|
}
|
25459
25468
|
/**
|
25460
25469
|
* Remaining gas in the context.
|
@@ -25462,7 +25471,7 @@ spurious results.`);
|
|
25462
25471
|
*/
|
25463
25472
|
static cgas() {
|
25464
25473
|
const ret3 = wasm$1.regid_cgas();
|
25465
|
-
return
|
25474
|
+
return RegId.__wrap(ret3);
|
25466
25475
|
}
|
25467
25476
|
/**
|
25468
25477
|
* Error codes for particular operations.
|
@@ -25470,7 +25479,7 @@ spurious results.`);
|
|
25470
25479
|
*/
|
25471
25480
|
static err() {
|
25472
25481
|
const ret3 = wasm$1.regid_err();
|
25473
|
-
return
|
25482
|
+
return RegId.__wrap(ret3);
|
25474
25483
|
}
|
25475
25484
|
/**
|
25476
25485
|
* Flags register.
|
@@ -25478,7 +25487,7 @@ spurious results.`);
|
|
25478
25487
|
*/
|
25479
25488
|
static flag() {
|
25480
25489
|
const ret3 = wasm$1.regid_flag();
|
25481
|
-
return
|
25490
|
+
return RegId.__wrap(ret3);
|
25482
25491
|
}
|
25483
25492
|
/**
|
25484
25493
|
* Frame pointer. Memory address of beginning of current call frame.
|
@@ -25486,7 +25495,7 @@ spurious results.`);
|
|
25486
25495
|
*/
|
25487
25496
|
static fp() {
|
25488
25497
|
const ret3 = wasm$1.regid_fp();
|
25489
|
-
return
|
25498
|
+
return RegId.__wrap(ret3);
|
25490
25499
|
}
|
25491
25500
|
/**
|
25492
25501
|
* Remaining gas globally.
|
@@ -25494,7 +25503,7 @@ spurious results.`);
|
|
25494
25503
|
*/
|
25495
25504
|
static ggas() {
|
25496
25505
|
const ret3 = wasm$1.regid_ggas();
|
25497
|
-
return
|
25506
|
+
return RegId.__wrap(ret3);
|
25498
25507
|
}
|
25499
25508
|
/**
|
25500
25509
|
* Heap pointer. Memory address below the current bottom of the heap (points to free
|
@@ -25503,7 +25512,7 @@ spurious results.`);
|
|
25503
25512
|
*/
|
25504
25513
|
static hp() {
|
25505
25514
|
const ret3 = wasm$1.regid_hp();
|
25506
|
-
return
|
25515
|
+
return RegId.__wrap(ret3);
|
25507
25516
|
}
|
25508
25517
|
/**
|
25509
25518
|
* Instructions start. Pointer to the start of the currently-executing code.
|
@@ -25511,7 +25520,7 @@ spurious results.`);
|
|
25511
25520
|
*/
|
25512
25521
|
static is() {
|
25513
25522
|
const ret3 = wasm$1.regid_is();
|
25514
|
-
return
|
25523
|
+
return RegId.__wrap(ret3);
|
25515
25524
|
}
|
25516
25525
|
/**
|
25517
25526
|
* Contains overflow/underflow of addition, subtraction, and multiplication.
|
@@ -25519,7 +25528,7 @@ spurious results.`);
|
|
25519
25528
|
*/
|
25520
25529
|
static of() {
|
25521
25530
|
const ret3 = wasm$1.regid_of();
|
25522
|
-
return
|
25531
|
+
return RegId.__wrap(ret3);
|
25523
25532
|
}
|
25524
25533
|
/**
|
25525
25534
|
* Contains one (1), for convenience.
|
@@ -25527,7 +25536,7 @@ spurious results.`);
|
|
25527
25536
|
*/
|
25528
25537
|
static one() {
|
25529
25538
|
const ret3 = wasm$1.regid_one();
|
25530
|
-
return
|
25539
|
+
return RegId.__wrap(ret3);
|
25531
25540
|
}
|
25532
25541
|
/**
|
25533
25542
|
* The program counter. Memory address of the current instruction.
|
@@ -25535,7 +25544,7 @@ spurious results.`);
|
|
25535
25544
|
*/
|
25536
25545
|
static pc() {
|
25537
25546
|
const ret3 = wasm$1.regid_pc();
|
25538
|
-
return
|
25547
|
+
return RegId.__wrap(ret3);
|
25539
25548
|
}
|
25540
25549
|
/**
|
25541
25550
|
* Return value or pointer.
|
@@ -25543,7 +25552,7 @@ spurious results.`);
|
|
25543
25552
|
*/
|
25544
25553
|
static ret() {
|
25545
25554
|
const ret3 = wasm$1.regid_ret();
|
25546
|
-
return
|
25555
|
+
return RegId.__wrap(ret3);
|
25547
25556
|
}
|
25548
25557
|
/**
|
25549
25558
|
* Return value length in bytes.
|
@@ -25551,7 +25560,7 @@ spurious results.`);
|
|
25551
25560
|
*/
|
25552
25561
|
static retl() {
|
25553
25562
|
const ret3 = wasm$1.regid_retl();
|
25554
|
-
return
|
25563
|
+
return RegId.__wrap(ret3);
|
25555
25564
|
}
|
25556
25565
|
/**
|
25557
25566
|
* Stack pointer. Memory address on top of current writable stack area (points to
|
@@ -25560,7 +25569,7 @@ spurious results.`);
|
|
25560
25569
|
*/
|
25561
25570
|
static sp() {
|
25562
25571
|
const ret3 = wasm$1.regid_sp();
|
25563
|
-
return
|
25572
|
+
return RegId.__wrap(ret3);
|
25564
25573
|
}
|
25565
25574
|
/**
|
25566
25575
|
* Stack start pointer. Memory address of bottom of current writable stack area.
|
@@ -25568,7 +25577,7 @@ spurious results.`);
|
|
25568
25577
|
*/
|
25569
25578
|
static spp() {
|
25570
25579
|
const ret3 = wasm$1.regid_spp();
|
25571
|
-
return
|
25580
|
+
return RegId.__wrap(ret3);
|
25572
25581
|
}
|
25573
25582
|
/**
|
25574
25583
|
* Smallest writable register.
|
@@ -25576,7 +25585,7 @@ spurious results.`);
|
|
25576
25585
|
*/
|
25577
25586
|
static writable() {
|
25578
25587
|
const ret3 = wasm$1.regid_writable();
|
25579
|
-
return
|
25588
|
+
return RegId.__wrap(ret3);
|
25580
25589
|
}
|
25581
25590
|
/**
|
25582
25591
|
* Contains zero (0), for convenience.
|
@@ -25584,7 +25593,7 @@ spurious results.`);
|
|
25584
25593
|
*/
|
25585
25594
|
static zero() {
|
25586
25595
|
const ret3 = wasm$1.regid_zero();
|
25587
|
-
return
|
25596
|
+
return RegId.__wrap(ret3);
|
25588
25597
|
}
|
25589
25598
|
/**
|
25590
25599
|
* Construct a register ID from the given value.
|
@@ -26639,10 +26648,10 @@ spurious results.`);
|
|
26639
26648
|
return RegId.__wrap(ret3);
|
26640
26649
|
}
|
26641
26650
|
};
|
26642
|
-
var WDCM = class
|
26651
|
+
var WDCM = class {
|
26643
26652
|
static __wrap(ptr) {
|
26644
26653
|
ptr = ptr >>> 0;
|
26645
|
-
const obj = Object.create(
|
26654
|
+
const obj = Object.create(WDCM.prototype);
|
26646
26655
|
obj.__wbg_ptr = ptr;
|
26647
26656
|
return obj;
|
26648
26657
|
}
|
@@ -26725,13 +26734,13 @@ spurious results.`);
|
|
26725
26734
|
_assertClass(args, CompareArgs);
|
26726
26735
|
var ptr3 = args.__destroy_into_raw();
|
26727
26736
|
const ret3 = wasm$1.wdcm_from_args(ptr0, ptr1, ptr2, ptr3);
|
26728
|
-
return
|
26737
|
+
return WDCM.__wrap(ret3);
|
26729
26738
|
}
|
26730
26739
|
};
|
26731
|
-
var WDDV = class
|
26740
|
+
var WDDV = class {
|
26732
26741
|
static __wrap(ptr) {
|
26733
26742
|
ptr = ptr >>> 0;
|
26734
|
-
const obj = Object.create(
|
26743
|
+
const obj = Object.create(WDDV.prototype);
|
26735
26744
|
obj.__wbg_ptr = ptr;
|
26736
26745
|
return obj;
|
26737
26746
|
}
|
@@ -26814,7 +26823,7 @@ spurious results.`);
|
|
26814
26823
|
_assertClass(args, DivArgs);
|
26815
26824
|
var ptr3 = args.__destroy_into_raw();
|
26816
26825
|
const ret3 = wasm$1.wddv_from_args(ptr0, ptr1, ptr2, ptr3);
|
26817
|
-
return
|
26826
|
+
return WDDV.__wrap(ret3);
|
26818
26827
|
}
|
26819
26828
|
};
|
26820
26829
|
var WDMD = class {
|
@@ -26880,10 +26889,10 @@ spurious results.`);
|
|
26880
26889
|
return RegId.__wrap(ret3);
|
26881
26890
|
}
|
26882
26891
|
};
|
26883
|
-
var WDML = class
|
26892
|
+
var WDML = class {
|
26884
26893
|
static __wrap(ptr) {
|
26885
26894
|
ptr = ptr >>> 0;
|
26886
|
-
const obj = Object.create(
|
26895
|
+
const obj = Object.create(WDML.prototype);
|
26887
26896
|
obj.__wbg_ptr = ptr;
|
26888
26897
|
return obj;
|
26889
26898
|
}
|
@@ -26966,7 +26975,7 @@ spurious results.`);
|
|
26966
26975
|
_assertClass(args, MulArgs);
|
26967
26976
|
var ptr3 = args.__destroy_into_raw();
|
26968
26977
|
const ret3 = wasm$1.wdml_from_args(ptr0, ptr1, ptr2, ptr3);
|
26969
|
-
return
|
26978
|
+
return WDML.__wrap(ret3);
|
26970
26979
|
}
|
26971
26980
|
};
|
26972
26981
|
var WDMM = class {
|
@@ -27032,10 +27041,10 @@ spurious results.`);
|
|
27032
27041
|
return RegId.__wrap(ret3);
|
27033
27042
|
}
|
27034
27043
|
};
|
27035
|
-
var WDOP = class
|
27044
|
+
var WDOP = class {
|
27036
27045
|
static __wrap(ptr) {
|
27037
27046
|
ptr = ptr >>> 0;
|
27038
|
-
const obj = Object.create(
|
27047
|
+
const obj = Object.create(WDOP.prototype);
|
27039
27048
|
obj.__wbg_ptr = ptr;
|
27040
27049
|
return obj;
|
27041
27050
|
}
|
@@ -27118,7 +27127,7 @@ spurious results.`);
|
|
27118
27127
|
_assertClass(args, MathArgs);
|
27119
27128
|
var ptr3 = args.__destroy_into_raw();
|
27120
27129
|
const ret3 = wasm$1.wdop_from_args(ptr0, ptr1, ptr2, ptr3);
|
27121
|
-
return
|
27130
|
+
return WDOP.__wrap(ret3);
|
27122
27131
|
}
|
27123
27132
|
};
|
27124
27133
|
var WQAM = class {
|
@@ -27184,10 +27193,10 @@ spurious results.`);
|
|
27184
27193
|
return RegId.__wrap(ret3);
|
27185
27194
|
}
|
27186
27195
|
};
|
27187
|
-
var WQCM = class
|
27196
|
+
var WQCM = class {
|
27188
27197
|
static __wrap(ptr) {
|
27189
27198
|
ptr = ptr >>> 0;
|
27190
|
-
const obj = Object.create(
|
27199
|
+
const obj = Object.create(WQCM.prototype);
|
27191
27200
|
obj.__wbg_ptr = ptr;
|
27192
27201
|
return obj;
|
27193
27202
|
}
|
@@ -27270,13 +27279,13 @@ spurious results.`);
|
|
27270
27279
|
_assertClass(args, CompareArgs);
|
27271
27280
|
var ptr3 = args.__destroy_into_raw();
|
27272
27281
|
const ret3 = wasm$1.wdcm_from_args(ptr0, ptr1, ptr2, ptr3);
|
27273
|
-
return
|
27282
|
+
return WQCM.__wrap(ret3);
|
27274
27283
|
}
|
27275
27284
|
};
|
27276
|
-
var WQDV = class
|
27285
|
+
var WQDV = class {
|
27277
27286
|
static __wrap(ptr) {
|
27278
27287
|
ptr = ptr >>> 0;
|
27279
|
-
const obj = Object.create(
|
27288
|
+
const obj = Object.create(WQDV.prototype);
|
27280
27289
|
obj.__wbg_ptr = ptr;
|
27281
27290
|
return obj;
|
27282
27291
|
}
|
@@ -27359,7 +27368,7 @@ spurious results.`);
|
|
27359
27368
|
_assertClass(args, DivArgs);
|
27360
27369
|
var ptr3 = args.__destroy_into_raw();
|
27361
27370
|
const ret3 = wasm$1.wddv_from_args(ptr0, ptr1, ptr2, ptr3);
|
27362
|
-
return
|
27371
|
+
return WQDV.__wrap(ret3);
|
27363
27372
|
}
|
27364
27373
|
};
|
27365
27374
|
var WQMD = class {
|
@@ -27425,10 +27434,10 @@ spurious results.`);
|
|
27425
27434
|
return RegId.__wrap(ret3);
|
27426
27435
|
}
|
27427
27436
|
};
|
27428
|
-
var WQML = class
|
27437
|
+
var WQML = class {
|
27429
27438
|
static __wrap(ptr) {
|
27430
27439
|
ptr = ptr >>> 0;
|
27431
|
-
const obj = Object.create(
|
27440
|
+
const obj = Object.create(WQML.prototype);
|
27432
27441
|
obj.__wbg_ptr = ptr;
|
27433
27442
|
return obj;
|
27434
27443
|
}
|
@@ -27511,7 +27520,7 @@ spurious results.`);
|
|
27511
27520
|
_assertClass(args, MulArgs);
|
27512
27521
|
var ptr3 = args.__destroy_into_raw();
|
27513
27522
|
const ret3 = wasm$1.wdml_from_args(ptr0, ptr1, ptr2, ptr3);
|
27514
|
-
return
|
27523
|
+
return WQML.__wrap(ret3);
|
27515
27524
|
}
|
27516
27525
|
};
|
27517
27526
|
var WQMM = class {
|
@@ -27577,10 +27586,10 @@ spurious results.`);
|
|
27577
27586
|
return RegId.__wrap(ret3);
|
27578
27587
|
}
|
27579
27588
|
};
|
27580
|
-
var WQOP = class
|
27589
|
+
var WQOP = class {
|
27581
27590
|
static __wrap(ptr) {
|
27582
27591
|
ptr = ptr >>> 0;
|
27583
|
-
const obj = Object.create(
|
27592
|
+
const obj = Object.create(WQOP.prototype);
|
27584
27593
|
obj.__wbg_ptr = ptr;
|
27585
27594
|
return obj;
|
27586
27595
|
}
|
@@ -27663,7 +27672,7 @@ spurious results.`);
|
|
27663
27672
|
_assertClass(args, MathArgs);
|
27664
27673
|
var ptr3 = args.__destroy_into_raw();
|
27665
27674
|
const ret3 = wasm$1.wdop_from_args(ptr0, ptr1, ptr2, ptr3);
|
27666
|
-
return
|
27675
|
+
return WQOP.__wrap(ret3);
|
27667
27676
|
}
|
27668
27677
|
};
|
27669
27678
|
var XOR = class {
|
@@ -28823,7 +28832,7 @@ spurious results.`);
|
|
28823
28832
|
}
|
28824
28833
|
B.fill(0);
|
28825
28834
|
}
|
28826
|
-
var Keccak = class
|
28835
|
+
var Keccak = class extends Hash {
|
28827
28836
|
// NOTE: we accept arguments in bytes instead of bits here.
|
28828
28837
|
constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
|
28829
28838
|
super();
|
@@ -28914,7 +28923,7 @@ spurious results.`);
|
|
28914
28923
|
}
|
28915
28924
|
_cloneInto(to) {
|
28916
28925
|
const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
|
28917
|
-
to || (to = new
|
28926
|
+
to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));
|
28918
28927
|
to.state32.set(this.state32);
|
28919
28928
|
to.pos = this.pos;
|
28920
28929
|
to.posOut = this.posOut;
|
@@ -28993,6 +29002,12 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
28993
29002
|
var versions = getBuiltinVersions();
|
28994
29003
|
|
28995
29004
|
// ../errors/dist/index.mjs
|
29005
|
+
var __defProp2 = Object.defineProperty;
|
29006
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
29007
|
+
var __publicField2 = (obj, key, value) => {
|
29008
|
+
__defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
29009
|
+
return value;
|
29010
|
+
};
|
28996
29011
|
var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => {
|
28997
29012
|
ErrorCode2["NO_ABIS_FOUND"] = "no-abis-found";
|
28998
29013
|
ErrorCode2["ABI_TYPES_AND_VALUES_MISMATCH"] = "abi-types-and-values-mismatch";
|
@@ -29071,8 +29086,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
29071
29086
|
ErrorCode2["STREAM_PARSING_ERROR"] = "stream-parsing-error";
|
29072
29087
|
return ErrorCode2;
|
29073
29088
|
})(ErrorCode || {});
|
29074
|
-
var
|
29075
|
-
static CODES = ErrorCode;
|
29089
|
+
var _FuelError = class extends Error {
|
29076
29090
|
VERSIONS = versions;
|
29077
29091
|
static parse(e) {
|
29078
29092
|
const error = e;
|
@@ -29103,8 +29117,16 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
29103
29117
|
return { code, name, message, VERSIONS };
|
29104
29118
|
}
|
29105
29119
|
};
|
29120
|
+
var FuelError = _FuelError;
|
29121
|
+
__publicField2(FuelError, "CODES", ErrorCode);
|
29106
29122
|
|
29107
29123
|
// ../utils/dist/index.mjs
|
29124
|
+
var __defProp3 = Object.defineProperty;
|
29125
|
+
var __defNormalProp3 = (obj, key, value) => key in obj ? __defProp3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
29126
|
+
var __publicField3 = (obj, key, value) => {
|
29127
|
+
__defNormalProp3(obj, typeof key !== "symbol" ? key + "" : key, value);
|
29128
|
+
return value;
|
29129
|
+
};
|
29108
29130
|
var chunkAndPadBytes = (bytes3, chunkSize) => {
|
29109
29131
|
const chunks = [];
|
29110
29132
|
for (let offset = 0; offset < bytes3.length; offset += chunkSize) {
|
@@ -29170,8 +29192,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
29170
29192
|
var tai64ToUnixSeconds = (tai64) => Number(BigInt(tai64) - TAI64_UNIX_OFFSET);
|
29171
29193
|
var unixSecondsToTai64 = (unixSeconds) => String(BigInt(unixSeconds) + TAI64_UNIX_OFFSET);
|
29172
29194
|
var tai64ToUnixMilliseconds = (tai64) => secondsToMs(tai64ToUnixSeconds(tai64));
|
29173
|
-
var
|
29174
|
-
static TAI64_NULL = "";
|
29195
|
+
var _DateTime = class extends Date {
|
29175
29196
|
/**
|
29176
29197
|
* Generates a new DateTime instance from a Tai64 timestamp.
|
29177
29198
|
*
|
@@ -29222,6 +29243,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
29222
29243
|
return msToSeconds(this.getTime());
|
29223
29244
|
}
|
29224
29245
|
};
|
29246
|
+
var DateTime = _DateTime;
|
29247
|
+
__publicField3(DateTime, "TAI64_NULL", "");
|
29225
29248
|
|
29226
29249
|
// ../crypto/dist/index.mjs
|
29227
29250
|
var import_crypto8 = __toESM(__require("crypto"), 1);
|
@@ -29935,7 +29958,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
29935
29958
|
}
|
29936
29959
|
B.fill(0);
|
29937
29960
|
}
|
29938
|
-
var Keccak2 = class
|
29961
|
+
var Keccak2 = class extends Hash2 {
|
29939
29962
|
// NOTE: we accept arguments in bytes instead of bits here.
|
29940
29963
|
constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
|
29941
29964
|
super();
|
@@ -30026,7 +30049,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30026
30049
|
}
|
30027
30050
|
_cloneInto(to) {
|
30028
30051
|
const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
|
30029
|
-
to || (to = new
|
30052
|
+
to || (to = new Keccak2(blockLen, suffix, outputLen, enableXOF, rounds));
|
30030
30053
|
to.state32.set(this.state32);
|
30031
30054
|
to.pos = this.pos;
|
30032
30055
|
to.posOut = this.posOut;
|
@@ -30414,7 +30437,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30414
30437
|
|
30415
30438
|
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/providers/plugins-network.js
|
30416
30439
|
var EnsAddress = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
|
30417
|
-
var NetworkPlugin = class
|
30440
|
+
var NetworkPlugin = class {
|
30418
30441
|
/**
|
30419
30442
|
* The name of the plugin.
|
30420
30443
|
*
|
@@ -30432,10 +30455,10 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30432
30455
|
* Creates a copy of this plugin.
|
30433
30456
|
*/
|
30434
30457
|
clone() {
|
30435
|
-
return new
|
30458
|
+
return new NetworkPlugin(this.name);
|
30436
30459
|
}
|
30437
30460
|
};
|
30438
|
-
var GasCostPlugin = class
|
30461
|
+
var GasCostPlugin = class extends NetworkPlugin {
|
30439
30462
|
/**
|
30440
30463
|
* The block number to treat these values as valid from.
|
30441
30464
|
*
|
@@ -30495,10 +30518,10 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30495
30518
|
defineProperties(this, props);
|
30496
30519
|
}
|
30497
30520
|
clone() {
|
30498
|
-
return new
|
30521
|
+
return new GasCostPlugin(this.effectiveBlock, this);
|
30499
30522
|
}
|
30500
30523
|
};
|
30501
|
-
var EnsPlugin = class
|
30524
|
+
var EnsPlugin = class extends NetworkPlugin {
|
30502
30525
|
/**
|
30503
30526
|
* The ENS Registrty Contract address.
|
30504
30527
|
*/
|
@@ -30520,7 +30543,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30520
30543
|
});
|
30521
30544
|
}
|
30522
30545
|
clone() {
|
30523
|
-
return new
|
30546
|
+
return new EnsPlugin(this.address, this.targetNetwork);
|
30524
30547
|
}
|
30525
30548
|
};
|
30526
30549
|
var FetchUrlFeeDataNetworkPlugin = class extends NetworkPlugin {
|
@@ -30555,7 +30578,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30555
30578
|
|
30556
30579
|
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/providers/network.js
|
30557
30580
|
var Networks = /* @__PURE__ */ new Map();
|
30558
|
-
var Network = class
|
30581
|
+
var Network = class {
|
30559
30582
|
#name;
|
30560
30583
|
#chainId;
|
30561
30584
|
#plugins;
|
@@ -30670,7 +30693,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30670
30693
|
* Create a copy of this Network.
|
30671
30694
|
*/
|
30672
30695
|
clone() {
|
30673
|
-
const clone4 = new
|
30696
|
+
const clone4 = new Network(this.name, this.chainId);
|
30674
30697
|
this.plugins.forEach((plugin) => {
|
30675
30698
|
clone4.attachPlugin(plugin.clone());
|
30676
30699
|
});
|
@@ -30711,7 +30734,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30711
30734
|
static from(network) {
|
30712
30735
|
injectCommonNetworks();
|
30713
30736
|
if (network == null) {
|
30714
|
-
return
|
30737
|
+
return Network.from("mainnet");
|
30715
30738
|
}
|
30716
30739
|
if (typeof network === "number") {
|
30717
30740
|
network = BigInt(network);
|
@@ -30722,7 +30745,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30722
30745
|
return networkFunc();
|
30723
30746
|
}
|
30724
30747
|
if (typeof network === "bigint") {
|
30725
|
-
return new
|
30748
|
+
return new Network("unknown", network);
|
30726
30749
|
}
|
30727
30750
|
assertArgument(false, "unknown network", "network", network);
|
30728
30751
|
}
|
@@ -30732,7 +30755,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30732
30755
|
}
|
30733
30756
|
if (typeof network === "object") {
|
30734
30757
|
assertArgument(typeof network.name === "string" && typeof network.chainId === "number", "invalid network object name or chainId", "network", network);
|
30735
|
-
const custom = new
|
30758
|
+
const custom = new Network(network.name, network.chainId);
|
30736
30759
|
if (network.ensAddress || network.ensNetwork != null) {
|
30737
30760
|
custom.attachPlugin(new EnsPlugin(network.ensAddress, network.ensNetwork));
|
30738
30761
|
}
|
@@ -31050,7 +31073,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
31050
31073
|
}
|
31051
31074
|
return address.replace("0x", "0x000000000000000000000000");
|
31052
31075
|
};
|
31053
|
-
var Address = class
|
31076
|
+
var Address = class extends AbstractAddress {
|
31054
31077
|
// #region address-2
|
31055
31078
|
bech32Address;
|
31056
31079
|
// #endregion address-2
|
@@ -31164,7 +31187,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
31164
31187
|
throw new FuelError(FuelError.CODES.INVALID_PUBLIC_KEY, `Invalid Public Key: ${publicKey}.`);
|
31165
31188
|
}
|
31166
31189
|
const b256Address = hexlify(sha256(arrayify(publicKey)));
|
31167
|
-
return new
|
31190
|
+
return new Address(toBech32(b256Address));
|
31168
31191
|
}
|
31169
31192
|
/**
|
31170
31193
|
* Takes a B256 Address and creates an `Address`
|
@@ -31179,7 +31202,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
31179
31202
|
`Invalid B256 Address: ${b256Address}.`
|
31180
31203
|
);
|
31181
31204
|
}
|
31182
|
-
return new
|
31205
|
+
return new Address(toBech32(b256Address));
|
31183
31206
|
}
|
31184
31207
|
/**
|
31185
31208
|
* Creates an `Address` with a randomized `bech32Address` property
|
@@ -31196,7 +31219,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
31196
31219
|
* @returns A new `Address` instance
|
31197
31220
|
*/
|
31198
31221
|
static fromString(address) {
|
31199
|
-
return isBech32(address) ? new
|
31222
|
+
return isBech32(address) ? new Address(address) : this.fromB256(address);
|
31200
31223
|
}
|
31201
31224
|
/**
|
31202
31225
|
* Takes an ambiguous string or address and creates an `Address`
|
@@ -31215,19 +31238,19 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
31215
31238
|
*/
|
31216
31239
|
static fromDynamicInput(address) {
|
31217
31240
|
if (typeof address !== "string" && "toB256" in address) {
|
31218
|
-
return
|
31241
|
+
return Address.fromB256(address.toB256());
|
31219
31242
|
}
|
31220
31243
|
if (isPublicKey(address)) {
|
31221
|
-
return
|
31244
|
+
return Address.fromPublicKey(address);
|
31222
31245
|
}
|
31223
31246
|
if (isBech32(address)) {
|
31224
|
-
return new
|
31247
|
+
return new Address(address);
|
31225
31248
|
}
|
31226
31249
|
if (isB256(address)) {
|
31227
|
-
return
|
31250
|
+
return Address.fromB256(address);
|
31228
31251
|
}
|
31229
31252
|
if (isEvmAddress(address)) {
|
31230
|
-
return
|
31253
|
+
return Address.fromEvmAddress(address);
|
31231
31254
|
}
|
31232
31255
|
throw new FuelError(
|
31233
31256
|
FuelError.CODES.PARSE_FAILED,
|
@@ -31247,7 +31270,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
31247
31270
|
);
|
31248
31271
|
}
|
31249
31272
|
const paddedAddress = padFirst12BytesOfEvmAddress(evmAddress);
|
31250
|
-
return new
|
31273
|
+
return new Address(toBech32(paddedAddress));
|
31251
31274
|
}
|
31252
31275
|
};
|
31253
31276
|
|
@@ -31275,12 +31298,12 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
31275
31298
|
const decimalPortion = decimals ? `.${decimals}` : "";
|
31276
31299
|
return `${units}${decimalPortion}`;
|
31277
31300
|
}
|
31278
|
-
var BN = class
|
31301
|
+
var BN = class extends import_bn.default {
|
31279
31302
|
MAX_U64 = "0xFFFFFFFFFFFFFFFF";
|
31280
31303
|
constructor(value, base, endian) {
|
31281
31304
|
let bnValue = value;
|
31282
31305
|
let bnBase = base;
|
31283
|
-
if (
|
31306
|
+
if (BN.isBN(value)) {
|
31284
31307
|
bnValue = value.toArray();
|
31285
31308
|
} else if (typeof value === "string" && value.slice(0, 2) === "0x") {
|
31286
31309
|
bnValue = value.substring(2);
|
@@ -31393,26 +31416,26 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
31393
31416
|
// END ANCHOR: OVERRIDES to accept better inputs
|
31394
31417
|
// ANCHOR: OVERRIDES to output our BN type
|
31395
31418
|
sqr() {
|
31396
|
-
return new
|
31419
|
+
return new BN(super.sqr().toArray());
|
31397
31420
|
}
|
31398
31421
|
neg() {
|
31399
|
-
return new
|
31422
|
+
return new BN(super.neg().toArray());
|
31400
31423
|
}
|
31401
31424
|
abs() {
|
31402
|
-
return new
|
31425
|
+
return new BN(super.abs().toArray());
|
31403
31426
|
}
|
31404
31427
|
toTwos(width) {
|
31405
|
-
return new
|
31428
|
+
return new BN(super.toTwos(width).toArray());
|
31406
31429
|
}
|
31407
31430
|
fromTwos(width) {
|
31408
|
-
return new
|
31431
|
+
return new BN(super.fromTwos(width).toArray());
|
31409
31432
|
}
|
31410
31433
|
// END ANCHOR: OVERRIDES to output our BN type
|
31411
31434
|
// ANCHOR: OVERRIDES to avoid losing references
|
31412
31435
|
caller(v, methodName) {
|
31413
|
-
const output3 = super[methodName](new
|
31414
|
-
if (
|
31415
|
-
return new
|
31436
|
+
const output3 = super[methodName](new BN(v));
|
31437
|
+
if (BN.isBN(output3)) {
|
31438
|
+
return new BN(output3.toArray());
|
31416
31439
|
}
|
31417
31440
|
if (typeof output3 === "boolean") {
|
31418
31441
|
return output3;
|
@@ -31420,32 +31443,32 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
31420
31443
|
return output3;
|
31421
31444
|
}
|
31422
31445
|
clone() {
|
31423
|
-
return new
|
31446
|
+
return new BN(this.toArray());
|
31424
31447
|
}
|
31425
31448
|
mulTo(num, out) {
|
31426
31449
|
const output3 = new import_bn.default(this.toArray()).mulTo(num, out);
|
31427
|
-
return new
|
31450
|
+
return new BN(output3.toArray());
|
31428
31451
|
}
|
31429
31452
|
egcd(p) {
|
31430
31453
|
const { a, b, gcd } = new import_bn.default(this.toArray()).egcd(p);
|
31431
31454
|
return {
|
31432
|
-
a: new
|
31433
|
-
b: new
|
31434
|
-
gcd: new
|
31455
|
+
a: new BN(a.toArray()),
|
31456
|
+
b: new BN(b.toArray()),
|
31457
|
+
gcd: new BN(gcd.toArray())
|
31435
31458
|
};
|
31436
31459
|
}
|
31437
31460
|
divmod(num, mode, positive) {
|
31438
|
-
const { div, mod: mod2 } = new import_bn.default(this.toArray()).divmod(new
|
31461
|
+
const { div, mod: mod2 } = new import_bn.default(this.toArray()).divmod(new BN(num), mode, positive);
|
31439
31462
|
return {
|
31440
|
-
div: new
|
31441
|
-
mod: new
|
31463
|
+
div: new BN(div?.toArray()),
|
31464
|
+
mod: new BN(mod2?.toArray())
|
31442
31465
|
};
|
31443
31466
|
}
|
31444
31467
|
maxU64() {
|
31445
|
-
return this.gte(this.MAX_U64) ? new
|
31468
|
+
return this.gte(this.MAX_U64) ? new BN(this.MAX_U64) : this;
|
31446
31469
|
}
|
31447
31470
|
normalizeZeroToOne() {
|
31448
|
-
return this.isZero() ? new
|
31471
|
+
return this.isZero() ? new BN(1) : this;
|
31449
31472
|
}
|
31450
31473
|
// END ANCHOR: OVERRIDES to avoid losing references
|
31451
31474
|
};
|
@@ -31530,6 +31553,25 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
31530
31553
|
}
|
31531
31554
|
|
31532
31555
|
// ../abi-coder/dist/index.mjs
|
31556
|
+
var __defProp4 = Object.defineProperty;
|
31557
|
+
var __defNormalProp4 = (obj, key, value) => key in obj ? __defProp4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
31558
|
+
var __publicField4 = (obj, key, value) => {
|
31559
|
+
__defNormalProp4(obj, typeof key !== "symbol" ? key + "" : key, value);
|
31560
|
+
return value;
|
31561
|
+
};
|
31562
|
+
var __accessCheck2 = (obj, member, msg) => {
|
31563
|
+
if (!member.has(obj))
|
31564
|
+
throw TypeError("Cannot " + msg);
|
31565
|
+
};
|
31566
|
+
var __privateAdd2 = (obj, member, value) => {
|
31567
|
+
if (member.has(obj))
|
31568
|
+
throw TypeError("Cannot add the same private member more than once");
|
31569
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
31570
|
+
};
|
31571
|
+
var __privateMethod2 = (obj, member, method) => {
|
31572
|
+
__accessCheck2(obj, member, "access private method");
|
31573
|
+
return method;
|
31574
|
+
};
|
31533
31575
|
var Coder = class {
|
31534
31576
|
name;
|
31535
31577
|
type;
|
@@ -31868,10 +31910,12 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
31868
31910
|
return [true, offset + this.paddingLength];
|
31869
31911
|
}
|
31870
31912
|
};
|
31913
|
+
var _getPaddedData;
|
31914
|
+
var getPaddedData_fn;
|
31871
31915
|
var ByteCoder = class extends Coder {
|
31872
|
-
static memorySize = 1;
|
31873
31916
|
constructor() {
|
31874
31917
|
super("struct", "struct Bytes", BASE_VECTOR_OFFSET);
|
31918
|
+
__privateAdd2(this, _getPaddedData);
|
31875
31919
|
}
|
31876
31920
|
encode(value) {
|
31877
31921
|
if (!Array.isArray(value)) {
|
@@ -31879,7 +31923,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
31879
31923
|
}
|
31880
31924
|
const parts = [];
|
31881
31925
|
const pointer = new BigNumberCoder("u64").encode(BASE_VECTOR_OFFSET);
|
31882
|
-
const data = this
|
31926
|
+
const data = __privateMethod2(this, _getPaddedData, getPaddedData_fn).call(this, value);
|
31883
31927
|
pointer.dynamicData = {
|
31884
31928
|
0: concatWithDynamicData([data])
|
31885
31929
|
};
|
@@ -31888,14 +31932,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
31888
31932
|
parts.push(new BigNumberCoder("u64").encode(value.length));
|
31889
31933
|
return concatWithDynamicData(parts);
|
31890
31934
|
}
|
31891
|
-
#getPaddedData(value) {
|
31892
|
-
const data = [Uint8Array.from(value)];
|
31893
|
-
const paddingLength = (WORD_SIZE - value.length % WORD_SIZE) % WORD_SIZE;
|
31894
|
-
if (paddingLength) {
|
31895
|
-
data.push(new Uint8Array(paddingLength));
|
31896
|
-
}
|
31897
|
-
return concat(data);
|
31898
|
-
}
|
31899
31935
|
decode(data, offset) {
|
31900
31936
|
if (data.length < BASE_VECTOR_OFFSET) {
|
31901
31937
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid byte data size.`);
|
@@ -31909,6 +31945,16 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
31909
31945
|
return [byteData, offset + BASE_VECTOR_OFFSET];
|
31910
31946
|
}
|
31911
31947
|
};
|
31948
|
+
_getPaddedData = /* @__PURE__ */ new WeakSet();
|
31949
|
+
getPaddedData_fn = function(value) {
|
31950
|
+
const data = [Uint8Array.from(value)];
|
31951
|
+
const paddingLength = (WORD_SIZE - value.length % WORD_SIZE) % WORD_SIZE;
|
31952
|
+
if (paddingLength) {
|
31953
|
+
data.push(new Uint8Array(paddingLength));
|
31954
|
+
}
|
31955
|
+
return concat(data);
|
31956
|
+
};
|
31957
|
+
__publicField4(ByteCoder, "memorySize", 1);
|
31912
31958
|
var isFullyNativeEnum = (enumCoders) => Object.values(enumCoders).every(
|
31913
31959
|
// @ts-expect-error complicated types
|
31914
31960
|
({ type: type3, coders }) => type3 === "()" && JSON.stringify(coders) === JSON.stringify([])
|
@@ -32107,15 +32153,17 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32107
32153
|
return [decodedValue, offset + dataBytes.length];
|
32108
32154
|
}
|
32109
32155
|
};
|
32156
|
+
var _getPaddedData2;
|
32157
|
+
var getPaddedData_fn2;
|
32110
32158
|
var StdStringCoder = class extends Coder {
|
32111
|
-
static memorySize = 1;
|
32112
32159
|
constructor() {
|
32113
32160
|
super("struct", "struct String", 1);
|
32161
|
+
__privateAdd2(this, _getPaddedData2);
|
32114
32162
|
}
|
32115
32163
|
encode(value) {
|
32116
32164
|
const parts = [];
|
32117
32165
|
const pointer = new BigNumberCoder("u64").encode(BASE_VECTOR_OFFSET);
|
32118
|
-
const data = this
|
32166
|
+
const data = __privateMethod2(this, _getPaddedData2, getPaddedData_fn2).call(this, value);
|
32119
32167
|
pointer.dynamicData = {
|
32120
32168
|
0: concatWithDynamicData([data])
|
32121
32169
|
};
|
@@ -32124,14 +32172,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32124
32172
|
parts.push(new BigNumberCoder("u64").encode(value.length));
|
32125
32173
|
return concatWithDynamicData(parts);
|
32126
32174
|
}
|
32127
|
-
#getPaddedData(value) {
|
32128
|
-
const data = [toUtf8Bytes(value)];
|
32129
|
-
const paddingLength = (WORD_SIZE - value.length % WORD_SIZE) % WORD_SIZE;
|
32130
|
-
if (paddingLength) {
|
32131
|
-
data.push(new Uint8Array(paddingLength));
|
32132
|
-
}
|
32133
|
-
return concat(data);
|
32134
|
-
}
|
32135
32175
|
decode(data, offset) {
|
32136
32176
|
if (data.length < this.encodedLength) {
|
32137
32177
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid std string data size.`);
|
@@ -32146,6 +32186,16 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32146
32186
|
return [value, offset + BASE_VECTOR_OFFSET];
|
32147
32187
|
}
|
32148
32188
|
};
|
32189
|
+
_getPaddedData2 = /* @__PURE__ */ new WeakSet();
|
32190
|
+
getPaddedData_fn2 = function(value) {
|
32191
|
+
const data = [toUtf8Bytes(value)];
|
32192
|
+
const paddingLength = (WORD_SIZE - value.length % WORD_SIZE) % WORD_SIZE;
|
32193
|
+
if (paddingLength) {
|
32194
|
+
data.push(new Uint8Array(paddingLength));
|
32195
|
+
}
|
32196
|
+
return concat(data);
|
32197
|
+
};
|
32198
|
+
__publicField4(StdStringCoder, "memorySize", 1);
|
32149
32199
|
var StringCoder = class extends Coder {
|
32150
32200
|
length;
|
32151
32201
|
#paddingLength;
|
@@ -32301,7 +32351,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32301
32351
|
];
|
32302
32352
|
}
|
32303
32353
|
};
|
32304
|
-
var ResolvedAbiType = class
|
32354
|
+
var ResolvedAbiType = class {
|
32305
32355
|
abi;
|
32306
32356
|
name;
|
32307
32357
|
type;
|
@@ -32325,11 +32375,11 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32325
32375
|
this.name = argument.name;
|
32326
32376
|
this.type = type3.type;
|
32327
32377
|
this.originalTypeArguments = argument.typeArguments;
|
32328
|
-
this.components =
|
32378
|
+
this.components = ResolvedAbiType.getResolvedGenericComponents(
|
32329
32379
|
abi,
|
32330
32380
|
argument,
|
32331
32381
|
type3.components,
|
32332
|
-
type3.typeParameters ??
|
32382
|
+
type3.typeParameters ?? ResolvedAbiType.getImplicitGenericTypeParameters(abi, type3.components)
|
32333
32383
|
);
|
32334
32384
|
}
|
32335
32385
|
static getResolvedGenericComponents(abi, arg, components, typeParameters) {
|
@@ -32337,7 +32387,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32337
32387
|
return null;
|
32338
32388
|
}
|
32339
32389
|
if (typeParameters === null || typeParameters.length === 0) {
|
32340
|
-
return components.map((c) => new
|
32390
|
+
return components.map((c) => new ResolvedAbiType(abi, c));
|
32341
32391
|
}
|
32342
32392
|
const typeParametersAndArgsMap = typeParameters.reduce(
|
32343
32393
|
(obj, typeParameter, typeParameterIndex) => {
|
@@ -32354,7 +32404,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32354
32404
|
components,
|
32355
32405
|
typeParametersAndArgsMap
|
32356
32406
|
);
|
32357
|
-
return resolvedComponents.map((c) => new
|
32407
|
+
return resolvedComponents.map((c) => new ResolvedAbiType(abi, c));
|
32358
32408
|
}
|
32359
32409
|
static resolveGenericArgTypes(abi, args, typeParametersAndArgsMap) {
|
32360
32410
|
return args.map((arg) => {
|
@@ -32441,7 +32491,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32441
32491
|
if (arrayMatch) {
|
32442
32492
|
return `[${this.components[0].getSignature()};${arrayMatch.length}]`;
|
32443
32493
|
}
|
32444
|
-
const typeArgumentsSignature = this.originalTypeArguments !== null ? `<${this.originalTypeArguments.map((a) => new
|
32494
|
+
const typeArgumentsSignature = this.originalTypeArguments !== null ? `<${this.originalTypeArguments.map((a) => new ResolvedAbiType(this.abi, a).getSignature()).join(",")}>` : "";
|
32445
32495
|
const componentsSignature = `(${this.components.map((c) => c.getSignature()).join(",")})`;
|
32446
32496
|
return `${typeArgumentsSignature}${componentsSignature}`;
|
32447
32497
|
}
|
@@ -32569,7 +32619,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32569
32619
|
}
|
32570
32620
|
};
|
32571
32621
|
var ByteCoder2 = class extends Coder {
|
32572
|
-
static memorySize = 1;
|
32573
32622
|
constructor() {
|
32574
32623
|
super("struct", "struct Bytes", WORD_SIZE);
|
32575
32624
|
}
|
@@ -32595,6 +32644,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32595
32644
|
return [dataBytes, offsetAndLength + length];
|
32596
32645
|
}
|
32597
32646
|
};
|
32647
|
+
__publicField4(ByteCoder2, "memorySize", 1);
|
32598
32648
|
var isFullyNativeEnum2 = (enumCoders) => Object.values(enumCoders).every(
|
32599
32649
|
// @ts-expect-error complicated types
|
32600
32650
|
({ type: type3, coders }) => type3 === "()" && JSON.stringify(coders) === JSON.stringify([])
|
@@ -32738,7 +32788,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32738
32788
|
}
|
32739
32789
|
};
|
32740
32790
|
var StdStringCoder2 = class extends Coder {
|
32741
|
-
static memorySize = 1;
|
32742
32791
|
constructor() {
|
32743
32792
|
super("struct", "struct String", WORD_SIZE);
|
32744
32793
|
}
|
@@ -32761,6 +32810,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32761
32810
|
return [toUtf8String(dataBytes), offsetAndLength + length];
|
32762
32811
|
}
|
32763
32812
|
};
|
32813
|
+
__publicField4(StdStringCoder2, "memorySize", 1);
|
32764
32814
|
var StringCoder2 = class extends Coder {
|
32765
32815
|
constructor(length) {
|
32766
32816
|
super("string", `str[${length}]`, length);
|
@@ -33000,7 +33050,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
33000
33050
|
return this.getCoder(abi, argument, options).decode(data, offset);
|
33001
33051
|
}
|
33002
33052
|
};
|
33003
|
-
var FunctionFragment = class
|
33053
|
+
var FunctionFragment = class {
|
33004
33054
|
signature;
|
33005
33055
|
selector;
|
33006
33056
|
name;
|
@@ -33013,8 +33063,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
33013
33063
|
this.jsonAbi = jsonAbi;
|
33014
33064
|
this.jsonFn = findOrThrow(this.jsonAbi.functions, (f2) => f2.name === name);
|
33015
33065
|
this.name = name;
|
33016
|
-
this.signature =
|
33017
|
-
this.selector =
|
33066
|
+
this.signature = FunctionFragment.getSignature(this.jsonAbi, this.jsonFn);
|
33067
|
+
this.selector = FunctionFragment.getFunctionSelector(this.signature);
|
33018
33068
|
this.isInputDataPointer = this.#isInputDataPointer();
|
33019
33069
|
this.outputMetadata = {
|
33020
33070
|
isHeapType: this.#isOutputDataHeap(),
|
@@ -33057,7 +33107,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
33057
33107
|
}
|
33058
33108
|
}
|
33059
33109
|
encodeArguments(values, offset = 0) {
|
33060
|
-
|
33110
|
+
FunctionFragment.verifyArgsAndInputsAlign(values, this.jsonFn.inputs, this.jsonAbi);
|
33061
33111
|
const shallowCopyValues = values.slice();
|
33062
33112
|
const nonEmptyInputs = this.jsonFn.inputs.filter(
|
33063
33113
|
(x) => findOrThrow(this.jsonAbi.types, (t) => t.typeId === x.type).type !== "()"
|
@@ -33408,7 +33458,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
33408
33458
|
];
|
33409
33459
|
}
|
33410
33460
|
};
|
33411
|
-
var InputMessageCoder = class
|
33461
|
+
var InputMessageCoder = class extends Coder {
|
33412
33462
|
constructor() {
|
33413
33463
|
super("InputMessage", "struct InputMessage", 0);
|
33414
33464
|
}
|
@@ -33428,7 +33478,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
33428
33478
|
}
|
33429
33479
|
encode(value) {
|
33430
33480
|
const parts = [];
|
33431
|
-
const data =
|
33481
|
+
const data = InputMessageCoder.encodeData(value.data);
|
33432
33482
|
parts.push(new ByteArrayCoder(32).encode(value.sender));
|
33433
33483
|
parts.push(new ByteArrayCoder(32).encode(value.recipient));
|
33434
33484
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
@@ -33872,7 +33922,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
33872
33922
|
ReceiptType2[ReceiptType2["Burn"] = 12] = "Burn";
|
33873
33923
|
return ReceiptType2;
|
33874
33924
|
})(ReceiptType || {});
|
33875
|
-
var ReceiptMessageOutCoder = class
|
33925
|
+
var ReceiptMessageOutCoder = class extends Coder {
|
33876
33926
|
constructor() {
|
33877
33927
|
super("ReceiptMessageOut", "struct ReceiptMessageOut", 0);
|
33878
33928
|
}
|
@@ -33923,7 +33973,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
33923
33973
|
digest,
|
33924
33974
|
data: messageData
|
33925
33975
|
};
|
33926
|
-
receiptMessageOut.messageId =
|
33976
|
+
receiptMessageOut.messageId = ReceiptMessageOutCoder.getMessageId(receiptMessageOut);
|
33927
33977
|
return [receiptMessageOut, o];
|
33928
33978
|
}
|
33929
33979
|
};
|
@@ -33932,7 +33982,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
33932
33982
|
const subIdBytes = arrayify(subId);
|
33933
33983
|
return sha2563(concat([contractIdBytes, subIdBytes]));
|
33934
33984
|
};
|
33935
|
-
var ReceiptMintCoder = class
|
33985
|
+
var ReceiptMintCoder = class extends Coder {
|
33936
33986
|
constructor() {
|
33937
33987
|
super("ReceiptMint", "struct ReceiptMint", 0);
|
33938
33988
|
}
|
@@ -33961,7 +34011,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
33961
34011
|
const pc = decoded;
|
33962
34012
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
33963
34013
|
const is = decoded;
|
33964
|
-
const assetId =
|
34014
|
+
const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
|
33965
34015
|
const receiptMint = {
|
33966
34016
|
type: 11,
|
33967
34017
|
subId,
|
@@ -34820,7 +34870,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34820
34870
|
}
|
34821
34871
|
return firstArg;
|
34822
34872
|
}
|
34823
|
-
var GraphQLError = class
|
34873
|
+
var GraphQLError = class extends Error {
|
34824
34874
|
/**
|
34825
34875
|
* An array of `{ line, column }` locations within the source GraphQL document
|
34826
34876
|
* which correspond to this error.
|
@@ -34907,7 +34957,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34907
34957
|
configurable: true
|
34908
34958
|
});
|
34909
34959
|
} else if (Error.captureStackTrace) {
|
34910
|
-
Error.captureStackTrace(this,
|
34960
|
+
Error.captureStackTrace(this, GraphQLError);
|
34911
34961
|
} else {
|
34912
34962
|
Object.defineProperty(this, "stack", {
|
34913
34963
|
value: Error().stack,
|
@@ -38671,12 +38721,11 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
38671
38721
|
}
|
38672
38722
|
|
38673
38723
|
// src/providers/fuel-graphql-subscriber.ts
|
38674
|
-
var
|
38724
|
+
var _FuelGraphqlSubscriber = class {
|
38675
38725
|
constructor(options) {
|
38676
38726
|
this.options = options;
|
38677
38727
|
}
|
38678
38728
|
stream;
|
38679
|
-
static textDecoder = new TextDecoder();
|
38680
38729
|
async setStream() {
|
38681
38730
|
const { url, query, variables, fetchFn } = this.options;
|
38682
38731
|
const response = await fetchFn(`${url}-sub`, {
|
@@ -38736,6 +38785,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
38736
38785
|
return this;
|
38737
38786
|
}
|
38738
38787
|
};
|
38788
|
+
var FuelGraphqlSubscriber = _FuelGraphqlSubscriber;
|
38789
|
+
__publicField(FuelGraphqlSubscriber, "textDecoder", new TextDecoder());
|
38739
38790
|
|
38740
38791
|
// src/providers/memory-cache.ts
|
38741
38792
|
var cache = {};
|
@@ -39334,7 +39385,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
39334
39385
|
};
|
39335
39386
|
|
39336
39387
|
// src/providers/transaction-request/transaction-request.ts
|
39337
|
-
var BaseTransactionRequest = class
|
39388
|
+
var BaseTransactionRequest = class {
|
39338
39389
|
/** Gas price for transaction */
|
39339
39390
|
gasPrice;
|
39340
39391
|
/** Block until which tx cannot be included */
|
@@ -39404,7 +39455,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
39404
39455
|
const inputs = this.inputs?.map(inputify) ?? [];
|
39405
39456
|
const outputs = this.outputs?.map(outputify) ?? [];
|
39406
39457
|
const witnesses = this.witnesses?.map(witnessify) ?? [];
|
39407
|
-
const { policyTypes, policies } =
|
39458
|
+
const { policyTypes, policies } = BaseTransactionRequest.getPolicyMeta(this);
|
39408
39459
|
return {
|
39409
39460
|
policyTypes,
|
39410
39461
|
inputs,
|
@@ -39442,13 +39493,27 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
39442
39493
|
this.outputs.push(output3);
|
39443
39494
|
return this.outputs.length - 1;
|
39444
39495
|
}
|
39496
|
+
/**
|
39497
|
+
* @hidden
|
39498
|
+
*
|
39499
|
+
* Pushes a witness to the list and returns the index
|
39500
|
+
*
|
39501
|
+
* @param signature - The signature to add to the witness.
|
39502
|
+
* @returns The index of the created witness.
|
39503
|
+
*/
|
39504
|
+
addWitness(signature) {
|
39505
|
+
this.witnesses.push(signature);
|
39506
|
+
return this.witnesses.length - 1;
|
39507
|
+
}
|
39445
39508
|
/**
|
39446
39509
|
* @hidden
|
39447
39510
|
*
|
39448
39511
|
* Creates an empty witness without any side effects and returns the index
|
39512
|
+
*
|
39513
|
+
* @returns The index of the created witness.
|
39449
39514
|
*/
|
39450
|
-
|
39451
|
-
this.
|
39515
|
+
addEmptyWitness() {
|
39516
|
+
this.addWitness(concat([ZeroBytes32, ZeroBytes32]));
|
39452
39517
|
return this.witnesses.length - 1;
|
39453
39518
|
}
|
39454
39519
|
/**
|
@@ -39477,6 +39542,21 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
39477
39542
|
}
|
39478
39543
|
this.witnesses[index] = witness;
|
39479
39544
|
}
|
39545
|
+
/**
|
39546
|
+
* Helper function to add an external signature to the transaction.
|
39547
|
+
*
|
39548
|
+
* @param account - The account/s to sign to the transaction.
|
39549
|
+
* @returns The transaction with the signature witness added.
|
39550
|
+
*/
|
39551
|
+
async addAccountWitnesses(account) {
|
39552
|
+
const accounts = Array.isArray(account) ? account : [account];
|
39553
|
+
await Promise.all(
|
39554
|
+
accounts.map(async (acc) => {
|
39555
|
+
this.addWitness(await acc.signTransaction(this));
|
39556
|
+
})
|
39557
|
+
);
|
39558
|
+
return this;
|
39559
|
+
}
|
39480
39560
|
/**
|
39481
39561
|
* Gets the coin inputs for a transaction.
|
39482
39562
|
*
|
@@ -39542,7 +39622,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
39542
39622
|
} else {
|
39543
39623
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
|
39544
39624
|
if (typeof witnessIndex !== "number") {
|
39545
|
-
witnessIndex = this.
|
39625
|
+
witnessIndex = this.addEmptyWitness();
|
39546
39626
|
}
|
39547
39627
|
}
|
39548
39628
|
const input = {
|
@@ -39576,7 +39656,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
39576
39656
|
} else {
|
39577
39657
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
|
39578
39658
|
if (typeof witnessIndex !== "number") {
|
39579
|
-
witnessIndex = this.
|
39659
|
+
witnessIndex = this.addEmptyWitness();
|
39580
39660
|
}
|
39581
39661
|
}
|
39582
39662
|
const input = {
|
@@ -40940,7 +41020,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
40940
41020
|
}
|
40941
41021
|
|
40942
41022
|
// src/providers/transaction-response/transaction-response.ts
|
40943
|
-
var TransactionResponse2 = class
|
41023
|
+
var TransactionResponse2 = class {
|
40944
41024
|
/** Transaction ID */
|
40945
41025
|
id;
|
40946
41026
|
/** Current provider */
|
@@ -40968,7 +41048,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
40968
41048
|
* @param provider - The provider.
|
40969
41049
|
*/
|
40970
41050
|
static async create(id, provider) {
|
40971
|
-
const response = new
|
41051
|
+
const response = new TransactionResponse2(id, provider);
|
40972
41052
|
await response.fetch();
|
40973
41053
|
return response;
|
40974
41054
|
}
|
@@ -41194,7 +41274,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
41194
41274
|
}
|
41195
41275
|
};
|
41196
41276
|
};
|
41197
|
-
var
|
41277
|
+
var _cacheInputs, cacheInputs_fn;
|
41278
|
+
var _Provider = class {
|
41198
41279
|
/**
|
41199
41280
|
* Constructor to initialize a Provider.
|
41200
41281
|
*
|
@@ -41205,25 +41286,27 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
41205
41286
|
*/
|
41206
41287
|
constructor(url, options = {}) {
|
41207
41288
|
this.url = url;
|
41289
|
+
/**
|
41290
|
+
* @hidden
|
41291
|
+
*/
|
41292
|
+
__privateAdd(this, _cacheInputs);
|
41293
|
+
__publicField(this, "operations");
|
41294
|
+
__publicField(this, "cache");
|
41295
|
+
__publicField(this, "options", {
|
41296
|
+
timeout: void 0,
|
41297
|
+
cacheUtxo: void 0,
|
41298
|
+
fetch: void 0,
|
41299
|
+
retryOptions: void 0
|
41300
|
+
});
|
41208
41301
|
this.options = { ...this.options, ...options };
|
41209
41302
|
this.url = url;
|
41210
41303
|
this.operations = this.createOperations();
|
41211
41304
|
this.cache = options.cacheUtxo ? new MemoryCache(options.cacheUtxo) : void 0;
|
41212
41305
|
}
|
41213
|
-
operations;
|
41214
|
-
cache;
|
41215
41306
|
static clearChainAndNodeCaches() {
|
41216
41307
|
_Provider.nodeInfoCache = {};
|
41217
41308
|
_Provider.chainInfoCache = {};
|
41218
41309
|
}
|
41219
|
-
static chainInfoCache = {};
|
41220
|
-
static nodeInfoCache = {};
|
41221
|
-
options = {
|
41222
|
-
timeout: void 0,
|
41223
|
-
cacheUtxo: void 0,
|
41224
|
-
fetch: void 0,
|
41225
|
-
retryOptions: void 0
|
41226
|
-
};
|
41227
41310
|
static getFetchFn(options) {
|
41228
41311
|
const { retryOptions, timeout } = options;
|
41229
41312
|
return autoRetryFetch(async (...args) => {
|
@@ -41420,19 +41503,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
41420
41503
|
} = this.getChain();
|
41421
41504
|
return chainId.toNumber();
|
41422
41505
|
}
|
41423
|
-
/**
|
41424
|
-
* @hidden
|
41425
|
-
*/
|
41426
|
-
#cacheInputs(inputs) {
|
41427
|
-
if (!this.cache) {
|
41428
|
-
return;
|
41429
|
-
}
|
41430
|
-
inputs.forEach((input) => {
|
41431
|
-
if (input.type === InputType.Coin) {
|
41432
|
-
this.cache?.set(input.id);
|
41433
|
-
}
|
41434
|
-
});
|
41435
|
-
}
|
41436
41506
|
/**
|
41437
41507
|
* Submits a transaction to the chain to be executed.
|
41438
41508
|
*
|
@@ -41445,7 +41515,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
41445
41515
|
// #region Provider-sendTransaction
|
41446
41516
|
async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution = false } = {}) {
|
41447
41517
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
41448
|
-
this
|
41518
|
+
__privateMethod(this, _cacheInputs, cacheInputs_fn).call(this, transactionRequest.inputs);
|
41449
41519
|
if (estimateTxDependencies) {
|
41450
41520
|
await this.estimateTxDependencies(transactionRequest);
|
41451
41521
|
}
|
@@ -41622,7 +41692,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
41622
41692
|
async getTransactionCost(transactionRequestLike, forwardingQuantities = [], {
|
41623
41693
|
estimateTxDependencies = true,
|
41624
41694
|
estimatePredicates = true,
|
41625
|
-
resourcesOwner
|
41695
|
+
resourcesOwner,
|
41696
|
+
signatureCallback
|
41626
41697
|
} = {}) {
|
41627
41698
|
const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
|
41628
41699
|
const chainInfo = this.getChain();
|
@@ -41641,6 +41712,9 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
41641
41712
|
}
|
41642
41713
|
await this.estimatePredicates(txRequestClone);
|
41643
41714
|
}
|
41715
|
+
if (signatureCallback && isScriptTransaction) {
|
41716
|
+
await signatureCallback(txRequestClone);
|
41717
|
+
}
|
41644
41718
|
const minGas = txRequestClone.calculateMinGas(chainInfo);
|
41645
41719
|
const maxGas = txRequestClone.calculateMaxGas(chainInfo, minGas);
|
41646
41720
|
let receipts = [];
|
@@ -42070,6 +42144,20 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42070
42144
|
return new TransactionResponse2(transactionId, this);
|
42071
42145
|
}
|
42072
42146
|
};
|
42147
|
+
var Provider = _Provider;
|
42148
|
+
_cacheInputs = new WeakSet();
|
42149
|
+
cacheInputs_fn = function(inputs) {
|
42150
|
+
if (!this.cache) {
|
42151
|
+
return;
|
42152
|
+
}
|
42153
|
+
inputs.forEach((input) => {
|
42154
|
+
if (input.type === InputType.Coin) {
|
42155
|
+
this.cache?.set(input.id);
|
42156
|
+
}
|
42157
|
+
});
|
42158
|
+
};
|
42159
|
+
__publicField(Provider, "chainInfoCache", {});
|
42160
|
+
__publicField(Provider, "nodeInfoCache", {});
|
42073
42161
|
|
42074
42162
|
// src/providers/transaction-summary/get-transaction-summary.ts
|
42075
42163
|
async function getTransactionSummary(params) {
|
@@ -42667,6 +42755,21 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42667
42755
|
}
|
42668
42756
|
return this._connector.signMessage(this.address.toString(), message);
|
42669
42757
|
}
|
42758
|
+
/**
|
42759
|
+
* Signs a transaction with the wallet's private key.
|
42760
|
+
*
|
42761
|
+
* @param transactionRequestLike - The transaction request to sign.
|
42762
|
+
* @returns A promise that resolves to the signature of the transaction.
|
42763
|
+
*/
|
42764
|
+
async signTransaction(transactionRequestLike) {
|
42765
|
+
if (!this._connector) {
|
42766
|
+
throw new FuelError(
|
42767
|
+
ErrorCode.MISSING_CONNECTOR,
|
42768
|
+
"A connector is required to sign transactions."
|
42769
|
+
);
|
42770
|
+
}
|
42771
|
+
return this._connector.signTransaction(this.address.toString(), transactionRequestLike);
|
42772
|
+
}
|
42670
42773
|
/**
|
42671
42774
|
* Sends a transaction to the network.
|
42672
42775
|
*
|
@@ -43992,7 +44095,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
43992
44095
|
var Point = secp256k1.ProjectivePoint;
|
43993
44096
|
|
43994
44097
|
// src/signer/signer.ts
|
43995
|
-
var Signer = class
|
44098
|
+
var Signer = class {
|
43996
44099
|
address;
|
43997
44100
|
publicKey;
|
43998
44101
|
compressedPublicKey;
|
@@ -44071,7 +44174,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
44071
44174
|
* @returns Address from signature
|
44072
44175
|
*/
|
44073
44176
|
static recoverAddress(data, signature) {
|
44074
|
-
return Address.fromPublicKey(
|
44177
|
+
return Address.fromPublicKey(Signer.recoverPublicKey(data, signature));
|
44075
44178
|
}
|
44076
44179
|
/**
|
44077
44180
|
* Generate a random privateKey
|
@@ -44229,10 +44332,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
44229
44332
|
|
44230
44333
|
// src/wallet/base-wallet-unlocked.ts
|
44231
44334
|
var BaseWalletUnlocked = class extends Account {
|
44232
|
-
/**
|
44233
|
-
* Default HDWallet path.
|
44234
|
-
*/
|
44235
|
-
static defaultPath = "m/44'/1179993420'/0'/0/0";
|
44236
44335
|
/**
|
44237
44336
|
* A function that returns the wallet's signer.
|
44238
44337
|
*/
|
@@ -44282,7 +44381,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
44282
44381
|
*/
|
44283
44382
|
async signTransaction(transactionRequestLike) {
|
44284
44383
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
44285
|
-
const chainId = this.provider.
|
44384
|
+
const chainId = this.provider.getChainId();
|
44286
44385
|
const hashedTransaction = transactionRequest.getTransactionId(chainId);
|
44287
44386
|
const signature = await this.signer().sign(hashedTransaction);
|
44288
44387
|
return hexlify(signature);
|
@@ -44338,6 +44437,10 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
44338
44437
|
return encryptKeystoreWallet(this.privateKey, this.address, password);
|
44339
44438
|
}
|
44340
44439
|
};
|
44440
|
+
/**
|
44441
|
+
* Default HDWallet path.
|
44442
|
+
*/
|
44443
|
+
__publicField(BaseWalletUnlocked, "defaultPath", "m/44'/1179993420'/0'/0/0");
|
44341
44444
|
|
44342
44445
|
// src/wordlists/words/english.ts
|
44343
44446
|
var english = [
|
@@ -46530,7 +46633,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46530
46633
|
throw new FuelError(ErrorCode.INVALID_MNEMONIC, errorMsg);
|
46531
46634
|
}
|
46532
46635
|
}
|
46533
|
-
var Mnemonic = class
|
46636
|
+
var Mnemonic = class {
|
46534
46637
|
wordlist;
|
46535
46638
|
/**
|
46536
46639
|
*
|
@@ -46547,7 +46650,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46547
46650
|
* @returns Entropy hash
|
46548
46651
|
*/
|
46549
46652
|
mnemonicToEntropy(phrase) {
|
46550
|
-
return
|
46653
|
+
return Mnemonic.mnemonicToEntropy(phrase, this.wordlist);
|
46551
46654
|
}
|
46552
46655
|
/**
|
46553
46656
|
*
|
@@ -46555,7 +46658,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46555
46658
|
* @returns Mnemonic phrase
|
46556
46659
|
*/
|
46557
46660
|
entropyToMnemonic(entropy) {
|
46558
|
-
return
|
46661
|
+
return Mnemonic.entropyToMnemonic(entropy, this.wordlist);
|
46559
46662
|
}
|
46560
46663
|
/**
|
46561
46664
|
*
|
@@ -46596,8 +46699,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46596
46699
|
* @returns 64-byte array contains privateKey and chainCode as described on BIP39
|
46597
46700
|
*/
|
46598
46701
|
static mnemonicToMasterKeys(phrase, passphrase = "") {
|
46599
|
-
const seed =
|
46600
|
-
return
|
46702
|
+
const seed = Mnemonic.mnemonicToSeed(phrase, passphrase);
|
46703
|
+
return Mnemonic.masterKeysFromSeed(seed);
|
46601
46704
|
}
|
46602
46705
|
/**
|
46603
46706
|
* Validates if given mnemonic is valid
|
@@ -46613,7 +46716,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46613
46716
|
return false;
|
46614
46717
|
}
|
46615
46718
|
while (i < words.length) {
|
46616
|
-
if (
|
46719
|
+
if (Mnemonic.binarySearch(words[i]) === false) {
|
46617
46720
|
return false;
|
46618
46721
|
}
|
46619
46722
|
i += 1;
|
@@ -46660,7 +46763,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46660
46763
|
* @returns BIP-32 extended private key
|
46661
46764
|
*/
|
46662
46765
|
static seedToExtendedKey(seed, testnet = false) {
|
46663
|
-
const masterKey =
|
46766
|
+
const masterKey = Mnemonic.masterKeysFromSeed(seed);
|
46664
46767
|
const prefix = arrayify(testnet ? TestnetPRV : MainnetPRV);
|
46665
46768
|
const depth = "0x00";
|
46666
46769
|
const fingerprint = "0x00000000";
|
@@ -46692,7 +46795,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46692
46795
|
*/
|
46693
46796
|
static generate(size = 32, extraEntropy = "") {
|
46694
46797
|
const entropy = extraEntropy ? sha2563(concat([randomBytes22(size), arrayify(extraEntropy)])) : randomBytes22(size);
|
46695
|
-
return
|
46798
|
+
return Mnemonic.entropyToMnemonic(entropy);
|
46696
46799
|
}
|
46697
46800
|
};
|
46698
46801
|
var mnemonic_default = Mnemonic;
|
@@ -46732,7 +46835,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46732
46835
|
(p) => ~p.indexOf(`'`) ? parseInt(p, 10) + HARDENED_INDEX : parseInt(p, 10)
|
46733
46836
|
);
|
46734
46837
|
}
|
46735
|
-
var HDWallet = class
|
46838
|
+
var HDWallet = class {
|
46736
46839
|
depth = 0;
|
46737
46840
|
index = 0;
|
46738
46841
|
fingerprint = hexlify("0x00000000");
|
@@ -46798,7 +46901,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46798
46901
|
if (privateKey) {
|
46799
46902
|
const N = "0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141";
|
46800
46903
|
const ki = bn(IL).add(privateKey).mod(N).toBytes(32);
|
46801
|
-
return new
|
46904
|
+
return new HDWallet({
|
46802
46905
|
privateKey: ki,
|
46803
46906
|
chainCode: IR,
|
46804
46907
|
index,
|
@@ -46808,7 +46911,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46808
46911
|
}
|
46809
46912
|
const signer = new Signer(hexlify(IL));
|
46810
46913
|
const Ki = signer.addPoint(publicKey);
|
46811
|
-
return new
|
46914
|
+
return new HDWallet({
|
46812
46915
|
publicKey: Ki,
|
46813
46916
|
chainCode: IR,
|
46814
46917
|
index,
|
@@ -46857,7 +46960,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46857
46960
|
*/
|
46858
46961
|
static fromSeed(seed) {
|
46859
46962
|
const masterKey = mnemonic_default.masterKeysFromSeed(seed);
|
46860
|
-
return new
|
46963
|
+
return new HDWallet({
|
46861
46964
|
chainCode: arrayify(masterKey.slice(32)),
|
46862
46965
|
privateKey: arrayify(masterKey.slice(0, 32))
|
46863
46966
|
});
|
@@ -46887,7 +46990,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46887
46990
|
if (key[0] !== 3) {
|
46888
46991
|
throw new FuelError(ErrorCode.HD_WALLET_ERROR, "Invalid public extended key.");
|
46889
46992
|
}
|
46890
|
-
return new
|
46993
|
+
return new HDWallet({
|
46891
46994
|
publicKey: key,
|
46892
46995
|
chainCode,
|
46893
46996
|
index,
|
@@ -46898,7 +47001,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46898
47001
|
if (key[0] !== 0) {
|
46899
47002
|
throw new FuelError(ErrorCode.HD_WALLET_ERROR, "Invalid private extended key.");
|
46900
47003
|
}
|
46901
|
-
return new
|
47004
|
+
return new HDWallet({
|
46902
47005
|
privateKey: key.slice(1),
|
46903
47006
|
chainCode,
|
46904
47007
|
index,
|
@@ -46921,7 +47024,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46921
47024
|
return new WalletUnlocked(privateKey, this._provider);
|
46922
47025
|
}
|
46923
47026
|
};
|
46924
|
-
var WalletUnlocked = class
|
47027
|
+
var WalletUnlocked = class extends BaseWalletUnlocked {
|
46925
47028
|
/**
|
46926
47029
|
* Locks the wallet and returns an instance of WalletLocked.
|
46927
47030
|
*
|
@@ -46939,7 +47042,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46939
47042
|
*/
|
46940
47043
|
static generate(generateOptions) {
|
46941
47044
|
const privateKey = Signer.generatePrivateKey(generateOptions?.entropy);
|
46942
|
-
return new
|
47045
|
+
return new WalletUnlocked(privateKey, generateOptions?.provider);
|
46943
47046
|
}
|
46944
47047
|
/**
|
46945
47048
|
* Create a Wallet Unlocked from a seed.
|
@@ -46951,8 +47054,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46951
47054
|
*/
|
46952
47055
|
static fromSeed(seed, path, provider) {
|
46953
47056
|
const hdWallet = hdwallet_default.fromSeed(seed);
|
46954
|
-
const childWallet = hdWallet.derivePath(path ||
|
46955
|
-
return new
|
47057
|
+
const childWallet = hdWallet.derivePath(path || WalletUnlocked.defaultPath);
|
47058
|
+
return new WalletUnlocked(childWallet.privateKey, provider);
|
46956
47059
|
}
|
46957
47060
|
/**
|
46958
47061
|
* Create a Wallet Unlocked from a mnemonic phrase.
|
@@ -46966,8 +47069,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46966
47069
|
static fromMnemonic(mnemonic, path, passphrase, provider) {
|
46967
47070
|
const seed = mnemonic_default.mnemonicToSeed(mnemonic, passphrase);
|
46968
47071
|
const hdWallet = hdwallet_default.fromSeed(seed);
|
46969
|
-
const childWallet = hdWallet.derivePath(path ||
|
46970
|
-
return new
|
47072
|
+
const childWallet = hdWallet.derivePath(path || WalletUnlocked.defaultPath);
|
47073
|
+
return new WalletUnlocked(childWallet.privateKey, provider);
|
46971
47074
|
}
|
46972
47075
|
/**
|
46973
47076
|
* Create a Wallet Unlocked from an extended key.
|
@@ -46978,7 +47081,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46978
47081
|
*/
|
46979
47082
|
static fromExtendedKey(extendedKey, provider) {
|
46980
47083
|
const hdWallet = hdwallet_default.fromExtendedKey(extendedKey);
|
46981
|
-
return new
|
47084
|
+
return new WalletUnlocked(hdWallet.privateKey, provider);
|
46982
47085
|
}
|
46983
47086
|
/**
|
46984
47087
|
* Create a Wallet Unlocked from an encrypted JSON.
|
@@ -46990,7 +47093,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
46990
47093
|
*/
|
46991
47094
|
static async fromEncryptedJson(jsonWallet, password, provider) {
|
46992
47095
|
const privateKey = await decryptKeystoreWallet(jsonWallet, password);
|
46993
|
-
return new
|
47096
|
+
return new WalletUnlocked(privateKey, provider);
|
46994
47097
|
}
|
46995
47098
|
};
|
46996
47099
|
|
@@ -47016,50 +47119,50 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47016
47119
|
static fromPrivateKey(privateKey, provider) {
|
47017
47120
|
return new WalletUnlocked(privateKey, provider);
|
47018
47121
|
}
|
47019
|
-
/**
|
47020
|
-
* Generate a new Wallet Unlocked with a random key pair.
|
47021
|
-
*
|
47022
|
-
* @param generateOptions - Options to customize the generation process (optional).
|
47023
|
-
* @returns An unlocked wallet instance.
|
47024
|
-
*/
|
47025
|
-
static generate = WalletUnlocked.generate;
|
47026
|
-
/**
|
47027
|
-
* Create a Wallet Unlocked from a seed.
|
47028
|
-
*
|
47029
|
-
* @param seed - The seed phrase.
|
47030
|
-
* @param provider - A Provider instance (optional).
|
47031
|
-
* @param path - The derivation path (optional).
|
47032
|
-
* @returns An unlocked wallet instance.
|
47033
|
-
*/
|
47034
|
-
static fromSeed = WalletUnlocked.fromSeed;
|
47035
|
-
/**
|
47036
|
-
* Create a Wallet Unlocked from a mnemonic phrase.
|
47037
|
-
*
|
47038
|
-
* @param mnemonic - The mnemonic phrase.
|
47039
|
-
* @param provider - A Provider instance (optional).
|
47040
|
-
* @param path - The derivation path (optional).
|
47041
|
-
* @param passphrase - The passphrase for the mnemonic (optional).
|
47042
|
-
* @returns An unlocked wallet instance.
|
47043
|
-
*/
|
47044
|
-
static fromMnemonic = WalletUnlocked.fromMnemonic;
|
47045
|
-
/**
|
47046
|
-
* Create a Wallet Unlocked from an extended key.
|
47047
|
-
*
|
47048
|
-
* @param extendedKey - The extended key.
|
47049
|
-
* @param provider - A Provider instance (optional).
|
47050
|
-
* @returns An unlocked wallet instance.
|
47051
|
-
*/
|
47052
|
-
static fromExtendedKey = WalletUnlocked.fromExtendedKey;
|
47053
|
-
/**
|
47054
|
-
* Create a Wallet Unlocked from an encrypted JSON.
|
47055
|
-
*
|
47056
|
-
* @param jsonWallet - The encrypted JSON keystore.
|
47057
|
-
* @param password - The password to decrypt the JSON.
|
47058
|
-
* @param provider - A Provider instance (optional).
|
47059
|
-
* @returns An unlocked wallet instance.
|
47060
|
-
*/
|
47061
|
-
static fromEncryptedJson = WalletUnlocked.fromEncryptedJson;
|
47062
47122
|
};
|
47123
|
+
/**
|
47124
|
+
* Generate a new Wallet Unlocked with a random key pair.
|
47125
|
+
*
|
47126
|
+
* @param generateOptions - Options to customize the generation process (optional).
|
47127
|
+
* @returns An unlocked wallet instance.
|
47128
|
+
*/
|
47129
|
+
__publicField(Wallet, "generate", WalletUnlocked.generate);
|
47130
|
+
/**
|
47131
|
+
* Create a Wallet Unlocked from a seed.
|
47132
|
+
*
|
47133
|
+
* @param seed - The seed phrase.
|
47134
|
+
* @param provider - A Provider instance (optional).
|
47135
|
+
* @param path - The derivation path (optional).
|
47136
|
+
* @returns An unlocked wallet instance.
|
47137
|
+
*/
|
47138
|
+
__publicField(Wallet, "fromSeed", WalletUnlocked.fromSeed);
|
47139
|
+
/**
|
47140
|
+
* Create a Wallet Unlocked from a mnemonic phrase.
|
47141
|
+
*
|
47142
|
+
* @param mnemonic - The mnemonic phrase.
|
47143
|
+
* @param provider - A Provider instance (optional).
|
47144
|
+
* @param path - The derivation path (optional).
|
47145
|
+
* @param passphrase - The passphrase for the mnemonic (optional).
|
47146
|
+
* @returns An unlocked wallet instance.
|
47147
|
+
*/
|
47148
|
+
__publicField(Wallet, "fromMnemonic", WalletUnlocked.fromMnemonic);
|
47149
|
+
/**
|
47150
|
+
* Create a Wallet Unlocked from an extended key.
|
47151
|
+
*
|
47152
|
+
* @param extendedKey - The extended key.
|
47153
|
+
* @param provider - A Provider instance (optional).
|
47154
|
+
* @returns An unlocked wallet instance.
|
47155
|
+
*/
|
47156
|
+
__publicField(Wallet, "fromExtendedKey", WalletUnlocked.fromExtendedKey);
|
47157
|
+
/**
|
47158
|
+
* Create a Wallet Unlocked from an encrypted JSON.
|
47159
|
+
*
|
47160
|
+
* @param jsonWallet - The encrypted JSON keystore.
|
47161
|
+
* @param password - The password to decrypt the JSON.
|
47162
|
+
* @param provider - A Provider instance (optional).
|
47163
|
+
* @returns An unlocked wallet instance.
|
47164
|
+
*/
|
47165
|
+
__publicField(Wallet, "fromEncryptedJson", WalletUnlocked.fromEncryptedJson);
|
47063
47166
|
|
47064
47167
|
// src/wallet-manager/wallet-manager.ts
|
47065
47168
|
var import_events = __require("events");
|
@@ -47083,14 +47186,14 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47083
47186
|
};
|
47084
47187
|
|
47085
47188
|
// src/wallet-manager/vaults/mnemonic-vault.ts
|
47189
|
+
var _secret;
|
47086
47190
|
var MnemonicVault = class {
|
47087
|
-
static type = "mnemonic";
|
47088
|
-
#secret;
|
47089
|
-
pathKey = "{}";
|
47090
|
-
rootPath = `m/44'/1179993420'/${this.pathKey}'/0/0`;
|
47091
|
-
numberOfAccounts = 0;
|
47092
47191
|
constructor(options) {
|
47093
|
-
this
|
47192
|
+
__privateAdd(this, _secret, void 0);
|
47193
|
+
__publicField(this, "pathKey", "{}");
|
47194
|
+
__publicField(this, "rootPath", `m/44'/1179993420'/${this.pathKey}'/0/0`);
|
47195
|
+
__publicField(this, "numberOfAccounts", 0);
|
47196
|
+
__privateSet(this, _secret, options.secret || mnemonic_default.generate());
|
47094
47197
|
this.rootPath = options.rootPath || this.rootPath;
|
47095
47198
|
this.numberOfAccounts = options.numberOfAccounts || 1;
|
47096
47199
|
}
|
@@ -47102,7 +47205,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47102
47205
|
}
|
47103
47206
|
serialize() {
|
47104
47207
|
return {
|
47105
|
-
secret: this
|
47208
|
+
secret: __privateGet(this, _secret),
|
47106
47209
|
rootPath: this.rootPath,
|
47107
47210
|
numberOfAccounts: this.numberOfAccounts
|
47108
47211
|
};
|
@@ -47111,7 +47214,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47111
47214
|
const accounts = [];
|
47112
47215
|
let numberOfAccounts = 0;
|
47113
47216
|
do {
|
47114
|
-
const wallet = Wallet.fromMnemonic(this
|
47217
|
+
const wallet = Wallet.fromMnemonic(__privateGet(this, _secret), this.getDerivePath(numberOfAccounts));
|
47115
47218
|
accounts.push({
|
47116
47219
|
publicKey: wallet.publicKey,
|
47117
47220
|
address: wallet.address
|
@@ -47122,7 +47225,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47122
47225
|
}
|
47123
47226
|
addAccount() {
|
47124
47227
|
this.numberOfAccounts += 1;
|
47125
|
-
const wallet = Wallet.fromMnemonic(this
|
47228
|
+
const wallet = Wallet.fromMnemonic(__privateGet(this, _secret), this.getDerivePath(this.numberOfAccounts - 1));
|
47126
47229
|
return {
|
47127
47230
|
publicKey: wallet.publicKey,
|
47128
47231
|
address: wallet.address
|
@@ -47132,7 +47235,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47132
47235
|
let numberOfAccounts = 0;
|
47133
47236
|
const ownerAddress = Address.fromAddressOrString(address);
|
47134
47237
|
do {
|
47135
|
-
const wallet = Wallet.fromMnemonic(this
|
47238
|
+
const wallet = Wallet.fromMnemonic(__privateGet(this, _secret), this.getDerivePath(numberOfAccounts));
|
47136
47239
|
if (wallet.address.equals(ownerAddress)) {
|
47137
47240
|
return wallet.privateKey;
|
47138
47241
|
}
|
@@ -47148,25 +47251,27 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47148
47251
|
return Wallet.fromPrivateKey(privateKey);
|
47149
47252
|
}
|
47150
47253
|
};
|
47254
|
+
_secret = new WeakMap();
|
47255
|
+
__publicField(MnemonicVault, "type", "mnemonic");
|
47151
47256
|
|
47152
47257
|
// src/wallet-manager/vaults/privatekey-vault.ts
|
47258
|
+
var _privateKeys;
|
47153
47259
|
var PrivateKeyVault = class {
|
47154
|
-
static type = "privateKey";
|
47155
|
-
#privateKeys = [];
|
47156
47260
|
/**
|
47157
47261
|
* If privateKey vault is initialized with a secretKey, it creates
|
47158
47262
|
* one account with the fallowing secret
|
47159
47263
|
*/
|
47160
47264
|
constructor(options = {}) {
|
47265
|
+
__privateAdd(this, _privateKeys, []);
|
47161
47266
|
if (options.secret) {
|
47162
|
-
this
|
47267
|
+
__privateSet(this, _privateKeys, [options.secret]);
|
47163
47268
|
} else {
|
47164
|
-
this
|
47269
|
+
__privateSet(this, _privateKeys, options.accounts || [Wallet.generate().privateKey]);
|
47165
47270
|
}
|
47166
47271
|
}
|
47167
47272
|
serialize() {
|
47168
47273
|
return {
|
47169
|
-
accounts: this
|
47274
|
+
accounts: __privateGet(this, _privateKeys)
|
47170
47275
|
};
|
47171
47276
|
}
|
47172
47277
|
getPublicAccount(privateKey) {
|
@@ -47177,16 +47282,16 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47177
47282
|
};
|
47178
47283
|
}
|
47179
47284
|
getAccounts() {
|
47180
|
-
return this
|
47285
|
+
return __privateGet(this, _privateKeys).map((pk) => this.getPublicAccount(pk));
|
47181
47286
|
}
|
47182
47287
|
addAccount() {
|
47183
47288
|
const wallet = Wallet.generate();
|
47184
|
-
this
|
47289
|
+
__privateGet(this, _privateKeys).push(wallet.privateKey);
|
47185
47290
|
return this.getPublicAccount(wallet.privateKey);
|
47186
47291
|
}
|
47187
47292
|
exportAccount(address) {
|
47188
47293
|
const ownerAddress = Address.fromAddressOrString(address);
|
47189
|
-
const privateKey = this
|
47294
|
+
const privateKey = __privateGet(this, _privateKeys).find(
|
47190
47295
|
(pk) => Wallet.fromPrivateKey(pk).address.equals(ownerAddress)
|
47191
47296
|
);
|
47192
47297
|
if (!privateKey) {
|
@@ -47202,6 +47307,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47202
47307
|
return Wallet.fromPrivateKey(privateKey);
|
47203
47308
|
}
|
47204
47309
|
};
|
47310
|
+
_privateKeys = new WeakMap();
|
47311
|
+
__publicField(PrivateKeyVault, "type", "privateKey");
|
47205
47312
|
|
47206
47313
|
// src/wallet-manager/wallet-manager.ts
|
47207
47314
|
var ERROR_MESSAGES = {
|
@@ -47216,43 +47323,46 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47216
47323
|
throw new FuelError(ErrorCode.WALLET_MANAGER_ERROR, message);
|
47217
47324
|
}
|
47218
47325
|
}
|
47219
|
-
var
|
47220
|
-
|
47221
|
-
* Vaults
|
47222
|
-
*
|
47223
|
-
* Vaults are responsible to store secret keys and return an `Wallet` instance,
|
47224
|
-
* to interact with the network.
|
47225
|
-
*
|
47226
|
-
* Each vault has access to its own state
|
47227
|
-
*
|
47228
|
-
*/
|
47229
|
-
static Vaults = [MnemonicVault, PrivateKeyVault];
|
47230
|
-
/**
|
47231
|
-
* Storage
|
47232
|
-
*
|
47233
|
-
* Persistent encrypted data. `The default storage works only on memory`.
|
47234
|
-
*/
|
47235
|
-
storage = new MemoryStorage();
|
47236
|
-
/* Key name passed to the storage */
|
47237
|
-
STORAGE_KEY = "WalletManager";
|
47238
|
-
// `This variables are only accessible from inside the class`
|
47239
|
-
#vaults = [];
|
47240
|
-
#passphrase = "";
|
47241
|
-
#isLocked = true;
|
47326
|
+
var _vaults, _passphrase, _isLocked, _serializeVaults, serializeVaults_fn, _deserializeVaults, deserializeVaults_fn;
|
47327
|
+
var _WalletManager = class extends import_events.EventEmitter {
|
47242
47328
|
constructor(options) {
|
47243
47329
|
super();
|
47330
|
+
/**
|
47331
|
+
* Serialize all vaults to store
|
47332
|
+
*
|
47333
|
+
* `This is only accessible from inside the class`
|
47334
|
+
*/
|
47335
|
+
__privateAdd(this, _serializeVaults);
|
47336
|
+
/**
|
47337
|
+
* Deserialize all vaults to state
|
47338
|
+
*
|
47339
|
+
* `This is only accessible from inside the class`
|
47340
|
+
*/
|
47341
|
+
__privateAdd(this, _deserializeVaults);
|
47342
|
+
/**
|
47343
|
+
* Storage
|
47344
|
+
*
|
47345
|
+
* Persistent encrypted data. `The default storage works only on memory`.
|
47346
|
+
*/
|
47347
|
+
__publicField(this, "storage", new MemoryStorage());
|
47348
|
+
/* Key name passed to the storage */
|
47349
|
+
__publicField(this, "STORAGE_KEY", "WalletManager");
|
47350
|
+
// `This variables are only accessible from inside the class`
|
47351
|
+
__privateAdd(this, _vaults, []);
|
47352
|
+
__privateAdd(this, _passphrase, "");
|
47353
|
+
__privateAdd(this, _isLocked, true);
|
47244
47354
|
this.storage = options?.storage || this.storage;
|
47245
47355
|
}
|
47246
47356
|
get isLocked() {
|
47247
|
-
return this
|
47357
|
+
return __privateGet(this, _isLocked);
|
47248
47358
|
}
|
47249
47359
|
/**
|
47250
47360
|
* Return the vault serialized object containing all the privateKeys,
|
47251
47361
|
* the format of the return depends on the Vault type.
|
47252
47362
|
*/
|
47253
47363
|
exportVault(vaultId) {
|
47254
|
-
assert3(!this
|
47255
|
-
const vaultState = this
|
47364
|
+
assert3(!__privateGet(this, _isLocked), ERROR_MESSAGES.wallet_not_unlocked);
|
47365
|
+
const vaultState = __privateGet(this, _vaults).find((_, idx) => idx === vaultId);
|
47256
47366
|
assert3(vaultState, ERROR_MESSAGES.vault_not_found);
|
47257
47367
|
return vaultState.vault.serialize();
|
47258
47368
|
}
|
@@ -47260,7 +47370,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47260
47370
|
* List all vaults on the Wallet Manager, this function not return secret's
|
47261
47371
|
*/
|
47262
47372
|
getVaults() {
|
47263
|
-
return this
|
47373
|
+
return __privateGet(this, _vaults).map((v, idx) => ({
|
47264
47374
|
title: v.title,
|
47265
47375
|
type: v.type,
|
47266
47376
|
vaultId: idx
|
@@ -47270,7 +47380,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47270
47380
|
* List all accounts on the Wallet Manager not vault information is revealed
|
47271
47381
|
*/
|
47272
47382
|
getAccounts() {
|
47273
|
-
return this
|
47383
|
+
return __privateGet(this, _vaults).flatMap(
|
47274
47384
|
(vaultState, vaultId) => vaultState.vault.getAccounts().map((account) => ({ ...account, vaultId }))
|
47275
47385
|
);
|
47276
47386
|
}
|
@@ -47279,7 +47389,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47279
47389
|
*/
|
47280
47390
|
getWallet(address) {
|
47281
47391
|
const ownerAddress = Address.fromAddressOrString(address);
|
47282
|
-
const vaultState = this
|
47392
|
+
const vaultState = __privateGet(this, _vaults).find(
|
47283
47393
|
(vs) => vs.vault.getAccounts().find((a) => a.address.equals(ownerAddress))
|
47284
47394
|
);
|
47285
47395
|
assert3(vaultState, ERROR_MESSAGES.address_not_found);
|
@@ -47290,8 +47400,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47290
47400
|
*/
|
47291
47401
|
exportPrivateKey(address) {
|
47292
47402
|
const ownerAddress = Address.fromAddressOrString(address);
|
47293
|
-
assert3(!this
|
47294
|
-
const vaultState = this
|
47403
|
+
assert3(!__privateGet(this, _isLocked), ERROR_MESSAGES.wallet_not_unlocked);
|
47404
|
+
const vaultState = __privateGet(this, _vaults).find(
|
47295
47405
|
(vs) => vs.vault.getAccounts().find((a) => a.address.equals(ownerAddress))
|
47296
47406
|
);
|
47297
47407
|
assert3(vaultState, ERROR_MESSAGES.address_not_found);
|
@@ -47303,7 +47413,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47303
47413
|
*/
|
47304
47414
|
async addAccount(options) {
|
47305
47415
|
await this.loadState();
|
47306
|
-
const vaultState = this
|
47416
|
+
const vaultState = __privateGet(this, _vaults)[options?.vaultId || 0];
|
47307
47417
|
await assert3(vaultState, ERROR_MESSAGES.vault_not_found);
|
47308
47418
|
const account = vaultState.vault.addAccount();
|
47309
47419
|
await this.saveState();
|
@@ -47314,7 +47424,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47314
47424
|
* created by the vault.
|
47315
47425
|
*/
|
47316
47426
|
async removeVault(index) {
|
47317
|
-
this
|
47427
|
+
__privateGet(this, _vaults).splice(index, 1);
|
47318
47428
|
await this.saveState();
|
47319
47429
|
}
|
47320
47430
|
/**
|
@@ -47325,11 +47435,11 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47325
47435
|
await this.loadState();
|
47326
47436
|
const Vault2 = this.getVaultClass(vaultConfig.type);
|
47327
47437
|
const vault = new Vault2(vaultConfig);
|
47328
|
-
this
|
47438
|
+
__privateSet(this, _vaults, __privateGet(this, _vaults).concat({
|
47329
47439
|
title: vaultConfig.title,
|
47330
47440
|
type: vaultConfig.type,
|
47331
47441
|
vault
|
47332
|
-
});
|
47442
|
+
}));
|
47333
47443
|
await this.saveState();
|
47334
47444
|
}
|
47335
47445
|
/**
|
@@ -47337,9 +47447,9 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47337
47447
|
* secrets.
|
47338
47448
|
*/
|
47339
47449
|
lock() {
|
47340
|
-
this
|
47341
|
-
this
|
47342
|
-
this
|
47450
|
+
__privateSet(this, _isLocked, true);
|
47451
|
+
__privateSet(this, _vaults, []);
|
47452
|
+
__privateSet(this, _passphrase, "");
|
47343
47453
|
this.emit("lock");
|
47344
47454
|
}
|
47345
47455
|
/**
|
@@ -47347,8 +47457,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47347
47457
|
* Vaults with secrets are not unlocked or instantiated on this moment.
|
47348
47458
|
*/
|
47349
47459
|
async unlock(passphrase) {
|
47350
|
-
this
|
47351
|
-
this
|
47460
|
+
__privateSet(this, _passphrase, passphrase);
|
47461
|
+
__privateSet(this, _isLocked, false);
|
47352
47462
|
try {
|
47353
47463
|
await this.loadState();
|
47354
47464
|
this.emit("unlock");
|
@@ -47361,9 +47471,9 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47361
47471
|
* Update WalletManager encryption passphrase
|
47362
47472
|
*/
|
47363
47473
|
async updatePassphrase(oldpass, newpass) {
|
47364
|
-
const isLocked = this
|
47474
|
+
const isLocked = __privateGet(this, _isLocked);
|
47365
47475
|
await this.unlock(oldpass);
|
47366
|
-
this
|
47476
|
+
__privateSet(this, _passphrase, newpass);
|
47367
47477
|
await this.saveState();
|
47368
47478
|
await this.loadState();
|
47369
47479
|
if (isLocked) {
|
@@ -47374,51 +47484,24 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47374
47484
|
* Retrieve and decrypt WalletManager state from storage
|
47375
47485
|
*/
|
47376
47486
|
async loadState() {
|
47377
|
-
await assert3(!this
|
47487
|
+
await assert3(!__privateGet(this, _isLocked), ERROR_MESSAGES.wallet_not_unlocked);
|
47378
47488
|
const data = await this.storage.getItem(this.STORAGE_KEY);
|
47379
47489
|
if (data) {
|
47380
|
-
const state = await decrypt2(this
|
47381
|
-
this
|
47490
|
+
const state = await decrypt2(__privateGet(this, _passphrase), JSON.parse(data));
|
47491
|
+
__privateSet(this, _vaults, __privateMethod(this, _deserializeVaults, deserializeVaults_fn).call(this, state.vaults));
|
47382
47492
|
}
|
47383
47493
|
}
|
47384
47494
|
/**
|
47385
47495
|
* Store encrypted WalletManager state on storage
|
47386
47496
|
*/
|
47387
47497
|
async saveState() {
|
47388
|
-
await assert3(!this
|
47389
|
-
const encryptedData = await encrypt2(this
|
47390
|
-
vaults: this
|
47498
|
+
await assert3(!__privateGet(this, _isLocked), ERROR_MESSAGES.wallet_not_unlocked);
|
47499
|
+
const encryptedData = await encrypt2(__privateGet(this, _passphrase), {
|
47500
|
+
vaults: __privateMethod(this, _serializeVaults, serializeVaults_fn).call(this, __privateGet(this, _vaults))
|
47391
47501
|
});
|
47392
47502
|
await this.storage.setItem(this.STORAGE_KEY, JSON.stringify(encryptedData));
|
47393
47503
|
this.emit("update");
|
47394
47504
|
}
|
47395
|
-
/**
|
47396
|
-
* Serialize all vaults to store
|
47397
|
-
*
|
47398
|
-
* `This is only accessible from inside the class`
|
47399
|
-
*/
|
47400
|
-
#serializeVaults(vaults) {
|
47401
|
-
return vaults.map(({ title, type: type3, vault }) => ({
|
47402
|
-
title,
|
47403
|
-
type: type3,
|
47404
|
-
data: vault.serialize()
|
47405
|
-
}));
|
47406
|
-
}
|
47407
|
-
/**
|
47408
|
-
* Deserialize all vaults to state
|
47409
|
-
*
|
47410
|
-
* `This is only accessible from inside the class`
|
47411
|
-
*/
|
47412
|
-
#deserializeVaults(vaults) {
|
47413
|
-
return vaults.map(({ title, type: type3, data: vaultConfig }) => {
|
47414
|
-
const VaultClass = this.getVaultClass(type3);
|
47415
|
-
return {
|
47416
|
-
title,
|
47417
|
-
type: type3,
|
47418
|
-
vault: new VaultClass(vaultConfig)
|
47419
|
-
};
|
47420
|
-
});
|
47421
|
-
}
|
47422
47505
|
/**
|
47423
47506
|
* Return a instantiable Class reference from `WalletManager.Vaults` supported list.
|
47424
47507
|
*/
|
@@ -47428,10 +47511,42 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47428
47511
|
return VaultClass;
|
47429
47512
|
}
|
47430
47513
|
};
|
47514
|
+
var WalletManager = _WalletManager;
|
47515
|
+
_vaults = new WeakMap();
|
47516
|
+
_passphrase = new WeakMap();
|
47517
|
+
_isLocked = new WeakMap();
|
47518
|
+
_serializeVaults = new WeakSet();
|
47519
|
+
serializeVaults_fn = function(vaults) {
|
47520
|
+
return vaults.map(({ title, type: type3, vault }) => ({
|
47521
|
+
title,
|
47522
|
+
type: type3,
|
47523
|
+
data: vault.serialize()
|
47524
|
+
}));
|
47525
|
+
};
|
47526
|
+
_deserializeVaults = new WeakSet();
|
47527
|
+
deserializeVaults_fn = function(vaults) {
|
47528
|
+
return vaults.map(({ title, type: type3, data: vaultConfig }) => {
|
47529
|
+
const VaultClass = this.getVaultClass(type3);
|
47530
|
+
return {
|
47531
|
+
title,
|
47532
|
+
type: type3,
|
47533
|
+
vault: new VaultClass(vaultConfig)
|
47534
|
+
};
|
47535
|
+
});
|
47536
|
+
};
|
47537
|
+
/**
|
47538
|
+
* Vaults
|
47539
|
+
*
|
47540
|
+
* Vaults are responsible to store secret keys and return an `Wallet` instance,
|
47541
|
+
* to interact with the network.
|
47542
|
+
*
|
47543
|
+
* Each vault has access to its own state
|
47544
|
+
*
|
47545
|
+
*/
|
47546
|
+
__publicField(WalletManager, "Vaults", [MnemonicVault, PrivateKeyVault]);
|
47431
47547
|
|
47432
47548
|
// src/wallet-manager/types.ts
|
47433
47549
|
var Vault = class {
|
47434
|
-
static type;
|
47435
47550
|
constructor(_options) {
|
47436
47551
|
throw new FuelError(ErrorCode.NOT_IMPLEMENTED, "Not implemented.");
|
47437
47552
|
}
|
@@ -47451,6 +47566,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47451
47566
|
throw new FuelError(ErrorCode.NOT_IMPLEMENTED, "Not implemented.");
|
47452
47567
|
}
|
47453
47568
|
};
|
47569
|
+
__publicField(Vault, "type");
|
47454
47570
|
var StorageAbstract = class {
|
47455
47571
|
};
|
47456
47572
|
|
@@ -47522,7 +47638,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47522
47638
|
};
|
47523
47639
|
|
47524
47640
|
// src/predicate/predicate.ts
|
47525
|
-
var Predicate = class
|
47641
|
+
var Predicate = class extends Account {
|
47526
47642
|
bytes;
|
47527
47643
|
predicateDataBytes = Uint8Array.from([]);
|
47528
47644
|
predicateData = [];
|
@@ -47543,7 +47659,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47543
47659
|
inputData,
|
47544
47660
|
configurableConstants
|
47545
47661
|
}) {
|
47546
|
-
const { predicateBytes, predicateInterface } =
|
47662
|
+
const { predicateBytes, predicateInterface } = Predicate.processPredicateData(
|
47547
47663
|
bytecode,
|
47548
47664
|
abi,
|
47549
47665
|
configurableConstants
|
@@ -47639,7 +47755,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47639
47755
|
}
|
47640
47756
|
}
|
47641
47757
|
if (configurableConstants && Object.keys(configurableConstants).length) {
|
47642
|
-
predicateBytes =
|
47758
|
+
predicateBytes = Predicate.setConfigurableConstants(
|
47643
47759
|
predicateBytes,
|
47644
47760
|
configurableConstants,
|
47645
47761
|
abiInterface
|
@@ -47824,6 +47940,18 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47824
47940
|
async signMessage(_address, _message) {
|
47825
47941
|
throw new Error("Method not implemented.");
|
47826
47942
|
}
|
47943
|
+
/**
|
47944
|
+
* Should start the sign transaction process and return
|
47945
|
+
* the signed transaction.
|
47946
|
+
*
|
47947
|
+
* @param address - The address to sign the transaction
|
47948
|
+
* @param transaction - The transaction to sign
|
47949
|
+
*
|
47950
|
+
* @returns Transaction signature
|
47951
|
+
*/
|
47952
|
+
async signTransaction(_address, _transaction) {
|
47953
|
+
throw new Error("Method not implemented.");
|
47954
|
+
}
|
47827
47955
|
/**
|
47828
47956
|
* Should start the send transaction process and return
|
47829
47957
|
* the transaction id submitted to the network.
|
@@ -48016,9 +48144,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
48016
48144
|
var HAS_CONNECTOR_TIMEOUT = 2e3;
|
48017
48145
|
var PING_CACHE_TIME = 5e3;
|
48018
48146
|
var { warn } = console;
|
48019
|
-
var
|
48020
|
-
static STORAGE_KEY = "fuel-current-connector";
|
48021
|
-
static defaultConfig = {};
|
48147
|
+
var _Fuel = class extends FuelConnector {
|
48022
48148
|
_storage = null;
|
48023
48149
|
_connectors = [];
|
48024
48150
|
_targetObject = null;
|
@@ -48343,6 +48469,9 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
48343
48469
|
await this.clean();
|
48344
48470
|
}
|
48345
48471
|
};
|
48472
|
+
var Fuel = _Fuel;
|
48473
|
+
__publicField(Fuel, "STORAGE_KEY", "fuel-current-connector");
|
48474
|
+
__publicField(Fuel, "defaultConfig", {});
|
48346
48475
|
})();
|
48347
48476
|
/*! Bundled license information:
|
48348
48477
|
|