@txnlab/use-wallet 2.0.0-alpha.1 → 2.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -15,6 +15,12 @@ exports.PROVIDER_ID = void 0;
15
15
  PROVIDER_ID["WALLETCONNECT"] = "walletconnect";
16
16
  PROVIDER_ID["MNEMONIC"] = "mnemonic";
17
17
  })(exports.PROVIDER_ID || (exports.PROVIDER_ID = {}));
18
+ const DEFAULT_PROVIDERS = [
19
+ exports.PROVIDER_ID.PERA,
20
+ exports.PROVIDER_ID.DEFLY,
21
+ exports.PROVIDER_ID.DAFFI,
22
+ exports.PROVIDER_ID.EXODUS
23
+ ];
18
24
  const DEFAULT_NETWORK$1 = 'mainnet';
19
25
  const DEFAULT_NODE_BASEURL = 'https://mainnet-api.algonode.cloud';
20
26
  const DEFAULT_NODE_TOKEN = '';
@@ -2669,7 +2675,7 @@ const initializeProviders = async (providers, nodeConfig, algosdkStatic) => {
2669
2675
  // Initialize default providers if `providers` is undefined or empty
2670
2676
  if (!providers || providers.length === 0) {
2671
2677
  const initPromises = Object.keys(allClients)
2672
- .filter((id) => id !== exports.PROVIDER_ID.KMD && id !== exports.PROVIDER_ID.MNEMONIC && id !== exports.PROVIDER_ID.WALLETCONNECT)
2678
+ .filter((id) => DEFAULT_PROVIDERS.includes(id))
2673
2679
  .map((id) => initClient(id));
2674
2680
  await Promise.all(initPromises);
2675
2681
  }
@@ -2711,7 +2717,7 @@ function encodeNFDTransactionsArray(transactionsArray) {
2711
2717
  });
2712
2718
  }
2713
2719
 
2714
- function useInitializeProviders({ providers, nodeConfig, algosdkStatic } = {}) {
2720
+ function useInitializeProviders({ providers = [], nodeConfig, algosdkStatic } = {}) {
2715
2721
  const [walletProviders, setWalletProviders] = require$$0.useState(null);
2716
2722
  require$$0.useEffect(() => {
2717
2723
  async function initializeAndConnect() {
@@ -2736,6 +2742,7 @@ exports.DEFAULT_NETWORK = DEFAULT_NETWORK$1;
2736
2742
  exports.DEFAULT_NODE_BASEURL = DEFAULT_NODE_BASEURL;
2737
2743
  exports.DEFAULT_NODE_PORT = DEFAULT_NODE_PORT;
2738
2744
  exports.DEFAULT_NODE_TOKEN = DEFAULT_NODE_TOKEN;
2745
+ exports.DEFAULT_PROVIDERS = DEFAULT_PROVIDERS;
2739
2746
  exports.WalletProvider = clientStore;
2740
2747
  exports.algosigner = AlgoSignerClient;
2741
2748
  exports.defly = DeflyWalletClient;