@gearbox-protocol/sdk 3.0.0-vfour.306 → 3.0.0-vfour.307
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/dist/cjs/sdk/chain/chains.js +28 -13
- package/dist/esm/sdk/chain/chains.js +28 -13
- package/package.json +1 -1
|
@@ -37,21 +37,36 @@ const SUPPORTED_NETWORKS = [
|
|
|
37
37
|
"Sonic"
|
|
38
38
|
];
|
|
39
39
|
const NetworkType = import_zod.z.enum(SUPPORTED_NETWORKS);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
default: {
|
|
49
|
-
name: "Sonic Explorer",
|
|
50
|
-
url: "https://sonicscan.org",
|
|
51
|
-
apiUrl: "https://api.sonicscan.org/api"
|
|
40
|
+
function withPublicNode(chain, subdomain) {
|
|
41
|
+
return (0, import_viem.defineChain)({
|
|
42
|
+
...chain,
|
|
43
|
+
rpcUrls: {
|
|
44
|
+
...chain.rpcUrls,
|
|
45
|
+
publicnode: {
|
|
46
|
+
http: [`https://${subdomain}.publicnode.com`],
|
|
47
|
+
webSocket: [`wss://${subdomain}.publicnode.com`]
|
|
52
48
|
}
|
|
53
49
|
}
|
|
54
|
-
})
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
const chains = {
|
|
53
|
+
Mainnet: withPublicNode(import_chains.mainnet, "ethereum-rpc"),
|
|
54
|
+
Arbitrum: withPublicNode(import_chains.arbitrum, "arbitrum-one-rpc"),
|
|
55
|
+
Optimism: withPublicNode(import_chains.optimism, "optimism-rpc"),
|
|
56
|
+
Base: withPublicNode(import_chains.base, "base-rpc"),
|
|
57
|
+
Sonic: withPublicNode(
|
|
58
|
+
(0, import_viem.defineChain)({
|
|
59
|
+
...import_chains.sonic,
|
|
60
|
+
blockExplorers: {
|
|
61
|
+
default: {
|
|
62
|
+
name: "Sonic Explorer",
|
|
63
|
+
url: "https://sonicscan.org",
|
|
64
|
+
apiUrl: "https://api.sonicscan.org/api"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}),
|
|
68
|
+
"sonic-rpc"
|
|
69
|
+
)
|
|
55
70
|
};
|
|
56
71
|
const CHAINS_BY_ID = {
|
|
57
72
|
[import_chains.mainnet.id]: "Mainnet",
|
|
@@ -9,21 +9,36 @@ const SUPPORTED_NETWORKS = [
|
|
|
9
9
|
"Sonic"
|
|
10
10
|
];
|
|
11
11
|
const NetworkType = z.enum(SUPPORTED_NETWORKS);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
default: {
|
|
21
|
-
name: "Sonic Explorer",
|
|
22
|
-
url: "https://sonicscan.org",
|
|
23
|
-
apiUrl: "https://api.sonicscan.org/api"
|
|
12
|
+
function withPublicNode(chain, subdomain) {
|
|
13
|
+
return defineChain({
|
|
14
|
+
...chain,
|
|
15
|
+
rpcUrls: {
|
|
16
|
+
...chain.rpcUrls,
|
|
17
|
+
publicnode: {
|
|
18
|
+
http: [`https://${subdomain}.publicnode.com`],
|
|
19
|
+
webSocket: [`wss://${subdomain}.publicnode.com`]
|
|
24
20
|
}
|
|
25
21
|
}
|
|
26
|
-
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const chains = {
|
|
25
|
+
Mainnet: withPublicNode(mainnet, "ethereum-rpc"),
|
|
26
|
+
Arbitrum: withPublicNode(arbitrum, "arbitrum-one-rpc"),
|
|
27
|
+
Optimism: withPublicNode(optimism, "optimism-rpc"),
|
|
28
|
+
Base: withPublicNode(base, "base-rpc"),
|
|
29
|
+
Sonic: withPublicNode(
|
|
30
|
+
defineChain({
|
|
31
|
+
...sonic,
|
|
32
|
+
blockExplorers: {
|
|
33
|
+
default: {
|
|
34
|
+
name: "Sonic Explorer",
|
|
35
|
+
url: "https://sonicscan.org",
|
|
36
|
+
apiUrl: "https://api.sonicscan.org/api"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
"sonic-rpc"
|
|
41
|
+
)
|
|
27
42
|
};
|
|
28
43
|
const CHAINS_BY_ID = {
|
|
29
44
|
[mainnet.id]: "Mainnet",
|