@fuel-ts/account 0.94.3 → 0.94.5
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 +391 -436
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +345 -195
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +427 -285
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts.map +1 -1
- package/dist/providers/__generated__/operations.d.ts +250 -0
- package/dist/providers/__generated__/operations.d.ts.map +1 -1
- package/dist/providers/fuel-graphql-subscriber.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 +36 -3
- 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/transaction-response/transaction-response.d.ts +3 -1
- package/dist/providers/transaction-response/transaction-response.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/providers/utils/receipts.d.ts.map +1 -1
- package/dist/test-utils/launchNode.d.ts.map +1 -1
- package/dist/test-utils.global.js +235 -286
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +300 -162
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +372 -239
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +16 -16
@@ -7610,8 +7610,8 @@
|
|
7610
7610
|
var utils = require_utils();
|
7611
7611
|
var Impl = require_URL_impl();
|
7612
7612
|
var impl = utils.implSymbol;
|
7613
|
-
function
|
7614
|
-
if (!this || this[impl] || !(this instanceof
|
7613
|
+
function URL3(url) {
|
7614
|
+
if (!this || this[impl] || !(this instanceof URL3)) {
|
7615
7615
|
throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");
|
7616
7616
|
}
|
7617
7617
|
if (arguments.length < 1) {
|
@@ -7627,7 +7627,7 @@
|
|
7627
7627
|
}
|
7628
7628
|
module.exports.setup(this, args);
|
7629
7629
|
}
|
7630
|
-
|
7630
|
+
URL3.prototype.toJSON = function toJSON() {
|
7631
7631
|
if (!this || !module.exports.is(this)) {
|
7632
7632
|
throw new TypeError("Illegal invocation");
|
7633
7633
|
}
|
@@ -7637,7 +7637,7 @@
|
|
7637
7637
|
}
|
7638
7638
|
return this[impl].toJSON.apply(this[impl], args);
|
7639
7639
|
};
|
7640
|
-
Object.defineProperty(
|
7640
|
+
Object.defineProperty(URL3.prototype, "href", {
|
7641
7641
|
get() {
|
7642
7642
|
return this[impl].href;
|
7643
7643
|
},
|
@@ -7648,20 +7648,20 @@
|
|
7648
7648
|
enumerable: true,
|
7649
7649
|
configurable: true
|
7650
7650
|
});
|
7651
|
-
|
7651
|
+
URL3.prototype.toString = function() {
|
7652
7652
|
if (!this || !module.exports.is(this)) {
|
7653
7653
|
throw new TypeError("Illegal invocation");
|
7654
7654
|
}
|
7655
7655
|
return this.href;
|
7656
7656
|
};
|
7657
|
-
Object.defineProperty(
|
7657
|
+
Object.defineProperty(URL3.prototype, "origin", {
|
7658
7658
|
get() {
|
7659
7659
|
return this[impl].origin;
|
7660
7660
|
},
|
7661
7661
|
enumerable: true,
|
7662
7662
|
configurable: true
|
7663
7663
|
});
|
7664
|
-
Object.defineProperty(
|
7664
|
+
Object.defineProperty(URL3.prototype, "protocol", {
|
7665
7665
|
get() {
|
7666
7666
|
return this[impl].protocol;
|
7667
7667
|
},
|
@@ -7672,7 +7672,7 @@
|
|
7672
7672
|
enumerable: true,
|
7673
7673
|
configurable: true
|
7674
7674
|
});
|
7675
|
-
Object.defineProperty(
|
7675
|
+
Object.defineProperty(URL3.prototype, "username", {
|
7676
7676
|
get() {
|
7677
7677
|
return this[impl].username;
|
7678
7678
|
},
|
@@ -7683,7 +7683,7 @@
|
|
7683
7683
|
enumerable: true,
|
7684
7684
|
configurable: true
|
7685
7685
|
});
|
7686
|
-
Object.defineProperty(
|
7686
|
+
Object.defineProperty(URL3.prototype, "password", {
|
7687
7687
|
get() {
|
7688
7688
|
return this[impl].password;
|
7689
7689
|
},
|
@@ -7694,7 +7694,7 @@
|
|
7694
7694
|
enumerable: true,
|
7695
7695
|
configurable: true
|
7696
7696
|
});
|
7697
|
-
Object.defineProperty(
|
7697
|
+
Object.defineProperty(URL3.prototype, "host", {
|
7698
7698
|
get() {
|
7699
7699
|
return this[impl].host;
|
7700
7700
|
},
|
@@ -7705,7 +7705,7 @@
|
|
7705
7705
|
enumerable: true,
|
7706
7706
|
configurable: true
|
7707
7707
|
});
|
7708
|
-
Object.defineProperty(
|
7708
|
+
Object.defineProperty(URL3.prototype, "hostname", {
|
7709
7709
|
get() {
|
7710
7710
|
return this[impl].hostname;
|
7711
7711
|
},
|
@@ -7716,7 +7716,7 @@
|
|
7716
7716
|
enumerable: true,
|
7717
7717
|
configurable: true
|
7718
7718
|
});
|
7719
|
-
Object.defineProperty(
|
7719
|
+
Object.defineProperty(URL3.prototype, "port", {
|
7720
7720
|
get() {
|
7721
7721
|
return this[impl].port;
|
7722
7722
|
},
|
@@ -7727,7 +7727,7 @@
|
|
7727
7727
|
enumerable: true,
|
7728
7728
|
configurable: true
|
7729
7729
|
});
|
7730
|
-
Object.defineProperty(
|
7730
|
+
Object.defineProperty(URL3.prototype, "pathname", {
|
7731
7731
|
get() {
|
7732
7732
|
return this[impl].pathname;
|
7733
7733
|
},
|
@@ -7738,7 +7738,7 @@
|
|
7738
7738
|
enumerable: true,
|
7739
7739
|
configurable: true
|
7740
7740
|
});
|
7741
|
-
Object.defineProperty(
|
7741
|
+
Object.defineProperty(URL3.prototype, "search", {
|
7742
7742
|
get() {
|
7743
7743
|
return this[impl].search;
|
7744
7744
|
},
|
@@ -7749,7 +7749,7 @@
|
|
7749
7749
|
enumerable: true,
|
7750
7750
|
configurable: true
|
7751
7751
|
});
|
7752
|
-
Object.defineProperty(
|
7752
|
+
Object.defineProperty(URL3.prototype, "hash", {
|
7753
7753
|
get() {
|
7754
7754
|
return this[impl].hash;
|
7755
7755
|
},
|
@@ -7765,7 +7765,7 @@
|
|
7765
7765
|
return !!obj && obj[impl] instanceof Impl.implementation;
|
7766
7766
|
},
|
7767
7767
|
create(constructorArgs, privateData) {
|
7768
|
-
let obj = Object.create(
|
7768
|
+
let obj = Object.create(URL3.prototype);
|
7769
7769
|
this.setup(obj, constructorArgs, privateData);
|
7770
7770
|
return obj;
|
7771
7771
|
},
|
@@ -7776,10 +7776,10 @@
|
|
7776
7776
|
obj[impl] = new Impl.implementation(constructorArgs, privateData);
|
7777
7777
|
obj[impl][utils.wrapperSymbol] = obj;
|
7778
7778
|
},
|
7779
|
-
interface:
|
7779
|
+
interface: URL3,
|
7780
7780
|
expose: {
|
7781
|
-
Window: { URL:
|
7782
|
-
Worker: { URL:
|
7781
|
+
Window: { URL: URL3 },
|
7782
|
+
Worker: { URL: URL3 }
|
7783
7783
|
}
|
7784
7784
|
};
|
7785
7785
|
}
|
@@ -8113,7 +8113,7 @@
|
|
8113
8113
|
}
|
8114
8114
|
function parseURL(urlStr) {
|
8115
8115
|
if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) {
|
8116
|
-
urlStr = new
|
8116
|
+
urlStr = new URL2(urlStr).toString();
|
8117
8117
|
}
|
8118
8118
|
return parse_url(urlStr);
|
8119
8119
|
}
|
@@ -8407,7 +8407,7 @@
|
|
8407
8407
|
stream.end();
|
8408
8408
|
}
|
8409
8409
|
}
|
8410
|
-
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,
|
8410
|
+
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;
|
8411
8411
|
var init_lib = __esm({
|
8412
8412
|
"../../node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.mjs"() {
|
8413
8413
|
import_stream = __toESM(__require("stream"), 1);
|
@@ -8930,7 +8930,7 @@
|
|
8930
8930
|
configurable: true
|
8931
8931
|
});
|
8932
8932
|
INTERNALS$2 = Symbol("Request internals");
|
8933
|
-
|
8933
|
+
URL2 = import_url.default.URL || import_whatwg_url.default.URL;
|
8934
8934
|
parse_url = import_url.default.parse;
|
8935
8935
|
format_url = import_url.default.format;
|
8936
8936
|
streamDestructionSupported = "destroy" in import_stream.default.Readable.prototype;
|
@@ -31655,9 +31655,9 @@ spurious results.`);
|
|
31655
31655
|
// ../versions/dist/index.mjs
|
31656
31656
|
function getBuiltinVersions() {
|
31657
31657
|
return {
|
31658
|
-
FORC: "0.63.
|
31659
|
-
FUEL_CORE: "0.
|
31660
|
-
FUELS: "0.94.
|
31658
|
+
FORC: "0.63.5",
|
31659
|
+
FUEL_CORE: "0.35.0",
|
31660
|
+
FUELS: "0.94.5"
|
31661
31661
|
};
|
31662
31662
|
}
|
31663
31663
|
function parseVersion(version) {
|
@@ -31820,7 +31820,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
31820
31820
|
return new _FuelError(error.code, error.message);
|
31821
31821
|
}
|
31822
31822
|
code;
|
31823
|
-
constructor(code, message, metadata = {}, rawError =
|
31823
|
+
constructor(code, message, metadata = {}, rawError = null) {
|
31824
31824
|
super(message);
|
31825
31825
|
this.code = code;
|
31826
31826
|
this.name = "FuelError";
|
@@ -34057,44 +34057,16 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
34057
34057
|
return derivedKey;
|
34058
34058
|
};
|
34059
34059
|
var keccak256 = (data) => keccak_256(data);
|
34060
|
-
var locked = false;
|
34061
|
-
var helper2 = (data) => ripemd160(data);
|
34062
|
-
var ripemd = helper2;
|
34063
34060
|
function ripemd1602(_data) {
|
34064
34061
|
const data = arrayify(_data, "data");
|
34065
|
-
return
|
34062
|
+
return ripemd160(data);
|
34066
34063
|
}
|
34067
|
-
ripemd1602._ = helper2;
|
34068
|
-
ripemd1602.lock = () => {
|
34069
|
-
locked = true;
|
34070
|
-
};
|
34071
|
-
ripemd1602.register = (func) => {
|
34072
|
-
if (locked) {
|
34073
|
-
throw new FuelError(ErrorCode.HASHER_LOCKED, "ripemd160 is locked");
|
34074
|
-
}
|
34075
|
-
ripemd = func;
|
34076
|
-
};
|
34077
|
-
Object.freeze(ripemd1602);
|
34078
34064
|
var bufferFromString = (string, encoding = "base64") => Uint8Array.from(Buffer.from(string, encoding));
|
34079
|
-
var locked2 = false;
|
34080
|
-
var PBKDF2 = (password, salt, iterations, keylen, algo) => (0, import_crypto2.pbkdf2Sync)(password, salt, iterations, keylen, algo);
|
34081
|
-
var pBkdf2 = PBKDF2;
|
34082
34065
|
function pbkdf22(_password, _salt, iterations, keylen, algo) {
|
34083
34066
|
const password = arrayify(_password, "password");
|
34084
34067
|
const salt = arrayify(_salt, "salt");
|
34085
|
-
return hexlify(
|
34068
|
+
return hexlify((0, import_crypto2.pbkdf2Sync)(password, salt, iterations, keylen, algo));
|
34086
34069
|
}
|
34087
|
-
pbkdf22._ = PBKDF2;
|
34088
|
-
pbkdf22.lock = () => {
|
34089
|
-
locked2 = true;
|
34090
|
-
};
|
34091
|
-
pbkdf22.register = (func) => {
|
34092
|
-
if (locked2) {
|
34093
|
-
throw new FuelError(ErrorCode.HASHER_LOCKED, "pbkdf2 is locked");
|
34094
|
-
}
|
34095
|
-
pBkdf2 = func;
|
34096
|
-
};
|
34097
|
-
Object.freeze(pbkdf22);
|
34098
34070
|
var randomBytes = (length) => {
|
34099
34071
|
const randomValues = Uint8Array.from(import_crypto3.default.randomBytes(length));
|
34100
34072
|
return randomValues;
|
@@ -34145,25 +34117,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
34145
34117
|
const decrypted = await Buffer.concat([decipher.update(data), decipher.final()]);
|
34146
34118
|
return new Uint8Array(decrypted);
|
34147
34119
|
}
|
34148
|
-
var locked3 = false;
|
34149
|
-
var COMPUTEHMAC = (algorithm, key, data) => (0, import_crypto5.createHmac)(algorithm, key).update(data).digest();
|
34150
|
-
var computeHMAC = COMPUTEHMAC;
|
34151
34120
|
function computeHmac(algorithm, _key, _data) {
|
34152
34121
|
const key = arrayify(_key, "key");
|
34153
34122
|
const data = arrayify(_data, "data");
|
34154
|
-
return hexlify(
|
34123
|
+
return hexlify((0, import_crypto5.createHmac)(algorithm, key).update(data).digest());
|
34155
34124
|
}
|
34156
|
-
computeHmac._ = COMPUTEHMAC;
|
34157
|
-
computeHmac.lock = () => {
|
34158
|
-
locked3 = true;
|
34159
|
-
};
|
34160
|
-
computeHmac.register = (func) => {
|
34161
|
-
if (locked3) {
|
34162
|
-
throw new FuelError(ErrorCode.HASHER_LOCKED, "computeHmac is locked");
|
34163
|
-
}
|
34164
|
-
computeHMAC = func;
|
34165
|
-
};
|
34166
|
-
Object.freeze(computeHmac);
|
34167
34125
|
var randomUUID = () => (0, import_crypto6.randomUUID)();
|
34168
34126
|
var api = {
|
34169
34127
|
bufferFromString,
|
@@ -37941,20 +37899,14 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
37941
37899
|
const rows = text.split("\n");
|
37942
37900
|
const rowWithUrl = rows.find((row) => row.indexOf(graphQLStartSubstring) !== -1);
|
37943
37901
|
const [realIp, realPort] = rowWithUrl.split(" ").at(-1).trim().split(":");
|
37944
|
-
|
37945
|
-
|
37946
|
-
|
37947
|
-
|
37948
|
-
|
37949
|
-
|
37950
|
-
|
37951
|
-
|
37952
|
-
snapshotDir: snapshotDirToUse,
|
37953
|
-
pid: child.pid
|
37954
|
-
})
|
37955
|
-
),
|
37956
|
-
500
|
37957
|
-
);
|
37902
|
+
resolve({
|
37903
|
+
cleanup,
|
37904
|
+
ip: realIp,
|
37905
|
+
port: realPort,
|
37906
|
+
url: `http://${realIp}:${realPort}/v1/graphql`,
|
37907
|
+
snapshotDir: snapshotDirToUse,
|
37908
|
+
pid: child.pid
|
37909
|
+
});
|
37958
37910
|
}
|
37959
37911
|
if (/error/i.test(text)) {
|
37960
37912
|
console.log(text);
|
@@ -38887,150 +38839,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
38887
38839
|
ReceiptType2[ReceiptType2["Burn"] = 12] = "Burn";
|
38888
38840
|
return ReceiptType2;
|
38889
38841
|
})(ReceiptType || {});
|
38890
|
-
var ReceiptMessageOutCoder = class extends Coder {
|
38891
|
-
constructor() {
|
38892
|
-
super("ReceiptMessageOut", "struct ReceiptMessageOut", 0);
|
38893
|
-
}
|
38894
|
-
static getMessageId(value) {
|
38895
|
-
const parts = [];
|
38896
|
-
parts.push(new ByteArrayCoder(32).encode(value.sender));
|
38897
|
-
parts.push(new ByteArrayCoder(32).encode(value.recipient));
|
38898
|
-
parts.push(new ByteArrayCoder(32).encode(value.nonce));
|
38899
|
-
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
38900
|
-
parts.push(arrayify(value.data || "0x"));
|
38901
|
-
return sha2562(concat(parts));
|
38902
|
-
}
|
38903
|
-
encode(value) {
|
38904
|
-
const parts = [];
|
38905
|
-
parts.push(new B256Coder().encode(value.sender));
|
38906
|
-
parts.push(new B256Coder().encode(value.recipient));
|
38907
|
-
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
38908
|
-
parts.push(new B256Coder().encode(value.nonce));
|
38909
|
-
parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.data.length));
|
38910
|
-
parts.push(new B256Coder().encode(value.digest));
|
38911
|
-
parts.push(new ByteArrayCoder(value.data.length).encode(value.data));
|
38912
|
-
return concat(parts);
|
38913
|
-
}
|
38914
|
-
decode(data, offset) {
|
38915
|
-
let decoded;
|
38916
|
-
let o = offset;
|
38917
|
-
[decoded, o] = new B256Coder().decode(data, o);
|
38918
|
-
const sender = decoded;
|
38919
|
-
[decoded, o] = new B256Coder().decode(data, o);
|
38920
|
-
const recipient = decoded;
|
38921
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38922
|
-
const amount = decoded;
|
38923
|
-
[decoded, o] = new B256Coder().decode(data, o);
|
38924
|
-
const nonce = decoded;
|
38925
|
-
[decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
|
38926
|
-
const len = decoded;
|
38927
|
-
[decoded, o] = new B256Coder().decode(data, o);
|
38928
|
-
const digest = decoded;
|
38929
|
-
[decoded, o] = new ByteArrayCoder(len).decode(data, o);
|
38930
|
-
const messageData = arrayify(decoded);
|
38931
|
-
const receiptMessageOut = {
|
38932
|
-
type: 10,
|
38933
|
-
messageId: "",
|
38934
|
-
sender,
|
38935
|
-
recipient,
|
38936
|
-
amount,
|
38937
|
-
nonce,
|
38938
|
-
digest,
|
38939
|
-
data: messageData
|
38940
|
-
};
|
38941
|
-
receiptMessageOut.messageId = ReceiptMessageOutCoder.getMessageId(receiptMessageOut);
|
38942
|
-
return [receiptMessageOut, o];
|
38943
|
-
}
|
38944
|
-
};
|
38945
38842
|
var getMintedAssetId = (contractId, subId) => {
|
38946
38843
|
const contractIdBytes = arrayify(contractId);
|
38947
38844
|
const subIdBytes = arrayify(subId);
|
38948
38845
|
return sha2562(concat([contractIdBytes, subIdBytes]));
|
38949
38846
|
};
|
38950
|
-
var ReceiptMintCoder = class extends Coder {
|
38951
|
-
constructor() {
|
38952
|
-
super("ReceiptMint", "struct ReceiptMint", 0);
|
38953
|
-
}
|
38954
|
-
static getAssetId(contractId, subId) {
|
38955
|
-
return getMintedAssetId(contractId, subId);
|
38956
|
-
}
|
38957
|
-
encode(value) {
|
38958
|
-
const parts = [];
|
38959
|
-
parts.push(new B256Coder().encode(value.subId));
|
38960
|
-
parts.push(new B256Coder().encode(value.contractId));
|
38961
|
-
parts.push(new BigNumberCoder("u64").encode(value.val));
|
38962
|
-
parts.push(new BigNumberCoder("u64").encode(value.pc));
|
38963
|
-
parts.push(new BigNumberCoder("u64").encode(value.is));
|
38964
|
-
return concat(parts);
|
38965
|
-
}
|
38966
|
-
decode(data, offset) {
|
38967
|
-
let decoded;
|
38968
|
-
let o = offset;
|
38969
|
-
[decoded, o] = new B256Coder().decode(data, o);
|
38970
|
-
const subId = decoded;
|
38971
|
-
[decoded, o] = new B256Coder().decode(data, o);
|
38972
|
-
const contractId = decoded;
|
38973
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38974
|
-
const val = decoded;
|
38975
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38976
|
-
const pc = decoded;
|
38977
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38978
|
-
const is = decoded;
|
38979
|
-
const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
|
38980
|
-
const receiptMint = {
|
38981
|
-
type: 11,
|
38982
|
-
subId,
|
38983
|
-
contractId,
|
38984
|
-
val,
|
38985
|
-
pc,
|
38986
|
-
is,
|
38987
|
-
assetId
|
38988
|
-
};
|
38989
|
-
return [receiptMint, o];
|
38990
|
-
}
|
38991
|
-
};
|
38992
|
-
var ReceiptBurnCoder = class extends Coder {
|
38993
|
-
constructor() {
|
38994
|
-
super("ReceiptBurn", "struct ReceiptBurn", 0);
|
38995
|
-
}
|
38996
|
-
static getAssetId(contractId, subId) {
|
38997
|
-
return getMintedAssetId(contractId, subId);
|
38998
|
-
}
|
38999
|
-
encode(value) {
|
39000
|
-
const parts = [];
|
39001
|
-
parts.push(new B256Coder().encode(value.subId));
|
39002
|
-
parts.push(new B256Coder().encode(value.contractId));
|
39003
|
-
parts.push(new BigNumberCoder("u64").encode(value.val));
|
39004
|
-
parts.push(new BigNumberCoder("u64").encode(value.pc));
|
39005
|
-
parts.push(new BigNumberCoder("u64").encode(value.is));
|
39006
|
-
return concat(parts);
|
39007
|
-
}
|
39008
|
-
decode(data, offset) {
|
39009
|
-
let decoded;
|
39010
|
-
let o = offset;
|
39011
|
-
[decoded, o] = new B256Coder().decode(data, o);
|
39012
|
-
const subId = decoded;
|
39013
|
-
[decoded, o] = new B256Coder().decode(data, o);
|
39014
|
-
const contractId = decoded;
|
39015
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
39016
|
-
const val = decoded;
|
39017
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
39018
|
-
const pc = decoded;
|
39019
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
39020
|
-
const is = decoded;
|
39021
|
-
const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
|
39022
|
-
const receiptBurn = {
|
39023
|
-
type: 12,
|
39024
|
-
subId,
|
39025
|
-
contractId,
|
39026
|
-
val,
|
39027
|
-
pc,
|
39028
|
-
is,
|
39029
|
-
assetId
|
39030
|
-
};
|
39031
|
-
return [receiptBurn, o];
|
39032
|
-
}
|
39033
|
-
};
|
39034
38847
|
var StorageSlotCoder = class extends StructCoder {
|
39035
38848
|
constructor() {
|
39036
38849
|
super("StorageSlot", {
|
@@ -43104,6 +42917,14 @@ ${ReceiptFragmentDoc}`;
|
|
43104
42917
|
height
|
43105
42918
|
header {
|
43106
42919
|
time
|
42920
|
+
daHeight
|
42921
|
+
stateTransitionBytecodeVersion
|
42922
|
+
transactionsCount
|
42923
|
+
transactionsRoot
|
42924
|
+
messageOutboxRoot
|
42925
|
+
eventInboxRoot
|
42926
|
+
prevRoot
|
42927
|
+
applicationHash
|
43107
42928
|
}
|
43108
42929
|
transactions {
|
43109
42930
|
id
|
@@ -43709,6 +43530,13 @@ ${MessageFragmentDoc}`;
|
|
43709
43530
|
submitAndAwait(tx: $encodedTransaction) {
|
43710
43531
|
...transactionStatusSubscriptionFragment
|
43711
43532
|
}
|
43533
|
+
}
|
43534
|
+
${TransactionStatusSubscriptionFragmentDoc}`;
|
43535
|
+
var SubmitAndAwaitStatusDocument = lib_default2`
|
43536
|
+
subscription submitAndAwaitStatus($encodedTransaction: HexString!) {
|
43537
|
+
submitAndAwaitStatus(tx: $encodedTransaction) {
|
43538
|
+
...transactionStatusSubscriptionFragment
|
43539
|
+
}
|
43712
43540
|
}
|
43713
43541
|
${TransactionStatusSubscriptionFragmentDoc}`;
|
43714
43542
|
var StatusChangeDocument = lib_default2`
|
@@ -43807,6 +43635,9 @@ ${MessageFragmentDoc}`;
|
|
43807
43635
|
submitAndAwait(variables, options) {
|
43808
43636
|
return requester(SubmitAndAwaitDocument, variables, options);
|
43809
43637
|
},
|
43638
|
+
submitAndAwaitStatus(variables, options) {
|
43639
|
+
return requester(SubmitAndAwaitStatusDocument, variables, options);
|
43640
|
+
},
|
43810
43641
|
statusChange(variables, options) {
|
43811
43642
|
return requester(StatusChangeDocument, variables, options);
|
43812
43643
|
}
|
@@ -43831,7 +43662,9 @@ ${MessageFragmentDoc}`;
|
|
43831
43662
|
Accept: "text/event-stream"
|
43832
43663
|
}
|
43833
43664
|
});
|
43834
|
-
|
43665
|
+
const [errorReader, resultReader] = response.body.tee().map((stream) => stream.getReader());
|
43666
|
+
await new _FuelGraphqlSubscriber(errorReader).next();
|
43667
|
+
return new _FuelGraphqlSubscriber(resultReader);
|
43835
43668
|
}
|
43836
43669
|
events = [];
|
43837
43670
|
parsingLeftover = "";
|
@@ -43874,10 +43707,8 @@ ${MessageFragmentDoc}`;
|
|
43874
43707
|
/**
|
43875
43708
|
* Gets called when `break` is called in a `for-await-of` loop.
|
43876
43709
|
*/
|
43877
|
-
|
43878
|
-
|
43879
|
-
this.stream.releaseLock();
|
43880
|
-
return { done: true, value: void 0 };
|
43710
|
+
return() {
|
43711
|
+
return Promise.resolve({ done: true, value: void 0 });
|
43881
43712
|
}
|
43882
43713
|
[Symbol.asyncIterator]() {
|
43883
43714
|
return this;
|
@@ -44070,6 +43901,9 @@ ${MessageFragmentDoc}`;
|
|
44070
43901
|
}
|
44071
43902
|
};
|
44072
43903
|
|
43904
|
+
// src/providers/message.ts
|
43905
|
+
var isMessageCoin = (message) => !("data" in message);
|
43906
|
+
|
44073
43907
|
// src/providers/resource.ts
|
44074
43908
|
var isCoin = (resource) => "id" in resource;
|
44075
43909
|
|
@@ -44291,12 +44125,12 @@ ${MessageFragmentDoc}`;
|
|
44291
44125
|
const amount = bn(receipt.amount);
|
44292
44126
|
const data = receipt.data ? arrayify(receipt.data) : Uint8Array.from([]);
|
44293
44127
|
const digest = hexOrZero(receipt.digest);
|
44294
|
-
const messageId =
|
44128
|
+
const messageId = InputMessageCoder.getMessageId({
|
44295
44129
|
sender,
|
44296
44130
|
recipient,
|
44297
44131
|
nonce,
|
44298
44132
|
amount,
|
44299
|
-
data
|
44133
|
+
data: hexlify(data)
|
44300
44134
|
});
|
44301
44135
|
const receiptMessageOut = {
|
44302
44136
|
type: ReceiptType.MessageOut,
|
@@ -44313,7 +44147,7 @@ ${MessageFragmentDoc}`;
|
|
44313
44147
|
case "MINT" /* Mint */: {
|
44314
44148
|
const contractId = hexOrZero(receipt.id || receipt.contractId);
|
44315
44149
|
const subId = hexOrZero(receipt.subId);
|
44316
|
-
const assetId =
|
44150
|
+
const assetId = getMintedAssetId(contractId, subId);
|
44317
44151
|
const mintReceipt = {
|
44318
44152
|
type: ReceiptType.Mint,
|
44319
44153
|
subId,
|
@@ -44328,7 +44162,7 @@ ${MessageFragmentDoc}`;
|
|
44328
44162
|
case "BURN" /* Burn */: {
|
44329
44163
|
const contractId = hexOrZero(receipt.id || receipt.contractId);
|
44330
44164
|
const subId = hexOrZero(receipt.subId);
|
44331
|
-
const assetId =
|
44165
|
+
const assetId = getMintedAssetId(contractId, subId);
|
44332
44166
|
const burnReceipt = {
|
44333
44167
|
type: ReceiptType.Burn,
|
44334
44168
|
subId,
|
@@ -44498,20 +44332,22 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
44498
44332
|
let reason = "";
|
44499
44333
|
if (revertReceipt) {
|
44500
44334
|
const reasonHex = bn(revertReceipt.val).toHex();
|
44335
|
+
const lastLog = logs[logs.length - 1];
|
44336
|
+
const lastButOneLog = logs[logs.length - 2];
|
44501
44337
|
switch (reasonHex) {
|
44502
44338
|
case FAILED_REQUIRE_SIGNAL: {
|
44503
44339
|
reason = "require";
|
44504
|
-
errorMessage = `The transaction reverted because a "require" statement has thrown ${logs.length ? stringify(
|
44340
|
+
errorMessage = `The transaction reverted because a "require" statement has thrown ${logs.length ? stringify(lastLog) : "an error."}.`;
|
44505
44341
|
break;
|
44506
44342
|
}
|
44507
44343
|
case FAILED_ASSERT_EQ_SIGNAL: {
|
44508
|
-
const sufix = logs.length >= 2 ? ` comparing ${stringify(
|
44344
|
+
const sufix = logs.length >= 2 ? ` comparing ${stringify(lastLog)} and ${stringify(lastButOneLog)}.` : ".";
|
44509
44345
|
reason = "assert_eq";
|
44510
44346
|
errorMessage = `The transaction reverted because of an "assert_eq" statement${sufix}`;
|
44511
44347
|
break;
|
44512
44348
|
}
|
44513
44349
|
case FAILED_ASSERT_NE_SIGNAL: {
|
44514
|
-
const sufix = logs.length >= 2 ? ` comparing ${stringify(
|
44350
|
+
const sufix = logs.length >= 2 ? ` comparing ${stringify(lastButOneLog)} and ${stringify(lastLog)}.` : ".";
|
44515
44351
|
reason = "assert_ne";
|
44516
44352
|
errorMessage = `The transaction reverted because of an "assert_ne" statement${sufix}`;
|
44517
44353
|
break;
|
@@ -44570,7 +44406,9 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
44570
44406
|
// src/providers/transaction-request/helpers.ts
|
44571
44407
|
var isRequestInputCoin = (input) => input.type === InputType.Coin;
|
44572
44408
|
var isRequestInputMessage = (input) => input.type === InputType.Message;
|
44573
|
-
var
|
44409
|
+
var isRequestInputMessageWithoutData = (input) => input.type === InputType.Message && bn(input.data).isZero();
|
44410
|
+
var isRequestInputCoinOrMessage = (input) => isRequestInputCoin(input) || isRequestInputMessage(input);
|
44411
|
+
var isRequestInputResource = (input) => isRequestInputCoin(input) || isRequestInputMessageWithoutData(input);
|
44574
44412
|
var getRequestInputResourceOwner = (input) => isRequestInputCoin(input) ? input.owner : input.recipient;
|
44575
44413
|
var isRequestInputResourceFromOwner = (input, owner) => getRequestInputResourceOwner(input) === owner.toB256();
|
44576
44414
|
var getAssetAmountInRequestInputs = (inputs, assetId, baseAsset) => inputs.filter(isRequestInputResource).reduce((acc, input) => {
|
@@ -44865,7 +44703,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
44865
44703
|
* @param message - Message resource.
|
44866
44704
|
*/
|
44867
44705
|
addMessageInput(message) {
|
44868
|
-
const { recipient, sender, amount, predicate, nonce,
|
44706
|
+
const { recipient, sender, amount, predicate, nonce, predicateData } = message;
|
44869
44707
|
let witnessIndex;
|
44870
44708
|
if (message.predicate) {
|
44871
44709
|
witnessIndex = 0;
|
@@ -44880,13 +44718,16 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
44880
44718
|
type: InputType.Message,
|
44881
44719
|
sender: sender.toB256(),
|
44882
44720
|
recipient: recipient.toB256(),
|
44721
|
+
data: isMessageCoin(message) ? "0x" : message.data,
|
44883
44722
|
amount,
|
44884
44723
|
witnessIndex,
|
44885
44724
|
predicate,
|
44886
44725
|
predicateData
|
44887
44726
|
};
|
44888
44727
|
this.pushInput(input);
|
44889
|
-
|
44728
|
+
if (isMessageCoin(message)) {
|
44729
|
+
this.addChangeOutput(recipient, message.assetId);
|
44730
|
+
}
|
44890
44731
|
}
|
44891
44732
|
/**
|
44892
44733
|
* Adds a single resource to the transaction by adding a coin/message input and a
|
@@ -45018,6 +44859,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
45018
44859
|
*
|
45019
44860
|
* @param quantities - CoinQuantity Array.
|
45020
44861
|
* @param baseAssetId - The base asset to fund the transaction.
|
44862
|
+
* @deprecated - This method is deprecated and will be removed in future versions.
|
44863
|
+
* Please use `Account.generateFakeResources` along with `this.addResources` instead.
|
45021
44864
|
*/
|
45022
44865
|
fundWithFakeUtxos(quantities, baseAssetId, resourcesOwner) {
|
45023
44866
|
const findAssetInput = (assetId) => this.inputs.find((input) => {
|
@@ -45086,7 +44929,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
45086
44929
|
});
|
45087
44930
|
}
|
45088
44931
|
updatePredicateGasUsed(inputs) {
|
45089
|
-
const inputsToExtractGasUsed = inputs.filter(
|
44932
|
+
const inputsToExtractGasUsed = inputs.filter(isRequestInputCoinOrMessage);
|
45090
44933
|
this.inputs.filter(isRequestInputResource).forEach((i) => {
|
45091
44934
|
const owner = getRequestInputResourceOwner(i);
|
45092
44935
|
const correspondingInput = inputsToExtractGasUsed.find(
|
@@ -45170,10 +45013,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
45170
45013
|
// src/providers/transaction-request/blob-transaction-request.ts
|
45171
45014
|
var BlobTransactionRequest = class extends BaseTransactionRequest {
|
45172
45015
|
static from(obj) {
|
45173
|
-
|
45174
|
-
return obj;
|
45175
|
-
}
|
45176
|
-
return new this(obj);
|
45016
|
+
return new this(clone_default(obj));
|
45177
45017
|
}
|
45178
45018
|
/** Type of the transaction */
|
45179
45019
|
type = TransactionType.Blob;
|
@@ -45256,10 +45096,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
45256
45096
|
// src/providers/transaction-request/create-transaction-request.ts
|
45257
45097
|
var CreateTransactionRequest = class extends BaseTransactionRequest {
|
45258
45098
|
static from(obj) {
|
45259
|
-
|
45260
|
-
return obj;
|
45261
|
-
}
|
45262
|
-
return new this(obj);
|
45099
|
+
return new this(clone_default(obj));
|
45263
45100
|
}
|
45264
45101
|
/** Type of the transaction */
|
45265
45102
|
type = TransactionType.Create;
|
@@ -45369,10 +45206,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
45369
45206
|
// src/providers/transaction-request/script-transaction-request.ts
|
45370
45207
|
var ScriptTransactionRequest = class extends BaseTransactionRequest {
|
45371
45208
|
static from(obj) {
|
45372
|
-
|
45373
|
-
return obj;
|
45374
|
-
}
|
45375
|
-
return new this(obj);
|
45209
|
+
return new this(clone_default(obj));
|
45376
45210
|
}
|
45377
45211
|
/** Type of the transaction */
|
45378
45212
|
type = TransactionType.Script;
|
@@ -46376,29 +46210,30 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
46376
46210
|
});
|
46377
46211
|
}
|
46378
46212
|
var TransactionResponse = class {
|
46379
|
-
/** Transaction ID */
|
46380
|
-
id;
|
46381
|
-
/** Current provider */
|
46382
|
-
provider;
|
46383
|
-
/** Gas used on the transaction */
|
46384
|
-
gasUsed = bn(0);
|
46385
|
-
/** The graphql Transaction with receipts object. */
|
46386
|
-
gqlTransaction;
|
46387
|
-
request;
|
46388
|
-
status;
|
46389
|
-
abis;
|
46390
46213
|
/**
|
46391
46214
|
* Constructor for `TransactionResponse`.
|
46392
46215
|
*
|
46393
46216
|
* @param tx - The transaction ID or TransactionRequest.
|
46394
46217
|
* @param provider - The provider.
|
46395
46218
|
*/
|
46396
|
-
constructor(tx, provider, abis) {
|
46219
|
+
constructor(tx, provider, abis, submitTxSubscription) {
|
46220
|
+
this.submitTxSubscription = submitTxSubscription;
|
46397
46221
|
this.id = typeof tx === "string" ? tx : tx.getTransactionId(provider.getChainId());
|
46398
46222
|
this.provider = provider;
|
46399
46223
|
this.abis = abis;
|
46400
46224
|
this.request = typeof tx === "string" ? void 0 : tx;
|
46401
46225
|
}
|
46226
|
+
/** Transaction ID */
|
46227
|
+
id;
|
46228
|
+
/** Current provider */
|
46229
|
+
provider;
|
46230
|
+
/** Gas used on the transaction */
|
46231
|
+
gasUsed = bn(0);
|
46232
|
+
/** The graphql Transaction with receipts object. */
|
46233
|
+
gqlTransaction;
|
46234
|
+
request;
|
46235
|
+
status;
|
46236
|
+
abis;
|
46402
46237
|
/**
|
46403
46238
|
* Async constructor for `TransactionResponse`. This method can be used to create
|
46404
46239
|
* an instance of `TransactionResponse` and wait for the transaction to be fetched
|
@@ -46531,10 +46366,11 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
46531
46366
|
if (status && status !== "SubmittedStatus") {
|
46532
46367
|
return;
|
46533
46368
|
}
|
46534
|
-
const subscription = await this.provider.operations.statusChange({
|
46369
|
+
const subscription = this.submitTxSubscription ?? await this.provider.operations.statusChange({
|
46535
46370
|
transactionId: this.id
|
46536
46371
|
});
|
46537
|
-
for await (const
|
46372
|
+
for await (const sub of subscription) {
|
46373
|
+
const statusChange = "statusChange" in sub ? sub.statusChange : sub.submitAndAwaitStatus;
|
46538
46374
|
this.status = statusChange;
|
46539
46375
|
if (statusChange.type === "SqueezedOutStatus") {
|
46540
46376
|
this.unsetResourceCache();
|
@@ -46645,6 +46481,21 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
46645
46481
|
};
|
46646
46482
|
}
|
46647
46483
|
|
46484
|
+
// src/providers/utils/handle-gql-error-message.ts
|
46485
|
+
var handleGqlErrorMessage = (errorMessage, rawError) => {
|
46486
|
+
switch (errorMessage) {
|
46487
|
+
case "not enough coins to fit the target" /* NOT_ENOUGH_COINS */:
|
46488
|
+
throw new FuelError(
|
46489
|
+
ErrorCode.NOT_ENOUGH_FUNDS,
|
46490
|
+
`The account(s) sending the transaction don't have enough funds to cover the transaction.`,
|
46491
|
+
{},
|
46492
|
+
rawError
|
46493
|
+
);
|
46494
|
+
default:
|
46495
|
+
throw new FuelError(ErrorCode.INVALID_REQUEST, errorMessage);
|
46496
|
+
}
|
46497
|
+
};
|
46498
|
+
|
46648
46499
|
// src/providers/provider.ts
|
46649
46500
|
var MAX_RETRIES = 10;
|
46650
46501
|
var RESOURCES_PAGE_SIZE_LIMIT = 512;
|
@@ -46771,6 +46622,17 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
46771
46622
|
return options.fetch ? options.fetch(url, fullRequest, options) : fetch(url, fullRequest);
|
46772
46623
|
}, retryOptions);
|
46773
46624
|
}
|
46625
|
+
static extractBasicAuth(url) {
|
46626
|
+
const parsedUrl = new URL(url);
|
46627
|
+
const username = parsedUrl.username;
|
46628
|
+
const password = parsedUrl.password;
|
46629
|
+
const urlNoBasicAuth = `${parsedUrl.origin}${parsedUrl.pathname}`;
|
46630
|
+
if (!(username && password)) {
|
46631
|
+
return { url, auth: void 0 };
|
46632
|
+
}
|
46633
|
+
const auth = `Basic ${btoa(`${username}:${password}`)}`;
|
46634
|
+
return { url: urlNoBasicAuth, auth };
|
46635
|
+
}
|
46774
46636
|
/**
|
46775
46637
|
* Creates a new instance of the Provider class. This is the recommended way to initialize a Provider.
|
46776
46638
|
*
|
@@ -46780,7 +46642,17 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
46780
46642
|
* @returns A promise that resolves to a Provider instance.
|
46781
46643
|
*/
|
46782
46644
|
static async create(url, options = {}) {
|
46783
|
-
const
|
46645
|
+
const { url: urlToUse, auth } = this.extractBasicAuth(url);
|
46646
|
+
const provider = new _Provider(urlToUse, {
|
46647
|
+
...options,
|
46648
|
+
requestMiddleware: async (request) => {
|
46649
|
+
if (auth && request) {
|
46650
|
+
request.headers ??= {};
|
46651
|
+
request.headers.Authorization = auth;
|
46652
|
+
}
|
46653
|
+
return options.requestMiddleware?.(request) ?? request;
|
46654
|
+
}
|
46655
|
+
});
|
46784
46656
|
await provider.fetchChainAndNodeInfo();
|
46785
46657
|
return provider;
|
46786
46658
|
}
|
@@ -46886,10 +46758,9 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
46886
46758
|
if ("response" in response) {
|
46887
46759
|
const graphQlResponse = response.response;
|
46888
46760
|
if (Array.isArray(graphQlResponse?.errors)) {
|
46889
|
-
|
46890
|
-
|
46891
|
-
|
46892
|
-
);
|
46761
|
+
for (const error of graphQlResponse.errors) {
|
46762
|
+
handleGqlErrorMessage(error.message, error);
|
46763
|
+
}
|
46893
46764
|
}
|
46894
46765
|
}
|
46895
46766
|
}
|
@@ -46907,7 +46778,26 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
46907
46778
|
}
|
46908
46779
|
return gqlClient.request(query, vars);
|
46909
46780
|
};
|
46910
|
-
|
46781
|
+
const customOperations = (requester) => ({
|
46782
|
+
getBlobs(variables) {
|
46783
|
+
const queryParams = variables.blobIds.map((_, i) => `$blobId${i}: BlobId!`).join(", ");
|
46784
|
+
const blobParams = variables.blobIds.map((_, i) => `blob${i}: blob(id: $blobId${i}) { id }`).join("\n");
|
46785
|
+
const updatedVariables = variables.blobIds.reduce(
|
46786
|
+
(acc, blobId, i) => {
|
46787
|
+
acc[`blobId${i}`] = blobId;
|
46788
|
+
return acc;
|
46789
|
+
},
|
46790
|
+
{}
|
46791
|
+
);
|
46792
|
+
const document2 = lib_default2`
|
46793
|
+
query getBlobs(${queryParams}) {
|
46794
|
+
${blobParams}
|
46795
|
+
}
|
46796
|
+
`;
|
46797
|
+
return requester(document2, updatedVariables);
|
46798
|
+
}
|
46799
|
+
});
|
46800
|
+
return { ...getSdk(executeQuery), ...customOperations(executeQuery) };
|
46911
46801
|
}
|
46912
46802
|
/**
|
46913
46803
|
* Returns the version of the connected node.
|
@@ -47016,11 +46906,9 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
47016
46906
|
if (isTransactionTypeScript(transactionRequest)) {
|
47017
46907
|
abis = transactionRequest.abis;
|
47018
46908
|
}
|
47019
|
-
const {
|
47020
|
-
|
47021
|
-
|
47022
|
-
__privateMethod(this, _cacheInputs, cacheInputs_fn).call(this, transactionRequest.inputs, transactionId);
|
47023
|
-
return new TransactionResponse(transactionRequest, this, abis);
|
46909
|
+
const subscription = await this.operations.submitAndAwaitStatus({ encodedTransaction });
|
46910
|
+
__privateMethod(this, _cacheInputs, cacheInputs_fn).call(this, transactionRequest.inputs, transactionRequest.getTransactionId(this.getChainId()));
|
46911
|
+
return new TransactionResponse(transactionRequest, this, abis, subscription);
|
47024
46912
|
}
|
47025
46913
|
/**
|
47026
46914
|
* Executes a transaction without actually submitting it to the chain.
|
@@ -47454,6 +47342,21 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
47454
47342
|
}).filter((v) => !!v);
|
47455
47343
|
return coins;
|
47456
47344
|
}
|
47345
|
+
/**
|
47346
|
+
* Returns an array of blobIds that exist on chain, for a given array of blobIds.
|
47347
|
+
*
|
47348
|
+
* @param blobIds - blobIds to check.
|
47349
|
+
* @returns - A promise that resolves to an array of blobIds that exist on chain.
|
47350
|
+
*/
|
47351
|
+
async getBlobs(blobIds) {
|
47352
|
+
const res = await this.operations.getBlobs({ blobIds });
|
47353
|
+
const blobs = [];
|
47354
|
+
Object.keys(res).forEach((key) => {
|
47355
|
+
const val = res[key];
|
47356
|
+
blobs.push(val?.id ?? null);
|
47357
|
+
});
|
47358
|
+
return blobs.filter((v) => v);
|
47359
|
+
}
|
47457
47360
|
/**
|
47458
47361
|
* Returns block matching the given ID or height.
|
47459
47362
|
*
|
@@ -47475,11 +47378,22 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
47475
47378
|
if (!block2) {
|
47476
47379
|
return null;
|
47477
47380
|
}
|
47381
|
+
const { header, height, id, transactions } = block2;
|
47478
47382
|
return {
|
47479
|
-
id
|
47480
|
-
height: bn(
|
47481
|
-
time:
|
47482
|
-
|
47383
|
+
id,
|
47384
|
+
height: bn(height),
|
47385
|
+
time: header.time,
|
47386
|
+
header: {
|
47387
|
+
applicationHash: header.applicationHash,
|
47388
|
+
daHeight: bn(header.daHeight),
|
47389
|
+
eventInboxRoot: header.eventInboxRoot,
|
47390
|
+
messageOutboxRoot: header.messageOutboxRoot,
|
47391
|
+
prevRoot: header.prevRoot,
|
47392
|
+
stateTransitionBytecodeVersion: header.stateTransitionBytecodeVersion,
|
47393
|
+
transactionsCount: header.transactionsCount,
|
47394
|
+
transactionsRoot: header.transactionsRoot
|
47395
|
+
},
|
47396
|
+
transactionIds: transactions.map((tx) => tx.id)
|
47483
47397
|
};
|
47484
47398
|
}
|
47485
47399
|
/**
|
@@ -47501,6 +47415,16 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
47501
47415
|
id: block2.id,
|
47502
47416
|
height: bn(block2.height),
|
47503
47417
|
time: block2.header.time,
|
47418
|
+
header: {
|
47419
|
+
applicationHash: block2.header.applicationHash,
|
47420
|
+
daHeight: bn(block2.header.daHeight),
|
47421
|
+
eventInboxRoot: block2.header.eventInboxRoot,
|
47422
|
+
messageOutboxRoot: block2.header.messageOutboxRoot,
|
47423
|
+
prevRoot: block2.header.prevRoot,
|
47424
|
+
stateTransitionBytecodeVersion: block2.header.stateTransitionBytecodeVersion,
|
47425
|
+
transactionsCount: block2.header.transactionsCount,
|
47426
|
+
transactionsRoot: block2.header.transactionsRoot
|
47427
|
+
},
|
47504
47428
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
47505
47429
|
}));
|
47506
47430
|
return { blocks, pageInfo };
|
@@ -47528,6 +47452,16 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
47528
47452
|
id: block2.id,
|
47529
47453
|
height: bn(block2.height, 10),
|
47530
47454
|
time: block2.header.time,
|
47455
|
+
header: {
|
47456
|
+
applicationHash: block2.header.applicationHash,
|
47457
|
+
daHeight: bn(block2.header.daHeight),
|
47458
|
+
eventInboxRoot: block2.header.eventInboxRoot,
|
47459
|
+
messageOutboxRoot: block2.header.messageOutboxRoot,
|
47460
|
+
prevRoot: block2.header.prevRoot,
|
47461
|
+
stateTransitionBytecodeVersion: block2.header.stateTransitionBytecodeVersion,
|
47462
|
+
transactionsCount: block2.header.transactionsCount,
|
47463
|
+
transactionsRoot: block2.header.transactionsRoot
|
47464
|
+
},
|
47531
47465
|
transactionIds: block2.transactions.map((tx) => tx.id),
|
47532
47466
|
transactions: block2.transactions.map(
|
47533
47467
|
(tx) => new TransactionCoder().decode(arrayify(tx.rawPayload), 0)?.[0]
|
@@ -47839,10 +47773,25 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
47839
47773
|
* @returns A promise that resolves to the Message object or null.
|
47840
47774
|
*/
|
47841
47775
|
async getMessageByNonce(nonce) {
|
47842
|
-
const { message } = await this.operations.getMessageByNonce({ nonce });
|
47843
|
-
if (!
|
47776
|
+
const { message: rawMessage } = await this.operations.getMessageByNonce({ nonce });
|
47777
|
+
if (!rawMessage) {
|
47844
47778
|
return null;
|
47845
47779
|
}
|
47780
|
+
const message = {
|
47781
|
+
messageId: InputMessageCoder.getMessageId({
|
47782
|
+
sender: rawMessage.sender,
|
47783
|
+
recipient: rawMessage.recipient,
|
47784
|
+
nonce: rawMessage.nonce,
|
47785
|
+
amount: bn(rawMessage.amount),
|
47786
|
+
data: rawMessage.data
|
47787
|
+
}),
|
47788
|
+
sender: Address.fromAddressOrString(rawMessage.sender),
|
47789
|
+
recipient: Address.fromAddressOrString(rawMessage.recipient),
|
47790
|
+
nonce: rawMessage.nonce,
|
47791
|
+
amount: bn(rawMessage.amount),
|
47792
|
+
data: InputMessageCoder.decodeData(rawMessage.data),
|
47793
|
+
daHeight: bn(rawMessage.daHeight)
|
47794
|
+
};
|
47846
47795
|
return message;
|
47847
47796
|
}
|
47848
47797
|
/**
|
@@ -48248,7 +48197,7 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
48248
48197
|
gasPrice
|
48249
48198
|
});
|
48250
48199
|
const totalBaseAssetOnInputs = getAssetAmountInRequestInputs(
|
48251
|
-
request.inputs,
|
48200
|
+
request.inputs.filter(isRequestInputResource),
|
48252
48201
|
baseAssetId,
|
48253
48202
|
baseAssetId
|
48254
48203
|
);
|
@@ -48454,10 +48403,10 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
48454
48403
|
const requiredQuantities = mergeQuantities(coinOutputsQuantities, quantities);
|
48455
48404
|
const transactionFeeForDryRun = [{ assetId: baseAssetId, amount: bn("100000000000000000") }];
|
48456
48405
|
const findAssetInput = (assetId) => txRequestClone.inputs.find((input) => {
|
48457
|
-
if (
|
48406
|
+
if (input.type === InputType.Coin) {
|
48458
48407
|
return input.assetId === assetId;
|
48459
48408
|
}
|
48460
|
-
if (
|
48409
|
+
if (isRequestInputMessageWithoutData(input)) {
|
48461
48410
|
return baseAssetId === assetId;
|
48462
48411
|
}
|
48463
48412
|
return false;
|