@openocean.finance/wallet 1.8.8 → 1.9.0

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/lib/Chains.js CHANGED
@@ -14,30 +14,6 @@ var chainObj = {
14
14
  ],
15
15
  compiler: 'EVM'
16
16
  },
17
- // "ropsten": {
18
- // chainName: "Ethereum Ropsten",
19
- // chainId: 3,
20
- // blockExplorerUrl: "https://ropsten.etherscan.io/",
21
- // nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18, address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" },
22
- // popularToken: ["ETH", "USDT", "USDC", "BUSD", "UNI", "C98", "LINK", "MATIC"],
23
- // rpcUrls: [
24
- // "https://ropsten.infura.io/v3"
25
- // ],
26
- // compiler: 'EVM',
27
- // isTest: true
28
- // },
29
- // "rinkeby": {
30
- // chainName: "Ethereum Rinkeby",
31
- // chainId: 4,
32
- // blockExplorerUrl: "https://rinkeby.etherscan.io/",
33
- // nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18, address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" },
34
- // popularToken: ["ETH", "USDT", "USDC", "BUSD", "UNI", "C98", "LINK", "MATIC"],
35
- // rpcUrls: [
36
- // "https://rinkeby.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"
37
- // ],
38
- // compiler: 'EVM',
39
- // isTest: true
40
- // },
41
17
  "bsc": {
42
18
  chainName: "Binance Smart Chain", chainId: 56, blockExplorerUrl: "https://bscscan.com/tx/",
43
19
  popularToken: ["BNB", "USDT", "BUSD", "CAKE", "C98", "BAKE", "MBOX"],
@@ -86,11 +62,6 @@ var chainObj = {
86
62
  chainName: "Arbitrum", chainId: 42161, blockExplorerUrl: "https://arbiscan.io/tx/", nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18, address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" },
87
63
  rpcUrls: ["https://arb1.arbitrum.io/rpc"]
88
64
  },
89
- "terra": {
90
- compiler: 'TERRA',
91
- chainName: "Terra Mainnet", blockExplorerUrl: "https://finder.terra.money/columbus-5/tx/",
92
- rpcUrls: null
93
- },
94
65
  "xdai": {
95
66
  compiler: 'EVM',
96
67
  chainName: "Gnosis Mainnet",
@@ -144,7 +115,7 @@ var chainObj = {
144
115
  compiler: 'EVM',
145
116
  chainName: "Optimism",
146
117
  chainId: 10,
147
- blockExplorerUrl: "https://optimism.io/tx/",
118
+ blockExplorerUrl: "https://optimistic.etherscan.io/tx/",
148
119
  nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18, address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" },
149
120
  rpcUrls: ["https://rpc.ankr.com/optimism", "https://optimism-mainnet.public.blastapi.io", "https://mainnet.optimism.io"]
150
121
  },
@@ -243,19 +243,20 @@ function link(reqConnectWalletVo, chain) {
243
243
  }
244
244
  function linkAddOrSwitch(wallet, chain) {
245
245
  return __awaiter(this, void 0, void 0, function () {
246
- var _a, currentProvider, utilsEht, chainId, params, address, address, switchError_1, address, address, error_1, message;
246
+ var _a, currentProvider, utilsEht, chainId, rpcUrls, blockExplorerUrl, nativeCurrency, chainName, params, address, address, switchError_1, address, address, error_1, message;
247
247
  return __generator(this, function (_b) {
248
248
  switch (_b.label) {
249
249
  case 0:
250
250
  _a = wallet.sdk || {}, currentProvider = _a.currentProvider, utilsEht = _a.utils;
251
251
  chainId = chain.chainId + '';
252
252
  if (!chain) return [3 /*break*/, 23];
253
+ rpcUrls = chain.rpcUrls, blockExplorerUrl = chain.blockExplorerUrl, nativeCurrency = chain.nativeCurrency, chainName = chain.chainName;
253
254
  params = {
254
255
  chainId: utilsEht.toHex(chainId),
255
- chainName: chain.chainName,
256
- nativeCurrency: chain.nativeCurrency,
257
- rpcUrls: chain.rpcUrls,
258
- blockExplorerUrls: [chain.blockExplorerUrl],
256
+ chainName: chainName,
257
+ nativeCurrency: nativeCurrency,
258
+ rpcUrls: rpcUrls,
259
+ blockExplorerUrls: [blockExplorerUrl.replace(/\/tx\/|\/transaction\//gi, '/')],
259
260
  };
260
261
  _b.label = 1;
261
262
  case 1:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openocean.finance/wallet",
3
- "version": "1.8.8",
3
+ "version": "1.9.0",
4
4
  "description": "A multi-chain wallets manager",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {