@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.mjs
CHANGED
@@ -1,3 +1,32 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
3
|
+
var __publicField = (obj, key, value) => {
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
5
|
+
return value;
|
6
|
+
};
|
7
|
+
var __accessCheck = (obj, member, msg) => {
|
8
|
+
if (!member.has(obj))
|
9
|
+
throw TypeError("Cannot " + msg);
|
10
|
+
};
|
11
|
+
var __privateGet = (obj, member, getter) => {
|
12
|
+
__accessCheck(obj, member, "read from private field");
|
13
|
+
return getter ? getter.call(obj) : member.get(obj);
|
14
|
+
};
|
15
|
+
var __privateAdd = (obj, member, value) => {
|
16
|
+
if (member.has(obj))
|
17
|
+
throw TypeError("Cannot add the same private member more than once");
|
18
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
19
|
+
};
|
20
|
+
var __privateSet = (obj, member, value, setter) => {
|
21
|
+
__accessCheck(obj, member, "write to private field");
|
22
|
+
setter ? setter.call(obj, value) : member.set(obj, value);
|
23
|
+
return value;
|
24
|
+
};
|
25
|
+
var __privateMethod = (obj, member, method) => {
|
26
|
+
__accessCheck(obj, member, "access private method");
|
27
|
+
return method;
|
28
|
+
};
|
29
|
+
|
1
30
|
// src/account.ts
|
2
31
|
import { Address as Address3 } from "@fuel-ts/address";
|
3
32
|
import { BaseAssetId as BaseAssetId3 } from "@fuel-ts/address/configs";
|
@@ -867,12 +896,11 @@ function getSdk(requester) {
|
|
867
896
|
// src/providers/fuel-graphql-subscriber.ts
|
868
897
|
import { ErrorCode, FuelError } from "@fuel-ts/errors";
|
869
898
|
import { print } from "graphql";
|
870
|
-
var
|
899
|
+
var _FuelGraphqlSubscriber = class {
|
871
900
|
constructor(options) {
|
872
901
|
this.options = options;
|
873
902
|
}
|
874
903
|
stream;
|
875
|
-
static textDecoder = new TextDecoder();
|
876
904
|
async setStream() {
|
877
905
|
const { url, query, variables, fetchFn } = this.options;
|
878
906
|
const response = await fetchFn(`${url}-sub`, {
|
@@ -932,6 +960,8 @@ var FuelGraphqlSubscriber = class _FuelGraphqlSubscriber {
|
|
932
960
|
return this;
|
933
961
|
}
|
934
962
|
};
|
963
|
+
var FuelGraphqlSubscriber = _FuelGraphqlSubscriber;
|
964
|
+
__publicField(FuelGraphqlSubscriber, "textDecoder", new TextDecoder());
|
935
965
|
|
936
966
|
// src/providers/memory-cache.ts
|
937
967
|
import { ErrorCode as ErrorCode2, FuelError as FuelError2 } from "@fuel-ts/errors";
|
@@ -1565,7 +1595,7 @@ var witnessify = (value) => {
|
|
1565
1595
|
};
|
1566
1596
|
|
1567
1597
|
// src/providers/transaction-request/transaction-request.ts
|
1568
|
-
var BaseTransactionRequest = class
|
1598
|
+
var BaseTransactionRequest = class {
|
1569
1599
|
/** Gas price for transaction */
|
1570
1600
|
gasPrice;
|
1571
1601
|
/** Block until which tx cannot be included */
|
@@ -1635,7 +1665,7 @@ var BaseTransactionRequest = class _BaseTransactionRequest {
|
|
1635
1665
|
const inputs = this.inputs?.map(inputify) ?? [];
|
1636
1666
|
const outputs = this.outputs?.map(outputify) ?? [];
|
1637
1667
|
const witnesses = this.witnesses?.map(witnessify) ?? [];
|
1638
|
-
const { policyTypes, policies } =
|
1668
|
+
const { policyTypes, policies } = BaseTransactionRequest.getPolicyMeta(this);
|
1639
1669
|
return {
|
1640
1670
|
policyTypes,
|
1641
1671
|
inputs,
|
@@ -1673,13 +1703,27 @@ var BaseTransactionRequest = class _BaseTransactionRequest {
|
|
1673
1703
|
this.outputs.push(output);
|
1674
1704
|
return this.outputs.length - 1;
|
1675
1705
|
}
|
1706
|
+
/**
|
1707
|
+
* @hidden
|
1708
|
+
*
|
1709
|
+
* Pushes a witness to the list and returns the index
|
1710
|
+
*
|
1711
|
+
* @param signature - The signature to add to the witness.
|
1712
|
+
* @returns The index of the created witness.
|
1713
|
+
*/
|
1714
|
+
addWitness(signature) {
|
1715
|
+
this.witnesses.push(signature);
|
1716
|
+
return this.witnesses.length - 1;
|
1717
|
+
}
|
1676
1718
|
/**
|
1677
1719
|
* @hidden
|
1678
1720
|
*
|
1679
1721
|
* Creates an empty witness without any side effects and returns the index
|
1722
|
+
*
|
1723
|
+
* @returns The index of the created witness.
|
1680
1724
|
*/
|
1681
|
-
|
1682
|
-
this.
|
1725
|
+
addEmptyWitness() {
|
1726
|
+
this.addWitness(concat([ZeroBytes324, ZeroBytes324]));
|
1683
1727
|
return this.witnesses.length - 1;
|
1684
1728
|
}
|
1685
1729
|
/**
|
@@ -1708,6 +1752,21 @@ var BaseTransactionRequest = class _BaseTransactionRequest {
|
|
1708
1752
|
}
|
1709
1753
|
this.witnesses[index] = witness;
|
1710
1754
|
}
|
1755
|
+
/**
|
1756
|
+
* Helper function to add an external signature to the transaction.
|
1757
|
+
*
|
1758
|
+
* @param account - The account/s to sign to the transaction.
|
1759
|
+
* @returns The transaction with the signature witness added.
|
1760
|
+
*/
|
1761
|
+
async addAccountWitnesses(account) {
|
1762
|
+
const accounts = Array.isArray(account) ? account : [account];
|
1763
|
+
await Promise.all(
|
1764
|
+
accounts.map(async (acc) => {
|
1765
|
+
this.addWitness(await acc.signTransaction(this));
|
1766
|
+
})
|
1767
|
+
);
|
1768
|
+
return this;
|
1769
|
+
}
|
1711
1770
|
/**
|
1712
1771
|
* Gets the coin inputs for a transaction.
|
1713
1772
|
*
|
@@ -1773,7 +1832,7 @@ var BaseTransactionRequest = class _BaseTransactionRequest {
|
|
1773
1832
|
} else {
|
1774
1833
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
|
1775
1834
|
if (typeof witnessIndex !== "number") {
|
1776
|
-
witnessIndex = this.
|
1835
|
+
witnessIndex = this.addEmptyWitness();
|
1777
1836
|
}
|
1778
1837
|
}
|
1779
1838
|
const input = {
|
@@ -1807,7 +1866,7 @@ var BaseTransactionRequest = class _BaseTransactionRequest {
|
|
1807
1866
|
} else {
|
1808
1867
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
|
1809
1868
|
if (typeof witnessIndex !== "number") {
|
1810
|
-
witnessIndex = this.
|
1869
|
+
witnessIndex = this.addEmptyWitness();
|
1811
1870
|
}
|
1812
1871
|
}
|
1813
1872
|
const input = {
|
@@ -3220,7 +3279,7 @@ function assembleTransactionSummary(params) {
|
|
3220
3279
|
}
|
3221
3280
|
|
3222
3281
|
// src/providers/transaction-response/transaction-response.ts
|
3223
|
-
var TransactionResponse = class
|
3282
|
+
var TransactionResponse = class {
|
3224
3283
|
/** Transaction ID */
|
3225
3284
|
id;
|
3226
3285
|
/** Current provider */
|
@@ -3248,7 +3307,7 @@ var TransactionResponse = class _TransactionResponse {
|
|
3248
3307
|
* @param provider - The provider.
|
3249
3308
|
*/
|
3250
3309
|
static async create(id, provider) {
|
3251
|
-
const response = new
|
3310
|
+
const response = new TransactionResponse(id, provider);
|
3252
3311
|
await response.fetch();
|
3253
3312
|
return response;
|
3254
3313
|
}
|
@@ -3476,7 +3535,8 @@ var processGqlChain = (chain) => {
|
|
3476
3535
|
}
|
3477
3536
|
};
|
3478
3537
|
};
|
3479
|
-
var
|
3538
|
+
var _cacheInputs, cacheInputs_fn;
|
3539
|
+
var _Provider = class {
|
3480
3540
|
/**
|
3481
3541
|
* Constructor to initialize a Provider.
|
3482
3542
|
*
|
@@ -3487,25 +3547,27 @@ var Provider = class _Provider {
|
|
3487
3547
|
*/
|
3488
3548
|
constructor(url, options = {}) {
|
3489
3549
|
this.url = url;
|
3550
|
+
/**
|
3551
|
+
* @hidden
|
3552
|
+
*/
|
3553
|
+
__privateAdd(this, _cacheInputs);
|
3554
|
+
__publicField(this, "operations");
|
3555
|
+
__publicField(this, "cache");
|
3556
|
+
__publicField(this, "options", {
|
3557
|
+
timeout: void 0,
|
3558
|
+
cacheUtxo: void 0,
|
3559
|
+
fetch: void 0,
|
3560
|
+
retryOptions: void 0
|
3561
|
+
});
|
3490
3562
|
this.options = { ...this.options, ...options };
|
3491
3563
|
this.url = url;
|
3492
3564
|
this.operations = this.createOperations();
|
3493
3565
|
this.cache = options.cacheUtxo ? new MemoryCache(options.cacheUtxo) : void 0;
|
3494
3566
|
}
|
3495
|
-
operations;
|
3496
|
-
cache;
|
3497
3567
|
static clearChainAndNodeCaches() {
|
3498
3568
|
_Provider.nodeInfoCache = {};
|
3499
3569
|
_Provider.chainInfoCache = {};
|
3500
3570
|
}
|
3501
|
-
static chainInfoCache = {};
|
3502
|
-
static nodeInfoCache = {};
|
3503
|
-
options = {
|
3504
|
-
timeout: void 0,
|
3505
|
-
cacheUtxo: void 0,
|
3506
|
-
fetch: void 0,
|
3507
|
-
retryOptions: void 0
|
3508
|
-
};
|
3509
3571
|
static getFetchFn(options) {
|
3510
3572
|
const { retryOptions, timeout } = options;
|
3511
3573
|
return autoRetryFetch(async (...args) => {
|
@@ -3702,19 +3764,6 @@ var Provider = class _Provider {
|
|
3702
3764
|
} = this.getChain();
|
3703
3765
|
return chainId.toNumber();
|
3704
3766
|
}
|
3705
|
-
/**
|
3706
|
-
* @hidden
|
3707
|
-
*/
|
3708
|
-
#cacheInputs(inputs) {
|
3709
|
-
if (!this.cache) {
|
3710
|
-
return;
|
3711
|
-
}
|
3712
|
-
inputs.forEach((input) => {
|
3713
|
-
if (input.type === InputType6.Coin) {
|
3714
|
-
this.cache?.set(input.id);
|
3715
|
-
}
|
3716
|
-
});
|
3717
|
-
}
|
3718
3767
|
/**
|
3719
3768
|
* Submits a transaction to the chain to be executed.
|
3720
3769
|
*
|
@@ -3727,7 +3776,7 @@ var Provider = class _Provider {
|
|
3727
3776
|
// #region Provider-sendTransaction
|
3728
3777
|
async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution = false } = {}) {
|
3729
3778
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
3730
|
-
this
|
3779
|
+
__privateMethod(this, _cacheInputs, cacheInputs_fn).call(this, transactionRequest.inputs);
|
3731
3780
|
if (estimateTxDependencies) {
|
3732
3781
|
await this.estimateTxDependencies(transactionRequest);
|
3733
3782
|
}
|
@@ -3904,7 +3953,8 @@ var Provider = class _Provider {
|
|
3904
3953
|
async getTransactionCost(transactionRequestLike, forwardingQuantities = [], {
|
3905
3954
|
estimateTxDependencies = true,
|
3906
3955
|
estimatePredicates = true,
|
3907
|
-
resourcesOwner
|
3956
|
+
resourcesOwner,
|
3957
|
+
signatureCallback
|
3908
3958
|
} = {}) {
|
3909
3959
|
const txRequestClone = clone3(transactionRequestify(transactionRequestLike));
|
3910
3960
|
const chainInfo = this.getChain();
|
@@ -3923,6 +3973,9 @@ var Provider = class _Provider {
|
|
3923
3973
|
}
|
3924
3974
|
await this.estimatePredicates(txRequestClone);
|
3925
3975
|
}
|
3976
|
+
if (signatureCallback && isScriptTransaction) {
|
3977
|
+
await signatureCallback(txRequestClone);
|
3978
|
+
}
|
3926
3979
|
const minGas = txRequestClone.calculateMinGas(chainInfo);
|
3927
3980
|
const maxGas = txRequestClone.calculateMaxGas(chainInfo, minGas);
|
3928
3981
|
let receipts = [];
|
@@ -4352,6 +4405,20 @@ var Provider = class _Provider {
|
|
4352
4405
|
return new TransactionResponse(transactionId, this);
|
4353
4406
|
}
|
4354
4407
|
};
|
4408
|
+
var Provider = _Provider;
|
4409
|
+
_cacheInputs = new WeakSet();
|
4410
|
+
cacheInputs_fn = function(inputs) {
|
4411
|
+
if (!this.cache) {
|
4412
|
+
return;
|
4413
|
+
}
|
4414
|
+
inputs.forEach((input) => {
|
4415
|
+
if (input.type === InputType6.Coin) {
|
4416
|
+
this.cache?.set(input.id);
|
4417
|
+
}
|
4418
|
+
});
|
4419
|
+
};
|
4420
|
+
__publicField(Provider, "chainInfoCache", {});
|
4421
|
+
__publicField(Provider, "nodeInfoCache", {});
|
4355
4422
|
|
4356
4423
|
// src/providers/transaction-summary/get-transaction-summary.ts
|
4357
4424
|
import { ErrorCode as ErrorCode13, FuelError as FuelError13 } from "@fuel-ts/errors";
|
@@ -4956,6 +5023,21 @@ var Account = class extends AbstractAccount {
|
|
4956
5023
|
}
|
4957
5024
|
return this._connector.signMessage(this.address.toString(), message);
|
4958
5025
|
}
|
5026
|
+
/**
|
5027
|
+
* Signs a transaction with the wallet's private key.
|
5028
|
+
*
|
5029
|
+
* @param transactionRequestLike - The transaction request to sign.
|
5030
|
+
* @returns A promise that resolves to the signature of the transaction.
|
5031
|
+
*/
|
5032
|
+
async signTransaction(transactionRequestLike) {
|
5033
|
+
if (!this._connector) {
|
5034
|
+
throw new FuelError14(
|
5035
|
+
ErrorCode14.MISSING_CONNECTOR,
|
5036
|
+
"A connector is required to sign transactions."
|
5037
|
+
);
|
5038
|
+
}
|
5039
|
+
return this._connector.signTransaction(this.address.toString(), transactionRequestLike);
|
5040
|
+
}
|
4959
5041
|
/**
|
4960
5042
|
* Sends a transaction to the network.
|
4961
5043
|
*
|
@@ -5022,7 +5104,7 @@ import { hash } from "@fuel-ts/hasher";
|
|
5022
5104
|
import { toBytes } from "@fuel-ts/math";
|
5023
5105
|
import { hexlify as hexlify13, concat as concat3, arrayify as arrayify15 } from "@fuel-ts/utils";
|
5024
5106
|
import { secp256k1 } from "@noble/curves/secp256k1";
|
5025
|
-
var Signer = class
|
5107
|
+
var Signer = class {
|
5026
5108
|
address;
|
5027
5109
|
publicKey;
|
5028
5110
|
compressedPublicKey;
|
@@ -5101,7 +5183,7 @@ var Signer = class _Signer {
|
|
5101
5183
|
* @returns Address from signature
|
5102
5184
|
*/
|
5103
5185
|
static recoverAddress(data, signature) {
|
5104
|
-
return Address4.fromPublicKey(
|
5186
|
+
return Address4.fromPublicKey(Signer.recoverPublicKey(data, signature));
|
5105
5187
|
}
|
5106
5188
|
/**
|
5107
5189
|
* Generate a random privateKey
|
@@ -5225,10 +5307,6 @@ async function decryptKeystoreWallet(jsonWallet, password) {
|
|
5225
5307
|
|
5226
5308
|
// src/wallet/base-wallet-unlocked.ts
|
5227
5309
|
var BaseWalletUnlocked = class extends Account {
|
5228
|
-
/**
|
5229
|
-
* Default HDWallet path.
|
5230
|
-
*/
|
5231
|
-
static defaultPath = "m/44'/1179993420'/0'/0/0";
|
5232
5310
|
/**
|
5233
5311
|
* A function that returns the wallet's signer.
|
5234
5312
|
*/
|
@@ -5278,7 +5356,7 @@ var BaseWalletUnlocked = class extends Account {
|
|
5278
5356
|
*/
|
5279
5357
|
async signTransaction(transactionRequestLike) {
|
5280
5358
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
5281
|
-
const chainId = this.provider.
|
5359
|
+
const chainId = this.provider.getChainId();
|
5282
5360
|
const hashedTransaction = transactionRequest.getTransactionId(chainId);
|
5283
5361
|
const signature = await this.signer().sign(hashedTransaction);
|
5284
5362
|
return hexlify15(signature);
|
@@ -5334,6 +5412,10 @@ var BaseWalletUnlocked = class extends Account {
|
|
5334
5412
|
return encryptKeystoreWallet(this.privateKey, this.address, password);
|
5335
5413
|
}
|
5336
5414
|
};
|
5415
|
+
/**
|
5416
|
+
* Default HDWallet path.
|
5417
|
+
*/
|
5418
|
+
__publicField(BaseWalletUnlocked, "defaultPath", "m/44'/1179993420'/0'/0/0");
|
5337
5419
|
|
5338
5420
|
// src/hdwallet/hdwallet.ts
|
5339
5421
|
import { ErrorCode as ErrorCode18, FuelError as FuelError18 } from "@fuel-ts/errors";
|
@@ -7543,7 +7625,7 @@ function assertMnemonic(words) {
|
|
7543
7625
|
throw new FuelError17(ErrorCode17.INVALID_MNEMONIC, errorMsg);
|
7544
7626
|
}
|
7545
7627
|
}
|
7546
|
-
var Mnemonic = class
|
7628
|
+
var Mnemonic = class {
|
7547
7629
|
wordlist;
|
7548
7630
|
/**
|
7549
7631
|
*
|
@@ -7560,7 +7642,7 @@ var Mnemonic = class _Mnemonic {
|
|
7560
7642
|
* @returns Entropy hash
|
7561
7643
|
*/
|
7562
7644
|
mnemonicToEntropy(phrase) {
|
7563
|
-
return
|
7645
|
+
return Mnemonic.mnemonicToEntropy(phrase, this.wordlist);
|
7564
7646
|
}
|
7565
7647
|
/**
|
7566
7648
|
*
|
@@ -7568,7 +7650,7 @@ var Mnemonic = class _Mnemonic {
|
|
7568
7650
|
* @returns Mnemonic phrase
|
7569
7651
|
*/
|
7570
7652
|
entropyToMnemonic(entropy) {
|
7571
|
-
return
|
7653
|
+
return Mnemonic.entropyToMnemonic(entropy, this.wordlist);
|
7572
7654
|
}
|
7573
7655
|
/**
|
7574
7656
|
*
|
@@ -7609,8 +7691,8 @@ var Mnemonic = class _Mnemonic {
|
|
7609
7691
|
* @returns 64-byte array contains privateKey and chainCode as described on BIP39
|
7610
7692
|
*/
|
7611
7693
|
static mnemonicToMasterKeys(phrase, passphrase = "") {
|
7612
|
-
const seed =
|
7613
|
-
return
|
7694
|
+
const seed = Mnemonic.mnemonicToSeed(phrase, passphrase);
|
7695
|
+
return Mnemonic.masterKeysFromSeed(seed);
|
7614
7696
|
}
|
7615
7697
|
/**
|
7616
7698
|
* Validates if given mnemonic is valid
|
@@ -7626,7 +7708,7 @@ var Mnemonic = class _Mnemonic {
|
|
7626
7708
|
return false;
|
7627
7709
|
}
|
7628
7710
|
while (i < words.length) {
|
7629
|
-
if (
|
7711
|
+
if (Mnemonic.binarySearch(words[i]) === false) {
|
7630
7712
|
return false;
|
7631
7713
|
}
|
7632
7714
|
i += 1;
|
@@ -7673,7 +7755,7 @@ var Mnemonic = class _Mnemonic {
|
|
7673
7755
|
* @returns BIP-32 extended private key
|
7674
7756
|
*/
|
7675
7757
|
static seedToExtendedKey(seed, testnet = false) {
|
7676
|
-
const masterKey =
|
7758
|
+
const masterKey = Mnemonic.masterKeysFromSeed(seed);
|
7677
7759
|
const prefix = arrayify17(testnet ? TestnetPRV : MainnetPRV);
|
7678
7760
|
const depth = "0x00";
|
7679
7761
|
const fingerprint = "0x00000000";
|
@@ -7705,7 +7787,7 @@ var Mnemonic = class _Mnemonic {
|
|
7705
7787
|
*/
|
7706
7788
|
static generate(size = 32, extraEntropy = "") {
|
7707
7789
|
const entropy = extraEntropy ? sha2563(concat4([randomBytes3(size), arrayify17(extraEntropy)])) : randomBytes3(size);
|
7708
|
-
return
|
7790
|
+
return Mnemonic.entropyToMnemonic(entropy);
|
7709
7791
|
}
|
7710
7792
|
};
|
7711
7793
|
var mnemonic_default = Mnemonic;
|
@@ -7745,7 +7827,7 @@ function parsePath(path, depth = 0) {
|
|
7745
7827
|
(p) => ~p.indexOf(`'`) ? parseInt(p, 10) + HARDENED_INDEX : parseInt(p, 10)
|
7746
7828
|
);
|
7747
7829
|
}
|
7748
|
-
var HDWallet = class
|
7830
|
+
var HDWallet = class {
|
7749
7831
|
depth = 0;
|
7750
7832
|
index = 0;
|
7751
7833
|
fingerprint = hexlify17("0x00000000");
|
@@ -7811,7 +7893,7 @@ var HDWallet = class _HDWallet {
|
|
7811
7893
|
if (privateKey) {
|
7812
7894
|
const N = "0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141";
|
7813
7895
|
const ki = bn17(IL).add(privateKey).mod(N).toBytes(32);
|
7814
|
-
return new
|
7896
|
+
return new HDWallet({
|
7815
7897
|
privateKey: ki,
|
7816
7898
|
chainCode: IR,
|
7817
7899
|
index,
|
@@ -7821,7 +7903,7 @@ var HDWallet = class _HDWallet {
|
|
7821
7903
|
}
|
7822
7904
|
const signer = new Signer(hexlify17(IL));
|
7823
7905
|
const Ki = signer.addPoint(publicKey);
|
7824
|
-
return new
|
7906
|
+
return new HDWallet({
|
7825
7907
|
publicKey: Ki,
|
7826
7908
|
chainCode: IR,
|
7827
7909
|
index,
|
@@ -7870,7 +7952,7 @@ var HDWallet = class _HDWallet {
|
|
7870
7952
|
*/
|
7871
7953
|
static fromSeed(seed) {
|
7872
7954
|
const masterKey = mnemonic_default.masterKeysFromSeed(seed);
|
7873
|
-
return new
|
7955
|
+
return new HDWallet({
|
7874
7956
|
chainCode: arrayify18(masterKey.slice(32)),
|
7875
7957
|
privateKey: arrayify18(masterKey.slice(0, 32))
|
7876
7958
|
});
|
@@ -7900,7 +7982,7 @@ var HDWallet = class _HDWallet {
|
|
7900
7982
|
if (key[0] !== 3) {
|
7901
7983
|
throw new FuelError18(ErrorCode18.HD_WALLET_ERROR, "Invalid public extended key.");
|
7902
7984
|
}
|
7903
|
-
return new
|
7985
|
+
return new HDWallet({
|
7904
7986
|
publicKey: key,
|
7905
7987
|
chainCode,
|
7906
7988
|
index,
|
@@ -7911,7 +7993,7 @@ var HDWallet = class _HDWallet {
|
|
7911
7993
|
if (key[0] !== 0) {
|
7912
7994
|
throw new FuelError18(ErrorCode18.HD_WALLET_ERROR, "Invalid private extended key.");
|
7913
7995
|
}
|
7914
|
-
return new
|
7996
|
+
return new HDWallet({
|
7915
7997
|
privateKey: key.slice(1),
|
7916
7998
|
chainCode,
|
7917
7999
|
index,
|
@@ -7934,7 +8016,7 @@ var WalletLocked = class extends Account {
|
|
7934
8016
|
return new WalletUnlocked(privateKey, this._provider);
|
7935
8017
|
}
|
7936
8018
|
};
|
7937
|
-
var WalletUnlocked = class
|
8019
|
+
var WalletUnlocked = class extends BaseWalletUnlocked {
|
7938
8020
|
/**
|
7939
8021
|
* Locks the wallet and returns an instance of WalletLocked.
|
7940
8022
|
*
|
@@ -7952,7 +8034,7 @@ var WalletUnlocked = class _WalletUnlocked extends BaseWalletUnlocked {
|
|
7952
8034
|
*/
|
7953
8035
|
static generate(generateOptions) {
|
7954
8036
|
const privateKey = Signer.generatePrivateKey(generateOptions?.entropy);
|
7955
|
-
return new
|
8037
|
+
return new WalletUnlocked(privateKey, generateOptions?.provider);
|
7956
8038
|
}
|
7957
8039
|
/**
|
7958
8040
|
* Create a Wallet Unlocked from a seed.
|
@@ -7964,8 +8046,8 @@ var WalletUnlocked = class _WalletUnlocked extends BaseWalletUnlocked {
|
|
7964
8046
|
*/
|
7965
8047
|
static fromSeed(seed, path, provider) {
|
7966
8048
|
const hdWallet = hdwallet_default.fromSeed(seed);
|
7967
|
-
const childWallet = hdWallet.derivePath(path ||
|
7968
|
-
return new
|
8049
|
+
const childWallet = hdWallet.derivePath(path || WalletUnlocked.defaultPath);
|
8050
|
+
return new WalletUnlocked(childWallet.privateKey, provider);
|
7969
8051
|
}
|
7970
8052
|
/**
|
7971
8053
|
* Create a Wallet Unlocked from a mnemonic phrase.
|
@@ -7979,8 +8061,8 @@ var WalletUnlocked = class _WalletUnlocked extends BaseWalletUnlocked {
|
|
7979
8061
|
static fromMnemonic(mnemonic, path, passphrase, provider) {
|
7980
8062
|
const seed = mnemonic_default.mnemonicToSeed(mnemonic, passphrase);
|
7981
8063
|
const hdWallet = hdwallet_default.fromSeed(seed);
|
7982
|
-
const childWallet = hdWallet.derivePath(path ||
|
7983
|
-
return new
|
8064
|
+
const childWallet = hdWallet.derivePath(path || WalletUnlocked.defaultPath);
|
8065
|
+
return new WalletUnlocked(childWallet.privateKey, provider);
|
7984
8066
|
}
|
7985
8067
|
/**
|
7986
8068
|
* Create a Wallet Unlocked from an extended key.
|
@@ -7991,7 +8073,7 @@ var WalletUnlocked = class _WalletUnlocked extends BaseWalletUnlocked {
|
|
7991
8073
|
*/
|
7992
8074
|
static fromExtendedKey(extendedKey, provider) {
|
7993
8075
|
const hdWallet = hdwallet_default.fromExtendedKey(extendedKey);
|
7994
|
-
return new
|
8076
|
+
return new WalletUnlocked(hdWallet.privateKey, provider);
|
7995
8077
|
}
|
7996
8078
|
/**
|
7997
8079
|
* Create a Wallet Unlocked from an encrypted JSON.
|
@@ -8003,7 +8085,7 @@ var WalletUnlocked = class _WalletUnlocked extends BaseWalletUnlocked {
|
|
8003
8085
|
*/
|
8004
8086
|
static async fromEncryptedJson(jsonWallet, password, provider) {
|
8005
8087
|
const privateKey = await decryptKeystoreWallet(jsonWallet, password);
|
8006
|
-
return new
|
8088
|
+
return new WalletUnlocked(privateKey, provider);
|
8007
8089
|
}
|
8008
8090
|
};
|
8009
8091
|
|
@@ -8029,50 +8111,50 @@ var Wallet = class {
|
|
8029
8111
|
static fromPrivateKey(privateKey, provider) {
|
8030
8112
|
return new WalletUnlocked(privateKey, provider);
|
8031
8113
|
}
|
8032
|
-
/**
|
8033
|
-
* Generate a new Wallet Unlocked with a random key pair.
|
8034
|
-
*
|
8035
|
-
* @param generateOptions - Options to customize the generation process (optional).
|
8036
|
-
* @returns An unlocked wallet instance.
|
8037
|
-
*/
|
8038
|
-
static generate = WalletUnlocked.generate;
|
8039
|
-
/**
|
8040
|
-
* Create a Wallet Unlocked from a seed.
|
8041
|
-
*
|
8042
|
-
* @param seed - The seed phrase.
|
8043
|
-
* @param provider - A Provider instance (optional).
|
8044
|
-
* @param path - The derivation path (optional).
|
8045
|
-
* @returns An unlocked wallet instance.
|
8046
|
-
*/
|
8047
|
-
static fromSeed = WalletUnlocked.fromSeed;
|
8048
|
-
/**
|
8049
|
-
* Create a Wallet Unlocked from a mnemonic phrase.
|
8050
|
-
*
|
8051
|
-
* @param mnemonic - The mnemonic phrase.
|
8052
|
-
* @param provider - A Provider instance (optional).
|
8053
|
-
* @param path - The derivation path (optional).
|
8054
|
-
* @param passphrase - The passphrase for the mnemonic (optional).
|
8055
|
-
* @returns An unlocked wallet instance.
|
8056
|
-
*/
|
8057
|
-
static fromMnemonic = WalletUnlocked.fromMnemonic;
|
8058
|
-
/**
|
8059
|
-
* Create a Wallet Unlocked from an extended key.
|
8060
|
-
*
|
8061
|
-
* @param extendedKey - The extended key.
|
8062
|
-
* @param provider - A Provider instance (optional).
|
8063
|
-
* @returns An unlocked wallet instance.
|
8064
|
-
*/
|
8065
|
-
static fromExtendedKey = WalletUnlocked.fromExtendedKey;
|
8066
|
-
/**
|
8067
|
-
* Create a Wallet Unlocked from an encrypted JSON.
|
8068
|
-
*
|
8069
|
-
* @param jsonWallet - The encrypted JSON keystore.
|
8070
|
-
* @param password - The password to decrypt the JSON.
|
8071
|
-
* @param provider - A Provider instance (optional).
|
8072
|
-
* @returns An unlocked wallet instance.
|
8073
|
-
*/
|
8074
|
-
static fromEncryptedJson = WalletUnlocked.fromEncryptedJson;
|
8075
8114
|
};
|
8115
|
+
/**
|
8116
|
+
* Generate a new Wallet Unlocked with a random key pair.
|
8117
|
+
*
|
8118
|
+
* @param generateOptions - Options to customize the generation process (optional).
|
8119
|
+
* @returns An unlocked wallet instance.
|
8120
|
+
*/
|
8121
|
+
__publicField(Wallet, "generate", WalletUnlocked.generate);
|
8122
|
+
/**
|
8123
|
+
* Create a Wallet Unlocked from a seed.
|
8124
|
+
*
|
8125
|
+
* @param seed - The seed phrase.
|
8126
|
+
* @param provider - A Provider instance (optional).
|
8127
|
+
* @param path - The derivation path (optional).
|
8128
|
+
* @returns An unlocked wallet instance.
|
8129
|
+
*/
|
8130
|
+
__publicField(Wallet, "fromSeed", WalletUnlocked.fromSeed);
|
8131
|
+
/**
|
8132
|
+
* Create a Wallet Unlocked from a mnemonic phrase.
|
8133
|
+
*
|
8134
|
+
* @param mnemonic - The mnemonic phrase.
|
8135
|
+
* @param provider - A Provider instance (optional).
|
8136
|
+
* @param path - The derivation path (optional).
|
8137
|
+
* @param passphrase - The passphrase for the mnemonic (optional).
|
8138
|
+
* @returns An unlocked wallet instance.
|
8139
|
+
*/
|
8140
|
+
__publicField(Wallet, "fromMnemonic", WalletUnlocked.fromMnemonic);
|
8141
|
+
/**
|
8142
|
+
* Create a Wallet Unlocked from an extended key.
|
8143
|
+
*
|
8144
|
+
* @param extendedKey - The extended key.
|
8145
|
+
* @param provider - A Provider instance (optional).
|
8146
|
+
* @returns An unlocked wallet instance.
|
8147
|
+
*/
|
8148
|
+
__publicField(Wallet, "fromExtendedKey", WalletUnlocked.fromExtendedKey);
|
8149
|
+
/**
|
8150
|
+
* Create a Wallet Unlocked from an encrypted JSON.
|
8151
|
+
*
|
8152
|
+
* @param jsonWallet - The encrypted JSON keystore.
|
8153
|
+
* @param password - The password to decrypt the JSON.
|
8154
|
+
* @param provider - A Provider instance (optional).
|
8155
|
+
* @returns An unlocked wallet instance.
|
8156
|
+
*/
|
8157
|
+
__publicField(Wallet, "fromEncryptedJson", WalletUnlocked.fromEncryptedJson);
|
8076
8158
|
|
8077
8159
|
// src/wallet-manager/wallet-manager.ts
|
8078
8160
|
import { Address as Address8 } from "@fuel-ts/address";
|
@@ -8101,14 +8183,14 @@ var MemoryStorage = class {
|
|
8101
8183
|
// src/wallet-manager/vaults/mnemonic-vault.ts
|
8102
8184
|
import { Address as Address6 } from "@fuel-ts/address";
|
8103
8185
|
import { ErrorCode as ErrorCode19, FuelError as FuelError19 } from "@fuel-ts/errors";
|
8186
|
+
var _secret;
|
8104
8187
|
var MnemonicVault = class {
|
8105
|
-
static type = "mnemonic";
|
8106
|
-
#secret;
|
8107
|
-
pathKey = "{}";
|
8108
|
-
rootPath = `m/44'/1179993420'/${this.pathKey}'/0/0`;
|
8109
|
-
numberOfAccounts = 0;
|
8110
8188
|
constructor(options) {
|
8111
|
-
this
|
8189
|
+
__privateAdd(this, _secret, void 0);
|
8190
|
+
__publicField(this, "pathKey", "{}");
|
8191
|
+
__publicField(this, "rootPath", `m/44'/1179993420'/${this.pathKey}'/0/0`);
|
8192
|
+
__publicField(this, "numberOfAccounts", 0);
|
8193
|
+
__privateSet(this, _secret, options.secret || mnemonic_default.generate());
|
8112
8194
|
this.rootPath = options.rootPath || this.rootPath;
|
8113
8195
|
this.numberOfAccounts = options.numberOfAccounts || 1;
|
8114
8196
|
}
|
@@ -8120,7 +8202,7 @@ var MnemonicVault = class {
|
|
8120
8202
|
}
|
8121
8203
|
serialize() {
|
8122
8204
|
return {
|
8123
|
-
secret: this
|
8205
|
+
secret: __privateGet(this, _secret),
|
8124
8206
|
rootPath: this.rootPath,
|
8125
8207
|
numberOfAccounts: this.numberOfAccounts
|
8126
8208
|
};
|
@@ -8129,7 +8211,7 @@ var MnemonicVault = class {
|
|
8129
8211
|
const accounts = [];
|
8130
8212
|
let numberOfAccounts = 0;
|
8131
8213
|
do {
|
8132
|
-
const wallet = Wallet.fromMnemonic(this
|
8214
|
+
const wallet = Wallet.fromMnemonic(__privateGet(this, _secret), this.getDerivePath(numberOfAccounts));
|
8133
8215
|
accounts.push({
|
8134
8216
|
publicKey: wallet.publicKey,
|
8135
8217
|
address: wallet.address
|
@@ -8140,7 +8222,7 @@ var MnemonicVault = class {
|
|
8140
8222
|
}
|
8141
8223
|
addAccount() {
|
8142
8224
|
this.numberOfAccounts += 1;
|
8143
|
-
const wallet = Wallet.fromMnemonic(this
|
8225
|
+
const wallet = Wallet.fromMnemonic(__privateGet(this, _secret), this.getDerivePath(this.numberOfAccounts - 1));
|
8144
8226
|
return {
|
8145
8227
|
publicKey: wallet.publicKey,
|
8146
8228
|
address: wallet.address
|
@@ -8150,7 +8232,7 @@ var MnemonicVault = class {
|
|
8150
8232
|
let numberOfAccounts = 0;
|
8151
8233
|
const ownerAddress = Address6.fromAddressOrString(address);
|
8152
8234
|
do {
|
8153
|
-
const wallet = Wallet.fromMnemonic(this
|
8235
|
+
const wallet = Wallet.fromMnemonic(__privateGet(this, _secret), this.getDerivePath(numberOfAccounts));
|
8154
8236
|
if (wallet.address.equals(ownerAddress)) {
|
8155
8237
|
return wallet.privateKey;
|
8156
8238
|
}
|
@@ -8166,27 +8248,29 @@ var MnemonicVault = class {
|
|
8166
8248
|
return Wallet.fromPrivateKey(privateKey);
|
8167
8249
|
}
|
8168
8250
|
};
|
8251
|
+
_secret = new WeakMap();
|
8252
|
+
__publicField(MnemonicVault, "type", "mnemonic");
|
8169
8253
|
|
8170
8254
|
// src/wallet-manager/vaults/privatekey-vault.ts
|
8171
8255
|
import { Address as Address7 } from "@fuel-ts/address";
|
8172
8256
|
import { ErrorCode as ErrorCode20, FuelError as FuelError20 } from "@fuel-ts/errors";
|
8257
|
+
var _privateKeys;
|
8173
8258
|
var PrivateKeyVault = class {
|
8174
|
-
static type = "privateKey";
|
8175
|
-
#privateKeys = [];
|
8176
8259
|
/**
|
8177
8260
|
* If privateKey vault is initialized with a secretKey, it creates
|
8178
8261
|
* one account with the fallowing secret
|
8179
8262
|
*/
|
8180
8263
|
constructor(options = {}) {
|
8264
|
+
__privateAdd(this, _privateKeys, []);
|
8181
8265
|
if (options.secret) {
|
8182
|
-
this
|
8266
|
+
__privateSet(this, _privateKeys, [options.secret]);
|
8183
8267
|
} else {
|
8184
|
-
this
|
8268
|
+
__privateSet(this, _privateKeys, options.accounts || [Wallet.generate().privateKey]);
|
8185
8269
|
}
|
8186
8270
|
}
|
8187
8271
|
serialize() {
|
8188
8272
|
return {
|
8189
|
-
accounts: this
|
8273
|
+
accounts: __privateGet(this, _privateKeys)
|
8190
8274
|
};
|
8191
8275
|
}
|
8192
8276
|
getPublicAccount(privateKey) {
|
@@ -8197,16 +8281,16 @@ var PrivateKeyVault = class {
|
|
8197
8281
|
};
|
8198
8282
|
}
|
8199
8283
|
getAccounts() {
|
8200
|
-
return this
|
8284
|
+
return __privateGet(this, _privateKeys).map((pk) => this.getPublicAccount(pk));
|
8201
8285
|
}
|
8202
8286
|
addAccount() {
|
8203
8287
|
const wallet = Wallet.generate();
|
8204
|
-
this
|
8288
|
+
__privateGet(this, _privateKeys).push(wallet.privateKey);
|
8205
8289
|
return this.getPublicAccount(wallet.privateKey);
|
8206
8290
|
}
|
8207
8291
|
exportAccount(address) {
|
8208
8292
|
const ownerAddress = Address7.fromAddressOrString(address);
|
8209
|
-
const privateKey = this
|
8293
|
+
const privateKey = __privateGet(this, _privateKeys).find(
|
8210
8294
|
(pk) => Wallet.fromPrivateKey(pk).address.equals(ownerAddress)
|
8211
8295
|
);
|
8212
8296
|
if (!privateKey) {
|
@@ -8222,6 +8306,8 @@ var PrivateKeyVault = class {
|
|
8222
8306
|
return Wallet.fromPrivateKey(privateKey);
|
8223
8307
|
}
|
8224
8308
|
};
|
8309
|
+
_privateKeys = new WeakMap();
|
8310
|
+
__publicField(PrivateKeyVault, "type", "privateKey");
|
8225
8311
|
|
8226
8312
|
// src/wallet-manager/wallet-manager.ts
|
8227
8313
|
var ERROR_MESSAGES = {
|
@@ -8236,43 +8322,46 @@ function assert(condition, message) {
|
|
8236
8322
|
throw new FuelError21(ErrorCode21.WALLET_MANAGER_ERROR, message);
|
8237
8323
|
}
|
8238
8324
|
}
|
8239
|
-
var
|
8240
|
-
|
8241
|
-
* Vaults
|
8242
|
-
*
|
8243
|
-
* Vaults are responsible to store secret keys and return an `Wallet` instance,
|
8244
|
-
* to interact with the network.
|
8245
|
-
*
|
8246
|
-
* Each vault has access to its own state
|
8247
|
-
*
|
8248
|
-
*/
|
8249
|
-
static Vaults = [MnemonicVault, PrivateKeyVault];
|
8250
|
-
/**
|
8251
|
-
* Storage
|
8252
|
-
*
|
8253
|
-
* Persistent encrypted data. `The default storage works only on memory`.
|
8254
|
-
*/
|
8255
|
-
storage = new MemoryStorage();
|
8256
|
-
/* Key name passed to the storage */
|
8257
|
-
STORAGE_KEY = "WalletManager";
|
8258
|
-
// `This variables are only accessible from inside the class`
|
8259
|
-
#vaults = [];
|
8260
|
-
#passphrase = "";
|
8261
|
-
#isLocked = true;
|
8325
|
+
var _vaults, _passphrase, _isLocked, _serializeVaults, serializeVaults_fn, _deserializeVaults, deserializeVaults_fn;
|
8326
|
+
var _WalletManager = class extends EventEmitter {
|
8262
8327
|
constructor(options) {
|
8263
8328
|
super();
|
8329
|
+
/**
|
8330
|
+
* Serialize all vaults to store
|
8331
|
+
*
|
8332
|
+
* `This is only accessible from inside the class`
|
8333
|
+
*/
|
8334
|
+
__privateAdd(this, _serializeVaults);
|
8335
|
+
/**
|
8336
|
+
* Deserialize all vaults to state
|
8337
|
+
*
|
8338
|
+
* `This is only accessible from inside the class`
|
8339
|
+
*/
|
8340
|
+
__privateAdd(this, _deserializeVaults);
|
8341
|
+
/**
|
8342
|
+
* Storage
|
8343
|
+
*
|
8344
|
+
* Persistent encrypted data. `The default storage works only on memory`.
|
8345
|
+
*/
|
8346
|
+
__publicField(this, "storage", new MemoryStorage());
|
8347
|
+
/* Key name passed to the storage */
|
8348
|
+
__publicField(this, "STORAGE_KEY", "WalletManager");
|
8349
|
+
// `This variables are only accessible from inside the class`
|
8350
|
+
__privateAdd(this, _vaults, []);
|
8351
|
+
__privateAdd(this, _passphrase, "");
|
8352
|
+
__privateAdd(this, _isLocked, true);
|
8264
8353
|
this.storage = options?.storage || this.storage;
|
8265
8354
|
}
|
8266
8355
|
get isLocked() {
|
8267
|
-
return this
|
8356
|
+
return __privateGet(this, _isLocked);
|
8268
8357
|
}
|
8269
8358
|
/**
|
8270
8359
|
* Return the vault serialized object containing all the privateKeys,
|
8271
8360
|
* the format of the return depends on the Vault type.
|
8272
8361
|
*/
|
8273
8362
|
exportVault(vaultId) {
|
8274
|
-
assert(!this
|
8275
|
-
const vaultState = this
|
8363
|
+
assert(!__privateGet(this, _isLocked), ERROR_MESSAGES.wallet_not_unlocked);
|
8364
|
+
const vaultState = __privateGet(this, _vaults).find((_, idx) => idx === vaultId);
|
8276
8365
|
assert(vaultState, ERROR_MESSAGES.vault_not_found);
|
8277
8366
|
return vaultState.vault.serialize();
|
8278
8367
|
}
|
@@ -8280,7 +8369,7 @@ var WalletManager = class _WalletManager extends EventEmitter {
|
|
8280
8369
|
* List all vaults on the Wallet Manager, this function not return secret's
|
8281
8370
|
*/
|
8282
8371
|
getVaults() {
|
8283
|
-
return this
|
8372
|
+
return __privateGet(this, _vaults).map((v, idx) => ({
|
8284
8373
|
title: v.title,
|
8285
8374
|
type: v.type,
|
8286
8375
|
vaultId: idx
|
@@ -8290,7 +8379,7 @@ var WalletManager = class _WalletManager extends EventEmitter {
|
|
8290
8379
|
* List all accounts on the Wallet Manager not vault information is revealed
|
8291
8380
|
*/
|
8292
8381
|
getAccounts() {
|
8293
|
-
return this
|
8382
|
+
return __privateGet(this, _vaults).flatMap(
|
8294
8383
|
(vaultState, vaultId) => vaultState.vault.getAccounts().map((account) => ({ ...account, vaultId }))
|
8295
8384
|
);
|
8296
8385
|
}
|
@@ -8299,7 +8388,7 @@ var WalletManager = class _WalletManager extends EventEmitter {
|
|
8299
8388
|
*/
|
8300
8389
|
getWallet(address) {
|
8301
8390
|
const ownerAddress = Address8.fromAddressOrString(address);
|
8302
|
-
const vaultState = this
|
8391
|
+
const vaultState = __privateGet(this, _vaults).find(
|
8303
8392
|
(vs) => vs.vault.getAccounts().find((a) => a.address.equals(ownerAddress))
|
8304
8393
|
);
|
8305
8394
|
assert(vaultState, ERROR_MESSAGES.address_not_found);
|
@@ -8310,8 +8399,8 @@ var WalletManager = class _WalletManager extends EventEmitter {
|
|
8310
8399
|
*/
|
8311
8400
|
exportPrivateKey(address) {
|
8312
8401
|
const ownerAddress = Address8.fromAddressOrString(address);
|
8313
|
-
assert(!this
|
8314
|
-
const vaultState = this
|
8402
|
+
assert(!__privateGet(this, _isLocked), ERROR_MESSAGES.wallet_not_unlocked);
|
8403
|
+
const vaultState = __privateGet(this, _vaults).find(
|
8315
8404
|
(vs) => vs.vault.getAccounts().find((a) => a.address.equals(ownerAddress))
|
8316
8405
|
);
|
8317
8406
|
assert(vaultState, ERROR_MESSAGES.address_not_found);
|
@@ -8323,7 +8412,7 @@ var WalletManager = class _WalletManager extends EventEmitter {
|
|
8323
8412
|
*/
|
8324
8413
|
async addAccount(options) {
|
8325
8414
|
await this.loadState();
|
8326
|
-
const vaultState = this
|
8415
|
+
const vaultState = __privateGet(this, _vaults)[options?.vaultId || 0];
|
8327
8416
|
await assert(vaultState, ERROR_MESSAGES.vault_not_found);
|
8328
8417
|
const account = vaultState.vault.addAccount();
|
8329
8418
|
await this.saveState();
|
@@ -8334,7 +8423,7 @@ var WalletManager = class _WalletManager extends EventEmitter {
|
|
8334
8423
|
* created by the vault.
|
8335
8424
|
*/
|
8336
8425
|
async removeVault(index) {
|
8337
|
-
this
|
8426
|
+
__privateGet(this, _vaults).splice(index, 1);
|
8338
8427
|
await this.saveState();
|
8339
8428
|
}
|
8340
8429
|
/**
|
@@ -8345,11 +8434,11 @@ var WalletManager = class _WalletManager extends EventEmitter {
|
|
8345
8434
|
await this.loadState();
|
8346
8435
|
const Vault2 = this.getVaultClass(vaultConfig.type);
|
8347
8436
|
const vault = new Vault2(vaultConfig);
|
8348
|
-
this
|
8437
|
+
__privateSet(this, _vaults, __privateGet(this, _vaults).concat({
|
8349
8438
|
title: vaultConfig.title,
|
8350
8439
|
type: vaultConfig.type,
|
8351
8440
|
vault
|
8352
|
-
});
|
8441
|
+
}));
|
8353
8442
|
await this.saveState();
|
8354
8443
|
}
|
8355
8444
|
/**
|
@@ -8357,9 +8446,9 @@ var WalletManager = class _WalletManager extends EventEmitter {
|
|
8357
8446
|
* secrets.
|
8358
8447
|
*/
|
8359
8448
|
lock() {
|
8360
|
-
this
|
8361
|
-
this
|
8362
|
-
this
|
8449
|
+
__privateSet(this, _isLocked, true);
|
8450
|
+
__privateSet(this, _vaults, []);
|
8451
|
+
__privateSet(this, _passphrase, "");
|
8363
8452
|
this.emit("lock");
|
8364
8453
|
}
|
8365
8454
|
/**
|
@@ -8367,8 +8456,8 @@ var WalletManager = class _WalletManager extends EventEmitter {
|
|
8367
8456
|
* Vaults with secrets are not unlocked or instantiated on this moment.
|
8368
8457
|
*/
|
8369
8458
|
async unlock(passphrase) {
|
8370
|
-
this
|
8371
|
-
this
|
8459
|
+
__privateSet(this, _passphrase, passphrase);
|
8460
|
+
__privateSet(this, _isLocked, false);
|
8372
8461
|
try {
|
8373
8462
|
await this.loadState();
|
8374
8463
|
this.emit("unlock");
|
@@ -8381,9 +8470,9 @@ var WalletManager = class _WalletManager extends EventEmitter {
|
|
8381
8470
|
* Update WalletManager encryption passphrase
|
8382
8471
|
*/
|
8383
8472
|
async updatePassphrase(oldpass, newpass) {
|
8384
|
-
const isLocked = this
|
8473
|
+
const isLocked = __privateGet(this, _isLocked);
|
8385
8474
|
await this.unlock(oldpass);
|
8386
|
-
this
|
8475
|
+
__privateSet(this, _passphrase, newpass);
|
8387
8476
|
await this.saveState();
|
8388
8477
|
await this.loadState();
|
8389
8478
|
if (isLocked) {
|
@@ -8394,51 +8483,24 @@ var WalletManager = class _WalletManager extends EventEmitter {
|
|
8394
8483
|
* Retrieve and decrypt WalletManager state from storage
|
8395
8484
|
*/
|
8396
8485
|
async loadState() {
|
8397
|
-
await assert(!this
|
8486
|
+
await assert(!__privateGet(this, _isLocked), ERROR_MESSAGES.wallet_not_unlocked);
|
8398
8487
|
const data = await this.storage.getItem(this.STORAGE_KEY);
|
8399
8488
|
if (data) {
|
8400
|
-
const state = await decrypt(this
|
8401
|
-
this
|
8489
|
+
const state = await decrypt(__privateGet(this, _passphrase), JSON.parse(data));
|
8490
|
+
__privateSet(this, _vaults, __privateMethod(this, _deserializeVaults, deserializeVaults_fn).call(this, state.vaults));
|
8402
8491
|
}
|
8403
8492
|
}
|
8404
8493
|
/**
|
8405
8494
|
* Store encrypted WalletManager state on storage
|
8406
8495
|
*/
|
8407
8496
|
async saveState() {
|
8408
|
-
await assert(!this
|
8409
|
-
const encryptedData = await encrypt(this
|
8410
|
-
vaults: this
|
8497
|
+
await assert(!__privateGet(this, _isLocked), ERROR_MESSAGES.wallet_not_unlocked);
|
8498
|
+
const encryptedData = await encrypt(__privateGet(this, _passphrase), {
|
8499
|
+
vaults: __privateMethod(this, _serializeVaults, serializeVaults_fn).call(this, __privateGet(this, _vaults))
|
8411
8500
|
});
|
8412
8501
|
await this.storage.setItem(this.STORAGE_KEY, JSON.stringify(encryptedData));
|
8413
8502
|
this.emit("update");
|
8414
8503
|
}
|
8415
|
-
/**
|
8416
|
-
* Serialize all vaults to store
|
8417
|
-
*
|
8418
|
-
* `This is only accessible from inside the class`
|
8419
|
-
*/
|
8420
|
-
#serializeVaults(vaults) {
|
8421
|
-
return vaults.map(({ title, type, vault }) => ({
|
8422
|
-
title,
|
8423
|
-
type,
|
8424
|
-
data: vault.serialize()
|
8425
|
-
}));
|
8426
|
-
}
|
8427
|
-
/**
|
8428
|
-
* Deserialize all vaults to state
|
8429
|
-
*
|
8430
|
-
* `This is only accessible from inside the class`
|
8431
|
-
*/
|
8432
|
-
#deserializeVaults(vaults) {
|
8433
|
-
return vaults.map(({ title, type, data: vaultConfig }) => {
|
8434
|
-
const VaultClass = this.getVaultClass(type);
|
8435
|
-
return {
|
8436
|
-
title,
|
8437
|
-
type,
|
8438
|
-
vault: new VaultClass(vaultConfig)
|
8439
|
-
};
|
8440
|
-
});
|
8441
|
-
}
|
8442
8504
|
/**
|
8443
8505
|
* Return a instantiable Class reference from `WalletManager.Vaults` supported list.
|
8444
8506
|
*/
|
@@ -8448,11 +8510,43 @@ var WalletManager = class _WalletManager extends EventEmitter {
|
|
8448
8510
|
return VaultClass;
|
8449
8511
|
}
|
8450
8512
|
};
|
8513
|
+
var WalletManager = _WalletManager;
|
8514
|
+
_vaults = new WeakMap();
|
8515
|
+
_passphrase = new WeakMap();
|
8516
|
+
_isLocked = new WeakMap();
|
8517
|
+
_serializeVaults = new WeakSet();
|
8518
|
+
serializeVaults_fn = function(vaults) {
|
8519
|
+
return vaults.map(({ title, type, vault }) => ({
|
8520
|
+
title,
|
8521
|
+
type,
|
8522
|
+
data: vault.serialize()
|
8523
|
+
}));
|
8524
|
+
};
|
8525
|
+
_deserializeVaults = new WeakSet();
|
8526
|
+
deserializeVaults_fn = function(vaults) {
|
8527
|
+
return vaults.map(({ title, type, data: vaultConfig }) => {
|
8528
|
+
const VaultClass = this.getVaultClass(type);
|
8529
|
+
return {
|
8530
|
+
title,
|
8531
|
+
type,
|
8532
|
+
vault: new VaultClass(vaultConfig)
|
8533
|
+
};
|
8534
|
+
});
|
8535
|
+
};
|
8536
|
+
/**
|
8537
|
+
* Vaults
|
8538
|
+
*
|
8539
|
+
* Vaults are responsible to store secret keys and return an `Wallet` instance,
|
8540
|
+
* to interact with the network.
|
8541
|
+
*
|
8542
|
+
* Each vault has access to its own state
|
8543
|
+
*
|
8544
|
+
*/
|
8545
|
+
__publicField(WalletManager, "Vaults", [MnemonicVault, PrivateKeyVault]);
|
8451
8546
|
|
8452
8547
|
// src/wallet-manager/types.ts
|
8453
8548
|
import { ErrorCode as ErrorCode22, FuelError as FuelError22 } from "@fuel-ts/errors";
|
8454
8549
|
var Vault = class {
|
8455
|
-
static type;
|
8456
8550
|
constructor(_options) {
|
8457
8551
|
throw new FuelError22(ErrorCode22.NOT_IMPLEMENTED, "Not implemented.");
|
8458
8552
|
}
|
@@ -8472,6 +8566,7 @@ var Vault = class {
|
|
8472
8566
|
throw new FuelError22(ErrorCode22.NOT_IMPLEMENTED, "Not implemented.");
|
8473
8567
|
}
|
8474
8568
|
};
|
8569
|
+
__publicField(Vault, "type");
|
8475
8570
|
var StorageAbstract = class {
|
8476
8571
|
};
|
8477
8572
|
|
@@ -8503,7 +8598,7 @@ var getPredicateRoot = (bytecode) => {
|
|
8503
8598
|
};
|
8504
8599
|
|
8505
8600
|
// src/predicate/predicate.ts
|
8506
|
-
var Predicate = class
|
8601
|
+
var Predicate = class extends Account {
|
8507
8602
|
bytes;
|
8508
8603
|
predicateDataBytes = Uint8Array.from([]);
|
8509
8604
|
predicateData = [];
|
@@ -8524,7 +8619,7 @@ var Predicate = class _Predicate extends Account {
|
|
8524
8619
|
inputData,
|
8525
8620
|
configurableConstants
|
8526
8621
|
}) {
|
8527
|
-
const { predicateBytes, predicateInterface } =
|
8622
|
+
const { predicateBytes, predicateInterface } = Predicate.processPredicateData(
|
8528
8623
|
bytecode,
|
8529
8624
|
abi,
|
8530
8625
|
configurableConstants
|
@@ -8620,7 +8715,7 @@ var Predicate = class _Predicate extends Account {
|
|
8620
8715
|
}
|
8621
8716
|
}
|
8622
8717
|
if (configurableConstants && Object.keys(configurableConstants).length) {
|
8623
|
-
predicateBytes =
|
8718
|
+
predicateBytes = Predicate.setConfigurableConstants(
|
8624
8719
|
predicateBytes,
|
8625
8720
|
configurableConstants,
|
8626
8721
|
abiInterface
|
@@ -8808,6 +8903,18 @@ var FuelConnector = class extends EventEmitter2 {
|
|
8808
8903
|
async signMessage(_address, _message) {
|
8809
8904
|
throw new Error("Method not implemented.");
|
8810
8905
|
}
|
8906
|
+
/**
|
8907
|
+
* Should start the sign transaction process and return
|
8908
|
+
* the signed transaction.
|
8909
|
+
*
|
8910
|
+
* @param address - The address to sign the transaction
|
8911
|
+
* @param transaction - The transaction to sign
|
8912
|
+
*
|
8913
|
+
* @returns Transaction signature
|
8914
|
+
*/
|
8915
|
+
async signTransaction(_address, _transaction) {
|
8916
|
+
throw new Error("Method not implemented.");
|
8917
|
+
}
|
8811
8918
|
/**
|
8812
8919
|
* Should start the send transaction process and return
|
8813
8920
|
* the transaction id submitted to the network.
|
@@ -9000,9 +9107,7 @@ async function withTimeout(promise, timeout = 1050) {
|
|
9000
9107
|
var HAS_CONNECTOR_TIMEOUT = 2e3;
|
9001
9108
|
var PING_CACHE_TIME = 5e3;
|
9002
9109
|
var { warn } = console;
|
9003
|
-
var
|
9004
|
-
static STORAGE_KEY = "fuel-current-connector";
|
9005
|
-
static defaultConfig = {};
|
9110
|
+
var _Fuel = class extends FuelConnector {
|
9006
9111
|
_storage = null;
|
9007
9112
|
_connectors = [];
|
9008
9113
|
_targetObject = null;
|
@@ -9327,6 +9432,9 @@ var Fuel = class _Fuel extends FuelConnector {
|
|
9327
9432
|
await this.clean();
|
9328
9433
|
}
|
9329
9434
|
};
|
9435
|
+
var Fuel = _Fuel;
|
9436
|
+
__publicField(Fuel, "STORAGE_KEY", "fuel-current-connector");
|
9437
|
+
__publicField(Fuel, "defaultConfig", {});
|
9330
9438
|
export {
|
9331
9439
|
Account,
|
9332
9440
|
AddressType,
|