@covalenthq/goldrush-mcp-server 0.0.2 → 0.0.4

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 (41) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +86 -47
  3. package/dist/index.d.ts +1 -2
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +2 -3
  6. package/dist/index.js.map +1 -1
  7. package/dist/resources/dynamicResources.d.ts.map +1 -1
  8. package/dist/resources/dynamicResources.js +11 -4
  9. package/dist/resources/dynamicResources.js.map +1 -1
  10. package/dist/resources/staticResources.d.ts.map +1 -1
  11. package/dist/resources/staticResources.js +12 -4
  12. package/dist/resources/staticResources.js.map +1 -1
  13. package/dist/server.d.ts +11 -3
  14. package/dist/server.d.ts.map +1 -1
  15. package/dist/server.js +211 -13
  16. package/dist/server.js.map +1 -1
  17. package/dist/services/AllChainsService.d.ts.map +1 -1
  18. package/dist/services/AllChainsService.js +59 -16
  19. package/dist/services/AllChainsService.js.map +1 -1
  20. package/dist/services/BalanceService.d.ts.map +1 -1
  21. package/dist/services/BalanceService.js +141 -38
  22. package/dist/services/BalanceService.js.map +1 -1
  23. package/dist/services/BaseService.d.ts.map +1 -1
  24. package/dist/services/BaseService.js +85 -23
  25. package/dist/services/BaseService.js.map +1 -1
  26. package/dist/services/BitcoinService.d.ts.map +1 -1
  27. package/dist/services/BitcoinService.js +23 -7
  28. package/dist/services/BitcoinService.js.map +1 -1
  29. package/dist/services/NftService.d.ts.map +1 -1
  30. package/dist/services/NftService.js +38 -10
  31. package/dist/services/NftService.js.map +1 -1
  32. package/dist/services/PricingService.d.ts.map +1 -1
  33. package/dist/services/PricingService.js +27 -9
  34. package/dist/services/PricingService.js.map +1 -1
  35. package/dist/services/SecurityService.d.ts.map +1 -1
  36. package/dist/services/SecurityService.js +6 -2
  37. package/dist/services/SecurityService.js.map +1 -1
  38. package/dist/services/TransactionService.d.ts.map +1 -1
  39. package/dist/services/TransactionService.js +72 -22
  40. package/dist/services/TransactionService.js.map +1 -1
  41. package/package.json +92 -87
package/dist/server.js CHANGED
@@ -12,23 +12,25 @@ import { addTransactionServiceTools } from "./services/TransactionService.js";
12
12
  import { GoldRushClient } from "@covalenthq/client-sdk";
13
13
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
14
14
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
15
+ import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
15
16
  import dotenv from "dotenv";
16
- const { version } = packageJson;
17
+ import express from "express";
17
18
  dotenv.config();
