@fuel-ts/account 0.94.3 → 0.94.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account.d.ts.map +1 -1
- package/dist/index.global.js +352 -268
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +307 -167
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +304 -167
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts.map +1 -1
- package/dist/providers/__generated__/operations.d.ts +81 -0
- package/dist/providers/__generated__/operations.d.ts.map +1 -1
- package/dist/providers/message.d.ts +3 -0
- package/dist/providers/message.d.ts.map +1 -1
- package/dist/providers/provider.d.ts +27 -2
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-request/blob-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/helpers.d.ts +2 -0
- package/dist/providers/transaction-request/helpers.d.ts.map +1 -1
- package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +4 -2
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
- package/dist/providers/utils/extract-tx-error.d.ts.map +1 -1
- package/dist/providers/utils/handle-gql-error-message.d.ts +6 -0
- package/dist/providers/utils/handle-gql-error-message.d.ts.map +1 -0
- package/dist/test-utils/launchNode.d.ts.map +1 -1
- package/dist/test-utils.global.js +196 -118
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +262 -134
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +260 -132
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +16 -16
package/dist/index.global.js
CHANGED
@@ -4754,8 +4754,8 @@
|
|
4754
4754
|
var utils = require_utils();
|
4755
4755
|
var Impl = require_URL_impl();
|
4756
4756
|
var impl = utils.implSymbol;
|
4757
|
-
function
|
4758
|
-
if (!this || this[impl] || !(this instanceof
|
4757
|
+
function URL3(url) {
|
4758
|
+
if (!this || this[impl] || !(this instanceof URL3)) {
|
4759
4759
|
throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");
|
4760
4760
|
}
|
4761
4761
|
if (arguments.length < 1) {
|
@@ -4771,7 +4771,7 @@
|
|
4771
4771
|
}
|
4772
4772
|
module.exports.setup(this, args);
|
4773
4773
|
}
|
4774
|
-
|
4774
|
+
URL3.prototype.toJSON = function toJSON() {
|
4775
4775
|
if (!this || !module.exports.is(this)) {
|
4776
4776
|
throw new TypeError("Illegal invocation");
|
4777
4777
|
}
|
@@ -4781,7 +4781,7 @@
|
|
4781
4781
|
}
|
4782
4782
|
return this[impl].toJSON.apply(this[impl], args);
|
4783
4783
|
};
|
4784
|
-
Object.defineProperty(
|
4784
|
+
Object.defineProperty(URL3.prototype, "href", {
|
4785
4785
|
get() {
|
4786
4786
|
return this[impl].href;
|
4787
4787
|
},
|
@@ -4792,20 +4792,20 @@
|
|
4792
4792
|
enumerable: true,
|
4793
4793
|
configurable: true
|
4794
4794
|
});
|
4795
|
-
|
4795
|
+
URL3.prototype.toString = function() {
|
4796
4796
|
if (!this || !module.exports.is(this)) {
|
4797
4797
|
throw new TypeError("Illegal invocation");
|
4798
4798
|
}
|
4799
4799
|
return this.href;
|
4800
4800
|
};
|
4801
|
-
Object.defineProperty(
|
4801
|
+
Object.defineProperty(URL3.prototype, "origin", {
|
4802
4802
|
get() {
|
4803
4803
|
return this[impl].origin;
|
4804
4804
|
},
|
4805
4805
|
enumerable: true,
|
4806
4806
|
configurable: true
|
4807
4807
|
});
|
4808
|
-
Object.defineProperty(
|
4808
|
+
Object.defineProperty(URL3.prototype, "protocol", {
|
4809
4809
|
get() {
|
4810
4810
|
return this[impl].protocol;
|
4811
4811
|
},
|
@@ -4816,7 +4816,7 @@
|
|
4816
4816
|
enumerable: true,
|
4817
4817
|
configurable: true
|
4818
4818
|
});
|
4819
|
-
Object.defineProperty(
|
4819
|
+
Object.defineProperty(URL3.prototype, "username", {
|
4820
4820
|
get() {
|
4821
4821
|
return this[impl].username;
|
4822
4822
|
},
|
@@ -4827,7 +4827,7 @@
|
|
4827
4827
|
enumerable: true,
|
4828
4828
|
configurable: true
|
4829
4829
|
});
|
4830
|
-
Object.defineProperty(
|
4830
|
+
Object.defineProperty(URL3.prototype, "password", {
|
4831
4831
|
get() {
|
4832
4832
|
return this[impl].password;
|
4833
4833
|
},
|
@@ -4838,7 +4838,7 @@
|
|
4838
4838
|
enumerable: true,
|
4839
4839
|
configurable: true
|
4840
4840
|
});
|
4841
|
-
Object.defineProperty(
|
4841
|
+
Object.defineProperty(URL3.prototype, "host", {
|
4842
4842
|
get() {
|
4843
4843
|
return this[impl].host;
|
4844
4844
|
},
|
@@ -4849,7 +4849,7 @@
|
|
4849
4849
|
enumerable: true,
|
4850
4850
|
configurable: true
|
4851
4851
|
});
|
4852
|
-
Object.defineProperty(
|
4852
|
+
Object.defineProperty(URL3.prototype, "hostname", {
|
4853
4853
|
get() {
|
4854
4854
|
return this[impl].hostname;
|
4855
4855
|
},
|
@@ -4860,7 +4860,7 @@
|
|
4860
4860
|
enumerable: true,
|
4861
4861
|
configurable: true
|
4862
4862
|
});
|
4863
|
-
Object.defineProperty(
|
4863
|
+
Object.defineProperty(URL3.prototype, "port", {
|
4864
4864
|
get() {
|
4865
4865
|
return this[impl].port;
|
4866
4866
|
},
|
@@ -4871,7 +4871,7 @@
|
|
4871
4871
|
enumerable: true,
|
4872
4872
|
configurable: true
|
4873
4873
|
});
|
4874
|
-
Object.defineProperty(
|
4874
|
+
Object.defineProperty(URL3.prototype, "pathname", {
|
4875
4875
|
get() {
|
4876
4876
|
return this[impl].pathname;
|
4877
4877
|
},
|
@@ -4882,7 +4882,7 @@
|
|
4882
4882
|
enumerable: true,
|
4883
4883
|
configurable: true
|
4884
4884
|
});
|
4885
|
-
Object.defineProperty(
|
4885
|
+
Object.defineProperty(URL3.prototype, "search", {
|
4886
4886
|
get() {
|
4887
4887
|
return this[impl].search;
|
4888
4888
|
},
|
@@ -4893,7 +4893,7 @@
|
|
4893
4893
|
enumerable: true,
|
4894
4894
|
configurable: true
|
4895
4895
|
});
|
4896
|
-
Object.defineProperty(
|
4896
|
+
Object.defineProperty(URL3.prototype, "hash", {
|
4897
4897
|
get() {
|
4898
4898
|
return this[impl].hash;
|
4899
4899
|
},
|
@@ -4909,7 +4909,7 @@
|
|
4909
4909
|
return !!obj && obj[impl] instanceof Impl.implementation;
|
4910
4910
|
},
|
4911
4911
|
create(constructorArgs, privateData) {
|
4912
|
-
let obj = Object.create(
|
4912
|
+
let obj = Object.create(URL3.prototype);
|
4913
4913
|
this.setup(obj, constructorArgs, privateData);
|
4914
4914
|
return obj;
|
4915
4915
|
},
|
@@ -4920,10 +4920,10 @@
|
|
4920
4920
|
obj[impl] = new Impl.implementation(constructorArgs, privateData);
|
4921
4921
|
obj[impl][utils.wrapperSymbol] = obj;
|
4922
4922
|
},
|
4923
|
-
interface:
|
4923
|
+
interface: URL3,
|
4924
4924
|
expose: {
|
4925
|
-
Window: { URL:
|
4926
|
-
Worker: { URL:
|
4925
|
+
Window: { URL: URL3 },
|
4926
|
+
Worker: { URL: URL3 }
|
4927
4927
|
}
|
4928
4928
|
};
|
4929
4929
|
}
|
@@ -5257,7 +5257,7 @@
|
|
5257
5257
|
}
|
5258
5258
|
function parseURL(urlStr) {
|
5259
5259
|
if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) {
|
5260
|
-
urlStr = new
|
5260
|
+
urlStr = new URL2(urlStr).toString();
|
5261
5261
|
}
|
5262
5262
|
return parse_url(urlStr);
|
5263
5263
|
}
|
@@ -5551,7 +5551,7 @@
|
|
5551
5551
|
stream.end();
|
5552
5552
|
}
|
5553
5553
|
}
|
5554
|
-
var import_stream, import_http, import_url, import_whatwg_url, import_https, import_zlib, Readable, BUFFER, TYPE, Blob2, convert, INTERNALS, PassThrough, invalidTokenRegex, invalidHeaderCharRegex, MAP, Headers2, INTERNAL, HeadersIteratorPrototype, INTERNALS$1, STATUS_CODES, Response2, INTERNALS$2,
|
5554
|
+
var import_stream, import_http, import_url, import_whatwg_url, import_https, import_zlib, Readable, BUFFER, TYPE, Blob2, convert, INTERNALS, PassThrough, invalidTokenRegex, invalidHeaderCharRegex, MAP, Headers2, INTERNAL, HeadersIteratorPrototype, INTERNALS$1, STATUS_CODES, Response2, INTERNALS$2, URL2, parse_url, format_url, streamDestructionSupported, Request, URL$1, PassThrough$1, isDomainOrSubdomain, isSameProtocol, lib_default;
|
5555
5555
|
var init_lib = __esm({
|
5556
5556
|
"../../node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.mjs"() {
|
5557
5557
|
import_stream = __toESM(__require("stream"), 1);
|
@@ -6074,7 +6074,7 @@
|
|
6074
6074
|
configurable: true
|
6075
6075
|
});
|
6076
6076
|
INTERNALS$2 = Symbol("Request internals");
|
6077
|
-
|
6077
|
+
URL2 = import_url.default.URL || import_whatwg_url.default.URL;
|
6078
6078
|
parse_url = import_url.default.parse;
|
6079
6079
|
format_url = import_url.default.format;
|
6080
6080
|
streamDestructionSupported = "destroy" in import_stream.default.Readable.prototype;
|
@@ -28800,8 +28800,8 @@ spurious results.`);
|
|
28800
28800
|
function getBuiltinVersions() {
|
28801
28801
|
return {
|
28802
28802
|
FORC: "0.63.3",
|
28803
|
-
FUEL_CORE: "0.
|
28804
|
-
FUELS: "0.94.
|
28803
|
+
FUEL_CORE: "0.35.0",
|
28804
|
+
FUELS: "0.94.4"
|
28805
28805
|
};
|
28806
28806
|
}
|
28807
28807
|
function parseVersion(version) {
|
@@ -28964,7 +28964,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
28964
28964
|
return new _FuelError(error.code, error.message);
|
28965
28965
|
}
|
28966
28966
|
code;
|
28967
|
-
constructor(code, message, metadata = {}, rawError =
|
28967
|
+
constructor(code, message, metadata = {}, rawError = null) {
|
28968
28968
|
super(message);
|
28969
28969
|
this.code = code;
|
28970
28970
|
this.name = "FuelError";
|
@@ -30422,44 +30422,16 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30422
30422
|
return derivedKey;
|
30423
30423
|
};
|
30424
30424
|
var keccak256 = (data) => keccak_256(data);
|
30425
|
-
var locked = false;
|
30426
|
-
var helper2 = (data) => ripemd160(data);
|
30427
|
-
var ripemd = helper2;
|
30428
30425
|
function ripemd1602(_data) {
|
30429
30426
|
const data = arrayify(_data, "data");
|
30430
|
-
return
|
30427
|
+
return ripemd160(data);
|
30431
30428
|
}
|
30432
|
-
ripemd1602._ = helper2;
|
30433
|
-
ripemd1602.lock = () => {
|
30434
|
-
locked = true;
|
30435
|
-
};
|
30436
|
-
ripemd1602.register = (func) => {
|
30437
|
-
if (locked) {
|
30438
|
-
throw new FuelError(ErrorCode.HASHER_LOCKED, "ripemd160 is locked");
|
30439
|
-
}
|
30440
|
-
ripemd = func;
|
30441
|
-
};
|
30442
|
-
Object.freeze(ripemd1602);
|
30443
30429
|
var bufferFromString = (string, encoding = "base64") => Uint8Array.from(Buffer.from(string, encoding));
|
30444
|
-
var locked2 = false;
|
30445
|
-
var PBKDF2 = (password, salt, iterations, keylen, algo) => (0, import_crypto2.pbkdf2Sync)(password, salt, iterations, keylen, algo);
|
30446
|
-
var pBkdf2 = PBKDF2;
|
30447
30430
|
function pbkdf22(_password, _salt, iterations, keylen, algo) {
|
30448
30431
|
const password = arrayify(_password, "password");
|
30449
30432
|
const salt = arrayify(_salt, "salt");
|
30450
|
-
return hexlify(
|
30433
|
+
return hexlify((0, import_crypto2.pbkdf2Sync)(password, salt, iterations, keylen, algo));
|
30451
30434
|
}
|
30452
|
-
pbkdf22._ = PBKDF2;
|
30453
|
-
pbkdf22.lock = () => {
|
30454
|
-
locked2 = true;
|
30455
|
-
};
|
30456
|
-
pbkdf22.register = (func) => {
|
30457
|
-
if (locked2) {
|
30458
|
-
throw new FuelError(ErrorCode.HASHER_LOCKED, "pbkdf2 is locked");
|
30459
|
-
}
|
30460
|
-
pBkdf2 = func;
|
30461
|
-
};
|
30462
|
-
Object.freeze(pbkdf22);
|
30463
30435
|
var randomBytes = (length) => {
|
30464
30436
|
const randomValues = Uint8Array.from(import_crypto3.default.randomBytes(length));
|
30465
30437
|
return randomValues;
|
@@ -30510,25 +30482,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
30510
30482
|
const decrypted = await Buffer.concat([decipher.update(data), decipher.final()]);
|
30511
30483
|
return new Uint8Array(decrypted);
|
30512
30484
|
}
|
30513
|
-
var locked3 = false;
|
30514
|
-
var COMPUTEHMAC = (algorithm, key, data) => (0, import_crypto5.createHmac)(algorithm, key).update(data).digest();
|
30515
|
-
var computeHMAC = COMPUTEHMAC;
|
30516
30485
|
function computeHmac(algorithm, _key, _data) {
|
30517
30486
|
const key = arrayify(_key, "key");
|
30518
30487
|
const data = arrayify(_data, "data");
|
30519
|
-
return hexlify(
|
30488
|
+
return hexlify((0, import_crypto5.createHmac)(algorithm, key).update(data).digest());
|
30520
30489
|
}
|
30521
|
-
computeHmac._ = COMPUTEHMAC;
|
30522
|
-
computeHmac.lock = () => {
|
30523
|
-
locked3 = true;
|
30524
|
-
};
|
30525
|
-
computeHmac.register = (func) => {
|
30526
|
-
if (locked3) {
|
30527
|
-
throw new FuelError(ErrorCode.HASHER_LOCKED, "computeHmac is locked");
|
30528
|
-
}
|
30529
|
-
computeHMAC = func;
|
30530
|
-
};
|
30531
|
-
Object.freeze(computeHmac);
|
30532
30490
|
var randomUUID = () => (0, import_crypto6.randomUUID)();
|
30533
30491
|
var api = {
|
30534
30492
|
bufferFromString,
|
@@ -32105,169 +32063,6 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
32105
32063
|
}
|
32106
32064
|
};
|
32107
32065
|
|
32108
|
-
// ../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_isPlaceholder.js
|
32109
|
-
function _isPlaceholder(a) {
|
32110
|
-
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
32111
|
-
}
|
32112
|
-
|
32113
|
-
// ../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_curry1.js
|
32114
|
-
function _curry1(fn) {
|
32115
|
-
return function f1(a) {
|
32116
|
-
if (arguments.length === 0 || _isPlaceholder(a)) {
|
32117
|
-
return f1;
|
32118
|
-
} else {
|
32119
|
-
return fn.apply(this, arguments);
|
32120
|
-
}
|
32121
|
-
};
|
32122
|
-
}
|
32123
|
-
|
32124
|
-
// ../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/type.js
|
32125
|
-
var type = /* @__PURE__ */ _curry1(function type2(val) {
|
32126
|
-
return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
|
32127
|
-
});
|
32128
|
-
var type_default = type;
|
32129
|
-
|
32130
|
-
// ../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_cloneRegExp.js
|
32131
|
-
function _cloneRegExp(pattern) {
|
32132
|
-
return new RegExp(pattern.source, pattern.flags ? pattern.flags : (pattern.global ? "g" : "") + (pattern.ignoreCase ? "i" : "") + (pattern.multiline ? "m" : "") + (pattern.sticky ? "y" : "") + (pattern.unicode ? "u" : "") + (pattern.dotAll ? "s" : ""));
|
32133
|
-
}
|
32134
|
-
|
32135
|
-
// ../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_clone.js
|
32136
|
-
function _clone(value, deep, map) {
|
32137
|
-
map || (map = new _ObjectMap());
|
32138
|
-
if (_isPrimitive(value)) {
|
32139
|
-
return value;
|
32140
|
-
}
|
32141
|
-
var copy = function copy2(copiedValue) {
|
32142
|
-
var cachedCopy = map.get(value);
|
32143
|
-
if (cachedCopy) {
|
32144
|
-
return cachedCopy;
|
32145
|
-
}
|
32146
|
-
map.set(value, copiedValue);
|
32147
|
-
for (var key in value) {
|
32148
|
-
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
32149
|
-
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
32150
|
-
}
|
32151
|
-
}
|
32152
|
-
return copiedValue;
|
32153
|
-
};
|
32154
|
-
switch (type_default(value)) {
|
32155
|
-
case "Object":
|
32156
|
-
return copy(Object.create(Object.getPrototypeOf(value)));
|
32157
|
-
case "Array":
|
32158
|
-
return copy(Array(value.length));
|
32159
|
-
case "Date":
|
32160
|
-
return new Date(value.valueOf());
|
32161
|
-
case "RegExp":
|
32162
|
-
return _cloneRegExp(value);
|
32163
|
-
case "Int8Array":
|
32164
|
-
case "Uint8Array":
|
32165
|
-
case "Uint8ClampedArray":
|
32166
|
-
case "Int16Array":
|
32167
|
-
case "Uint16Array":
|
32168
|
-
case "Int32Array":
|
32169
|
-
case "Uint32Array":
|
32170
|
-
case "Float32Array":
|
32171
|
-
case "Float64Array":
|
32172
|
-
case "BigInt64Array":
|
32173
|
-
case "BigUint64Array":
|
32174
|
-
return value.slice();
|
32175
|
-
default:
|
32176
|
-
return value;
|
32177
|
-
}
|
32178
|
-
}
|
32179
|
-
function _isPrimitive(param) {
|
32180
|
-
var type3 = typeof param;
|
32181
|
-
return param == null || type3 != "object" && type3 != "function";
|
32182
|
-
}
|
32183
|
-
var _ObjectMap = /* @__PURE__ */ function() {
|
32184
|
-
function _ObjectMap2() {
|
32185
|
-
this.map = {};
|
32186
|
-
this.length = 0;
|
32187
|
-
}
|
32188
|
-
_ObjectMap2.prototype.set = function(key, value) {
|
32189
|
-
var hashedKey = this.hash(key);
|
32190
|
-
var bucket = this.map[hashedKey];
|
32191
|
-
if (!bucket) {
|
32192
|
-
this.map[hashedKey] = bucket = [];
|
32193
|
-
}
|
32194
|
-
bucket.push([key, value]);
|
32195
|
-
this.length += 1;
|
32196
|
-
};
|
32197
|
-
_ObjectMap2.prototype.hash = function(key) {
|
32198
|
-
var hashedKey = [];
|
32199
|
-
for (var value in key) {
|
32200
|
-
hashedKey.push(Object.prototype.toString.call(key[value]));
|
32201
|
-
}
|
32202
|
-
return hashedKey.join();
|
32203
|
-
};
|
32204
|
-
_ObjectMap2.prototype.get = function(key) {
|
32205
|
-
if (this.length <= 180) {
|
32206
|
-
for (var p in this.map) {
|
32207
|
-
var bucket = this.map[p];
|
32208
|
-
for (var i = 0; i < bucket.length; i += 1) {
|
32209
|
-
var element = bucket[i];
|
32210
|
-
if (element[0] === key) {
|
32211
|
-
return element[1];
|
32212
|
-
}
|
32213
|
-
}
|
32214
|
-
}
|
32215
|
-
return;
|
32216
|
-
}
|
32217
|
-
var hashedKey = this.hash(key);
|
32218
|
-
var bucket = this.map[hashedKey];
|
32219
|
-
if (!bucket) {
|
32220
|
-
return;
|
32221
|
-
}
|
32222
|
-
for (var i = 0; i < bucket.length; i += 1) {
|
32223
|
-
var element = bucket[i];
|
32224
|
-
if (element[0] === key) {
|
32225
|
-
return element[1];
|
32226
|
-
}
|
32227
|
-
}
|
32228
|
-
};
|
32229
|
-
return _ObjectMap2;
|
32230
|
-
}();
|
32231
|
-
|
32232
|
-
// ../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/clone.js
|
32233
|
-
var clone = /* @__PURE__ */ _curry1(function clone2(value) {
|
32234
|
-
return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
|
32235
|
-
});
|
32236
|
-
var clone_default = clone;
|
32237
|
-
|
32238
|
-
// src/providers/coin-quantity.ts
|
32239
|
-
var coinQuantityfy = (coinQuantityLike) => {
|
32240
|
-
let assetId;
|
32241
|
-
let amount;
|
32242
|
-
let max;
|
32243
|
-
if (Array.isArray(coinQuantityLike)) {
|
32244
|
-
amount = coinQuantityLike[0];
|
32245
|
-
assetId = coinQuantityLike[1];
|
32246
|
-
max = coinQuantityLike[2] ?? void 0;
|
32247
|
-
} else {
|
32248
|
-
amount = coinQuantityLike.amount;
|
32249
|
-
assetId = coinQuantityLike.assetId;
|
32250
|
-
max = coinQuantityLike.max ?? void 0;
|
32251
|
-
}
|
32252
|
-
const bnAmount = bn(amount);
|
32253
|
-
return {
|
32254
|
-
assetId: hexlify(assetId),
|
32255
|
-
amount: bnAmount.lt(1) ? bn(1) : bnAmount,
|
32256
|
-
max: max ? bn(max) : void 0
|
32257
|
-
};
|
32258
|
-
};
|
32259
|
-
var addAmountToCoinQuantities = (params) => {
|
32260
|
-
const { amount, assetId } = params;
|
32261
|
-
const coinQuantities = [...params.coinQuantities];
|
32262
|
-
const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);
|
32263
|
-
if (assetIdx !== -1) {
|
32264
|
-
coinQuantities[assetIdx].amount = coinQuantities[assetIdx].amount.add(amount);
|
32265
|
-
} else {
|
32266
|
-
coinQuantities.push({ assetId, amount });
|
32267
|
-
}
|
32268
|
-
return coinQuantities;
|
32269
|
-
};
|
32270
|
-
|
32271
32066
|
// ../transactions/dist/index.mjs
|
32272
32067
|
var ByteArrayCoder = class extends Coder {
|
32273
32068
|
length;
|
@@ -33634,6 +33429,169 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
33634
33429
|
}
|
33635
33430
|
};
|
33636
33431
|
|
33432
|
+
// ../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_isPlaceholder.js
|
33433
|
+
function _isPlaceholder(a) {
|
33434
|
+
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
33435
|
+
}
|
33436
|
+
|
33437
|
+
// ../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_curry1.js
|
33438
|
+
function _curry1(fn) {
|
33439
|
+
return function f1(a) {
|
33440
|
+
if (arguments.length === 0 || _isPlaceholder(a)) {
|
33441
|
+
return f1;
|
33442
|
+
} else {
|
33443
|
+
return fn.apply(this, arguments);
|
33444
|
+
}
|
33445
|
+
};
|
33446
|
+
}
|
33447
|
+
|
33448
|
+
// ../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/type.js
|
33449
|
+
var type = /* @__PURE__ */ _curry1(function type2(val) {
|
33450
|
+
return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
|
33451
|
+
});
|
33452
|
+
var type_default = type;
|
33453
|
+
|
33454
|
+
// ../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_cloneRegExp.js
|
33455
|
+
function _cloneRegExp(pattern) {
|
33456
|
+
return new RegExp(pattern.source, pattern.flags ? pattern.flags : (pattern.global ? "g" : "") + (pattern.ignoreCase ? "i" : "") + (pattern.multiline ? "m" : "") + (pattern.sticky ? "y" : "") + (pattern.unicode ? "u" : "") + (pattern.dotAll ? "s" : ""));
|
33457
|
+
}
|
33458
|
+
|
33459
|
+
// ../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_clone.js
|
33460
|
+
function _clone(value, deep, map) {
|
33461
|
+
map || (map = new _ObjectMap());
|
33462
|
+
if (_isPrimitive(value)) {
|
33463
|
+
return value;
|
33464
|
+
}
|
33465
|
+
var copy = function copy2(copiedValue) {
|
33466
|
+
var cachedCopy = map.get(value);
|
33467
|
+
if (cachedCopy) {
|
33468
|
+
return cachedCopy;
|
33469
|
+
}
|
33470
|
+
map.set(value, copiedValue);
|
33471
|
+
for (var key in value) {
|
33472
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
33473
|
+
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
33474
|
+
}
|
33475
|
+
}
|
33476
|
+
return copiedValue;
|
33477
|
+
};
|
33478
|
+
switch (type_default(value)) {
|
33479
|
+
case "Object":
|
33480
|
+
return copy(Object.create(Object.getPrototypeOf(value)));
|
33481
|
+
case "Array":
|
33482
|
+
return copy(Array(value.length));
|
33483
|
+
case "Date":
|
33484
|
+
return new Date(value.valueOf());
|
33485
|
+
case "RegExp":
|
33486
|
+
return _cloneRegExp(value);
|
33487
|
+
case "Int8Array":
|
33488
|
+
case "Uint8Array":
|
33489
|
+
case "Uint8ClampedArray":
|
33490
|
+
case "Int16Array":
|
33491
|
+
case "Uint16Array":
|
33492
|
+
case "Int32Array":
|
33493
|
+
case "Uint32Array":
|
33494
|
+
case "Float32Array":
|
33495
|
+
case "Float64Array":
|
33496
|
+
case "BigInt64Array":
|
33497
|
+
case "BigUint64Array":
|
33498
|
+
return value.slice();
|
33499
|
+
default:
|
33500
|
+
return value;
|
33501
|
+
}
|
33502
|
+
}
|
33503
|
+
function _isPrimitive(param) {
|
33504
|
+
var type3 = typeof param;
|
33505
|
+
return param == null || type3 != "object" && type3 != "function";
|
33506
|
+
}
|
33507
|
+
var _ObjectMap = /* @__PURE__ */ function() {
|
33508
|
+
function _ObjectMap2() {
|
33509
|
+
this.map = {};
|
33510
|
+
this.length = 0;
|
33511
|
+
}
|
33512
|
+
_ObjectMap2.prototype.set = function(key, value) {
|
33513
|
+
var hashedKey = this.hash(key);
|
33514
|
+
var bucket = this.map[hashedKey];
|
33515
|
+
if (!bucket) {
|
33516
|
+
this.map[hashedKey] = bucket = [];
|
33517
|
+
}
|
33518
|
+
bucket.push([key, value]);
|
33519
|
+
this.length += 1;
|
33520
|
+
};
|
33521
|
+
_ObjectMap2.prototype.hash = function(key) {
|
33522
|
+
var hashedKey = [];
|
33523
|
+
for (var value in key) {
|
33524
|
+
hashedKey.push(Object.prototype.toString.call(key[value]));
|
33525
|
+
}
|
33526
|
+
return hashedKey.join();
|
33527
|
+
};
|
33528
|
+
_ObjectMap2.prototype.get = function(key) {
|
33529
|
+
if (this.length <= 180) {
|
33530
|
+
for (var p in this.map) {
|
33531
|
+
var bucket = this.map[p];
|
33532
|
+
for (var i = 0; i < bucket.length; i += 1) {
|
33533
|
+
var element = bucket[i];
|
33534
|
+
if (element[0] === key) {
|
33535
|
+
return element[1];
|
33536
|
+
}
|
33537
|
+
}
|
33538
|
+
}
|
33539
|
+
return;
|
33540
|
+
}
|
33541
|
+
var hashedKey = this.hash(key);
|
33542
|
+
var bucket = this.map[hashedKey];
|
33543
|
+
if (!bucket) {
|
33544
|
+
return;
|
33545
|
+
}
|
33546
|
+
for (var i = 0; i < bucket.length; i += 1) {
|
33547
|
+
var element = bucket[i];
|
33548
|
+
if (element[0] === key) {
|
33549
|
+
return element[1];
|
33550
|
+
}
|
33551
|
+
}
|
33552
|
+
};
|
33553
|
+
return _ObjectMap2;
|
33554
|
+
}();
|
33555
|
+
|
33556
|
+
// ../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/clone.js
|
33557
|
+
var clone = /* @__PURE__ */ _curry1(function clone2(value) {
|
33558
|
+
return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
|
33559
|
+
});
|
33560
|
+
var clone_default = clone;
|
33561
|
+
|
33562
|
+
// src/providers/coin-quantity.ts
|
33563
|
+
var coinQuantityfy = (coinQuantityLike) => {
|
33564
|
+
let assetId;
|
33565
|
+
let amount;
|
33566
|
+
let max;
|
33567
|
+
if (Array.isArray(coinQuantityLike)) {
|
33568
|
+
amount = coinQuantityLike[0];
|
33569
|
+
assetId = coinQuantityLike[1];
|
33570
|
+
max = coinQuantityLike[2] ?? void 0;
|
33571
|
+
} else {
|
33572
|
+
amount = coinQuantityLike.amount;
|
33573
|
+
assetId = coinQuantityLike.assetId;
|
33574
|
+
max = coinQuantityLike.max ?? void 0;
|
33575
|
+
}
|
33576
|
+
const bnAmount = bn(amount);
|
33577
|
+
return {
|
33578
|
+
assetId: hexlify(assetId),
|
33579
|
+
amount: bnAmount.lt(1) ? bn(1) : bnAmount,
|
33580
|
+
max: max ? bn(max) : void 0
|
33581
|
+
};
|
33582
|
+
};
|
33583
|
+
var addAmountToCoinQuantities = (params) => {
|
33584
|
+
const { amount, assetId } = params;
|
33585
|
+
const coinQuantities = [...params.coinQuantities];
|
33586
|
+
const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);
|
33587
|
+
if (assetIdx !== -1) {
|
33588
|
+
coinQuantities[assetIdx].amount = coinQuantities[assetIdx].amount.add(amount);
|
33589
|
+
} else {
|
33590
|
+
coinQuantities.push({ assetId, amount });
|
33591
|
+
}
|
33592
|
+
return coinQuantities;
|
33593
|
+
};
|
33594
|
+
|
33637
33595
|
// ../../node_modules/.pnpm/@noble+curves@1.4.2/node_modules/@noble/curves/esm/abstract/utils.js
|
33638
33596
|
var utils_exports = {};
|
33639
33597
|
__export(utils_exports, {
|
@@ -37369,6 +37327,14 @@ ${ReceiptFragmentDoc}`;
|
|
37369
37327
|
height
|
37370
37328
|
header {
|
37371
37329
|
time
|
37330
|
+
daHeight
|
37331
|
+
stateTransitionBytecodeVersion
|
37332
|
+
transactionsCount
|
37333
|
+
transactionsRoot
|
37334
|
+
messageOutboxRoot
|
37335
|
+
eventInboxRoot
|
37336
|
+
prevRoot
|
37337
|
+
applicationHash
|
37372
37338
|
}
|
37373
37339
|
transactions {
|
37374
37340
|
id
|
@@ -38335,6 +38301,9 @@ ${MessageFragmentDoc}`;
|
|
38335
38301
|
}
|
38336
38302
|
};
|
38337
38303
|
|
38304
|
+
// src/providers/message.ts
|
38305
|
+
var isMessageCoin = (message) => !("data" in message);
|
38306
|
+
|
38338
38307
|
// src/providers/resource.ts
|
38339
38308
|
var isRawCoin = (resource) => "utxoId" in resource;
|
38340
38309
|
var isRawMessage = (resource) => "recipient" in resource;
|
@@ -38827,20 +38796,22 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
38827
38796
|
let reason = "";
|
38828
38797
|
if (revertReceipt) {
|
38829
38798
|
const reasonHex = bn(revertReceipt.val).toHex();
|
38799
|
+
const lastLog = logs[logs.length - 1];
|
38800
|
+
const lastButOneLog = logs[logs.length - 2];
|
38830
38801
|
switch (reasonHex) {
|
38831
38802
|
case FAILED_REQUIRE_SIGNAL: {
|
38832
38803
|
reason = "require";
|
38833
|
-
errorMessage = `The transaction reverted because a "require" statement has thrown ${logs.length ? stringify(
|
38804
|
+
errorMessage = `The transaction reverted because a "require" statement has thrown ${logs.length ? stringify(lastLog) : "an error."}.`;
|
38834
38805
|
break;
|
38835
38806
|
}
|
38836
38807
|
case FAILED_ASSERT_EQ_SIGNAL: {
|
38837
|
-
const sufix = logs.length >= 2 ? ` comparing ${stringify(
|
38808
|
+
const sufix = logs.length >= 2 ? ` comparing ${stringify(lastLog)} and ${stringify(lastButOneLog)}.` : ".";
|
38838
38809
|
reason = "assert_eq";
|
38839
38810
|
errorMessage = `The transaction reverted because of an "assert_eq" statement${sufix}`;
|
38840
38811
|
break;
|
38841
38812
|
}
|
38842
38813
|
case FAILED_ASSERT_NE_SIGNAL: {
|
38843
|
-
const sufix = logs.length >= 2 ? ` comparing ${stringify(
|
38814
|
+
const sufix = logs.length >= 2 ? ` comparing ${stringify(lastButOneLog)} and ${stringify(lastLog)}.` : ".";
|
38844
38815
|
reason = "assert_ne";
|
38845
38816
|
errorMessage = `The transaction reverted because of an "assert_ne" statement${sufix}`;
|
38846
38817
|
break;
|
@@ -38911,7 +38882,9 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
38911
38882
|
// src/providers/transaction-request/helpers.ts
|
38912
38883
|
var isRequestInputCoin = (input) => input.type === InputType.Coin;
|
38913
38884
|
var isRequestInputMessage = (input) => input.type === InputType.Message;
|
38914
|
-
var
|
38885
|
+
var isRequestInputMessageWithoutData = (input) => input.type === InputType.Message && bn(input.data).isZero();
|
38886
|
+
var isRequestInputCoinOrMessage = (input) => isRequestInputCoin(input) || isRequestInputMessage(input);
|
38887
|
+
var isRequestInputResource = (input) => isRequestInputCoin(input) || isRequestInputMessageWithoutData(input);
|
38915
38888
|
var getRequestInputResourceOwner = (input) => isRequestInputCoin(input) ? input.owner : input.recipient;
|
38916
38889
|
var isRequestInputResourceFromOwner = (input, owner) => getRequestInputResourceOwner(input) === owner.toB256();
|
38917
38890
|
var getAssetAmountInRequestInputs = (inputs, assetId, baseAsset) => inputs.filter(isRequestInputResource).reduce((acc, input) => {
|
@@ -39220,7 +39193,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
39220
39193
|
* @param message - Message resource.
|
39221
39194
|
*/
|
39222
39195
|
addMessageInput(message) {
|
39223
|
-
const { recipient, sender, amount, predicate, nonce,
|
39196
|
+
const { recipient, sender, amount, predicate, nonce, predicateData } = message;
|
39224
39197
|
let witnessIndex;
|
39225
39198
|
if (message.predicate) {
|
39226
39199
|
witnessIndex = 0;
|
@@ -39235,13 +39208,16 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
39235
39208
|
type: InputType.Message,
|
39236
39209
|
sender: sender.toB256(),
|
39237
39210
|
recipient: recipient.toB256(),
|
39211
|
+
data: isMessageCoin(message) ? "0x" : message.data,
|
39238
39212
|
amount,
|
39239
39213
|
witnessIndex,
|
39240
39214
|
predicate,
|
39241
39215
|
predicateData
|
39242
39216
|
};
|
39243
39217
|
this.pushInput(input);
|
39244
|
-
|
39218
|
+
if (isMessageCoin(message)) {
|
39219
|
+
this.addChangeOutput(recipient, message.assetId);
|
39220
|
+
}
|
39245
39221
|
}
|
39246
39222
|
/**
|
39247
39223
|
* Adds a single resource to the transaction by adding a coin/message input and a
|
@@ -39373,6 +39349,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
39373
39349
|
*
|
39374
39350
|
* @param quantities - CoinQuantity Array.
|
39375
39351
|
* @param baseAssetId - The base asset to fund the transaction.
|
39352
|
+
* @deprecated - This method is deprecated and will be removed in future versions.
|
39353
|
+
* Please use `Account.generateFakeResources` along with `this.addResources` instead.
|
39376
39354
|
*/
|
39377
39355
|
fundWithFakeUtxos(quantities, baseAssetId, resourcesOwner) {
|
39378
39356
|
const findAssetInput = (assetId) => this.inputs.find((input) => {
|
@@ -39441,7 +39419,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
39441
39419
|
});
|
39442
39420
|
}
|
39443
39421
|
updatePredicateGasUsed(inputs) {
|
39444
|
-
const inputsToExtractGasUsed = inputs.filter(
|
39422
|
+
const inputsToExtractGasUsed = inputs.filter(isRequestInputCoinOrMessage);
|
39445
39423
|
this.inputs.filter(isRequestInputResource).forEach((i) => {
|
39446
39424
|
const owner = getRequestInputResourceOwner(i);
|
39447
39425
|
const correspondingInput = inputsToExtractGasUsed.find(
|
@@ -39525,10 +39503,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
39525
39503
|
// src/providers/transaction-request/blob-transaction-request.ts
|
39526
39504
|
var BlobTransactionRequest = class extends BaseTransactionRequest {
|
39527
39505
|
static from(obj) {
|
39528
|
-
|
39529
|
-
return obj;
|
39530
|
-
}
|
39531
|
-
return new this(obj);
|
39506
|
+
return new this(clone_default(obj));
|
39532
39507
|
}
|
39533
39508
|
/** Type of the transaction */
|
39534
39509
|
type = TransactionType.Blob;
|
@@ -39611,10 +39586,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
39611
39586
|
// src/providers/transaction-request/create-transaction-request.ts
|
39612
39587
|
var CreateTransactionRequest = class extends BaseTransactionRequest {
|
39613
39588
|
static from(obj) {
|
39614
|
-
|
39615
|
-
return obj;
|
39616
|
-
}
|
39617
|
-
return new this(obj);
|
39589
|
+
return new this(clone_default(obj));
|
39618
39590
|
}
|
39619
39591
|
/** Type of the transaction */
|
39620
39592
|
type = TransactionType.Create;
|
@@ -39724,10 +39696,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
39724
39696
|
// src/providers/transaction-request/script-transaction-request.ts
|
39725
39697
|
var ScriptTransactionRequest = class extends BaseTransactionRequest {
|
39726
39698
|
static from(obj) {
|
39727
|
-
|
39728
|
-
return obj;
|
39729
|
-
}
|
39730
|
-
return new this(obj);
|
39699
|
+
return new this(clone_default(obj));
|
39731
39700
|
}
|
39732
39701
|
/** Type of the transaction */
|
39733
39702
|
type = TransactionType.Script;
|
@@ -41051,6 +41020,21 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
41051
41020
|
};
|
41052
41021
|
}
|
41053
41022
|
|
41023
|
+
// src/providers/utils/handle-gql-error-message.ts
|
41024
|
+
var handleGqlErrorMessage = (errorMessage, rawError) => {
|
41025
|
+
switch (errorMessage) {
|
41026
|
+
case "not enough coins to fit the target" /* NOT_ENOUGH_COINS */:
|
41027
|
+
throw new FuelError(
|
41028
|
+
ErrorCode.NOT_ENOUGH_FUNDS,
|
41029
|
+
`The account(s) sending the transaction don't have enough funds to cover the transaction.`,
|
41030
|
+
{},
|
41031
|
+
rawError
|
41032
|
+
);
|
41033
|
+
default:
|
41034
|
+
throw new FuelError(ErrorCode.INVALID_REQUEST, errorMessage);
|
41035
|
+
}
|
41036
|
+
};
|
41037
|
+
|
41054
41038
|
// src/providers/provider.ts
|
41055
41039
|
var MAX_RETRIES = 10;
|
41056
41040
|
var RESOURCES_PAGE_SIZE_LIMIT = 512;
|
@@ -41177,6 +41161,17 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
41177
41161
|
return options.fetch ? options.fetch(url, fullRequest, options) : fetch(url, fullRequest);
|
41178
41162
|
}, retryOptions);
|
41179
41163
|
}
|
41164
|
+
static extractBasicAuth(url) {
|
41165
|
+
const parsedUrl = new URL(url);
|
41166
|
+
const username = parsedUrl.username;
|
41167
|
+
const password = parsedUrl.password;
|
41168
|
+
const urlNoBasicAuth = `${parsedUrl.origin}${parsedUrl.pathname}`;
|
41169
|
+
if (!(username && password)) {
|
41170
|
+
return { url, auth: void 0 };
|
41171
|
+
}
|
41172
|
+
const auth = `Basic ${btoa(`${username}:${password}`)}`;
|
41173
|
+
return { url: urlNoBasicAuth, auth };
|
41174
|
+
}
|
41180
41175
|
/**
|
41181
41176
|
* Creates a new instance of the Provider class. This is the recommended way to initialize a Provider.
|
41182
41177
|
*
|
@@ -41186,7 +41181,17 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
41186
41181
|
* @returns A promise that resolves to a Provider instance.
|
41187
41182
|
*/
|
41188
41183
|
static async create(url, options = {}) {
|
41189
|
-
const
|
41184
|
+
const { url: urlToUse, auth } = this.extractBasicAuth(url);
|
41185
|
+
const provider = new _Provider(urlToUse, {
|
41186
|
+
...options,
|
41187
|
+
requestMiddleware: async (request) => {
|
41188
|
+
if (auth) {
|
41189
|
+
request.headers ??= {};
|
41190
|
+
request.headers.Authorization = auth;
|
41191
|
+
}
|
41192
|
+
return options.requestMiddleware?.(request) ?? request;
|
41193
|
+
}
|
41194
|
+
});
|
41190
41195
|
await provider.fetchChainAndNodeInfo();
|
41191
41196
|
return provider;
|
41192
41197
|
}
|
@@ -41292,10 +41297,9 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
41292
41297
|
if ("response" in response) {
|
41293
41298
|
const graphQlResponse = response.response;
|
41294
41299
|
if (Array.isArray(graphQlResponse?.errors)) {
|
41295
|
-
|
41296
|
-
|
41297
|
-
|
41298
|
-
);
|
41300
|
+
for (const error of graphQlResponse.errors) {
|
41301
|
+
handleGqlErrorMessage(error.message, error);
|
41302
|
+
}
|
41299
41303
|
}
|
41300
41304
|
}
|
41301
41305
|
}
|
@@ -41313,7 +41317,26 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
41313
41317
|
}
|
41314
41318
|
return gqlClient.request(query, vars);
|
41315
41319
|
};
|
41316
|
-
|
41320
|
+
const customOperations = (requester) => ({
|
41321
|
+
getBlobs(variables) {
|
41322
|
+
const queryParams = variables.blobIds.map((_, i) => `$blobId${i}: BlobId!`).join(", ");
|
41323
|
+
const blobParams = variables.blobIds.map((_, i) => `blob${i}: blob(id: $blobId${i}) { id }`).join("\n");
|
41324
|
+
const updatedVariables = variables.blobIds.reduce(
|
41325
|
+
(acc, blobId, i) => {
|
41326
|
+
acc[`blobId${i}`] = blobId;
|
41327
|
+
return acc;
|
41328
|
+
},
|
41329
|
+
{}
|
41330
|
+
);
|
41331
|
+
const document2 = lib_default2`
|
41332
|
+
query getBlobs(${queryParams}) {
|
41333
|
+
${blobParams}
|
41334
|
+
}
|
41335
|
+
`;
|
41336
|
+
return requester(document2, updatedVariables);
|
41337
|
+
}
|
41338
|
+
});
|
41339
|
+
return { ...getSdk(executeQuery), ...customOperations(executeQuery) };
|
41317
41340
|
}
|
41318
41341
|
/**
|
41319
41342
|
* Returns the version of the connected node.
|
@@ -41860,6 +41883,21 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
41860
41883
|
}).filter((v) => !!v);
|
41861
41884
|
return coins;
|
41862
41885
|
}
|
41886
|
+
/**
|
41887
|
+
* Returns an array of blobIds that exist on chain, for a given array of blobIds.
|
41888
|
+
*
|
41889
|
+
* @param blobIds - blobIds to check.
|
41890
|
+
* @returns - A promise that resolves to an array of blobIds that exist on chain.
|
41891
|
+
*/
|
41892
|
+
async getBlobs(blobIds) {
|
41893
|
+
const res = await this.operations.getBlobs({ blobIds });
|
41894
|
+
const blobs = [];
|
41895
|
+
Object.keys(res).forEach((key) => {
|
41896
|
+
const val = res[key];
|
41897
|
+
blobs.push(val?.id ?? null);
|
41898
|
+
});
|
41899
|
+
return blobs.filter((v) => v);
|
41900
|
+
}
|
41863
41901
|
/**
|
41864
41902
|
* Returns block matching the given ID or height.
|
41865
41903
|
*
|
@@ -41881,11 +41919,22 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
41881
41919
|
if (!block2) {
|
41882
41920
|
return null;
|
41883
41921
|
}
|
41922
|
+
const { header, height, id, transactions } = block2;
|
41884
41923
|
return {
|
41885
|
-
id
|
41886
|
-
height: bn(
|
41887
|
-
time:
|
41888
|
-
|
41924
|
+
id,
|
41925
|
+
height: bn(height),
|
41926
|
+
time: header.time,
|
41927
|
+
header: {
|
41928
|
+
applicationHash: header.applicationHash,
|
41929
|
+
daHeight: bn(header.daHeight),
|
41930
|
+
eventInboxRoot: header.eventInboxRoot,
|
41931
|
+
messageOutboxRoot: header.messageOutboxRoot,
|
41932
|
+
prevRoot: header.prevRoot,
|
41933
|
+
stateTransitionBytecodeVersion: header.stateTransitionBytecodeVersion,
|
41934
|
+
transactionsCount: header.transactionsCount,
|
41935
|
+
transactionsRoot: header.transactionsRoot
|
41936
|
+
},
|
41937
|
+
transactionIds: transactions.map((tx) => tx.id)
|
41889
41938
|
};
|
41890
41939
|
}
|
41891
41940
|
/**
|
@@ -41907,6 +41956,16 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
41907
41956
|
id: block2.id,
|
41908
41957
|
height: bn(block2.height),
|
41909
41958
|
time: block2.header.time,
|
41959
|
+
header: {
|
41960
|
+
applicationHash: block2.header.applicationHash,
|
41961
|
+
daHeight: bn(block2.header.daHeight),
|
41962
|
+
eventInboxRoot: block2.header.eventInboxRoot,
|
41963
|
+
messageOutboxRoot: block2.header.messageOutboxRoot,
|
41964
|
+
prevRoot: block2.header.prevRoot,
|
41965
|
+
stateTransitionBytecodeVersion: block2.header.stateTransitionBytecodeVersion,
|
41966
|
+
transactionsCount: block2.header.transactionsCount,
|
41967
|
+
transactionsRoot: block2.header.transactionsRoot
|
41968
|
+
},
|
41910
41969
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
41911
41970
|
}));
|
41912
41971
|
return { blocks, pageInfo };
|
@@ -41934,6 +41993,16 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
41934
41993
|
id: block2.id,
|
41935
41994
|
height: bn(block2.height, 10),
|
41936
41995
|
time: block2.header.time,
|
41996
|
+
header: {
|
41997
|
+
applicationHash: block2.header.applicationHash,
|
41998
|
+
daHeight: bn(block2.header.daHeight),
|
41999
|
+
eventInboxRoot: block2.header.eventInboxRoot,
|
42000
|
+
messageOutboxRoot: block2.header.messageOutboxRoot,
|
42001
|
+
prevRoot: block2.header.prevRoot,
|
42002
|
+
stateTransitionBytecodeVersion: block2.header.stateTransitionBytecodeVersion,
|
42003
|
+
transactionsCount: block2.header.transactionsCount,
|
42004
|
+
transactionsRoot: block2.header.transactionsRoot
|
42005
|
+
},
|
41937
42006
|
transactionIds: block2.transactions.map((tx) => tx.id),
|
41938
42007
|
transactions: block2.transactions.map(
|
41939
42008
|
(tx) => new TransactionCoder().decode(arrayify(tx.rawPayload), 0)?.[0]
|
@@ -42245,10 +42314,25 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
42245
42314
|
* @returns A promise that resolves to the Message object or null.
|
42246
42315
|
*/
|
42247
42316
|
async getMessageByNonce(nonce) {
|
42248
|
-
const { message } = await this.operations.getMessageByNonce({ nonce });
|
42249
|
-
if (!
|
42317
|
+
const { message: rawMessage } = await this.operations.getMessageByNonce({ nonce });
|
42318
|
+
if (!rawMessage) {
|
42250
42319
|
return null;
|
42251
42320
|
}
|
42321
|
+
const message = {
|
42322
|
+
messageId: InputMessageCoder.getMessageId({
|
42323
|
+
sender: rawMessage.sender,
|
42324
|
+
recipient: rawMessage.recipient,
|
42325
|
+
nonce: rawMessage.nonce,
|
42326
|
+
amount: bn(rawMessage.amount),
|
42327
|
+
data: rawMessage.data
|
42328
|
+
}),
|
42329
|
+
sender: Address.fromAddressOrString(rawMessage.sender),
|
42330
|
+
recipient: Address.fromAddressOrString(rawMessage.recipient),
|
42331
|
+
nonce: rawMessage.nonce,
|
42332
|
+
amount: bn(rawMessage.amount),
|
42333
|
+
data: InputMessageCoder.decodeData(rawMessage.data),
|
42334
|
+
daHeight: bn(rawMessage.daHeight)
|
42335
|
+
};
|
42252
42336
|
return message;
|
42253
42337
|
}
|
42254
42338
|
/**
|
@@ -42809,7 +42893,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
42809
42893
|
gasPrice
|
42810
42894
|
});
|
42811
42895
|
const totalBaseAssetOnInputs = getAssetAmountInRequestInputs(
|
42812
|
-
request.inputs,
|
42896
|
+
request.inputs.filter(isRequestInputResource),
|
42813
42897
|
baseAssetId,
|
42814
42898
|
baseAssetId
|
42815
42899
|
);
|
@@ -43015,10 +43099,10 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
43015
43099
|
const requiredQuantities = mergeQuantities(coinOutputsQuantities, quantities);
|
43016
43100
|
const transactionFeeForDryRun = [{ assetId: baseAssetId, amount: bn("100000000000000000") }];
|
43017
43101
|
const findAssetInput = (assetId) => txRequestClone.inputs.find((input) => {
|
43018
|
-
if (
|
43102
|
+
if (input.type === InputType.Coin) {
|
43019
43103
|
return input.assetId === assetId;
|
43020
43104
|
}
|
43021
|
-
if (
|
43105
|
+
if (isRequestInputMessageWithoutData(input)) {
|
43022
43106
|
return baseAssetId === assetId;
|
43023
43107
|
}
|
43024
43108
|
return false;
|
@@ -48377,7 +48461,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
48377
48461
|
if (placeholderIndex !== -1) {
|
48378
48462
|
request.removeWitness(placeholderIndex);
|
48379
48463
|
}
|
48380
|
-
request.inputs.filter(
|
48464
|
+
request.inputs.filter(isRequestInputCoinOrMessage).forEach((input) => {
|
48381
48465
|
if (isRequestInputResourceFromOwner(input, this.address)) {
|
48382
48466
|
input.predicate = hexlify(this.bytes);
|
48383
48467
|
input.predicateData = hexlify(this.getPredicateData());
|