@instadapp/avocado-base 0.0.0-dev.2588b9b → 0.0.0-dev.2671274
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/abi/forwarder.json +1253 -149
- package/abi/multisigForwarder.json +697 -0
- package/app.vue +7 -0
- package/assets/images/icons/arrow-left.svg +5 -0
- package/assets/images/icons/arrow-right.svg +5 -0
- package/assets/images/icons/avocado.svg +4 -0
- package/assets/images/icons/bridge-2.svg +3 -0
- package/assets/images/icons/bridge.svg +7 -0
- package/assets/images/icons/calendar.svg +8 -0
- package/assets/images/icons/change-threshold.svg +4 -0
- package/assets/images/icons/check-circle.svg +4 -0
- package/assets/images/icons/chevron-down.svg +4 -0
- package/assets/images/icons/clipboard.svg +7 -0
- package/assets/images/icons/clock-circle.svg +5 -0
- package/assets/images/icons/copy.svg +5 -0
- package/assets/images/icons/cross-transfer.svg +7 -0
- package/assets/images/icons/dapp.svg +4 -0
- package/assets/images/icons/deploy.svg +12 -0
- package/assets/images/icons/error-circle.svg +6 -0
- package/assets/images/icons/exclamation-circle.svg +13 -0
- package/assets/images/icons/exclamation-octagon.svg +13 -0
- package/assets/images/icons/exclamation-triangle.svg +5 -0
- package/assets/images/icons/external-link.svg +6 -0
- package/assets/images/icons/eye.svg +4 -0
- package/assets/images/icons/flowers.svg +8 -0
- package/assets/images/icons/gas-emoji.svg +193 -0
- package/assets/images/icons/gas.svg +14 -0
- package/assets/images/icons/gift.svg +153 -0
- package/assets/images/icons/globe.svg +110 -0
- package/assets/images/icons/hamburger.svg +6 -0
- package/assets/images/icons/hammer.svg +5 -0
- package/assets/images/icons/info-2.svg +12 -0
- package/assets/images/icons/instadapp-pro.svg +4 -0
- package/assets/images/icons/logout.svg +3 -0
- package/assets/images/icons/moon.svg +3 -0
- package/assets/images/icons/multi-send.svg +7 -0
- package/assets/images/icons/network.svg +13 -0
- package/assets/images/icons/options.svg +5 -0
- package/assets/images/icons/permit-sign.svg +11 -0
- package/assets/images/icons/plus-circle.svg +6 -0
- package/assets/images/icons/plus.svg +5 -0
- package/assets/images/icons/power-off-bg.svg +24 -0
- package/assets/images/icons/power-off.svg +19 -0
- package/assets/images/icons/power-on.svg +19 -0
- package/assets/images/icons/qr.svg +20 -0
- package/assets/images/icons/question-circle.svg +14 -0
- package/assets/images/icons/refresh.svg +6 -0
- package/assets/images/icons/reject-proposal.svg +6 -0
- package/assets/images/icons/search.svg +12 -0
- package/assets/images/icons/sun.svg +3 -0
- package/assets/images/icons/transfer.svg +5 -0
- package/assets/images/icons/trash-2.svg +8 -0
- package/assets/images/icons/upgrade.svg +4 -0
- package/assets/images/icons/wave.svg +214 -0
- package/assets/images/icons/x.svg +5 -0
- package/components/ActionLogo.vue +40 -0
- package/components/ActionMetadata.vue +78 -0
- package/components/AuthorityAvatar.vue +38 -0
- package/components/ChainLogo.vue +14 -556
- package/components/CopyClipboard.vue +64 -0
- package/components/metadata/Bridge.vue +59 -0
- package/components/metadata/CrossTransfer.vue +79 -0
- package/components/metadata/GasTopup.vue +39 -0
- package/components/metadata/Permit2.vue +42 -0
- package/components/metadata/Signers.vue +63 -0
- package/components/metadata/Swap.vue +74 -0
- package/components/metadata/Transfer.vue +50 -0
- package/components.d.ts +13 -0
- package/contracts/Forwarder.ts +856 -2
- package/contracts/MultisigForwarder.ts +859 -0
- package/contracts/factories/Forwarder__factory.ts +816 -16
- package/contracts/factories/MultisigForwarder__factory.ts +721 -0
- package/contracts/factories/index.ts +1 -0
- package/contracts/index.ts +2 -0
- package/nuxt.config.ts +17 -1
- package/package.json +9 -4
- package/utils/avocado.ts +2 -0
- package/utils/bignumber.ts +20 -0
- package/utils/formatter.ts +22 -13
- package/utils/helper.ts +8 -0
- package/utils/metadata.ts +406 -134
- package/utils/network.ts +246 -79
- package/utils/services.ts +21 -0
- package/utils/utils.d.ts +131 -97
package/utils/network.ts
CHANGED
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
import { ethers } from "ethers";
|
|
2
|
+
import {
|
|
3
|
+
AVO_PROD_CHAIN_NAME,
|
|
4
|
+
AVO_PROD_CHAIN_ID,
|
|
5
|
+
AVO_PROD_RPC_URL,
|
|
6
|
+
AVO_PROD_EXPLORER_URL,
|
|
7
|
+
AVO_STAGING_CHAIN_NAME,
|
|
8
|
+
AVO_STAGING_CHAIN_ID,
|
|
9
|
+
AVO_STAGING_RPC_URL,
|
|
10
|
+
AVO_STAGING_EXPLORER_URL,
|
|
11
|
+
} from "./avocado";
|
|
2
12
|
|
|
3
|
-
export const bridgeDisabledNetworks = [
|
|
13
|
+
export const bridgeDisabledNetworks = [];
|
|
14
|
+
|
|
15
|
+
export const networksSimulationNotSupported = [1313161554, 1101];
|
|
4
16
|
|
|
5
17
|
export const networks: Network[] = [
|
|
6
|
-
{
|
|
7
|
-
name: "Mainnet",
|
|
8
|
-
debankName: "eth",
|
|
9
|
-
ankrName: "eth",
|
|
10
|
-
zerionName: "ethereum",
|
|
11
|
-
chainId: 1,
|
|
12
|
-
explorerUrl: "https://etherscan.io",
|
|
13
|
-
get serverRpcUrl() {
|
|
14
|
-
return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0];
|
|
15
|
-
},
|
|
16
|
-
balanceResolverAddress: "0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43",
|
|
17
|
-
usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
18
|
-
params: {
|
|
19
|
-
rpcUrls: ["https://rpc.ankr.com/eth"],
|
|
20
|
-
nativeCurrency: {
|
|
21
|
-
name: "Ethereum",
|
|
22
|
-
symbol: "ETH",
|
|
23
|
-
decimals: 18,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
18
|
{
|
|
28
19
|
name: "Polygon",
|
|
29
20
|
debankName: "matic",
|
|
30
21
|
ankrName: "polygon",
|
|
31
22
|
zerionName: "polygon",
|
|
23
|
+
color: "#7A4ADD",
|
|
32
24
|
chainId: 137,
|
|
33
25
|
balanceResolverAddress: "0x58632D23120b20650262b8A629a14e4F4043E0D9",
|
|
34
26
|
usdcAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
|
35
27
|
explorerUrl: "https://polygonscan.com",
|
|
28
|
+
apiURL: "https://api.polygonscan.com",
|
|
29
|
+
fakeTransactionHash:
|
|
30
|
+
"0x906c551abd5873a428505b6530ac14d91367820706c7ee525f6d7313265d1c92",
|
|
36
31
|
get serverRpcUrl() {
|
|
37
32
|
return process.env?.POLYGON_RPC_URL || this.params.rpcUrls[0];
|
|
38
33
|
},
|
|
@@ -51,10 +46,14 @@ export const networks: Network[] = [
|
|
|
51
46
|
debankName: "arb",
|
|
52
47
|
ankrName: "arbitrum",
|
|
53
48
|
zerionName: "arbitrum",
|
|
49
|
+
color: "#2D374B",
|
|
54
50
|
chainId: 42161,
|
|
55
51
|
usdcAddress: "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
|
|
56
52
|
balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
|
|
53
|
+
fakeTransactionHash:
|
|
54
|
+
"0x9fa291c3b09d31f19b1fa5dd05f30169d1364036d5f7c14b026410bc07bd8843",
|
|
57
55
|
explorerUrl: "https://arbiscan.io",
|
|
56
|
+
apiURL: "https://api.arbiscan.io",
|
|
58
57
|
get serverRpcUrl() {
|
|
59
58
|
return process.env?.ARBITRUM_RPC_URL || this.params.rpcUrls[0];
|
|
60
59
|
},
|
|
@@ -68,14 +67,67 @@ export const networks: Network[] = [
|
|
|
68
67
|
rpcUrls: ["https://arb1.arbitrum.io/rpc"],
|
|
69
68
|
},
|
|
70
69
|
},
|
|
70
|
+
{
|
|
71
|
+
name: "Ethereum",
|
|
72
|
+
debankName: "eth",
|
|
73
|
+
ankrName: "eth",
|
|
74
|
+
zerionName: "ethereum",
|
|
75
|
+
chainId: 1,
|
|
76
|
+
explorerUrl: "https://etherscan.io",
|
|
77
|
+
fakeTransactionHash:
|
|
78
|
+
"0x13232dd32cef2f641ead890a507710c96560c8c9c3d5fab6facb5ec563c49433",
|
|
79
|
+
apiURL: "https://api.etherscan.io",
|
|
80
|
+
color: "#5D5FEF",
|
|
81
|
+
get serverRpcUrl() {
|
|
82
|
+
return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0];
|
|
83
|
+
},
|
|
84
|
+
balanceResolverAddress: "0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43",
|
|
85
|
+
usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
86
|
+
params: {
|
|
87
|
+
rpcUrls: ["https://rpc.ankr.com/eth"],
|
|
88
|
+
nativeCurrency: {
|
|
89
|
+
name: "Ethereum",
|
|
90
|
+
symbol: "ETH",
|
|
91
|
+
decimals: 18,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "Base",
|
|
97
|
+
chainId: 8453,
|
|
98
|
+
color: "#1E2024",
|
|
99
|
+
ankrName: "base",
|
|
100
|
+
explorerUrl: "https://basescan.org",
|
|
101
|
+
fakeTransactionHash:
|
|
102
|
+
"0xf7833d80da33730c4fc5d4c64151f0eaa64c0c0535be022af0228a44cc4e9c8e",
|
|
103
|
+
apiURL: "https://api.basescan.org",
|
|
104
|
+
get serverRpcUrl() {
|
|
105
|
+
return process.env?.BASE_RPC_URL || this.params.rpcUrls[0];
|
|
106
|
+
},
|
|
107
|
+
usdcAddress: "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA",
|
|
108
|
+
balanceResolverAddress: "0x23c8EAb8a4373dD16b0947Ebe8bf76Ff7A49d13C",
|
|
109
|
+
params: {
|
|
110
|
+
rpcUrls: ["https://rpc.ankr.com/base"],
|
|
111
|
+
chainName: "Base",
|
|
112
|
+
nativeCurrency: {
|
|
113
|
+
name: "Ethereum",
|
|
114
|
+
symbol: "ETH",
|
|
115
|
+
decimals: 18,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
71
119
|
{
|
|
72
120
|
name: "Optimism",
|
|
73
121
|
debankName: "op",
|
|
74
122
|
ankrName: "optimism",
|
|
75
123
|
zerionName: "optimism",
|
|
124
|
+
color: "#FF0420",
|
|
76
125
|
chainId: 10,
|
|
126
|
+
apiURL: "https://api-optimistic.etherscan.io",
|
|
77
127
|
usdcAddress: "0x7f5c764cbc14f9669b88837ca1490cca17c31607",
|
|
78
128
|
balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
|
|
129
|
+
fakeTransactionHash:
|
|
130
|
+
"0xee7311d68059732b05088f2144dfec6c7a4f5fd0433eb85306afcd6bdf17cebc",
|
|
79
131
|
explorerUrl: "https://optimistic.etherscan.io",
|
|
80
132
|
get serverRpcUrl() {
|
|
81
133
|
return process.env?.OPTIMISM_RPC_URL || this.params.rpcUrls[0];
|
|
@@ -91,25 +143,27 @@ export const networks: Network[] = [
|
|
|
91
143
|
},
|
|
92
144
|
},
|
|
93
145
|
{
|
|
94
|
-
name: "
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
balanceResolverAddress: "
|
|
101
|
-
|
|
146
|
+
name: "Polygon zkEVM",
|
|
147
|
+
chainId: 1101,
|
|
148
|
+
color: "#8544f6",
|
|
149
|
+
ankrName: "polygon_zkevm",
|
|
150
|
+
explorerUrl: "https://zkevm.polygonscan.com",
|
|
151
|
+
apiURL: "https://api-zkevm.polygonscan.com",
|
|
152
|
+
balanceResolverAddress: "0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01",
|
|
153
|
+
fakeTransactionHash:
|
|
154
|
+
"0x1077130463ade91ad4e9c43c3195298e26a99970975238128912490eea12bf41",
|
|
155
|
+
usdcAddress: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
|
|
102
156
|
get serverRpcUrl() {
|
|
103
|
-
return process.env?.
|
|
157
|
+
return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0];
|
|
104
158
|
},
|
|
105
159
|
params: {
|
|
106
|
-
chainName: "
|
|
160
|
+
chainName: "polygon zkEVM",
|
|
161
|
+
rpcUrls: ["https://zkevm-rpc.com"],
|
|
107
162
|
nativeCurrency: {
|
|
108
|
-
name: "
|
|
109
|
-
symbol: "
|
|
163
|
+
name: "Ethereum",
|
|
164
|
+
symbol: "ETH",
|
|
110
165
|
decimals: 18,
|
|
111
166
|
},
|
|
112
|
-
rpcUrls: ["https://api.avax.network/ext/bc/C/rpc"],
|
|
113
167
|
},
|
|
114
168
|
},
|
|
115
169
|
{
|
|
@@ -117,8 +171,12 @@ export const networks: Network[] = [
|
|
|
117
171
|
debankName: "bsc",
|
|
118
172
|
ankrName: "bsc",
|
|
119
173
|
zerionName: "binance-smart-chain",
|
|
174
|
+
color: "#F3BA2F",
|
|
120
175
|
chainId: 56,
|
|
121
176
|
explorerUrl: "https://bscscan.com",
|
|
177
|
+
fakeTransactionHash:
|
|
178
|
+
"0x897d54bf8e492f840bd4d8f1e743bfcab8226ab4d5a899e47ee433dcd6d6abf7",
|
|
179
|
+
apiURL: "https://api.bscscan.com",
|
|
122
180
|
usdcAddress: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
|
|
123
181
|
balanceResolverAddress: "0xb808cff38706e267067b0af427726aa099f69f89",
|
|
124
182
|
get serverRpcUrl() {
|
|
@@ -134,13 +192,68 @@ export const networks: Network[] = [
|
|
|
134
192
|
},
|
|
135
193
|
},
|
|
136
194
|
},
|
|
195
|
+
{
|
|
196
|
+
name: "Avalanche",
|
|
197
|
+
debankName: "avax",
|
|
198
|
+
ankrName: "avalanche",
|
|
199
|
+
zerionName: "avalanche",
|
|
200
|
+
color: "#EB5757",
|
|
201
|
+
chainId: 43114,
|
|
202
|
+
usdcAddress: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
|
|
203
|
+
balanceResolverAddress: "0x63009f31D054E0ac9F321Cf0D642375236A4Bf1E",
|
|
204
|
+
explorerUrl: "https://snowtrace.io",
|
|
205
|
+
fakeTransactionHash:
|
|
206
|
+
"0x233aac7402558dd4e23f938a50f983e67f5c9604233981c7ac74e63737b8294e",
|
|
207
|
+
apiURL: "https://api.snowtrace.io",
|
|
208
|
+
get serverRpcUrl() {
|
|
209
|
+
return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0];
|
|
210
|
+
},
|
|
211
|
+
params: {
|
|
212
|
+
chainName: "Avalanche Network",
|
|
213
|
+
nativeCurrency: {
|
|
214
|
+
name: "Avalanche",
|
|
215
|
+
symbol: "AVAX",
|
|
216
|
+
decimals: 18,
|
|
217
|
+
},
|
|
218
|
+
rpcUrls: ["https://rpc.ankr.com/avalanche"],
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: "Fantom",
|
|
223
|
+
chainId: 250,
|
|
224
|
+
zerionName: "fantom",
|
|
225
|
+
explorerUrl: "https://ftmscan.com",
|
|
226
|
+
ankrName: "fantom",
|
|
227
|
+
color: "#1969ff",
|
|
228
|
+
get serverRpcUrl() {
|
|
229
|
+
return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0];
|
|
230
|
+
},
|
|
231
|
+
usdcAddress: "0x04068da6c83afcfa0e13ba15a6696662335d5b75",
|
|
232
|
+
balanceResolverAddress: "0x929376c77a2fb8152375a089a4fccf84ff481479",
|
|
233
|
+
fakeTransactionHash:
|
|
234
|
+
"0x1e9a8405d660172314124e06896212c0786d7fb1550b89410d4bc87e9e8054e4",
|
|
235
|
+
params: {
|
|
236
|
+
rpcUrls: ["https://rpc.ankr.com/fantom"],
|
|
237
|
+
chainName: "Fantom",
|
|
238
|
+
nativeCurrency: {
|
|
239
|
+
name: "Fantom",
|
|
240
|
+
symbol: "FTM",
|
|
241
|
+
decimals: 18,
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
},
|
|
137
245
|
{
|
|
138
246
|
name: "Gnosis",
|
|
139
247
|
debankName: "xdai",
|
|
140
248
|
zerionName: "xdai",
|
|
249
|
+
color: "#04795C",
|
|
250
|
+
ankrName: "gnosis",
|
|
141
251
|
chainId: 100,
|
|
142
252
|
balanceResolverAddress: "0xfaa244e276b1597f663975ed007ee4ff70d27849",
|
|
143
253
|
explorerUrl: "https://gnosisscan.io",
|
|
254
|
+
fakeTransactionHash:
|
|
255
|
+
"0x1513033806310a2c3b29f2276f8aa7388461b0ef9f8499c297e68c12187c179b",
|
|
256
|
+
apiURL: "https://api.gnosisscan.io",
|
|
144
257
|
usdcAddress: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83",
|
|
145
258
|
get serverRpcUrl() {
|
|
146
259
|
return process.env?.GNOSIS_RPC_URL || this.params.rpcUrls[0];
|
|
@@ -156,18 +269,64 @@ export const networks: Network[] = [
|
|
|
156
269
|
},
|
|
157
270
|
},
|
|
158
271
|
{
|
|
159
|
-
name: "
|
|
160
|
-
chainId:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
272
|
+
name: "Aurora",
|
|
273
|
+
chainId: 1313161554,
|
|
274
|
+
zerionName: "aurora",
|
|
275
|
+
color: "#78d64b",
|
|
276
|
+
explorerUrl: "https://explorer.mainnet.aurora.dev",
|
|
277
|
+
fakeTransactionHash:
|
|
278
|
+
"0x0923401c5a80c39a5cd57c098a6c4729edbefd0db6894def7d349493f4ff3ec6",
|
|
164
279
|
get serverRpcUrl() {
|
|
165
|
-
return process.env?.
|
|
280
|
+
return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0];
|
|
166
281
|
},
|
|
282
|
+
usdcAddress: "0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",
|
|
283
|
+
balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
|
|
167
284
|
params: {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
285
|
+
rpcUrls: ["https://mainnet.aurora.dev"],
|
|
286
|
+
chainName: "Aurora",
|
|
287
|
+
nativeCurrency: {
|
|
288
|
+
decimals: 18,
|
|
289
|
+
name: "Aurora ETH",
|
|
290
|
+
symbol: "AETH",
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
name: "Fuse",
|
|
296
|
+
chainId: 122,
|
|
297
|
+
zerionName: "fuse",
|
|
298
|
+
color: "#78d64b",
|
|
299
|
+
explorerUrl: "https://explorer.fuse.io",
|
|
300
|
+
fakeTransactionHash:
|
|
301
|
+
"0xf22a8031de9b978a57c728e18c6b54633356c39db4d0466e53b9b7c3ee7f8def",
|
|
302
|
+
get serverRpcUrl() {
|
|
303
|
+
return process.env?.FUSE_RPC_URL || this.params.rpcUrls[0];
|
|
304
|
+
},
|
|
305
|
+
usdcAddress: "",
|
|
306
|
+
balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
|
|
307
|
+
params: {
|
|
308
|
+
rpcUrls: ["https://fuse-mainnet.chainstacklabs.com"],
|
|
309
|
+
chainName: "Fuse",
|
|
310
|
+
nativeCurrency: {
|
|
311
|
+
decimals: 18,
|
|
312
|
+
name: "Fuse",
|
|
313
|
+
symbol: "fuse",
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
name: "Scroll",
|
|
319
|
+
chainId: 534352,
|
|
320
|
+
color: "#78d64b",
|
|
321
|
+
explorerUrl: "https://scrollscan.com",
|
|
322
|
+
fakeTransactionHash:
|
|
323
|
+
"0x6bf297c414264fc8cddd47224632b4426a02138df2f50fe891eca87f6aefea01",
|
|
324
|
+
get serverRpcUrl() {
|
|
325
|
+
return process.env?.SCROLL_RPC_URL || this.params.rpcUrls[0];
|
|
326
|
+
},
|
|
327
|
+
params: {
|
|
328
|
+
rpcUrls: ["https://rpc.scroll.io"],
|
|
329
|
+
chainName: "Scroll",
|
|
171
330
|
nativeCurrency: {
|
|
172
331
|
name: "Ethereum",
|
|
173
332
|
symbol: "ETH",
|
|
@@ -175,43 +334,22 @@ export const networks: Network[] = [
|
|
|
175
334
|
},
|
|
176
335
|
},
|
|
177
336
|
},
|
|
178
|
-
// {
|
|
179
|
-
// name: "Aurora",
|
|
180
|
-
// chainId: 1313161554,
|
|
181
|
-
// zerionName: "aurora",
|
|
182
|
-
// explorerUrl: "https://explorer.mainnet.aurora.dev",
|
|
183
|
-
// get serverRpcUrl() {
|
|
184
|
-
// return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0];
|
|
185
|
-
// },
|
|
186
|
-
// usdcAddress: "0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",
|
|
187
|
-
// balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
|
|
188
|
-
// params: {
|
|
189
|
-
// rpcUrls: ["https://mainnet.aurora.dev"],
|
|
190
|
-
// chainName: "Aurora",
|
|
191
|
-
// nativeCurrency: {
|
|
192
|
-
// decimals: 18,
|
|
193
|
-
// name: "Aurora ETH",
|
|
194
|
-
// symbol: "AETH",
|
|
195
|
-
// },
|
|
196
|
-
// },
|
|
197
|
-
// },
|
|
198
337
|
{
|
|
199
|
-
name: "
|
|
200
|
-
chainId:
|
|
201
|
-
|
|
202
|
-
explorerUrl: "https://
|
|
203
|
-
|
|
338
|
+
name: "opBNB",
|
|
339
|
+
chainId: 204,
|
|
340
|
+
color: "#78d64b",
|
|
341
|
+
explorerUrl: "https://opbnbscan.com",
|
|
342
|
+
fakeTransactionHash:
|
|
343
|
+
"0xb9438a3eae61442bc7d419d79930370ce09ac0f46e0695025751e3bfe1a931e7",
|
|
204
344
|
get serverRpcUrl() {
|
|
205
|
-
return process.env?.
|
|
345
|
+
return process.env?.OPBNB_RPC_URL || this.params.rpcUrls[0];
|
|
206
346
|
},
|
|
207
|
-
usdcAddress: "0x04068da6c83afcfa0e13ba15a6696662335d5b75",
|
|
208
|
-
balanceResolverAddress: "0x929376c77a2fb8152375a089a4fccf84ff481479",
|
|
209
347
|
params: {
|
|
210
|
-
rpcUrls: ["https://rpc.
|
|
211
|
-
chainName: "
|
|
348
|
+
rpcUrls: ["https://opbnb-mainnet-rpc.bnbchain.org"],
|
|
349
|
+
chainName: "opBNB",
|
|
212
350
|
nativeCurrency: {
|
|
213
|
-
name: "
|
|
214
|
-
symbol: "
|
|
351
|
+
name: "BNB",
|
|
352
|
+
symbol: "BNB",
|
|
215
353
|
decimals: 18,
|
|
216
354
|
},
|
|
217
355
|
},
|
|
@@ -221,6 +359,8 @@ export const networks: Network[] = [
|
|
|
221
359
|
chainId: AVO_PROD_CHAIN_ID,
|
|
222
360
|
isAvocado: true,
|
|
223
361
|
balanceResolverAddress: "",
|
|
362
|
+
fakeTransactionHash: "",
|
|
363
|
+
color: "#16A34A",
|
|
224
364
|
usdcAddress: "",
|
|
225
365
|
serverRpcUrl: AVO_PROD_RPC_URL,
|
|
226
366
|
explorerUrl: AVO_PROD_EXPLORER_URL,
|
|
@@ -239,7 +379,9 @@ export const networks: Network[] = [
|
|
|
239
379
|
name: AVO_STAGING_CHAIN_NAME,
|
|
240
380
|
chainId: AVO_STAGING_CHAIN_ID,
|
|
241
381
|
serverRpcUrl: AVO_STAGING_RPC_URL,
|
|
382
|
+
color: "#16A34A",
|
|
242
383
|
explorerUrl: AVO_STAGING_EXPLORER_URL,
|
|
384
|
+
fakeTransactionHash: "",
|
|
243
385
|
isAvocado: true,
|
|
244
386
|
balanceResolverAddress: "",
|
|
245
387
|
usdcAddress: "",
|
|
@@ -256,6 +398,26 @@ export const networks: Network[] = [
|
|
|
256
398
|
},
|
|
257
399
|
];
|
|
258
400
|
|
|
401
|
+
export const chainUsdcAddresses = [
|
|
402
|
+
{ chainId: 1, address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" },
|
|
403
|
+
{ chainId: 10, address: "0x7f5c764cbc14f9669b88837ca1490cca17c31607" },
|
|
404
|
+
{ chainId: 56, address: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d" },
|
|
405
|
+
{ chainId: 100, address: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83" },
|
|
406
|
+
{ chainId: 137, address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174" },
|
|
407
|
+
{ chainId: 137, address: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359" },
|
|
408
|
+
{ chainId: 250, address: "0x04068da6c83afcfa0e13ba15a6696662335d5b75" },
|
|
409
|
+
{ chainId: 42161, address: "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8" },
|
|
410
|
+
{ chainId: 42161, address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831" },
|
|
411
|
+
{ chainId: 43114, address: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e" },
|
|
412
|
+
{ chainId: 43114, address: "0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664" },
|
|
413
|
+
{ chainId: 1101, address: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035" },
|
|
414
|
+
{
|
|
415
|
+
chainId: 1313161554,
|
|
416
|
+
address: "0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",
|
|
417
|
+
},
|
|
418
|
+
{ chainId: 8453, address: "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA" },
|
|
419
|
+
];
|
|
420
|
+
|
|
259
421
|
export const getNetworkByChainId = (
|
|
260
422
|
chainId: ChainId | number | string
|
|
261
423
|
): Network => {
|
|
@@ -268,12 +430,16 @@ export const availableNetworks = networks.filter(
|
|
|
268
430
|
|
|
269
431
|
export const chainIdToName = (chainId: ChainId | number | string) => {
|
|
270
432
|
const network = getNetworkByChainId(chainId);
|
|
271
|
-
return network
|
|
433
|
+
return network?.name;
|
|
272
434
|
};
|
|
273
435
|
|
|
274
436
|
export const getRpcURLByChainId = (chainId: ChainId | number | string) => {
|
|
275
|
-
|
|
276
|
-
|
|
437
|
+
try {
|
|
438
|
+
const network = getNetworkByChainId(chainId);
|
|
439
|
+
return network.params.rpcUrls[0];
|
|
440
|
+
} catch (e) {
|
|
441
|
+
return "";
|
|
442
|
+
}
|
|
277
443
|
};
|
|
278
444
|
|
|
279
445
|
export const RPCMap = networks.reduce((acc, network) => {
|
|
@@ -315,5 +481,6 @@ export const getExplorerUrl = (
|
|
|
315
481
|
suffix: `/${string}` = "/"
|
|
316
482
|
) => {
|
|
317
483
|
const network = getNetworkByChainId(chainId);
|
|
484
|
+
if (!network) return "";
|
|
318
485
|
return `${network.explorerUrl}${suffix}`;
|
|
319
486
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const fetchTokenByAddress = async (
|
|
2
|
+
address: string,
|
|
3
|
+
chainId: string | number,
|
|
4
|
+
tokens?: ITokenPrice[]
|
|
5
|
+
) => {
|
|
6
|
+
if (!address || !chainId) return null;
|
|
7
|
+
|
|
8
|
+
if (tokens?.length) {
|
|
9
|
+
const token = tokens.find((token) => token.address?.toLocaleLowerCase() === address?.toLocaleLowerCase() && token.chain_id == chainId);
|
|
10
|
+
if (token) return token;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const [token] = (await $fetch(`${blockQueryURL}/${chainId}/tokens`, {
|
|
14
|
+
params: {
|
|
15
|
+
sparkline: false,
|
|
16
|
+
"addresses[]": [address],
|
|
17
|
+
},
|
|
18
|
+
})) as ITokenPrice[];
|
|
19
|
+
|
|
20
|
+
return token;
|
|
21
|
+
};
|