18
- export function createGoldRushClient() {
19
- const apiKey = process.env["GOLDRUSH_API_KEY"];
20
- if (!apiKey) {
21
- console.error("GOLDRUSH_API_KEY environment variable is not set.");
22
- process.exit(1);
19
+ const { version } = packageJson;
20
+ const DEFAULT_PORT = 3000;
21
+ export function createGoldRushClient(apiKey) {
22
+ const key = apiKey || process.env["GOLDRUSH_API_KEY"];
23
+ if (!key) {
24
+ throw new Error("GOLDRUSH_API_KEY is required. Provide it as a parameter or set the environment variable.");
23
25
  }
24
- return new GoldRushClient(apiKey);
26
+ return new GoldRushClient(key);
25
27
  }
26
- export function createServer() {
27
- const goldRushClient = createGoldRushClient();
28
+ export function createServer(apiKey) {
29
+ const goldRushClient = createGoldRushClient(apiKey);
28
30
  const server = new McpServer({
29
31
  name: "GoldRush MCP Server",
30
32
  version: version,
31
- });
33
+ }, { capabilities: { logging: {} } });
32
34
  addStaticResources(server);
33
35
  addRealTimeChainStatusResources(server, goldRushClient);
34
36
  addAllChainsServiceTools(server, goldRushClient);
@@ -41,14 +43,210 @@ export function createServer() {
41
43
  addSecurityServiceTools(server, goldRushClient);
42
44
  return server;
43
45
  }
44
- export async function startServer() {
46
+ export async function startStdioServer(apiKey) {
45
47
  try {
46
- const server = createServer();
48
+ const server = createServer(apiKey);
47
49
  const transport = new StdioServerTransport();
48
50
  await server.connect(transport);
49
51
  }
50
52
  catch (error) {
51
- console.error("Failed to start server:", error);
53
+ console.error("Failed to start STDIO server:", error);
54
+ process.exit(1);
55
+ }
56
+ }
57
+ export function startHttpServer(port = DEFAULT_PORT) {
58
+ const app = express();
59
+ app.use(express.json());
60
+ app.post("/mcp", async (req, res) => {
61
+ try {
62
+ const authHeader = req.headers.authorization;
63
+ const requestId = (() => {
64
+ try {
65
+ return req.body?.id || null;
66
+ }
67
+ catch {
68
+ return null;
69
+ }
70
+ })();
71
+ if (!authHeader || !authHeader.startsWith("Bearer ")) {
72
+ console.log("Received invalid Authorization header");
73
+ res.writeHead(401).end(JSON.stringify({
74
+ jsonrpc: "2.0",
75
+ error: {
76
+ code: -32001,
77
+ message: "Missing or invalid Authorization header. Expected format: Bearer <GOLDRUSH_API_KEY>",
78
+ },
79
+ id: requestId,
80
+ }));
81
+ return;
82
+ }
83
+ const apiKey = authHeader?.split(" ")[1];
84
+ if (!apiKey || apiKey.trim() === "") {
85
+ console.log("Received invalid API key");
86
+ res.writeHead(401).end(JSON.stringify({
87
+ jsonrpc: "2.0",
88
+ error: {
89
+ code: -32001,
90
+ message: "API key is empty or invalid",
91
+ },
92
+ id: requestId,
93
+ }));
94
+ return;
95
+ }
96
+ const server = createServer(apiKey);
97
+ const transport = new StreamableHTTPServerTransport({
98
+ sessionIdGenerator: undefined,
99
+ });
100
+ res.on("close", () => {
101
+ console.log("Request closed");
102
+ transport.close();
103
+ server.close();
104
+ });
105
+ await server.connect(transport);
106
+ await transport.handleRequest(req, res, req.body);
107
+ }
108
+ catch (error) {
109
+ console.error("Error handling MCP request:", error);
110
+ if (!res.headersSent) {
111
+ res.status(500).json({
112
+ jsonrpc: "2.0",
113
+ error: {
114
+ code: -32603,
115
+ message: "Internal server error",
116
+ },
117
+ id: null,
118
+ });
119
+ }
120
+ }
121
+ });
122
+ app.get("/mcp", async (req, res) => {
123
+ console.log("Received GET MCP request");
124
+ res.writeHead(405).end(JSON.stringify({
125
+ jsonrpc: "2.0",
126
+ error: {
127
+ code: -32000,
128
+ message: "Method not allowed.",
129
+ },
130
+ id: null,
131
+ }));
132
+ });
133
+ app.delete("/mcp", async (req, res) => {
134
+ console.log("Received DELETE MCP request");
135
+ res.writeHead(405).end(JSON.stringify({
136
+ jsonrpc: "2.0",
137
+ error: {
138
+ code: -32000,
139
+ message: "Method not allowed.",
140
+ },
141
+ id: null,
142
+ }));
143
+ });
144
+ app.listen(port, () => {
145
+ console.log(`MCP Streamable HTTP Server listening on port ${port}`);
146
+ });
147
+ process.on("SIGINT", async () => {
148
+ console.log("Shutting down HTTP server...");
149
+ process.exit(0);
150
+ });
151
+ }
152
+ export async function startServer(transportType = "stdio", options = {}) {
153
+ const { port = DEFAULT_PORT, apiKey } = options;
154
+ switch (transportType) {
155
+ case "stdio":
156
+ await startStdioServer(apiKey);
157
+ break;
158
+ case "http":
159
+ startHttpServer(port);
160
+ break;
161
+ default:
162
+ throw new Error(`Unsupported transport type: ${transportType}`);
163
+ }
164
+ }
165
+ export function parseArgsAndStart() {
166
+ try {
167
+ const args = process.argv.slice(2);
168
+ let transportType = "stdio";
169
+ let port = DEFAULT_PORT;
170
+ let apiKey;
171
+ for (let i = 0; i < args.length; i++) {
172
+ const arg = args[i];
173
+ switch (arg) {
174
+ case "--transport":
175
+ case "-t": {
176
+ const transport = args[i + 1];
177
+ if (!transport) {
178
+ throw new Error("Transport type is required");
179
+ }
180
+ if (transport === "stdio" || transport === "http") {
181
+ transportType = transport;
182
+ i++;
183
+ }
184
+ else {
185
+ throw new Error(`Invalid transport type: ${transport}. Supported: stdio, http`);
186
+ }
187
+ break;
188
+ }
189
+ case "--port":
190
+ case "-p": {
191
+ const portStr = args[i + 1];
192
+ if (!portStr) {
193
+ throw new Error("Port value is required");
194
+ }
195
+ const parsedPort = parseInt(portStr, 10);
196
+ if (isNaN(parsedPort) ||
197
+ parsedPort < 1 ||
198
+ parsedPort > 65535) {
199
+ throw new Error(`Invalid port: ${portStr}`);
200
+ }
201
+ port = parsedPort;
202
+ i++;
203
+ break;
204
+ }
205
+ case "--api-key":
206
+ case "-k": {
207
+ const keyValue = args[i + 1];
208
+ if (!keyValue) {
209
+ throw new Error("API key cannot be empty");
210
+ }
211
+ apiKey = keyValue;
212
+ i++;
213
+ break;
214
+ }
215
+ case "--help":
216
+ case "-h":
217
+ console.log(`
218
+ GoldRush MCP Server v${version}
219
+
220
+ Usage: goldrush-mcp-server [options]
221
+
222
+ Options:
223
+ -t, --transport <type> Transport type: stdio (default) or http
224
+ -p, --port <number> Port for HTTP transport (default: ${DEFAULT_PORT})
225
+ -k, --api-key <key> GoldRush API key (or set GOLDRUSH_API_KEY env var)
226
+ -h, --help Show this help message
227
+
228
+ Examples:
229
+ goldrush-mcp-server # STDIO transport
230
+ goldrush-mcp-server -t http # HTTP transport on default port
231
+ goldrush-mcp-server -t http -p 8080 # HTTP transport on port 8080
232
+ goldrush-mcp-server -k your_api_key # With API key argument
233
+ `);
234
+ process.exit(0);
235
+ break;
236
+ default:
237
+ if (arg && arg.startsWith("-")) {
238
+ throw new Error(`Unknown argument: ${arg}`);
239
+ }
240
+ break;
241
+ }
242
+ }
243
+ startServer(transportType, { port, apiKey }).catch((error) => {
244
+ console.error("Failed to start server:", error);
245
+ process.exit(1);
246
+ });
247
+ }
248
+ catch (error) {
249
+ console.error("Error:", error instanceof Error ? error.message : error);
52
250
  process.exit(1);
53
251
  }
54
252
  }
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAKA,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,m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"names":[],"mappings":"AAEA,OAAO,EAIH,KAAK,cAAc,EAEtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAczE,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,SAAS,EACjB,cAAc,EAAE,cAAc,QAwJjC"}
1
+ {"version":3,"file":"AllChainsService.d.ts","sourceRoot":"","sources":["../../src/services/AllChainsService.ts"],"names":[],"mappings":"AAEA,OAAO,EAIH,KAAK,cAAc,EAEtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAczE,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,SAAS,EACjB,cAAc,EAAE,cAAc,QAmOjC"}
@@ -13,16 +13,39 @@ export function addAllChainsServiceTools(server, goldRushClient) {
13
13
  z.enum(Object.values(ChainName)),
14
14
  z.number(),
15
15
  ]))
