@instadapp/avocado-base 0.0.0-dev.9807f71 → 0.0.0-dev.aceef3f

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instadapp/avocado-base",
3
- "version": "0.0.0-dev.9807f71",
3
+ "version": "0.0.0-dev.aceef3f",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "global.d.ts",
package/utils/network.ts CHANGED
@@ -8,14 +8,14 @@ export const networks: Network[] = [
8
8
  debankName: "eth",
9
9
  ankrName: "eth",
10
10
  chainId: 1,
11
- explorerUrl: "https://etherscan.io",
12
- get serverRpcUrl() {
13
- return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0];
14
- },
15
- balanceResolverAddress: "0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43",
16
- usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
17
11
  params: {
18
12
  rpcUrls: ["https://rpc.ankr.com/eth"],
13
+ explorerUrl: "https://etherscan.io",
14
+ get serverRpcUrl() {
15
+ return process.env?.MAINNET_RPC_URL || this.rpcUrls[0];
16
+ },
17
+ balanceResolverAddress: "0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43",
18
+ usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
19
19
  nativeCurrency: {
20
20
  name: "Ethereum",
21
21
  symbol: "ETH",
@@ -28,12 +28,6 @@ export const networks: Network[] = [
28
28
  debankName: "matic",
29
29
  ankrName: "polygon",
30
30
  chainId: 137,
31
- balanceResolverAddress: "0x58632D23120b20650262b8A629a14e4F4043E0D9",
32
- usdcAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
33
- explorerUrl: "https://polygonscan.com",
34
- get serverRpcUrl() {
35
- return process.env?.POLYGON_RPC_URL || this.params.rpcUrls[0];
36
- },
37
31
  params: {
38
32
  chainName: "Matic(Polygon) Mainnet",
39
33
  nativeCurrency: {
@@ -41,7 +35,13 @@ export const networks: Network[] = [
41
35
  symbol: "MATIC",
42
36
  decimals: 18,
43
37
  },
38
+ balanceResolverAddress: "0x58632D23120b20650262b8A629a14e4F4043E0D9",
39
+ usdcAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
44
40
  rpcUrls: ["https://polygon-rpc.com"],
41
+ get serverRpcUrl() {
42
+ return process.env?.POLYGON_RPC_URL || this.rpcUrls[0];
43
+ },
44
+ explorerUrl: "https://polygonscan.com",
45
45
  },
46
46
  },
47
47
  {
@@ -49,12 +49,6 @@ export const networks: Network[] = [
49
49
  debankName: "arb",
50
50
  ankrName: "arbitrum",
51
51
  chainId: 42161,
52
- usdcAddress: "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
53
- balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
54
- explorerUrl: "https://arbiscan.io",
55
- get serverRpcUrl() {
56
- return process.env?.ARBITRUM_RPC_URL || this.params.rpcUrls[0];
57
- },
58
52
  params: {
59
53
  chainName: "Arbitrum One",
60
54
  nativeCurrency: {
@@ -62,7 +56,13 @@ export const networks: Network[] = [
62
56
  symbol: "ETH",
63
57
  decimals: 18,
64
58
  },
59
+ usdcAddress: "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
60
+ balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
61
+ get serverRpcUrl() {
62
+ return process.env?.ARBITRUM_RPC_URL || this.rpcUrls[0];
63
+ },
65
64
  rpcUrls: ["https://arb1.arbitrum.io/rpc"],
65
+ explorerUrl: "https://arbiscan.io",
66
66
  },
67
67
  },
68
68
  {
@@ -70,12 +70,6 @@ export const networks: Network[] = [
70
70
  debankName: "op",
71
71
  ankrName: "optimism",
72
72
  chainId: 10,
73
- usdcAddress: "0x7f5c764cbc14f9669b88837ca1490cca17c31607",
74
- balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
75
- explorerUrl: "https://optimistic.etherscan.io",
76
- get serverRpcUrl() {
77
- return process.env?.OPTIMISM_RPC_URL || this.params.rpcUrls[0];
78
- },
79
73
  params: {
80
74
  chainName: "Optimistic Ethereum",
81
75
  nativeCurrency: {
@@ -83,7 +77,13 @@ export const networks: Network[] = [
83
77
  symbol: "ETH",
84
78
  decimals: 18,
85
79
  },
80
+ usdcAddress: "0x7f5c764cbc14f9669b88837ca1490cca17c31607",
81
+ balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
82
+ get serverRpcUrl() {
83
+ return process.env?.OPTIMISM_RPC_URL || this.rpcUrls[0];
84
+ },
86
85
  rpcUrls: ["https://mainnet.optimism.io"],
86
+ explorerUrl: "https://optimistic.etherscan.io",
87
87
  },
88
88
  },
89
89
  {
@@ -91,20 +91,20 @@ export const networks: Network[] = [
91
91
  debankName: "avax",
92
92
  ankrName: "avalanche",
93
93
  chainId: 43114,
94
- usdcAddress: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
95
- balanceResolverAddress: "0x63009f31D054E0ac9F321Cf0D642375236A4Bf1E",
96
- explorerUrl: "https://snowtrace.io",
97
- get serverRpcUrl() {
98
- return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0];
99
- },
100
94
  params: {
101
95
  chainName: "Avalanche Network",
96
+ get serverRpcUrl() {
97
+ return process.env?.AVALANCHE_RPC_URL || this.rpcUrls[0];
98
+ },
102
99
  nativeCurrency: {
103
100
  name: "Avalanche",
104
101
  symbol: "AVAX",
105
102
  decimals: 18,
106
103
  },
104
+ usdcAddress: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
105
+ balanceResolverAddress: "0x63009f31D054E0ac9F321Cf0D642375236A4Bf1E",
107
106
  rpcUrls: ["https://api.avax.network/ext/bc/C/rpc"],
107
+ explorerUrl: "https://snowtrace.io",
108
108
  },
109
109
  },
110
110
  {
@@ -112,15 +112,15 @@ export const networks: Network[] = [
112
112
  debankName: "bsc",
113
113
  ankrName: "bsc",
114
114
  chainId: 56,
115
- explorerUrl: "https://bscscan.com",
116
- usdcAddress: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
117
- balanceResolverAddress: "0xb808cff38706e267067b0af427726aa099f69f89",
118
- get serverRpcUrl() {
119
- return process.env?.BSC_RPC_URL || this.params.rpcUrls[0];
120
- },
121
115
  params: {
122
116
  chainName: "Binance Smart Chain",
117
+ explorerUrl: "https://bscscan.com",
123
118
  rpcUrls: ["https://rpc.ankr.com/bsc"],
119
+ get serverRpcUrl() {
120
+ return process.env?.BSC_RPC_URL || this.rpcUrls[0];
121
+ },
122
+ usdcAddress: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
123
+ balanceResolverAddress: "0xb808cff38706e267067b0af427726aa099f69f89",
124
124
  nativeCurrency: {
125
125
  name: "Binance Coin",
126
126
  symbol: "BNB",
@@ -133,15 +133,15 @@ export const networks: Network[] = [
133
133
  debankName: "xdai",
134
134
  ankrName: "gnosis",
135
135
  chainId: 100,
136
- balanceResolverAddress: "0xfaa244e276b1597f663975ed007ee4ff70d27849",
137
- explorerUrl: "https://gnosisscan.io",
138
- usdcAddress: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83",
139
- get serverRpcUrl() {
140
- return process.env?.GNOSIS_RPC_URL || this.params.rpcUrls[0];
141
- },
142
136
  params: {
143
137
  chainName: "Gnosis Safe",
138
+ explorerUrl: "https://gnosisscan.io",
144
139
  rpcUrls: ["https://rpc.ankr.com/gnosis"],
140
+ get serverRpcUrl() {
141
+ return process.env?.GNOSIS_RPC_URL || this.rpcUrls[0];
142
+ },
143
+ balanceResolverAddress: "0xfaa244e276b1597f663975ed007ee4ff70d27849",
144
+ usdcAddress: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83",
145
145
  nativeCurrency: {
146
146
  name: "xdaistable",
147
147
  symbol: "xDAI",
@@ -152,16 +152,15 @@ export const networks: Network[] = [
152
152
  {
153
153
  name: "Polygon zkEVM",
154
154
  chainId: 1101,
155
- explorerUrl: "https://zkevm.polygonscan.com",
156
- balanceResolverAddress: "0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01",
157
- usdcAddress: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
158
- get serverRpcUrl() {
159
- return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0];
160
- },
161
155
  params: {
162
156
  chainName: "polygon zkEVM",
157
+ explorerUrl: "https://zkevm.polygonscan.com",
163
158
  rpcUrls: ["https://rpc.ankr.com/polygon_zkevm"],
164
-
159
+ get serverRpcUrl() {
160
+ return process.env?.POLYGON_ZKEVM_RPC_URL || this.rpcUrls[0];
161
+ },
162
+ balanceResolverAddress: "0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01",
163
+ usdcAddress: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
165
164
  nativeCurrency: {
166
165
  name: "Ethereum",
167
166
  symbol: "ETH",
@@ -173,10 +172,6 @@ export const networks: Network[] = [
173
172
  name: AVO_PROD_CHAIN_NAME,
174
173
  chainId: AVO_PROD_CHAIN_ID,
175
174
  isAvocado: true,
176
- balanceResolverAddress: "",
177
- usdcAddress: "",
178
- serverRpcUrl: AVO_PROD_RPC_URL,
179
- explorerUrl: AVO_PROD_EXPLORER_URL,
180
175
  params: {
181
176
  chainName: AVO_PROD_CHAIN_NAME,
182
177
  nativeCurrency: {
@@ -185,17 +180,17 @@ export const networks: Network[] = [
185
180
  decimals: 18,
186
181
  },
187
182
  iconUrls: ["https://avocado.instadapp.io/logo.svg"],
183
+ balanceResolverAddress: "",
184
+ usdcAddress: "",
185
+ serverRpcUrl: AVO_PROD_RPC_URL,
188
186
  rpcUrls: [AVO_PROD_RPC_URL],
187
+ explorerUrl: AVO_PROD_EXPLORER_URL,
189
188
  },
190
189
  },
191
190
  {
192
191
  name: AVO_STAGING_CHAIN_NAME,
193
192
  chainId: AVO_STAGING_CHAIN_ID,
194
- serverRpcUrl: AVO_STAGING_RPC_URL,
195
- explorerUrl: AVO_STAGING_EXPLORER_URL,
196
193
  isAvocado: true,
197
- balanceResolverAddress: "",
198
- usdcAddress: "",
199
194
  params: {
200
195
  chainName: AVO_STAGING_CHAIN_NAME,
201
196
  nativeCurrency: {
@@ -203,8 +198,12 @@ export const networks: Network[] = [
203
198
  symbol: "USDC",
204
199
  decimals: 18,
205
200
  },
201
+ serverRpcUrl: AVO_STAGING_RPC_URL,
202
+ balanceResolverAddress: "",
203
+ usdcAddress: "",
206
204
  iconUrls: ["https://avocado.instadapp.io/logo.svg"],
207
205
  rpcUrls: [AVO_STAGING_RPC_URL],
206
+ explorerUrl: AVO_STAGING_EXPLORER_URL,
208
207
  },
209
208
  },
210
209
  ];
@@ -243,7 +242,7 @@ export const getServerRpcProvider = (chainId: number | string) => {
243
242
  if (!rpcInstances[chainId]) {
244
243
  const network = networks.find((n) => n.chainId == chainId);
245
244
  serverRpcInstances[chainId] = new ethers.providers.JsonRpcProvider(
246
- network?.serverRpcUrl
245
+ network?.params.serverRpcUrl
247
246
  );
248
247
  }
249
248
 
@@ -265,5 +264,5 @@ export const getExplorerUrl = (
265
264
  suffix: `/${string}` = "/"
266
265
  ) => {
267
266
  const network = getNetworkByChainId(chainId);
268
- return `${network.explorerUrl}${suffix}`;
267
+ return `${network.params.explorerUrl}${suffix}`;
269
268
  };
package/utils/utils.d.ts CHANGED
@@ -8,14 +8,14 @@ interface Network {
8
8
  ankrName?: string;
9
9
  chainId: ChainId;
10
10
  isAvocado?: boolean;
11
- serverRpcUrl: string | undefined;
12
- balanceResolverAddress?: string;
13
- usdcAddress: string;
14
- explorerUrl: string;
15
11
  params: {
16
12
  chainName?: string;
17
- iconUrls?: string[];
18
13
  rpcUrls: string[];
14
+ serverRpcUrl: string | undefined;
15
+ balanceResolverAddress?: string;
16
+ usdcAddress: string;
17
+ explorerUrl: string;
18
+ iconUrls?: string[];
19
19
  nativeCurrency?: {
20
20
  name: string;
21
21
  symbol: string;