web3-tools-mcp 3.1.0 → 3.2.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +23 -11
  3. package/dist/chains.d.ts +609 -65
  4. package/dist/chains.d.ts.map +1 -1
  5. package/dist/chains.js +89 -28
  6. package/dist/chains.js.map +1 -1
  7. package/dist/client.d.ts.map +1 -1
  8. package/dist/client.js +2 -4
  9. package/dist/client.js.map +1 -1
  10. package/dist/http-server.d.ts +1 -1
  11. package/dist/http-server.d.ts.map +1 -1
  12. package/dist/http-server.js +3 -2
  13. package/dist/http-server.js.map +1 -1
  14. package/dist/index.js +0 -5
  15. package/dist/index.js.map +1 -1
  16. package/dist/tools/index.d.ts.map +1 -1
  17. package/dist/tools/index.js +2 -0
  18. package/dist/tools/index.js.map +1 -1
  19. package/dist/tools/read/advanced.d.ts +16 -16
  20. package/dist/tools/read/balance.d.ts +6 -6
  21. package/dist/tools/read/contract-info.d.ts +12 -12
  22. package/dist/tools/read/contract.d.ts +10 -10
  23. package/dist/tools/read/defi.d.ts +86 -0
  24. package/dist/tools/read/defi.d.ts.map +1 -0
  25. package/dist/tools/read/defi.js +210 -0
  26. package/dist/tools/read/defi.js.map +1 -0
  27. package/dist/tools/read/gas.d.ts +16 -16
  28. package/dist/tools/read/logs.d.ts +4 -4
  29. package/dist/tools/sign/transactions.d.ts +12 -12
  30. package/dist/tools/sign/wallet.d.ts +4 -4
  31. package/dist/types.d.ts +0 -1
  32. package/dist/types.d.ts.map +1 -1
  33. package/dist/utils.d.ts.map +1 -1
  34. package/dist/utils.js +1 -2
  35. package/dist/utils.js.map +1 -1
  36. package/dist/wallet-client.d.ts.map +1 -1
  37. package/dist/wallet-client.js +2 -2
  38. package/dist/wallet-client.js.map +1 -1
  39. package/package.json +2 -2
  40. package/src/chains.ts +101 -31
  41. package/src/client.ts +2 -3
  42. package/src/http-server.ts +3 -3
  43. package/src/index.ts +0 -5
  44. package/src/tools/index.ts +2 -0
  45. package/src/tools/read/defi.ts +287 -0
  46. package/src/types.ts +0 -1
  47. package/src/utils.ts +1 -2
  48. package/src/wallet-client.ts +9 -2