16
- .optional(),
17
- addresses: z.array(z.string()).optional(),
18
- limit: z.number().optional().default(10),
19
- before: z.string().optional(),
20
- after: z.string().optional(),
21
- withLogs: z.boolean().optional().default(false),
22
- withDecodedLogs: z.boolean().optional().default(false),
16
+ .optional()
17
+ .describe("Array of blockchain networks to query. Can be chain names (e.g., 'eth-mainnet') or chain IDs (e.g., 1). If not specified, queries all supported chains."),
18
+ addresses: z
19
+ .array(z.string())
20
+ .optional()
21
+ .describe("Array of wallet addresses to get transactions for. Each address should be a valid blockchain address."),
22
+ limit: z
23
+ .number()
24
+ .optional()
25
+ .default(10)
26
+ .describe("Maximum number of transactions to return per request. Default is 10, maximum is 100."),
27
+ before: z
28
+ .string()
29
+ .optional()
30
+ .describe("Pagination cursor to get transactions before this point. Use the 'before' value from previous response."),
31
+ after: z
32
+ .string()
33
+ .optional()
34
+ .describe("Pagination cursor to get transactions after this point. Use the 'after' value from previous response."),
35
+ withLogs: z
36
+ .boolean()
37
+ .optional()
38
+ .default(false)
39
+ .describe("Include transaction logs in the response. Default is false."),
40
+ withDecodedLogs: z
41
+ .boolean()
42
+ .optional()
43
+ .default(false)
44
+ .describe("Include decoded transaction logs in the response. Only applicable when withLogs is true. Default is false."),
23
45
  quoteCurrency: z
