hybrid 1.2.2 → 1.2.3

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.
@@ -0,0 +1,681 @@
1
+ // src/tools/blockchain.ts
2
+ import {
3
+ createPublicClient,
4
+ createWalletClient,
5
+ formatEther,
6
+ http,
7
+ parseEther
8
+ } from "viem";
9
+ import { privateKeyToAccount } from "viem/accounts";
10
+ import {
11
+ arbitrum,
12
+ base,
13
+ mainnet,
14
+ optimism,
15
+ polygon,
16
+ sepolia
17
+ } from "viem/chains";
18
+ import { z } from "zod";
19
+
20
+ // src/core/tool.ts
21
+ function toolFactory() {
22
+ return (config) => {
23
+ return {
24
+ description: config.description,
25
+ inputSchema: config.inputSchema,
26
+ outputSchema: config.outputSchema,
27
+ execute: async (args) => {
28
+ const input = config.inputSchema.parse(args.input);
29
+ const result = await config.execute({
30
+ input,
31
+ runtime: args.runtime,
32
+ messages: args.messages
33
+ });
34
+ if (config.outputSchema) {
35
+ return config.outputSchema.parse(result);
36
+ }
37
+ return result;
38
+ }
39
+ };
40
+ };
41
+ }
42
+ var createTool = toolFactory();
43
+
44
+ // src/tools/blockchain.ts
45
+ var SUPPORTED_CHAINS = {
46
+ mainnet,
47
+ sepolia,
48
+ polygon,
49
+ arbitrum,
50
+ optimism,
51
+ base
52
+ };
53
+ var getBalanceTool = createTool({
54
+ id: "getBalance",
55
+ description: "Get the native token balance for a wallet address on a blockchain",
56
+ inputSchema: z.object({
57
+ address: z.string().describe("The wallet address to check balance for"),
58
+ chain: z.enum(["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]).default("mainnet").describe("The blockchain network to check on")
59
+ }),
60
+ outputSchema: z.object({
61
+ success: z.boolean(),
62
+ balance: z.string().describe("Balance in human readable format (ETH, MATIC, etc.)"),
63
+ balanceWei: z.string().describe("Balance in wei (smallest unit)"),
64
+ address: z.string(),
65
+ chain: z.string(),
66
+ error: z.string().optional()
67
+ }),
68
+ execute: async ({ input, runtime }) => {
69
+ try {
70
+ const { address, chain } = input;
71
+ const chainConfig = SUPPORTED_CHAINS[chain];
72
+ const rpcUrl = runtime.rpcUrl || chainConfig.rpcUrls.default.http[0];
73
+ const client = createPublicClient({
74
+ chain: chainConfig,
75
+ transport: http(rpcUrl)
76
+ });
77
+ console.log(`\u{1F50D} [getBalance] Checking balance for ${address} on ${chain}`);
78
+ const balanceWei = await client.getBalance({
79
+ address
80
+ });
81
+ const balance = formatEther(balanceWei);
82
+ console.log(
83
+ `\u2705 [getBalance] Balance: ${balance} ${chainConfig.nativeCurrency.symbol}`
84
+ );
85
+ return {
86
+ success: true,
87
+ balance: `${balance} ${chainConfig.nativeCurrency.symbol}`,
88
+ balanceWei: balanceWei.toString(),
89
+ address,
90
+ chain
91
+ };
92
+ } catch (error) {
93
+ const errorMessage = error instanceof Error ? error.message : String(error);
94
+ console.error("\u274C [getBalance] Error:", errorMessage);
95
+ return {
96
+ success: false,
97
+ balance: "0",
98
+ balanceWei: "0",
99
+ address: input.address,
100
+ chain: input.chain,
101
+ error: errorMessage
102
+ };
103
+ }
104
+ }
105
+ });
106
+ var getTransactionTool = createTool({
107
+ id: "getTransaction",
108
+ description: "Get transaction details by transaction hash",
109
+ inputSchema: z.object({
110
+ hash: z.string().describe("The transaction hash to look up"),
111
+ chain: z.enum(["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]).default("mainnet").describe("The blockchain network to check on")
112
+ }),
113
+ outputSchema: z.object({
114
+ success: z.boolean(),
115
+ transaction: z.object({
116
+ hash: z.string(),
117
+ from: z.string(),
118
+ to: z.string().nullable(),
119
+ value: z.string(),
120
+ gasUsed: z.string().optional(),
121
+ gasPrice: z.string().optional(),
122
+ blockNumber: z.string().optional(),
123
+ status: z.string().optional()
124
+ }).optional(),
125
+ error: z.string().optional()
126
+ }),
127
+ execute: async ({ input, runtime }) => {
128
+ try {
129
+ const { hash, chain } = input;
130
+ const chainConfig = SUPPORTED_CHAINS[chain];
131
+ const rpcUrl = runtime.rpcUrl || chainConfig.rpcUrls.default.http[0];
132
+ const client = createPublicClient({
133
+ chain: chainConfig,
134
+ transport: http(rpcUrl)
135
+ });
136
+ console.log(
137
+ `\u{1F50D} [getTransaction] Looking up transaction ${hash} on ${chain}`
138
+ );
139
+ const transaction = await client.getTransaction({
140
+ hash
141
+ });
142
+ const receipt = await client.getTransactionReceipt({
143
+ hash
144
+ }).catch(() => null);
145
+ console.log(
146
+ `\u2705 [getTransaction] Found transaction from ${transaction.from} to ${transaction.to}`
147
+ );
148
+ return {
149
+ success: true,
150
+ transaction: {
151
+ hash: transaction.hash,
152
+ from: transaction.from,
153
+ to: transaction.to,
154
+ value: formatEther(transaction.value),
155
+ gasUsed: receipt?.gasUsed.toString(),
156
+ gasPrice: transaction.gasPrice?.toString(),
157
+ blockNumber: transaction.blockNumber?.toString(),
158
+ status: receipt?.status === "success" ? "success" : receipt?.status === "reverted" ? "failed" : "pending"
159
+ }
160
+ };
161
+ } catch (error) {
162
+ const errorMessage = error instanceof Error ? error.message : String(error);
163
+ console.error("\u274C [getTransaction] Error:", errorMessage);
164
+ return {
165
+ success: false,
166
+ error: errorMessage
167
+ };
168
+ }
169
+ }
170
+ });
171
+ var sendTransactionTool = createTool({
172
+ id: "sendTransaction",
173
+ description: "Send native tokens to another address",
174
+ inputSchema: z.object({
175
+ to: z.string().describe("The recipient address"),
176
+ amount: z.string().describe("The amount to send (in ETH, MATIC, etc.)"),
177
+ chain: z.enum(["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]).default("mainnet").describe("The blockchain network to send on")
178
+ }),
179
+ outputSchema: z.object({
180
+ success: z.boolean(),
181
+ hash: z.string().optional(),
182
+ from: z.string().optional(),
183
+ to: z.string(),
184
+ amount: z.string(),
185
+ chain: z.string(),
186
+ error: z.string().optional()
187
+ }),
188
+ execute: async ({ input, runtime }) => {
189
+ try {
190
+ const { to, amount, chain } = input;
191
+ const chainConfig = SUPPORTED_CHAINS[chain];
192
+ const privateKey = runtime.privateKey;
193
+ if (!privateKey) {
194
+ return {
195
+ success: false,
196
+ to,
197
+ amount,
198
+ chain,
199
+ error: "Private key not configured in runtime"
200
+ };
201
+ }
202
+ const rpcUrl = runtime.rpcUrl || chainConfig.rpcUrls.default.http[0];
203
+ const account = privateKeyToAccount(privateKey);
204
+ const client = createWalletClient({
205
+ account,
206
+ chain: chainConfig,
207
+ transport: http(rpcUrl)
208
+ });
209
+ console.log(
210
+ `\u{1F4B8} [sendTransaction] Sending ${amount} ${chainConfig.nativeCurrency.symbol} to ${to} on ${chain}`
211
+ );
212
+ const hash = await client.sendTransaction({
213
+ to,
214
+ value: parseEther(amount)
215
+ });
216
+ console.log(`\u2705 [sendTransaction] Transaction sent: ${hash}`);
217
+ return {
218
+ success: true,
219
+ hash,
220
+ from: account.address,
221
+ to,
222
+ amount,
223
+ chain
224
+ };
225
+ } catch (error) {
226
+ const errorMessage = error instanceof Error ? error.message : String(error);
227
+ console.error("\u274C [sendTransaction] Error:", errorMessage);
228
+ return {
229
+ success: false,
230
+ to: input.to,
231
+ amount: input.amount,
232
+ chain: input.chain,
233
+ error: errorMessage
234
+ };
235
+ }
236
+ }
237
+ });
238
+ var getBlockTool = createTool({
239
+ id: "getBlock",
240
+ description: "Get information about a blockchain block",
241
+ inputSchema: z.object({
242
+ blockNumber: z.string().optional().describe("Block number (defaults to latest)"),
243
+ chain: z.enum(["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]).default("mainnet").describe("The blockchain network to check on")
244
+ }),
245
+ outputSchema: z.object({
246
+ success: z.boolean(),
247
+ block: z.object({
248
+ number: z.string(),
249
+ hash: z.string(),
250
+ timestamp: z.string(),
251
+ transactionCount: z.number(),
252
+ gasUsed: z.string(),
253
+ gasLimit: z.string()
254
+ }).optional(),
255
+ error: z.string().optional()
256
+ }),
257
+ execute: async ({ input, runtime }) => {
258
+ try {
259
+ const { blockNumber, chain } = input;
260
+ const chainConfig = SUPPORTED_CHAINS[chain];
261
+ const rpcUrl = runtime.rpcUrl || chainConfig.rpcUrls.default.http[0];
262
+ const client = createPublicClient({
263
+ chain: chainConfig,
264
+ transport: http(rpcUrl)
265
+ });
266
+ console.log(
267
+ `\u{1F50D} [getBlock] Getting block ${blockNumber || "latest"} on ${chain}`
268
+ );
269
+ const block = await client.getBlock({
270
+ blockNumber: blockNumber ? BigInt(blockNumber) : void 0
271
+ });
272
+ console.log(
273
+ `\u2705 [getBlock] Found block ${block.number} with ${block.transactions.length} transactions`
274
+ );
275
+ return {
276
+ success: true,
277
+ block: {
278
+ number: block.number.toString(),
279
+ hash: block.hash,
280
+ timestamp: block.timestamp.toString(),
281
+ transactionCount: block.transactions.length,
282
+ gasUsed: block.gasUsed.toString(),
283
+ gasLimit: block.gasLimit.toString()
284
+ }
285
+ };
286
+ } catch (error) {
287
+ const errorMessage = error instanceof Error ? error.message : String(error);
288
+ console.error("\u274C [getBlock] Error:", errorMessage);
289
+ return {
290
+ success: false,
291
+ error: errorMessage
292
+ };
293
+ }
294
+ }
295
+ });
296
+ var getGasPriceTool = createTool({
297
+ id: "getGasPrice",
298
+ description: "Get current gas price for a blockchain",
299
+ inputSchema: z.object({
300
+ chain: z.enum(["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]).default("mainnet").describe("The blockchain network to check on")
301
+ }),
302
+ outputSchema: z.object({
303
+ success: z.boolean(),
304
+ gasPrice: z.string().optional().describe("Gas price in gwei"),
305
+ gasPriceWei: z.string().optional().describe("Gas price in wei"),
306
+ chain: z.string(),
307
+ error: z.string().optional()
308
+ }),
309
+ execute: async ({ input, runtime }) => {
310
+ try {
311
+ const { chain } = input;
312
+ const chainConfig = SUPPORTED_CHAINS[chain];
313
+ const rpcUrl = runtime.rpcUrl || chainConfig.rpcUrls.default.http[0];
314
+ const client = createPublicClient({
315
+ chain: chainConfig,
316
+ transport: http(rpcUrl)
317
+ });
318
+ console.log(`\u26FD [getGasPrice] Getting gas price for ${chain}`);
319
+ const gasPrice = await client.getGasPrice();
320
+ const gasPriceGwei = formatEther(gasPrice * BigInt(1e9));
321
+ console.log(`\u2705 [getGasPrice] Current gas price: ${gasPriceGwei} gwei`);
322
+ return {
323
+ success: true,
324
+ gasPrice: `${gasPriceGwei} gwei`,
325
+ gasPriceWei: gasPrice.toString(),
326
+ chain
327
+ };
328
+ } catch (error) {
329
+ const errorMessage = error instanceof Error ? error.message : String(error);
330
+ console.error("\u274C [getGasPrice] Error:", errorMessage);
331
+ return {
332
+ success: false,
333
+ chain: input.chain,
334
+ error: errorMessage
335
+ };
336
+ }
337
+ }
338
+ });
339
+ var estimateGasTool = createTool({
340
+ id: "estimateGas",
341
+ description: "Estimate gas required for a transaction",
342
+ inputSchema: z.object({
343
+ to: z.string().describe("The recipient address"),
344
+ amount: z.string().default("0").describe("The amount to send (defaults to 0)"),
345
+ data: z.string().optional().describe("Transaction data (for contract calls)"),
346
+ chain: z.enum(["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]).default("mainnet").describe("The blockchain network to estimate on")
347
+ }),
348
+ outputSchema: z.object({
349
+ success: z.boolean(),
350
+ gasEstimate: z.string().optional(),
351
+ to: z.string(),
352
+ amount: z.string(),
353
+ chain: z.string(),
354
+ error: z.string().optional()
355
+ }),
356
+ execute: async ({ input, runtime }) => {
357
+ try {
358
+ const { to, amount, data, chain } = input;
359
+ const chainConfig = SUPPORTED_CHAINS[chain];
360
+ const privateKey = runtime.privateKey;
361
+ if (!privateKey) {
362
+ return {
363
+ success: false,
364
+ to,
365
+ amount,
366
+ chain,
367
+ error: "Private key not configured in runtime"
368
+ };
369
+ }
370
+ const rpcUrl = runtime.rpcUrl || chainConfig.rpcUrls.default.http[0];
371
+ const account = privateKeyToAccount(privateKey);
372
+ const client = createPublicClient({
373
+ chain: chainConfig,
374
+ transport: http(rpcUrl)
375
+ });
376
+ console.log(
377
+ `\u26FD [estimateGas] Estimating gas for transaction to ${to} on ${chain}`
378
+ );
379
+ const gasEstimate = await client.estimateGas({
380
+ account: account.address,
381
+ to,
382
+ value: parseEther(amount),
383
+ data
384
+ });
385
+ console.log(`\u2705 [estimateGas] Estimated gas: ${gasEstimate.toString()}`);
386
+ return {
387
+ success: true,
388
+ gasEstimate: gasEstimate.toString(),
389
+ to,
390
+ amount,
391
+ chain
392
+ };
393
+ } catch (error) {
394
+ const errorMessage = error instanceof Error ? error.message : String(error);
395
+ console.error("\u274C [estimateGas] Error:", errorMessage);
396
+ return {
397
+ success: false,
398
+ to: input.to,
399
+ amount: input.amount,
400
+ chain: input.chain,
401
+ error: errorMessage
402
+ };
403
+ }
404
+ }
405
+ });
406
+ var blockchainTools = {
407
+ getBalance: getBalanceTool,
408
+ getTransaction: getTransactionTool,
409
+ sendTransaction: sendTransactionTool,
410
+ getBlock: getBlockTool,
411
+ getGasPrice: getGasPriceTool,
412
+ estimateGas: estimateGasTool
413
+ };
414
+
415
+ // src/tools/xmtp.ts
416
+ import { z as z2 } from "zod";
417
+ var sendReactionTool = createTool({
418
+ id: "sendReaction",
419
+ description: "Send an emoji reaction to a message to indicate it has been seen",
420
+ inputSchema: z2.object({
421
+ emoji: z2.string().default("\u{1F440}").describe(
422
+ "The emoji to send as a reaction (supports common emoji like \u{1F44D}, \u2764\uFE0F, \u{1F525}, etc.)"
423
+ ),
424
+ referenceMessageId: z2.string().optional().describe(
425
+ "The message ID to react to (uses current message if not provided)"
426
+ )
427
+ }),
428
+ outputSchema: z2.object({
429
+ success: z2.boolean(),
430
+ emoji: z2.string(),
431
+ error: z2.string().optional()
432
+ }),
433
+ execute: async ({ input, runtime }) => {
434
+ try {
435
+ const xmtpClient = runtime.xmtpClient;
436
+ const currentMessage = runtime.message;
437
+ if (!xmtpClient) {
438
+ const errorMsg = "\u274C XMTP service not available";
439
+ return { success: false, emoji: input.emoji, error: errorMsg };
440
+ }
441
+ if (!currentMessage) {
442
+ const errorMsg = "\u274C No message to react to";
443
+ return { success: false, emoji: input.emoji, error: errorMsg };
444
+ }
445
+ const messageIdToReactTo = input.referenceMessageId || currentMessage.id;
446
+ console.log(
447
+ `\u{1F440} [sendReaction] Sending ${input.emoji} reaction to message ${messageIdToReactTo}`
448
+ );
449
+ const reactionResult = await xmtpClient.sendReaction({
450
+ messageId: messageIdToReactTo,
451
+ emoji: input.emoji,
452
+ action: "added"
453
+ });
454
+ if (!reactionResult.success) {
455
+ const errorMsg = `\u274C Failed to send reaction: ${reactionResult.error || "Unknown error"}`;
456
+ return { success: false, emoji: input.emoji, error: errorMsg };
457
+ }
458
+ console.log(`\u2705 [sendReaction] Successfully sent ${input.emoji} reaction`);
459
+ return { success: true, emoji: input.emoji };
460
+ } catch (error) {
461
+ const errorMessage = error instanceof Error ? error.message : String(error);
462
+ console.error("\u274C [sendReaction] Error:", errorMessage);
463
+ return { success: false, emoji: input.emoji, error: errorMessage };
464
+ }
465
+ }
466
+ });
467
+ var sendMessageTool = createTool({
468
+ id: "sendMessage",
469
+ description: "Send a message to an XMTP conversation",
470
+ inputSchema: z2.object({
471
+ content: z2.string().describe("The message content to send"),
472
+ recipientAddress: z2.string().optional().describe("Recipient address for new conversations"),
473
+ conversationId: z2.string().optional().describe("Existing conversation ID to send to")
474
+ }).refine((data) => data.recipientAddress || data.conversationId, {
475
+ message: "Either recipientAddress or conversationId must be provided"
476
+ }),
477
+ outputSchema: z2.object({
478
+ success: z2.boolean(),
479
+ messageId: z2.string().optional(),
480
+ conversationId: z2.string().optional(),
481
+ content: z2.string(),
482
+ error: z2.string().optional()
483
+ }),
484
+ execute: async ({ input, runtime }) => {
485
+ try {
486
+ const xmtpClient = runtime.xmtpClient;
487
+ const { content, recipientAddress, conversationId } = input;
488
+ if (!xmtpClient) {
489
+ return {
490
+ success: false,
491
+ content,
492
+ error: "XMTP service not available"
493
+ };
494
+ }
495
+ console.log(
496
+ `\u{1F4AC} [sendMessage] Sending message: "${content.substring(0, 50)}${content.length > 50 ? "..." : ""}"`
497
+ );
498
+ let targetConversationId = conversationId;
499
+ if (!targetConversationId && recipientAddress) {
500
+ console.log(
501
+ `\u{1F50D} [sendMessage] Creating/finding conversation with ${recipientAddress}`
502
+ );
503
+ targetConversationId = recipientAddress;
504
+ }
505
+ const messageResult = await xmtpClient.sendMessage({
506
+ content
507
+ });
508
+ if (!messageResult.success) {
509
+ return {
510
+ success: false,
511
+ content,
512
+ error: messageResult.error || "Failed to send message"
513
+ };
514
+ }
515
+ console.log(`\u2705 [sendMessage] Message sent successfully`);
516
+ return {
517
+ success: true,
518
+ messageId: messageResult.data?.conversationId,
519
+ conversationId: messageResult.data?.conversationId,
520
+ content
521
+ };
522
+ } catch (error) {
523
+ const errorMessage = error instanceof Error ? error.message : String(error);
524
+ console.error("\u274C [sendMessage] Error:", errorMessage);
525
+ return {
526
+ success: false,
527
+ content: input.content,
528
+ error: errorMessage
529
+ };
530
+ }
531
+ }
532
+ });
533
+ var sendReplyTool = createTool({
534
+ id: "sendReply",
535
+ description: "Send a reply to a specific message in an XMTP conversation",
536
+ inputSchema: z2.object({
537
+ content: z2.string().describe("The reply content to send"),
538
+ replyToMessageId: z2.string().optional().describe("Message ID to reply to (uses current message if not provided)")
539
+ }),
540
+ outputSchema: z2.object({
541
+ success: z2.boolean(),
542
+ messageId: z2.string().optional(),
543
+ replyToMessageId: z2.string().optional(),
544
+ content: z2.string(),
545
+ error: z2.string().optional()
546
+ }),
547
+ execute: async ({ input, runtime }) => {
548
+ try {
549
+ const xmtpClient = runtime.xmtpClient;
550
+ const currentMessage = runtime.message;
551
+ const { content, replyToMessageId } = input;
552
+ if (!xmtpClient) {
553
+ return {
554
+ success: false,
555
+ content,
556
+ error: "XMTP service not available"
557
+ };
558
+ }
559
+ if (!currentMessage && !replyToMessageId) {
560
+ return {
561
+ success: false,
562
+ content,
563
+ error: "No message to reply to"
564
+ };
565
+ }
566
+ const targetMessageId = replyToMessageId || currentMessage?.id;
567
+ console.log(
568
+ `\u21A9\uFE0F [sendReply] Sending reply to message ${targetMessageId}: "${content.substring(0, 50)}${content.length > 50 ? "..." : ""}"`
569
+ );
570
+ const replyResult = await xmtpClient.sendReply({
571
+ content,
572
+ messageId: targetMessageId
573
+ });
574
+ if (!replyResult.success) {
575
+ return {
576
+ success: false,
577
+ content,
578
+ replyToMessageId: targetMessageId,
579
+ error: replyResult.error || "Failed to send reply"
580
+ };
581
+ }
582
+ console.log(`\u2705 [sendReply] Reply sent successfully`);
583
+ return {
584
+ success: true,
585
+ messageId: replyResult.data?.conversationId,
586
+ replyToMessageId: targetMessageId,
587
+ content
588
+ };
589
+ } catch (error) {
590
+ const errorMessage = error instanceof Error ? error.message : String(error);
591
+ console.error("\u274C [sendReply] Error:", errorMessage);
592
+ return {
593
+ success: false,
594
+ content: input.content,
595
+ replyToMessageId: input.replyToMessageId,
596
+ error: errorMessage
597
+ };
598
+ }
599
+ }
600
+ });
601
+ var getMessageTool = createTool({
602
+ id: "getMessage",
603
+ description: "Get a specific message by ID from XMTP",
604
+ inputSchema: z2.object({
605
+ messageId: z2.string().describe("The message ID to retrieve")
606
+ }),
607
+ outputSchema: z2.object({
608
+ success: z2.boolean(),
609
+ message: z2.object({
610
+ id: z2.string(),
611
+ conversationId: z2.string(),
612
+ content: z2.union([z2.string(), z2.record(z2.unknown())]),
613
+ senderInboxId: z2.string(),
614
+ sentAt: z2.string(),
615
+ contentType: z2.object({
616
+ typeId: z2.string(),
617
+ authorityId: z2.string().optional(),
618
+ versionMajor: z2.number().optional(),
619
+ versionMinor: z2.number().optional()
620
+ }).optional()
621
+ }).optional(),
622
+ error: z2.string().optional()
623
+ }),
624
+ execute: async ({ input, runtime }) => {
625
+ try {
626
+ const xmtpClient = runtime.xmtpClient;
627
+ const { messageId } = input;
628
+ if (!xmtpClient) {
629
+ return {
630
+ success: false,
631
+ error: "XMTP service not available"
632
+ };
633
+ }
634
+ console.log(`\u{1F4DC} [getMessage] Retrieving message ${messageId}`);
635
+ const messageResult = await xmtpClient.getMessage({
636
+ messageId
637
+ });
638
+ if (!messageResult.success) {
639
+ return {
640
+ success: false,
641
+ error: messageResult.error || "Failed to get message"
642
+ };
643
+ }
644
+ console.log(
645
+ `\u2705 [getMessage] Retrieved message from ${messageResult.data?.senderInboxId}`
646
+ );
647
+ return {
648
+ success: true,
649
+ message: messageResult.data
650
+ };
651
+ } catch (error) {
652
+ const errorMessage = error instanceof Error ? error.message : String(error);
653
+ console.error("\u274C [getMessage] Error:", errorMessage);
654
+ return {
655
+ success: false,
656
+ error: errorMessage
657
+ };
658
+ }
659
+ }
660
+ });
661
+ var xmtpTools = {
662
+ sendMessage: sendMessageTool,
663
+ sendReply: sendReplyTool,
664
+ sendReaction: sendReactionTool,
665
+ getMessage: getMessageTool
666
+ };
667
+ export {
668
+ blockchainTools,
669
+ estimateGasTool,
670
+ getBalanceTool,
671
+ getBlockTool,
672
+ getGasPriceTool,
673
+ getMessageTool,
674
+ getTransactionTool,
675
+ sendMessageTool,
676
+ sendReactionTool,
677
+ sendReplyTool,
678
+ sendTransactionTool,
679
+ xmtpTools
680
+ };
681
+ //# sourceMappingURL=index.js.map