moon-iq 0.2.0 → 0.2.1
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/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
- package/src/auth.ts +0 -332
- package/src/client.ts +0 -68
- package/src/generated/client.ts +0 -556
- package/src/index.ts +0 -307
- package/tsconfig.json +0 -10
- package/tsup.config.ts +0 -10
package/src/generated/client.ts
DELETED
|
@@ -1,556 +0,0 @@
|
|
|
1
|
-
// Generated by scripts/generate-cli-client.ts - do not edit
|
|
2
|
-
export const TOOL_NAMES = [
|
|
3
|
-
"iron_account_create",
|
|
4
|
-
"iron_account_retrieve",
|
|
5
|
-
"iron_offramp_create",
|
|
6
|
-
"iron_offramp_initiate",
|
|
7
|
-
"iron_offramp_list",
|
|
8
|
-
"iron_offramp_retrieve",
|
|
9
|
-
"iron_onramp_create",
|
|
10
|
-
"iron_onramp_list",
|
|
11
|
-
"iron_onramp_retrieve",
|
|
12
|
-
"lending_account_retrieve",
|
|
13
|
-
"lending_deposit",
|
|
14
|
-
"lending_rate_retrieve",
|
|
15
|
-
"lending_recommend",
|
|
16
|
-
"lending_withdraw",
|
|
17
|
-
"moonit_buy",
|
|
18
|
-
"moonit_buy_recommend",
|
|
19
|
-
"moonit_sell",
|
|
20
|
-
"moonit_sell_recommend",
|
|
21
|
-
"moonit_token_list",
|
|
22
|
-
"moonpay_buy",
|
|
23
|
-
"rhythm_token_list",
|
|
24
|
-
"rhythm_token_trending_list",
|
|
25
|
-
"rhythm_trade_list",
|
|
26
|
-
"token_balance_list",
|
|
27
|
-
"token_balance_retrieve",
|
|
28
|
-
"token_buy",
|
|
29
|
-
"token_digest_retrieve",
|
|
30
|
-
"token_limit_buy",
|
|
31
|
-
"token_limit_buy_recommend",
|
|
32
|
-
"token_limit_order_list",
|
|
33
|
-
"token_limit_recommend",
|
|
34
|
-
"token_limit_sell",
|
|
35
|
-
"token_limit_sell_recommend",
|
|
36
|
-
"token_recurring_buy",
|
|
37
|
-
"token_recurring_order_list",
|
|
38
|
-
"token_recurring_recommend",
|
|
39
|
-
"token_recurring_sell",
|
|
40
|
-
"token_retrieve",
|
|
41
|
-
"token_search",
|
|
42
|
-
"token_sell",
|
|
43
|
-
"token_swap",
|
|
44
|
-
"token_swap_recommend",
|
|
45
|
-
"token_trending_list",
|
|
46
|
-
"user_retrieve",
|
|
47
|
-
"user_update"
|
|
48
|
-
] as const;
|
|
49
|
-
|
|
50
|
-
export type ToolOption = {
|
|
51
|
-
name: string;
|
|
52
|
-
type: "string" | "number" | "boolean";
|
|
53
|
-
description: string;
|
|
54
|
-
required: boolean;
|
|
55
|
-
choices?: string[];
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export type ToolDefinition = {
|
|
59
|
-
name: string;
|
|
60
|
-
description: string;
|
|
61
|
-
options: ToolOption[];
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export const TOOL_DEFINITIONS: ToolDefinition[] = [
|
|
65
|
-
{
|
|
66
|
-
"name": "iron_account_create",
|
|
67
|
-
"description": "Create a new Iron account for the user.",
|
|
68
|
-
"options": []
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"name": "iron_account_retrieve",
|
|
72
|
-
"description": "Get the user's Iron account information.",
|
|
73
|
-
"options": []
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"name": "iron_offramp_create",
|
|
77
|
-
"description": "Create a new offramp for the user to convert crypto to fiat",
|
|
78
|
-
"options": [
|
|
79
|
-
{
|
|
80
|
-
"name": "name",
|
|
81
|
-
"type": "string",
|
|
82
|
-
"description": "The name of the offramp",
|
|
83
|
-
"required": true
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"name": "fiat",
|
|
87
|
-
"type": "string",
|
|
88
|
-
"description": "The fiat currency to convert to",
|
|
89
|
-
"required": true
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"name": "stablecoin",
|
|
93
|
-
"type": "string",
|
|
94
|
-
"description": "The stablecoin token to convert from",
|
|
95
|
-
"required": true
|
|
96
|
-
}
|
|
97
|
-
]
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
"name": "iron_offramp_initiate",
|
|
101
|
-
"description": "Initiate an offramp by sending stablecoin to the offramp's deposit account. The stablecoin will be converted to fiat and deposited into your registered bank account. This process is asynchronous and may take some time for funds to appear in your bank account.",
|
|
102
|
-
"options": []
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"name": "iron_offramp_list",
|
|
106
|
-
"description": "Get all offramps for the user",
|
|
107
|
-
"options": []
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"name": "iron_offramp_retrieve",
|
|
111
|
-
"description": "Get an offramp for the user",
|
|
112
|
-
"options": [
|
|
113
|
-
{
|
|
114
|
-
"name": "offrampId",
|
|
115
|
-
"type": "string",
|
|
116
|
-
"description": "The ID of the offramp to retrieve",
|
|
117
|
-
"required": true
|
|
118
|
-
}
|
|
119
|
-
]
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"name": "iron_onramp_create",
|
|
123
|
-
"description": "Create an onramp to convert fiat currency to a stablecoin",
|
|
124
|
-
"options": [
|
|
125
|
-
{
|
|
126
|
-
"name": "name",
|
|
127
|
-
"type": "string",
|
|
128
|
-
"description": "The name of the onramp",
|
|
129
|
-
"required": true
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
"name": "fiat",
|
|
133
|
-
"type": "string",
|
|
134
|
-
"description": "The fiat currency to convert from",
|
|
135
|
-
"required": true
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
"name": "stablecoin",
|
|
139
|
-
"type": "string",
|
|
140
|
-
"description": "The stablecoin token to convert to",
|
|
141
|
-
"required": true
|
|
142
|
-
}
|
|
143
|
-
]
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"name": "iron_onramp_list",
|
|
147
|
-
"description": "Get all onramps for the user",
|
|
148
|
-
"options": [
|
|
149
|
-
{
|
|
150
|
-
"name": "status",
|
|
151
|
-
"type": "string",
|
|
152
|
-
"description": "Status of the onramps to get",
|
|
153
|
-
"required": true
|
|
154
|
-
}
|
|
155
|
-
]
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
"name": "iron_onramp_retrieve",
|
|
159
|
-
"description": "Get an onramp for the user",
|
|
160
|
-
"options": [
|
|
161
|
-
{
|
|
162
|
-
"name": "onrampId",
|
|
163
|
-
"type": "string",
|
|
164
|
-
"description": "The ID of the onramp to retrieve",
|
|
165
|
-
"required": true
|
|
166
|
-
}
|
|
167
|
-
]
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
"name": "lending_account_retrieve",
|
|
171
|
-
"description": "Get account details for a lending account by wallet address, including balances, interest earned, and withdrawal limits",
|
|
172
|
-
"options": []
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
"name": "lending_deposit",
|
|
176
|
-
"description": "Deposit USDC into your lending account to earn interest.",
|
|
177
|
-
"options": []
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
"name": "lending_rate_retrieve",
|
|
181
|
-
"description": "Get current and historical interest rates for lending USDC",
|
|
182
|
-
"options": []
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
"name": "lending_recommend",
|
|
186
|
-
"description": "Analyze user's lending account and wallet balances to recommend either a deposit or withdraw action with appropriate parameters. Understands queries like 'should I deposit more?', 'recommend a withdrawal', or 'what should I do with my lending account?'.",
|
|
187
|
-
"options": [
|
|
188
|
-
{
|
|
189
|
-
"name": "query",
|
|
190
|
-
"type": "string",
|
|
191
|
-
"description": "Natural language query about lending recommendations. Examples: 'should I deposit more?', 'recommend a withdrawal', 'what should I do with my lending account?'.",
|
|
192
|
-
"required": true
|
|
193
|
-
}
|
|
194
|
-
]
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
"name": "lending_withdraw",
|
|
198
|
-
"description": "Withdraw USDC from your lending account.",
|
|
199
|
-
"options": []
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
"name": "moonit_buy",
|
|
203
|
-
"description": "Buy tokens on Moonit platform using bonding curve. This tool converts USDC to SOL, then uses the SOL as collateral to buy Moonit tokens. It builds, signs, and executes the transaction. Note: This tool requires SOL for transaction fees.",
|
|
204
|
-
"options": []
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
"name": "moonit_buy_recommend",
|
|
208
|
-
"description": "Parse natural language queries into structured buy parameters for Moonit on Solana. Understands queries like 'buy 100 USDC worth of Moonit token', 'buy $50 worth of token ABC', or 'buy all my USDC worth of Moonit token XYZ'. Returns the recommended buy parameters ready to use with moonit_buy.",
|
|
209
|
-
"options": [
|
|
210
|
-
{
|
|
211
|
-
"name": "query",
|
|
212
|
-
"type": "string",
|
|
213
|
-
"description": "Natural language description of the desired buy transaction on Moonit. Examples: 'buy 100 USDC worth of Moonit token', 'buy $50 worth of token ABC', 'buy all my USDC worth of Moonit token XYZ'. The agent will parse token and amount from this query.",
|
|
214
|
-
"required": true
|
|
215
|
-
}
|
|
216
|
-
]
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
"name": "moonit_sell",
|
|
220
|
-
"description": "Sell tokens on Moonit platform using bonding curve. This tool sells Moonit tokens to get SOL, then converts SOL to USDC. It builds, signs, and executes the transaction. Note: This tool requires SOL for transaction fees.",
|
|
221
|
-
"options": []
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
"name": "moonit_sell_recommend",
|
|
225
|
-
"description": "Parse natural language queries into structured sell parameters for Moonit on Solana. Understands queries like 'sell 100 SANTAMOON tokens', 'sell all my Moonit tokens', or 'sell 50% of my token ABC'. Returns the recommended sell parameters ready to use with moonit_sell.",
|
|
226
|
-
"options": [
|
|
227
|
-
{
|
|
228
|
-
"name": "query",
|
|
229
|
-
"type": "string",
|
|
230
|
-
"description": "Natural language description of the desired sell transaction on Moonit. Examples: 'sell 100 SANTAMOON tokens', 'sell all my Moonit tokens', 'sell 50% of my token ABC'. The agent will parse token and amount from this query.",
|
|
231
|
-
"required": true
|
|
232
|
-
}
|
|
233
|
-
]
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
"name": "moonit_token_list",
|
|
237
|
-
"description": "Get the most popular Moonit tokens sorted by market capitalization. Moonit is a token launch platform by DEX Screener x Helio offering bonding curve mechanics, daily LP rewards, and graduation to Raydium/Meteora DEXs.",
|
|
238
|
-
"options": []
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
"name": "moonpay_buy",
|
|
242
|
-
"description": "Buy a token using Moonpay. Specify either from.amount (USD to spend) or to.amount (tokens to buy), not both.",
|
|
243
|
-
"options": [
|
|
244
|
-
{
|
|
245
|
-
"name": "from",
|
|
246
|
-
"type": "string",
|
|
247
|
-
"description": "Payment currency and amount to spend",
|
|
248
|
-
"required": true
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
"name": "to",
|
|
252
|
-
"type": "string",
|
|
253
|
-
"description": "Destination chain, currency, and token amount",
|
|
254
|
-
"required": true
|
|
255
|
-
}
|
|
256
|
-
]
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
"name": "rhythm_token_list",
|
|
260
|
-
"description": "List tokens from Rhythm",
|
|
261
|
-
"options": []
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
"name": "rhythm_token_trending_list",
|
|
265
|
-
"description": "Get trending tokens from Rhythm",
|
|
266
|
-
"options": [
|
|
267
|
-
{
|
|
268
|
-
"name": "type",
|
|
269
|
-
"type": "string",
|
|
270
|
-
"description": "Type of trending tokens to get",
|
|
271
|
-
"required": true,
|
|
272
|
-
"choices": [
|
|
273
|
-
"holding_strong",
|
|
274
|
-
"survivor",
|
|
275
|
-
"legacies"
|
|
276
|
-
]
|
|
277
|
-
}
|
|
278
|
-
]
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
"name": "rhythm_trade_list",
|
|
282
|
-
"description": "Get whale trades from Rhythm discover",
|
|
283
|
-
"options": []
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
"name": "token_balance_list",
|
|
287
|
-
"description": "List all token balances held in a wallet, including amount owned, current value in USD, and token details. Shows the complete token portfolio.",
|
|
288
|
-
"options": [
|
|
289
|
-
{
|
|
290
|
-
"name": "wallet",
|
|
291
|
-
"type": "string",
|
|
292
|
-
"description": "Wallet address to check token balances for",
|
|
293
|
-
"required": true
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
"name": "chain",
|
|
297
|
-
"type": "string",
|
|
298
|
-
"description": "Blockchain to check balances on (e.g. 'solana', 'ethereum', 'base')",
|
|
299
|
-
"required": true
|
|
300
|
-
}
|
|
301
|
-
]
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
"name": "token_balance_retrieve",
|
|
305
|
-
"description": "Get the balance of a specific token in a wallet, including the amount owned, current USD value, and token price. Returns zero balance if token is not held.",
|
|
306
|
-
"options": [
|
|
307
|
-
{
|
|
308
|
-
"name": "wallet",
|
|
309
|
-
"type": "string",
|
|
310
|
-
"description": "Wallet address to check the balance for",
|
|
311
|
-
"required": true
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
"name": "token",
|
|
315
|
-
"type": "string",
|
|
316
|
-
"description": "Token address to check the balance of",
|
|
317
|
-
"required": true
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
"name": "chain",
|
|
321
|
-
"type": "string",
|
|
322
|
-
"description": "Blockchain where the token and wallet exist",
|
|
323
|
-
"required": true
|
|
324
|
-
}
|
|
325
|
-
]
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
"name": "token_buy",
|
|
329
|
-
"description": "Swap the specified amount of USDC for a token.",
|
|
330
|
-
"options": []
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
"name": "token_digest_retrieve",
|
|
334
|
-
"description": "Retrieve a token digest by token and chain.",
|
|
335
|
-
"options": [
|
|
336
|
-
{
|
|
337
|
-
"name": "token",
|
|
338
|
-
"type": "string",
|
|
339
|
-
"description": "Token address",
|
|
340
|
-
"required": true
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
"name": "chain",
|
|
344
|
-
"type": "string",
|
|
345
|
-
"description": "Blockchain network where the token exists",
|
|
346
|
-
"required": true
|
|
347
|
-
}
|
|
348
|
-
]
|
|
349
|
-
},
|
|
350
|
-
{
|
|
351
|
-
"name": "token_limit_buy",
|
|
352
|
-
"description": "Create a limit buy order to swap USDC for a token at a specific price.",
|
|
353
|
-
"options": []
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
"name": "token_limit_buy_recommend",
|
|
357
|
-
"description": "Parse natural language queries into structured limit buy parameters. Understands queries like 'buy BONK at $0.00001', 'limit buy 100 USDC worth of SOL when price reaches $150', or 'buy BONK at $0.00001 with 50 USDC'. Returns the recommended limit buy parameters ready to use with token_limit_buy.",
|
|
358
|
-
"options": [
|
|
359
|
-
{
|
|
360
|
-
"name": "query",
|
|
361
|
-
"type": "string",
|
|
362
|
-
"description": "Natural language description of the desired limit buy order. Examples: 'buy BONK at $0.00001', 'limit buy 100 USDC worth of SOL when price reaches $150', 'buy BONK at $0.00001 with 50 USDC'. The agent will parse token, amount, and price from this query.",
|
|
363
|
-
"required": true
|
|
364
|
-
}
|
|
365
|
-
]
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
"name": "token_limit_order_list",
|
|
369
|
-
"description": "Get limit orders for the authenticated user.",
|
|
370
|
-
"options": []
|
|
371
|
-
},
|
|
372
|
-
{
|
|
373
|
-
"name": "token_limit_recommend",
|
|
374
|
-
"description": "Parse natural language queries into structured limit order parameters (buy or sell). Understands queries like 'buy BONK at $0.00001', 'sell BONK at $0.00002', 'limit buy 100 USDC worth of SOL when price reaches $150', or 'sell all my BONK at $0.00002'. Automatically determines if the request is a buy or sell order and returns the appropriate parameters ready to use with token_limit_buy or token_limit_sell.",
|
|
375
|
-
"options": [
|
|
376
|
-
{
|
|
377
|
-
"name": "query",
|
|
378
|
-
"type": "string",
|
|
379
|
-
"description": "Natural language description of the desired limit order (buy or sell). Examples: 'buy BONK at $0.00001', 'sell BONK at $0.00002', 'limit buy 100 USDC worth of SOL when price reaches $150', 'sell all my BONK at $0.00002'. The agent will parse the order type (buy/sell), token, amount, and price from this query.",
|
|
380
|
-
"required": true
|
|
381
|
-
}
|
|
382
|
-
]
|
|
383
|
-
},
|
|
384
|
-
{
|
|
385
|
-
"name": "token_limit_sell",
|
|
386
|
-
"description": "Create a limit sell order to swap a token for USDC at a specific price.",
|
|
387
|
-
"options": []
|
|
388
|
-
},
|
|
389
|
-
{
|
|
390
|
-
"name": "token_limit_sell_recommend",
|
|
391
|
-
"description": "Parse natural language queries into structured limit sell parameters. Understands queries like 'sell BONK at $0.00002', 'limit sell 100 SOL when price reaches $200', or 'sell all my BONK at $0.00002'. Returns the recommended limit sell parameters ready to use with token_limit_sell.",
|
|
392
|
-
"options": [
|
|
393
|
-
{
|
|
394
|
-
"name": "query",
|
|
395
|
-
"type": "string",
|
|
396
|
-
"description": "Natural language description of the desired limit sell order. Examples: 'sell BONK at $0.00002', 'limit sell 100 SOL when price reaches $200', 'sell all my BONK at $0.00002'. The agent will parse token, amount, and price from this query.",
|
|
397
|
-
"required": true
|
|
398
|
-
}
|
|
399
|
-
]
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
"name": "token_recurring_buy",
|
|
403
|
-
"description": "Create a recurring buy order (DCA) to swap USDC for a token at regular intervals.",
|
|
404
|
-
"options": []
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
"name": "token_recurring_order_list",
|
|
408
|
-
"description": "Get recurring orders.",
|
|
409
|
-
"options": []
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
"name": "token_recurring_recommend",
|
|
413
|
-
"description": "Parse natural language queries into structured recurring order (DCA) parameters (buy or sell). Understands queries like 'buy BONK daily with 50 USDC for 10 days', 'sell BONK daily, 100 tokens per order for 10 days', 'DCA 100 USDC into SOL weekly for a month', or 'recurring sell SOL every day, 0.5 SOL, 20 orders'. Automatically determines if the request is a buy or sell order and returns the appropriate parameters ready to use with token_recurring_buy or token_recurring_sell.",
|
|
414
|
-
"options": [
|
|
415
|
-
{
|
|
416
|
-
"name": "query",
|
|
417
|
-
"type": "string",
|
|
418
|
-
"description": "Natural language description of the desired recurring order (buy or sell). Examples: 'buy BONK daily with 50 USDC for 10 days', 'sell BONK daily, 100 tokens per order for 10 days', 'DCA 100 USDC into SOL weekly for a month', 'recurring sell SOL every day, 0.5 SOL, 20 orders'. The agent will parse the order type (buy/sell), token, amount, interval, and numberOfOrders from this query.",
|
|
419
|
-
"required": true
|
|
420
|
-
}
|
|
421
|
-
]
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
"name": "token_recurring_sell",
|
|
425
|
-
"description": "Create a recurring sell order (DCA) to swap a token for USDC at regular intervals.",
|
|
426
|
-
"options": []
|
|
427
|
-
},
|
|
428
|
-
{
|
|
429
|
-
"name": "token_retrieve",
|
|
430
|
-
"description": "Get detailed token information including market data, price changes, volume, trades, and holder statistics by token address",
|
|
431
|
-
"options": [
|
|
432
|
-
{
|
|
433
|
-
"name": "token",
|
|
434
|
-
"type": "string",
|
|
435
|
-
"description": "Address of the token to retrieve",
|
|
436
|
-
"required": true
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
"name": "chain",
|
|
440
|
-
"type": "string",
|
|
441
|
-
"description": "Blockchain network where the token exists",
|
|
442
|
-
"required": true
|
|
443
|
-
}
|
|
444
|
-
]
|
|
445
|
-
},
|
|
446
|
-
{
|
|
447
|
-
"name": "token_search",
|
|
448
|
-
"description": "Search for tokens by name, symbol, or address. Returns matching tokens with their market data including price, volume, and liquidity.",
|
|
449
|
-
"options": [
|
|
450
|
-
{
|
|
451
|
-
"name": "query",
|
|
452
|
-
"type": "string",
|
|
453
|
-
"description": "Search term - can be token name (e.g. 'Bitcoin'), symbol (e.g. 'BTC'), or partial match",
|
|
454
|
-
"required": true
|
|
455
|
-
},
|
|
456
|
-
{
|
|
457
|
-
"name": "chain",
|
|
458
|
-
"type": "string",
|
|
459
|
-
"description": "Blockchain to search on (e.g. 'solana', 'ethereum', 'base')",
|
|
460
|
-
"required": true
|
|
461
|
-
},
|
|
462
|
-
{
|
|
463
|
-
"name": "limit",
|
|
464
|
-
"type": "number",
|
|
465
|
-
"description": "Maximum number of results to return (optional, defaults to 5)",
|
|
466
|
-
"required": false
|
|
467
|
-
}
|
|
468
|
-
]
|
|
469
|
-
},
|
|
470
|
-
{
|
|
471
|
-
"name": "token_sell",
|
|
472
|
-
"description": "Swap the specified amount of tokens for USDC.",
|
|
473
|
-
"options": []
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
"name": "token_swap",
|
|
477
|
-
"description": "Swap the specified amount of input token for output token.",
|
|
478
|
-
"options": []
|
|
479
|
-
},
|
|
480
|
-
{
|
|
481
|
-
"name": "token_swap_recommend",
|
|
482
|
-
"description": "Parse natural language queries into structured swap parameters for swapping tokens on Solana. Understands queries like 'swap 100 USDC for SOL', 'swap all my USDC for BONK', or '50 SOL to USDC'. Returns the recommended swap parameters ready to use with token_swap.",
|
|
483
|
-
"options": [
|
|
484
|
-
{
|
|
485
|
-
"name": "query",
|
|
486
|
-
"type": "string",
|
|
487
|
-
"description": "Natural language description of the desired swap on Solana. Examples: 'swap 100 USDC for SOL', 'swap all my USDC for BONK', '50 SOL to USDC', 'convert my SOL to USDC'. The agent will parse tokens and amounts from this query.",
|
|
488
|
-
"required": true
|
|
489
|
-
}
|
|
490
|
-
]
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
"name": "token_trending_list",
|
|
494
|
-
"description": "Get currently trending tokens on a blockchain, sorted by popularity rank, trading volume, or liquidity. Perfect for discovering what's hot right now.",
|
|
495
|
-
"options": []
|
|
496
|
-
},
|
|
497
|
-
{
|
|
498
|
-
"name": "user_retrieve",
|
|
499
|
-
"description": "Retrieve the currently authenticated user from the session context.",
|
|
500
|
-
"options": []
|
|
501
|
-
},
|
|
502
|
-
{
|
|
503
|
-
"name": "user_update",
|
|
504
|
-
"description": "Update user fields in the database. This is a PUT-style update requiring all updatable fields (developer, firstName, lastName, username) to be sent. You must first call user_retrieve to get the current user state, then update with all four fields.",
|
|
505
|
-
"options": [
|
|
506
|
-
{
|
|
507
|
-
"name": "developer",
|
|
508
|
-
"type": "boolean",
|
|
509
|
-
"description": "Whether the user is a developer",
|
|
510
|
-
"required": true
|
|
511
|
-
},
|
|
512
|
-
{
|
|
513
|
-
"name": "firstName",
|
|
514
|
-
"type": "string",
|
|
515
|
-
"description": "The user's first name, or null to clear it",
|
|
516
|
-
"required": false
|
|
517
|
-
},
|
|
518
|
-
{
|
|
519
|
-
"name": "lastName",
|
|
520
|
-
"type": "string",
|
|
521
|
-
"description": "The user's last name, or null to clear it",
|
|
522
|
-
"required": false
|
|
523
|
-
},
|
|
524
|
-
{
|
|
525
|
-
"name": "username",
|
|
526
|
-
"type": "string",
|
|
527
|
-
"description": "The user's username (3-20 lowercase letters, numbers, and underscores, must start with a letter), or null to clear it",
|
|
528
|
-
"required": false
|
|
529
|
-
}
|
|
530
|
-
]
|
|
531
|
-
}
|
|
532
|
-
];
|
|
533
|
-
|
|
534
|
-
export async function callTool(
|
|
535
|
-
baseUrl: string,
|
|
536
|
-
token: string,
|
|
537
|
-
toolName: string,
|
|
538
|
-
params: Record<string, unknown>
|
|
539
|
-
): Promise<unknown> {
|
|
540
|
-
const res = await fetch(`${baseUrl}/api/tools/${toolName}`, {
|
|
541
|
-
method: "POST",
|
|
542
|
-
headers: {
|
|
543
|
-
"Content-Type": "application/json",
|
|
544
|
-
Authorization: `Bearer ${token}`,
|
|
545
|
-
},
|
|
546
|
-
body: JSON.stringify(params),
|
|
547
|
-
});
|
|
548
|
-
|
|
549
|
-
const data = await res.json();
|
|
550
|
-
|
|
551
|
-
if (!res.ok) {
|
|
552
|
-
throw new Error(data.error ?? "Tool call failed");
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
return data;
|
|
556
|
-
}
|