24
46
  .enum(Object.values(validQuoteValues))
25
- .optional(),
47
+ .optional()
48
+ .describe("Currency to quote token values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency."),
26
49
  }, async (params) => {
27
50
  try {
28
51
  const response = await goldRushClient.AllChainsService.getMultiChainMultiAddressTransactions({
@@ -56,19 +79,33 @@ export function addAllChainsServiceTools(server, goldRushClient) {
56
79
  "quoteCurrency for value conversion, limit (default 10), pagination (before), " +
57
80
  "and cutoffTimestamp to filter by time. " +
58
81
  "Use this to get a comprehensive view of token holdings across different blockchains.", {
59
- walletAddress: z.string(),
82
+ walletAddress: z
83
+ .string()
84
+ .describe("The wallet address to get token balances for. Must be a valid blockchain address."),
60
85
  quoteCurrency: z
61
86
  .enum(Object.values(validQuoteValues))
62
- .optional(),
63
- before: z.string().optional(),
64
- limit: z.number().optional().default(10),
87
+ .optional()
88
+ .describe("Currency to quote token values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency."),
89
+ before: z
90
+ .string()
91
+ .optional()
92
+ .describe("Pagination cursor to get balances before this point. Use the 'before' value from previous response."),
93
+ limit: z
94
+ .number()
95
+ .optional()
96
+ .default(10)
97
+ .describe("Maximum number of token balances to return. Default is 10, maximum is 100."),
65
98
  chains: z
66
99
  .array(z.union([
67
100
  z.enum(Object.values(ChainName)),
68
101
  z.number(),
69
102
  ]))
70
- .optional(),
71
- cutoffTimestamp: z.number().optional(),
103
+ .optional()
104
+ .describe("Array of blockchain networks to query balances from. Can be chain names or chain IDs. If not specified, queries all supported chains."),
105
+ cutoffTimestamp: z
106
+ .number()
107
+ .optional()
108
+ .describe("Unix timestamp to filter balances by last activity. Only returns tokens with activity after this time."),
72
109
  }, async (params) => {
73
110
  try {
74
111
  const response = await goldRushClient.AllChainsService.getMultiChainBalances(params.walletAddress, {
@@ -99,8 +136,14 @@ export function addAllChainsServiceTools(server, goldRushClient) {
99
136
  "determines whether to include testnet activity. " +
100
137
  "Returns a comprehensive summary of chain activity including transaction counts, " +
101
138
  "first/last activity timestamps, and activity status across all networks.", {
102
- walletAddress: z.string(),
103
- testnets: z.boolean().optional().default(false),
139
+ walletAddress: z
140
+ .string()
141
+ .describe("The wallet address to analyze activity for. Must be a valid blockchain address."),
142
+ testnets: z
143
+ .boolean()
144
+ .optional()
145
+ .default(false)
146
+ .describe("Whether to include testnet activity in the analysis. Default is false (mainnet only)."),
104
147
  }, async (params) => {
105
148
  try {
106
149
  const response = await goldRushClient.AllChainsService.getAddressActivity(params.walletAddress, { testnets: params.testnets });
@@ -1 +1 @@
1
- {"version":3,"file":"AllChainsService.js","sourceRoot":"","sources":["../../src/services/AllChainsService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAGH,SAAS,GAGZ,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,MAAM,UAAU,wBAAwB,CACpC,MAAiB,EACjB,cAA8B;IAE9B,MAAM,CAAC,IAAI,CACP,yBAAyB,EACzB,+EAA+E;QAC3E,sEAAsE;QACtE,qFAAqF;QACrF,2DAA2D;QAC3D,mFAAmF,EACvF;QACI,MAAM,EAAE,CAAC;aACJ,KAAK,CACF,CAAC,CAAC,KAAK,CAAC;YACJ,CAAC,CAAC,IAAI,CACF,MAAM,CAAC,MAAM,CAAC,SAAS,CAA0B,CACpD;YACD,CAAC,CAAC,MAAM,EAAE;SACb,CAAC,CACL;aACA,QAAQ,EAAE;QACf,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;QACzC,KAAK,EAAE,CAAC,CAAC,M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aACJ,CAAC;QACN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO;gBACH,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,EAAE,EAAE,CAAC;gBACpD,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;IACL,CAAC,CACJ,CAAC;IAEF,MAAM,CAAC,IAAI,CACP,6BAA6B,EAC7B,sEAAsE;QAClE,sEAAsE;QACtE,kDAAkD;QAClD,kFAAkF;QAClF,0EAA0E,EAC9E;QACI,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;QACzB,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;KAClD,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,IAAI,CAAC;YACD,MAAM,QAAQ,GACV,MAAM,cAAc,CAAC,gBAAgB,CAAC,kBAAkB,CACpD,MAAM,CAAC,aAAa,EACpB,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAChC,CAAC;YACN,OAAO;gBACH,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC;qBAC3C;iBACJ;aACJ,CAAC;QACN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO;gBACH,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,EAAE,EAAE,CAAC;gBACpD,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;IACL,CAAC,CACJ,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"AllChainsService.js","sourceRoot":"","sources":["../../src/services/AllChainsService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,M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IACL,CAAC,CACJ,CAAC;IAEF,MAAM,CAAC,IAAI,CACP,6BAA6B,EAC7B,sEAAsE;QAClE,sEAAsE;QACtE,kDAAkD;QAClD,kFAAkF;QAClF,0EAA0E,EAC9E;QACI,aAAa,EAAE,CAAC;aACX,MAAM,EAAE;aACR,QAAQ,CACL,iFAAiF,CACpF;QACL,QAAQ,EAAE,CAAC;aACN,OAAO,EAAE;aACT,QAAQ,EAAE;aACV,OAAO,CAAC,KAAK,CAAC;aACd,QAAQ,CACL,uFAAuF,CAC1F;KACR,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,IAAI,CAAC;YACD,MAAM,QAAQ,GACV,MAAM,cAAc,CAAC,gBAAgB,CAAC,kBAAkB,CACpD,MAAM,CAAC,aAAa,EACpB,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAChC,CAAC;YACN,OAAO;gBACH,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC;qBAC3C;iBACJ;aACJ,CAAC;QACN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO;gBACH,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,EAAE,EAAE,CAAC;gBACpD,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;IACL,CAAC,CACJ,CAAC;AACN,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BalanceService.d.ts","sourceRoot":"","sources":["../../src/services/BalanceService.ts"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,cAAc,EAEtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkBzE,wBAAgB,sBAAsB,CAClC,MAAM,EAAE,SAAS,EACjB,cAAc,EAAE,cAAc,QAuSjC"}
1
+ {"version":3,"file":"BalanceService.d.ts","sourceRoot":"","sources":["../../src/services/BalanceService.ts"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,cAAc,EAEtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkBzE,wBAAgB,sBAAsB,CAClC,MAAM,EAAE,SAAS,EACjB,cAAc,EAAE,cAAc,QA4cjC"}
@@ -8,15 +8,36 @@ export function addBalanceServiceTools(server, goldRushClient) {
8
8
  "Optional: quoteCurrency for value conversion, nft (include NFTs, default false), " +
9
9
  "noNftFetch, noSpam, and noNftAssetMetadata (all default true) to control data returned. " +
10
10
  "Returns detailed token balance information including spot prices and metadata.", {
11
- chainName: z.enum(Object.values(ChainName)),
12
- address: z.string(),
11
+ chainName: z
12
+ .enum(Object.values(ChainName))
13
+ .describe("The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."),
14
+ address: z
15
+ .string()
16
+ .describe("The wallet address to get token balances for. Must be a valid blockchain address."),
13
17
  quoteCurrency: z
14
18
  .enum(Object.values(validQuoteValues))
15
- .optional(),
16
- nft: z.boolean().optional().default(false),
17
- noNftFetch: z.boolean().optional().default(true),
18
- noSpam: z.boolean().optional().default(true),
19
- noNftAssetMetadata: z.boolean().optional().default(true),
19
+ .optional()
20
+ .describe("Currency to quote token values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency."),
21
+ nft: z
22
+ .boolean()
23
+ .optional()
24
+ .default(false)
25
+ .describe("Include NFT token balances in the response. Default is false."),
26
+ noNftFetch: z
27
+ .boolean()
28
+ .optional()
29
+ .default(true)
30
+ .describe("Skip fetching NFT metadata. Default is true for better performance."),
31
+ noSpam: z
32
+ .boolean()
33
+ .optional()
34
+ .default(true)
35
+ .describe("Filter out spam/scam tokens from results. Default is true."),
36
+ noNftAssetMetadata: z
37
+ .boolean()
38
+ .optional()
39
+ .default(true)
40
+ .describe("Skip fetching NFT asset metadata. Default is true for better performance."),
20
41
  }, async (params) => {
21
42
  try {
22
43
  const response = await goldRushClient.BalanceService.getTokenBalancesForWalletAddress(params.chainName, params.address, {
@@ -47,17 +68,44 @@ export function addBalanceServiceTools(server, goldRushClient) {
47
68
  "Optional: quoteCurrency for value conversion, blockHeight or date to specify point in time, " +
48
69
  "nft (include NFTs, default false), noNftFetch, noSpam, and noNftAssetMetadata (all default true). " +
49
70
  "Returns token balances as they existed at the specified historical point.", {
50
- chainName: z.enum(Object.values(ChainName)),
51
- address: z.string(),
71
+ chainName: z
72
+ .enum(Object.values(ChainName))
73
+ .describe("The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."),
74
+ address: z
75
+ .string()
76
+ .describe("The wallet address to get historical token balances for. Must be a valid blockchain address."),
52
77
  quoteCurrency: z
53
78
  .enum(Object.values(validQuoteValues))
54
- .optional(),
55
- nft: z.boolean().optional().default(false),
56
- noNftFetch: z.boolean().optional().default(true),
57
- noSpam: z.boolean().optional().default(true),
58
- noNftAssetMetadata: z.boolean().optional().default(true),
59
- blockHeight: z.number().optional(),
60
- date: z.string().optional(),
79
+ .optional()
80
+ .describe("Currency to quote token values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency."),
81
+ nft: z
82
+ .boolean()
83
+ .optional()
84
+ .default(false)
85
+ .describe("Include NFT token balances in the response. Default is false."),
86
+ noNftFetch: z
87
+ .boolean()
88
+ .optional()
89
+ .default(true)
90
+ .describe("Skip fetching NFT metadata. Default is true for better performance."),
91
+ noSpam: z
92
+ .boolean()
93
+ .optional()
94
+ .default(true)
95
+ .describe("Filter out spam/scam tokens from results. Default is true."),
96
+ noNftAssetMetadata: z
97
+ .boolean()
98
+ .optional()
99
+ .default(true)
100
+ .describe("Skip fetching NFT asset metadata. Default is true for better performance."),
101
+ blockHeight: z
102
+ .number()
103
+ .optional()
104
+ .describe("Specific block height to get historical balances from. Cannot be used with date parameter."),
105
+ date: z
106
+ .string()
107
+ .optional()
108
+ .describe("Specific date to get historical balances from (YYYY-MM-DD format). Cannot be used with blockHeight parameter."),
61
109
  }, async (params) => {
62
110
  try {
63
111
  const response = await goldRushClient.BalanceService.getHistoricalTokenBalancesForWalletAddress(params.chainName, params.address, {
@@ -89,12 +137,21 @@ export function addBalanceServiceTools(server, goldRushClient) {
89
137
  "Required: chainName (blockchain network), walletAddress (wallet address). " +
90
138
  "Optional: quoteCurrency for value conversion, days (timeframe to analyze, default 7). " +
91
139
  "Returns portfolio value time series data showing value changes over the specified timeframe.", {
92
- chainName: z.enum(Object.values(ChainName)),
93
- walletAddress: z.string(),
140
+ chainName: z
141
+ .enum(Object.values(ChainName))
142
+ .describe("The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."),
143
+ walletAddress: z
144
+ .string()
145
+ .describe("The wallet address to get portfolio history for. Must be a valid blockchain address."),
94
146
  quoteCurrency: z
95
147
  .enum(Object.values(validQuoteValues))
96
- .optional(),
97
- days: z.number().optional().default(7),
148
+ .optional()
149
+ .describe("Currency to quote portfolio values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency."),
150
+ days: z
151
+ .number()
152
+ .optional()
153
+ .default(7)
154
+ .describe("Number of days of historical data to retrieve. Default is 7 days."),
98
155
  }, async (params) => {
99
156
  try {
100
157
  const response = await goldRushClient.BalanceService.getHistoricalPortfolioForWalletAddress(params.chainName, params.walletAddress, {
@@ -122,16 +179,38 @@ export function addBalanceServiceTools(server, goldRushClient) {
122
179
  "Optional: quoteCurrency for value conversion, contractAddress to filter by specific token, " +
123
180
  "startingBlock/endingBlock to set range, pageSize (default 10) and pageNumber (default 0). " +
124
181
  "Returns token transfer events with timestamps, values, and transaction details.", {
125
- chainName: z.enum(Object.values(ChainName)),
126
- walletAddress: z.string(),
182
+ chainName: z
183
+ .enum(Object.values(ChainName))
184
+ .describe("The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."),
185
+ walletAddress: z
186
+ .string()
187
+ .describe("The wallet address to get ERC20 transfers for. Must be a valid blockchain address."),
127
188
  quoteCurrency: z
128
189
  .enum(Object.values(validQuoteValues))
129
- .optional(),
130
- contractAddress: z.string().nullable(),
131
- startingBlock: z.number().optional(),
132
- endingBlock: z.number().optional(),
133
- pageSize: z.number().optional().default(10),
134
- pageNumber: z.number().optional().default(0),
190
+ .optional()
191
+ .describe("Currency to quote transfer values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency."),
192
+ contractAddress: z
193
+ .string()
194
+ .nullable()
195
+ .describe("Specific ERC20 token contract address to filter transfers. If null, returns transfers for all ERC20 tokens."),
196
+ startingBlock: z
197
+ .number()
198
+ .optional()
199
+ .describe("Starting block number to begin search from. Use with endingBlock to define a range."),
200
+ endingBlock: z
201
+ .number()
202
+ .optional()
203
+ .describe("Ending block number to search until. Use with startingBlock to define a range."),
204
+ pageSize: z
205
+ .number()
206
+ .optional()
207
+ .default(10)
208
+ .describe("Number of transfers to return per page. Default is 10, maximum is 100."),
209
+ pageNumber: z
210
+ .number()
211
+ .optional()
212
+ .default(0)
213
+ .describe("Page number for pagination, starting from 0. Default is 0."),
135
214
  }, async (params) => {
136
215
  try {
137
216
  const response = await goldRushClient.BalanceService.getErc20TransfersForWalletAddressByPage(params.chainName, params.walletAddress, {
@@ -162,12 +241,28 @@ export function addBalanceServiceTools(server, goldRushClient) {
162
241
  "Required: chainName (blockchain network), tokenAddress (token contract address). " +
163
242
  "Optional: blockHeight or date for historical data, pageSize and pageNumber for pagination. " +
164
243
  "Returns list of addresses holding the token with balance amounts and ownership percentages.", {
165
- chainName: z.enum(Object.values(ChainName)),
166
- tokenAddress: z.string(),
167
- blockHeight: z.union([z.string(), z.number()]).optional(),
168
- date: z.string().optional(),
169
- pageSize: z.number().optional(),
170
- pageNumber: z.number().optional(),
244
+ chainName: z
245
+ .enum(Object.values(ChainName))
246
+ .describe("The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."),
247
+ tokenAddress: z
248
+ .string()
249
+ .describe("The token contract address to get holders for. Must be a valid ERC20 or ERC721 contract address."),
250
+ blockHeight: z
251
+ .union([z.string(), z.number()])
252
+ .optional()
253
+ .describe("Specific block height to get historical token holders from. Cannot be used with date parameter."),
254
+ date: z
255
+ .string()
256
+ .optional()
257
+ .describe("Specific date to get historical token holders from (YYYY-MM-DD format). Cannot be used with blockHeight parameter."),
258
+ pageSize: z
259
+ .number()
260
+ .optional()
261
+ .describe("Number of token holders to return per page. Maximum is 100."),
262
+ pageNumber: z
263
+ .number()
264
+ .optional()
265
+ .describe("Page number for pagination, starting from 0."),
171
266
  }, async (params) => {
172
267
  try {
173
268
  const response = await goldRushClient.BalanceService.getTokenHoldersV2ForTokenAddressByPage(params.chainName, params.tokenAddress, {
@@ -196,12 +291,20 @@ export function addBalanceServiceTools(server, goldRushClient) {
196
291
  "Required: chainName (blockchain network), walletAddress (wallet address). " +
197
292
  "Optional: quoteCurrency for value conversion, blockHeight for historical balance. " +
198
293
  "Returns native token balance with current market value and token metadata.", {
199
- chainName: z.enum(Object.values(ChainName)),
200
- walletAddress: z.string(),
294
+ chainName: z
295
+ .enum(Object.values(ChainName))
296
+ .describe("The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."),
297
+ walletAddress: z
298
+ .string()
299
+ .describe("The wallet address to get native token balance for. Must be a valid blockchain address."),
201
300
  quoteCurrency: z
202
301
  .enum(Object.values(validQuoteValues))
203
- .optional(),
204
- blockHeight: z.union([z.string(), z.number()]).optional(),
302
+ .optional()
303
+ .describe("Currency to quote native token value in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency."),
304
+ blockHeight: z
305
+ .union([z.string(), z.number()])
306
+ .optional()
307
+ .describe("Specific block height to get historical native token balance from."),
205
308
  }, async (params) => {
206
309
  try {
207
310
  const response = await goldRushClient.BalanceService.getNativeTokenBalance(params.chainName, params.walletAddress, {