@instadapp/avocado-base 0.0.0-dev.24c65ca → 0.0.0-dev.258fb14
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/.github/workflows/npm-publish-dev.yml +2 -5
- package/abi/forwarder.json +1253 -149
- package/abi/multisigAgnosticForwarder.json +1 -0
- 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/stars.svg +4 -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 +42 -0
- package/components/ActionMetadata.vue +82 -0
- package/components/AuthorityAvatar.vue +37 -0
- package/components/ChainLogo.vue +14 -563
- package/components/CopyClipboard.vue +58 -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 +66 -0
- package/components/metadata/Swap.vue +67 -0
- package/components/metadata/Transfer.vue +50 -0
- package/components.d.ts +13 -0
- package/contracts/Forwarder.ts +856 -2
- package/contracts/MultisigAgnosticForwarder.ts +1413 -0
- package/contracts/MultisigForwarder.ts +859 -0
- package/contracts/factories/Forwarder__factory.ts +816 -16
- package/contracts/factories/MultisigAgnosticForwarder__factory.ts +2051 -0
- package/contracts/factories/MultisigForwarder__factory.ts +721 -0
- package/contracts/factories/index.ts +2 -0
- package/contracts/index.ts +4 -0
- package/nuxt.config.ts +17 -1
- package/package.json +16 -8
- package/utils/avocado.ts +2 -0
- package/utils/bignumber.ts +20 -0
- package/utils/formatter.ts +50 -7
- package/utils/helper.ts +8 -0
- package/utils/metadata.ts +501 -134
- package/utils/network.ts +408 -70
- package/utils/services.ts +21 -0
- package/utils/utils.d.ts +143 -96
package/utils/network.ts
CHANGED
|
@@ -1,36 +1,86 @@
|
|
|
1
1
|
import { ethers } from "ethers";
|
|
2
|
+
import {
|
|
3
|
+
polygon,
|
|
4
|
+
arbitrum,
|
|
5
|
+
mainnet,
|
|
6
|
+
base,
|
|
7
|
+
optimism,
|
|
8
|
+
polygonZkEvm,
|
|
9
|
+
bsc,
|
|
10
|
+
avalanche,
|
|
11
|
+
fantom,
|
|
12
|
+
gnosis,
|
|
13
|
+
aurora,
|
|
14
|
+
fuse,
|
|
15
|
+
scroll,
|
|
16
|
+
opBNB,
|
|
17
|
+
mode,
|
|
18
|
+
blast,
|
|
19
|
+
linea
|
|
20
|
+
} from "viem/chains";
|
|
21
|
+
import {
|
|
22
|
+
AVO_PROD_CHAIN_NAME,
|
|
23
|
+
AVO_PROD_CHAIN_ID,
|
|
24
|
+
AVO_PROD_RPC_URL,
|
|
25
|
+
AVO_PROD_EXPLORER_URL,
|
|
26
|
+
AVO_STAGING_CHAIN_NAME,
|
|
27
|
+
AVO_STAGING_CHAIN_ID,
|
|
28
|
+
AVO_STAGING_RPC_URL,
|
|
29
|
+
AVO_STAGING_EXPLORER_URL,
|
|
30
|
+
} from "./avocado";
|
|
31
|
+
import { defineChain } from "viem";
|
|
2
32
|
|
|
3
|
-
export const bridgeDisabledNetworks = [
|
|
33
|
+
export const bridgeDisabledNetworks = [];
|
|
4
34
|
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
35
|
+
export const networksSimulationNotSupported = [1313161554, 1101];
|
|
36
|
+
|
|
37
|
+
const avocado = defineChain({
|
|
38
|
+
id: AVO_PROD_CHAIN_ID,
|
|
39
|
+
name: AVO_PROD_CHAIN_NAME,
|
|
40
|
+
nativeCurrency: {
|
|
41
|
+
name: "Avocado",
|
|
42
|
+
symbol: "USDC",
|
|
43
|
+
decimals: 18,
|
|
44
|
+
},
|
|
45
|
+
rpcUrls: {
|
|
46
|
+
default: { http: [AVO_PROD_RPC_URL] },
|
|
47
|
+
},
|
|
48
|
+
blockExplorers: {
|
|
49
|
+
default: { name: "Avoscan", url: AVO_PROD_EXPLORER_URL },
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const avocadoStaging = defineChain({
|
|
54
|
+
id: AVO_STAGING_CHAIN_ID,
|
|
55
|
+
name: AVO_STAGING_CHAIN_NAME,
|
|
56
|
+
nativeCurrency: {
|
|
57
|
+
name: "Avocado",
|
|
58
|
+
symbol: "USDC",
|
|
59
|
+
decimals: 18,
|
|
60
|
+
},
|
|
61
|
+
rpcUrls: {
|
|
62
|
+
default: { http: [AVO_STAGING_RPC_URL] },
|
|
63
|
+
},
|
|
64
|
+
blockExplorers: {
|
|
65
|
+
default: { name: "Avoscan", url: AVO_STAGING_EXPLORER_URL },
|
|
25
66
|
},
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export const networks: Network[] = [
|
|
26
70
|
{
|
|
27
71
|
name: "Polygon",
|
|
28
72
|
debankName: "matic",
|
|
29
73
|
ankrName: "polygon",
|
|
74
|
+
zerionName: "polygon",
|
|
75
|
+
color: "#7A4ADD",
|
|
30
76
|
chainId: 137,
|
|
77
|
+
viemChain: polygon,
|
|
31
78
|
balanceResolverAddress: "0x58632D23120b20650262b8A629a14e4F4043E0D9",
|
|
32
79
|
usdcAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
|
33
80
|
explorerUrl: "https://polygonscan.com",
|
|
81
|
+
apiURL: "https://api.polygonscan.com/api",
|
|
82
|
+
fakeTransactionHash:
|
|
83
|
+
"0x906c551abd5873a428505b6530ac14d91367820706c7ee525f6d7313265d1c92",
|
|
34
84
|
get serverRpcUrl() {
|
|
35
85
|
return process.env?.POLYGON_RPC_URL || this.params.rpcUrls[0];
|
|
36
86
|
},
|
|
@@ -48,10 +98,16 @@ export const networks: Network[] = [
|
|
|
48
98
|
name: "Arbitrum",
|
|
49
99
|
debankName: "arb",
|
|
50
100
|
ankrName: "arbitrum",
|
|
101
|
+
zerionName: "arbitrum",
|
|
102
|
+
viemChain: arbitrum,
|
|
103
|
+
color: "#2D374B",
|
|
51
104
|
chainId: 42161,
|
|
52
105
|
usdcAddress: "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
|
|
53
106
|
balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
|
|
107
|
+
fakeTransactionHash:
|
|
108
|
+
"0x9fa291c3b09d31f19b1fa5dd05f30169d1364036d5f7c14b026410bc07bd8843",
|
|
54
109
|
explorerUrl: "https://arbiscan.io",
|
|
110
|
+
apiURL: "https://api.arbiscan.io/api",
|
|
55
111
|
get serverRpcUrl() {
|
|
56
112
|
return process.env?.ARBITRUM_RPC_URL || this.params.rpcUrls[0];
|
|
57
113
|
},
|
|
@@ -65,13 +121,70 @@ export const networks: Network[] = [
|
|
|
65
121
|
rpcUrls: ["https://arb1.arbitrum.io/rpc"],
|
|
66
122
|
},
|
|
67
123
|
},
|
|
124
|
+
{
|
|
125
|
+
name: "Ethereum",
|
|
126
|
+
debankName: "eth",
|
|
127
|
+
ankrName: "eth",
|
|
128
|
+
zerionName: "ethereum",
|
|
129
|
+
viemChain: mainnet,
|
|
130
|
+
chainId: 1,
|
|
131
|
+
explorerUrl: "https://etherscan.io",
|
|
132
|
+
fakeTransactionHash:
|
|
133
|
+
"0x13232dd32cef2f641ead890a507710c96560c8c9c3d5fab6facb5ec563c49433",
|
|
134
|
+
apiURL: "https://api.etherscan.io/api",
|
|
135
|
+
color: "#5D5FEF",
|
|
136
|
+
get serverRpcUrl() {
|
|
137
|
+
return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0];
|
|
138
|
+
},
|
|
139
|
+
balanceResolverAddress: "0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43",
|
|
140
|
+
usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
141
|
+
params: {
|
|
142
|
+
rpcUrls: ["https://rpc.ankr.com/eth"],
|
|
143
|
+
nativeCurrency: {
|
|
144
|
+
name: "Ethereum",
|
|
145
|
+
symbol: "ETH",
|
|
146
|
+
decimals: 18,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "Base",
|
|
152
|
+
chainId: 8453,
|
|
153
|
+
color: "#1E2024",
|
|
154
|
+
ankrName: "base",
|
|
155
|
+
viemChain: base,
|
|
156
|
+
explorerUrl: "https://basescan.org",
|
|
157
|
+
fakeTransactionHash:
|
|
158
|
+
"0xf7833d80da33730c4fc5d4c64151f0eaa64c0c0535be022af0228a44cc4e9c8e",
|
|
159
|
+
apiURL: "https://api.basescan.org/api",
|
|
160
|
+
get serverRpcUrl() {
|
|
161
|
+
return process.env?.BASE_RPC_URL || this.params.rpcUrls[0];
|
|
162
|
+
},
|
|
163
|
+
usdcAddress: "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA",
|
|
164
|
+
balanceResolverAddress: "0x23c8EAb8a4373dD16b0947Ebe8bf76Ff7A49d13C",
|
|
165
|
+
params: {
|
|
166
|
+
rpcUrls: ["https://rpc.ankr.com/base"],
|
|
167
|
+
chainName: "Base",
|
|
168
|
+
nativeCurrency: {
|
|
169
|
+
name: "Ethereum",
|
|
170
|
+
symbol: "ETH",
|
|
171
|
+
decimals: 18,
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
68
175
|
{
|
|
69
176
|
name: "Optimism",
|
|
70
177
|
debankName: "op",
|
|
71
178
|
ankrName: "optimism",
|
|
179
|
+
zerionName: "optimism",
|
|
180
|
+
color: "#FF0420",
|
|
181
|
+
viemChain: optimism,
|
|
72
182
|
chainId: 10,
|
|
183
|
+
apiURL: "https://api-optimistic.etherscan.io/api",
|
|
73
184
|
usdcAddress: "0x7f5c764cbc14f9669b88837ca1490cca17c31607",
|
|
74
185
|
balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
|
|
186
|
+
fakeTransactionHash:
|
|
187
|
+
"0xee7311d68059732b05088f2144dfec6c7a4f5fd0433eb85306afcd6bdf17cebc",
|
|
75
188
|
explorerUrl: "https://optimistic.etherscan.io",
|
|
76
189
|
get serverRpcUrl() {
|
|
77
190
|
return process.env?.OPTIMISM_RPC_URL || this.params.rpcUrls[0];
|
|
@@ -83,36 +196,46 @@ export const networks: Network[] = [
|
|
|
83
196
|
symbol: "ETH",
|
|
84
197
|
decimals: 18,
|
|
85
198
|
},
|
|
86
|
-
rpcUrls: ["https://
|
|
199
|
+
rpcUrls: ["https://rpc.ankr.com/optimism"],
|
|
87
200
|
},
|
|
88
201
|
},
|
|
89
202
|
{
|
|
90
|
-
name: "
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
203
|
+
name: "Polygon zkEVM",
|
|
204
|
+
chainId: 1101,
|
|
205
|
+
color: "#8544f6",
|
|
206
|
+
ankrName: "polygon_zkevm",
|
|
207
|
+
viemChain: polygonZkEvm,
|
|
208
|
+
explorerUrl: "https://zkevm.polygonscan.com",
|
|
209
|
+
apiURL: "https://api-zkevm.polygonscan.com/api",
|
|
210
|
+
balanceResolverAddress: "0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01",
|
|
211
|
+
fakeTransactionHash:
|
|
212
|
+
"0x1077130463ade91ad4e9c43c3195298e26a99970975238128912490eea12bf41",
|
|
213
|
+
usdcAddress: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
|
|
97
214
|
get serverRpcUrl() {
|
|
98
|
-
return process.env?.
|
|
215
|
+
return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0];
|
|
99
216
|
},
|
|
100
217
|
params: {
|
|
101
|
-
chainName: "
|
|
218
|
+
chainName: "polygon zkEVM",
|
|
219
|
+
rpcUrls: ["https://zkevm-rpc.com"],
|
|
102
220
|
nativeCurrency: {
|
|
103
|
-
name: "
|
|
104
|
-
symbol: "
|
|
221
|
+
name: "Ethereum",
|
|
222
|
+
symbol: "ETH",
|
|
105
223
|
decimals: 18,
|
|
106
224
|
},
|
|
107
|
-
rpcUrls: ["https://api.avax.network/ext/bc/C/rpc"],
|
|
108
225
|
},
|
|
109
226
|
},
|
|
110
227
|
{
|
|
111
228
|
name: "BSC",
|
|
112
229
|
debankName: "bsc",
|
|
113
230
|
ankrName: "bsc",
|
|
231
|
+
zerionName: "binance-smart-chain",
|
|
232
|
+
color: "#F3BA2F",
|
|
114
233
|
chainId: 56,
|
|
115
234
|
explorerUrl: "https://bscscan.com",
|
|
235
|
+
viemChain: bsc,
|
|
236
|
+
fakeTransactionHash:
|
|
237
|
+
"0x897d54bf8e492f840bd4d8f1e743bfcab8226ab4d5a899e47ee433dcd6d6abf7",
|
|
238
|
+
apiURL: "https://api.bscscan.com/api",
|
|
116
239
|
usdcAddress: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
|
|
117
240
|
balanceResolverAddress: "0xb808cff38706e267067b0af427726aa099f69f89",
|
|
118
241
|
get serverRpcUrl() {
|
|
@@ -128,13 +251,72 @@ export const networks: Network[] = [
|
|
|
128
251
|
},
|
|
129
252
|
},
|
|
130
253
|
},
|
|
254
|
+
{
|
|
255
|
+
name: "Avalanche",
|
|
256
|
+
debankName: "avax",
|
|
257
|
+
ankrName: "avalanche",
|
|
258
|
+
zerionName: "avalanche",
|
|
259
|
+
color: "#EB5757",
|
|
260
|
+
viemChain: avalanche,
|
|
261
|
+
chainId: 43114,
|
|
262
|
+
usdcAddress: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
|
|
263
|
+
balanceResolverAddress: "0x63009f31D054E0ac9F321Cf0D642375236A4Bf1E",
|
|
264
|
+
explorerUrl: "https://snowtrace.io",
|
|
265
|
+
fakeTransactionHash:
|
|
266
|
+
"0x233aac7402558dd4e23f938a50f983e67f5c9604233981c7ac74e63737b8294e",
|
|
267
|
+
apiURL: "https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan/api",
|
|
268
|
+
get serverRpcUrl() {
|
|
269
|
+
return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0];
|
|
270
|
+
},
|
|
271
|
+
params: {
|
|
272
|
+
chainName: "Avalanche Network",
|
|
273
|
+
nativeCurrency: {
|
|
274
|
+
name: "Avalanche",
|
|
275
|
+
symbol: "AVAX",
|
|
276
|
+
decimals: 18,
|
|
277
|
+
},
|
|
278
|
+
rpcUrls: ["https://rpc.ankr.com/avalanche"],
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
name: "Fantom",
|
|
283
|
+
chainId: 250,
|
|
284
|
+
zerionName: "fantom",
|
|
285
|
+
explorerUrl: "https://ftmscan.com",
|
|
286
|
+
apiURL: 'https://api.ftmscan.com/api',
|
|
287
|
+
ankrName: "fantom",
|
|
288
|
+
color: "#1969ff",
|
|
289
|
+
viemChain: fantom,
|
|
290
|
+
get serverRpcUrl() {
|
|
291
|
+
return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0];
|
|
292
|
+
},
|
|
293
|
+
usdcAddress: "0x04068da6c83afcfa0e13ba15a6696662335d5b75",
|
|
294
|
+
balanceResolverAddress: "0x929376c77a2fb8152375a089a4fccf84ff481479",
|
|
295
|
+
fakeTransactionHash:
|
|
296
|
+
"0x1e9a8405d660172314124e06896212c0786d7fb1550b89410d4bc87e9e8054e4",
|
|
297
|
+
params: {
|
|
298
|
+
rpcUrls: ["https://rpc.ankr.com/fantom"],
|
|
299
|
+
chainName: "Fantom",
|
|
300
|
+
nativeCurrency: {
|
|
301
|
+
name: "Fantom",
|
|
302
|
+
symbol: "FTM",
|
|
303
|
+
decimals: 18,
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
},
|
|
131
307
|
{
|
|
132
308
|
name: "Gnosis",
|
|
133
309
|
debankName: "xdai",
|
|
310
|
+
zerionName: "xdai",
|
|
311
|
+
color: "#04795C",
|
|
134
312
|
ankrName: "gnosis",
|
|
313
|
+
viemChain: gnosis,
|
|
135
314
|
chainId: 100,
|
|
136
315
|
balanceResolverAddress: "0xfaa244e276b1597f663975ed007ee4ff70d27849",
|
|
137
316
|
explorerUrl: "https://gnosisscan.io",
|
|
317
|
+
fakeTransactionHash:
|
|
318
|
+
"0x1513033806310a2c3b29f2276f8aa7388461b0ef9f8499c297e68c12187c179b",
|
|
319
|
+
apiURL: "https://api.gnosisscan.io/api",
|
|
138
320
|
usdcAddress: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83",
|
|
139
321
|
get serverRpcUrl() {
|
|
140
322
|
return process.env?.GNOSIS_RPC_URL || this.params.rpcUrls[0];
|
|
@@ -150,18 +332,71 @@ export const networks: Network[] = [
|
|
|
150
332
|
},
|
|
151
333
|
},
|
|
152
334
|
{
|
|
153
|
-
name: "
|
|
154
|
-
chainId:
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
335
|
+
name: "Aurora",
|
|
336
|
+
chainId: 1313161554,
|
|
337
|
+
zerionName: "aurora",
|
|
338
|
+
color: "#78d64b",
|
|
339
|
+
viemChain: aurora,
|
|
340
|
+
explorerUrl: "https://explorer.mainnet.aurora.dev",
|
|
341
|
+
apiURL:'https://explorer.mainnet.aurora.dev/api/v2',
|
|
342
|
+
fakeTransactionHash:
|
|
343
|
+
"0x0923401c5a80c39a5cd57c098a6c4729edbefd0db6894def7d349493f4ff3ec6",
|
|
158
344
|
get serverRpcUrl() {
|
|
159
|
-
return process.env?.
|
|
345
|
+
return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0];
|
|
160
346
|
},
|
|
347
|
+
usdcAddress: "0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",
|
|
348
|
+
balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
|
|
161
349
|
params: {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
350
|
+
rpcUrls: ["https://mainnet.aurora.dev"],
|
|
351
|
+
chainName: "Aurora",
|
|
352
|
+
nativeCurrency: {
|
|
353
|
+
decimals: 18,
|
|
354
|
+
name: "Aurora ETH",
|
|
355
|
+
symbol: "AETH",
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
name: "Fuse",
|
|
361
|
+
chainId: 122,
|
|
362
|
+
zerionName: "fuse",
|
|
363
|
+
color: "#78d64b",
|
|
364
|
+
explorerUrl: "https://explorer.fuse.io",
|
|
365
|
+
apiURL: 'https://explorer.fuse.io/api/v2',
|
|
366
|
+
viemChain: fuse,
|
|
367
|
+
fakeTransactionHash:
|
|
368
|
+
"0xf22a8031de9b978a57c728e18c6b54633356c39db4d0466e53b9b7c3ee7f8def",
|
|
369
|
+
get serverRpcUrl() {
|
|
370
|
+
return process.env?.FUSE_RPC_URL || this.params.rpcUrls[0];
|
|
371
|
+
},
|
|
372
|
+
usdcAddress: "",
|
|
373
|
+
balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
|
|
374
|
+
params: {
|
|
375
|
+
rpcUrls: ["https://fuse-mainnet.chainstacklabs.com"],
|
|
376
|
+
chainName: "Fuse",
|
|
377
|
+
nativeCurrency: {
|
|
378
|
+
decimals: 18,
|
|
379
|
+
name: "Fuse",
|
|
380
|
+
symbol: "fuse",
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
name: "Scroll",
|
|
386
|
+
chainId: 534352,
|
|
387
|
+
color: "#78d64b",
|
|
388
|
+
ankrName: 'scroll',
|
|
389
|
+
explorerUrl: "https://scrollscan.com",
|
|
390
|
+
apiURL: 'https://api.scrollscan.com/api',
|
|
391
|
+
viemChain: scroll,
|
|
392
|
+
fakeTransactionHash:
|
|
393
|
+
"0x6bf297c414264fc8cddd47224632b4426a02138df2f50fe891eca87f6aefea01",
|
|
394
|
+
get serverRpcUrl() {
|
|
395
|
+
return process.env?.SCROLL_RPC_URL || this.params.rpcUrls[0];
|
|
396
|
+
},
|
|
397
|
+
params: {
|
|
398
|
+
rpcUrls: ["https://rpc.scroll.io"],
|
|
399
|
+
chainName: "Scroll",
|
|
165
400
|
nativeCurrency: {
|
|
166
401
|
name: "Ethereum",
|
|
167
402
|
symbol: "ETH",
|
|
@@ -170,48 +405,119 @@ export const networks: Network[] = [
|
|
|
170
405
|
},
|
|
171
406
|
},
|
|
172
407
|
{
|
|
173
|
-
name: "
|
|
174
|
-
chainId:
|
|
175
|
-
|
|
408
|
+
name: "opBNB",
|
|
409
|
+
chainId: 204,
|
|
410
|
+
color: "#78d64b",
|
|
411
|
+
explorerUrl: "https://opbnbscan.com",
|
|
412
|
+
apiURL: null,
|
|
413
|
+
viemChain: opBNB,
|
|
414
|
+
fakeTransactionHash:
|
|
415
|
+
"0xb9438a3eae61442bc7d419d79930370ce09ac0f46e0695025751e3bfe1a931e7",
|
|
176
416
|
get serverRpcUrl() {
|
|
177
|
-
return process.env?.
|
|
417
|
+
return process.env?.OPBNB_RPC_URL || this.params.rpcUrls[0];
|
|
178
418
|
},
|
|
179
|
-
usdcAddress: "0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",
|
|
180
|
-
balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
|
|
181
419
|
params: {
|
|
182
|
-
rpcUrls: ["https://mainnet.
|
|
183
|
-
chainName: "
|
|
420
|
+
rpcUrls: ["https://opbnb-mainnet-rpc.bnbchain.org"],
|
|
421
|
+
chainName: "opBNB",
|
|
184
422
|
nativeCurrency: {
|
|
423
|
+
name: "BNB",
|
|
424
|
+
symbol: "BNB",
|
|
185
425
|
decimals: 18,
|
|
186
|
-
name: "Aurora ETH",
|
|
187
|
-
symbol: "AETH",
|
|
188
426
|
},
|
|
189
427
|
},
|
|
190
428
|
},
|
|
191
429
|
{
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
430
|
+
chainId: 34443,
|
|
431
|
+
name: "Mode",
|
|
432
|
+
color: "#d7ff00",
|
|
433
|
+
explorerUrl: 'https://explorer.mode.network',
|
|
434
|
+
fakeTransactionHash: '0xb58002db3481f2c51855a91280ec940d0bebec075c4b362b9f90c21a2b14edbe',
|
|
435
|
+
apiURL: 'https://explorer.mode.network/api/v2',
|
|
436
|
+
params: {
|
|
437
|
+
rpcUrls: ["https://1rpc.io/mode"],
|
|
438
|
+
chainName: "Mode",
|
|
439
|
+
nativeCurrency: {
|
|
440
|
+
name: "Ethereum",
|
|
441
|
+
symbol: "ETH",
|
|
442
|
+
decimals: 18,
|
|
443
|
+
}
|
|
444
|
+
},
|
|
195
445
|
get serverRpcUrl() {
|
|
196
|
-
return process.env?.
|
|
446
|
+
return process.env?.MODE_RPC_URL || this.params.rpcUrls[0];
|
|
197
447
|
},
|
|
198
|
-
|
|
199
|
-
|
|
448
|
+
viemChain: mode,
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
chainId: 81457,
|
|
452
|
+
name: "Blast",
|
|
453
|
+
color: "#78d64b",
|
|
454
|
+
explorerUrl: 'https://blastscan.io',
|
|
455
|
+
apiURL:'https://api.blastscan.io/api',
|
|
456
|
+
fakeTransactionHash: '0x934ed8516242f8c08bb9e0e90bb1f989d92ceb6b0333e86ac2d555f25ac27e58',
|
|
200
457
|
params: {
|
|
201
|
-
rpcUrls: [
|
|
202
|
-
chainName: "
|
|
458
|
+
rpcUrls: ['https://rpc.ankr.com/blast'],
|
|
459
|
+
chainName: "Blast",
|
|
203
460
|
nativeCurrency: {
|
|
204
|
-
name: "
|
|
205
|
-
symbol: "
|
|
461
|
+
name: "Ethereum",
|
|
462
|
+
symbol: "ETH",
|
|
206
463
|
decimals: 18,
|
|
464
|
+
}
|
|
465
|
+
},
|
|
466
|
+
get serverRpcUrl() {
|
|
467
|
+
return process.env?.BLAST_RPC_URL || this.params.rpcUrls[0];
|
|
468
|
+
},
|
|
469
|
+
viemChain: blast,
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
chainId: 59144,
|
|
473
|
+
name: "Linea",
|
|
474
|
+
apiURL: "https://api.lineascan.build/api",
|
|
475
|
+
color: "#78d64b",
|
|
476
|
+
explorerUrl: "https://lineascan.build",
|
|
477
|
+
params: {
|
|
478
|
+
rpcUrls: ["https://linea-mainnet.public.blastapi.io"],
|
|
479
|
+
chainName: "Linea",
|
|
480
|
+
"nativeCurrency": {
|
|
481
|
+
"name": "Linea Ether",
|
|
482
|
+
"symbol": "ETH",
|
|
483
|
+
"decimals": 18
|
|
207
484
|
},
|
|
208
485
|
},
|
|
486
|
+
fakeTransactionHash: '0x62d068a66eb1515a09e993200e8a495c7fead512689ba78e50523c8e83bbf5b5',
|
|
487
|
+
get serverRpcUrl() {
|
|
488
|
+
return process.env?.LINEA_RPC_URL || this.params.rpcUrls[0];
|
|
489
|
+
},
|
|
490
|
+
viemChain: linea,
|
|
491
|
+
ankrName:'linea',
|
|
209
492
|
},
|
|
493
|
+
// {
|
|
494
|
+
// name: "Manta Pacific",
|
|
495
|
+
// chainId: 169,
|
|
496
|
+
// explorerUrl: "https://pacific-explorer.manta.network",
|
|
497
|
+
// params: {
|
|
498
|
+
// rpcUrls: ["https://pacific-rpc.manta.network/http"],
|
|
499
|
+
// chainName: "Manta Pacific",
|
|
500
|
+
// nativeCurrency: {
|
|
501
|
+
// name: "Ethereum",
|
|
502
|
+
// symbol: "ETH",
|
|
503
|
+
// decimals: 18,
|
|
504
|
+
// },
|
|
505
|
+
// },
|
|
506
|
+
// color: "#78d64b",
|
|
507
|
+
// fakeTransactionHash: "0x3fB128aA5AC254C8539996B11C587E521AE0d3ab",
|
|
508
|
+
// get serverRpcUrl() {
|
|
509
|
+
// return process.env?.MANTA_RPC_URL || this.params.rpcUrls[0];
|
|
510
|
+
// },
|
|
511
|
+
// },
|
|
210
512
|
{
|
|
211
513
|
name: AVO_PROD_CHAIN_NAME,
|
|
212
514
|
chainId: AVO_PROD_CHAIN_ID,
|
|
515
|
+
apiURL:null,
|
|
213
516
|
isAvocado: true,
|
|
214
517
|
balanceResolverAddress: "",
|
|
518
|
+
fakeTransactionHash: "",
|
|
519
|
+
viemChain: avocado,
|
|
520
|
+
color: "#16A34A",
|
|
215
521
|
usdcAddress: "",
|
|
216
522
|
serverRpcUrl: AVO_PROD_RPC_URL,
|
|
217
523
|
explorerUrl: AVO_PROD_EXPLORER_URL,
|
|
@@ -228,9 +534,13 @@ export const networks: Network[] = [
|
|
|
228
534
|
},
|
|
229
535
|
{
|
|
230
536
|
name: AVO_STAGING_CHAIN_NAME,
|
|
537
|
+
apiURL: null,
|
|
231
538
|
chainId: AVO_STAGING_CHAIN_ID,
|
|
232
539
|
serverRpcUrl: AVO_STAGING_RPC_URL,
|
|
540
|
+
color: "#16A34A",
|
|
233
541
|
explorerUrl: AVO_STAGING_EXPLORER_URL,
|
|
542
|
+
viemChain: avocadoStaging,
|
|
543
|
+
fakeTransactionHash: "",
|
|
234
544
|
isAvocado: true,
|
|
235
545
|
balanceResolverAddress: "",
|
|
236
546
|
usdcAddress: "",
|
|
@@ -247,6 +557,26 @@ export const networks: Network[] = [
|
|
|
247
557
|
},
|
|
248
558
|
];
|
|
249
559
|
|
|
560
|
+
export const chainUsdcAddresses = [
|
|
561
|
+
{ chainId: 1, address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" },
|
|
562
|
+
{ chainId: 10, address: "0x7f5c764cbc14f9669b88837ca1490cca17c31607" },
|
|
563
|
+
{ chainId: 56, address: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d" },
|
|
564
|
+
{ chainId: 100, address: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83" },
|
|
565
|
+
{ chainId: 137, address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174" },
|
|
566
|
+
{ chainId: 137, address: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359" },
|
|
567
|
+
{ chainId: 250, address: "0x04068da6c83afcfa0e13ba15a6696662335d5b75" },
|
|
568
|
+
{ chainId: 42161, address: "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8" },
|
|
569
|
+
{ chainId: 42161, address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831" },
|
|
570
|
+
{ chainId: 43114, address: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e" },
|
|
571
|
+
{ chainId: 43114, address: "0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664" },
|
|
572
|
+
{ chainId: 1101, address: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035" },
|
|
573
|
+
{
|
|
574
|
+
chainId: 1313161554,
|
|
575
|
+
address: "0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",
|
|
576
|
+
},
|
|
577
|
+
{ chainId: 8453, address: "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA" },
|
|
578
|
+
];
|
|
579
|
+
|
|
250
580
|
export const getNetworkByChainId = (
|
|
251
581
|
chainId: ChainId | number | string
|
|
252
582
|
): Network => {
|
|
@@ -259,12 +589,16 @@ export const availableNetworks = networks.filter(
|
|
|
259
589
|
|
|
260
590
|
export const chainIdToName = (chainId: ChainId | number | string) => {
|
|
261
591
|
const network = getNetworkByChainId(chainId);
|
|
262
|
-
return network
|
|
592
|
+
return network?.name;
|
|
263
593
|
};
|
|
264
594
|
|
|
265
595
|
export const getRpcURLByChainId = (chainId: ChainId | number | string) => {
|
|
266
|
-
|
|
267
|
-
|
|
596
|
+
try {
|
|
597
|
+
const network = getNetworkByChainId(chainId);
|
|
598
|
+
return network.params.rpcUrls[0];
|
|
599
|
+
} catch (e) {
|
|
600
|
+
return "";
|
|
601
|
+
}
|
|
268
602
|
};
|
|
269
603
|
|
|
270
604
|
export const RPCMap = networks.reduce((acc, network) => {
|
|
@@ -274,13 +608,16 @@ export const RPCMap = networks.reduce((acc, network) => {
|
|
|
274
608
|
|
|
275
609
|
export const networkIds = networks.map((network) => network.chainId);
|
|
276
610
|
|
|
277
|
-
const rpcInstances: Record<string, ethers.providers.
|
|
278
|
-
const serverRpcInstances: Record<
|
|
611
|
+
const rpcInstances: Record<string, ethers.providers.StaticJsonRpcProvider> = {};
|
|
612
|
+
const serverRpcInstances: Record<
|
|
613
|
+
string,
|
|
614
|
+
ethers.providers.StaticJsonRpcProvider
|
|
615
|
+
> = {};
|
|
279
616
|
|
|
280
617
|
export const getServerRpcProvider = (chainId: number | string) => {
|
|
281
618
|
if (!rpcInstances[chainId]) {
|
|
282
619
|
const network = networks.find((n) => n.chainId == chainId);
|
|
283
|
-
serverRpcInstances[chainId] = new ethers.providers.
|
|
620
|
+
serverRpcInstances[chainId] = new ethers.providers.StaticJsonRpcProvider(
|
|
284
621
|
network?.serverRpcUrl
|
|
285
622
|
);
|
|
286
623
|
}
|
|
@@ -290,7 +627,7 @@ export const getServerRpcProvider = (chainId: number | string) => {
|
|
|
290
627
|
|
|
291
628
|
export const getRpcProvider = (chainId: number | string) => {
|
|
292
629
|
if (!rpcInstances[chainId]) {
|
|
293
|
-
rpcInstances[chainId] = new ethers.providers.
|
|
630
|
+
rpcInstances[chainId] = new ethers.providers.StaticJsonRpcProvider(
|
|
294
631
|
getRpcURLByChainId(Number(chainId))
|
|
295
632
|
);
|
|
296
633
|
}
|
|
@@ -303,5 +640,6 @@ export const getExplorerUrl = (
|
|
|
303
640
|
suffix: `/${string}` = "/"
|
|
304
641
|
) => {
|
|
305
642
|
const network = getNetworkByChainId(chainId);
|
|
643
|
+
if (!network) return "";
|
|
306
644
|
return `${network.explorerUrl}${suffix}`;
|
|
307
645
|
};
|
|
@@ -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
|
+
};
|