@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.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -3
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.js +14 -3
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +14 -3
- package/dist/react/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -361,7 +361,15 @@ var CHAIN_INFO = {
|
|
|
361
361
|
symbol: "BNB",
|
|
362
362
|
decimals: 18
|
|
363
363
|
},
|
|
364
|
-
rpcUrls: [
|
|
364
|
+
rpcUrls: [
|
|
365
|
+
"https://data-seed-prebsc-2-s1.binance.org:8545",
|
|
366
|
+
"https://data-seed-prebsc-1-s2.binance.org:8545",
|
|
367
|
+
"https://data-seed-prebsc-2-s2.binance.org:8545",
|
|
368
|
+
"https://data-seed-prebsc-1-s3.binance.org:8545",
|
|
369
|
+
"https://data-seed-prebsc-2-s3.binance.org:8545",
|
|
370
|
+
"https://data-seed-prebsc-1-s1.binance.org:8545"
|
|
371
|
+
// 原来的主节点作为最后备选
|
|
372
|
+
],
|
|
365
373
|
blockExplorerUrls: ["https://testnet.bscscan.com"]
|
|
366
374
|
},
|
|
367
375
|
// Polygon
|
|
@@ -562,9 +570,12 @@ var MetaMaskAdapter = class extends BrowserWalletAdapter {
|
|
|
562
570
|
chain: viemChain,
|
|
563
571
|
transport: viem.custom(provider)
|
|
564
572
|
});
|
|
573
|
+
const chainInfo = getChainInfo(finalChainId);
|
|
574
|
+
const primaryRpcUrl = chainInfo?.rpcUrls[0];
|
|
565
575
|
this.publicClient = viem.createPublicClient({
|
|
566
576
|
chain: viemChain,
|
|
567
|
-
transport: viem.custom(provider)
|
|
577
|
+
transport: primaryRpcUrl ? viem.http(primaryRpcUrl) : viem.custom(provider)
|
|
578
|
+
// 优先使用我们的 RPC,降级到 MetaMask provider
|
|
568
579
|
});
|
|
569
580
|
const address = formatEVMAddress(accounts[0]);
|
|
570
581
|
const account = {
|
|
@@ -829,7 +840,7 @@ var MetaMaskAdapter = class extends BrowserWalletAdapter {
|
|
|
829
840
|
return void 0;
|
|
830
841
|
}
|
|
831
842
|
const w = window;
|
|
832
|
-
return w.ethereum
|
|
843
|
+
return w.ethereum ? w.ethereum : void 0;
|
|
833
844
|
}
|
|
834
845
|
/**
|
|
835
846
|
* 获取下载链接
|