web3-tools-mcp 1.2.3 → 1.3.0
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/README.md +11 -5
- package/dist/client.d.ts +483 -411
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +107 -14
- package/dist/client.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/tools/advanced.d.ts +12 -12
- package/dist/tools/balance.d.ts +6 -6
- package/dist/tools/contract-info.d.ts +12 -12
- package/dist/tools/contract.d.ts +10 -10
- package/dist/tools/ens.d.ts +20 -20
- package/dist/tools/logs.d.ts +4 -4
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +128 -14
- package/src/index.ts +1 -1
- package/src/types.ts +14 -1
package/dist/tools/ens.d.ts
CHANGED
|
@@ -4,20 +4,20 @@ declare const _default: {
|
|
|
4
4
|
title: string;
|
|
5
5
|
description: string;
|
|
6
6
|
schema: z.ZodObject<{
|
|
7
|
-
chain: z.ZodDefault<z.ZodEnum<["mainnet", "base", "
|
|
7
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "arbitrum", "avalanche", "base", "bnb", "gnosis", "sonic", "optimism", "polygon", "zksync", "linea", "unichain", "localhost"]>>;
|
|
8
8
|
name: z.ZodString;
|
|
9
9
|
universalResolver: z.ZodOptional<z.ZodBoolean>;
|
|
10
10
|
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
chain: "mainnet" | "base" | "
|
|
11
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
12
12
|
name: string;
|
|
13
13
|
universalResolver?: boolean | undefined;
|
|
14
14
|
}, {
|
|
15
15
|
name: string;
|
|
16
|
-
chain?: "mainnet" | "base" | "
|
|
16
|
+
chain?: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost" | undefined;
|
|
17
17
|
universalResolver?: boolean | undefined;
|
|
18
18
|
}>;
|
|
19
19
|
handler: (args: {
|
|
20
|
-
chain: "mainnet" | "base" | "
|
|
20
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
21
21
|
name: string;
|
|
22
22
|
universalResolver?: boolean | undefined;
|
|
23
23
|
}) => Promise<import("../types.js").ToolResult>;
|
|
@@ -26,20 +26,20 @@ declare const _default: {
|
|
|
26
26
|
title: string;
|
|
27
27
|
description: string;
|
|
28
28
|
schema: z.ZodObject<{
|
|
29
|
-
chain: z.ZodDefault<z.ZodEnum<["mainnet", "base", "
|
|
29
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "arbitrum", "avalanche", "base", "bnb", "gnosis", "sonic", "optimism", "polygon", "zksync", "linea", "unichain", "localhost"]>>;
|
|
30
30
|
address: z.ZodString;
|
|
31
31
|
universalResolver: z.ZodOptional<z.ZodBoolean>;
|
|
32
32
|
}, "strip", z.ZodTypeAny, {
|
|
33
|
-
chain: "mainnet" | "base" | "
|
|
33
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
34
34
|
address: string;
|
|
35
35
|
universalResolver?: boolean | undefined;
|
|
36
36
|
}, {
|
|
37
37
|
address: string;
|
|
38
|
-
chain?: "mainnet" | "base" | "
|
|
38
|
+
chain?: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost" | undefined;
|
|
39
39
|
universalResolver?: boolean | undefined;
|
|
40
40
|
}>;
|
|
41
41
|
handler: (args: {
|
|
42
|
-
chain: "mainnet" | "base" | "
|
|
42
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
43
43
|
address: string;
|
|
44
44
|
universalResolver?: boolean | undefined;
|
|
45
45
|
}) => Promise<import("../types.js").ToolResult>;
|
|
@@ -48,23 +48,23 @@ declare const _default: {
|
|
|
48
48
|
title: string;
|
|
49
49
|
description: string;
|
|
50
50
|
schema: z.ZodObject<{
|
|
51
|
-
chain: z.ZodDefault<z.ZodEnum<["mainnet", "base", "
|
|
51
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "arbitrum", "avalanche", "base", "bnb", "gnosis", "sonic", "optimism", "polygon", "zksync", "linea", "unichain", "localhost"]>>;
|
|
52
52
|
name: z.ZodString;
|
|
53
53
|
key: z.ZodString;
|
|
54
54
|
universalResolver: z.ZodOptional<z.ZodBoolean>;
|
|
55
55
|
}, "strip", z.ZodTypeAny, {
|
|
56
|
-
chain: "mainnet" | "base" | "
|
|
56
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
57
57
|
key: string;
|
|
58
58
|
name: string;
|
|
59
59
|
universalResolver?: boolean | undefined;
|
|
60
60
|
}, {
|
|
61
61
|
key: string;
|
|
62
62
|
name: string;
|
|
63
|
-
chain?: "mainnet" | "base" | "
|
|
63
|
+
chain?: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost" | undefined;
|
|
64
64
|
universalResolver?: boolean | undefined;
|
|
65
65
|
}>;
|
|
66
66
|
handler: (args: {
|
|
67
|
-
chain: "mainnet" | "base" | "
|
|
67
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
68
68
|
key: string;
|
|
69
69
|
name: string;
|
|
70
70
|
universalResolver?: boolean | undefined;
|
|
@@ -74,20 +74,20 @@ declare const _default: {
|
|
|
74
74
|
title: string;
|
|
75
75
|
description: string;
|
|
76
76
|
schema: z.ZodObject<{
|
|
77
|
-
chain: z.ZodDefault<z.ZodEnum<["mainnet", "base", "
|
|
77
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "arbitrum", "avalanche", "base", "bnb", "gnosis", "sonic", "optimism", "polygon", "zksync", "linea", "unichain", "localhost"]>>;
|
|
78
78
|
name: z.ZodString;
|
|
79
79
|
universalResolver: z.ZodOptional<z.ZodBoolean>;
|
|
80
80
|
}, "strip", z.ZodTypeAny, {
|
|
81
|
-
chain: "mainnet" | "base" | "
|
|
81
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
82
82
|
name: string;
|
|
83
83
|
universalResolver?: boolean | undefined;
|
|
84
84
|
}, {
|
|
85
85
|
name: string;
|
|
86
|
-
chain?: "mainnet" | "base" | "
|
|
86
|
+
chain?: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost" | undefined;
|
|
87
87
|
universalResolver?: boolean | undefined;
|
|
88
88
|
}>;
|
|
89
89
|
handler: (args: {
|
|
90
|
-
chain: "mainnet" | "base" | "
|
|
90
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
91
91
|
name: string;
|
|
92
92
|
universalResolver?: boolean | undefined;
|
|
93
93
|
}) => Promise<import("../types.js").ToolResult>;
|
|
@@ -96,20 +96,20 @@ declare const _default: {
|
|
|
96
96
|
title: string;
|
|
97
97
|
description: string;
|
|
98
98
|
schema: z.ZodObject<{
|
|
99
|
-
chain: z.ZodDefault<z.ZodEnum<["mainnet", "base", "
|
|
99
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "arbitrum", "avalanche", "base", "bnb", "gnosis", "sonic", "optimism", "polygon", "zksync", "linea", "unichain", "localhost"]>>;
|
|
100
100
|
names: z.ZodArray<z.ZodString, "many">;
|
|
101
101
|
universalResolver: z.ZodOptional<z.ZodBoolean>;
|
|
102
102
|
}, "strip", z.ZodTypeAny, {
|
|
103
|
-
chain: "mainnet" | "base" | "
|
|
103
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
104
104
|
names: string[];
|
|
105
105
|
universalResolver?: boolean | undefined;
|
|
106
106
|
}, {
|
|
107
107
|
names: string[];
|
|
108
|
-
chain?: "mainnet" | "base" | "
|
|
108
|
+
chain?: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost" | undefined;
|
|
109
109
|
universalResolver?: boolean | undefined;
|
|
110
110
|
}>;
|
|
111
111
|
handler: (args: {
|
|
112
|
-
chain: "mainnet" | "base" | "
|
|
112
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
113
113
|
names: string[];
|
|
114
114
|
universalResolver?: boolean | undefined;
|
|
115
115
|
}) => Promise<import("../types.js").ToolResult>;
|
package/dist/tools/logs.d.ts
CHANGED
|
@@ -4,21 +4,21 @@ declare const _default: {
|
|
|
4
4
|
title: string;
|
|
5
5
|
description: string;
|
|
6
6
|
schema: z.ZodObject<{
|
|
7
|
-
chain: z.ZodEnum<["mainnet", "base", "
|
|
7
|
+
chain: z.ZodEnum<["mainnet", "arbitrum", "avalanche", "base", "bnb", "gnosis", "sonic", "optimism", "polygon", "zksync", "linea", "unichain", "localhost"]>;
|
|
8
8
|
eventAbi: z.ZodString;
|
|
9
9
|
address: z.ZodOptional<z.ZodString>;
|
|
10
10
|
fromBlock: z.ZodOptional<z.ZodString>;
|
|
11
11
|
toBlock: z.ZodOptional<z.ZodString>;
|
|
12
12
|
eventArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">]>>>;
|
|
13
13
|
}, "strip", z.ZodTypeAny, {
|
|
14
|
-
chain: "mainnet" | "base" | "
|
|
14
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
15
15
|
eventAbi: string;
|
|
16
16
|
address?: string | undefined;
|
|
17
17
|
fromBlock?: string | undefined;
|
|
18
18
|
toBlock?: string | undefined;
|
|
19
19
|
eventArgs?: Record<string, string | number | boolean | (string | number | boolean)[]> | undefined;
|
|
20
20
|
}, {
|
|
21
|
-
chain: "mainnet" | "base" | "
|
|
21
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
22
22
|
eventAbi: string;
|
|
23
23
|
address?: string | undefined;
|
|
24
24
|
fromBlock?: string | undefined;
|
|
@@ -26,7 +26,7 @@ declare const _default: {
|
|
|
26
26
|
eventArgs?: Record<string, string | number | boolean | (string | number | boolean)[]> | undefined;
|
|
27
27
|
}>;
|
|
28
28
|
handler: (args: {
|
|
29
|
-
chain: "mainnet" | "base" | "
|
|
29
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
30
30
|
eventAbi: string;
|
|
31
31
|
address?: string | undefined;
|
|
32
32
|
fromBlock?: string | undefined;
|
package/dist/types.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface Config {
|
|
|
11
11
|
customRpcUrls?: Record<string, string>;
|
|
12
12
|
hypersyncApiKey?: string;
|
|
13
13
|
}
|
|
14
|
-
export type ChainName = 'mainnet' | 'base' | '
|
|
14
|
+
export type ChainName = 'mainnet' | 'arbitrum' | 'avalanche' | 'base' | 'bnb' | 'gnosis' | 'sonic' | 'optimism' | 'polygon' | 'zksync' | 'linea' | 'unichain' | 'localhost';
|
|
15
15
|
export interface ToolResult {
|
|
16
16
|
[x: string]: unknown;
|
|
17
17
|
content: Array<{
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAGxC,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,OAAO,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,SAAS,YAAY,EAAE,CAAA;CAChC;AAGD,MAAM,WAAW,MAAM;IACrB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAGD,MAAM,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAGxC,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,OAAO,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,SAAS,YAAY,EAAE,CAAA;CAChC;AAGD,MAAM,WAAW,MAAM;IACrB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAGD,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,UAAU,GACV,WAAW,GACX,MAAM,GACN,KAAK,GACL,QAAQ,GACR,OAAO,GACP,UAAU,GACV,SAAS,GACT,QAAQ,GACR,OAAO,GACP,UAAU,GACV,WAAW,CAAA;AAGf,MAAM,WAAW,UAAU;IACzB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACpB,OAAO,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;KACb,CAAC,CAAA;CACH"}
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { http, createPublicClient } from 'viem'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
arbitrum,
|
|
4
|
+
avalanche,
|
|
5
|
+
base,
|
|
6
|
+
bsc,
|
|
7
|
+
gnosis,
|
|
8
|
+
linea,
|
|
9
|
+
localhost,
|
|
10
|
+
mainnet,
|
|
11
|
+
optimism,
|
|
12
|
+
polygon,
|
|
13
|
+
sonic,
|
|
14
|
+
unichain,
|
|
15
|
+
zksync
|
|
16
|
+
} from 'viem/chains'
|
|
3
17
|
import type { ChainName, Config } from './types.js'
|
|
4
18
|
|
|
5
19
|
// Enhanced RPC configuration with API keys
|
|
@@ -31,7 +45,7 @@ function getRpcUrl(chainName: string, config: Config): string {
|
|
|
31
45
|
? `https://polygon-mainnet.g.alchemy.com/v2/${config.alchemyApiKey}`
|
|
32
46
|
: config.infuraApiKey
|
|
33
47
|
? `https://polygon-mainnet.infura.io/v3/${config.infuraApiKey}`
|
|
34
|
-
: 'https://polygon-rpc.com
|
|
48
|
+
: 'https://polygon-rpc.com',
|
|
35
49
|
|
|
36
50
|
optimism: config.alchemyApiKey
|
|
37
51
|
? `https://opt-mainnet.g.alchemy.com/v2/${config.alchemyApiKey}`
|
|
@@ -39,7 +53,44 @@ function getRpcUrl(chainName: string, config: Config): string {
|
|
|
39
53
|
? `https://optimism-mainnet.infura.io/v3/${config.infuraApiKey}`
|
|
40
54
|
: 'https://mainnet.optimism.io',
|
|
41
55
|
|
|
42
|
-
|
|
56
|
+
avalanche: config.alchemyApiKey
|
|
57
|
+
? `https://avax-mainnet.g.alchemy.com/v2/${config.alchemyApiKey}`
|
|
58
|
+
: config.infuraApiKey
|
|
59
|
+
? `https://avalanche-mainnet.infura.io/v3/${config.infuraApiKey}`
|
|
60
|
+
: 'https://api.avax.network/ext/bc/C/rpc',
|
|
61
|
+
|
|
62
|
+
bnb: config.alchemyApiKey
|
|
63
|
+
? `https://bnb-mainnet.g.alchemy.com/v2/${config.alchemyApiKey}`
|
|
64
|
+
: config.infuraApiKey
|
|
65
|
+
? `https://bsc-mainnet.infura.io/v3/${config.infuraApiKey}`
|
|
66
|
+
: 'https://bsc-dataseed.bnbchain.org',
|
|
67
|
+
|
|
68
|
+
gnosis: config.alchemyApiKey
|
|
69
|
+
? `https://gnosis-mainnet.g.alchemy.com/v2/${config.alchemyApiKey}`
|
|
70
|
+
: 'https://rpc.gnosischain.com',
|
|
71
|
+
|
|
72
|
+
sonic: config.alchemyApiKey
|
|
73
|
+
? `https://sonic-mainnet.g.alchemy.com/v2/${config.alchemyApiKey}`
|
|
74
|
+
: 'https://rpc.soniclabs.com',
|
|
75
|
+
|
|
76
|
+
zksync: config.alchemyApiKey
|
|
77
|
+
? `https://zksync-mainnet.g.alchemy.com/v2/${config.alchemyApiKey}`
|
|
78
|
+
: config.infuraApiKey
|
|
79
|
+
? `https://zksync-mainnet.infura.io/v3/${config.infuraApiKey}`
|
|
80
|
+
: 'https://mainnet.era.zksync.io',
|
|
81
|
+
|
|
82
|
+
linea: config.alchemyApiKey
|
|
83
|
+
? `https://linea-mainnet.g.alchemy.com/v2/${config.alchemyApiKey}`
|
|
84
|
+
: config.infuraApiKey
|
|
85
|
+
? `https://linea-mainnet.infura.io/v3/${config.infuraApiKey}`
|
|
86
|
+
: 'https://rpc.linea.build',
|
|
87
|
+
|
|
88
|
+
unichain: config.alchemyApiKey
|
|
89
|
+
? `https://unichain-mainnet.g.alchemy.com/v2/${config.alchemyApiKey}`
|
|
90
|
+
: config.infuraApiKey
|
|
91
|
+
? `https://unichain-mainnet.infura.io/v3/${config.infuraApiKey}`
|
|
92
|
+
: 'https://sepolia.unichain.org',
|
|
93
|
+
|
|
43
94
|
localhost: 'http://localhost:8545'
|
|
44
95
|
}
|
|
45
96
|
|
|
@@ -78,10 +129,46 @@ export const CHAINS = (config: Config) => ({
|
|
|
78
129
|
return getRpcUrl('optimism', config)
|
|
79
130
|
}
|
|
80
131
|
},
|
|
81
|
-
|
|
82
|
-
chain:
|
|
132
|
+
avalanche: {
|
|
133
|
+
chain: avalanche,
|
|
134
|
+
get rpc() {
|
|
135
|
+
return getRpcUrl('avalanche', config)
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
bnb: {
|
|
139
|
+
chain: bsc,
|
|
140
|
+
get rpc() {
|
|
141
|
+
return getRpcUrl('bnb', config)
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
gnosis: {
|
|
145
|
+
chain: gnosis,
|
|
146
|
+
get rpc() {
|
|
147
|
+
return getRpcUrl('gnosis', config)
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
sonic: {
|
|
151
|
+
chain: sonic,
|
|
152
|
+
get rpc() {
|
|
153
|
+
return getRpcUrl('sonic', config)
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
zksync: {
|
|
157
|
+
chain: zksync,
|
|
158
|
+
get rpc() {
|
|
159
|
+
return getRpcUrl('zksync', config)
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
linea: {
|
|
163
|
+
chain: linea,
|
|
164
|
+
get rpc() {
|
|
165
|
+
return getRpcUrl('linea', config)
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
unichain: {
|
|
169
|
+
chain: unichain,
|
|
83
170
|
get rpc() {
|
|
84
|
-
return getRpcUrl('
|
|
171
|
+
return getRpcUrl('unichain', config)
|
|
85
172
|
}
|
|
86
173
|
},
|
|
87
174
|
localhost: {
|
|
@@ -94,15 +181,36 @@ export const CHAINS = (config: Config) => ({
|
|
|
94
181
|
|
|
95
182
|
// Hypersync URLs for supported chains (localhost is not supported)
|
|
96
183
|
export const HYPERSYNC_URLS: Partial<Record<ChainName, string>> = {
|
|
97
|
-
|
|
98
|
-
arbitrum: 'https://arbitrum.hypersync.xyz',
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
184
|
+
mainnet: 'https://eth.hypersync.xyz', // Chain ID 1
|
|
185
|
+
arbitrum: 'https://arbitrum.hypersync.xyz', // Chain ID 42161
|
|
186
|
+
avalanche: 'https://avalanche.hypersync.xyz', // Chain ID 43114
|
|
187
|
+
base: 'https://base.hypersync.xyz', // Chain ID 8453
|
|
188
|
+
bnb: 'https://bsc.hypersync.xyz', // Chain ID 56
|
|
189
|
+
gnosis: 'https://gnosis.hypersync.xyz', // Chain ID 100
|
|
190
|
+
sonic: 'https://sonic.hypersync.xyz', // Chain ID 146
|
|
191
|
+
optimism: 'https://optimism.hypersync.xyz', // Chain ID 10
|
|
192
|
+
polygon: 'https://polygon.hypersync.xyz', // Chain ID 137
|
|
193
|
+
zksync: 'https://zksync.hypersync.xyz', // Chain ID 324
|
|
194
|
+
linea: 'https://linea.hypersync.xyz', // Chain ID 59144
|
|
195
|
+
unichain: 'https://unichain.hypersync.xyz' // Chain ID 130
|
|
196
|
+
// localhost is not supported by hypersync
|
|
103
197
|
}
|
|
104
198
|
|
|
105
|
-
export const SUPPORTED_CHAINS = [
|
|
199
|
+
export const SUPPORTED_CHAINS = [
|
|
200
|
+
'mainnet',
|
|
201
|
+
'arbitrum',
|
|
202
|
+
'avalanche',
|
|
203
|
+
'base',
|
|
204
|
+
'bnb',
|
|
205
|
+
'gnosis',
|
|
206
|
+
'sonic',
|
|
207
|
+
'optimism',
|
|
208
|
+
'polygon',
|
|
209
|
+
'zksync',
|
|
210
|
+
'linea',
|
|
211
|
+
'unichain',
|
|
212
|
+
'localhost'
|
|
213
|
+
] as const
|
|
106
214
|
|
|
107
215
|
// Client manager
|
|
108
216
|
export class ClientManager {
|
|
@@ -137,7 +245,13 @@ export class ClientManager {
|
|
|
137
245
|
arbitrum: 'arbiscan.io',
|
|
138
246
|
polygon: 'polygonscan.com',
|
|
139
247
|
optimism: 'optimistic.etherscan.io',
|
|
140
|
-
|
|
248
|
+
avalanche: 'snowtrace.io',
|
|
249
|
+
bnb: 'bscscan.com',
|
|
250
|
+
gnosis: 'gnosisscan.io',
|
|
251
|
+
sonic: 'sonicscan.org',
|
|
252
|
+
zksync: 'era.zksync.network',
|
|
253
|
+
linea: 'lineascan.build',
|
|
254
|
+
unichain: 'uniscan.xyz',
|
|
141
255
|
localhost: 'etherscan.io'
|
|
142
256
|
}
|
|
143
257
|
return domains[chainName] || 'etherscan.io'
|
package/src/index.ts
CHANGED
|
@@ -35,7 +35,7 @@ ENVIRONMENT VARIABLES:
|
|
|
35
35
|
HYPERSYNC_API_KEY Alternative to --hypersync-api-key
|
|
36
36
|
|
|
37
37
|
SUPPORTED CHAINS:
|
|
38
|
-
mainnet, base,
|
|
38
|
+
mainnet, arbitrum, avalanche, base, bnb, gnosis, sonic, optimism, polygon, zksync, linea, unichain, localhost
|
|
39
39
|
|
|
40
40
|
EXAMPLES:
|
|
41
41
|
# Use with npx (recommended)
|
package/src/types.ts
CHANGED
|
@@ -17,7 +17,20 @@ export interface Config {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// Chain names
|
|
20
|
-
export type ChainName =
|
|
20
|
+
export type ChainName =
|
|
21
|
+
| 'mainnet'
|
|
22
|
+
| 'arbitrum'
|
|
23
|
+
| 'avalanche'
|
|
24
|
+
| 'base'
|
|
25
|
+
| 'bnb'
|
|
26
|
+
| 'gnosis'
|
|
27
|
+
| 'sonic'
|
|
28
|
+
| 'optimism'
|
|
29
|
+
| 'polygon'
|
|
30
|
+
| 'zksync'
|
|
31
|
+
| 'linea'
|
|
32
|
+
| 'unichain'
|
|
33
|
+
| 'localhost'
|
|
21
34
|
|
|
22
35
|
// Tool handler result type
|
|
23
36
|
export interface ToolResult {
|