@enclave-hq/wallet-sdk 1.0.2 → 1.1.1

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/index.mjs CHANGED
@@ -353,7 +353,15 @@ var CHAIN_INFO = {
353
353
  symbol: "BNB",
354
354
  decimals: 18
355
355
  },
356
- rpcUrls: ["https://data-seed-prebsc-1-s1.binance.org:8545"],
356
+ rpcUrls: [
357
+ "https://data-seed-prebsc-2-s1.binance.org:8545",
358
+ "https://data-seed-prebsc-1-s2.binance.org:8545",
359
+ "https://data-seed-prebsc-2-s2.binance.org:8545",
360
+ "https://data-seed-prebsc-1-s3.binance.org:8545",
361
+ "https://data-seed-prebsc-2-s3.binance.org:8545",
362
+ "https://data-seed-prebsc-1-s1.binance.org:8545"
363
+ // 原来的主节点作为最后备选
364
+ ],
357
365
  blockExplorerUrls: ["https://testnet.bscscan.com"]
358
366
  },
359
367
  // Polygon
@@ -554,9 +562,12 @@ var MetaMaskAdapter = class extends BrowserWalletAdapter {
554
562
  chain: viemChain,
555
563
  transport: custom(provider)
556
564
  });
565
+ const chainInfo = getChainInfo(finalChainId);
566
+ const primaryRpcUrl = chainInfo?.rpcUrls[0];
557
567
  this.publicClient = createPublicClient({
558
568
  chain: viemChain,
559
- transport: custom(provider)
569
+ transport: primaryRpcUrl ? http(primaryRpcUrl) : custom(provider)
570
+ // 优先使用我们的 RPC,降级到 MetaMask provider
560
571
  });
561
572
  const address = formatEVMAddress(accounts[0]);
562
573
  const account = {
@@ -821,7 +832,7 @@ var MetaMaskAdapter = class extends BrowserWalletAdapter {
821
832
  return void 0;
822
833
  }
823
834
  const w = window;
824
- return w.ethereum && w.ethereum.isMetaMask ? w.ethereum : void 0;
835
+ return w.ethereum ? w.ethereum : void 0;
825
836
  }
826
837
  /**
827
838
  * 获取下载链接