@fuel-ts/account 0.0.0-rc-1889-20240322122653 → 0.0.0-rc-1815-20240322131329
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @fuel-ts/account might be problematic. Click here for more details.
- package/dist/account.d.ts +184 -0
- package/dist/account.d.ts.map +1 -0
- package/dist/configs.d.ts +2 -3
- package/dist/configs.d.ts.map +1 -0
- package/dist/connectors/fuel-connector.d.ts +198 -0
- package/dist/connectors/fuel-connector.d.ts.map +1 -0
- package/dist/connectors/fuel.d.ts +133 -0
- package/dist/connectors/fuel.d.ts.map +1 -0
- package/dist/connectors/index.d.ts +5 -0
- package/dist/connectors/index.d.ts.map +1 -0
- package/dist/connectors/types/connector-metadata.d.ts +12 -0
- package/dist/connectors/types/connector-metadata.d.ts.map +1 -0
- package/dist/connectors/types/connector-types.d.ts +34 -0
- package/dist/connectors/types/connector-types.d.ts.map +1 -0
- package/dist/connectors/types/data-type.d.ts +34 -0
- package/dist/connectors/types/data-type.d.ts.map +1 -0
- package/dist/connectors/types/events.d.ts +111 -0
- package/dist/connectors/types/events.d.ts.map +1 -0
- package/dist/connectors/types/index.d.ts +7 -0
- package/dist/connectors/types/index.d.ts.map +1 -0
- package/dist/connectors/types/local-storage.d.ts +11 -0
- package/dist/connectors/types/local-storage.d.ts.map +1 -0
- package/dist/connectors/types/target-object.d.ts +14 -0
- package/dist/connectors/types/target-object.d.ts.map +1 -0
- package/dist/connectors/utils/cache.d.ts +14 -0
- package/dist/connectors/utils/cache.d.ts.map +1 -0
- package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts +7 -0
- package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts.map +1 -0
- package/dist/connectors/utils/index.d.ts +4 -0
- package/dist/connectors/utils/index.d.ts.map +1 -0
- package/dist/connectors/utils/promises.d.ts +8 -0
- package/dist/connectors/utils/promises.d.ts.map +1 -0
- package/dist/hdwallet/hdwallet.d.ts +58 -0
- package/dist/hdwallet/hdwallet.d.ts.map +1 -0
- package/dist/hdwallet/index.d.ts +2 -0
- package/dist/hdwallet/index.d.ts.map +1 -0
- package/dist/index.d.ts +13 -904
- package/dist/index.d.ts.map +1 -0
- package/dist/index.global.js +520 -391
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +314 -208
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +316 -208
- package/dist/index.mjs.map +1 -1
- package/dist/mnemonic/index.d.ts +3 -0
- package/dist/mnemonic/index.d.ts.map +1 -0
- package/dist/mnemonic/mnemonic.d.ts +85 -0
- package/dist/mnemonic/mnemonic.d.ts.map +1 -0
- package/dist/mnemonic/utils.d.ts +8 -0
- package/dist/mnemonic/utils.d.ts.map +1 -0
- package/dist/predicate/index.d.ts +3 -0
- package/dist/predicate/index.d.ts.map +1 -0
- package/dist/predicate/predicate.d.ts +94 -0
- package/dist/predicate/predicate.d.ts.map +1 -0
- package/dist/predicate/utils/getPredicateRoot.d.ts +12 -0
- package/dist/predicate/utils/getPredicateRoot.d.ts.map +1 -0
- package/dist/predicate/utils/index.d.ts +2 -0
- package/dist/predicate/utils/index.d.ts.map +1 -0
- package/dist/providers/__generated__/operations.d.ts +3477 -0
- package/dist/providers/__generated__/operations.d.ts.map +1 -0
- package/dist/providers/assets/index.d.ts +5 -0
- package/dist/providers/assets/index.d.ts.map +1 -0
- package/dist/providers/assets/types.d.ts +36 -0
- package/dist/providers/assets/types.d.ts.map +1 -0
- package/dist/providers/assets/utils/index.d.ts +4 -0
- package/dist/providers/assets/utils/index.d.ts.map +1 -0
- package/dist/providers/assets/utils/network.d.ts +33 -0
- package/dist/providers/assets/utils/network.d.ts.map +1 -0
- package/dist/providers/assets/utils/resolveIconPaths.d.ts +14 -0
- package/dist/providers/assets/utils/resolveIconPaths.d.ts.map +1 -0
- package/dist/providers/assets/utils/url.d.ts +2 -0
- package/dist/providers/assets/utils/url.d.ts.map +1 -0
- package/dist/providers/chains.d.ts +11 -0
- package/dist/providers/chains.d.ts.map +1 -0
- package/dist/providers/coin-quantity.d.ts +21 -0
- package/dist/providers/coin-quantity.d.ts.map +1 -0
- package/dist/providers/coin.d.ts +15 -0
- package/dist/providers/coin.d.ts.map +1 -0
- package/dist/providers/fuel-graphql-subscriber.d.ts +23 -0
- package/dist/providers/fuel-graphql-subscriber.d.ts.map +1 -0
- package/dist/providers/index.d.ts +13 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/memory-cache.d.ts +11 -0
- package/dist/providers/memory-cache.d.ts.map +1 -0
- package/dist/providers/message.d.ts +60 -0
- package/dist/providers/message.d.ts.map +1 -0
- package/dist/providers/provider.d.ts +523 -0
- package/dist/providers/provider.d.ts.map +1 -0
- package/dist/providers/resource.d.ts +37 -0
- package/dist/providers/resource.d.ts.map +1 -0
- package/dist/providers/transaction-request/create-transaction-request.d.ts +73 -0
- package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -0
- package/dist/providers/transaction-request/errors.d.ts +25 -0
- package/dist/providers/transaction-request/errors.d.ts.map +1 -0
- package/dist/providers/transaction-request/hash-transaction.d.ts +9 -0
- package/dist/providers/transaction-request/hash-transaction.d.ts.map +1 -0
- package/dist/providers/transaction-request/index.d.ts +10 -0
- package/dist/providers/transaction-request/index.d.ts.map +1 -0
- package/dist/providers/transaction-request/input.d.ts +59 -0
- package/dist/providers/transaction-request/input.d.ts.map +1 -0
- package/dist/providers/transaction-request/output.d.ts +39 -0
- package/dist/providers/transaction-request/output.d.ts.map +1 -0
- package/dist/providers/transaction-request/script-transaction-request.d.ts +106 -0
- package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -0
- package/dist/providers/transaction-request/scripts.d.ts +6 -0
- package/dist/providers/transaction-request/scripts.d.ts.map +1 -0
- package/dist/providers/transaction-request/storage-slot.d.ts +10 -0
- package/dist/providers/transaction-request/storage-slot.d.ts.map +1 -0
- package/dist/providers/transaction-request/transaction-request.d.ts +278 -0
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -0
- package/dist/providers/transaction-request/types.d.ts +10 -0
- package/dist/providers/transaction-request/types.d.ts.map +1 -0
- package/dist/providers/transaction-request/utils.d.ts +4 -0
- package/dist/providers/transaction-request/utils.d.ts.map +1 -0
- package/dist/providers/transaction-request/witness.d.ts +5 -0
- package/dist/providers/transaction-request/witness.d.ts.map +1 -0
- package/dist/providers/transaction-response/getDecodedLogs.d.ts +5 -0
- package/dist/providers/transaction-response/getDecodedLogs.d.ts.map +1 -0
- package/dist/providers/transaction-response/index.d.ts +3 -0
- package/dist/providers/transaction-response/index.d.ts.map +1 -0
- package/dist/providers/transaction-response/transaction-response.d.ts +106 -0
- package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -0
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +20 -0
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -0
- package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts +21 -0
- package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts.map +1 -0
- package/dist/providers/transaction-summary/call.d.ts +18 -0
- package/dist/providers/transaction-summary/call.d.ts.map +1 -0
- package/dist/providers/transaction-summary/get-transaction-summary.d.ts +31 -0
- package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -0
- package/dist/providers/transaction-summary/index.d.ts +10 -0
- package/dist/providers/transaction-summary/index.d.ts.map +1 -0
- package/dist/providers/transaction-summary/input.d.ts +21 -0
- package/dist/providers/transaction-summary/input.d.ts.map +1 -0
- package/dist/providers/transaction-summary/operations.d.ts +40 -0
- package/dist/providers/transaction-summary/operations.d.ts.map +1 -0
- package/dist/providers/transaction-summary/output.d.ts +15 -0
- package/dist/providers/transaction-summary/output.d.ts.map +1 -0
- package/dist/providers/transaction-summary/receipt.d.ts +7 -0
- package/dist/providers/transaction-summary/receipt.d.ts.map +1 -0
- package/dist/providers/transaction-summary/status.d.ts +9 -0
- package/dist/providers/transaction-summary/status.d.ts.map +1 -0
- package/dist/providers/transaction-summary/types.d.ts +146 -0
- package/dist/providers/transaction-summary/types.d.ts.map +1 -0
- package/dist/providers/utils/auto-retry-fetch.d.ts +36 -0
- package/dist/providers/utils/auto-retry-fetch.d.ts.map +1 -0
- package/dist/providers/utils/block-explorer.d.ts +14 -0
- package/dist/providers/utils/block-explorer.d.ts.map +1 -0
- package/dist/providers/utils/gas.d.ts +38 -0
- package/dist/providers/utils/gas.d.ts.map +1 -0
- package/dist/providers/utils/index.d.ts +6 -0
- package/dist/providers/utils/index.d.ts.map +1 -0
- package/dist/providers/utils/json.d.ts +7 -0
- package/dist/providers/utils/json.d.ts.map +1 -0
- package/dist/providers/utils/merge-quantities.d.ts +3 -0
- package/dist/providers/utils/merge-quantities.d.ts.map +1 -0
- package/dist/providers/utils/receipts.d.ts +10 -0
- package/dist/providers/utils/receipts.d.ts.map +1 -0
- package/dist/providers/utils/sleep.d.ts +3 -0
- package/dist/providers/utils/sleep.d.ts.map +1 -0
- package/dist/signer/index.d.ts +2 -0
- package/dist/signer/index.d.ts.map +1 -0
- package/dist/signer/signer.d.ts +64 -0
- package/dist/signer/signer.d.ts.map +1 -0
- package/dist/test-utils/generateTestWallet.d.ts +4 -0
- package/dist/test-utils/generateTestWallet.d.ts.map +1 -0
- package/dist/test-utils/index.d.ts +4 -0
- package/dist/test-utils/index.d.ts.map +1 -0
- package/dist/{test-utils.d.ts → test-utils/launchNode.d.ts} +12 -24
- package/dist/test-utils/launchNode.d.ts.map +1 -0
- package/dist/test-utils/seedTestWallet.d.ts +4 -0
- package/dist/test-utils/seedTestWallet.d.ts.map +1 -0
- package/dist/test-utils.global.js +386 -295
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +179 -108
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +181 -108
- package/dist/test-utils.mjs.map +1 -1
- package/dist/utils/formatTransferToContractScriptData.d.ts +14 -0
- package/dist/utils/formatTransferToContractScriptData.d.ts.map +1 -0
- package/dist/wallet/base-wallet-unlocked.d.ts +73 -0
- package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -0
- package/dist/wallet/index.d.ts +4 -0
- package/dist/wallet/index.d.ts.map +1 -0
- package/dist/wallet/keystore-wallet.d.ts +38 -0
- package/dist/wallet/keystore-wallet.d.ts.map +1 -0
- package/dist/wallet/wallet.d.ts +68 -0
- package/dist/wallet/wallet.d.ts.map +1 -0
- package/dist/wallet/wallets.d.ts +76 -0
- package/dist/wallet/wallets.d.ts.map +1 -0
- package/dist/wallet-manager/index.d.ts +6 -0
- package/dist/wallet-manager/index.d.ts.map +1 -0
- package/dist/wallet-manager/storages/memory-storage.d.ts +9 -0
- package/dist/wallet-manager/storages/memory-storage.d.ts.map +1 -0
- package/dist/wallet-manager/types.d.ts +42 -0
- package/dist/wallet-manager/types.d.ts.map +1 -0
- package/dist/wallet-manager/vaults/mnemonic-vault.d.ts +29 -0
- package/dist/wallet-manager/vaults/mnemonic-vault.d.ts.map +1 -0
- package/dist/wallet-manager/vaults/privatekey-vault.d.ts +29 -0
- package/dist/wallet-manager/vaults/privatekey-vault.d.ts.map +1 -0
- package/dist/wallet-manager/wallet-manager.d.ts +104 -0
- package/dist/wallet-manager/wallet-manager.d.ts.map +1 -0
- package/dist/wordlists/index.d.ts +5 -0
- package/dist/wordlists/index.d.ts.map +1 -0
- package/dist/wordlists/words/english.d.ts +2 -0
- package/dist/wordlists/words/english.d.ts.map +1 -0
- package/package.json +25 -21
- package/dist/account-E9nGNf5X.d.mts +0 -3837
- package/dist/account-E9nGNf5X.d.ts +0 -3837
- package/dist/configs.d.mts +0 -3
- package/dist/index.d.mts +0 -904
- package/dist/test-utils.d.mts +0 -66
package/dist/index.js
CHANGED
@@ -5,6 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
8
9
|
var __export = (target, all) => {
|
9
10
|
for (var name in all)
|
10
11
|
__defProp(target, name, { get: all[name], enumerable: true });
|
@@ -26,6 +27,32 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
26
27
|
mod
|
27
28
|
));
|
28
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
30
|
+
var __publicField = (obj, key, value) => {
|
31
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
32
|
+
return value;
|
33
|
+
};
|
34
|
+
var __accessCheck = (obj, member, msg) => {
|
35
|
+
if (!member.has(obj))
|
36
|
+
throw TypeError("Cannot " + msg);
|
37
|
+
};
|
38
|
+
var __privateGet = (obj, member, getter) => {
|
39
|
+
__accessCheck(obj, member, "read from private field");
|
40
|
+
return getter ? getter.call(obj) : member.get(obj);
|
41
|
+
};
|
42
|
+
var __privateAdd = (obj, member, value) => {
|
43
|
+
if (member.has(obj))
|
44
|
+
throw TypeError("Cannot add the same private member more than once");
|
45
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
46
|
+
};
|
47
|
+
var __privateSet = (obj, member, value, setter) => {
|
48
|
+
__accessCheck(obj, member, "write to private field");
|
49
|
+
setter ? setter.call(obj, value) : member.set(obj, value);
|
50
|
+
return value;
|
51
|
+
};
|
52
|
+
var __privateMethod = (obj, member, method) => {
|
53
|
+
__accessCheck(obj, member, "access private method");
|
54
|
+
return method;
|
55
|
+
};
|
29
56
|
|
30
57
|
// src/index.ts
|
31
58
|
var src_exports = {};
|
@@ -1016,12 +1043,11 @@ function getSdk(requester) {
|
|
1016
1043
|
// src/providers/fuel-graphql-subscriber.ts
|
1017
1044
|
var import_errors = require("@fuel-ts/errors");
|
1018
1045
|
var import_graphql = require("graphql");
|
1019
|
-
var
|
1046
|
+
var _FuelGraphqlSubscriber = class {
|
1020
1047
|
constructor(options) {
|
1021
1048
|
this.options = options;
|
1022
1049
|
}
|
1023
1050
|
stream;
|
1024
|
-
static textDecoder = new TextDecoder();
|
1025
1051
|
async setStream() {
|
1026
1052
|
const { url, query, variables, fetchFn } = this.options;
|
1027
1053
|
const response = await fetchFn(`${url}-sub`, {
|
@@ -1081,6 +1107,8 @@ var FuelGraphqlSubscriber = class _FuelGraphqlSubscriber {
|
|
1081
1107
|
return this;
|
1082
1108
|
}
|
1083
1109
|
};
|
1110
|
+
var FuelGraphqlSubscriber = _FuelGraphqlSubscriber;
|
1111
|
+
__publicField(FuelGraphqlSubscriber, "textDecoder", new TextDecoder());
|
1084
1112
|
|
1085
1113
|
// src/providers/memory-cache.ts
|
1086
1114
|
var import_errors2 = require("@fuel-ts/errors");
|
@@ -1703,7 +1731,7 @@ var witnessify = (value) => {
|
|
1703
1731
|
};
|
1704
1732
|
|
1705
1733
|
// src/providers/transaction-request/transaction-request.ts
|
1706
|
-
var BaseTransactionRequest = class
|
1734
|
+
var BaseTransactionRequest = class {
|
1707
1735
|
/** Gas price for transaction */
|
1708
1736
|
gasPrice;
|
1709
1737
|
/** Block until which tx cannot be included */
|
@@ -1773,7 +1801,7 @@ var BaseTransactionRequest = class _BaseTransactionRequest {
|
|
1773
1801
|
const inputs = this.inputs?.map(inputify) ?? [];
|
1774
1802
|
const outputs = this.outputs?.map(outputify) ?? [];
|
1775
1803
|
const witnesses = this.witnesses?.map(witnessify) ?? [];
|
1776
|
-
const { policyTypes, policies } =
|
1804
|
+
const { policyTypes, policies } = BaseTransactionRequest.getPolicyMeta(this);
|
1777
1805
|
return {
|
1778
1806
|
policyTypes,
|
1779
1807
|
inputs,
|
@@ -1811,13 +1839,27 @@ var BaseTransactionRequest = class _BaseTransactionRequest {
|
|
1811
1839
|
this.outputs.push(output);
|
1812
1840
|
return this.outputs.length - 1;
|
1813
1841
|
}
|
1842
|
+
/**
|
1843
|
+
* @hidden
|
1844
|
+
*
|
1845
|
+
* Pushes a witness to the list and returns the index
|
1846
|
+
*
|
1847
|
+
* @param signature - The signature to add to the witness.
|
1848
|
+
* @returns The index of the created witness.
|
1849
|
+
*/
|
1850
|
+
addWitness(signature) {
|
1851
|
+
this.witnesses.push(signature);
|
1852
|
+
return this.witnesses.length - 1;
|
1853
|
+
}
|
1814
1854
|
/**
|
1815
1855
|
* @hidden
|
1816
1856
|
*
|
1817
1857
|
* Creates an empty witness without any side effects and returns the index
|
1858
|
+
*
|
1859
|
+
* @returns The index of the created witness.
|
1818
1860
|
*/
|
1819
|
-
|
1820
|
-
this.
|
1861
|
+
addEmptyWitness() {
|
1862
|
+
this.addWitness((0, import_utils9.concat)([import_configs6.ZeroBytes32, import_configs6.ZeroBytes32]));
|
1821
1863
|
return this.witnesses.length - 1;
|
1822
1864
|
}
|
1823
1865
|
/**
|
@@ -1846,6 +1888,21 @@ var BaseTransactionRequest = class _BaseTransactionRequest {
|
|
1846
1888
|
}
|
1847
1889
|
this.witnesses[index] = witness;
|
1848
1890
|
}
|
1891
|
+
/**
|
1892
|
+
* Helper function to add an external signature to the transaction.
|
1893
|
+
*
|
1894
|
+
* @param account - The account/s to sign to the transaction.
|
1895
|
+
* @returns The transaction with the signature witness added.
|
1896
|
+
*/
|
1897
|
+
async addAccountWitnesses(account) {
|
1898
|
+
const accounts = Array.isArray(account) ? account : [account];
|
1899
|
+
await Promise.all(
|
1900
|
+
accounts.map(async (acc) => {
|
1901
|
+
this.addWitness(await acc.signTransaction(this));
|
1902
|
+
})
|
1903
|
+
);
|
1904
|
+
return this;
|
1905
|
+
}
|
1849
1906
|
/**
|
1850
1907
|
* Gets the coin inputs for a transaction.
|
1851
1908
|
*
|
@@ -1911,7 +1968,7 @@ var BaseTransactionRequest = class _BaseTransactionRequest {
|
|
1911
1968
|
} else {
|
1912
1969
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
|
1913
1970
|
if (typeof witnessIndex !== "number") {
|
1914
|
-
witnessIndex = this.
|
1971
|
+
witnessIndex = this.addEmptyWitness();
|
1915
1972
|
}
|
1916
1973
|
}
|
1917
1974
|
const input = {
|
@@ -1945,7 +2002,7 @@ var BaseTransactionRequest = class _BaseTransactionRequest {
|
|
1945
2002
|
} else {
|
1946
2003
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
|
1947
2004
|
if (typeof witnessIndex !== "number") {
|
1948
|
-
witnessIndex = this.
|
2005
|
+
witnessIndex = this.addEmptyWitness();
|
1949
2006
|
}
|
1950
2007
|
}
|
1951
2008
|
const input = {
|
@@ -3358,7 +3415,7 @@ function assembleTransactionSummary(params) {
|
|
3358
3415
|
}
|
3359
3416
|
|
3360
3417
|
// src/providers/transaction-response/transaction-response.ts
|
3361
|
-
var TransactionResponse = class
|
3418
|
+
var TransactionResponse = class {
|
3362
3419
|
/** Transaction ID */
|
3363
3420
|
id;
|
3364
3421
|
/** Current provider */
|
@@ -3386,7 +3443,7 @@ var TransactionResponse = class _TransactionResponse {
|
|
3386
3443
|
* @param provider - The provider.
|
3387
3444
|
*/
|
3388
3445
|
static async create(id, provider) {
|
3389
|
-
const response = new
|
3446
|
+
const response = new TransactionResponse(id, provider);
|
3390
3447
|
await response.fetch();
|
3391
3448
|
return response;
|
3392
3449
|
}
|
@@ -3614,7 +3671,8 @@ var processGqlChain = (chain) => {
|
|
3614
3671
|
}
|
3615
3672
|
};
|
3616
3673
|
};
|
3617
|
-
var
|
3674
|
+
var _cacheInputs, cacheInputs_fn;
|
3675
|
+
var _Provider = class {
|
3618
3676
|
/**
|
3619
3677
|
* Constructor to initialize a Provider.
|
3620
3678
|
*
|
@@ -3625,25 +3683,27 @@ var Provider = class _Provider {
|
|
3625
3683
|
*/
|
3626
3684
|
constructor(url, options = {}) {
|
3627
3685
|
this.url = url;
|
3686
|
+
/**
|
3687
|
+
* @hidden
|
3688
|
+
*/
|
3689
|
+
__privateAdd(this, _cacheInputs);
|
3690
|
+
__publicField(this, "operations");
|
3691
|
+
__publicField(this, "cache");
|
3692
|
+
__publicField(this, "options", {
|
3693
|
+
timeout: void 0,
|
3694
|
+
cacheUtxo: void 0,
|
3695
|
+
fetch: void 0,
|
3696
|
+
retryOptions: void 0
|
3697
|
+
});
|
3628
3698
|
this.options = { ...this.options, ...options };
|
3629
3699
|
this.url = url;
|
3630
3700
|
this.operations = this.createOperations();
|
3631
3701
|
this.cache = options.cacheUtxo ? new MemoryCache(options.cacheUtxo) : void 0;
|
3632
3702
|
}
|
3633
|
-
operations;
|
3634
|
-
cache;
|
3635
3703
|
static clearChainAndNodeCaches() {
|
3636
3704
|
_Provider.nodeInfoCache = {};
|
3637
3705
|
_Provider.chainInfoCache = {};
|
3638
3706
|
}
|
3639
|
-
static chainInfoCache = {};
|
3640
|
-
static nodeInfoCache = {};
|
3641
|
-
options = {
|
3642
|
-
timeout: void 0,
|
3643
|
-
cacheUtxo: void 0,
|
3644
|
-
fetch: void 0,
|
3645
|
-
retryOptions: void 0
|
3646
|
-
};
|
3647
3707
|
static getFetchFn(options) {
|
3648
3708
|
const { retryOptions, timeout } = options;
|
3649
3709
|
return autoRetryFetch(async (...args) => {
|
@@ -3840,19 +3900,6 @@ var Provider = class _Provider {
|
|
3840
3900
|
} = this.getChain();
|
3841
3901
|
return chainId.toNumber();
|
3842
3902
|
}
|
3843
|
-
/**
|
3844
|
-
* @hidden
|
3845
|
-
*/
|
3846
|
-
#cacheInputs(inputs) {
|
3847
|
-
if (!this.cache) {
|
3848
|
-
return;
|
3849
|
-
}
|
3850
|
-
inputs.forEach((input) => {
|
3851
|
-
if (input.type === import_transactions17.InputType.Coin) {
|
3852
|
-
this.cache?.set(input.id);
|
3853
|
-
}
|
3854
|
-
});
|
3855
|
-
}
|
3856
3903
|
/**
|
3857
3904
|
* Submits a transaction to the chain to be executed.
|
3858
3905
|
*
|
@@ -3865,7 +3912,7 @@ var Provider = class _Provider {
|
|
3865
3912
|
// #region Provider-sendTransaction
|
3866
3913
|
async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution = false } = {}) {
|
3867
3914
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
3868
|
-
this
|
3915
|
+
__privateMethod(this, _cacheInputs, cacheInputs_fn).call(this, transactionRequest.inputs);
|
3869
3916
|
if (estimateTxDependencies) {
|
3870
3917
|
await this.estimateTxDependencies(transactionRequest);
|
3871
3918
|
}
|
@@ -4042,7 +4089,8 @@ var Provider = class _Provider {
|
|
4042
4089
|
async getTransactionCost(transactionRequestLike, forwardingQuantities = [], {
|
4043
4090
|
estimateTxDependencies = true,
|
4044
4091
|
estimatePredicates = true,
|
4045
|
-
resourcesOwner
|
4092
|
+
resourcesOwner,
|
4093
|
+
signatureCallback
|
4046
4094
|
} = {}) {
|
4047
4095
|
const txRequestClone = (0, import_ramda3.clone)(transactionRequestify(transactionRequestLike));
|
4048
4096
|
const chainInfo = this.getChain();
|
@@ -4061,6 +4109,9 @@ var Provider = class _Provider {
|
|
4061
4109
|
}
|
4062
4110
|
await this.estimatePredicates(txRequestClone);
|
4063
4111
|
}
|
4112
|
+
if (signatureCallback && isScriptTransaction) {
|
4113
|
+
await signatureCallback(txRequestClone);
|
4114
|
+
}
|
4064
4115
|
const minGas = txRequestClone.calculateMinGas(chainInfo);
|
4065
4116
|
const maxGas = txRequestClone.calculateMaxGas(chainInfo, minGas);
|
4066
4117
|
let receipts = [];
|
@@ -4490,6 +4541,20 @@ var Provider = class _Provider {
|
|
4490
4541
|
return new TransactionResponse(transactionId, this);
|
4491
4542
|
}
|
4492
4543
|
};
|
4544
|
+
var Provider = _Provider;
|
4545
|
+
_cacheInputs = new WeakSet();
|
4546
|
+
cacheInputs_fn = function(inputs) {
|
4547
|
+
if (!this.cache) {
|
4548
|
+
return;
|
4549
|
+
}
|
4550
|
+
inputs.forEach((input) => {
|
4551
|
+
if (input.type === import_transactions17.InputType.Coin) {
|
4552
|
+
this.cache?.set(input.id);
|
4553
|
+
}
|
4554
|
+
});
|
4555
|
+
};
|
4556
|
+
__publicField(Provider, "chainInfoCache", {});
|
4557
|
+
__publicField(Provider, "nodeInfoCache", {});
|
4493
4558
|
|
4494
4559
|
// src/providers/transaction-summary/get-transaction-summary.ts
|
4495
4560
|
var import_errors14 = require("@fuel-ts/errors");
|
@@ -5094,6 +5159,21 @@ var Account = class extends import_interfaces.AbstractAccount {
|
|
5094
5159
|
}
|
5095
5160
|
return this._connector.signMessage(this.address.toString(), message);
|
5096
5161
|
}
|
5162
|
+
/**
|
5163
|
+
* Signs a transaction with the wallet's private key.
|
5164
|
+
*
|
5165
|
+
* @param transactionRequestLike - The transaction request to sign.
|
5166
|
+
* @returns A promise that resolves to the signature of the transaction.
|
5167
|
+
*/
|
5168
|
+
async signTransaction(transactionRequestLike) {
|
5169
|
+
if (!this._connector) {
|
5170
|
+
throw new import_errors15.FuelError(
|
5171
|
+
import_errors15.ErrorCode.MISSING_CONNECTOR,
|
5172
|
+
"A connector is required to sign transactions."
|
5173
|
+
);
|
5174
|
+
}
|
5175
|
+
return this._connector.signTransaction(this.address.toString(), transactionRequestLike);
|
5176
|
+
}
|
5097
5177
|
/**
|
5098
5178
|
* Sends a transaction to the network.
|
5099
5179
|
*
|
@@ -5160,7 +5240,7 @@ var import_hasher2 = require("@fuel-ts/hasher");
|
|
5160
5240
|
var import_math18 = require("@fuel-ts/math");
|
5161
5241
|
var import_utils28 = require("@fuel-ts/utils");
|
5162
5242
|
var import_secp256k1 = require("@noble/curves/secp256k1");
|
5163
|
-
var Signer = class
|
5243
|
+
var Signer = class {
|
5164
5244
|
address;
|
5165
5245
|
publicKey;
|
5166
5246
|
compressedPublicKey;
|
@@ -5239,7 +5319,7 @@ var Signer = class _Signer {
|
|
5239
5319
|
* @returns Address from signature
|
5240
5320
|
*/
|
5241
5321
|
static recoverAddress(data, signature) {
|
5242
|
-
return import_address5.Address.fromPublicKey(
|
5322
|
+
return import_address5.Address.fromPublicKey(Signer.recoverPublicKey(data, signature));
|
5243
5323
|
}
|
5244
5324
|
/**
|
5245
5325
|
* Generate a random privateKey
|
@@ -5355,10 +5435,6 @@ async function decryptKeystoreWallet(jsonWallet, password) {
|
|
5355
5435
|
|
5356
5436
|
// src/wallet/base-wallet-unlocked.ts
|
5357
5437
|
var BaseWalletUnlocked = class extends Account {
|
5358
|
-
/**
|
5359
|
-
* Default HDWallet path.
|
5360
|
-
*/
|
5361
|
-
static defaultPath = "m/44'/1179993420'/0'/0/0";
|
5362
5438
|
/**
|
5363
5439
|
* A function that returns the wallet's signer.
|
5364
5440
|
*/
|
@@ -5408,7 +5484,7 @@ var BaseWalletUnlocked = class extends Account {
|
|
5408
5484
|
*/
|
5409
5485
|
async signTransaction(transactionRequestLike) {
|
5410
5486
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
5411
|
-
const chainId = this.provider.
|
5487
|
+
const chainId = this.provider.getChainId();
|
5412
5488
|
const hashedTransaction = transactionRequest.getTransactionId(chainId);
|
5413
5489
|
const signature = await this.signer().sign(hashedTransaction);
|
5414
5490
|
return (0, import_utils30.hexlify)(signature);
|
@@ -5464,6 +5540,10 @@ var BaseWalletUnlocked = class extends Account {
|
|
5464
5540
|
return encryptKeystoreWallet(this.privateKey, this.address, password);
|
5465
5541
|
}
|
5466
5542
|
};
|
5543
|
+
/**
|
5544
|
+
* Default HDWallet path.
|
5545
|
+
*/
|
5546
|
+
__publicField(BaseWalletUnlocked, "defaultPath", "m/44'/1179993420'/0'/0/0");
|
5467
5547
|
|
5468
5548
|
// src/hdwallet/hdwallet.ts
|
5469
5549
|
var import_errors19 = require("@fuel-ts/errors");
|
@@ -7673,7 +7753,7 @@ function assertMnemonic(words) {
|
|
7673
7753
|
throw new import_errors18.FuelError(import_errors18.ErrorCode.INVALID_MNEMONIC, errorMsg);
|
7674
7754
|
}
|
7675
7755
|
}
|
7676
|
-
var Mnemonic = class
|
7756
|
+
var Mnemonic = class {
|
7677
7757
|
wordlist;
|
7678
7758
|
/**
|
7679
7759
|
*
|
@@ -7690,7 +7770,7 @@ var Mnemonic = class _Mnemonic {
|
|
7690
7770
|
* @returns Entropy hash
|
7691
7771
|
*/
|
7692
7772
|
mnemonicToEntropy(phrase) {
|
7693
|
-
return
|
7773
|
+
return Mnemonic.mnemonicToEntropy(phrase, this.wordlist);
|
7694
7774
|
}
|
7695
7775
|
/**
|
7696
7776
|
*
|
@@ -7698,7 +7778,7 @@ var Mnemonic = class _Mnemonic {
|
|
7698
7778
|
* @returns Mnemonic phrase
|
7699
7779
|
*/
|
7700
7780
|
entropyToMnemonic(entropy) {
|
7701
|
-
return
|
7781
|
+
return Mnemonic.entropyToMnemonic(entropy, this.wordlist);
|
7702
7782
|
}
|
7703
7783
|
/**
|
7704
7784
|
*
|
@@ -7739,8 +7819,8 @@ var Mnemonic = class _Mnemonic {
|
|
7739
7819
|
* @returns 64-byte array contains privateKey and chainCode as described on BIP39
|
7740
7820
|
*/
|
7741
7821
|
static mnemonicToMasterKeys(phrase, passphrase = "") {
|
7742
|
-
const seed =
|
7743
|
-
return
|
7822
|
+
const seed = Mnemonic.mnemonicToSeed(phrase, passphrase);
|
7823
|
+
return Mnemonic.masterKeysFromSeed(seed);
|
7744
7824
|
}
|
7745
7825
|
/**
|
7746
7826
|
* Validates if given mnemonic is valid
|
@@ -7756,7 +7836,7 @@ var Mnemonic = class _Mnemonic {
|
|
7756
7836
|
return false;
|
7757
7837
|
}
|
7758
7838
|
while (i < words.length) {
|
7759
|
-
if (
|
7839
|
+
if (Mnemonic.binarySearch(words[i]) === false) {
|
7760
7840
|
return false;
|
7761
7841
|
}
|
7762
7842
|
i += 1;
|
@@ -7803,7 +7883,7 @@ var Mnemonic = class _Mnemonic {
|
|
7803
7883
|
* @returns BIP-32 extended private key
|
7804
7884
|
*/
|
7805
7885
|
static seedToExtendedKey(seed, testnet = false) {
|
7806
|
-
const masterKey =
|
7886
|
+
const masterKey = Mnemonic.masterKeysFromSeed(seed);
|
7807
7887
|
const prefix = (0, import_utils32.arrayify)(testnet ? TestnetPRV : MainnetPRV);
|
7808
7888
|
const depth = "0x00";
|
7809
7889
|
const fingerprint = "0x00000000";
|
@@ -7835,7 +7915,7 @@ var Mnemonic = class _Mnemonic {
|
|
7835
7915
|
*/
|
7836
7916
|
static generate(size = 32, extraEntropy = "") {
|
7837
7917
|
const entropy = extraEntropy ? (0, import_hasher5.sha256)((0, import_utils32.concat)([(0, import_crypto3.randomBytes)(size), (0, import_utils32.arrayify)(extraEntropy)])) : (0, import_crypto3.randomBytes)(size);
|
7838
|
-
return
|
7918
|
+
return Mnemonic.entropyToMnemonic(entropy);
|
7839
7919
|
}
|
7840
7920
|
};
|
7841
7921
|
var mnemonic_default = Mnemonic;
|
@@ -7875,7 +7955,7 @@ function parsePath(path, depth = 0) {
|
|
7875
7955
|
(p) => ~p.indexOf(`'`) ? parseInt(p, 10) + HARDENED_INDEX : parseInt(p, 10)
|
7876
7956
|
);
|
7877
7957
|
}
|
7878
|
-
var HDWallet = class
|
7958
|
+
var HDWallet = class {
|
7879
7959
|
depth = 0;
|
7880
7960
|
index = 0;
|
7881
7961
|
fingerprint = (0, import_utils34.hexlify)("0x00000000");
|
@@ -7941,7 +8021,7 @@ var HDWallet = class _HDWallet {
|
|
7941
8021
|
if (privateKey) {
|
7942
8022
|
const N = "0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141";
|
7943
8023
|
const ki = (0, import_math19.bn)(IL).add(privateKey).mod(N).toBytes(32);
|
7944
|
-
return new
|
8024
|
+
return new HDWallet({
|
7945
8025
|
privateKey: ki,
|
7946
8026
|
chainCode: IR,
|
7947
8027
|
index,
|
@@ -7951,7 +8031,7 @@ var HDWallet = class _HDWallet {
|
|
7951
8031
|
}
|
7952
8032
|
const signer = new Signer((0, import_utils34.hexlify)(IL));
|
7953
8033
|
const Ki = signer.addPoint(publicKey);
|
7954
|
-
return new
|
8034
|
+
return new HDWallet({
|
7955
8035
|
publicKey: Ki,
|
7956
8036
|
chainCode: IR,
|
7957
8037
|
index,
|
@@ -8000,7 +8080,7 @@ var HDWallet = class _HDWallet {
|
|
8000
8080
|
*/
|
8001
8081
|
static fromSeed(seed) {
|
8002
8082
|
const masterKey = mnemonic_default.masterKeysFromSeed(seed);
|
8003
|
-
return new
|
8083
|
+
return new HDWallet({
|
8004
8084
|
chainCode: (0, import_utils34.arrayify)(masterKey.slice(32)),
|
8005
8085
|
privateKey: (0, import_utils34.arrayify)(masterKey.slice(0, 32))
|
8006
8086
|
});
|
@@ -8030,7 +8110,7 @@ var HDWallet = class _HDWallet {
|
|
8030
8110
|
if (key[0] !== 3) {
|
8031
8111
|
throw new import_errors19.FuelError(import_errors19.ErrorCode.HD_WALLET_ERROR, "Invalid public extended key.");
|
8032
8112
|
}
|
8033
|
-
return new
|
8113
|
+
return new HDWallet({
|
8034
8114
|
publicKey: key,
|
8035
8115
|
chainCode,
|
8036
8116
|
index,
|
@@ -8041,7 +8121,7 @@ var HDWallet = class _HDWallet {
|
|
8041
8121
|
if (key[0] !== 0) {
|
8042
8122
|
throw new import_errors19.FuelError(import_errors19.ErrorCode.HD_WALLET_ERROR, "Invalid private extended key.");
|
8043
8123
|
}
|
8044
|
-
return new
|
8124
|
+
return new HDWallet({
|
8045
8125
|
privateKey: key.slice(1),
|
8046
8126
|
chainCode,
|
8047
8127
|
index,
|
@@ -8064,7 +8144,7 @@ var WalletLocked = class extends Account {
|
|
8064
8144
|
return new WalletUnlocked(privateKey, this._provider);
|
8065
8145
|
}
|
8066
8146
|
};
|
8067
|
-
var WalletUnlocked = class
|
8147
|
+
var WalletUnlocked = class extends BaseWalletUnlocked {
|
8068
8148
|
/**
|
8069
8149
|
* Locks the wallet and returns an instance of WalletLocked.
|
8070
8150
|
*
|
@@ -8082,7 +8162,7 @@ var WalletUnlocked = class _WalletUnlocked extends BaseWalletUnlocked {
|
|
8082
8162
|
*/
|
8083
8163
|
static generate(generateOptions) {
|
8084
8164
|
const privateKey = Signer.generatePrivateKey(generateOptions?.entropy);
|
8085
|
-
return new
|
8165
|
+
return new WalletUnlocked(privateKey, generateOptions?.provider);
|
8086
8166
|
}
|
8087
8167
|
/**
|
8088
8168
|
* Create a Wallet Unlocked from a seed.
|
@@ -8094,8 +8174,8 @@ var WalletUnlocked = class _WalletUnlocked extends BaseWalletUnlocked {
|
|
8094
8174
|
*/
|
8095
8175
|
static fromSeed(seed, path, provider) {
|
8096
8176
|
const hdWallet = hdwallet_default.fromSeed(seed);
|
8097
|
-
const childWallet = hdWallet.derivePath(path ||
|
8098
|
-
return new
|
8177
|
+
const childWallet = hdWallet.derivePath(path || WalletUnlocked.defaultPath);
|
8178
|
+
return new WalletUnlocked(childWallet.privateKey, provider);
|
8099
8179
|
}
|
8100
8180
|
/**
|
8101
8181
|
* Create a Wallet Unlocked from a mnemonic phrase.
|
@@ -8109,8 +8189,8 @@ var WalletUnlocked = class _WalletUnlocked extends BaseWalletUnlocked {
|
|
8109
8189
|
static fromMnemonic(mnemonic, path, passphrase, provider) {
|
8110
8190
|
const seed = mnemonic_default.mnemonicToSeed(mnemonic, passphrase);
|
8111
8191
|
const hdWallet = hdwallet_default.fromSeed(seed);
|
8112
|
-
const childWallet = hdWallet.derivePath(path ||
|
8113
|
-
return new
|
8192
|
+
const childWallet = hdWallet.derivePath(path || WalletUnlocked.defaultPath);
|
8193
|
+
return new WalletUnlocked(childWallet.privateKey, provider);
|
8114
8194
|
}
|
8115
8195
|
/**
|
8116
8196
|
* Create a Wallet Unlocked from an extended key.
|
@@ -8121,7 +8201,7 @@ var WalletUnlocked = class _WalletUnlocked extends BaseWalletUnlocked {
|
|
8121
8201
|
*/
|
8122
8202
|
static fromExtendedKey(extendedKey, provider) {
|
8123
8203
|
const hdWallet = hdwallet_default.fromExtendedKey(extendedKey);
|
8124
|
-
return new
|
8204
|
+
return new WalletUnlocked(hdWallet.privateKey, provider);
|
8125
8205
|
}
|
8126
8206
|
/**
|
8127
8207
|
* Create a Wallet Unlocked from an encrypted JSON.
|
@@ -8133,7 +8213,7 @@ var WalletUnlocked = class _WalletUnlocked extends BaseWalletUnlocked {
|
|
8133
8213
|
*/
|
8134
8214
|
static async fromEncryptedJson(jsonWallet, password, provider) {
|
8135
8215
|
const privateKey = await decryptKeystoreWallet(jsonWallet, password);
|
8136
|
-
return new
|
8216
|
+
return new WalletUnlocked(privateKey, provider);
|
8137
8217
|
}
|
8138
8218
|
};
|
8139
8219
|
|
@@ -8159,50 +8239,50 @@ var Wallet = class {
|
|
8159
8239
|
static fromPrivateKey(privateKey, provider) {
|
8160
8240
|
return new WalletUnlocked(privateKey, provider);
|
8161
8241
|
}
|
8162
|
-
/**
|
8163
|
-
* Generate a new Wallet Unlocked with a random key pair.
|
8164
|
-
*
|
8165
|
-
* @param generateOptions - Options to customize the generation process (optional).
|
8166
|
-
* @returns An unlocked wallet instance.
|
8167
|
-
*/
|
8168
|
-
static generate = WalletUnlocked.generate;
|
8169
|
-
/**
|
8170
|
-
* Create a Wallet Unlocked from a seed.
|
8171
|
-
*
|
8172
|
-
* @param seed - The seed phrase.
|
8173
|
-
* @param provider - A Provider instance (optional).
|
8174
|
-
* @param path - The derivation path (optional).
|
8175
|
-
* @returns An unlocked wallet instance.
|
8176
|
-
*/
|
8177
|
-
static fromSeed = WalletUnlocked.fromSeed;
|
8178
|
-
/**
|
8179
|
-
* Create a Wallet Unlocked from a mnemonic phrase.
|
8180
|
-
*
|
8181
|
-
* @param mnemonic - The mnemonic phrase.
|
8182
|
-
* @param provider - A Provider instance (optional).
|
8183
|
-
* @param path - The derivation path (optional).
|
8184
|
-
* @param passphrase - The passphrase for the mnemonic (optional).
|
8185
|
-
* @returns An unlocked wallet instance.
|
8186
|
-
*/
|
8187
|
-
static fromMnemonic = WalletUnlocked.fromMnemonic;
|
8188
|
-
/**
|
8189
|
-
* Create a Wallet Unlocked from an extended key.
|
8190
|
-
*
|
8191
|
-
* @param extendedKey - The extended key.
|
8192
|
-
* @param provider - A Provider instance (optional).
|
8193
|
-
* @returns An unlocked wallet instance.
|
8194
|
-
*/
|
8195
|
-
static fromExtendedKey = WalletUnlocked.fromExtendedKey;
|
8196
|
-
/**
|
8197
|
-
* Create a Wallet Unlocked from an encrypted JSON.
|
8198
|
-
*
|
8199
|
-
* @param jsonWallet - The encrypted JSON keystore.
|
8200
|
-
* @param password - The password to decrypt the JSON.
|
8201
|
-
* @param provider - A Provider instance (optional).
|
8202
|
-
* @returns An unlocked wallet instance.
|
8203
|
-
*/
|
8204
|
-
static fromEncryptedJson = WalletUnlocked.fromEncryptedJson;
|
8205
8242
|
};
|
8243
|
+
/**
|
8244
|
+
* Generate a new Wallet Unlocked with a random key pair.
|
8245
|
+
*
|
8246
|
+
* @param generateOptions - Options to customize the generation process (optional).
|
8247
|
+
* @returns An unlocked wallet instance.
|
8248
|
+
*/
|
8249
|
+
__publicField(Wallet, "generate", WalletUnlocked.generate);
|
8250
|
+
/**
|
8251
|
+
* Create a Wallet Unlocked from a seed.
|
8252
|
+
*
|
8253
|
+
* @param seed - The seed phrase.
|
8254
|
+
* @param provider - A Provider instance (optional).
|
8255
|
+
* @param path - The derivation path (optional).
|
8256
|
+
* @returns An unlocked wallet instance.
|
8257
|
+
*/
|
8258
|
+
__publicField(Wallet, "fromSeed", WalletUnlocked.fromSeed);
|
8259
|
+
/**
|
8260
|
+
* Create a Wallet Unlocked from a mnemonic phrase.
|
8261
|
+
*
|
8262
|
+
* @param mnemonic - The mnemonic phrase.
|
8263
|
+
* @param provider - A Provider instance (optional).
|
8264
|
+
* @param path - The derivation path (optional).
|
8265
|
+
* @param passphrase - The passphrase for the mnemonic (optional).
|
8266
|
+
* @returns An unlocked wallet instance.
|
8267
|
+
*/
|
8268
|
+
__publicField(Wallet, "fromMnemonic", WalletUnlocked.fromMnemonic);
|
8269
|
+
/**
|
8270
|
+
* Create a Wallet Unlocked from an extended key.
|
8271
|
+
*
|
8272
|
+
* @param extendedKey - The extended key.
|
8273
|
+
* @param provider - A Provider instance (optional).
|
8274
|
+
* @returns An unlocked wallet instance.
|
8275
|
+
*/
|
8276
|
+
__publicField(Wallet, "fromExtendedKey", WalletUnlocked.fromExtendedKey);
|
8277
|
+
/**
|
8278
|
+
* Create a Wallet Unlocked from an encrypted JSON.
|
8279
|
+
*
|
8280
|
+
* @param jsonWallet - The encrypted JSON keystore.
|
8281
|
+
* @param password - The password to decrypt the JSON.
|
8282
|
+
* @param provider - A Provider instance (optional).
|
8283
|
+
* @returns An unlocked wallet instance.
|
8284
|
+
*/
|
8285
|
+
__publicField(Wallet, "fromEncryptedJson", WalletUnlocked.fromEncryptedJson);
|
8206
8286
|
|
8207
8287
|
// src/wallet-manager/wallet-manager.ts
|
8208
8288
|
var import_address9 = require("@fuel-ts/address");
|
@@ -8231,14 +8311,14 @@ var MemoryStorage = class {
|
|
8231
8311
|
// src/wallet-manager/vaults/mnemonic-vault.ts
|
8232
8312
|
var import_address7 = require("@fuel-ts/address");
|
8233
8313
|
var import_errors20 = require("@fuel-ts/errors");
|
8314
|
+
var _secret;
|
8234
8315
|
var MnemonicVault = class {
|
8235
|
-
static type = "mnemonic";
|
8236
|
-
#secret;
|
8237
|
-
pathKey = "{}";
|
8238
|
-
rootPath = `m/44'/1179993420'/${this.pathKey}'/0/0`;
|
8239
|
-
numberOfAccounts = 0;
|
8240
8316
|
constructor(options) {
|
8241
|
-
this
|
8317
|
+
__privateAdd(this, _secret, void 0);
|
8318
|
+
__publicField(this, "pathKey", "{}");
|
8319
|
+
__publicField(this, "rootPath", `m/44'/1179993420'/${this.pathKey}'/0/0`);
|
8320
|
+
__publicField(this, "numberOfAccounts", 0);
|
8321
|
+
__privateSet(this, _secret, options.secret || mnemonic_default.generate());
|
8242
8322
|
this.rootPath = options.rootPath || this.rootPath;
|
8243
8323
|
this.numberOfAccounts = options.numberOfAccounts || 1;
|
8244
8324
|
}
|
@@ -8250,7 +8330,7 @@ var MnemonicVault = class {
|
|
8250
8330
|
}
|
8251
8331
|
serialize() {
|
8252
8332
|
return {
|
8253
|
-
secret: this
|
8333
|
+
secret: __privateGet(this, _secret),
|
8254
8334
|
rootPath: this.rootPath,
|
8255
8335
|
numberOfAccounts: this.numberOfAccounts
|
8256
8336
|
};
|
@@ -8259,7 +8339,7 @@ var MnemonicVault = class {
|
|
8259
8339
|
const accounts = [];
|
8260
8340
|
let numberOfAccounts = 0;
|
8261
8341
|
do {
|
8262
|
-
const wallet = Wallet.fromMnemonic(this
|
8342
|
+
const wallet = Wallet.fromMnemonic(__privateGet(this, _secret), this.getDerivePath(numberOfAccounts));
|
8263
8343
|
accounts.push({
|
8264
8344
|
publicKey: wallet.publicKey,
|
8265
8345
|
address: wallet.address
|
@@ -8270,7 +8350,7 @@ var MnemonicVault = class {
|
|
8270
8350
|
}
|
8271
8351
|
addAccount() {
|
8272
8352
|
this.numberOfAccounts += 1;
|
8273
|
-
const wallet = Wallet.fromMnemonic(this
|
8353
|
+
const wallet = Wallet.fromMnemonic(__privateGet(this, _secret), this.getDerivePath(this.numberOfAccounts - 1));
|
8274
8354
|
return {
|
8275
8355
|
publicKey: wallet.publicKey,
|
8276
8356
|
address: wallet.address
|
@@ -8280,7 +8360,7 @@ var MnemonicVault = class {
|
|
8280
8360
|
let numberOfAccounts = 0;
|
8281
8361
|
const ownerAddress = import_address7.Address.fromAddressOrString(address);
|
8282
8362
|
do {
|
8283
|
-
const wallet = Wallet.fromMnemonic(this
|
8363
|
+
const wallet = Wallet.fromMnemonic(__privateGet(this, _secret), this.getDerivePath(numberOfAccounts));
|
8284
8364
|
if (wallet.address.equals(ownerAddress)) {
|
8285
8365
|
return wallet.privateKey;
|
8286
8366
|
}
|
@@ -8296,27 +8376,29 @@ var MnemonicVault = class {
|
|
8296
8376
|
return Wallet.fromPrivateKey(privateKey);
|
8297
8377
|
}
|
8298
8378
|
};
|
8379
|
+
_secret = new WeakMap();
|
8380
|
+
__publicField(MnemonicVault, "type", "mnemonic");
|
8299
8381
|
|
8300
8382
|
// src/wallet-manager/vaults/privatekey-vault.ts
|
8301
8383
|
var import_address8 = require("@fuel-ts/address");
|
8302
8384
|
var import_errors21 = require("@fuel-ts/errors");
|
8385
|
+
var _privateKeys;
|
8303
8386
|
var PrivateKeyVault = class {
|
8304
|
-
static type = "privateKey";
|
8305
|
-
#privateKeys = [];
|
8306
8387
|
/**
|
8307
8388
|
* If privateKey vault is initialized with a secretKey, it creates
|
8308
8389
|
* one account with the fallowing secret
|
8309
8390
|
*/
|
8310
8391
|
constructor(options = {}) {
|
8392
|
+
__privateAdd(this, _privateKeys, []);
|
8311
8393
|
if (options.secret) {
|
8312
|
-
this
|
8394
|
+
__privateSet(this, _privateKeys, [options.secret]);
|
8313
8395
|
} else {
|
8314
|
-
this
|
8396
|
+
__privateSet(this, _privateKeys, options.accounts || [Wallet.generate().privateKey]);
|
8315
8397
|
}
|
8316
8398
|
}
|
8317
8399
|
serialize() {
|
8318
8400
|
return {
|
8319
|
-
accounts: this
|
8401
|
+
accounts: __privateGet(this, _privateKeys)
|
8320
8402
|
};
|
8321
8403
|
}
|
8322
8404
|
getPublicAccount(privateKey) {
|
@@ -8327,16 +8409,16 @@ var PrivateKeyVault = class {
|
|
8327
8409
|
};
|
8328
8410
|
}
|
8329
8411
|
getAccounts() {
|
8330
|
-
return this
|
8412
|
+
return __privateGet(this, _privateKeys).map((pk) => this.getPublicAccount(pk));
|
8331
8413
|
}
|
8332
8414
|
addAccount() {
|
8333
8415
|
const wallet = Wallet.generate();
|
8334
|
-
this
|
8416
|
+
__privateGet(this, _privateKeys).push(wallet.privateKey);
|
8335
8417
|
return this.getPublicAccount(wallet.privateKey);
|
8336
8418
|
}
|
8337
8419
|
exportAccount(address) {
|
8338
8420
|
const ownerAddress = import_address8.Address.fromAddressOrString(address);
|
8339
|
-
const privateKey = this
|
8421
|
+
const privateKey = __privateGet(this, _privateKeys).find(
|
8340
8422
|
(pk) => Wallet.fromPrivateKey(pk).address.equals(ownerAddress)
|
8341
8423
|
);
|
8342
8424
|
if (!privateKey) {
|
@@ -8352,6 +8434,8 @@ var PrivateKeyVault = class {
|
|
8352
8434
|
return Wallet.fromPrivateKey(privateKey);
|
8353
8435
|
}
|
8354
8436
|
};
|
8437
|
+
_privateKeys = new WeakMap();
|
8438
|
+
__publicField(PrivateKeyVault, "type", "privateKey");
|
8355
8439
|
|
8356
8440
|
// src/wallet-manager/wallet-manager.ts
|
8357
8441
|
var ERROR_MESSAGES = {
|
@@ -8366,43 +8450,46 @@ function assert(condition, message) {
|
|
8366
8450
|
throw new import_errors22.FuelError(import_errors22.ErrorCode.WALLET_MANAGER_ERROR, message);
|
8367
8451
|
}
|
8368
8452
|
}
|
8369
|
-
var
|
8370
|
-
|
8371
|
-
* Vaults
|
8372
|
-
*
|
8373
|
-
* Vaults are responsible to store secret keys and return an `Wallet` instance,
|
8374
|
-
* to interact with the network.
|
8375
|
-
*
|
8376
|
-
* Each vault has access to its own state
|
8377
|
-
*
|
8378
|
-
*/
|
8379
|
-
static Vaults = [MnemonicVault, PrivateKeyVault];
|
8380
|
-
/**
|
8381
|
-
* Storage
|
8382
|
-
*
|
8383
|
-
* Persistent encrypted data. `The default storage works only on memory`.
|
8384
|
-
*/
|
8385
|
-
storage = new MemoryStorage();
|
8386
|
-
/* Key name passed to the storage */
|
8387
|
-
STORAGE_KEY = "WalletManager";
|
8388
|
-
// `This variables are only accessible from inside the class`
|
8389
|
-
#vaults = [];
|
8390
|
-
#passphrase = "";
|
8391
|
-
#isLocked = true;
|
8453
|
+
var _vaults, _passphrase, _isLocked, _serializeVaults, serializeVaults_fn, _deserializeVaults, deserializeVaults_fn;
|
8454
|
+
var _WalletManager = class extends import_events.EventEmitter {
|
8392
8455
|
constructor(options) {
|
8393
8456
|
super();
|
8457
|
+
/**
|
8458
|
+
* Serialize all vaults to store
|
8459
|
+
*
|
8460
|
+
* `This is only accessible from inside the class`
|
8461
|
+
*/
|
8462
|
+
__privateAdd(this, _serializeVaults);
|
8463
|
+
/**
|
8464
|
+
* Deserialize all vaults to state
|
8465
|
+
*
|
8466
|
+
* `This is only accessible from inside the class`
|
8467
|
+
*/
|
8468
|
+
__privateAdd(this, _deserializeVaults);
|
8469
|
+
/**
|
8470
|
+
* Storage
|
8471
|
+
*
|
8472
|
+
* Persistent encrypted data. `The default storage works only on memory`.
|
8473
|
+
*/
|
8474
|
+
__publicField(this, "storage", new MemoryStorage());
|
8475
|
+
/* Key name passed to the storage */
|
8476
|
+
__publicField(this, "STORAGE_KEY", "WalletManager");
|
8477
|
+
// `This variables are only accessible from inside the class`
|
8478
|
+
__privateAdd(this, _vaults, []);
|
8479
|
+
__privateAdd(this, _passphrase, "");
|
8480
|
+
__privateAdd(this, _isLocked, true);
|
8394
8481
|
this.storage = options?.storage || this.storage;
|
8395
8482
|
}
|
8396
8483
|
get isLocked() {
|
8397
|
-
return this
|
8484
|
+
return __privateGet(this, _isLocked);
|
8398
8485
|
}
|
8399
8486
|
/**
|
8400
8487
|
* Return the vault serialized object containing all the privateKeys,
|
8401
8488
|
* the format of the return depends on the Vault type.
|
8402
8489
|
*/
|
8403
8490
|
exportVault(vaultId) {
|
8404
|
-
assert(!this
|
8405
|
-
const vaultState = this
|
8491
|
+
assert(!__privateGet(this, _isLocked), ERROR_MESSAGES.wallet_not_unlocked);
|
8492
|
+
const vaultState = __privateGet(this, _vaults).find((_, idx) => idx === vaultId);
|
8406
8493
|
assert(vaultState, ERROR_MESSAGES.vault_not_found);
|
8407
8494
|
return vaultState.vault.serialize();
|
8408
8495
|
}
|
@@ -8410,7 +8497,7 @@ var WalletManager = class _WalletManager extends import_events.EventEmitter {
|
|
8410
8497
|
* List all vaults on the Wallet Manager, this function not return secret's
|
8411
8498
|
*/
|
8412
8499
|
getVaults() {
|
8413
|
-
return this
|
8500
|
+
return __privateGet(this, _vaults).map((v, idx) => ({
|
8414
8501
|
title: v.title,
|
8415
8502
|
type: v.type,
|
8416
8503
|
vaultId: idx
|
@@ -8420,7 +8507,7 @@ var WalletManager = class _WalletManager extends import_events.EventEmitter {
|
|
8420
8507
|
* List all accounts on the Wallet Manager not vault information is revealed
|
8421
8508
|
*/
|
8422
8509
|
getAccounts() {
|
8423
|
-
return this
|
8510
|
+
return __privateGet(this, _vaults).flatMap(
|
8424
8511
|
(vaultState, vaultId) => vaultState.vault.getAccounts().map((account) => ({ ...account, vaultId }))
|
8425
8512
|
);
|
8426
8513
|
}
|
@@ -8429,7 +8516,7 @@ var WalletManager = class _WalletManager extends import_events.EventEmitter {
|
|
8429
8516
|
*/
|
8430
8517
|
getWallet(address) {
|
8431
8518
|
const ownerAddress = import_address9.Address.fromAddressOrString(address);
|
8432
|
-
const vaultState = this
|
8519
|
+
const vaultState = __privateGet(this, _vaults).find(
|
8433
8520
|
(vs) => vs.vault.getAccounts().find((a) => a.address.equals(ownerAddress))
|
8434
8521
|
);
|
8435
8522
|
assert(vaultState, ERROR_MESSAGES.address_not_found);
|
@@ -8440,8 +8527,8 @@ var WalletManager = class _WalletManager extends import_events.EventEmitter {
|
|
8440
8527
|
*/
|
8441
8528
|
exportPrivateKey(address) {
|
8442
8529
|
const ownerAddress = import_address9.Address.fromAddressOrString(address);
|
8443
|
-
assert(!this
|
8444
|
-
const vaultState = this
|
8530
|
+
assert(!__privateGet(this, _isLocked), ERROR_MESSAGES.wallet_not_unlocked);
|
8531
|
+
const vaultState = __privateGet(this, _vaults).find(
|
8445
8532
|
(vs) => vs.vault.getAccounts().find((a) => a.address.equals(ownerAddress))
|
8446
8533
|
);
|
8447
8534
|
assert(vaultState, ERROR_MESSAGES.address_not_found);
|
@@ -8453,7 +8540,7 @@ var WalletManager = class _WalletManager extends import_events.EventEmitter {
|
|
8453
8540
|
*/
|
8454
8541
|
async addAccount(options) {
|
8455
8542
|
await this.loadState();
|
8456
|
-
const vaultState = this
|
8543
|
+
const vaultState = __privateGet(this, _vaults)[options?.vaultId || 0];
|
8457
8544
|
await assert(vaultState, ERROR_MESSAGES.vault_not_found);
|
8458
8545
|
const account = vaultState.vault.addAccount();
|
8459
8546
|
await this.saveState();
|
@@ -8464,7 +8551,7 @@ var WalletManager = class _WalletManager extends import_events.EventEmitter {
|
|
8464
8551
|
* created by the vault.
|
8465
8552
|
*/
|
8466
8553
|
async removeVault(index) {
|
8467
|
-
this
|
8554
|
+
__privateGet(this, _vaults).splice(index, 1);
|
8468
8555
|
await this.saveState();
|
8469
8556
|
}
|
8470
8557
|
/**
|
@@ -8475,11 +8562,11 @@ var WalletManager = class _WalletManager extends import_events.EventEmitter {
|
|
8475
8562
|
await this.loadState();
|
8476
8563
|
const Vault2 = this.getVaultClass(vaultConfig.type);
|
8477
8564
|
const vault = new Vault2(vaultConfig);
|
8478
|
-
this
|
8565
|
+
__privateSet(this, _vaults, __privateGet(this, _vaults).concat({
|
8479
8566
|
title: vaultConfig.title,
|
8480
8567
|
type: vaultConfig.type,
|
8481
8568
|
vault
|
8482
|
-
});
|
8569
|
+
}));
|
8483
8570
|
await this.saveState();
|
8484
8571
|
}
|
8485
8572
|
/**
|
@@ -8487,9 +8574,9 @@ var WalletManager = class _WalletManager extends import_events.EventEmitter {
|
|
8487
8574
|
* secrets.
|
8488
8575
|
*/
|
8489
8576
|
lock() {
|
8490
|
-
this
|
8491
|
-
this
|
8492
|
-
this
|
8577
|
+
__privateSet(this, _isLocked, true);
|
8578
|
+
__privateSet(this, _vaults, []);
|
8579
|
+
__privateSet(this, _passphrase, "");
|
8493
8580
|
this.emit("lock");
|
8494
8581
|
}
|
8495
8582
|
/**
|
@@ -8497,8 +8584,8 @@ var WalletManager = class _WalletManager extends import_events.EventEmitter {
|
|
8497
8584
|
* Vaults with secrets are not unlocked or instantiated on this moment.
|
8498
8585
|
*/
|
8499
8586
|
async unlock(passphrase) {
|
8500
|
-
this
|
8501
|
-
this
|
8587
|
+
__privateSet(this, _passphrase, passphrase);
|
8588
|
+
__privateSet(this, _isLocked, false);
|
8502
8589
|
try {
|
8503
8590
|
await this.loadState();
|
8504
8591
|
this.emit("unlock");
|
@@ -8511,9 +8598,9 @@ var WalletManager = class _WalletManager extends import_events.EventEmitter {
|
|
8511
8598
|
* Update WalletManager encryption passphrase
|
8512
8599
|
*/
|
8513
8600
|
async updatePassphrase(oldpass, newpass) {
|
8514
|
-
const isLocked = this
|
8601
|
+
const isLocked = __privateGet(this, _isLocked);
|
8515
8602
|
await this.unlock(oldpass);
|
8516
|
-
this
|
8603
|
+
__privateSet(this, _passphrase, newpass);
|
8517
8604
|
await this.saveState();
|
8518
8605
|
await this.loadState();
|
8519
8606
|
if (isLocked) {
|
@@ -8524,51 +8611,24 @@ var WalletManager = class _WalletManager extends import_events.EventEmitter {
|
|
8524
8611
|
* Retrieve and decrypt WalletManager state from storage
|
8525
8612
|
*/
|
8526
8613
|
async loadState() {
|
8527
|
-
await assert(!this
|
8614
|
+
await assert(!__privateGet(this, _isLocked), ERROR_MESSAGES.wallet_not_unlocked);
|
8528
8615
|
const data = await this.storage.getItem(this.STORAGE_KEY);
|
8529
8616
|
if (data) {
|
8530
|
-
const state = await (0, import_crypto4.decrypt)(this
|
8531
|
-
this
|
8617
|
+
const state = await (0, import_crypto4.decrypt)(__privateGet(this, _passphrase), JSON.parse(data));
|
8618
|
+
__privateSet(this, _vaults, __privateMethod(this, _deserializeVaults, deserializeVaults_fn).call(this, state.vaults));
|
8532
8619
|
}
|
8533
8620
|
}
|
8534
8621
|
/**
|
8535
8622
|
* Store encrypted WalletManager state on storage
|
8536
8623
|
*/
|
8537
8624
|
async saveState() {
|
8538
|
-
await assert(!this
|
8539
|
-
const encryptedData = await (0, import_crypto4.encrypt)(this
|
8540
|
-
vaults: this
|
8625
|
+
await assert(!__privateGet(this, _isLocked), ERROR_MESSAGES.wallet_not_unlocked);
|
8626
|
+
const encryptedData = await (0, import_crypto4.encrypt)(__privateGet(this, _passphrase), {
|
8627
|
+
vaults: __privateMethod(this, _serializeVaults, serializeVaults_fn).call(this, __privateGet(this, _vaults))
|
8541
8628
|
});
|
8542
8629
|
await this.storage.setItem(this.STORAGE_KEY, JSON.stringify(encryptedData));
|
8543
8630
|
this.emit("update");
|
8544
8631
|
}
|
8545
|
-
/**
|
8546
|
-
* Serialize all vaults to store
|
8547
|
-
*
|
8548
|
-
* `This is only accessible from inside the class`
|
8549
|
-
*/
|
8550
|
-
#serializeVaults(vaults) {
|
8551
|
-
return vaults.map(({ title, type, vault }) => ({
|
8552
|
-
title,
|
8553
|
-
type,
|
8554
|
-
data: vault.serialize()
|
8555
|
-
}));
|
8556
|
-
}
|
8557
|
-
/**
|
8558
|
-
* Deserialize all vaults to state
|
8559
|
-
*
|
8560
|
-
* `This is only accessible from inside the class`
|
8561
|
-
*/
|
8562
|
-
#deserializeVaults(vaults) {
|
8563
|
-
return vaults.map(({ title, type, data: vaultConfig }) => {
|
8564
|
-
const VaultClass = this.getVaultClass(type);
|
8565
|
-
return {
|
8566
|
-
title,
|
8567
|
-
type,
|
8568
|
-
vault: new VaultClass(vaultConfig)
|
8569
|
-
};
|
8570
|
-
});
|
8571
|
-
}
|
8572
8632
|
/**
|
8573
8633
|
* Return a instantiable Class reference from `WalletManager.Vaults` supported list.
|
8574
8634
|
*/
|
@@ -8578,11 +8638,43 @@ var WalletManager = class _WalletManager extends import_events.EventEmitter {
|
|
8578
8638
|
return VaultClass;
|
8579
8639
|
}
|
8580
8640
|
};
|
8641
|
+
var WalletManager = _WalletManager;
|
8642
|
+
_vaults = new WeakMap();
|
8643
|
+
_passphrase = new WeakMap();
|
8644
|
+
_isLocked = new WeakMap();
|
8645
|
+
_serializeVaults = new WeakSet();
|
8646
|
+
serializeVaults_fn = function(vaults) {
|
8647
|
+
return vaults.map(({ title, type, vault }) => ({
|
8648
|
+
title,
|
8649
|
+
type,
|
8650
|
+
data: vault.serialize()
|
8651
|
+
}));
|
8652
|
+
};
|
8653
|
+
_deserializeVaults = new WeakSet();
|
8654
|
+
deserializeVaults_fn = function(vaults) {
|
8655
|
+
return vaults.map(({ title, type, data: vaultConfig }) => {
|
8656
|
+
const VaultClass = this.getVaultClass(type);
|
8657
|
+
return {
|
8658
|
+
title,
|
8659
|
+
type,
|
8660
|
+
vault: new VaultClass(vaultConfig)
|
8661
|
+
};
|
8662
|
+
});
|
8663
|
+
};
|
8664
|
+
/**
|
8665
|
+
* Vaults
|
8666
|
+
*
|
8667
|
+
* Vaults are responsible to store secret keys and return an `Wallet` instance,
|
8668
|
+
* to interact with the network.
|
8669
|
+
*
|
8670
|
+
* Each vault has access to its own state
|
8671
|
+
*
|
8672
|
+
*/
|
8673
|
+
__publicField(WalletManager, "Vaults", [MnemonicVault, PrivateKeyVault]);
|
8581
8674
|
|
8582
8675
|
// src/wallet-manager/types.ts
|
8583
8676
|
var import_errors23 = require("@fuel-ts/errors");
|
8584
8677
|
var Vault = class {
|
8585
|
-
static type;
|
8586
8678
|
constructor(_options) {
|
8587
8679
|
throw new import_errors23.FuelError(import_errors23.ErrorCode.NOT_IMPLEMENTED, "Not implemented.");
|
8588
8680
|
}
|
@@ -8602,6 +8694,7 @@ var Vault = class {
|
|
8602
8694
|
throw new import_errors23.FuelError(import_errors23.ErrorCode.NOT_IMPLEMENTED, "Not implemented.");
|
8603
8695
|
}
|
8604
8696
|
};
|
8697
|
+
__publicField(Vault, "type");
|
8605
8698
|
var StorageAbstract = class {
|
8606
8699
|
};
|
8607
8700
|
|
@@ -8627,7 +8720,7 @@ var getPredicateRoot = (bytecode) => {
|
|
8627
8720
|
};
|
8628
8721
|
|
8629
8722
|
// src/predicate/predicate.ts
|
8630
|
-
var Predicate = class
|
8723
|
+
var Predicate = class extends Account {
|
8631
8724
|
bytes;
|
8632
8725
|
predicateDataBytes = Uint8Array.from([]);
|
8633
8726
|
predicateData = [];
|
@@ -8648,7 +8741,7 @@ var Predicate = class _Predicate extends Account {
|
|
8648
8741
|
inputData,
|
8649
8742
|
configurableConstants
|
8650
8743
|
}) {
|
8651
|
-
const { predicateBytes, predicateInterface } =
|
8744
|
+
const { predicateBytes, predicateInterface } = Predicate.processPredicateData(
|
8652
8745
|
bytecode,
|
8653
8746
|
abi,
|
8654
8747
|
configurableConstants
|
@@ -8744,7 +8837,7 @@ var Predicate = class _Predicate extends Account {
|
|
8744
8837
|
}
|
8745
8838
|
}
|
8746
8839
|
if (configurableConstants && Object.keys(configurableConstants).length) {
|
8747
|
-
predicateBytes =
|
8840
|
+
predicateBytes = Predicate.setConfigurableConstants(
|
8748
8841
|
predicateBytes,
|
8749
8842
|
configurableConstants,
|
8750
8843
|
abiInterface
|
@@ -8932,6 +9025,18 @@ var FuelConnector = class extends import_events2.EventEmitter {
|
|
8932
9025
|
async signMessage(_address, _message) {
|
8933
9026
|
throw new Error("Method not implemented.");
|
8934
9027
|
}
|
9028
|
+
/**
|
9029
|
+
* Should start the sign transaction process and return
|
9030
|
+
* the signed transaction.
|
9031
|
+
*
|
9032
|
+
* @param address - The address to sign the transaction
|
9033
|
+
* @param transaction - The transaction to sign
|
9034
|
+
*
|
9035
|
+
* @returns Transaction signature
|
9036
|
+
*/
|
9037
|
+
async signTransaction(_address, _transaction) {
|
9038
|
+
throw new Error("Method not implemented.");
|
9039
|
+
}
|
8935
9040
|
/**
|
8936
9041
|
* Should start the send transaction process and return
|
8937
9042
|
* the transaction id submitted to the network.
|
@@ -9124,9 +9229,7 @@ async function withTimeout(promise, timeout = 1050) {
|
|
9124
9229
|
var HAS_CONNECTOR_TIMEOUT = 2e3;
|
9125
9230
|
var PING_CACHE_TIME = 5e3;
|
9126
9231
|
var { warn } = console;
|
9127
|
-
var
|
9128
|
-
static STORAGE_KEY = "fuel-current-connector";
|
9129
|
-
static defaultConfig = {};
|
9232
|
+
var _Fuel = class extends FuelConnector {
|
9130
9233
|
_storage = null;
|
9131
9234
|
_connectors = [];
|
9132
9235
|
_targetObject = null;
|
@@ -9451,6 +9554,9 @@ var Fuel = class _Fuel extends FuelConnector {
|
|
9451
9554
|
await this.clean();
|
9452
9555
|
}
|
9453
9556
|
};
|
9557
|
+
var Fuel = _Fuel;
|
9558
|
+
__publicField(Fuel, "STORAGE_KEY", "fuel-current-connector");
|
9559
|
+
__publicField(Fuel, "defaultConfig", {});
|
9454
9560
|
// Annotate the CommonJS export names for ESM import in node:
|
9455
9561
|
0 && (module.exports = {
|
9456
9562
|
Account,
|