@instadapp/avocado-base 0.0.7 → 0.0.10

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils/network.ts +27 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instadapp/avocado-base",
3
- "version": "0.0.7",
3
+ "version": "0.0.10",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "global.d.ts",
package/utils/network.ts CHANGED
@@ -83,7 +83,7 @@ export const networks: Network[] = [
83
83
  symbol: "ETH",
84
84
  decimals: 18,
85
85
  },
86
- rpcUrls: ["https://mainnet.optimism.io"],
86
+ rpcUrls: ["https://rpc.ankr.com/optimism"],
87
87
  },
88
88
  },
89
89
  {
@@ -169,25 +169,25 @@ export const networks: Network[] = [
169
169
  },
170
170
  },
171
171
  },
172
- {
173
- name: "Aurora",
174
- chainId: 1313161554,
175
- explorerUrl: "https://explorer.mainnet.aurora.dev",
176
- get serverRpcUrl() {
177
- return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0];
178
- },
179
- usdcAddress: "0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",
180
- balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
181
- params: {
182
- rpcUrls: ["https://mainnet.aurora.dev"],
183
- chainName: "Aurora",
184
- nativeCurrency: {
185
- decimals: 18,
186
- name: "Aurora ETH",
187
- symbol: "AETH",
188
- },
189
- },
190
- },
172
+ // {
173
+ // name: "Aurora",
174
+ // chainId: 1313161554,
175
+ // explorerUrl: "https://explorer.mainnet.aurora.dev",
176
+ // get serverRpcUrl() {
177
+ // return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0];
178
+ // },
179
+ // usdcAddress: "0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",
180
+ // balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
181
+ // params: {
182
+ // rpcUrls: ["https://mainnet.aurora.dev"],
183
+ // chainName: "Aurora",
184
+ // nativeCurrency: {
185
+ // decimals: 18,
186
+ // name: "Aurora ETH",
187
+ // symbol: "AETH",
188
+ // },
189
+ // },
190
+ // },
191
191
  {
192
192
  name: "Fantom",
193
193
  chainId: 250,
@@ -274,13 +274,16 @@ export const RPCMap = networks.reduce((acc, network) => {
274
274
 
275
275
  export const networkIds = networks.map((network) => network.chainId);
276
276
 
277
- const rpcInstances: Record<string, ethers.providers.JsonRpcProvider> = {};
278
- const serverRpcInstances: Record<string, ethers.providers.JsonRpcProvider> = {};
277
+ const rpcInstances: Record<string, ethers.providers.StaticJsonRpcProvider> = {};
278
+ const serverRpcInstances: Record<
279
+ string,
280
+ ethers.providers.StaticJsonRpcProvider
281
+ > = {};
279
282
 
280
283
  export const getServerRpcProvider = (chainId: number | string) => {
281
284
  if (!rpcInstances[chainId]) {
282
285
  const network = networks.find((n) => n.chainId == chainId);
283
- serverRpcInstances[chainId] = new ethers.providers.JsonRpcProvider(
286
+ serverRpcInstances[chainId] = new ethers.providers.StaticJsonRpcProvider(
284
287
  network?.serverRpcUrl
285
288
  );
286
289
  }
@@ -290,7 +293,7 @@ export const getServerRpcProvider = (chainId: number | string) => {
290
293
 
291
294
  export const getRpcProvider = (chainId: number | string) => {
292
295
  if (!rpcInstances[chainId]) {
293
- rpcInstances[chainId] = new ethers.providers.JsonRpcProvider(
296
+ rpcInstances[chainId] = new ethers.providers.StaticJsonRpcProvider(
294
297
  getRpcURLByChainId(Number(chainId))
295
298
  );
296
299
  }