@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.
@@ -278,7 +278,15 @@ var CHAIN_INFO = {
278
278
  symbol: "BNB",
279
279
  decimals: 18
280
280
  },
281
- rpcUrls: ["https://data-seed-prebsc-1-s1.binance.org:8545"],
281
+ rpcUrls: [
282
+ "https://data-seed-prebsc-2-s1.binance.org:8545",
283
+ "https://data-seed-prebsc-1-s2.binance.org:8545",
284
+ "https://data-seed-prebsc-2-s2.binance.org:8545",
285
+ "https://data-seed-prebsc-1-s3.binance.org:8545",
286
+ "https://data-seed-prebsc-2-s3.binance.org:8545",
287
+ "https://data-seed-prebsc-1-s1.binance.org:8545"
288
+ // 原来的主节点作为最后备选
289
+ ],
282
290
  blockExplorerUrls: ["https://testnet.bscscan.com"]
283
291
  },
284
292
  // Polygon
@@ -470,9 +478,12 @@ var MetaMaskAdapter = class extends BrowserWalletAdapter {
470
478
  chain: viemChain,
471
479
  transport: viem.custom(provider)
472
480
  });
481
+ const chainInfo = getChainInfo(finalChainId);
482
+ const primaryRpcUrl = chainInfo?.rpcUrls[0];
473
483
  this.publicClient = viem.createPublicClient({
474
484
  chain: viemChain,
475
- transport: viem.custom(provider)
485
+ transport: primaryRpcUrl ? viem.http(primaryRpcUrl) : viem.custom(provider)
486
+ // 优先使用我们的 RPC,降级到 MetaMask provider
476
487
  });
477
488
  const address = formatEVMAddress(accounts[0]);
478
489
  const account = {
@@ -737,7 +748,7 @@ var MetaMaskAdapter = class extends BrowserWalletAdapter {
737
748
  return void 0;
738
749
  }
739
750
  const w = window;
740
- return w.ethereum && w.ethereum.isMetaMask ? w.ethereum : void 0;
751
+ return w.ethereum ? w.ethereum : void 0;
741
752
  }
742
753
  /**
743
754
  * 获取下载链接