@fuel-ts/account 0.90.0 → 0.92.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @fuel-ts/account might be problematic. Click here for more details.
- package/dist/account.d.ts +4 -4
- package/dist/account.d.ts.map +1 -1
- package/dist/connectors/fuel-connector.d.ts +2 -2
- package/dist/index.global.js +1079 -622
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +181 -117
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +179 -117
- package/dist/index.mjs.map +1 -1
- package/dist/providers/__generated__/operations.d.ts +682 -507
- package/dist/providers/__generated__/operations.d.ts.map +1 -1
- package/dist/providers/assets/utils/network.d.ts.map +1 -1
- package/dist/providers/provider.d.ts +27 -6
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-response/transaction-response.d.ts +13 -0
- package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -1
- package/dist/providers/utils/extract-tx-error.d.ts +2 -8
- package/dist/providers/utils/extract-tx-error.d.ts.map +1 -1
- package/dist/test-utils/launchNode.d.ts +4 -16
- package/dist/test-utils/launchNode.d.ts.map +1 -1
- package/dist/test-utils/setup-test-provider-and-wallets.d.ts +2 -1
- package/dist/test-utils/setup-test-provider-and-wallets.d.ts.map +1 -1
- package/dist/test-utils.global.js +1164 -778
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +254 -172
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +253 -170
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +24 -25
package/dist/index.global.js
CHANGED
@@ -85,20 +85,20 @@
|
|
85
85
|
ctor.prototype = new TempCtor();
|
86
86
|
ctor.prototype.constructor = ctor;
|
87
87
|
}
|
88
|
-
function BN2(
|
89
|
-
if (BN2.isBN(
|
90
|
-
return
|
88
|
+
function BN2(number3, base, endian) {
|
89
|
+
if (BN2.isBN(number3)) {
|
90
|
+
return number3;
|
91
91
|
}
|
92
92
|
this.negative = 0;
|
93
93
|
this.words = null;
|
94
94
|
this.length = 0;
|
95
95
|
this.red = null;
|
96
|
-
if (
|
96
|
+
if (number3 !== null) {
|
97
97
|
if (base === "le" || base === "be") {
|
98
98
|
endian = base;
|
99
99
|
base = 10;
|
100
100
|
}
|
101
|
-
this._init(
|
101
|
+
this._init(number3 || 0, base || 10, endian || "be");
|
102
102
|
}
|
103
103
|
}
|
104
104
|
if (typeof module2 === "object") {
|
@@ -133,53 +133,53 @@
|
|
133
133
|
return left;
|
134
134
|
return right;
|
135
135
|
};
|
136
|
-
BN2.prototype._init = function init(
|
137
|
-
if (typeof
|
138
|
-
return this._initNumber(
|
136
|
+
BN2.prototype._init = function init(number3, base, endian) {
|
137
|
+
if (typeof number3 === "number") {
|
138
|
+
return this._initNumber(number3, base, endian);
|
139
139
|
}
|
140
|
-
if (typeof
|
141
|
-
return this._initArray(
|
140
|
+
if (typeof number3 === "object") {
|
141
|
+
return this._initArray(number3, base, endian);
|
142
142
|
}
|
143
143
|
if (base === "hex") {
|
144
144
|
base = 16;
|
145
145
|
}
|
146
146
|
assert2(base === (base | 0) && base >= 2 && base <= 36);
|
147
|
-
|
147
|
+
number3 = number3.toString().replace(/\s+/g, "");
|
148
148
|
var start = 0;
|
149
|
-
if (
|
149
|
+
if (number3[0] === "-") {
|
150
150
|
start++;
|
151
151
|
this.negative = 1;
|
152
152
|
}
|
153
|
-
if (start <
|
153
|
+
if (start < number3.length) {
|
154
154
|
if (base === 16) {
|
155
|
-
this._parseHex(
|
155
|
+
this._parseHex(number3, start, endian);
|
156
156
|
} else {
|
157
|
-
this._parseBase(
|
157
|
+
this._parseBase(number3, base, start);
|
158
158
|
if (endian === "le") {
|
159
159
|
this._initArray(this.toArray(), base, endian);
|
160
160
|
}
|
161
161
|
}
|
162
162
|
}
|
163
163
|
};
|
164
|
-
BN2.prototype._initNumber = function _initNumber(
|
165
|
-
if (
|
164
|
+
BN2.prototype._initNumber = function _initNumber(number3, base, endian) {
|
165
|
+
if (number3 < 0) {
|
166
166
|
this.negative = 1;
|
167
|
-
|
167
|
+
number3 = -number3;
|
168
168
|
}
|
169
|
-
if (
|
170
|
-
this.words = [
|
169
|
+
if (number3 < 67108864) {
|
170
|
+
this.words = [number3 & 67108863];
|
171
171
|
this.length = 1;
|
172
|
-
} else if (
|
172
|
+
} else if (number3 < 4503599627370496) {
|
173
173
|
this.words = [
|
174
|
-
|
175
|
-
|
174
|
+
number3 & 67108863,
|
175
|
+
number3 / 67108864 & 67108863
|
176
176
|
];
|
177
177
|
this.length = 2;
|
178
178
|
} else {
|
179
|
-
assert2(
|
179
|
+
assert2(number3 < 9007199254740992);
|
180
180
|
this.words = [
|
181
|
-
|
182
|
-
|
181
|
+
number3 & 67108863,
|
182
|
+
number3 / 67108864 & 67108863,
|
183
183
|
1
|
184
184
|
];
|
185
185
|
this.length = 3;
|
@@ -188,14 +188,14 @@
|
|
188
188
|
return;
|
189
189
|
this._initArray(this.toArray(), base, endian);
|
190
190
|
};
|
191
|
-
BN2.prototype._initArray = function _initArray(
|
192
|
-
assert2(typeof
|
193
|
-
if (
|
191
|
+
BN2.prototype._initArray = function _initArray(number3, base, endian) {
|
192
|
+
assert2(typeof number3.length === "number");
|
193
|
+
if (number3.length <= 0) {
|
194
194
|
this.words = [0];
|
195
195
|
this.length = 1;
|
196
196
|
return this;
|
197
197
|
}
|
198
|
-
this.length = Math.ceil(
|
198
|
+
this.length = Math.ceil(number3.length / 3);
|
199
199
|
this.words = new Array(this.length);
|
200
200
|
for (var i = 0; i < this.length; i++) {
|
201
201
|
this.words[i] = 0;
|
@@ -203,8 +203,8 @@
|
|
203
203
|
var j, w;
|
204
204
|
var off = 0;
|
205
205
|
if (endian === "be") {
|
206
|
-
for (i =
|
207
|
-
w =
|
206
|
+
for (i = number3.length - 1, j = 0; i >= 0; i -= 3) {
|
207
|
+
w = number3[i] | number3[i - 1] << 8 | number3[i - 2] << 16;
|
208
208
|
this.words[j] |= w << off & 67108863;
|
209
209
|
this.words[j + 1] = w >>> 26 - off & 67108863;
|
210
210
|
off += 24;
|
@@ -214,8 +214,8 @@
|
|
214
214
|
}
|
215
215
|
}
|
216
216
|
} else if (endian === "le") {
|
217
|
-
for (i = 0, j = 0; i <
|
218
|
-
w =
|
217
|
+
for (i = 0, j = 0; i < number3.length; i += 3) {
|
218
|
+
w = number3[i] | number3[i + 1] << 8 | number3[i + 2] << 16;
|
219
219
|
this.words[j] |= w << off & 67108863;
|
220
220
|
this.words[j + 1] = w >>> 26 - off & 67108863;
|
221
221
|
off += 24;
|
@@ -246,8 +246,8 @@
|
|
246
246
|
}
|
247
247
|
return r;
|
248
248
|
}
|
249
|
-
BN2.prototype._parseHex = function _parseHex(
|
250
|
-
this.length = Math.ceil((
|
249
|
+
BN2.prototype._parseHex = function _parseHex(number3, start, endian) {
|
250
|
+
this.length = Math.ceil((number3.length - start) / 6);
|
251
251
|
this.words = new Array(this.length);
|
252
252
|
for (var i = 0; i < this.length; i++) {
|
253
253
|
this.words[i] = 0;
|
@@ -256,8 +256,8 @@
|
|
256
256
|
var j = 0;
|
257
257
|
var w;
|
258
258
|
if (endian === "be") {
|
259
|
-
for (i =
|
260
|
-
w = parseHexByte(
|
259
|
+
for (i = number3.length - 1; i >= start; i -= 2) {
|
260
|
+
w = parseHexByte(number3, start, i) << off;
|
261
261
|
this.words[j] |= w & 67108863;
|
262
262
|
if (off >= 18) {
|
263
263
|
off -= 18;
|
@@ -268,9 +268,9 @@
|
|
268
268
|
}
|
269
269
|
}
|
270
270
|
} else {
|
271
|
-
var parseLength =
|
272
|
-
for (i = parseLength % 2 === 0 ? start + 1 : start; i <
|
273
|
-
w = parseHexByte(
|
271
|
+
var parseLength = number3.length - start;
|
272
|
+
for (i = parseLength % 2 === 0 ? start + 1 : start; i < number3.length; i += 2) {
|
273
|
+
w = parseHexByte(number3, start, i) << off;
|
274
274
|
this.words[j] |= w & 67108863;
|
275
275
|
if (off >= 18) {
|
276
276
|
off -= 18;
|
@@ -302,7 +302,7 @@
|
|
302
302
|
}
|
303
303
|
return r;
|
304
304
|
}
|
305
|
-
BN2.prototype._parseBase = function _parseBase(
|
305
|
+
BN2.prototype._parseBase = function _parseBase(number3, base, start) {
|
306
306
|
this.words = [0];
|
307
307
|
this.length = 1;
|
308
308
|
for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) {
|
@@ -310,12 +310,12 @@
|
|
310
310
|
}
|
311
311
|
limbLen--;
|
312
312
|
limbPow = limbPow / base | 0;
|
313
|
-
var total =
|
313
|
+
var total = number3.length - start;
|
314
314
|
var mod2 = total % limbLen;
|
315
315
|
var end = Math.min(total, total - mod2) + start;
|
316
316
|
var word = 0;
|
317
317
|
for (var i = start; i < end; i += limbLen) {
|
318
|
-
word = parseBase(
|
318
|
+
word = parseBase(number3, i, i + limbLen, base);
|
319
319
|
this.imuln(limbPow);
|
320
320
|
if (this.words[0] + word < 67108864) {
|
321
321
|
this.words[0] += word;
|
@@ -325,7 +325,7 @@
|
|
325
325
|
}
|
326
326
|
if (mod2 !== 0) {
|
327
327
|
var pow3 = 1;
|
328
|
-
word = parseBase(
|
328
|
+
word = parseBase(number3, i, number3.length, base);
|
329
329
|
for (i = 0; i < mod2; i++) {
|
330
330
|
pow3 *= base;
|
331
331
|
}
|
@@ -2651,20 +2651,20 @@
|
|
2651
2651
|
);
|
2652
2652
|
}
|
2653
2653
|
inherits(K256, MPrime);
|
2654
|
-
K256.prototype.split = function split2(input,
|
2654
|
+
K256.prototype.split = function split2(input, output3) {
|
2655
2655
|
var mask = 4194303;
|
2656
2656
|
var outLen = Math.min(input.length, 9);
|
2657
2657
|
for (var i = 0; i < outLen; i++) {
|
2658
|
-
|
2658
|
+
output3.words[i] = input.words[i];
|
2659
2659
|
}
|
2660
|
-
|
2660
|
+
output3.length = outLen;
|
2661
2661
|
if (input.length <= 9) {
|
2662
2662
|
input.words[0] = 0;
|
2663
2663
|
input.length = 1;
|
2664
2664
|
return;
|
2665
2665
|
}
|
2666
2666
|
var prev = input.words[9];
|
2667
|
-
|
2667
|
+
output3.words[output3.length++] = prev & mask;
|
2668
2668
|
for (i = 10; i < input.length; i++) {
|
2669
2669
|
var next = input.words[i] | 0;
|
2670
2670
|
input.words[i - 10] = (next & mask) << 4 | prev >>> 22;
|
@@ -3060,8 +3060,8 @@
|
|
3060
3060
|
}
|
3061
3061
|
return result;
|
3062
3062
|
}
|
3063
|
-
function toWords(
|
3064
|
-
return convert2(
|
3063
|
+
function toWords(bytes3) {
|
3064
|
+
return convert2(bytes3, 8, 5, true);
|
3065
3065
|
}
|
3066
3066
|
function fromWordsUnsafe(words) {
|
3067
3067
|
const res = convert2(words, 5, 8, false);
|
@@ -3600,18 +3600,18 @@
|
|
3600
3600
|
}
|
3601
3601
|
function utf8PercentDecode(str) {
|
3602
3602
|
const input = new Buffer(str);
|
3603
|
-
const
|
3603
|
+
const output3 = [];
|
3604
3604
|
for (let i = 0; i < input.length; ++i) {
|
3605
3605
|
if (input[i] !== 37) {
|
3606
|
-
|
3606
|
+
output3.push(input[i]);
|
3607
3607
|
} else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) {
|
3608
|
-
|
3608
|
+
output3.push(parseInt(input.slice(i + 1, i + 3).toString(), 16));
|
3609
3609
|
i += 2;
|
3610
3610
|
} else {
|
3611
|
-
|
3611
|
+
output3.push(input[i]);
|
3612
3612
|
}
|
3613
3613
|
}
|
3614
|
-
return new Buffer(
|
3614
|
+
return new Buffer(output3).toString();
|
3615
3615
|
}
|
3616
3616
|
function isC0ControlPercentEncode(c) {
|
3617
3617
|
return c <= 31 || c > 126;
|
@@ -3687,16 +3687,16 @@
|
|
3687
3687
|
return ipv4;
|
3688
3688
|
}
|
3689
3689
|
function serializeIPv4(address) {
|
3690
|
-
let
|
3690
|
+
let output3 = "";
|
3691
3691
|
let n = address;
|
3692
3692
|
for (let i = 1; i <= 4; ++i) {
|
3693
|
-
|
3693
|
+
output3 = String(n % 256) + output3;
|
3694
3694
|
if (i !== 4) {
|
3695
|
-
|
3695
|
+
output3 = "." + output3;
|
3696
3696
|
}
|
3697
3697
|
n = Math.floor(n / 256);
|
3698
3698
|
}
|
3699
|
-
return
|
3699
|
+
return output3;
|
3700
3700
|
}
|
3701
3701
|
function parseIPv6(input) {
|
3702
3702
|
const address = [0, 0, 0, 0, 0, 0, 0, 0];
|
@@ -3754,13 +3754,13 @@
|
|
3754
3754
|
return failure;
|
3755
3755
|
}
|
3756
3756
|
while (isASCIIDigit(input[pointer])) {
|
3757
|
-
const
|
3757
|
+
const number3 = parseInt(at(input, pointer));
|
3758
3758
|
if (ipv4Piece === null) {
|
3759
|
-
ipv4Piece =
|
3759
|
+
ipv4Piece = number3;
|
3760
3760
|
} else if (ipv4Piece === 0) {
|
3761
3761
|
return failure;
|
3762
3762
|
} else {
|
3763
|
-
ipv4Piece = ipv4Piece * 10 +
|
3763
|
+
ipv4Piece = ipv4Piece * 10 + number3;
|
3764
3764
|
}
|
3765
3765
|
if (ipv4Piece > 255) {
|
3766
3766
|
return failure;
|
@@ -3804,7 +3804,7 @@
|
|
3804
3804
|
return address;
|
3805
3805
|
}
|
3806
3806
|
function serializeIPv6(address) {
|
3807
|
-
let
|
3807
|
+
let output3 = "";
|
3808
3808
|
const seqResult = findLongestZeroSequence(address);
|
3809
3809
|
const compress = seqResult.idx;
|
3810
3810
|
let ignore0 = false;
|
@@ -3816,16 +3816,16 @@
|
|
3816
3816
|
}
|
3817
3817
|
if (compress === pieceIndex) {
|
3818
3818
|
const separator = pieceIndex === 0 ? "::" : ":";
|
3819
|
-
|
3819
|
+
output3 += separator;
|
3820
3820
|
ignore0 = true;
|
3821
3821
|
continue;
|
3822
3822
|
}
|
3823
|
-
|
3823
|
+
output3 += address[pieceIndex].toString(16);
|
3824
3824
|
if (pieceIndex !== 7) {
|
3825
|
-
|
3825
|
+
output3 += ":";
|
3826
3826
|
}
|
3827
3827
|
}
|
3828
|
-
return
|
3828
|
+
return output3;
|
3829
3829
|
}
|
3830
3830
|
function parseHost(input, isSpecialArg) {
|
3831
3831
|
if (input[0] === "[") {
|
@@ -3855,12 +3855,12 @@
|
|
3855
3855
|
if (containsForbiddenHostCodePointExcludingPercent(input)) {
|
3856
3856
|
return failure;
|
3857
3857
|
}
|
3858
|
-
let
|
3858
|
+
let output3 = "";
|
3859
3859
|
const decoded = punycode.ucs2.decode(input);
|
3860
3860
|
for (let i = 0; i < decoded.length; ++i) {
|
3861
|
-
|
3861
|
+
output3 += percentEncodeChar(decoded[i], isC0ControlPercentEncode);
|
3862
3862
|
}
|
3863
|
-
return
|
3863
|
+
return output3;
|
3864
3864
|
}
|
3865
3865
|
function findLongestZeroSequence(arr) {
|
3866
3866
|
let maxIdx = null;
|
@@ -4485,37 +4485,37 @@
|
|
4485
4485
|
return true;
|
4486
4486
|
};
|
4487
4487
|
function serializeURL(url, excludeFragment) {
|
4488
|
-
let
|
4488
|
+
let output3 = url.scheme + ":";
|
4489
4489
|
if (url.host !== null) {
|
4490
|
-
|
4490
|
+
output3 += "//";
|
4491
4491
|
if (url.username !== "" || url.password !== "") {
|
4492
|
-
|
4492
|
+
output3 += url.username;
|
4493
4493
|
if (url.password !== "") {
|
4494
|
-
|
4494
|
+
output3 += ":" + url.password;
|
4495
4495
|
}
|
4496
|
-
|
4496
|
+
output3 += "@";
|
4497
4497
|
}
|
4498
|
-
|
4498
|
+
output3 += serializeHost(url.host);
|
4499
4499
|
if (url.port !== null) {
|
4500
|
-
|
4500
|
+
output3 += ":" + url.port;
|
4501
4501
|
}
|
4502
4502
|
} else if (url.host === null && url.scheme === "file") {
|
4503
|
-
|
4503
|
+
output3 += "//";
|
4504
4504
|
}
|
4505
4505
|
if (url.cannotBeABaseURL) {
|
4506
|
-
|
4506
|
+
output3 += url.path[0];
|
4507
4507
|
} else {
|
4508
4508
|
for (const string of url.path) {
|
4509
|
-
|
4509
|
+
output3 += "/" + string;
|
4510
4510
|
}
|
4511
4511
|
}
|
4512
4512
|
if (url.query !== null) {
|
4513
|
-
|
4513
|
+
output3 += "?" + url.query;
|
4514
4514
|
}
|
4515
4515
|
if (!excludeFragment && url.fragment !== null) {
|
4516
|
-
|
4516
|
+
output3 += "#" + url.fragment;
|
4517
4517
|
}
|
4518
|
-
return
|
4518
|
+
return output3;
|
4519
4519
|
}
|
4520
4520
|
function serializeOrigin(tuple) {
|
4521
4521
|
let result = tuple.scheme + "://";
|
@@ -6210,9 +6210,9 @@
|
|
6210
6210
|
}
|
6211
6211
|
});
|
6212
6212
|
|
6213
|
-
// ../../node_modules/.pnpm/graphql@16.
|
6213
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/isObjectLike.js
|
6214
6214
|
var require_isObjectLike = __commonJS({
|
6215
|
-
"../../node_modules/.pnpm/graphql@16.
|
6215
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/isObjectLike.js"(exports) {
|
6216
6216
|
"use strict";
|
6217
6217
|
Object.defineProperty(exports, "__esModule", {
|
6218
6218
|
value: true
|
@@ -6224,9 +6224,9 @@
|
|
6224
6224
|
}
|
6225
6225
|
});
|
6226
6226
|
|
6227
|
-
// ../../node_modules/.pnpm/graphql@16.
|
6227
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/invariant.js
|
6228
6228
|
var require_invariant = __commonJS({
|
6229
|
-
"../../node_modules/.pnpm/graphql@16.
|
6229
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/invariant.js"(exports) {
|
6230
6230
|
"use strict";
|
6231
6231
|
Object.defineProperty(exports, "__esModule", {
|
6232
6232
|
value: true
|
@@ -6243,9 +6243,9 @@
|
|
6243
6243
|
}
|
6244
6244
|
});
|
6245
6245
|
|
6246
|
-
// ../../node_modules/.pnpm/graphql@16.
|
6246
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/location.js
|
6247
6247
|
var require_location = __commonJS({
|
6248
|
-
"../../node_modules/.pnpm/graphql@16.
|
6248
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/location.js"(exports) {
|
6249
6249
|
"use strict";
|
6250
6250
|
Object.defineProperty(exports, "__esModule", {
|
6251
6251
|
value: true
|
@@ -6272,9 +6272,9 @@
|
|
6272
6272
|
}
|
6273
6273
|
});
|
6274
6274
|
|
6275
|
-
// ../../node_modules/.pnpm/graphql@16.
|
6275
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/printLocation.js
|
6276
6276
|
var require_printLocation = __commonJS({
|
6277
|
-
"../../node_modules/.pnpm/graphql@16.
|
6277
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/printLocation.js"(exports) {
|
6278
6278
|
"use strict";
|
6279
6279
|
Object.defineProperty(exports, "__esModule", {
|
6280
6280
|
value: true
|
@@ -6330,9 +6330,9 @@
|
|
6330
6330
|
}
|
6331
6331
|
});
|
6332
6332
|
|
6333
|
-
// ../../node_modules/.pnpm/graphql@16.
|
6333
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/error/GraphQLError.js
|
6334
6334
|
var require_GraphQLError = __commonJS({
|
6335
|
-
"../../node_modules/.pnpm/graphql@16.
|
6335
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/error/GraphQLError.js"(exports) {
|
6336
6336
|
"use strict";
|
6337
6337
|
Object.defineProperty(exports, "__esModule", {
|
6338
6338
|
value: true
|
@@ -6459,19 +6459,19 @@
|
|
6459
6459
|
return "GraphQLError";
|
6460
6460
|
}
|
6461
6461
|
toString() {
|
6462
|
-
let
|
6462
|
+
let output3 = this.message;
|
6463
6463
|
if (this.nodes) {
|
6464
6464
|
for (const node of this.nodes) {
|
6465
6465
|
if (node.loc) {
|
6466
|
-
|
6466
|
+
output3 += "\n\n" + (0, _printLocation.printLocation)(node.loc);
|
6467
6467
|
}
|
6468
6468
|
}
|
6469
6469
|
} else if (this.source && this.locations) {
|
6470
6470
|
for (const location of this.locations) {
|
6471
|
-
|
6471
|
+
output3 += "\n\n" + (0, _printLocation.printSourceLocation)(this.source, location);
|
6472
6472
|
}
|
6473
6473
|
}
|
6474
|
-
return
|
6474
|
+
return output3;
|
6475
6475
|
}
|
6476
6476
|
toJSON() {
|
6477
6477
|
const formattedError = {
|
@@ -6502,9 +6502,9 @@
|
|
6502
6502
|
}
|
6503
6503
|
});
|
6504
6504
|
|
6505
|
-
// ../../node_modules/.pnpm/graphql@16.
|
6505
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/error/syntaxError.js
|
6506
6506
|
var require_syntaxError = __commonJS({
|
6507
|
-
"../../node_modules/.pnpm/graphql@16.
|
6507
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/error/syntaxError.js"(exports) {
|
6508
6508
|
"use strict";
|
6509
6509
|
Object.defineProperty(exports, "__esModule", {
|
6510
6510
|
value: true
|
@@ -6520,9 +6520,9 @@
|
|
6520
6520
|
}
|
6521
6521
|
});
|
6522
6522
|
|
6523
|
-
// ../../node_modules/.pnpm/graphql@16.
|
6523
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/ast.js
|
6524
6524
|
var require_ast = __commonJS({
|
6525
|
-
"../../node_modules/.pnpm/graphql@16.
|
6525
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/ast.js"(exports) {
|
6526
6526
|
"use strict";
|
6527
6527
|
Object.defineProperty(exports, "__esModule", {
|
6528
6528
|
value: true
|
@@ -6704,9 +6704,9 @@
|
|
6704
6704
|
}
|
6705
6705
|
});
|
6706
6706
|
|
6707
|
-
// ../../node_modules/.pnpm/graphql@16.
|
6707
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/directiveLocation.js
|
6708
6708
|
var require_directiveLocation = __commonJS({
|
6709
|
-
"../../node_modules/.pnpm/graphql@16.
|
6709
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/directiveLocation.js"(exports) {
|
6710
6710
|
"use strict";
|
6711
6711
|
Object.defineProperty(exports, "__esModule", {
|
6712
6712
|
value: true
|
@@ -6738,9 +6738,9 @@
|
|
6738
6738
|
}
|
6739
6739
|
});
|
6740
6740
|
|
6741
|
-
// ../../node_modules/.pnpm/graphql@16.
|
6741
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/kinds.js
|
6742
6742
|
var require_kinds = __commonJS({
|
6743
|
-
"../../node_modules/.pnpm/graphql@16.
|
6743
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/kinds.js"(exports) {
|
6744
6744
|
"use strict";
|
6745
6745
|
Object.defineProperty(exports, "__esModule", {
|
6746
6746
|
value: true
|
@@ -6796,9 +6796,9 @@
|
|
6796
6796
|
}
|
6797
6797
|
});
|
6798
6798
|
|
6799
|
-
// ../../node_modules/.pnpm/graphql@16.
|
6799
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/characterClasses.js
|
6800
6800
|
var require_characterClasses = __commonJS({
|
6801
|
-
"../../node_modules/.pnpm/graphql@16.
|
6801
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/characterClasses.js"(exports) {
|
6802
6802
|
"use strict";
|
6803
6803
|
Object.defineProperty(exports, "__esModule", {
|
6804
6804
|
value: true
|
@@ -6827,9 +6827,9 @@
|
|
6827
6827
|
}
|
6828
6828
|
});
|
6829
6829
|
|
6830
|
-
// ../../node_modules/.pnpm/graphql@16.
|
6830
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/blockString.js
|
6831
6831
|
var require_blockString = __commonJS({
|
6832
|
-
"../../node_modules/.pnpm/graphql@16.
|
6832
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/blockString.js"(exports) {
|
6833
6833
|
"use strict";
|
6834
6834
|
Object.defineProperty(exports, "__esModule", {
|
6835
6835
|
value: true
|
@@ -6946,9 +6946,9 @@
|
|
6946
6946
|
}
|
6947
6947
|
});
|
6948
6948
|
|
6949
|
-
// ../../node_modules/.pnpm/graphql@16.
|
6949
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/tokenKind.js
|
6950
6950
|
var require_tokenKind = __commonJS({
|
6951
|
-
"../../node_modules/.pnpm/graphql@16.
|
6951
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/tokenKind.js"(exports) {
|
6952
6952
|
"use strict";
|
6953
6953
|
Object.defineProperty(exports, "__esModule", {
|
6954
6954
|
value: true
|
@@ -6983,9 +6983,9 @@
|
|
6983
6983
|
}
|
6984
6984
|
});
|
6985
6985
|
|
6986
|
-
// ../../node_modules/.pnpm/graphql@16.
|
6986
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/lexer.js
|
6987
6987
|
var require_lexer = __commonJS({
|
6988
|
-
"../../node_modules/.pnpm/graphql@16.
|
6988
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/lexer.js"(exports) {
|
6989
6989
|
"use strict";
|
6990
6990
|
Object.defineProperty(exports, "__esModule", {
|
6991
6991
|
value: true
|
@@ -7590,9 +7590,9 @@
|
|
7590
7590
|
}
|
7591
7591
|
});
|
7592
7592
|
|
7593
|
-
// ../../node_modules/.pnpm/graphql@16.
|
7593
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/devAssert.js
|
7594
7594
|
var require_devAssert = __commonJS({
|
7595
|
-
"../../node_modules/.pnpm/graphql@16.
|
7595
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/devAssert.js"(exports) {
|
7596
7596
|
"use strict";
|
7597
7597
|
Object.defineProperty(exports, "__esModule", {
|
7598
7598
|
value: true
|
@@ -7607,9 +7607,9 @@
|
|
7607
7607
|
}
|
7608
7608
|
});
|
7609
7609
|
|
7610
|
-
// ../../node_modules/.pnpm/graphql@16.
|
7610
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/inspect.js
|
7611
7611
|
var require_inspect = __commonJS({
|
7612
|
-
"../../node_modules/.pnpm/graphql@16.
|
7612
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/inspect.js"(exports) {
|
7613
7613
|
"use strict";
|
7614
7614
|
Object.defineProperty(exports, "__esModule", {
|
7615
7615
|
value: true
|
@@ -7699,19 +7699,21 @@
|
|
7699
7699
|
}
|
7700
7700
|
});
|
7701
7701
|
|
7702
|
-
// ../../node_modules/.pnpm/graphql@16.
|
7702
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/instanceOf.js
|
7703
7703
|
var require_instanceOf = __commonJS({
|
7704
|
-
"../../node_modules/.pnpm/graphql@16.
|
7704
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/instanceOf.js"(exports) {
|
7705
7705
|
"use strict";
|
7706
7706
|
Object.defineProperty(exports, "__esModule", {
|
7707
7707
|
value: true
|
7708
7708
|
});
|
7709
7709
|
exports.instanceOf = void 0;
|
7710
7710
|
var _inspect = require_inspect();
|
7711
|
+
var isProduction2 = globalThis.process && // eslint-disable-next-line no-undef
|
7712
|
+
process.env.NODE_ENV === "production";
|
7711
7713
|
var instanceOf4 = (
|
7712
7714
|
/* c8 ignore next 6 */
|
7713
7715
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
7714
|
-
|
7716
|
+
isProduction2 ? function instanceOf5(value, constructor) {
|
7715
7717
|
return value instanceof constructor;
|
7716
7718
|
} : function instanceOf5(value, constructor) {
|
7717
7719
|
if (value instanceof constructor) {
|
@@ -7747,9 +7749,9 @@ spurious results.`);
|
|
7747
7749
|
}
|
7748
7750
|
});
|
7749
7751
|
|
7750
|
-
// ../../node_modules/.pnpm/graphql@16.
|
7752
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/source.js
|
7751
7753
|
var require_source = __commonJS({
|
7752
|
-
"../../node_modules/.pnpm/graphql@16.
|
7754
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/source.js"(exports) {
|
7753
7755
|
"use strict";
|
7754
7756
|
Object.defineProperty(exports, "__esModule", {
|
7755
7757
|
value: true
|
@@ -7791,9 +7793,9 @@ spurious results.`);
|
|
7791
7793
|
}
|
7792
7794
|
});
|
7793
7795
|
|
7794
|
-
// ../../node_modules/.pnpm/graphql@16.
|
7796
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/parser.js
|
7795
7797
|
var require_parser = __commonJS({
|
7796
|
-
"../../node_modules/.pnpm/graphql@16.
|
7798
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/parser.js"(exports) {
|
7797
7799
|
"use strict";
|
7798
7800
|
Object.defineProperty(exports, "__esModule", {
|
7799
7801
|
value: true
|
@@ -9100,9 +9102,9 @@ spurious results.`);
|
|
9100
9102
|
}
|
9101
9103
|
});
|
9102
9104
|
|
9103
|
-
// ../../node_modules/.pnpm/graphql@16.
|
9105
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/printString.js
|
9104
9106
|
var require_printString = __commonJS({
|
9105
|
-
"../../node_modules/.pnpm/graphql@16.
|
9107
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/printString.js"(exports) {
|
9106
9108
|
"use strict";
|
9107
9109
|
Object.defineProperty(exports, "__esModule", {
|
9108
9110
|
value: true
|
@@ -9285,9 +9287,9 @@ spurious results.`);
|
|
9285
9287
|
}
|
9286
9288
|
});
|
9287
9289
|
|
9288
|
-
// ../../node_modules/.pnpm/graphql@16.
|
9290
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/visitor.js
|
9289
9291
|
var require_visitor = __commonJS({
|
9290
|
-
"../../node_modules/.pnpm/graphql@16.
|
9292
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/visitor.js"(exports) {
|
9291
9293
|
"use strict";
|
9292
9294
|
Object.defineProperty(exports, "__esModule", {
|
9293
9295
|
value: true
|
@@ -9496,9 +9498,9 @@ spurious results.`);
|
|
9496
9498
|
}
|
9497
9499
|
});
|
9498
9500
|
|
9499
|
-
// ../../node_modules/.pnpm/graphql@16.
|
9501
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/printer.js
|
9500
9502
|
var require_printer = __commonJS({
|
9501
|
-
"../../node_modules/.pnpm/graphql@16.
|
9503
|
+
"../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/printer.js"(exports) {
|
9502
9504
|
"use strict";
|
9503
9505
|
Object.defineProperty(exports, "__esModule", {
|
9504
9506
|
value: true
|
@@ -18786,7 +18788,7 @@ spurious results.`);
|
|
18786
18788
|
module.exports = iterate;
|
18787
18789
|
function iterate(list, iterator, state, callback) {
|
18788
18790
|
var key = state["keyedList"] ? state["keyedList"][state.index] : state.index;
|
18789
|
-
state.jobs[key] = runJob(iterator, key, list[key], function(error,
|
18791
|
+
state.jobs[key] = runJob(iterator, key, list[key], function(error, output3) {
|
18790
18792
|
if (!(key in state.jobs)) {
|
18791
18793
|
return;
|
18792
18794
|
}
|
@@ -18794,7 +18796,7 @@ spurious results.`);
|
|
18794
18796
|
if (error) {
|
18795
18797
|
abort(state);
|
18796
18798
|
} else {
|
18797
|
-
state.results[key] =
|
18799
|
+
state.results[key] = output3;
|
18798
18800
|
}
|
18799
18801
|
callback(error, state.results);
|
18800
18802
|
});
|
@@ -19257,9 +19259,9 @@ spurious results.`);
|
|
19257
19259
|
}
|
19258
19260
|
});
|
19259
19261
|
|
19260
|
-
// ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.
|
19262
|
+
// ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.9.0/node_modules/graphql-request/dist/defaultJsonSerializer.js
|
19261
19263
|
var require_defaultJsonSerializer = __commonJS({
|
19262
|
-
"../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.
|
19264
|
+
"../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.9.0/node_modules/graphql-request/dist/defaultJsonSerializer.js"(exports) {
|
19263
19265
|
"use strict";
|
19264
19266
|
Object.defineProperty(exports, "__esModule", { value: true });
|
19265
19267
|
exports.defaultJsonSerializer = void 0;
|
@@ -19270,9 +19272,9 @@ spurious results.`);
|
|
19270
19272
|
}
|
19271
19273
|
});
|
19272
19274
|
|
19273
|
-
// ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.
|
19275
|
+
// ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.9.0/node_modules/graphql-request/dist/createRequestBody.js
|
19274
19276
|
var require_createRequestBody = __commonJS({
|
19275
|
-
"../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.
|
19277
|
+
"../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.9.0/node_modules/graphql-request/dist/createRequestBody.js"(exports) {
|
19276
19278
|
"use strict";
|
19277
19279
|
var __importDefault = exports && exports.__importDefault || function(mod2) {
|
19278
19280
|
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
@@ -19321,9 +19323,9 @@ spurious results.`);
|
|
19321
19323
|
}
|
19322
19324
|
});
|
19323
19325
|
|
19324
|
-
// ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.
|
19326
|
+
// ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.9.0/node_modules/graphql-request/dist/parseArgs.js
|
19325
19327
|
var require_parseArgs = __commonJS({
|
19326
|
-
"../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.
|
19328
|
+
"../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.9.0/node_modules/graphql-request/dist/parseArgs.js"(exports) {
|
19327
19329
|
"use strict";
|
19328
19330
|
Object.defineProperty(exports, "__esModule", { value: true });
|
19329
19331
|
exports.parseBatchRequestsExtendedArgs = exports.parseRawRequestExtendedArgs = exports.parseRequestExtendedArgs = exports.parseBatchRequestArgs = exports.parseRawRequestArgs = exports.parseRequestArgs = void 0;
|
@@ -19385,9 +19387,9 @@ spurious results.`);
|
|
19385
19387
|
}
|
19386
19388
|
});
|
19387
19389
|
|
19388
|
-
// ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.
|
19390
|
+
// ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.9.0/node_modules/graphql-request/dist/types.js
|
19389
19391
|
var require_types = __commonJS({
|
19390
|
-
"../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.
|
19392
|
+
"../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.9.0/node_modules/graphql-request/dist/types.js"(exports) {
|
19391
19393
|
"use strict";
|
19392
19394
|
var __extends = exports && exports.__extends || function() {
|
19393
19395
|
var extendStatics = function(d, b) {
|
@@ -19445,9 +19447,9 @@ spurious results.`);
|
|
19445
19447
|
}
|
19446
19448
|
});
|
19447
19449
|
|
19448
|
-
// ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.
|
19450
|
+
// ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.9.0/node_modules/graphql-request/dist/graphql-ws.js
|
19449
19451
|
var require_graphql_ws = __commonJS({
|
19450
|
-
"../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.
|
19452
|
+
"../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.9.0/node_modules/graphql-request/dist/graphql-ws.js"(exports) {
|
19451
19453
|
"use strict";
|
19452
19454
|
var __assign2 = exports && exports.__assign || function() {
|
19453
19455
|
__assign2 = Object.assign || function(t) {
|
@@ -19817,9 +19819,9 @@ spurious results.`);
|
|
19817
19819
|
}
|
19818
19820
|
});
|
19819
19821
|
|
19820
|
-
// ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.
|
19822
|
+
// ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.9.0/node_modules/graphql-request/dist/index.js
|
19821
19823
|
var require_dist2 = __commonJS({
|
19822
|
-
"../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.
|
19824
|
+
"../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.9.0/node_modules/graphql-request/dist/index.js"(exports) {
|
19823
19825
|
"use strict";
|
19824
19826
|
var __assign2 = exports && exports.__assign || function() {
|
19825
19827
|
__assign2 = Object.assign || function(t) {
|
@@ -20556,8 +20558,8 @@ spurious results.`);
|
|
20556
20558
|
const ret3 = wasm$1.retd(addr, len);
|
20557
20559
|
return Instruction.__wrap(ret3);
|
20558
20560
|
}
|
20559
|
-
function aloc(
|
20560
|
-
const ret3 = wasm$1.aloc(
|
20561
|
+
function aloc(bytes3) {
|
20562
|
+
const ret3 = wasm$1.aloc(bytes3);
|
20561
20563
|
return Instruction.__wrap(ret3);
|
20562
20564
|
}
|
20563
20565
|
function mcl(dst_addr, len) {
|
@@ -21766,9 +21768,9 @@ spurious results.`);
|
|
21766
21768
|
* Construct the instruction from its parts.
|
21767
21769
|
* @param {RegId} bytes
|
21768
21770
|
*/
|
21769
|
-
constructor(
|
21770
|
-
_assertClass(
|
21771
|
-
var ptr0 =
|
21771
|
+
constructor(bytes3) {
|
21772
|
+
_assertClass(bytes3, RegId);
|
21773
|
+
var ptr0 = bytes3.__destroy_into_raw();
|
21772
21774
|
const ret3 = wasm$1.aloc_new_typescript(ptr0);
|
21773
21775
|
this.__wbg_ptr = ret3 >>> 0;
|
21774
21776
|
return this;
|
@@ -28305,8 +28307,8 @@ spurious results.`);
|
|
28305
28307
|
}
|
28306
28308
|
}
|
28307
28309
|
}
|
28308
|
-
const
|
28309
|
-
return await WebAssembly.instantiate(
|
28310
|
+
const bytes3 = await module2.arrayBuffer();
|
28311
|
+
return await WebAssembly.instantiate(bytes3, imports);
|
28310
28312
|
} else {
|
28311
28313
|
const instance = await WebAssembly.instantiate(module2, imports);
|
28312
28314
|
if (instance instanceof WebAssembly.Instance) {
|
@@ -28636,9 +28638,9 @@ spurious results.`);
|
|
28636
28638
|
// ../versions/dist/index.mjs
|
28637
28639
|
function getBuiltinVersions() {
|
28638
28640
|
return {
|
28639
|
-
FORC: "0.
|
28640
|
-
FUEL_CORE: "0.
|
28641
|
-
FUELS: "0.
|
28641
|
+
FORC: "0.61.2",
|
28642
|
+
FUEL_CORE: "0.31.0",
|
28643
|
+
FUELS: "0.92.0"
|
28642
28644
|
};
|
28643
28645
|
}
|
28644
28646
|
function parseVersion(version) {
|
@@ -28761,15 +28763,17 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
28761
28763
|
ErrorCode2["UNLOCKED_WALLET_REQUIRED"] = "unlocked-wallet-required";
|
28762
28764
|
ErrorCode2["ERROR_BUILDING_BLOCK_EXPLORER_URL"] = "error-building-block-explorer-url";
|
28763
28765
|
ErrorCode2["VITEPRESS_PLUGIN_ERROR"] = "vitepress-plugin-error";
|
28764
|
-
ErrorCode2["INVALID_MULTICALL"] = "invalid-multicall";
|
28765
28766
|
ErrorCode2["SCRIPT_REVERTED"] = "script-reverted";
|
28766
28767
|
ErrorCode2["SCRIPT_RETURN_INVALID_TYPE"] = "script-return-invalid-type";
|
28767
28768
|
ErrorCode2["STREAM_PARSING_ERROR"] = "stream-parsing-error";
|
28769
|
+
ErrorCode2["NODE_LAUNCH_FAILED"] = "node-launch-failed";
|
28770
|
+
ErrorCode2["UNKNOWN"] = "unknown";
|
28768
28771
|
return ErrorCode2;
|
28769
28772
|
})(ErrorCode || {});
|
28770
28773
|
var _FuelError = class extends Error {
|
28771
28774
|
VERSIONS = versions;
|
28772
28775
|
metadata;
|
28776
|
+
rawError;
|
28773
28777
|
static parse(e) {
|
28774
28778
|
const error = e;
|
28775
28779
|
if (error.code === void 0) {
|
@@ -28789,15 +28793,16 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
28789
28793
|
return new _FuelError(error.code, error.message);
|
28790
28794
|
}
|
28791
28795
|
code;
|
28792
|
-
constructor(code, message, metadata = {}) {
|
28796
|
+
constructor(code, message, metadata = {}, rawError = {}) {
|
28793
28797
|
super(message);
|
28794
28798
|
this.code = code;
|
28795
28799
|
this.name = "FuelError";
|
28796
28800
|
this.metadata = metadata;
|
28801
|
+
this.rawError = rawError;
|
28797
28802
|
}
|
28798
28803
|
toObject() {
|
28799
|
-
const { code, name, message, metadata, VERSIONS } = this;
|
28800
|
-
return { code, name, message, metadata, VERSIONS };
|
28804
|
+
const { code, name, message, metadata, VERSIONS, rawError } = this;
|
28805
|
+
return { code, name, message, metadata, VERSIONS, rawError };
|
28801
28806
|
}
|
28802
28807
|
};
|
28803
28808
|
var FuelError = _FuelError;
|
@@ -28839,15 +28844,15 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
28839
28844
|
// ANCHOR: HELPERS
|
28840
28845
|
// make sure we always include `0x` in hex strings
|
28841
28846
|
toString(base, length) {
|
28842
|
-
const
|
28847
|
+
const output3 = super.toString(base, length);
|
28843
28848
|
if (base === 16 || base === "hex") {
|
28844
|
-
return `0x${
|
28849
|
+
return `0x${output3}`;
|
28845
28850
|
}
|
28846
|
-
return
|
28851
|
+
return output3;
|
28847
28852
|
}
|
28848
28853
|
toHex(bytesPadding) {
|
28849
|
-
const
|
28850
|
-
const bytesLength =
|
28854
|
+
const bytes3 = bytesPadding || 0;
|
28855
|
+
const bytesLength = bytes3 * 2;
|
28851
28856
|
if (this.isNeg()) {
|
28852
28857
|
throw new FuelError(ErrorCode.CONVERTING_FAILED, "Cannot convert negative value to hex.");
|
28853
28858
|
}
|
@@ -28958,21 +28963,21 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
28958
28963
|
// END ANCHOR: OVERRIDES to output our BN type
|
28959
28964
|
// ANCHOR: OVERRIDES to avoid losing references
|
28960
28965
|
caller(v, methodName) {
|
28961
|
-
const
|
28962
|
-
if (BN.isBN(
|
28963
|
-
return new BN(
|
28966
|
+
const output3 = super[methodName](new BN(v));
|
28967
|
+
if (BN.isBN(output3)) {
|
28968
|
+
return new BN(output3.toArray());
|
28964
28969
|
}
|
28965
|
-
if (typeof
|
28966
|
-
return
|
28970
|
+
if (typeof output3 === "boolean") {
|
28971
|
+
return output3;
|
28967
28972
|
}
|
28968
|
-
return
|
28973
|
+
return output3;
|
28969
28974
|
}
|
28970
28975
|
clone() {
|
28971
28976
|
return new BN(this.toArray());
|
28972
28977
|
}
|
28973
28978
|
mulTo(num, out) {
|
28974
|
-
const
|
28975
|
-
return new BN(
|
28979
|
+
const output3 = new import_bn.default(this.toArray()).mulTo(num, out);
|
28980
|
+
return new BN(output3.toArray());
|
28976
28981
|
}
|
28977
28982
|
egcd(p) {
|
28978
28983
|
const { a, b, gcd } = new import_bn.default(this.toArray()).egcd(p);
|
@@ -29030,15 +29035,15 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
29030
29035
|
__defNormalProp3(obj, typeof key !== "symbol" ? key + "" : key, value);
|
29031
29036
|
return value;
|
29032
29037
|
};
|
29033
|
-
var chunkAndPadBytes = (
|
29038
|
+
var chunkAndPadBytes = (bytes3, chunkSize) => {
|
29034
29039
|
const chunks = [];
|
29035
|
-
for (let offset = 0; offset <
|
29040
|
+
for (let offset = 0; offset < bytes3.length; offset += chunkSize) {
|
29036
29041
|
const chunk = new Uint8Array(chunkSize);
|
29037
|
-
chunk.set(
|
29042
|
+
chunk.set(bytes3.slice(offset, offset + chunkSize));
|
29038
29043
|
chunks.push(chunk);
|
29039
29044
|
}
|
29040
29045
|
const lastChunk = chunks[chunks.length - 1];
|
29041
|
-
const remainingBytes =
|
29046
|
+
const remainingBytes = bytes3.length % chunkSize;
|
29042
29047
|
const paddedChunkLength = remainingBytes + (8 - remainingBytes % 8) % 8;
|
29043
29048
|
const newChunk = lastChunk.slice(0, paddedChunkLength);
|
29044
29049
|
chunks[chunks.length - 1] = newChunk;
|
@@ -29081,15 +29086,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29081
29086
|
return concatenated;
|
29082
29087
|
};
|
29083
29088
|
var concat = (arrays) => {
|
29084
|
-
const
|
29085
|
-
return concatBytes(
|
29089
|
+
const bytes3 = arrays.map((v) => arrayify(v));
|
29090
|
+
return concatBytes(bytes3);
|
29086
29091
|
};
|
29087
29092
|
var HexCharacters = "0123456789abcdef";
|
29088
29093
|
function hexlify(data) {
|
29089
|
-
const
|
29094
|
+
const bytes3 = arrayify(data);
|
29090
29095
|
let result = "0x";
|
29091
|
-
for (let i = 0; i <
|
29092
|
-
const v =
|
29096
|
+
for (let i = 0; i < bytes3.length; i++) {
|
29097
|
+
const v = bytes3[i];
|
29093
29098
|
result += HexCharacters[(v & 240) >> 4] + HexCharacters[v & 15];
|
29094
29099
|
}
|
29095
29100
|
return result;
|
@@ -29182,15 +29187,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29182
29187
|
return bn(result);
|
29183
29188
|
}
|
29184
29189
|
function encodeBase58(_value) {
|
29185
|
-
const
|
29186
|
-
let value = bn(
|
29190
|
+
const bytes3 = arrayify(_value);
|
29191
|
+
let value = bn(bytes3);
|
29187
29192
|
let result = "";
|
29188
29193
|
while (value.gt(BN_0)) {
|
29189
29194
|
result = Alphabet[Number(value.mod(BN_58))] + result;
|
29190
29195
|
value = value.div(BN_58);
|
29191
29196
|
}
|
29192
|
-
for (let i = 0; i <
|
29193
|
-
if (
|
29197
|
+
for (let i = 0; i < bytes3.length; i++) {
|
29198
|
+
if (bytes3[i]) {
|
29194
29199
|
break;
|
29195
29200
|
}
|
29196
29201
|
result = Alphabet[0] + result;
|
@@ -29206,11 +29211,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29206
29211
|
return result;
|
29207
29212
|
}
|
29208
29213
|
function dataSlice(data, start, end) {
|
29209
|
-
const
|
29210
|
-
if (end != null && end >
|
29214
|
+
const bytes3 = arrayify(data);
|
29215
|
+
if (end != null && end > bytes3.length) {
|
29211
29216
|
throw new FuelError(ErrorCode.INVALID_DATA, "cannot slice beyond data bounds");
|
29212
29217
|
}
|
29213
|
-
return hexlify(
|
29218
|
+
return hexlify(bytes3.slice(start == null ? 0 : start, end == null ? bytes3.length : end));
|
29214
29219
|
}
|
29215
29220
|
function toUtf8Bytes(stri, form = true) {
|
29216
29221
|
let str = stri;
|
@@ -29247,8 +29252,8 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29247
29252
|
}
|
29248
29253
|
return new Uint8Array(result);
|
29249
29254
|
}
|
29250
|
-
function onError(reason, offset,
|
29251
|
-
console.log(`invalid codepoint at offset ${offset}; ${reason}, bytes: ${
|
29255
|
+
function onError(reason, offset, bytes3, output3, badCodepoint) {
|
29256
|
+
console.log(`invalid codepoint at offset ${offset}; ${reason}, bytes: ${bytes3}`);
|
29252
29257
|
return offset;
|
29253
29258
|
}
|
29254
29259
|
function helper(codePoints) {
|
@@ -29264,11 +29269,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29264
29269
|
}).join("");
|
29265
29270
|
}
|
29266
29271
|
function getUtf8CodePoints(_bytes) {
|
29267
|
-
const
|
29272
|
+
const bytes3 = arrayify(_bytes, "bytes");
|
29268
29273
|
const result = [];
|
29269
29274
|
let i = 0;
|
29270
|
-
while (i <
|
29271
|
-
const c =
|
29275
|
+
while (i < bytes3.length) {
|
29276
|
+
const c = bytes3[i++];
|
29272
29277
|
if (c >> 7 === 0) {
|
29273
29278
|
result.push(c);
|
29274
29279
|
continue;
|
@@ -29286,21 +29291,21 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29286
29291
|
overlongMask = 65535;
|
29287
29292
|
} else {
|
29288
29293
|
if ((c & 192) === 128) {
|
29289
|
-
i += onError("UNEXPECTED_CONTINUE", i - 1,
|
29294
|
+
i += onError("UNEXPECTED_CONTINUE", i - 1, bytes3, result);
|
29290
29295
|
} else {
|
29291
|
-
i += onError("BAD_PREFIX", i - 1,
|
29296
|
+
i += onError("BAD_PREFIX", i - 1, bytes3, result);
|
29292
29297
|
}
|
29293
29298
|
continue;
|
29294
29299
|
}
|
29295
|
-
if (i - 1 + extraLength >=
|
29296
|
-
i += onError("OVERRUN", i - 1,
|
29300
|
+
if (i - 1 + extraLength >= bytes3.length) {
|
29301
|
+
i += onError("OVERRUN", i - 1, bytes3, result);
|
29297
29302
|
continue;
|
29298
29303
|
}
|
29299
29304
|
let res = c & (1 << 8 - extraLength - 1) - 1;
|
29300
29305
|
for (let j = 0; j < extraLength; j++) {
|
29301
|
-
const nextChar =
|
29306
|
+
const nextChar = bytes3[i];
|
29302
29307
|
if ((nextChar & 192) !== 128) {
|
29303
|
-
i += onError("MISSING_CONTINUE", i,
|
29308
|
+
i += onError("MISSING_CONTINUE", i, bytes3, result);
|
29304
29309
|
res = null;
|
29305
29310
|
break;
|
29306
29311
|
}
|
@@ -29311,23 +29316,23 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29311
29316
|
continue;
|
29312
29317
|
}
|
29313
29318
|
if (res > 1114111) {
|
29314
|
-
i += onError("OUT_OF_RANGE", i - 1 - extraLength,
|
29319
|
+
i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes3, result, res);
|
29315
29320
|
continue;
|
29316
29321
|
}
|
29317
29322
|
if (res >= 55296 && res <= 57343) {
|
29318
|
-
i += onError("UTF16_SURROGATE", i - 1 - extraLength,
|
29323
|
+
i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes3, result, res);
|
29319
29324
|
continue;
|
29320
29325
|
}
|
29321
29326
|
if (res <= overlongMask) {
|
29322
|
-
i += onError("OVERLONG", i - 1 - extraLength,
|
29327
|
+
i += onError("OVERLONG", i - 1 - extraLength, bytes3, result, res);
|
29323
29328
|
continue;
|
29324
29329
|
}
|
29325
29330
|
result.push(res);
|
29326
29331
|
}
|
29327
29332
|
return result;
|
29328
29333
|
}
|
29329
|
-
function toUtf8String(
|
29330
|
-
return helper(getUtf8CodePoints(
|
29334
|
+
function toUtf8String(bytes3) {
|
29335
|
+
return helper(getUtf8CodePoints(bytes3));
|
29331
29336
|
}
|
29332
29337
|
|
29333
29338
|
// ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/_assert.js
|
@@ -29344,11 +29349,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29344
29349
|
if (lengths.length > 0 && !lengths.includes(b.length))
|
29345
29350
|
throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);
|
29346
29351
|
}
|
29347
|
-
function hash(
|
29348
|
-
if (typeof
|
29352
|
+
function hash(hash4) {
|
29353
|
+
if (typeof hash4 !== "function" || typeof hash4.create !== "function")
|
29349
29354
|
throw new Error("Hash should be wrapped by utils.wrapConstructor");
|
29350
|
-
number(
|
29351
|
-
number(
|
29355
|
+
number(hash4.outputLen);
|
29356
|
+
number(hash4.blockLen);
|
29352
29357
|
}
|
29353
29358
|
function exists(instance, checkFinished = true) {
|
29354
29359
|
if (instance.destroyed)
|
@@ -29364,10 +29369,6 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29364
29369
|
}
|
29365
29370
|
}
|
29366
29371
|
|
29367
|
-
// ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/cryptoNode.js
|
29368
|
-
var nc = __toESM(__require("crypto"), 1);
|
29369
|
-
var crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : void 0;
|
29370
|
-
|
29371
29372
|
// ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/utils.js
|
29372
29373
|
var u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
29373
29374
|
function isBytes2(a) {
|
@@ -29390,22 +29391,6 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29390
29391
|
throw new Error(`expected Uint8Array, got ${typeof data}`);
|
29391
29392
|
return data;
|
29392
29393
|
}
|
29393
|
-
function concatBytes2(...arrays) {
|
29394
|
-
let sum = 0;
|
29395
|
-
for (let i = 0; i < arrays.length; i++) {
|
29396
|
-
const a = arrays[i];
|
29397
|
-
if (!isBytes2(a))
|
29398
|
-
throw new Error("Uint8Array expected");
|
29399
|
-
sum += a.length;
|
29400
|
-
}
|
29401
|
-
const res = new Uint8Array(sum);
|
29402
|
-
for (let i = 0, pad3 = 0; i < arrays.length; i++) {
|
29403
|
-
const a = arrays[i];
|
29404
|
-
res.set(a, pad3);
|
29405
|
-
pad3 += a.length;
|
29406
|
-
}
|
29407
|
-
return res;
|
29408
|
-
}
|
29409
29394
|
var Hash = class {
|
29410
29395
|
// Safe version that clones internal state
|
29411
29396
|
clone() {
|
@@ -29435,33 +29420,27 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29435
29420
|
hashC.create = (opts) => hashCons(opts);
|
29436
29421
|
return hashC;
|
29437
29422
|
}
|
29438
|
-
function randomBytes(bytesLength = 32) {
|
29439
|
-
if (crypto && typeof crypto.getRandomValues === "function") {
|
29440
|
-
return crypto.getRandomValues(new Uint8Array(bytesLength));
|
29441
|
-
}
|
29442
|
-
throw new Error("crypto.getRandomValues must be defined");
|
29443
|
-
}
|
29444
29423
|
|
29445
29424
|
// ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/_sha2.js
|
29446
|
-
function setBigUint64(view, byteOffset, value,
|
29425
|
+
function setBigUint64(view, byteOffset, value, isLE3) {
|
29447
29426
|
if (typeof view.setBigUint64 === "function")
|
29448
|
-
return view.setBigUint64(byteOffset, value,
|
29427
|
+
return view.setBigUint64(byteOffset, value, isLE3);
|
29449
29428
|
const _32n2 = BigInt(32);
|
29450
29429
|
const _u32_max = BigInt(4294967295);
|
29451
29430
|
const wh = Number(value >> _32n2 & _u32_max);
|
29452
29431
|
const wl = Number(value & _u32_max);
|
29453
|
-
const h =
|
29454
|
-
const l =
|
29455
|
-
view.setUint32(byteOffset + h, wh,
|
29456
|
-
view.setUint32(byteOffset + l, wl,
|
29432
|
+
const h = isLE3 ? 4 : 0;
|
29433
|
+
const l = isLE3 ? 0 : 4;
|
29434
|
+
view.setUint32(byteOffset + h, wh, isLE3);
|
29435
|
+
view.setUint32(byteOffset + l, wl, isLE3);
|
29457
29436
|
}
|
29458
29437
|
var SHA2 = class extends Hash {
|
29459
|
-
constructor(blockLen, outputLen, padOffset,
|
29438
|
+
constructor(blockLen, outputLen, padOffset, isLE3) {
|
29460
29439
|
super();
|
29461
29440
|
this.blockLen = blockLen;
|
29462
29441
|
this.outputLen = outputLen;
|
29463
29442
|
this.padOffset = padOffset;
|
29464
|
-
this.isLE =
|
29443
|
+
this.isLE = isLE3;
|
29465
29444
|
this.finished = false;
|
29466
29445
|
this.length = 0;
|
29467
29446
|
this.pos = 0;
|
@@ -29498,7 +29477,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29498
29477
|
exists(this);
|
29499
29478
|
output(out, this);
|
29500
29479
|
this.finished = true;
|
29501
|
-
const { buffer, view, blockLen, isLE:
|
29480
|
+
const { buffer, view, blockLen, isLE: isLE3 } = this;
|
29502
29481
|
let { pos } = this;
|
29503
29482
|
buffer[pos++] = 128;
|
29504
29483
|
this.buffer.subarray(pos).fill(0);
|
@@ -29508,7 +29487,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29508
29487
|
}
|
29509
29488
|
for (let i = pos; i < blockLen; i++)
|
29510
29489
|
buffer[i] = 0;
|
29511
|
-
setBigUint64(view, blockLen - 8, BigInt(this.length * 8),
|
29490
|
+
setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE3);
|
29512
29491
|
this.process(view, 0);
|
29513
29492
|
const oview = createView(out);
|
29514
29493
|
const len = this.outputLen;
|
@@ -29519,7 +29498,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29519
29498
|
if (outLen > state.length)
|
29520
29499
|
throw new Error("_sha2: outputLen bigger than state");
|
29521
29500
|
for (let i = 0; i < outLen; i++)
|
29522
|
-
oview.setUint32(4 * i, state[i],
|
29501
|
+
oview.setUint32(4 * i, state[i], isLE3);
|
29523
29502
|
}
|
29524
29503
|
digest() {
|
29525
29504
|
const { buffer, outputLen } = this;
|
@@ -29696,24 +29675,24 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29696
29675
|
|
29697
29676
|
// ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/hmac.js
|
29698
29677
|
var HMAC = class extends Hash {
|
29699
|
-
constructor(
|
29678
|
+
constructor(hash4, _key) {
|
29700
29679
|
super();
|
29701
29680
|
this.finished = false;
|
29702
29681
|
this.destroyed = false;
|
29703
|
-
hash(
|
29682
|
+
hash(hash4);
|
29704
29683
|
const key = toBytes2(_key);
|
29705
|
-
this.iHash =
|
29684
|
+
this.iHash = hash4.create();
|
29706
29685
|
if (typeof this.iHash.update !== "function")
|
29707
29686
|
throw new Error("Expected instance of class which extends utils.Hash");
|
29708
29687
|
this.blockLen = this.iHash.blockLen;
|
29709
29688
|
this.outputLen = this.iHash.outputLen;
|
29710
29689
|
const blockLen = this.blockLen;
|
29711
29690
|
const pad3 = new Uint8Array(blockLen);
|
29712
|
-
pad3.set(key.length > blockLen ?
|
29691
|
+
pad3.set(key.length > blockLen ? hash4.create().update(key).digest() : key);
|
29713
29692
|
for (let i = 0; i < pad3.length; i++)
|
29714
29693
|
pad3[i] ^= 54;
|
29715
29694
|
this.iHash.update(pad3);
|
29716
|
-
this.oHash =
|
29695
|
+
this.oHash = hash4.create();
|
29717
29696
|
for (let i = 0; i < pad3.length; i++)
|
29718
29697
|
pad3[i] ^= 54 ^ 92;
|
29719
29698
|
this.oHash.update(pad3);
|
@@ -29756,12 +29735,12 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29756
29735
|
this.iHash.destroy();
|
29757
29736
|
}
|
29758
29737
|
};
|
29759
|
-
var hmac = (
|
29760
|
-
hmac.create = (
|
29738
|
+
var hmac = (hash4, key, message) => new HMAC(hash4, key).update(message).digest();
|
29739
|
+
hmac.create = (hash4, key) => new HMAC(hash4, key);
|
29761
29740
|
|
29762
29741
|
// ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/pbkdf2.js
|
29763
|
-
function pbkdf2Init(
|
29764
|
-
hash(
|
29742
|
+
function pbkdf2Init(hash4, _password, _salt, _opts) {
|
29743
|
+
hash(hash4);
|
29765
29744
|
const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts);
|
29766
29745
|
const { c, dkLen, asyncTick } = opts;
|
29767
29746
|
number(c);
|
@@ -29772,7 +29751,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29772
29751
|
const password = toBytes2(_password);
|
29773
29752
|
const salt = toBytes2(_salt);
|
29774
29753
|
const DK = new Uint8Array(dkLen);
|
29775
|
-
const PRF = hmac.create(
|
29754
|
+
const PRF = hmac.create(hash4, password);
|
29776
29755
|
const PRFSalt = PRF._cloneInto().update(salt);
|
29777
29756
|
return { c, dkLen, asyncTick, DK, PRF, PRFSalt };
|
29778
29757
|
}
|
@@ -29784,8 +29763,8 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
29784
29763
|
u.fill(0);
|
29785
29764
|
return DK;
|
29786
29765
|
}
|
29787
|
-
function pbkdf2(
|
29788
|
-
const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(
|
29766
|
+
function pbkdf2(hash4, password, salt, opts) {
|
29767
|
+
const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash4, password, salt, opts);
|
29789
29768
|
let prfW;
|
29790
29769
|
const arr = new Uint8Array(4);
|
29791
29770
|
const view = createView(arr);
|
@@ -30112,9 +30091,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30112
30091
|
throw new Error("XOF is not possible for this instance");
|
30113
30092
|
return this.writeInto(out);
|
30114
30093
|
}
|
30115
|
-
xof(
|
30116
|
-
number(
|
30117
|
-
return this.xofInto(new Uint8Array(
|
30094
|
+
xof(bytes3) {
|
30095
|
+
number(bytes3);
|
30096
|
+
return this.xofInto(new Uint8Array(bytes3));
|
30118
30097
|
}
|
30119
30098
|
digestInto(out) {
|
30120
30099
|
output(out, this);
|
@@ -30257,11 +30236,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30257
30236
|
var ripemd160 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160());
|
30258
30237
|
|
30259
30238
|
// ../crypto/dist/index.mjs
|
30260
|
-
var
|
30261
|
-
var
|
30239
|
+
var import_crypto = __toESM(__require("crypto"), 1);
|
30240
|
+
var import_crypto2 = __require("crypto");
|
30241
|
+
var import_crypto3 = __toESM(__require("crypto"), 1);
|
30262
30242
|
var import_crypto4 = __toESM(__require("crypto"), 1);
|
30263
|
-
var import_crypto5 =
|
30264
|
-
var import_crypto6 = __require("crypto");
|
30243
|
+
var import_crypto5 = __require("crypto");
|
30265
30244
|
var scrypt2 = (params) => {
|
30266
30245
|
const { password, salt, n, p, r, dklen } = params;
|
30267
30246
|
const derivedKey = scrypt(password, salt, { N: n, r, p, dkLen: dklen });
|
@@ -30288,7 +30267,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30288
30267
|
Object.freeze(ripemd1602);
|
30289
30268
|
var bufferFromString = (string, encoding = "base64") => Uint8Array.from(Buffer.from(string, encoding));
|
30290
30269
|
var locked2 = false;
|
30291
|
-
var PBKDF2 = (password, salt, iterations, keylen, algo) => (0,
|
30270
|
+
var PBKDF2 = (password, salt, iterations, keylen, algo) => (0, import_crypto2.pbkdf2Sync)(password, salt, iterations, keylen, algo);
|
30292
30271
|
var pBkdf2 = PBKDF2;
|
30293
30272
|
function pbkdf22(_password, _salt, iterations, keylen, algo) {
|
30294
30273
|
const password = arrayify(_password, "password");
|
@@ -30306,8 +30285,8 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30306
30285
|
pBkdf2 = func;
|
30307
30286
|
};
|
30308
30287
|
Object.freeze(pbkdf22);
|
30309
|
-
var
|
30310
|
-
const randomValues = Uint8Array.from(
|
30288
|
+
var randomBytes = (length) => {
|
30289
|
+
const randomValues = Uint8Array.from(import_crypto3.default.randomBytes(length));
|
30311
30290
|
return randomValues;
|
30312
30291
|
};
|
30313
30292
|
var stringFromBuffer = (buffer, encoding = "base64") => Buffer.from(buffer).toString(encoding);
|
@@ -30318,11 +30297,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30318
30297
|
return arrayify(key);
|
30319
30298
|
};
|
30320
30299
|
var encrypt = async (password, data) => {
|
30321
|
-
const iv =
|
30322
|
-
const salt =
|
30300
|
+
const iv = randomBytes(16);
|
30301
|
+
const salt = randomBytes(32);
|
30323
30302
|
const secret = keyFromPassword(password, salt);
|
30324
30303
|
const dataBuffer = Uint8Array.from(Buffer.from(JSON.stringify(data), "utf-8"));
|
30325
|
-
const cipher = await
|
30304
|
+
const cipher = await import_crypto.default.createCipheriv(ALGORITHM, secret, iv);
|
30326
30305
|
let cipherData = cipher.update(dataBuffer);
|
30327
30306
|
cipherData = Buffer.concat([cipherData, cipher.final()]);
|
30328
30307
|
return {
|
@@ -30336,7 +30315,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30336
30315
|
const salt = bufferFromString(keystore.salt);
|
30337
30316
|
const secret = keyFromPassword(password, salt);
|
30338
30317
|
const encryptedText = bufferFromString(keystore.data);
|
30339
|
-
const decipher = await
|
30318
|
+
const decipher = await import_crypto.default.createDecipheriv(ALGORITHM, secret, iv);
|
30340
30319
|
const decrypted = decipher.update(encryptedText);
|
30341
30320
|
const deBuff = Buffer.concat([decrypted, decipher.final()]);
|
30342
30321
|
const decryptedData = Buffer.from(deBuff).toString("utf-8");
|
@@ -30347,17 +30326,17 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30347
30326
|
}
|
30348
30327
|
};
|
30349
30328
|
async function encryptJsonWalletData(data, key, iv) {
|
30350
|
-
const cipher = await
|
30329
|
+
const cipher = await import_crypto4.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
|
30351
30330
|
const encrypted = Buffer.concat([cipher.update(data), cipher.final()]);
|
30352
30331
|
return new Uint8Array(encrypted);
|
30353
30332
|
}
|
30354
30333
|
async function decryptJsonWalletData(data, key, iv) {
|
30355
|
-
const decipher =
|
30334
|
+
const decipher = import_crypto4.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
|
30356
30335
|
const decrypted = await Buffer.concat([decipher.update(data), decipher.final()]);
|
30357
30336
|
return new Uint8Array(decrypted);
|
30358
30337
|
}
|
30359
30338
|
var locked3 = false;
|
30360
|
-
var COMPUTEHMAC = (algorithm, key, data) => (0,
|
30339
|
+
var COMPUTEHMAC = (algorithm, key, data) => (0, import_crypto5.createHmac)(algorithm, key).update(data).digest();
|
30361
30340
|
var computeHMAC = COMPUTEHMAC;
|
30362
30341
|
function computeHmac(algorithm, _key, _data) {
|
30363
30342
|
const key = arrayify(_key, "key");
|
@@ -30381,7 +30360,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30381
30360
|
decrypt,
|
30382
30361
|
encrypt,
|
30383
30362
|
keyFromPassword,
|
30384
|
-
randomBytes
|
30363
|
+
randomBytes,
|
30385
30364
|
scrypt: scrypt2,
|
30386
30365
|
keccak256,
|
30387
30366
|
decryptJsonWalletData,
|
@@ -30396,7 +30375,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30396
30375
|
decrypt: decrypt2,
|
30397
30376
|
encrypt: encrypt2,
|
30398
30377
|
keyFromPassword: keyFromPassword2,
|
30399
|
-
randomBytes:
|
30378
|
+
randomBytes: randomBytes2,
|
30400
30379
|
stringFromBuffer: stringFromBuffer2,
|
30401
30380
|
scrypt: scrypt22,
|
30402
30381
|
keccak256: keccak2562,
|
@@ -30574,15 +30553,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30574
30553
|
if (data.length < this.encodedLength) {
|
30575
30554
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid b256 data size.`);
|
30576
30555
|
}
|
30577
|
-
let
|
30578
|
-
const decoded = bn(
|
30556
|
+
let bytes3 = data.slice(offset, offset + this.encodedLength);
|
30557
|
+
const decoded = bn(bytes3);
|
30579
30558
|
if (decoded.isZero()) {
|
30580
|
-
|
30559
|
+
bytes3 = new Uint8Array(32);
|
30581
30560
|
}
|
30582
|
-
if (
|
30561
|
+
if (bytes3.length !== this.encodedLength) {
|
30583
30562
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid b256 byte data size.`);
|
30584
30563
|
}
|
30585
|
-
return [toHex(
|
30564
|
+
return [toHex(bytes3, 32), offset + 32];
|
30586
30565
|
}
|
30587
30566
|
};
|
30588
30567
|
var B512Coder = class extends Coder {
|
@@ -30605,15 +30584,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30605
30584
|
if (data.length < this.encodedLength) {
|
30606
30585
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid b512 data size.`);
|
30607
30586
|
}
|
30608
|
-
let
|
30609
|
-
const decoded = bn(
|
30587
|
+
let bytes3 = data.slice(offset, offset + this.encodedLength);
|
30588
|
+
const decoded = bn(bytes3);
|
30610
30589
|
if (decoded.isZero()) {
|
30611
|
-
|
30590
|
+
bytes3 = new Uint8Array(64);
|
30612
30591
|
}
|
30613
|
-
if (
|
30592
|
+
if (bytes3.length !== this.encodedLength) {
|
30614
30593
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid b512 byte data size.`);
|
30615
30594
|
}
|
30616
|
-
return [toHex(
|
30595
|
+
return [toHex(bytes3, this.encodedLength), offset + this.encodedLength];
|
30617
30596
|
}
|
30618
30597
|
};
|
30619
30598
|
var encodedLengths = {
|
@@ -30625,24 +30604,24 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30625
30604
|
super("bigNumber", baseType, encodedLengths[baseType]);
|
30626
30605
|
}
|
30627
30606
|
encode(value) {
|
30628
|
-
let
|
30607
|
+
let bytes3;
|
30629
30608
|
try {
|
30630
|
-
|
30609
|
+
bytes3 = toBytes(value, this.encodedLength);
|
30631
30610
|
} catch (error) {
|
30632
30611
|
throw new FuelError(ErrorCode.ENCODE_ERROR, `Invalid ${this.type}.`);
|
30633
30612
|
}
|
30634
|
-
return
|
30613
|
+
return bytes3;
|
30635
30614
|
}
|
30636
30615
|
decode(data, offset) {
|
30637
30616
|
if (data.length < this.encodedLength) {
|
30638
30617
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid ${this.type} data size.`);
|
30639
30618
|
}
|
30640
|
-
let
|
30641
|
-
|
30642
|
-
if (
|
30619
|
+
let bytes3 = data.slice(offset, offset + this.encodedLength);
|
30620
|
+
bytes3 = bytes3.slice(0, this.encodedLength);
|
30621
|
+
if (bytes3.length !== this.encodedLength) {
|
30643
30622
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid ${this.type} byte data size.`);
|
30644
30623
|
}
|
30645
|
-
return [bn(
|
30624
|
+
return [bn(bytes3), offset + this.encodedLength];
|
30646
30625
|
}
|
30647
30626
|
};
|
30648
30627
|
var BooleanCoder = class extends Coder {
|
@@ -30665,11 +30644,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30665
30644
|
if (data.length < this.encodedLength) {
|
30666
30645
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid boolean data size.`);
|
30667
30646
|
}
|
30668
|
-
const
|
30669
|
-
if (
|
30647
|
+
const bytes3 = bn(data.slice(offset, offset + this.encodedLength));
|
30648
|
+
if (bytes3.isZero()) {
|
30670
30649
|
return [false, offset + this.encodedLength];
|
30671
30650
|
}
|
30672
|
-
if (!
|
30651
|
+
if (!bytes3.eq(bn(1))) {
|
30673
30652
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid boolean value.`);
|
30674
30653
|
}
|
30675
30654
|
return [true, offset + this.encodedLength];
|
@@ -30680,9 +30659,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30680
30659
|
super("struct", "struct Bytes", WORD_SIZE);
|
30681
30660
|
}
|
30682
30661
|
encode(value) {
|
30683
|
-
const
|
30684
|
-
const lengthBytes = new BigNumberCoder("u64").encode(
|
30685
|
-
return new Uint8Array([...lengthBytes, ...
|
30662
|
+
const bytes3 = value instanceof Uint8Array ? value : new Uint8Array(value);
|
30663
|
+
const lengthBytes = new BigNumberCoder("u64").encode(bytes3.length);
|
30664
|
+
return new Uint8Array([...lengthBytes, ...bytes3]);
|
30686
30665
|
}
|
30687
30666
|
decode(data, offset) {
|
30688
30667
|
if (data.length < WORD_SIZE) {
|
@@ -30809,26 +30788,26 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30809
30788
|
this.options = options;
|
30810
30789
|
}
|
30811
30790
|
encode(value) {
|
30812
|
-
let
|
30791
|
+
let bytes3;
|
30813
30792
|
try {
|
30814
|
-
|
30793
|
+
bytes3 = toBytes(value);
|
30815
30794
|
} catch (error) {
|
30816
30795
|
throw new FuelError(ErrorCode.ENCODE_ERROR, `Invalid ${this.baseType}.`);
|
30817
30796
|
}
|
30818
|
-
if (
|
30797
|
+
if (bytes3.length > this.encodedLength) {
|
30819
30798
|
throw new FuelError(ErrorCode.ENCODE_ERROR, `Invalid ${this.baseType}, too many bytes.`);
|
30820
30799
|
}
|
30821
|
-
return toBytes(
|
30800
|
+
return toBytes(bytes3, this.encodedLength);
|
30822
30801
|
}
|
30823
30802
|
decode(data, offset) {
|
30824
30803
|
if (data.length < this.encodedLength) {
|
30825
30804
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid number data size.`);
|
30826
30805
|
}
|
30827
|
-
const
|
30828
|
-
if (
|
30806
|
+
const bytes3 = data.slice(offset, offset + this.encodedLength);
|
30807
|
+
if (bytes3.length !== this.encodedLength) {
|
30829
30808
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid number byte data size.`);
|
30830
30809
|
}
|
30831
|
-
return [toNumber(
|
30810
|
+
return [toNumber(bytes3), offset + this.encodedLength];
|
30832
30811
|
}
|
30833
30812
|
};
|
30834
30813
|
var OptionCoder = class extends EnumCoder {
|
@@ -30846,9 +30825,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30846
30825
|
const [decoded, newOffset] = super.decode(data, offset);
|
30847
30826
|
return [this.toOption(decoded), newOffset];
|
30848
30827
|
}
|
30849
|
-
toOption(
|
30850
|
-
if (
|
30851
|
-
return
|
30828
|
+
toOption(output3) {
|
30829
|
+
if (output3 && "Some" in output3) {
|
30830
|
+
return output3.Some;
|
30852
30831
|
}
|
30853
30832
|
return void 0;
|
30854
30833
|
}
|
@@ -30862,9 +30841,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30862
30841
|
throw new FuelError(ErrorCode.ENCODE_ERROR, `Expected array value.`);
|
30863
30842
|
}
|
30864
30843
|
const internalCoder = new ArrayCoder(new NumberCoder("u8"), value.length);
|
30865
|
-
const
|
30866
|
-
const lengthBytes = new BigNumberCoder("u64").encode(
|
30867
|
-
return new Uint8Array([...lengthBytes, ...
|
30844
|
+
const bytes3 = internalCoder.encode(value);
|
30845
|
+
const lengthBytes = new BigNumberCoder("u64").encode(bytes3.length);
|
30846
|
+
return new Uint8Array([...lengthBytes, ...bytes3]);
|
30868
30847
|
}
|
30869
30848
|
decode(data, offset) {
|
30870
30849
|
if (data.length < this.encodedLength) {
|
@@ -30887,9 +30866,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30887
30866
|
super("struct", "struct String", WORD_SIZE);
|
30888
30867
|
}
|
30889
30868
|
encode(value) {
|
30890
|
-
const
|
30869
|
+
const bytes3 = toUtf8Bytes(value);
|
30891
30870
|
const lengthBytes = new BigNumberCoder("u64").encode(value.length);
|
30892
|
-
return new Uint8Array([...lengthBytes, ...
|
30871
|
+
return new Uint8Array([...lengthBytes, ...bytes3]);
|
30893
30872
|
}
|
30894
30873
|
decode(data, offset) {
|
30895
30874
|
if (data.length < this.encodedLength) {
|
@@ -30911,9 +30890,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30911
30890
|
super("strSlice", "str", WORD_SIZE);
|
30912
30891
|
}
|
30913
30892
|
encode(value) {
|
30914
|
-
const
|
30893
|
+
const bytes3 = toUtf8Bytes(value);
|
30915
30894
|
const lengthBytes = new BigNumberCoder("u64").encode(value.length);
|
30916
|
-
return new Uint8Array([...lengthBytes, ...
|
30895
|
+
return new Uint8Array([...lengthBytes, ...bytes3]);
|
30917
30896
|
}
|
30918
30897
|
decode(data, offset) {
|
30919
30898
|
if (data.length < this.encodedLength) {
|
@@ -30922,11 +30901,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30922
30901
|
const offsetAndLength = offset + WORD_SIZE;
|
30923
30902
|
const lengthBytes = data.slice(offset, offsetAndLength);
|
30924
30903
|
const length = bn(new BigNumberCoder("u64").decode(lengthBytes, 0)[0]).toNumber();
|
30925
|
-
const
|
30926
|
-
if (
|
30904
|
+
const bytes3 = data.slice(offsetAndLength, offsetAndLength + length);
|
30905
|
+
if (bytes3.length !== length) {
|
30927
30906
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid string slice byte data size.`);
|
30928
30907
|
}
|
30929
|
-
return [toUtf8String(
|
30908
|
+
return [toUtf8String(bytes3), offsetAndLength + length];
|
30930
30909
|
}
|
30931
30910
|
};
|
30932
30911
|
__publicField4(StrSliceCoder, "memorySize", 1);
|
@@ -30944,11 +30923,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30944
30923
|
if (data.length < this.encodedLength) {
|
30945
30924
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid string data size.`);
|
30946
30925
|
}
|
30947
|
-
const
|
30948
|
-
if (
|
30926
|
+
const bytes3 = data.slice(offset, offset + this.encodedLength);
|
30927
|
+
if (bytes3.length !== this.encodedLength) {
|
30949
30928
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid string byte data size.`);
|
30950
30929
|
}
|
30951
|
-
return [toUtf8String(
|
30930
|
+
return [toUtf8String(bytes3), offset + this.encodedLength];
|
30952
30931
|
}
|
30953
30932
|
};
|
30954
30933
|
var StructCoder = class extends Coder {
|
@@ -31042,9 +31021,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
31042
31021
|
if (isUint8Array(value)) {
|
31043
31022
|
return new Uint8Array([...lengthCoder.encode(value.length), ...value]);
|
31044
31023
|
}
|
31045
|
-
const
|
31024
|
+
const bytes3 = value.map((v) => this.coder.encode(v));
|
31046
31025
|
const lengthBytes = lengthCoder.encode(value.length);
|
31047
|
-
return new Uint8Array([...lengthBytes, ...concatBytes(
|
31026
|
+
return new Uint8Array([...lengthBytes, ...concatBytes(bytes3)]);
|
31048
31027
|
}
|
31049
31028
|
decode(data, offset) {
|
31050
31029
|
if (!this.#hasNestedOption && data.length < this.encodedLength || data.length > MAX_BYTES) {
|
@@ -31423,10 +31402,10 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
31423
31402
|
throw new FuelError(ErrorCode.ABI_TYPES_AND_VALUES_MISMATCH, errorMsg);
|
31424
31403
|
}
|
31425
31404
|
decodeArguments(data) {
|
31426
|
-
const
|
31405
|
+
const bytes3 = arrayify(data);
|
31427
31406
|
const nonEmptyInputs = findNonEmptyInputs(this.jsonAbi, this.jsonFn.inputs);
|
31428
31407
|
if (nonEmptyInputs.length === 0) {
|
31429
|
-
if (
|
31408
|
+
if (bytes3.length === 0) {
|
31430
31409
|
return void 0;
|
31431
31410
|
}
|
31432
31411
|
throw new FuelError(
|
@@ -31435,12 +31414,12 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
31435
31414
|
count: {
|
31436
31415
|
types: this.jsonFn.inputs.length,
|
31437
31416
|
nonEmptyInputs: nonEmptyInputs.length,
|
31438
|
-
values:
|
31417
|
+
values: bytes3.length
|
31439
31418
|
},
|
31440
31419
|
value: {
|
31441
31420
|
args: this.jsonFn.inputs,
|
31442
31421
|
nonEmptyInputs,
|
31443
|
-
values:
|
31422
|
+
values: bytes3
|
31444
31423
|
}
|
31445
31424
|
})}`
|
31446
31425
|
);
|
@@ -31448,7 +31427,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
31448
31427
|
const result = nonEmptyInputs.reduce(
|
31449
31428
|
(obj, input) => {
|
31450
31429
|
const coder = AbiCoder.getCoder(this.jsonAbi, input, { encoding: this.encoding });
|
31451
|
-
const [decodedValue, decodedValueByteSize] = coder.decode(
|
31430
|
+
const [decodedValue, decodedValueByteSize] = coder.decode(bytes3, obj.offset);
|
31452
31431
|
return {
|
31453
31432
|
decoded: [...obj.decoded, decodedValue],
|
31454
31433
|
offset: obj.offset + decodedValueByteSize
|
@@ -31463,11 +31442,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
31463
31442
|
if (outputAbiType.type === "()") {
|
31464
31443
|
return [void 0, 0];
|
31465
31444
|
}
|
31466
|
-
const
|
31445
|
+
const bytes3 = arrayify(data);
|
31467
31446
|
const coder = AbiCoder.getCoder(this.jsonAbi, this.jsonFn.output, {
|
31468
31447
|
encoding: this.encoding
|
31469
31448
|
});
|
31470
|
-
return coder.decode(
|
31449
|
+
return coder.decode(bytes3, 0);
|
31471
31450
|
}
|
31472
31451
|
/**
|
31473
31452
|
* Checks if the function is read-only i.e. it only reads from storage, does not write to it.
|
@@ -31601,9 +31580,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
31601
31580
|
}
|
31602
31581
|
return addressLike;
|
31603
31582
|
};
|
31604
|
-
var getRandomB256 = () => hexlify(
|
31583
|
+
var getRandomB256 = () => hexlify(randomBytes2(32));
|
31605
31584
|
var clearFirst12BytesFromB256 = (b256) => {
|
31606
|
-
let
|
31585
|
+
let bytes3;
|
31607
31586
|
try {
|
31608
31587
|
if (!isB256(b256)) {
|
31609
31588
|
throw new FuelError(
|
@@ -31611,15 +31590,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
31611
31590
|
`Invalid Bech32 Address: ${b256}.`
|
31612
31591
|
);
|
31613
31592
|
}
|
31614
|
-
|
31615
|
-
|
31593
|
+
bytes3 = getBytesFromBech32(toBech32(b256));
|
31594
|
+
bytes3 = hexlify(bytes3.fill(0, 0, 12));
|
31616
31595
|
} catch (error) {
|
31617
31596
|
throw new FuelError(
|
31618
31597
|
FuelError.CODES.PARSE_FAILED,
|
31619
31598
|
`Cannot generate EVM Address B256 from: ${b256}.`
|
31620
31599
|
);
|
31621
31600
|
}
|
31622
|
-
return
|
31601
|
+
return bytes3;
|
31623
31602
|
};
|
31624
31603
|
var padFirst12BytesOfEvmAddress = (address) => {
|
31625
31604
|
if (!isEvmAddress(address)) {
|
@@ -32193,9 +32172,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
32193
32172
|
return sha2562(concat(parts));
|
32194
32173
|
}
|
32195
32174
|
static encodeData(messageData) {
|
32196
|
-
const
|
32197
|
-
const dataLength =
|
32198
|
-
return new ByteArrayCoder(dataLength).encode(
|
32175
|
+
const bytes3 = arrayify(messageData || "0x");
|
32176
|
+
const dataLength = bytes3.length;
|
32177
|
+
return new ByteArrayCoder(dataLength).encode(bytes3);
|
32199
32178
|
}
|
32200
32179
|
encode(value) {
|
32201
32180
|
const parts = [];
|
@@ -32217,9 +32196,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
32217
32196
|
return concat(parts);
|
32218
32197
|
}
|
32219
32198
|
static decodeData(messageData) {
|
32220
|
-
const
|
32221
|
-
const dataLength =
|
32222
|
-
const [data] = new ByteArrayCoder(dataLength).decode(
|
32199
|
+
const bytes3 = arrayify(messageData);
|
32200
|
+
const dataLength = bytes3.length;
|
32201
|
+
const [data] = new ByteArrayCoder(dataLength).decode(bytes3, 0);
|
32223
32202
|
return arrayify(data);
|
32224
32203
|
}
|
32225
32204
|
decode(data, offset) {
|
@@ -33299,9 +33278,10 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33299
33278
|
}
|
33300
33279
|
};
|
33301
33280
|
|
33302
|
-
// ../../node_modules/.pnpm/@noble+curves@1.
|
33281
|
+
// ../../node_modules/.pnpm/@noble+curves@1.4.2/node_modules/@noble/curves/esm/abstract/utils.js
|
33303
33282
|
var utils_exports = {};
|
33304
33283
|
__export(utils_exports, {
|
33284
|
+
abytes: () => abytes,
|
33305
33285
|
bitGet: () => bitGet,
|
33306
33286
|
bitLen: () => bitLen,
|
33307
33287
|
bitMask: () => bitMask,
|
@@ -33309,7 +33289,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33309
33289
|
bytesToHex: () => bytesToHex,
|
33310
33290
|
bytesToNumberBE: () => bytesToNumberBE,
|
33311
33291
|
bytesToNumberLE: () => bytesToNumberLE,
|
33312
|
-
concatBytes: () =>
|
33292
|
+
concatBytes: () => concatBytes2,
|
33313
33293
|
createHmacDrbg: () => createHmacDrbg,
|
33314
33294
|
ensureBytes: () => ensureBytes,
|
33315
33295
|
equalBytes: () => equalBytes,
|
@@ -33323,19 +33303,22 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33323
33303
|
utf8ToBytes: () => utf8ToBytes2,
|
33324
33304
|
validateObject: () => validateObject
|
33325
33305
|
});
|
33326
|
-
var _0n2 = BigInt(0);
|
33327
|
-
var _1n2 = BigInt(1);
|
33328
|
-
var _2n2 = BigInt(2);
|
33306
|
+
var _0n2 = /* @__PURE__ */ BigInt(0);
|
33307
|
+
var _1n2 = /* @__PURE__ */ BigInt(1);
|
33308
|
+
var _2n2 = /* @__PURE__ */ BigInt(2);
|
33329
33309
|
function isBytes3(a) {
|
33330
33310
|
return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array";
|
33331
33311
|
}
|
33332
|
-
|
33333
|
-
|
33334
|
-
if (!isBytes3(bytes2))
|
33312
|
+
function abytes(item) {
|
33313
|
+
if (!isBytes3(item))
|
33335
33314
|
throw new Error("Uint8Array expected");
|
33315
|
+
}
|
33316
|
+
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
|
33317
|
+
function bytesToHex(bytes3) {
|
33318
|
+
abytes(bytes3);
|
33336
33319
|
let hex = "";
|
33337
|
-
for (let i = 0; i <
|
33338
|
-
hex += hexes[
|
33320
|
+
for (let i = 0; i < bytes3.length; i++) {
|
33321
|
+
hex += hexes[bytes3[i]];
|
33339
33322
|
}
|
33340
33323
|
return hex;
|
33341
33324
|
}
|
@@ -33377,13 +33360,12 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33377
33360
|
}
|
33378
33361
|
return array;
|
33379
33362
|
}
|
33380
|
-
function bytesToNumberBE(
|
33381
|
-
return hexToNumber(bytesToHex(
|
33363
|
+
function bytesToNumberBE(bytes3) {
|
33364
|
+
return hexToNumber(bytesToHex(bytes3));
|
33382
33365
|
}
|
33383
|
-
function bytesToNumberLE(
|
33384
|
-
|
33385
|
-
|
33386
|
-
return hexToNumber(bytesToHex(Uint8Array.from(bytes2).reverse()));
|
33366
|
+
function bytesToNumberLE(bytes3) {
|
33367
|
+
abytes(bytes3);
|
33368
|
+
return hexToNumber(bytesToHex(Uint8Array.from(bytes3).reverse()));
|
33387
33369
|
}
|
33388
33370
|
function numberToBytesBE(n, len) {
|
33389
33371
|
return hexToBytes(n.toString(16).padStart(len * 2, "0"));
|
@@ -33412,17 +33394,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33412
33394
|
throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`);
|
33413
33395
|
return res;
|
33414
33396
|
}
|
33415
|
-
function
|
33397
|
+
function concatBytes2(...arrays) {
|
33416
33398
|
let sum = 0;
|
33417
33399
|
for (let i = 0; i < arrays.length; i++) {
|
33418
33400
|
const a = arrays[i];
|
33419
|
-
|
33420
|
-
throw new Error("Uint8Array expected");
|
33401
|
+
abytes(a);
|
33421
33402
|
sum += a.length;
|
33422
33403
|
}
|
33423
|
-
|
33424
|
-
let pad3 = 0;
|
33425
|
-
for (let i = 0; i < arrays.length; i++) {
|
33404
|
+
const res = new Uint8Array(sum);
|
33405
|
+
for (let i = 0, pad3 = 0; i < arrays.length; i++) {
|
33426
33406
|
const a = arrays[i];
|
33427
33407
|
res.set(a, pad3);
|
33428
33408
|
pad3 += a.length;
|
@@ -33451,9 +33431,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33451
33431
|
function bitGet(n, pos) {
|
33452
33432
|
return n >> BigInt(pos) & _1n2;
|
33453
33433
|
}
|
33454
|
-
|
33434
|
+
function bitSet(n, pos, value) {
|
33455
33435
|
return n | (value ? _1n2 : _0n2) << BigInt(pos);
|
33456
|
-
}
|
33436
|
+
}
|
33457
33437
|
var bitMask = (n) => (_2n2 << BigInt(n - 1)) - _1n2;
|
33458
33438
|
var u8n = (data) => new Uint8Array(data);
|
33459
33439
|
var u8fr = (arr) => Uint8Array.from(arr);
|
@@ -33492,7 +33472,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33492
33472
|
out.push(sl);
|
33493
33473
|
len += v.length;
|
33494
33474
|
}
|
33495
|
-
return
|
33475
|
+
return concatBytes2(...out);
|
33496
33476
|
};
|
33497
33477
|
const genUntil = (seed, pred) => {
|
33498
33478
|
reset();
|
@@ -33552,7 +33532,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33552
33532
|
return __assign.apply(this, arguments);
|
33553
33533
|
};
|
33554
33534
|
|
33555
|
-
// ../../node_modules/.pnpm/graphql@16.
|
33535
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/devAssert.mjs
|
33556
33536
|
function devAssert(condition, message) {
|
33557
33537
|
const booleanCondition = Boolean(condition);
|
33558
33538
|
if (!booleanCondition) {
|
@@ -33560,12 +33540,12 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33560
33540
|
}
|
33561
33541
|
}
|
33562
33542
|
|
33563
|
-
// ../../node_modules/.pnpm/graphql@16.
|
33543
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/isObjectLike.mjs
|
33564
33544
|
function isObjectLike(value) {
|
33565
33545
|
return typeof value == "object" && value !== null;
|
33566
33546
|
}
|
33567
33547
|
|
33568
|
-
// ../../node_modules/.pnpm/graphql@16.
|
33548
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/invariant.mjs
|
33569
33549
|
function invariant(condition, message) {
|
33570
33550
|
const booleanCondition = Boolean(condition);
|
33571
33551
|
if (!booleanCondition) {
|
@@ -33575,7 +33555,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33575
33555
|
}
|
33576
33556
|
}
|
33577
33557
|
|
33578
|
-
// ../../node_modules/.pnpm/graphql@16.
|
33558
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/location.mjs
|
33579
33559
|
var LineRegExp = /\r\n|[\n\r]/g;
|
33580
33560
|
function getLocation(source, position) {
|
33581
33561
|
let lastLineStart = 0;
|
@@ -33594,7 +33574,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33594
33574
|
};
|
33595
33575
|
}
|
33596
33576
|
|
33597
|
-
// ../../node_modules/.pnpm/graphql@16.
|
33577
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/printLocation.mjs
|
33598
33578
|
function printLocation(location) {
|
33599
33579
|
return printSourceLocation(
|
33600
33580
|
location.source,
|
@@ -33641,7 +33621,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33641
33621
|
return existingLines.map(([prefix, line]) => prefix.padStart(padLen) + (line ? " " + line : "")).join("\n");
|
33642
33622
|
}
|
33643
33623
|
|
33644
|
-
// ../../node_modules/.pnpm/graphql@16.
|
33624
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/error/GraphQLError.mjs
|
33645
33625
|
function toNormalizedOptions(args) {
|
33646
33626
|
const firstArg = args[0];
|
33647
33627
|
if (firstArg == null || "kind" in firstArg || "length" in firstArg) {
|
@@ -33756,19 +33736,19 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33756
33736
|
return "GraphQLError";
|
33757
33737
|
}
|
33758
33738
|
toString() {
|
33759
|
-
let
|
33739
|
+
let output3 = this.message;
|
33760
33740
|
if (this.nodes) {
|
33761
33741
|
for (const node of this.nodes) {
|
33762
33742
|
if (node.loc) {
|
33763
|
-
|
33743
|
+
output3 += "\n\n" + printLocation(node.loc);
|
33764
33744
|
}
|
33765
33745
|
}
|
33766
33746
|
} else if (this.source && this.locations) {
|
33767
33747
|
for (const location of this.locations) {
|
33768
|
-
|
33748
|
+
output3 += "\n\n" + printSourceLocation(this.source, location);
|
33769
33749
|
}
|
33770
33750
|
}
|
33771
|
-
return
|
33751
|
+
return output3;
|
33772
33752
|
}
|
33773
33753
|
toJSON() {
|
33774
33754
|
const formattedError = {
|
@@ -33790,7 +33770,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33790
33770
|
return array === void 0 || array.length === 0 ? void 0 : array;
|
33791
33771
|
}
|
33792
33772
|
|
33793
|
-
// ../../node_modules/.pnpm/graphql@16.
|
33773
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/error/syntaxError.mjs
|
33794
33774
|
function syntaxError(source, position, description) {
|
33795
33775
|
return new GraphQLError(`Syntax Error: ${description}`, {
|
33796
33776
|
source,
|
@@ -33798,7 +33778,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33798
33778
|
});
|
33799
33779
|
}
|
33800
33780
|
|
33801
|
-
// ../../node_modules/.pnpm/graphql@16.
|
33781
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/ast.mjs
|
33802
33782
|
var Location = class {
|
33803
33783
|
/**
|
33804
33784
|
* The character offset at which this Node begins.
|
@@ -33968,7 +33948,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33968
33948
|
OperationTypeNode2["SUBSCRIPTION"] = "subscription";
|
33969
33949
|
})(OperationTypeNode || (OperationTypeNode = {}));
|
33970
33950
|
|
33971
|
-
// ../../node_modules/.pnpm/graphql@16.
|
33951
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/directiveLocation.mjs
|
33972
33952
|
var DirectiveLocation;
|
33973
33953
|
(function(DirectiveLocation2) {
|
33974
33954
|
DirectiveLocation2["QUERY"] = "QUERY";
|
@@ -33992,7 +33972,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33992
33972
|
DirectiveLocation2["INPUT_FIELD_DEFINITION"] = "INPUT_FIELD_DEFINITION";
|
33993
33973
|
})(DirectiveLocation || (DirectiveLocation = {}));
|
33994
33974
|
|
33995
|
-
// ../../node_modules/.pnpm/graphql@16.
|
33975
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/kinds.mjs
|
33996
33976
|
var Kind;
|
33997
33977
|
(function(Kind2) {
|
33998
33978
|
Kind2["NAME"] = "Name";
|
@@ -34040,7 +34020,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
34040
34020
|
Kind2["INPUT_OBJECT_TYPE_EXTENSION"] = "InputObjectTypeExtension";
|
34041
34021
|
})(Kind || (Kind = {}));
|
34042
34022
|
|
34043
|
-
// ../../node_modules/.pnpm/graphql@16.
|
34023
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/characterClasses.mjs
|
34044
34024
|
function isWhiteSpace(code) {
|
34045
34025
|
return code === 9 || code === 32;
|
34046
34026
|
}
|
@@ -34058,7 +34038,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
34058
34038
|
return isLetter(code) || isDigit(code) || code === 95;
|
34059
34039
|
}
|
34060
34040
|
|
34061
|
-
// ../../node_modules/.pnpm/graphql@16.
|
34041
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/blockString.mjs
|
34062
34042
|
function dedentBlockStringLines(lines) {
|
34063
34043
|
var _firstNonEmptyLine2;
|
34064
34044
|
let commonIndent = Number.MAX_SAFE_INTEGER;
|
@@ -34112,7 +34092,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
34112
34092
|
return '"""' + result + '"""';
|
34113
34093
|
}
|
34114
34094
|
|
34115
|
-
// ../../node_modules/.pnpm/graphql@16.
|
34095
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/tokenKind.mjs
|
34116
34096
|
var TokenKind;
|
34117
34097
|
(function(TokenKind2) {
|
34118
34098
|
TokenKind2["SOF"] = "<SOF>";
|
@@ -34139,7 +34119,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
34139
34119
|
TokenKind2["COMMENT"] = "Comment";
|
34140
34120
|
})(TokenKind || (TokenKind = {}));
|
34141
34121
|
|
34142
|
-
// ../../node_modules/.pnpm/graphql@16.
|
34122
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/lexer.mjs
|
34143
34123
|
var Lexer = class {
|
34144
34124
|
/**
|
34145
34125
|
* The previously focused non-ignored token.
|
@@ -34640,7 +34620,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
34640
34620
|
);
|
34641
34621
|
}
|
34642
34622
|
|
34643
|
-
// ../../node_modules/.pnpm/graphql@16.
|
34623
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/inspect.mjs
|
34644
34624
|
var MAX_ARRAY_LENGTH = 10;
|
34645
34625
|
var MAX_RECURSIVE_DEPTH = 2;
|
34646
34626
|
function inspect(value) {
|
@@ -34723,11 +34703,13 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
34723
34703
|
return tag;
|
34724
34704
|
}
|
34725
34705
|
|
34726
|
-
// ../../node_modules/.pnpm/graphql@16.
|
34706
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/instanceOf.mjs
|
34707
|
+
var isProduction = globalThis.process && // eslint-disable-next-line no-undef
|
34708
|
+
process.env.NODE_ENV === "production";
|
34727
34709
|
var instanceOf = (
|
34728
34710
|
/* c8 ignore next 6 */
|
34729
34711
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
34730
|
-
|
34712
|
+
isProduction ? function instanceOf2(value, constructor) {
|
34731
34713
|
return value instanceof constructor;
|
34732
34714
|
} : function instanceOf3(value, constructor) {
|
34733
34715
|
if (value instanceof constructor) {
|
@@ -34760,7 +34742,7 @@ spurious results.`);
|
|
34760
34742
|
}
|
34761
34743
|
);
|
34762
34744
|
|
34763
|
-
// ../../node_modules/.pnpm/graphql@16.
|
34745
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/source.mjs
|
34764
34746
|
var Source = class {
|
34765
34747
|
constructor(body, name = "GraphQL request", locationOffset = {
|
34766
34748
|
line: 1,
|
@@ -34787,7 +34769,7 @@ spurious results.`);
|
|
34787
34769
|
return instanceOf(source, Source);
|
34788
34770
|
}
|
34789
34771
|
|
34790
|
-
// ../../node_modules/.pnpm/graphql@16.
|
34772
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/parser.mjs
|
34791
34773
|
function parse(source, options) {
|
34792
34774
|
const parser = new Parser(source, options);
|
34793
34775
|
return parser.parseDocument();
|
@@ -36036,7 +36018,7 @@ spurious results.`);
|
|
36036
36018
|
return isPunctuatorTokenKind(kind) ? `"${kind}"` : kind;
|
36037
36019
|
}
|
36038
36020
|
|
36039
|
-
// ../../node_modules/.pnpm/graphql@16.
|
36021
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/printString.mjs
|
36040
36022
|
function printString(str) {
|
36041
36023
|
return `"${str.replace(escapedRegExp, escapedReplacer)}"`;
|
36042
36024
|
}
|
@@ -36212,7 +36194,7 @@ spurious results.`);
|
|
36212
36194
|
"\\u009F"
|
36213
36195
|
];
|
36214
36196
|
|
36215
|
-
// ../../node_modules/.pnpm/graphql@16.
|
36197
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/visitor.mjs
|
36216
36198
|
var BREAK = Object.freeze({});
|
36217
36199
|
function visit(root, visitor, visitorKeys = QueryDocumentKeys) {
|
36218
36200
|
const enterLeaveMap = /* @__PURE__ */ new Map();
|
@@ -36344,7 +36326,7 @@ spurious results.`);
|
|
36344
36326
|
};
|
36345
36327
|
}
|
36346
36328
|
|
36347
|
-
// ../../node_modules/.pnpm/graphql@16.
|
36329
|
+
// ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/printer.mjs
|
36348
36330
|
function print(ast) {
|
36349
36331
|
return visit(ast, printDocASTReducer);
|
36350
36332
|
}
|
@@ -36586,7 +36568,7 @@ spurious results.`);
|
|
36586
36568
|
return (_maybeArray$some = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.some((str) => str.includes("\n"))) !== null && _maybeArray$some !== void 0 ? _maybeArray$some : false;
|
36587
36569
|
}
|
36588
36570
|
|
36589
|
-
// ../../node_modules/.pnpm/graphql-tag@2.12.6_graphql@16.
|
36571
|
+
// ../../node_modules/.pnpm/graphql-tag@2.12.6_graphql@16.9.0/node_modules/graphql-tag/lib/index.js
|
36590
36572
|
var docCache = /* @__PURE__ */ new Map();
|
36591
36573
|
var fragmentSourceMap = /* @__PURE__ */ new Map();
|
36592
36574
|
var printFragmentWarnings = true;
|
@@ -37127,6 +37109,12 @@ ${ReceiptFragmentDoc}`;
|
|
37127
37109
|
alocDependentCost {
|
37128
37110
|
...DependentCostFragment
|
37129
37111
|
}
|
37112
|
+
cfe {
|
37113
|
+
...DependentCostFragment
|
37114
|
+
}
|
37115
|
+
cfeiDependentCost {
|
37116
|
+
...DependentCostFragment
|
37117
|
+
}
|
37130
37118
|
call {
|
37131
37119
|
...DependentCostFragment
|
37132
37120
|
}
|
@@ -37367,6 +37355,9 @@ ${TransactionFragmentDoc}`;
|
|
37367
37355
|
var GetBlocksDocument = lib_default2`
|
37368
37356
|
query getBlocks($after: String, $before: String, $first: Int, $last: Int) {
|
37369
37357
|
blocks(after: $after, before: $before, first: $first, last: $last) {
|
37358
|
+
pageInfo {
|
37359
|
+
...pageInfoFragment
|
37360
|
+
}
|
37370
37361
|
edges {
|
37371
37362
|
node {
|
37372
37363
|
...blockFragment
|
@@ -37374,7 +37365,8 @@ ${TransactionFragmentDoc}`;
|
|
37374
37365
|
}
|
37375
37366
|
}
|
37376
37367
|
}
|
37377
|
-
${
|
37368
|
+
${PageInfoFragmentDoc}
|
37369
|
+
${BlockFragmentDoc}`;
|
37378
37370
|
var GetCoinDocument = lib_default2`
|
37379
37371
|
query getCoin($coinId: UtxoId!) {
|
37380
37372
|
coin(utxoId: $coinId) {
|
@@ -37391,6 +37383,9 @@ ${TransactionFragmentDoc}`;
|
|
37391
37383
|
first: $first
|
37392
37384
|
last: $last
|
37393
37385
|
) {
|
37386
|
+
pageInfo {
|
37387
|
+
...pageInfoFragment
|
37388
|
+
}
|
37394
37389
|
edges {
|
37395
37390
|
node {
|
37396
37391
|
...coinFragment
|
@@ -37398,7 +37393,8 @@ ${TransactionFragmentDoc}`;
|
|
37398
37393
|
}
|
37399
37394
|
}
|
37400
37395
|
}
|
37401
|
-
${
|
37396
|
+
${PageInfoFragmentDoc}
|
37397
|
+
${CoinFragmentDoc}`;
|
37402
37398
|
var GetCoinsToSpendDocument = lib_default2`
|
37403
37399
|
query getCoinsToSpend($owner: Address!, $queryPerAsset: [SpendQueryElementInput!]!, $excludedIds: ExcludeInput) {
|
37404
37400
|
coinsToSpend(
|
@@ -37457,6 +37453,9 @@ ${MessageCoinFragmentDoc}`;
|
|
37457
37453
|
first: $first
|
37458
37454
|
last: $last
|
37459
37455
|
) {
|
37456
|
+
pageInfo {
|
37457
|
+
...pageInfoFragment
|
37458
|
+
}
|
37460
37459
|
edges {
|
37461
37460
|
node {
|
37462
37461
|
...balanceFragment
|
@@ -37464,7 +37463,8 @@ ${MessageCoinFragmentDoc}`;
|
|
37464
37463
|
}
|
37465
37464
|
}
|
37466
37465
|
}
|
37467
|
-
${
|
37466
|
+
${PageInfoFragmentDoc}
|
37467
|
+
${BalanceFragmentDoc}`;
|
37468
37468
|
var GetMessagesDocument = lib_default2`
|
37469
37469
|
query getMessages($owner: Address!, $after: String, $before: String, $first: Int, $last: Int) {
|
37470
37470
|
messages(
|
@@ -37474,6 +37474,9 @@ ${MessageCoinFragmentDoc}`;
|
|
37474
37474
|
first: $first
|
37475
37475
|
last: $last
|
37476
37476
|
) {
|
37477
|
+
pageInfo {
|
37478
|
+
...pageInfoFragment
|
37479
|
+
}
|
37477
37480
|
edges {
|
37478
37481
|
node {
|
37479
37482
|
...messageFragment
|
@@ -37481,7 +37484,8 @@ ${MessageCoinFragmentDoc}`;
|
|
37481
37484
|
}
|
37482
37485
|
}
|
37483
37486
|
}
|
37484
|
-
${
|
37487
|
+
${PageInfoFragmentDoc}
|
37488
|
+
${MessageFragmentDoc}`;
|
37485
37489
|
var GetMessageProofDocument = lib_default2`
|
37486
37490
|
query getMessageProof($transactionId: TransactionId!, $nonce: Nonce!, $commitBlockId: BlockId, $commitBlockHeight: U32) {
|
37487
37491
|
messageProof(
|
@@ -38359,7 +38363,7 @@ ${MessageCoinFragmentDoc}`;
|
|
38359
38363
|
}
|
38360
38364
|
|
38361
38365
|
// src/providers/utils/extract-tx-error.ts
|
38362
|
-
var assemblePanicError = (statusReason) => {
|
38366
|
+
var assemblePanicError = (statusReason, metadata) => {
|
38363
38367
|
let errorMessage = `The transaction reverted with reason: "${statusReason}".`;
|
38364
38368
|
if (PANIC_REASONS.includes(statusReason)) {
|
38365
38369
|
errorMessage = `${errorMessage}
|
@@ -38368,10 +38372,13 @@ You can read more about this error at:
|
|
38368
38372
|
|
38369
38373
|
${PANIC_DOC_URL}#variant.${statusReason}`;
|
38370
38374
|
}
|
38371
|
-
return
|
38375
|
+
return new FuelError(ErrorCode.SCRIPT_REVERTED, errorMessage, {
|
38376
|
+
...metadata,
|
38377
|
+
reason: statusReason
|
38378
|
+
});
|
38372
38379
|
};
|
38373
38380
|
var stringify = (obj) => JSON.stringify(obj, null, 2);
|
38374
|
-
var assembleRevertError = (receipts, logs) => {
|
38381
|
+
var assembleRevertError = (receipts, logs, metadata) => {
|
38375
38382
|
let errorMessage = "The transaction reverted with an unknown reason.";
|
38376
38383
|
const revertReceipt = receipts.find(({ type: type3 }) => type3 === ReceiptType.Revert);
|
38377
38384
|
let reason = "";
|
@@ -38404,25 +38411,36 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
38404
38411
|
errorMessage = `The transaction reverted because it's missing an "OutputChange".`;
|
38405
38412
|
break;
|
38406
38413
|
default:
|
38407
|
-
|
38408
|
-
|
38414
|
+
throw new FuelError(
|
38415
|
+
ErrorCode.UNKNOWN,
|
38416
|
+
`The transaction reverted with an unknown reason: ${revertReceipt.val}`,
|
38417
|
+
{
|
38418
|
+
...metadata,
|
38419
|
+
reason: "unknown"
|
38420
|
+
}
|
38421
|
+
);
|
38409
38422
|
}
|
38410
38423
|
}
|
38411
|
-
return
|
38424
|
+
return new FuelError(ErrorCode.SCRIPT_REVERTED, errorMessage, {
|
38425
|
+
...metadata,
|
38426
|
+
reason
|
38427
|
+
});
|
38412
38428
|
};
|
38413
38429
|
var extractTxError = (params) => {
|
38414
38430
|
const { receipts, statusReason, logs } = params;
|
38415
38431
|
const isPanic = receipts.some(({ type: type3 }) => type3 === ReceiptType.Panic);
|
38416
38432
|
const isRevert = receipts.some(({ type: type3 }) => type3 === ReceiptType.Revert);
|
38417
|
-
const { errorMessage, reason } = isPanic ? assemblePanicError(statusReason) : assembleRevertError(receipts, logs);
|
38418
38433
|
const metadata = {
|
38419
38434
|
logs,
|
38420
38435
|
receipts,
|
38421
38436
|
panic: isPanic,
|
38422
38437
|
revert: isRevert,
|
38423
|
-
reason
|
38438
|
+
reason: ""
|
38424
38439
|
};
|
38425
|
-
|
38440
|
+
if (isPanic) {
|
38441
|
+
return assemblePanicError(statusReason, metadata);
|
38442
|
+
}
|
38443
|
+
return assembleRevertError(receipts, logs, metadata);
|
38426
38444
|
};
|
38427
38445
|
|
38428
38446
|
// src/providers/transaction-request/errors.ts
|
@@ -38604,8 +38622,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
38604
38622
|
*
|
38605
38623
|
* Pushes an output to the list without any side effects and returns the index
|
38606
38624
|
*/
|
38607
|
-
pushOutput(
|
38608
|
-
this.outputs.push(
|
38625
|
+
pushOutput(output3) {
|
38626
|
+
this.outputs.push(output3);
|
38609
38627
|
return this.outputs.length - 1;
|
38610
38628
|
}
|
38611
38629
|
/**
|
@@ -38689,7 +38707,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
38689
38707
|
*/
|
38690
38708
|
getCoinOutputs() {
|
38691
38709
|
return this.outputs.filter(
|
38692
|
-
(
|
38710
|
+
(output3) => output3.type === OutputType.Coin
|
38693
38711
|
);
|
38694
38712
|
}
|
38695
38713
|
/**
|
@@ -38699,7 +38717,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
38699
38717
|
*/
|
38700
38718
|
getChangeOutputs() {
|
38701
38719
|
return this.outputs.filter(
|
38702
|
-
(
|
38720
|
+
(output3) => output3.type === OutputType.Change
|
38703
38721
|
);
|
38704
38722
|
}
|
38705
38723
|
/**
|
@@ -38849,7 +38867,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
38849
38867
|
*/
|
38850
38868
|
addChangeOutput(to, assetId) {
|
38851
38869
|
const changeOutput = this.getChangeOutputs().find(
|
38852
|
-
(
|
38870
|
+
(output3) => hexlify(output3.assetId) === assetId
|
38853
38871
|
);
|
38854
38872
|
if (!changeOutput) {
|
38855
38873
|
this.pushOutput({
|
@@ -38927,12 +38945,12 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
38927
38945
|
usedQuantity = bn("1000000000000000000");
|
38928
38946
|
}
|
38929
38947
|
if (assetInput && "assetId" in assetInput) {
|
38930
|
-
assetInput.id = hexlify(
|
38948
|
+
assetInput.id = hexlify(randomBytes2(UTXO_ID_LEN));
|
38931
38949
|
assetInput.amount = usedQuantity;
|
38932
38950
|
} else {
|
38933
38951
|
this.addResources([
|
38934
38952
|
{
|
38935
|
-
id: hexlify(
|
38953
|
+
id: hexlify(randomBytes2(UTXO_ID_LEN)),
|
38936
38954
|
amount: usedQuantity,
|
38937
38955
|
assetId,
|
38938
38956
|
owner: resourcesOwner || Address.fromRandom(),
|
@@ -39028,8 +39046,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
39028
39046
|
return inputClone;
|
39029
39047
|
}
|
39030
39048
|
});
|
39031
|
-
transaction.outputs = transaction.outputs.map((
|
39032
|
-
const outputClone = clone_default(
|
39049
|
+
transaction.outputs = transaction.outputs.map((output3) => {
|
39050
|
+
const outputClone = clone_default(output3);
|
39033
39051
|
switch (outputClone.type) {
|
39034
39052
|
case OutputType.Contract: {
|
39035
39053
|
outputClone.balanceRoot = ZeroBytes32;
|
@@ -39131,7 +39149,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
39131
39149
|
*/
|
39132
39150
|
getContractCreatedOutputs() {
|
39133
39151
|
return this.outputs.filter(
|
39134
|
-
(
|
39152
|
+
(output3) => output3.type === OutputType.ContractCreated
|
39135
39153
|
);
|
39136
39154
|
}
|
39137
39155
|
/**
|
@@ -39257,7 +39275,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
39257
39275
|
*/
|
39258
39276
|
getContractOutputs() {
|
39259
39277
|
return this.outputs.filter(
|
39260
|
-
(
|
39278
|
+
(output3) => output3.type === OutputType.Contract
|
39261
39279
|
);
|
39262
39280
|
}
|
39263
39281
|
/**
|
@@ -39267,7 +39285,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
39267
39285
|
*/
|
39268
39286
|
getVariableOutputs() {
|
39269
39287
|
return this.outputs.filter(
|
39270
|
-
(
|
39288
|
+
(output3) => output3.type === OutputType.Variable
|
39271
39289
|
);
|
39272
39290
|
}
|
39273
39291
|
/**
|
@@ -39739,8 +39757,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
39739
39757
|
}) {
|
39740
39758
|
const contractCallReceipts = getReceiptsCall(receipts);
|
39741
39759
|
const contractOutputs = getOutputsContract(outputs);
|
39742
|
-
const contractCallOperations = contractOutputs.reduce((prevOutputCallOps,
|
39743
|
-
const contractInput = getInputContractFromIndex(inputs,
|
39760
|
+
const contractCallOperations = contractOutputs.reduce((prevOutputCallOps, output3) => {
|
39761
|
+
const contractInput = getInputContractFromIndex(inputs, output3.inputIndex);
|
39744
39762
|
if (contractInput) {
|
39745
39763
|
const newCallOps = contractCallReceipts.reduce((prevContractCallOps, receipt) => {
|
39746
39764
|
if (receipt.to === contractInput.contractID) {
|
@@ -39794,7 +39812,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
39794
39812
|
let { from: fromAddress } = receipt;
|
39795
39813
|
const toType = contractInputs.some((input) => input.contractID === toAddress) ? 0 /* contract */ : 1 /* account */;
|
39796
39814
|
if (ZeroBytes32 === fromAddress) {
|
39797
|
-
const change = changeOutputs.find((
|
39815
|
+
const change = changeOutputs.find((output3) => output3.assetId === assetId);
|
39798
39816
|
fromAddress = change?.to || fromAddress;
|
39799
39817
|
}
|
39800
39818
|
const fromType = contractInputs.some((input) => input.contractID === fromAddress) ? 0 /* contract */ : 1 /* account */;
|
@@ -39825,8 +39843,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
39825
39843
|
const coinOutputs = getOutputsCoin(outputs);
|
39826
39844
|
const contractInputs = getInputsContract(inputs);
|
39827
39845
|
const changeOutputs = getOutputsChange(outputs);
|
39828
|
-
coinOutputs.forEach((
|
39829
|
-
const { amount, assetId, to } =
|
39846
|
+
coinOutputs.forEach((output3) => {
|
39847
|
+
const { amount, assetId, to } = output3;
|
39830
39848
|
const changeOutput = changeOutputs.find((change) => change.assetId === assetId);
|
39831
39849
|
if (changeOutput) {
|
39832
39850
|
operations = addOperation(operations, {
|
@@ -39864,7 +39882,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
39864
39882
|
}
|
39865
39883
|
function getPayProducerOperations(outputs) {
|
39866
39884
|
const coinOutputs = getOutputsCoin(outputs);
|
39867
|
-
const payProducerOperations = coinOutputs.reduce((prev,
|
39885
|
+
const payProducerOperations = coinOutputs.reduce((prev, output3) => {
|
39868
39886
|
const operations = addOperation(prev, {
|
39869
39887
|
name: "Pay network fee to block producer" /* payBlockProducer */,
|
39870
39888
|
from: {
|
@@ -39873,12 +39891,12 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
39873
39891
|
},
|
39874
39892
|
to: {
|
39875
39893
|
type: 1 /* account */,
|
39876
|
-
address:
|
39894
|
+
address: output3.to.toString()
|
39877
39895
|
},
|
39878
39896
|
assetsSent: [
|
39879
39897
|
{
|
39880
|
-
assetId:
|
39881
|
-
amount:
|
39898
|
+
assetId: output3.assetId.toString(),
|
39899
|
+
amount: output3.amount
|
39882
39900
|
}
|
39883
39901
|
]
|
39884
39902
|
});
|
@@ -40277,12 +40295,18 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
40277
40295
|
await this.fetch();
|
40278
40296
|
}
|
40279
40297
|
/**
|
40280
|
-
*
|
40298
|
+
* Assembles the result of a transaction by retrieving the transaction summary,
|
40299
|
+
* decoding logs (if available), and handling transaction failure.
|
40281
40300
|
*
|
40282
|
-
*
|
40301
|
+
* This method can be used to obtain the result of a transaction that has just
|
40302
|
+
* been submitted or one that has already been processed.
|
40303
|
+
*
|
40304
|
+
* @template TTransactionType - The type of the transaction.
|
40305
|
+
* @param contractsAbiMap - The map of contract ABIs.
|
40306
|
+
* @returns - The assembled transaction result.
|
40307
|
+
* @throws If the transaction status is a failure.
|
40283
40308
|
*/
|
40284
|
-
async
|
40285
|
-
await this.waitForStatusChange();
|
40309
|
+
async assembleResult(contractsAbiMap) {
|
40286
40310
|
const transactionSummary = await this.getTransactionSummary(contractsAbiMap);
|
40287
40311
|
const transactionResult = {
|
40288
40312
|
gqlTransaction: this.gqlTransaction,
|
@@ -40308,6 +40332,15 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
40308
40332
|
}
|
40309
40333
|
return transactionResult;
|
40310
40334
|
}
|
40335
|
+
/**
|
40336
|
+
* Waits for transaction to complete and returns the result.
|
40337
|
+
*
|
40338
|
+
* @returns The completed transaction result
|
40339
|
+
*/
|
40340
|
+
async waitForResult(contractsAbiMap) {
|
40341
|
+
await this.waitForStatusChange();
|
40342
|
+
return this.assembleResult(contractsAbiMap);
|
40343
|
+
}
|
40311
40344
|
/**
|
40312
40345
|
* Waits for transaction to complete and returns the result.
|
40313
40346
|
*
|
@@ -40370,6 +40403,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
40370
40403
|
|
40371
40404
|
// src/providers/provider.ts
|
40372
40405
|
var MAX_RETRIES = 10;
|
40406
|
+
var RESOURCES_PAGE_SIZE_LIMIT = 512;
|
40407
|
+
var BLOCKS_PAGE_SIZE_LIMIT = 5;
|
40373
40408
|
var processGqlChain = (chain) => {
|
40374
40409
|
const { name, daHeight, consensusParameters, latestBlock } = chain;
|
40375
40410
|
const {
|
@@ -41013,7 +41048,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
41013
41048
|
/**
|
41014
41049
|
* Returns a transaction cost to enable user
|
41015
41050
|
* to set gasLimit and also reserve balance amounts
|
41016
|
-
* on the
|
41051
|
+
* on the transaction.
|
41017
41052
|
*
|
41018
41053
|
* @param transactionRequestLike - The transaction request object.
|
41019
41054
|
* @param transactionCostParams - The transaction cost parameters (optional).
|
@@ -41124,20 +41159,27 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
41124
41159
|
*/
|
41125
41160
|
async getCoins(owner, assetId, paginationArgs) {
|
41126
41161
|
const ownerAddress = Address.fromAddressOrString(owner);
|
41127
|
-
const
|
41128
|
-
|
41129
|
-
|
41162
|
+
const {
|
41163
|
+
coins: { edges, pageInfo }
|
41164
|
+
} = await this.operations.getCoins({
|
41165
|
+
...this.validatePaginationArgs({
|
41166
|
+
paginationLimit: RESOURCES_PAGE_SIZE_LIMIT,
|
41167
|
+
inputArgs: paginationArgs
|
41168
|
+
}),
|
41130
41169
|
filter: { owner: ownerAddress.toB256(), assetId: assetId && hexlify(assetId) }
|
41131
41170
|
});
|
41132
|
-
const coins =
|
41133
|
-
|
41134
|
-
|
41135
|
-
|
41136
|
-
|
41137
|
-
|
41138
|
-
|
41139
|
-
txCreatedIdx: bn(coin.txCreatedIdx)
|
41171
|
+
const coins = edges.map(({ node }) => ({
|
41172
|
+
id: node.utxoId,
|
41173
|
+
assetId: node.assetId,
|
41174
|
+
amount: bn(node.amount),
|
41175
|
+
owner: Address.fromAddressOrString(node.owner),
|
41176
|
+
blockCreated: bn(node.blockCreated),
|
41177
|
+
txCreatedIdx: bn(node.txCreatedIdx)
|
41140
41178
|
}));
|
41179
|
+
return {
|
41180
|
+
coins,
|
41181
|
+
pageInfo
|
41182
|
+
};
|
41141
41183
|
}
|
41142
41184
|
/**
|
41143
41185
|
* Returns resources for the given owner satisfying the spend query.
|
@@ -41230,14 +41272,21 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
41230
41272
|
* @returns A promise that resolves to the blocks.
|
41231
41273
|
*/
|
41232
41274
|
async getBlocks(params) {
|
41233
|
-
const {
|
41234
|
-
|
41275
|
+
const {
|
41276
|
+
blocks: { edges, pageInfo }
|
41277
|
+
} = await this.operations.getBlocks({
|
41278
|
+
...this.validatePaginationArgs({
|
41279
|
+
paginationLimit: BLOCKS_PAGE_SIZE_LIMIT,
|
41280
|
+
inputArgs: params
|
41281
|
+
})
|
41282
|
+
});
|
41283
|
+
const blocks = edges.map(({ node: block2 }) => ({
|
41235
41284
|
id: block2.id,
|
41236
41285
|
height: bn(block2.height),
|
41237
41286
|
time: block2.header.time,
|
41238
41287
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
41239
41288
|
}));
|
41240
|
-
return blocks;
|
41289
|
+
return { blocks, pageInfo };
|
41241
41290
|
}
|
41242
41291
|
/**
|
41243
41292
|
* Returns block matching the given ID or type, including transaction data.
|
@@ -41347,17 +41396,22 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
41347
41396
|
* @param paginationArgs - Pagination arguments (optional).
|
41348
41397
|
* @returns A promise that resolves to the balances.
|
41349
41398
|
*/
|
41350
|
-
async getBalances(owner
|
41351
|
-
const
|
41352
|
-
|
41353
|
-
|
41399
|
+
async getBalances(owner) {
|
41400
|
+
const {
|
41401
|
+
balances: { edges }
|
41402
|
+
} = await this.operations.getBalances({
|
41403
|
+
/**
|
41404
|
+
* The query parameters for this method were designed to support pagination,
|
41405
|
+
* but the current Fuel-Core implementation does not support pagination yet.
|
41406
|
+
*/
|
41407
|
+
first: 1e4,
|
41354
41408
|
filter: { owner: Address.fromAddressOrString(owner).toB256() }
|
41355
41409
|
});
|
41356
|
-
const balances =
|
41357
|
-
|
41358
|
-
|
41359
|
-
amount: bn(balance.amount)
|
41410
|
+
const balances = edges.map(({ node }) => ({
|
41411
|
+
assetId: node.assetId,
|
41412
|
+
amount: bn(node.amount)
|
41360
41413
|
}));
|
41414
|
+
return { balances };
|
41361
41415
|
}
|
41362
41416
|
/**
|
41363
41417
|
* Returns message for the given address.
|
@@ -41367,27 +41421,34 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
41367
41421
|
* @returns A promise that resolves to the messages.
|
41368
41422
|
*/
|
41369
41423
|
async getMessages(address, paginationArgs) {
|
41370
|
-
const
|
41371
|
-
|
41372
|
-
|
41424
|
+
const {
|
41425
|
+
messages: { edges, pageInfo }
|
41426
|
+
} = await this.operations.getMessages({
|
41427
|
+
...this.validatePaginationArgs({
|
41428
|
+
inputArgs: paginationArgs,
|
41429
|
+
paginationLimit: RESOURCES_PAGE_SIZE_LIMIT
|
41430
|
+
}),
|
41373
41431
|
owner: Address.fromAddressOrString(address).toB256()
|
41374
41432
|
});
|
41375
|
-
const messages =
|
41376
|
-
return messages.map((message) => ({
|
41433
|
+
const messages = edges.map(({ node }) => ({
|
41377
41434
|
messageId: InputMessageCoder.getMessageId({
|
41378
|
-
sender:
|
41379
|
-
recipient:
|
41380
|
-
nonce:
|
41381
|
-
amount: bn(
|
41382
|
-
data:
|
41435
|
+
sender: node.sender,
|
41436
|
+
recipient: node.recipient,
|
41437
|
+
nonce: node.nonce,
|
41438
|
+
amount: bn(node.amount),
|
41439
|
+
data: node.data
|
41383
41440
|
}),
|
41384
|
-
sender: Address.fromAddressOrString(
|
41385
|
-
recipient: Address.fromAddressOrString(
|
41386
|
-
nonce:
|
41387
|
-
amount: bn(
|
41388
|
-
data: InputMessageCoder.decodeData(
|
41389
|
-
daHeight: bn(
|
41441
|
+
sender: Address.fromAddressOrString(node.sender),
|
41442
|
+
recipient: Address.fromAddressOrString(node.recipient),
|
41443
|
+
nonce: node.nonce,
|
41444
|
+
amount: bn(node.amount),
|
41445
|
+
data: InputMessageCoder.decodeData(node.data),
|
41446
|
+
daHeight: bn(node.daHeight)
|
41390
41447
|
}));
|
41448
|
+
return {
|
41449
|
+
messages,
|
41450
|
+
pageInfo
|
41451
|
+
};
|
41391
41452
|
}
|
41392
41453
|
/**
|
41393
41454
|
* Returns Message Proof for given transaction id and the message id from MessageOut receipt.
|
@@ -41566,6 +41627,41 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
41566
41627
|
}
|
41567
41628
|
return relayedTransactionStatus;
|
41568
41629
|
}
|
41630
|
+
/**
|
41631
|
+
* @hidden
|
41632
|
+
*/
|
41633
|
+
validatePaginationArgs(params) {
|
41634
|
+
const { paginationLimit, inputArgs = {} } = params;
|
41635
|
+
const { first, last, after, before } = inputArgs;
|
41636
|
+
if (after && before) {
|
41637
|
+
throw new FuelError(
|
41638
|
+
ErrorCode.INVALID_INPUT_PARAMETERS,
|
41639
|
+
'Pagination arguments "after" and "before" cannot be used together'
|
41640
|
+
);
|
41641
|
+
}
|
41642
|
+
if ((first || 0) > paginationLimit || (last || 0) > paginationLimit) {
|
41643
|
+
throw new FuelError(
|
41644
|
+
ErrorCode.INVALID_INPUT_PARAMETERS,
|
41645
|
+
`Pagination limit for this query cannot exceed ${paginationLimit} items`
|
41646
|
+
);
|
41647
|
+
}
|
41648
|
+
if (first && before) {
|
41649
|
+
throw new FuelError(
|
41650
|
+
ErrorCode.INVALID_INPUT_PARAMETERS,
|
41651
|
+
'The use of pagination argument "first" with "before" is not supported'
|
41652
|
+
);
|
41653
|
+
}
|
41654
|
+
if (last && after) {
|
41655
|
+
throw new FuelError(
|
41656
|
+
ErrorCode.INVALID_INPUT_PARAMETERS,
|
41657
|
+
'The use of pagination argument "last" with "after" is not supported'
|
41658
|
+
);
|
41659
|
+
}
|
41660
|
+
if (!first && !last) {
|
41661
|
+
inputArgs.first = paginationLimit;
|
41662
|
+
}
|
41663
|
+
return inputArgs;
|
41664
|
+
}
|
41569
41665
|
/**
|
41570
41666
|
* @hidden
|
41571
41667
|
*/
|
@@ -41714,11 +41810,11 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
41714
41810
|
gasPrice,
|
41715
41811
|
baseAssetId
|
41716
41812
|
});
|
41717
|
-
const
|
41813
|
+
const output3 = {
|
41718
41814
|
gqlTransaction,
|
41719
41815
|
...transactionSummary
|
41720
41816
|
};
|
41721
|
-
return
|
41817
|
+
return output3;
|
41722
41818
|
});
|
41723
41819
|
return {
|
41724
41820
|
transactions,
|
@@ -41959,52 +42055,16 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
41959
42055
|
* @param assetId - The asset ID of the coins to retrieve (optional).
|
41960
42056
|
* @returns A promise that resolves to an array of Coins.
|
41961
42057
|
*/
|
41962
|
-
async getCoins(assetId) {
|
41963
|
-
|
41964
|
-
const pageSize = 9999;
|
41965
|
-
let cursor;
|
41966
|
-
for (; ; ) {
|
41967
|
-
const pageCoins = await this.provider.getCoins(this.address, assetId, {
|
41968
|
-
first: pageSize,
|
41969
|
-
after: cursor
|
41970
|
-
});
|
41971
|
-
coins.push(...pageCoins);
|
41972
|
-
const hasNextPage = pageCoins.length >= pageSize;
|
41973
|
-
if (!hasNextPage) {
|
41974
|
-
break;
|
41975
|
-
}
|
41976
|
-
throw new FuelError(
|
41977
|
-
ErrorCode.NOT_SUPPORTED,
|
41978
|
-
`Wallets containing more than ${pageSize} coins exceed the current supported limit.`
|
41979
|
-
);
|
41980
|
-
}
|
41981
|
-
return coins;
|
42058
|
+
async getCoins(assetId, paginationArgs) {
|
42059
|
+
return this.provider.getCoins(this.address, assetId, paginationArgs);
|
41982
42060
|
}
|
41983
42061
|
/**
|
41984
42062
|
* Retrieves messages owned by the account.
|
41985
42063
|
*
|
41986
42064
|
* @returns A promise that resolves to an array of Messages.
|
41987
42065
|
*/
|
41988
|
-
async getMessages() {
|
41989
|
-
|
41990
|
-
const pageSize = 9999;
|
41991
|
-
let cursor;
|
41992
|
-
for (; ; ) {
|
41993
|
-
const pageMessages = await this.provider.getMessages(this.address, {
|
41994
|
-
first: pageSize,
|
41995
|
-
after: cursor
|
41996
|
-
});
|
41997
|
-
messages.push(...pageMessages);
|
41998
|
-
const hasNextPage = pageMessages.length >= pageSize;
|
41999
|
-
if (!hasNextPage) {
|
42000
|
-
break;
|
42001
|
-
}
|
42002
|
-
throw new FuelError(
|
42003
|
-
ErrorCode.NOT_SUPPORTED,
|
42004
|
-
`Wallets containing more than ${pageSize} messages exceed the current supported limit.`
|
42005
|
-
);
|
42006
|
-
}
|
42007
|
-
return messages;
|
42066
|
+
async getMessages(paginationArgs) {
|
42067
|
+
return this.provider.getMessages(this.address, paginationArgs);
|
42008
42068
|
}
|
42009
42069
|
/**
|
42010
42070
|
* Retrieves the balance of the account for the given asset.
|
@@ -42023,25 +42083,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
42023
42083
|
* @returns A promise that resolves to an array of Coins and their quantities.
|
42024
42084
|
*/
|
42025
42085
|
async getBalances() {
|
42026
|
-
|
42027
|
-
const pageSize = 9999;
|
42028
|
-
let cursor;
|
42029
|
-
for (; ; ) {
|
42030
|
-
const pageBalances = await this.provider.getBalances(this.address, {
|
42031
|
-
first: pageSize,
|
42032
|
-
after: cursor
|
42033
|
-
});
|
42034
|
-
balances.push(...pageBalances);
|
42035
|
-
const hasNextPage = pageBalances.length >= pageSize;
|
42036
|
-
if (!hasNextPage) {
|
42037
|
-
break;
|
42038
|
-
}
|
42039
|
-
throw new FuelError(
|
42040
|
-
ErrorCode.NOT_SUPPORTED,
|
42041
|
-
`Wallets containing more than ${pageSize} balances exceed the current supported limit.`
|
42042
|
-
);
|
42043
|
-
}
|
42044
|
-
return balances;
|
42086
|
+
return this.provider.getBalances(this.address);
|
42045
42087
|
}
|
42046
42088
|
/**
|
42047
42089
|
* Funds a transaction request by adding the necessary resources.
|
@@ -42363,7 +42405,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
42363
42405
|
*/
|
42364
42406
|
generateFakeResources(coins) {
|
42365
42407
|
return coins.map((coin) => ({
|
42366
|
-
id: hexlify(
|
42408
|
+
id: hexlify(randomBytes2(UTXO_ID_LEN)),
|
42367
42409
|
owner: this.address,
|
42368
42410
|
blockCreated: bn(1),
|
42369
42411
|
txCreatedIdx: bn(1),
|
@@ -42422,7 +42464,414 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
42422
42464
|
}
|
42423
42465
|
};
|
42424
42466
|
|
42425
|
-
// ../../node_modules/.pnpm/@noble+
|
42467
|
+
// ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/_assert.js
|
42468
|
+
function number2(n) {
|
42469
|
+
if (!Number.isSafeInteger(n) || n < 0)
|
42470
|
+
throw new Error(`positive integer expected, not ${n}`);
|
42471
|
+
}
|
42472
|
+
function isBytes4(a) {
|
42473
|
+
return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array";
|
42474
|
+
}
|
42475
|
+
function bytes2(b, ...lengths) {
|
42476
|
+
if (!isBytes4(b))
|
42477
|
+
throw new Error("Uint8Array expected");
|
42478
|
+
if (lengths.length > 0 && !lengths.includes(b.length))
|
42479
|
+
throw new Error(`Uint8Array expected of length ${lengths}, not of length=${b.length}`);
|
42480
|
+
}
|
42481
|
+
function hash3(h) {
|
42482
|
+
if (typeof h !== "function" || typeof h.create !== "function")
|
42483
|
+
throw new Error("Hash should be wrapped by utils.wrapConstructor");
|
42484
|
+
number2(h.outputLen);
|
42485
|
+
number2(h.blockLen);
|
42486
|
+
}
|
42487
|
+
function exists2(instance, checkFinished = true) {
|
42488
|
+
if (instance.destroyed)
|
42489
|
+
throw new Error("Hash instance has been destroyed");
|
42490
|
+
if (checkFinished && instance.finished)
|
42491
|
+
throw new Error("Hash#digest() has already been called");
|
42492
|
+
}
|
42493
|
+
function output2(out, instance) {
|
42494
|
+
bytes2(out);
|
42495
|
+
const min = instance.outputLen;
|
42496
|
+
if (out.length < min) {
|
42497
|
+
throw new Error(`digestInto() expects output buffer of length at least ${min}`);
|
42498
|
+
}
|
42499
|
+
}
|
42500
|
+
|
42501
|
+
// ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/cryptoNode.js
|
42502
|
+
var nc = __toESM(__require("crypto"), 1);
|
42503
|
+
var crypto4 = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : void 0;
|
42504
|
+
|
42505
|
+
// ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/utils.js
|
42506
|
+
var createView2 = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
42507
|
+
var rotr2 = (word, shift) => word << 32 - shift | word >>> shift;
|
42508
|
+
var isLE2 = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
42509
|
+
function utf8ToBytes3(str) {
|
42510
|
+
if (typeof str !== "string")
|
42511
|
+
throw new Error(`utf8ToBytes expected string, got ${typeof str}`);
|
42512
|
+
return new Uint8Array(new TextEncoder().encode(str));
|
42513
|
+
}
|
42514
|
+
function toBytes3(data) {
|
42515
|
+
if (typeof data === "string")
|
42516
|
+
data = utf8ToBytes3(data);
|
42517
|
+
bytes2(data);
|
42518
|
+
return data;
|
42519
|
+
}
|
42520
|
+
function concatBytes3(...arrays) {
|
42521
|
+
let sum = 0;
|
42522
|
+
for (let i = 0; i < arrays.length; i++) {
|
42523
|
+
const a = arrays[i];
|
42524
|
+
bytes2(a);
|
42525
|
+
sum += a.length;
|
42526
|
+
}
|
42527
|
+
const res = new Uint8Array(sum);
|
42528
|
+
for (let i = 0, pad3 = 0; i < arrays.length; i++) {
|
42529
|
+
const a = arrays[i];
|
42530
|
+
res.set(a, pad3);
|
42531
|
+
pad3 += a.length;
|
42532
|
+
}
|
42533
|
+
return res;
|
42534
|
+
}
|
42535
|
+
var Hash2 = class {
|
42536
|
+
// Safe version that clones internal state
|
42537
|
+
clone() {
|
42538
|
+
return this._cloneInto();
|
42539
|
+
}
|
42540
|
+
};
|
42541
|
+
var toStr2 = {}.toString;
|
42542
|
+
function wrapConstructor2(hashCons) {
|
42543
|
+
const hashC = (msg) => hashCons().update(toBytes3(msg)).digest();
|
42544
|
+
const tmp = hashCons();
|
42545
|
+
hashC.outputLen = tmp.outputLen;
|
42546
|
+
hashC.blockLen = tmp.blockLen;
|
42547
|
+
hashC.create = () => hashCons();
|
42548
|
+
return hashC;
|
42549
|
+
}
|
42550
|
+
function randomBytes3(bytesLength = 32) {
|
42551
|
+
if (crypto4 && typeof crypto4.getRandomValues === "function") {
|
42552
|
+
return crypto4.getRandomValues(new Uint8Array(bytesLength));
|
42553
|
+
}
|
42554
|
+
throw new Error("crypto.getRandomValues must be defined");
|
42555
|
+
}
|
42556
|
+
|
42557
|
+
// ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/_md.js
|
42558
|
+
function setBigUint642(view, byteOffset, value, isLE3) {
|
42559
|
+
if (typeof view.setBigUint64 === "function")
|
42560
|
+
return view.setBigUint64(byteOffset, value, isLE3);
|
42561
|
+
const _32n2 = BigInt(32);
|
42562
|
+
const _u32_max = BigInt(4294967295);
|
42563
|
+
const wh = Number(value >> _32n2 & _u32_max);
|
42564
|
+
const wl = Number(value & _u32_max);
|
42565
|
+
const h = isLE3 ? 4 : 0;
|
42566
|
+
const l = isLE3 ? 0 : 4;
|
42567
|
+
view.setUint32(byteOffset + h, wh, isLE3);
|
42568
|
+
view.setUint32(byteOffset + l, wl, isLE3);
|
42569
|
+
}
|
42570
|
+
var Chi2 = (a, b, c) => a & b ^ ~a & c;
|
42571
|
+
var Maj2 = (a, b, c) => a & b ^ a & c ^ b & c;
|
42572
|
+
var HashMD = class extends Hash2 {
|
42573
|
+
constructor(blockLen, outputLen, padOffset, isLE3) {
|
42574
|
+
super();
|
42575
|
+
this.blockLen = blockLen;
|
42576
|
+
this.outputLen = outputLen;
|
42577
|
+
this.padOffset = padOffset;
|
42578
|
+
this.isLE = isLE3;
|
42579
|
+
this.finished = false;
|
42580
|
+
this.length = 0;
|
42581
|
+
this.pos = 0;
|
42582
|
+
this.destroyed = false;
|
42583
|
+
this.buffer = new Uint8Array(blockLen);
|
42584
|
+
this.view = createView2(this.buffer);
|
42585
|
+
}
|
42586
|
+
update(data) {
|
42587
|
+
exists2(this);
|
42588
|
+
const { view, buffer, blockLen } = this;
|
42589
|
+
data = toBytes3(data);
|
42590
|
+
const len = data.length;
|
42591
|
+
for (let pos = 0; pos < len; ) {
|
42592
|
+
const take = Math.min(blockLen - this.pos, len - pos);
|
42593
|
+
if (take === blockLen) {
|
42594
|
+
const dataView = createView2(data);
|
42595
|
+
for (; blockLen <= len - pos; pos += blockLen)
|
42596
|
+
this.process(dataView, pos);
|
42597
|
+
continue;
|
42598
|
+
}
|
42599
|
+
buffer.set(data.subarray(pos, pos + take), this.pos);
|
42600
|
+
this.pos += take;
|
42601
|
+
pos += take;
|
42602
|
+
if (this.pos === blockLen) {
|
42603
|
+
this.process(view, 0);
|
42604
|
+
this.pos = 0;
|
42605
|
+
}
|
42606
|
+
}
|
42607
|
+
this.length += data.length;
|
42608
|
+
this.roundClean();
|
42609
|
+
return this;
|
42610
|
+
}
|
42611
|
+
digestInto(out) {
|
42612
|
+
exists2(this);
|
42613
|
+
output2(out, this);
|
42614
|
+
this.finished = true;
|
42615
|
+
const { buffer, view, blockLen, isLE: isLE3 } = this;
|
42616
|
+
let { pos } = this;
|
42617
|
+
buffer[pos++] = 128;
|
42618
|
+
this.buffer.subarray(pos).fill(0);
|
42619
|
+
if (this.padOffset > blockLen - pos) {
|
42620
|
+
this.process(view, 0);
|
42621
|
+
pos = 0;
|
42622
|
+
}
|
42623
|
+
for (let i = pos; i < blockLen; i++)
|
42624
|
+
buffer[i] = 0;
|
42625
|
+
setBigUint642(view, blockLen - 8, BigInt(this.length * 8), isLE3);
|
42626
|
+
this.process(view, 0);
|
42627
|
+
const oview = createView2(out);
|
42628
|
+
const len = this.outputLen;
|
42629
|
+
if (len % 4)
|
42630
|
+
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
42631
|
+
const outLen = len / 4;
|
42632
|
+
const state = this.get();
|
42633
|
+
if (outLen > state.length)
|
42634
|
+
throw new Error("_sha2: outputLen bigger than state");
|
42635
|
+
for (let i = 0; i < outLen; i++)
|
42636
|
+
oview.setUint32(4 * i, state[i], isLE3);
|
42637
|
+
}
|
42638
|
+
digest() {
|
42639
|
+
const { buffer, outputLen } = this;
|
42640
|
+
this.digestInto(buffer);
|
42641
|
+
const res = buffer.slice(0, outputLen);
|
42642
|
+
this.destroy();
|
42643
|
+
return res;
|
42644
|
+
}
|
42645
|
+
_cloneInto(to) {
|
42646
|
+
to || (to = new this.constructor());
|
42647
|
+
to.set(...this.get());
|
42648
|
+
const { blockLen, buffer, length, finished, destroyed, pos } = this;
|
42649
|
+
to.length = length;
|
42650
|
+
to.pos = pos;
|
42651
|
+
to.finished = finished;
|
42652
|
+
to.destroyed = destroyed;
|
42653
|
+
if (length % blockLen)
|
42654
|
+
to.buffer.set(buffer);
|
42655
|
+
return to;
|
42656
|
+
}
|
42657
|
+
};
|
42658
|
+
|
42659
|
+
// ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/sha256.js
|
42660
|
+
var SHA256_K2 = /* @__PURE__ */ new Uint32Array([
|
42661
|
+
1116352408,
|
42662
|
+
1899447441,
|
42663
|
+
3049323471,
|
42664
|
+
3921009573,
|
42665
|
+
961987163,
|
42666
|
+
1508970993,
|
42667
|
+
2453635748,
|
42668
|
+
2870763221,
|
42669
|
+
3624381080,
|
42670
|
+
310598401,
|
42671
|
+
607225278,
|
42672
|
+
1426881987,
|
42673
|
+
1925078388,
|
42674
|
+
2162078206,
|
42675
|
+
2614888103,
|
42676
|
+
3248222580,
|
42677
|
+
3835390401,
|
42678
|
+
4022224774,
|
42679
|
+
264347078,
|
42680
|
+
604807628,
|
42681
|
+
770255983,
|
42682
|
+
1249150122,
|
42683
|
+
1555081692,
|
42684
|
+
1996064986,
|
42685
|
+
2554220882,
|
42686
|
+
2821834349,
|
42687
|
+
2952996808,
|
42688
|
+
3210313671,
|
42689
|
+
3336571891,
|
42690
|
+
3584528711,
|
42691
|
+
113926993,
|
42692
|
+
338241895,
|
42693
|
+
666307205,
|
42694
|
+
773529912,
|
42695
|
+
1294757372,
|
42696
|
+
1396182291,
|
42697
|
+
1695183700,
|
42698
|
+
1986661051,
|
42699
|
+
2177026350,
|
42700
|
+
2456956037,
|
42701
|
+
2730485921,
|
42702
|
+
2820302411,
|
42703
|
+
3259730800,
|
42704
|
+
3345764771,
|
42705
|
+
3516065817,
|
42706
|
+
3600352804,
|
42707
|
+
4094571909,
|
42708
|
+
275423344,
|
42709
|
+
430227734,
|
42710
|
+
506948616,
|
42711
|
+
659060556,
|
42712
|
+
883997877,
|
42713
|
+
958139571,
|
42714
|
+
1322822218,
|
42715
|
+
1537002063,
|
42716
|
+
1747873779,
|
42717
|
+
1955562222,
|
42718
|
+
2024104815,
|
42719
|
+
2227730452,
|
42720
|
+
2361852424,
|
42721
|
+
2428436474,
|
42722
|
+
2756734187,
|
42723
|
+
3204031479,
|
42724
|
+
3329325298
|
42725
|
+
]);
|
42726
|
+
var SHA256_IV = /* @__PURE__ */ new Uint32Array([
|
42727
|
+
1779033703,
|
42728
|
+
3144134277,
|
42729
|
+
1013904242,
|
42730
|
+
2773480762,
|
42731
|
+
1359893119,
|
42732
|
+
2600822924,
|
42733
|
+
528734635,
|
42734
|
+
1541459225
|
42735
|
+
]);
|
42736
|
+
var SHA256_W2 = /* @__PURE__ */ new Uint32Array(64);
|
42737
|
+
var SHA2562 = class extends HashMD {
|
42738
|
+
constructor() {
|
42739
|
+
super(64, 32, 8, false);
|
42740
|
+
this.A = SHA256_IV[0] | 0;
|
42741
|
+
this.B = SHA256_IV[1] | 0;
|
42742
|
+
this.C = SHA256_IV[2] | 0;
|
42743
|
+
this.D = SHA256_IV[3] | 0;
|
42744
|
+
this.E = SHA256_IV[4] | 0;
|
42745
|
+
this.F = SHA256_IV[5] | 0;
|
42746
|
+
this.G = SHA256_IV[6] | 0;
|
42747
|
+
this.H = SHA256_IV[7] | 0;
|
42748
|
+
}
|
42749
|
+
get() {
|
42750
|
+
const { A, B, C, D, E, F, G, H } = this;
|
42751
|
+
return [A, B, C, D, E, F, G, H];
|
42752
|
+
}
|
42753
|
+
// prettier-ignore
|
42754
|
+
set(A, B, C, D, E, F, G, H) {
|
42755
|
+
this.A = A | 0;
|
42756
|
+
this.B = B | 0;
|
42757
|
+
this.C = C | 0;
|
42758
|
+
this.D = D | 0;
|
42759
|
+
this.E = E | 0;
|
42760
|
+
this.F = F | 0;
|
42761
|
+
this.G = G | 0;
|
42762
|
+
this.H = H | 0;
|
42763
|
+
}
|
42764
|
+
process(view, offset) {
|
42765
|
+
for (let i = 0; i < 16; i++, offset += 4)
|
42766
|
+
SHA256_W2[i] = view.getUint32(offset, false);
|
42767
|
+
for (let i = 16; i < 64; i++) {
|
42768
|
+
const W15 = SHA256_W2[i - 15];
|
42769
|
+
const W2 = SHA256_W2[i - 2];
|
42770
|
+
const s0 = rotr2(W15, 7) ^ rotr2(W15, 18) ^ W15 >>> 3;
|
42771
|
+
const s1 = rotr2(W2, 17) ^ rotr2(W2, 19) ^ W2 >>> 10;
|
42772
|
+
SHA256_W2[i] = s1 + SHA256_W2[i - 7] + s0 + SHA256_W2[i - 16] | 0;
|
42773
|
+
}
|
42774
|
+
let { A, B, C, D, E, F, G, H } = this;
|
42775
|
+
for (let i = 0; i < 64; i++) {
|
42776
|
+
const sigma1 = rotr2(E, 6) ^ rotr2(E, 11) ^ rotr2(E, 25);
|
42777
|
+
const T1 = H + sigma1 + Chi2(E, F, G) + SHA256_K2[i] + SHA256_W2[i] | 0;
|
42778
|
+
const sigma0 = rotr2(A, 2) ^ rotr2(A, 13) ^ rotr2(A, 22);
|
42779
|
+
const T2 = sigma0 + Maj2(A, B, C) | 0;
|
42780
|
+
H = G;
|
42781
|
+
G = F;
|
42782
|
+
F = E;
|
42783
|
+
E = D + T1 | 0;
|
42784
|
+
D = C;
|
42785
|
+
C = B;
|
42786
|
+
B = A;
|
42787
|
+
A = T1 + T2 | 0;
|
42788
|
+
}
|
42789
|
+
A = A + this.A | 0;
|
42790
|
+
B = B + this.B | 0;
|
42791
|
+
C = C + this.C | 0;
|
42792
|
+
D = D + this.D | 0;
|
42793
|
+
E = E + this.E | 0;
|
42794
|
+
F = F + this.F | 0;
|
42795
|
+
G = G + this.G | 0;
|
42796
|
+
H = H + this.H | 0;
|
42797
|
+
this.set(A, B, C, D, E, F, G, H);
|
42798
|
+
}
|
42799
|
+
roundClean() {
|
42800
|
+
SHA256_W2.fill(0);
|
42801
|
+
}
|
42802
|
+
destroy() {
|
42803
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
42804
|
+
this.buffer.fill(0);
|
42805
|
+
}
|
42806
|
+
};
|
42807
|
+
var sha2563 = /* @__PURE__ */ wrapConstructor2(() => new SHA2562());
|
42808
|
+
|
42809
|
+
// ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/hmac.js
|
42810
|
+
var HMAC2 = class extends Hash2 {
|
42811
|
+
constructor(hash4, _key) {
|
42812
|
+
super();
|
42813
|
+
this.finished = false;
|
42814
|
+
this.destroyed = false;
|
42815
|
+
hash3(hash4);
|
42816
|
+
const key = toBytes3(_key);
|
42817
|
+
this.iHash = hash4.create();
|
42818
|
+
if (typeof this.iHash.update !== "function")
|
42819
|
+
throw new Error("Expected instance of class which extends utils.Hash");
|
42820
|
+
this.blockLen = this.iHash.blockLen;
|
42821
|
+
this.outputLen = this.iHash.outputLen;
|
42822
|
+
const blockLen = this.blockLen;
|
42823
|
+
const pad3 = new Uint8Array(blockLen);
|
42824
|
+
pad3.set(key.length > blockLen ? hash4.create().update(key).digest() : key);
|
42825
|
+
for (let i = 0; i < pad3.length; i++)
|
42826
|
+
pad3[i] ^= 54;
|
42827
|
+
this.iHash.update(pad3);
|
42828
|
+
this.oHash = hash4.create();
|
42829
|
+
for (let i = 0; i < pad3.length; i++)
|
42830
|
+
pad3[i] ^= 54 ^ 92;
|
42831
|
+
this.oHash.update(pad3);
|
42832
|
+
pad3.fill(0);
|
42833
|
+
}
|
42834
|
+
update(buf) {
|
42835
|
+
exists2(this);
|
42836
|
+
this.iHash.update(buf);
|
42837
|
+
return this;
|
42838
|
+
}
|
42839
|
+
digestInto(out) {
|
42840
|
+
exists2(this);
|
42841
|
+
bytes2(out, this.outputLen);
|
42842
|
+
this.finished = true;
|
42843
|
+
this.iHash.digestInto(out);
|
42844
|
+
this.oHash.update(out);
|
42845
|
+
this.oHash.digestInto(out);
|
42846
|
+
this.destroy();
|
42847
|
+
}
|
42848
|
+
digest() {
|
42849
|
+
const out = new Uint8Array(this.oHash.outputLen);
|
42850
|
+
this.digestInto(out);
|
42851
|
+
return out;
|
42852
|
+
}
|
42853
|
+
_cloneInto(to) {
|
42854
|
+
to || (to = Object.create(Object.getPrototypeOf(this), {}));
|
42855
|
+
const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;
|
42856
|
+
to = to;
|
42857
|
+
to.finished = finished;
|
42858
|
+
to.destroyed = destroyed;
|
42859
|
+
to.blockLen = blockLen;
|
42860
|
+
to.outputLen = outputLen;
|
42861
|
+
to.oHash = oHash._cloneInto(to.oHash);
|
42862
|
+
to.iHash = iHash._cloneInto(to.iHash);
|
42863
|
+
return to;
|
42864
|
+
}
|
42865
|
+
destroy() {
|
42866
|
+
this.destroyed = true;
|
42867
|
+
this.oHash.destroy();
|
42868
|
+
this.iHash.destroy();
|
42869
|
+
}
|
42870
|
+
};
|
42871
|
+
var hmac2 = (hash4, key, message) => new HMAC2(hash4, key).update(message).digest();
|
42872
|
+
hmac2.create = (hash4, key) => new HMAC2(hash4, key);
|
42873
|
+
|
42874
|
+
// ../../node_modules/.pnpm/@noble+curves@1.4.2/node_modules/@noble/curves/esm/abstract/modular.js
|
42426
42875
|
var _0n3 = BigInt(0);
|
42427
42876
|
var _1n3 = BigInt(1);
|
42428
42877
|
var _2n3 = BigInt(2);
|
@@ -42458,11 +42907,11 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
42458
42907
|
}
|
42459
42908
|
return res;
|
42460
42909
|
}
|
42461
|
-
function invert(
|
42462
|
-
if (
|
42463
|
-
throw new Error(`invert: expected positive integers, got n=${
|
42910
|
+
function invert(number3, modulo) {
|
42911
|
+
if (number3 === _0n3 || modulo <= _0n3) {
|
42912
|
+
throw new Error(`invert: expected positive integers, got n=${number3} mod=${modulo}`);
|
42464
42913
|
}
|
42465
|
-
let a = mod(
|
42914
|
+
let a = mod(number3, modulo);
|
42466
42915
|
let b = modulo;
|
42467
42916
|
let x = _0n3, y = _1n3, u = _1n3, v = _0n3;
|
42468
42917
|
while (a !== _0n3) {
|
@@ -42617,7 +43066,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
42617
43066
|
const nByteLength = Math.ceil(_nBitLength / 8);
|
42618
43067
|
return { nBitLength: _nBitLength, nByteLength };
|
42619
43068
|
}
|
42620
|
-
function Field(ORDER, bitLen2,
|
43069
|
+
function Field(ORDER, bitLen2, isLE3 = false, redef = {}) {
|
42621
43070
|
if (ORDER <= _0n3)
|
42622
43071
|
throw new Error(`Expected Field ORDER > 0, got ${ORDER}`);
|
42623
43072
|
const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen2);
|
@@ -42658,11 +43107,11 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
42658
43107
|
// TODO: do we really need constant cmov?
|
42659
43108
|
// We don't have const-time bigints anyway, so probably will be not very useful
|
42660
43109
|
cmov: (a, b, c) => c ? b : a,
|
42661
|
-
toBytes: (num) =>
|
42662
|
-
fromBytes: (
|
42663
|
-
if (
|
42664
|
-
throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${
|
42665
|
-
return
|
43110
|
+
toBytes: (num) => isLE3 ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES),
|
43111
|
+
fromBytes: (bytes3) => {
|
43112
|
+
if (bytes3.length !== BYTES)
|
43113
|
+
throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes3.length}`);
|
43114
|
+
return isLE3 ? bytesToNumberLE(bytes3) : bytesToNumberBE(bytes3);
|
42666
43115
|
}
|
42667
43116
|
});
|
42668
43117
|
return Object.freeze(f2);
|
@@ -42677,18 +43126,18 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
42677
43126
|
const length = getFieldBytesLength(fieldOrder);
|
42678
43127
|
return length + Math.ceil(length / 2);
|
42679
43128
|
}
|
42680
|
-
function mapHashToField(key, fieldOrder,
|
43129
|
+
function mapHashToField(key, fieldOrder, isLE3 = false) {
|
42681
43130
|
const len = key.length;
|
42682
43131
|
const fieldLen = getFieldBytesLength(fieldOrder);
|
42683
43132
|
const minLen = getMinHashLength(fieldOrder);
|
42684
43133
|
if (len < 16 || len < minLen || len > 1024)
|
42685
43134
|
throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`);
|
42686
|
-
const num =
|
43135
|
+
const num = isLE3 ? bytesToNumberBE(key) : bytesToNumberLE(key);
|
42687
43136
|
const reduced = mod(num, fieldOrder - _1n3) + _1n3;
|
42688
|
-
return
|
43137
|
+
return isLE3 ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);
|
42689
43138
|
}
|
42690
43139
|
|
42691
|
-
// ../../node_modules/.pnpm/@noble+curves@1.
|
43140
|
+
// ../../node_modules/.pnpm/@noble+curves@1.4.2/node_modules/@noble/curves/esm/abstract/curve.js
|
42692
43141
|
var _0n4 = BigInt(0);
|
42693
43142
|
var _1n4 = BigInt(1);
|
42694
43143
|
function wNAF(c, bits) {
|
@@ -42806,7 +43255,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
42806
43255
|
});
|
42807
43256
|
}
|
42808
43257
|
|
42809
|
-
// ../../node_modules/.pnpm/@noble+curves@1.
|
43258
|
+
// ../../node_modules/.pnpm/@noble+curves@1.4.2/node_modules/@noble/curves/esm/abstract/weierstrass.js
|
42810
43259
|
function validatePointOpts(curve) {
|
42811
43260
|
const opts = validateBasic(curve);
|
42812
43261
|
validateObject(opts, {
|
@@ -42857,8 +43306,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
42857
43306
|
toSig(hex) {
|
42858
43307
|
const { Err: E } = DER;
|
42859
43308
|
const data = typeof hex === "string" ? h2b(hex) : hex;
|
42860
|
-
|
42861
|
-
throw new Error("ui8a expected");
|
43309
|
+
abytes(data);
|
42862
43310
|
let l = data.length;
|
42863
43311
|
if (l < 2 || data[0] != 48)
|
42864
43312
|
throw new E("Invalid signature tag");
|
@@ -42893,12 +43341,12 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
42893
43341
|
function weierstrassPoints(opts) {
|
42894
43342
|
const CURVE = validatePointOpts(opts);
|
42895
43343
|
const { Fp: Fp2 } = CURVE;
|
42896
|
-
const
|
43344
|
+
const toBytes4 = CURVE.toBytes || ((_c, point, _isCompressed) => {
|
42897
43345
|
const a = point.toAffine();
|
42898
|
-
return
|
43346
|
+
return concatBytes2(Uint8Array.from([4]), Fp2.toBytes(a.x), Fp2.toBytes(a.y));
|
42899
43347
|
});
|
42900
|
-
const fromBytes = CURVE.fromBytes || ((
|
42901
|
-
const tail =
|
43348
|
+
const fromBytes = CURVE.fromBytes || ((bytes3) => {
|
43349
|
+
const tail = bytes3.subarray(1);
|
42902
43350
|
const x = Fp2.fromBytes(tail.subarray(0, Fp2.BYTES));
|
42903
43351
|
const y = Fp2.fromBytes(tail.subarray(Fp2.BYTES, 2 * Fp2.BYTES));
|
42904
43352
|
return { x, y };
|
@@ -43261,7 +43709,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
43261
43709
|
}
|
43262
43710
|
toRawBytes(isCompressed = true) {
|
43263
43711
|
this.assertValidity();
|
43264
|
-
return
|
43712
|
+
return toBytes4(Point2, this, isCompressed);
|
43265
43713
|
}
|
43266
43714
|
toHex(isCompressed = true) {
|
43267
43715
|
return bytesToHex(this.toRawBytes(isCompressed));
|
@@ -43311,23 +43759,29 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
43311
43759
|
toBytes(_c, point, isCompressed) {
|
43312
43760
|
const a = point.toAffine();
|
43313
43761
|
const x = Fp2.toBytes(a.x);
|
43314
|
-
const cat =
|
43762
|
+
const cat = concatBytes2;
|
43315
43763
|
if (isCompressed) {
|
43316
43764
|
return cat(Uint8Array.from([point.hasEvenY() ? 2 : 3]), x);
|
43317
43765
|
} else {
|
43318
43766
|
return cat(Uint8Array.from([4]), x, Fp2.toBytes(a.y));
|
43319
43767
|
}
|
43320
43768
|
},
|
43321
|
-
fromBytes(
|
43322
|
-
const len =
|
43323
|
-
const head =
|
43324
|
-
const tail =
|
43769
|
+
fromBytes(bytes3) {
|
43770
|
+
const len = bytes3.length;
|
43771
|
+
const head = bytes3[0];
|
43772
|
+
const tail = bytes3.subarray(1);
|
43325
43773
|
if (len === compressedLen && (head === 2 || head === 3)) {
|
43326
43774
|
const x = bytesToNumberBE(tail);
|
43327
43775
|
if (!isValidFieldElement(x))
|
43328
43776
|
throw new Error("Point is not on curve");
|
43329
43777
|
const y2 = weierstrassEquation(x);
|
43330
|
-
let y
|
43778
|
+
let y;
|
43779
|
+
try {
|
43780
|
+
y = Fp2.sqrt(y2);
|
43781
|
+
} catch (sqrtError) {
|
43782
|
+
const suffix = sqrtError instanceof Error ? ": " + sqrtError.message : "";
|
43783
|
+
throw new Error("Point is not on curve" + suffix);
|
43784
|
+
}
|
43331
43785
|
const isYOdd = (y & _1n5) === _1n5;
|
43332
43786
|
const isHeadOdd = (head & 1) === 1;
|
43333
43787
|
if (isHeadOdd !== isYOdd)
|
@@ -43343,9 +43797,9 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
43343
43797
|
}
|
43344
43798
|
});
|
43345
43799
|
const numToNByteStr = (num) => bytesToHex(numberToBytesBE(num, CURVE.nByteLength));
|
43346
|
-
function isBiggerThanHalfOrder(
|
43800
|
+
function isBiggerThanHalfOrder(number3) {
|
43347
43801
|
const HALF = CURVE_ORDER >> _1n5;
|
43348
|
-
return
|
43802
|
+
return number3 > HALF;
|
43349
43803
|
}
|
43350
43804
|
function normalizeS(s) {
|
43351
43805
|
return isBiggerThanHalfOrder(s) ? modN(-s) : s;
|
@@ -43475,13 +43929,13 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
43475
43929
|
const b = Point2.fromHex(publicB);
|
43476
43930
|
return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed);
|
43477
43931
|
}
|
43478
|
-
const bits2int = CURVE.bits2int || function(
|
43479
|
-
const num = bytesToNumberBE(
|
43480
|
-
const delta =
|
43932
|
+
const bits2int = CURVE.bits2int || function(bytes3) {
|
43933
|
+
const num = bytesToNumberBE(bytes3);
|
43934
|
+
const delta = bytes3.length * 8 - CURVE.nBitLength;
|
43481
43935
|
return delta > 0 ? num >> BigInt(delta) : num;
|
43482
43936
|
};
|
43483
|
-
const bits2int_modN = CURVE.bits2int_modN || function(
|
43484
|
-
return modN(bits2int(
|
43937
|
+
const bits2int_modN = CURVE.bits2int_modN || function(bytes3) {
|
43938
|
+
return modN(bits2int(bytes3));
|
43485
43939
|
};
|
43486
43940
|
const ORDER_MASK = bitMask(CURVE.nBitLength);
|
43487
43941
|
function int2octets(num) {
|
@@ -43494,21 +43948,21 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
43494
43948
|
function prepSig(msgHash, privateKey, opts = defaultSigOpts) {
|
43495
43949
|
if (["recovered", "canonical"].some((k) => k in opts))
|
43496
43950
|
throw new Error("sign() legacy options not supported");
|
43497
|
-
const { hash:
|
43951
|
+
const { hash: hash4, randomBytes: randomBytes4 } = CURVE;
|
43498
43952
|
let { lowS, prehash, extraEntropy: ent } = opts;
|
43499
43953
|
if (lowS == null)
|
43500
43954
|
lowS = true;
|
43501
43955
|
msgHash = ensureBytes("msgHash", msgHash);
|
43502
43956
|
if (prehash)
|
43503
|
-
msgHash = ensureBytes("prehashed msgHash",
|
43957
|
+
msgHash = ensureBytes("prehashed msgHash", hash4(msgHash));
|
43504
43958
|
const h1int = bits2int_modN(msgHash);
|
43505
43959
|
const d = normPrivateKeyToScalar(privateKey);
|
43506
43960
|
const seedArgs = [int2octets(d), int2octets(h1int)];
|
43507
|
-
if (ent != null) {
|
43508
|
-
const e = ent === true ?
|
43961
|
+
if (ent != null && ent !== false) {
|
43962
|
+
const e = ent === true ? randomBytes4(Fp2.BYTES) : ent;
|
43509
43963
|
seedArgs.push(ensureBytes("extraEntropy", e));
|
43510
43964
|
}
|
43511
|
-
const seed =
|
43965
|
+
const seed = concatBytes2(...seedArgs);
|
43512
43966
|
const m = h1int;
|
43513
43967
|
function k2sig(kBytes) {
|
43514
43968
|
const k = bits2int(kBytes);
|
@@ -43598,20 +44052,20 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
43598
44052
|
};
|
43599
44053
|
}
|
43600
44054
|
|
43601
|
-
// ../../node_modules/.pnpm/@noble+curves@1.
|
43602
|
-
function getHash(
|
44055
|
+
// ../../node_modules/.pnpm/@noble+curves@1.4.2/node_modules/@noble/curves/esm/_shortw_utils.js
|
44056
|
+
function getHash(hash4) {
|
43603
44057
|
return {
|
43604
|
-
hash:
|
43605
|
-
hmac: (key, ...msgs) =>
|
43606
|
-
randomBytes
|
44058
|
+
hash: hash4,
|
44059
|
+
hmac: (key, ...msgs) => hmac2(hash4, key, concatBytes3(...msgs)),
|
44060
|
+
randomBytes: randomBytes3
|
43607
44061
|
};
|
43608
44062
|
}
|
43609
44063
|
function createCurve(curveDef, defHash) {
|
43610
|
-
const create = (
|
44064
|
+
const create = (hash4) => weierstrass({ ...curveDef, ...getHash(hash4) });
|
43611
44065
|
return Object.freeze({ ...create(defHash), create });
|
43612
44066
|
}
|
43613
44067
|
|
43614
|
-
// ../../node_modules/.pnpm/@noble+curves@1.
|
44068
|
+
// ../../node_modules/.pnpm/@noble+curves@1.4.2/node_modules/@noble/curves/esm/secp256k1.js
|
43615
44069
|
var secp256k1P = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f");
|
43616
44070
|
var secp256k1N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
|
43617
44071
|
var _1n6 = BigInt(1);
|
@@ -43687,7 +44141,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
43687
44141
|
return { k1neg, k1, k2neg, k2 };
|
43688
44142
|
}
|
43689
44143
|
}
|
43690
|
-
},
|
44144
|
+
}, sha2563);
|
43691
44145
|
var _0n6 = BigInt(0);
|
43692
44146
|
var Point = secp256k1.ProjectivePoint;
|
43693
44147
|
|
@@ -43780,7 +44234,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
43780
44234
|
* @returns random 32-byte hashed
|
43781
44235
|
*/
|
43782
44236
|
static generatePrivateKey(entropy) {
|
43783
|
-
return entropy ? hash2(concat([
|
44237
|
+
return entropy ? hash2(concat([randomBytes2(32), arrayify(entropy)])) : randomBytes2(32);
|
43784
44238
|
}
|
43785
44239
|
/**
|
43786
44240
|
* Extended publicKey from a compact publicKey
|
@@ -43794,34 +44248,34 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
43794
44248
|
}
|
43795
44249
|
};
|
43796
44250
|
|
43797
|
-
// ../../node_modules/.pnpm/uuid@
|
43798
|
-
var
|
44251
|
+
// ../../node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-node/stringify.js
|
44252
|
+
var byteToHex = [];
|
44253
|
+
for (let i = 0; i < 256; ++i) {
|
44254
|
+
byteToHex.push((i + 256).toString(16).slice(1));
|
44255
|
+
}
|
44256
|
+
function unsafeStringify(arr, offset = 0) {
|
44257
|
+
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
44258
|
+
}
|
44259
|
+
|
44260
|
+
// ../../node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-node/rng.js
|
44261
|
+
var import_node_crypto = __toESM(__require("crypto"));
|
43799
44262
|
var rnds8Pool = new Uint8Array(256);
|
43800
44263
|
var poolPtr = rnds8Pool.length;
|
43801
44264
|
function rng() {
|
43802
44265
|
if (poolPtr > rnds8Pool.length - 16) {
|
43803
|
-
|
44266
|
+
import_node_crypto.default.randomFillSync(rnds8Pool);
|
43804
44267
|
poolPtr = 0;
|
43805
44268
|
}
|
43806
44269
|
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
43807
44270
|
}
|
43808
44271
|
|
43809
|
-
// ../../node_modules/.pnpm/uuid@
|
43810
|
-
var
|
43811
|
-
for (let i = 0; i < 256; ++i) {
|
43812
|
-
byteToHex.push((i + 256).toString(16).slice(1));
|
43813
|
-
}
|
43814
|
-
function unsafeStringify(arr, offset = 0) {
|
43815
|
-
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
43816
|
-
}
|
43817
|
-
|
43818
|
-
// ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/native.js
|
43819
|
-
var import_crypto14 = __toESM(__require("crypto"));
|
44272
|
+
// ../../node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-node/native.js
|
44273
|
+
var import_node_crypto2 = __toESM(__require("crypto"));
|
43820
44274
|
var native_default = {
|
43821
|
-
randomUUID:
|
44275
|
+
randomUUID: import_node_crypto2.default.randomUUID
|
43822
44276
|
};
|
43823
44277
|
|
43824
|
-
// ../../node_modules/.pnpm/uuid@
|
44278
|
+
// ../../node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-node/v4.js
|
43825
44279
|
function v4(options, buf, offset) {
|
43826
44280
|
if (native_default.randomUUID && !buf && !options) {
|
43827
44281
|
return native_default.randomUUID();
|
@@ -43856,7 +44310,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
43856
44310
|
async function encryptKeystoreWallet(privateKey, address, password) {
|
43857
44311
|
const privateKeyBuffer = bufferFromString2(removeHexPrefix(privateKey), "hex");
|
43858
44312
|
const ownerAddress = Address.fromAddressOrString(address);
|
43859
|
-
const salt =
|
44313
|
+
const salt = randomBytes2(DEFAULT_KEY_SIZE);
|
43860
44314
|
const key = scrypt22({
|
43861
44315
|
password: bufferFromString2(password),
|
43862
44316
|
salt,
|
@@ -43865,7 +44319,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
43865
44319
|
r: DEFAULT_KDF_PARAMS_R,
|
43866
44320
|
p: DEFAULT_KDF_PARAMS_P
|
43867
44321
|
});
|
43868
|
-
const iv =
|
44322
|
+
const iv = randomBytes2(DEFAULT_IV_SIZE);
|
43869
44323
|
const ciphertext = await encryptJsonWalletData2(privateKeyBuffer, key, iv);
|
43870
44324
|
const data = Uint8Array.from([...key.subarray(16, 32), ...ciphertext]);
|
43871
44325
|
const macHashUint8Array = keccak2562(data);
|
@@ -46367,7 +46821,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
46367
46821
|
* @returns A randomly generated mnemonic
|
46368
46822
|
*/
|
46369
46823
|
static generate(size = 32, extraEntropy = "") {
|
46370
|
-
const entropy = extraEntropy ? sha2562(concat([
|
46824
|
+
const entropy = extraEntropy ? sha2562(concat([randomBytes2(size), arrayify(extraEntropy)])) : randomBytes2(size);
|
46371
46825
|
return Mnemonic.entropyToMnemonic(entropy);
|
46372
46826
|
}
|
46373
46827
|
};
|
@@ -46468,9 +46922,9 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
46468
46922
|
data.set(arrayify(this.publicKey));
|
46469
46923
|
}
|
46470
46924
|
data.set(toBytes(index, 4), 33);
|
46471
|
-
const
|
46472
|
-
const IL =
|
46473
|
-
const IR =
|
46925
|
+
const bytes3 = arrayify(computeHmac2("sha512", chainCode, data));
|
46926
|
+
const IL = bytes3.slice(0, 32);
|
46927
|
+
const IR = bytes3.slice(32);
|
46474
46928
|
if (privateKey) {
|
46475
46929
|
const N = "0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141";
|
46476
46930
|
const ki = bn(IL).add(privateKey).mod(N).toBytes(32);
|
@@ -46540,26 +46994,26 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
46540
46994
|
}
|
46541
46995
|
static fromExtendedKey(extendedKey) {
|
46542
46996
|
const decoded = hexlify(toBytes(decodeBase58(extendedKey)));
|
46543
|
-
const
|
46544
|
-
const validChecksum = base58check(
|
46545
|
-
if (
|
46997
|
+
const bytes3 = arrayify(decoded);
|
46998
|
+
const validChecksum = base58check(bytes3.slice(0, 78)) === extendedKey;
|
46999
|
+
if (bytes3.length !== 82 || !isValidExtendedKey(bytes3)) {
|
46546
47000
|
throw new FuelError(ErrorCode.HD_WALLET_ERROR, "Provided key is not a valid extended key.");
|
46547
47001
|
}
|
46548
47002
|
if (!validChecksum) {
|
46549
47003
|
throw new FuelError(ErrorCode.HD_WALLET_ERROR, "Provided key has an invalid checksum.");
|
46550
47004
|
}
|
46551
|
-
const depth =
|
46552
|
-
const parentFingerprint = hexlify(
|
46553
|
-
const index = parseInt(hexlify(
|
46554
|
-
const chainCode = hexlify(
|
46555
|
-
const key =
|
47005
|
+
const depth = bytes3[4];
|
47006
|
+
const parentFingerprint = hexlify(bytes3.slice(5, 9));
|
47007
|
+
const index = parseInt(hexlify(bytes3.slice(9, 13)).substring(2), 16);
|
47008
|
+
const chainCode = hexlify(bytes3.slice(13, 45));
|
47009
|
+
const key = bytes3.slice(45, 78);
|
46556
47010
|
if (depth === 0 && parentFingerprint !== "0x00000000" || depth === 0 && index !== 0) {
|
46557
47011
|
throw new FuelError(
|
46558
47012
|
ErrorCode.HD_WALLET_ERROR,
|
46559
47013
|
"Inconsistency detected: Depth is zero but fingerprint/index is non-zero."
|
46560
47014
|
);
|
46561
47015
|
}
|
46562
|
-
if (isPublicExtendedKey(
|
47016
|
+
if (isPublicExtendedKey(bytes3)) {
|
46563
47017
|
if (key[0] !== 3) {
|
46564
47018
|
throw new FuelError(ErrorCode.HD_WALLET_ERROR, "Invalid public extended key.");
|
46565
47019
|
}
|
@@ -47203,8 +47657,8 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
47203
47657
|
// src/predicate/utils/getPredicateRoot.ts
|
47204
47658
|
var getPredicateRoot = (bytecode) => {
|
47205
47659
|
const chunkSize = 16 * 1024;
|
47206
|
-
const
|
47207
|
-
const chunks = chunkAndPadBytes(
|
47660
|
+
const bytes3 = arrayify(bytecode);
|
47661
|
+
const chunks = chunkAndPadBytes(bytes3, chunkSize);
|
47208
47662
|
const codeRoot = calcRoot(chunks.map((c) => hexlify(c)));
|
47209
47663
|
const predicateRoot = hash2(concat(["0x4655454C", codeRoot]));
|
47210
47664
|
return predicateRoot;
|
@@ -47300,8 +47754,8 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
47300
47754
|
* @param configurableConstants - Optional configurable constants for the predicate.
|
47301
47755
|
* @returns An object containing the new predicate bytes and interface.
|
47302
47756
|
*/
|
47303
|
-
static processPredicateData(
|
47304
|
-
let predicateBytes = arrayify(
|
47757
|
+
static processPredicateData(bytes3, jsonAbi, configurableConstants) {
|
47758
|
+
let predicateBytes = arrayify(bytes3);
|
47305
47759
|
let abiInterface;
|
47306
47760
|
if (jsonAbi) {
|
47307
47761
|
abiInterface = new Interface(jsonAbi);
|
@@ -47364,8 +47818,8 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
47364
47818
|
* @param abiInterface - The ABI interface of the predicate.
|
47365
47819
|
* @returns The mutated bytes with the configurable constants set.
|
47366
47820
|
*/
|
47367
|
-
static setConfigurableConstants(
|
47368
|
-
const mutatedBytes =
|
47821
|
+
static setConfigurableConstants(bytes3, configurableConstants, abiInterface) {
|
47822
|
+
const mutatedBytes = bytes3;
|
47369
47823
|
try {
|
47370
47824
|
if (!abiInterface) {
|
47371
47825
|
throw new Error(
|
@@ -47592,7 +48046,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
47592
48046
|
throw new Error("Method not implemented.");
|
47593
48047
|
}
|
47594
48048
|
/**
|
47595
|
-
* Should add the
|
48049
|
+
* Should add the assets metadata to the connector and return true if the asset
|
47596
48050
|
* was added successfully.
|
47597
48051
|
*
|
47598
48052
|
* If the asset already exists it should throw an error.
|
@@ -47606,7 +48060,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
47606
48060
|
throw new Error("Method not implemented.");
|
47607
48061
|
}
|
47608
48062
|
/**
|
47609
|
-
* Should add the
|
48063
|
+
* Should add the asset metadata to the connector and return true if the asset
|
47610
48064
|
* was added successfully.
|
47611
48065
|
*
|
47612
48066
|
* If the asset already exists it should throw an error.
|
@@ -48109,6 +48563,9 @@ mime-types/index.js:
|
|
48109
48563
|
@noble/curves/esm/abstract/utils.js:
|
48110
48564
|
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
48111
48565
|
|
48566
|
+
@noble/hashes/esm/utils.js:
|
48567
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
48568
|
+
|
48112
48569
|
@noble/curves/esm/abstract/modular.js:
|
48113
48570
|
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
48114
48571
|
|