@@ -6,20 +6,20 @@ declare const _default: {
6
6
  title: string;
7
7
  description: string;
8
8
  schema: z.ZodObject<{
9
- chain: z.ZodEnum<["mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost", ...("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost")[]]>;
9
+ chain: z.ZodEnum<["mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost", ...("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost")[]]>;
10
10
  address: z.ZodString;
11
11
  include: z.ZodOptional<z.ZodArray<z.ZodEnum<["abi", "implementationAbi", "metadata", "compilation", "creation", "stats"]>, "many">>;
12
12
  }, "strip", z.ZodTypeAny, {
13
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
13
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
14
14
  address: string;
15
15
  include?: ("abi" | "implementationAbi" | "metadata" | "compilation" | "creation" | "stats")[] | undefined;
16
16
  }, {
17
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
17
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
18
18
  address: string;
19
19
  include?: ("abi" | "implementationAbi" | "metadata" | "compilation" | "creation" | "stats")[] | undefined;
20
20
  }>;
21
21
  handler: (args: {
22
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
22
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
23
23
  address: string;
24
24
  include?: ("abi" | "implementationAbi" | "metadata" | "compilation" | "creation" | "stats")[] | undefined;
25
25
  }, identity: string) => Promise<import("../../types.js").ToolResult>;
@@ -29,23 +29,23 @@ declare const _default: {
29
29
  title: string;
30
30
  description: string;
31
31
  schema: z.ZodObject<{
32
- chain: z.ZodEnum<["mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost", ...("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost")[]]>;
32
+ chain: z.ZodEnum<["mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost", ...("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost")[]]>;
33
33
  address: z.ZodString;
34
34
  includeImplementation: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
35
35
  includeSource: z.ZodDefault<z.ZodOptional<z.ZodEnum<["full", "summary", "none"]>>>;
36
36
  }, "strip", z.ZodTypeAny, {
37
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
37
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
38
38
  address: string;
39
39
  includeImplementation: boolean;
40
40
  includeSource: "full" | "summary" | "none";
41
41
  }, {
42
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
42
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
43
43
  address: string;
44
44
  includeImplementation?: boolean | undefined;
45
45
  includeSource?: "full" | "summary" | "none" | undefined;
46
46
  }>;
47
47
  handler: (args: {
48
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
48
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
49
49
  address: string;
50
50
  includeImplementation: boolean;
51
51
  includeSource: "full" | "summary" | "none";
@@ -56,23 +56,23 @@ declare const _default: {
56
56
  title: string;
57
57
  description: string;
58
58
  schema: z.ZodObject<{
59
- chain: z.ZodEnum<["mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost", ...("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost")[]]>;
59
+ chain: z.ZodEnum<["mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost", ...("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost")[]]>;
60
60
  address: z.ZodString;
61
61
  filePath: z.ZodOptional<z.ZodString>;
62
62
  useImplementation: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
63
63
  }, "strip", z.ZodTypeAny, {
64
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
64
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
65
65
  address: string;
66
66
  useImplementation: boolean;
67
67
  filePath?: string | undefined;
68
68
  }, {
69
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
69
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
70
70
  address: string;
71
71
  filePath?: string | undefined;
72
72
  useImplementation?: boolean | undefined;
73
73
  }>;
74
74
  handler: (args: {
75
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
75
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
76
76
  address: string;
77
77
  useImplementation: boolean;
78
78
  filePath?: string | undefined;
@@ -5,21 +5,21 @@ declare const _default: {
5
5
  description: string;
6
6
  schema: z.ZodObject<{
7
7
  calls: z.ZodArray<z.ZodObject<{
8
- chain: z.ZodEnum<["mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost", ...("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost")[]]>;
8
+ chain: z.ZodEnum<["mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost", ...("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost")[]]>;
9
9
  contractAddress: z.ZodString;
10
10
  functionAbi: z.ZodString;
11
11
  args: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">>;
12
12
  blockNumber: z.ZodOptional<z.ZodString>;
13
13
  label: z.ZodOptional<z.ZodString>;
14
14
  }, "strip", z.ZodTypeAny, {
15
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
15
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
16
16
  contractAddress: string;
17
17
  functionAbi: string;
18
18
  blockNumber?: string | undefined;
19
19
  args?: (string | number | boolean | null)[] | undefined;
20
20
  label?: string | undefined;
21
21
  }, {
22
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
22
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
23
23
  contractAddress: string;
24
24
  functionAbi: string;
25
25
  blockNumber?: string | undefined;
@@ -28,7 +28,7 @@ declare const _default: {
28
28
  }>, "many">;
29
29
  }, "strip", z.ZodTypeAny, {
30
30
  calls: {
31
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
31
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
32
32
  contractAddress: string;
33
33
  functionAbi: string;
34
34
  blockNumber?: string | undefined;
@@ -37,7 +37,7 @@ declare const _default: {
37
37
  }[];
38
38
  }, {
39
39
  calls: {
40
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
40
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
41
41
  contractAddress: string;
42
42
  functionAbi: string;
43
43
  blockNumber?: string | undefined;
@@ -47,7 +47,7 @@ declare const _default: {
47
47
  }>;
48
48
  handler: (args: {
49
49
  calls: {
50
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
50
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
51
51
  contractAddress: string;
52
52
  functionAbi: string;
53
53
  blockNumber?: string | undefined;
@@ -61,17 +61,17 @@ declare const _default: {
61
61
  title: string;
62
62
  description: string;
63
63
  schema: z.ZodObject<{
64
- chain: z.ZodEnum<["mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost", ...("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost")[]]>;
64
+ chain: z.ZodEnum<["mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost", ...("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost")[]]>;
65
65
  address: z.ZodString;
66
66
  }, "strip", z.ZodTypeAny, {
67
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
67
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
68
68
  address: string;
69
69
  }, {
70
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
70
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
71
71
  address: string;
72
72
  }>;
73
73
  handler: (args: {
74
- chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
74
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
75
75
  address: string;
76
76
  }, identity: string) => Promise<import("../../types.js").ToolResult>;
77
77
  available: (() => boolean) | undefined;
@@ -0,0 +1,86 @@
1
+ import { z } from 'zod';
2
+ declare const _default: {
3
+ get_token_prices: {
4
+ title: string;
5
+ description: string;
6
+ schema: z.ZodObject<{
7
+ chain: z.ZodEnum<["mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost", ...("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost")[]]>;
8
+ tokens: z.ZodArray<z.ZodString, "many">;
9
+ timestamp: z.ZodOptional<z.ZodNumber>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
12
+ tokens: string[];
13
+ timestamp?: number | undefined;
14
+ }, {
15
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
16
+ tokens: string[];
17
+ timestamp?: number | undefined;
18
+ }>;
19
+ handler: (args: {
20
+ chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost";
21
+ tokens: string[];
22
+ timestamp?: number | undefined;
23
+ }, identity: string) => Promise<import("../../types.js").ToolResult>;
24
+ available: (() => boolean) | undefined;
25
+ };
26
+ get_portfolio: {
27
+ title: string;
28
+ description: string;
29
+ schema: z.ZodObject<{
30
+ address: z.ZodString;
31
+ chains: z.ZodOptional<z.ZodArray<z.ZodEnum<["mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost", ...("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost")[]]>, "many">>;
32
+ minValueUsd: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ address: string;
35
+ minValueUsd: number;
36
+ chains?: ("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost")[] | undefined;
37
+ }, {
38
+ address: string;
39
+ chains?: ("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost")[] | undefined;
40
+ minValueUsd?: number | undefined;
41
+ }>;
42
+ handler: (args: {
43
+ address: string;
44
+ minValueUsd: number;
45
+ chains?: ("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost")[] | undefined;
46
+ }, identity: string) => Promise<import("../../types.js").ToolResult>;
47
+ available: (() => boolean) | undefined;
48
+ };
49
+ get_yield_pools: {
50
+ title: string;
51
+ description: string;
52
+ schema: z.ZodObject<{
53
+ chain: z.ZodOptional<z.ZodEnum<["mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost", ...("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost")[]]>>;
54
+ symbol: z.ZodOptional<z.ZodString>;
55
+ project: z.ZodOptional<z.ZodString>;
56
+ stablecoinOnly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
57
+ minTvlUsd: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
58
+ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
59
+ }, "strip", z.ZodTypeAny, {
60
+ stablecoinOnly: boolean;
61
+ minTvlUsd: number;
62
+ limit: number;
63
+ symbol?: string | undefined;
64
+ chain?: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost" | undefined;
65
+ project?: string | undefined;
66
+ }, {
67
+ symbol?: string | undefined;
68
+ chain?: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost" | undefined;
69
+ project?: string | undefined;
70
+ stablecoinOnly?: boolean | undefined;
71
+ minTvlUsd?: number | undefined;
72
+ limit?: number | undefined;
73
+ }>;
74
+ handler: (args: {
75
+ stablecoinOnly: boolean;
76
+ minTvlUsd: number;
77
+ limit: number;
78
+ symbol?: string | undefined;
79
+ chain?: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "monad" | "robinhood" | "arc" | "plasma" | "ink" | "mantle" | "celo" | "hyperevm" | "localhost" | undefined;
80
+ project?: string | undefined;
81
+ }, identity: string) => Promise<import("../../types.js").ToolResult>;
82
+ available: (() => boolean) | undefined;
83
+ };
84
+ };
85
+ export default _default;
86
+ //# sourceMappingURL=defi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defi.d.ts","sourceRoot":"","sources":["../../../src/tools/read/defi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuIvB,wBAsJC"}
@@ -0,0 +1,210 @@
1
+ import { formatUnits, isAddress, zeroAddress } from 'viem';
2
+ import { z } from 'zod';
3
+ import { CHAINS, SUPPORTED_CHAINS } from '../../chains.js';
4
+ import { getClientManager } from '../../client.js';
5
+ import { createTool, formatResponse, MAX_BATCH, rpcReason } from '../../utils.js';
6
+ /** Token ids per DefiLlama price request, to keep the URL short. */
7
+ const PRICE_BATCH = 50;
8
+ const MAX_TOKEN_PAGES = 10;
9
+ /** DefiLlama's public API: free, keyless, and the same for every caller. */
10
+ async function llama(url) {
11
+ const response = await fetch(url, { headers: { Accept: 'application/json' }, signal: AbortSignal.timeout(30_000) });
12
+ if (!response.ok)
13
+ throw new Error(`DefiLlama answered ${response.status} for ${url}`);
14
+ return (await response.json());
15
+ }
16
+ function llamaNames(chain) {
17
+ const names = CHAINS[chain].llama;
18
+ if (!names)
19
+ throw new Error(`DefiLlama has no data for ${chain}`);
20
+ return names;
21
+ }
22
+ /** Prices by lowercased token address; a token DefiLlama cannot price is absent. */
23
+ async function llamaPrices(chain, tokens, timestamp) {
24
+ const prefix = llamaNames(chain).coins;
25
+ const when = timestamp ? `historical/${timestamp}` : 'current';
26
+ const batches = Array.from({ length: Math.ceil(tokens.length / PRICE_BATCH) }, (_, index) => tokens.slice(index * PRICE_BATCH, (index + 1) * PRICE_BATCH));
27
+ const answers = await Promise.all(batches.map((batch) => llama(`https://coins.llama.fi/prices/${when}/${batch.map((token) => `${prefix}:${token}`).join(',')}`)));
28
+ // DefiLlama keys its answer by the id as sent, but not reliably in the same case.
29
+ return new Map(answers.flatMap(({ coins }) => Object.entries(coins).map(([id, price]) => [id.slice(prefix.length + 1).toLowerCase(), price])));
30
+ }
31
+ /**
32
+ * Every ERC20 the address holds a non-zero balance of, as Alchemy indexes them.
33
+ *
34
+ * ponytail: stops after MAX_TOKEN_PAGES pages; past that a wallet is nearly all spam, but a
35
+ * real token beyond the cut is missed. `truncated` says when that happened.
36
+ */
37
+ async function erc20Balances(chain, address) {
38
+ const client = getClientManager().getClient(chain);
39
+ const balances = [];
40
+ let pageKey;
41
+ for (let page = 0; page < MAX_TOKEN_PAGES; page++) {
42
+ const result = (await client.request({
43
+ method: 'alchemy_getTokenBalances',
44
+ params: [address, 'erc20', { maxCount: 100, ...(pageKey && { pageKey }) }]
45
+ }));
46
+ for (const { contractAddress, tokenBalance } of result.tokenBalances) {
47
+ if (tokenBalance && BigInt(tokenBalance) > 0n)
48
+ balances.push([contractAddress, BigInt(tokenBalance)]);
49
+ }
50
+ pageKey = result.pageKey;
51
+ if (!pageKey)
52
+ break;
53
+ }
54
+ return { balances, truncated: Boolean(pageKey) };
55
+ }
56
+ async function holdingsOn(chain, address, minValueUsd) {
57
+ const [native, erc20] = await Promise.all([
58
+ getClientManager().getClient(chain).getBalance({ address }),
59
+ erc20Balances(chain, address)
60
+ ]);
61
+ const held = native > 0n ? [[zeroAddress, native], ...erc20.balances] : erc20.balances;
62
+ const prices = await llamaPrices(chain, held.map(([token]) => token));
63
+ const holdings = [];
64
+ let unpriced = 0;
65
+ let belowMinValue = 0;
66
+ for (const [token, raw] of held) {
67
+ const price = prices.get(token.toLowerCase());
68
+ if (!price || price.decimals === undefined) {
69
+ unpriced++;
70
+ continue;
71
+ }
72
+ const amount = formatUnits(raw, price.decimals);
73
+ const valueUsd = Number(amount) * price.price;
74
+ if (valueUsd < minValueUsd) {
75
+ belowMinValue++;
76
+ continue;
77
+ }
78
+ holdings.push({
79
+ chain,
80
+ token: token === zeroAddress ? 'native' : token,
81
+ symbol: price.symbol,
82
+ amount,
83
+ priceUsd: price.price,
84
+ valueUsd: Math.round(valueUsd * 100) / 100
85
+ });
86
+ }
87
+ return { chain, holdings, unpriced, belowMinValue, truncated: erc20.truncated };
88
+ }
89
+ export default {
90
+ get_token_prices: createTool('Get Token Prices', "USD prices from DefiLlama for tokens on one chain, now or at a past timestamp. Use the zero address for the chain's native token. " +
91
+ 'Tokens DefiLlama cannot price are listed as unpriced — usually spam or illiquid.', z.object({
92
+ chain: z.enum(SUPPORTED_CHAINS).describe('Blockchain network'),
93
+ tokens: z
94
+ .array(z.string())
95
+ .min(1)
96
+ .max(MAX_BATCH)
97
+ .describe(`Token contract addresses (up to ${MAX_BATCH}); ${zeroAddress} for the native token`),
98
+ timestamp: z.number().int().positive().optional().describe('Unix time in seconds for a past price (defaults to now)')
99
+ }), async (args) => {
100
+ const invalid = args.tokens.find((token) => !isAddress(token));
101
+ if (invalid)
102
+ throw new Error(`Invalid token address: ${invalid}`);
103
+ const byToken = await llamaPrices(args.chain, args.tokens, args.timestamp);
104
+ const prices = args.tokens.map((token) => {
105
+ const price = byToken.get(token.toLowerCase());
106
+ if (!price)
107
+ return { token, priced: false };
108
+ return {
109
+ token,
110
+ priced: true,
111
+ symbol: price.symbol,
112
+ priceUsd: price.price,
113
+ decimals: price.decimals,
114
+ confidence: price.confidence,
115
+ updatedAt: new Date(price.timestamp * 1000).toISOString()
116
+ };
117
+ });
118
+ return formatResponse({ chain: args.chain, source: 'DefiLlama', prices });
119
+ }),
120
+ get_portfolio: createTool('Get Portfolio', 'What a wallet holds across chains, valued in USD: native and ERC20 balances found through Alchemy, priced by ' +
121
+ 'DefiLlama, largest first. Tokens DefiLlama cannot price are left out — that drops the spam airdrops most ' +
122
+ 'wallets collect. Positions inside DeFi protocols appear only as the receipt tokens DefiLlama happens to price.', z.object({
123
+ address: z.string().describe('Wallet address'),
124
+ chains: z
125
+ .array(z.enum(SUPPORTED_CHAINS))
126
+ .optional()
127
+ .describe('Chains to look at (defaults to every chain where both the Alchemy token API and DefiLlama are available)'),
128
+ minValueUsd: z.number().optional().default(1).describe('Leave out holdings worth less than this, in USD (default 1)')
129
+ }), async (args) => {
130
+ if (!isAddress(args.address))
131
+ throw new Error(`Invalid address: ${args.address}`);
132
+ const address = args.address;
133
+ const chains = (args.chains ?? SUPPORTED_CHAINS).filter((chain) => CHAINS[chain].alchemy && CHAINS[chain].alchemyTokenApi !== false && CHAINS[chain].llama);
134
+ const scanned = [];
135
+ const failedChains = [];
136
+ await Promise.all(chains.map(async (chain) => {
137
+ try {
138
+ scanned.push(await holdingsOn(chain, address, args.minValueUsd));
139
+ }
140
+ catch (error) {
141
+ failedChains.push({ chain, error: rpcReason(error) });
142
+ }
143
+ }));
144
+ const holdings = scanned.flatMap((result) => result.holdings).sort((a, b) => b.valueUsd - a.valueUsd);
145
+ const truncatedChains = scanned.filter((result) => result.truncated).map((result) => result.chain);
146
+ return formatResponse({
147
+ address,
148
+ totalUsd: Math.round(holdings.reduce((sum, holding) => sum + holding.valueUsd, 0) * 100) / 100,
149
+ holdings,
150
+ hidden: {
151
+ unpriced: scanned.reduce((sum, result) => sum + result.unpriced, 0),
152
+ belowMinValue: scanned.reduce((sum, result) => sum + result.belowMinValue, 0)
153
+ },
154
+ ...(truncatedChains.length > 0 && { truncatedChains }),
155
+ ...(failedChains.length > 0 && { failedChains })
156
+ });
157
+ },
158
+ // alchemy_getTokenBalances is what finds the tokens; no other RPC here indexes them.
159
+ () => Boolean(getClientManager().getConfig().alchemyApiKey)),
160
+ get_yield_pools: createTool('Get Yield Pools', 'DeFi lending, staking and liquidity pools from DefiLlama, highest APY first — e.g. where USDC earns most on ' +
161
+ 'Arbitrum, or what Aave pays on Base. Pools DefiLlama flags as APY outliers are left out. APY is a percentage.', z.object({
162
+ chain: z
163
+ .enum(SUPPORTED_CHAINS)
164
+ .optional()
165
+ .describe('Only pools on this chain (defaults to every chain this server supports)'),
166
+ symbol: z.string().optional().describe('Only pools holding this token, e.g. "USDC" (matches "USDC" and "USDC-WETH")'),
167
+ project: z.string().optional().describe('Only this protocol, as DefiLlama names it — "aave" matches aave-v3 and aave-v2'),
168
+ stablecoinOnly: z.boolean().optional().default(false).describe('Only pools of stablecoins'),
169
+ minTvlUsd: z.number().optional().default(1_000_000).describe('Leave out pools smaller than this, in USD (default 1M)'),
170
+ limit: z.number().int().min(1).max(100).optional().default(20).describe('How many pools to return (default 20)')
171
+ }), async (args) => {
172
+ const chains = new Map((args.chain ? [args.chain] : SUPPORTED_CHAINS)
173
+ .filter((chain) => CHAINS[chain].llama)
174
+ .map((chain) => [llamaNames(chain).yields, chain]));
175
+ const symbol = args.symbol?.toUpperCase();
176
+ const project = args.project?.toLowerCase();
177
+ // ponytail: fetches DefiLlama's whole pool list (~12 MB) per call; cache it for a few minutes if calls pile up.
178
+ const { data } = await llama('https://yields.llama.fi/pools');
179
+ const matching = data
180
+ .filter((pool) => chains.has(pool.chain) &&
181
+ !pool.outlier &&
182
+ pool.apy !== null &&
183
+ pool.tvlUsd >= args.minTvlUsd &&
184
+ (!args.stablecoinOnly || pool.stablecoin) &&
185
+ (!project || pool.project.includes(project)) &&
186
+ (!symbol || pool.symbol.toUpperCase().split('-').includes(symbol)))
187
+ .sort((a, b) => (b.apy ?? 0) - (a.apy ?? 0));
188
+ return formatResponse({
189
+ source: 'DefiLlama',
190
+ matched: matching.length,
191
+ pools: matching.slice(0, args.limit).map((pool) => ({
192
+ chain: chains.get(pool.chain),
193
+ project: pool.project,
194
+ symbol: pool.symbol,
195
+ ...(pool.poolMeta && { meta: pool.poolMeta }),
196
+ apy: pool.apy,
197
+ apyBase: pool.apyBase,
198
+ apyReward: pool.apyReward,
199
+ apyMean30d: pool.apyMean30d,
200
+ tvlUsd: Math.round(pool.tvlUsd),
201
+ stablecoin: pool.stablecoin,
202
+ ilRisk: pool.ilRisk,
203
+ exposure: pool.exposure,
204
+ underlyingTokens: pool.underlyingTokens,
205
+ url: `https://defillama.com/yields/pool/${pool.pool}`
206
+ }))
207
+ });
208
+ })
209
+ };
210
+ //# sourceMappingURL=defi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defi.js","sourceRoot":"","sources":["../../../src/tools/read/defi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,WAAW,EAAY,SAAS,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAClF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,MAAM,EAAkB,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAEjF,oEAAoE;AACpE,MAAM,WAAW,GAAG,EAAE,CAAA;AACtB,MAAM,eAAe,GAAG,EAAE,CAAA;AA4B1B,4EAA4E;AAC5E,KAAK,UAAU,KAAK,CAAI,GAAW;IACjC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IACnH,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,QAAQ,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC,CAAA;IACrF,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAM,CAAA;AACrC,CAAC;AAED,SAAS,UAAU,CAAC,KAAgB;IAClC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAA;IACjC,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,KAAK,EAAE,CAAC,CAAA;IACjE,OAAO,KAAK,CAAA;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