@instadapp/avocado-base 0.0.7 → 0.0.9
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/package.json +1 -1
- package/utils/network.ts +46 -43
package/package.json
CHANGED
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://
|
|
86
|
+
rpcUrls: ["https://rpc.ankr.com/optimism"],
|
|
87
87
|
},
|
|
88
88
|
},
|
|
89
89
|
{
|
|
@@ -169,44 +169,44 @@ export const networks: Network[] = [
|
|
|
169
169
|
},
|
|
170
170
|
},
|
|
171
171
|
},
|
|
172
|
-
{
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
},
|
|
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
|
+
// {
|
|
192
|
+
// name: "Fantom",
|
|
193
|
+
// chainId: 250,
|
|
194
|
+
// explorerUrl: "https://ftmscan.com",
|
|
195
|
+
// get serverRpcUrl() {
|
|
196
|
+
// return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0];
|
|
197
|
+
// },
|
|
198
|
+
// usdcAddress: "0x04068da6c83afcfa0e13ba15a6696662335d5b75",
|
|
199
|
+
// balanceResolverAddress: "0x929376c77a2fb8152375a089a4fccf84ff481479",
|
|
200
|
+
// params: {
|
|
201
|
+
// rpcUrls: ["https://rpc.ankr.com/fantom"],
|
|
202
|
+
// chainName: "Fantom",
|
|
203
|
+
// nativeCurrency: {
|
|
204
|
+
// name: "Fantom",
|
|
205
|
+
// symbol: "FTM",
|
|
206
|
+
// decimals: 18,
|
|
207
|
+
// },
|
|
208
|
+
// },
|
|
209
|
+
// },
|
|
210
210
|
{
|
|
211
211
|
name: AVO_PROD_CHAIN_NAME,
|
|
212
212
|
chainId: AVO_PROD_CHAIN_ID,
|
|
@@ -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.
|
|
278
|
-
const serverRpcInstances: Record<
|
|
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.
|
|
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.
|
|
296
|
+
rpcInstances[chainId] = new ethers.providers.StaticJsonRpcProvider(
|
|
294
297
|
getRpcURLByChainId(Number(chainId))
|
|
295
298
|
);
|
|
296
299
|
}
|