hybrid 1.2.8 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index-CWnGnicw.d.cts +1927 -0
- package/dist/index-CWnGnicw.d.ts +1927 -0
- package/dist/index.cjs +33 -276
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +334 -7
- package/dist/index.d.ts +334 -7
- package/dist/index.js +33 -276
- package/dist/index.js.map +1 -1
- package/dist/tools/index.d.cts +4 -1858
- package/dist/tools/index.d.ts +4 -1858
- package/package.json +4 -8
- package/src/lib/jwt.ts +50 -4
- package/src/server/listen.ts +1 -2
- package/dist/agent-6fncjbIG.d.ts +0 -334
- package/dist/agent-MbcG6CoX.d.cts +0 -334
- package/dist/ponder/index.cjs +0 -176
- package/dist/ponder/index.cjs.map +0 -1
- package/dist/ponder/index.d.cts +0 -23
- package/dist/ponder/index.d.ts +0 -23
- package/dist/ponder/index.js +0 -148
- package/dist/ponder/index.js.map +0 -1
- package/dist/tool-CoVdD8Fb.d.cts +0 -73
- package/dist/tool-CoVdD8Fb.d.ts +0 -73
- package/src/ponder/endpoints.ts +0 -71
- package/src/ponder/forwarder.ts +0 -149
- package/src/ponder/index.ts +0 -2
- package/src/ponder/plugin.ts +0 -22
- package/src/xmtp/endpoints.ts +0 -314
- package/src/xmtp/plugin.ts +0 -50
|
@@ -0,0 +1,1927 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UIMessage } from 'ai';
|
|
3
|
+
import { XmtpConversation, XmtpMessage, XmtpSender, XmtpSubjects, XmtpServiceClient } from '@hybrd/xmtp';
|
|
4
|
+
import * as viem_chains from 'viem/chains';
|
|
5
|
+
import * as viem from 'viem';
|
|
6
|
+
|
|
7
|
+
interface BaseRuntime extends Record<string, unknown> {
|
|
8
|
+
conversation: XmtpConversation;
|
|
9
|
+
message: XmtpMessage;
|
|
10
|
+
parentMessage?: XmtpMessage;
|
|
11
|
+
rootMessage: XmtpMessage;
|
|
12
|
+
sender: XmtpSender;
|
|
13
|
+
subjects: XmtpSubjects;
|
|
14
|
+
xmtpClient: XmtpServiceClient;
|
|
15
|
+
}
|
|
16
|
+
type AgentRuntime = BaseRuntime & {
|
|
17
|
+
chatId?: string;
|
|
18
|
+
messages: Array<UIMessage>;
|
|
19
|
+
};
|
|
20
|
+
interface XmtpCredentials {
|
|
21
|
+
inboxId: string;
|
|
22
|
+
xmtpServiceUrl: string;
|
|
23
|
+
xmtpServiceToken: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
type DefaultRuntimeExtension = Record<string, never>;
|
|
27
|
+
/**
|
|
28
|
+
* Configuration interface for creating custom tools that integrate with AI SDK.
|
|
29
|
+
*/
|
|
30
|
+
interface ToolConfig<TInput extends z.ZodTypeAny = z.ZodTypeAny, TOutput extends z.ZodTypeAny = z.ZodTypeAny, TRuntimeExtension = DefaultRuntimeExtension> {
|
|
31
|
+
/** Unique identifier for the tool */
|
|
32
|
+
id: string;
|
|
33
|
+
/** Human-readable description of what the tool does */
|
|
34
|
+
description: string;
|
|
35
|
+
/** Zod schema for validating tool input */
|
|
36
|
+
inputSchema: TInput;
|
|
37
|
+
/** Optional Zod schema for validating tool output */
|
|
38
|
+
outputSchema?: TOutput;
|
|
39
|
+
/** Function that executes the tool's logic */
|
|
40
|
+
execute: (args: {
|
|
41
|
+
input: z.infer<TInput>;
|
|
42
|
+
runtime: AgentRuntime & TRuntimeExtension;
|
|
43
|
+
messages: UIMessage[];
|
|
44
|
+
}) => Promise<z.infer<TOutput>>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Internal tool interface used throughout the agent framework.
|
|
48
|
+
* Similar to ToolConfig but without the ID field, used after tool creation.
|
|
49
|
+
*/
|
|
50
|
+
interface Tool<TInput extends z.ZodTypeAny = z.ZodTypeAny, TOutput extends z.ZodTypeAny = z.ZodTypeAny, TRuntimeExtension = DefaultRuntimeExtension> {
|
|
51
|
+
/** Human-readable description of what the tool does */
|
|
52
|
+
description: string;
|
|
53
|
+
/** Zod schema for validating tool input */
|
|
54
|
+
inputSchema: TInput;
|
|
55
|
+
/** Optional Zod schema for validating tool output */
|
|
56
|
+
outputSchema?: TOutput;
|
|
57
|
+
/** Function that executes the tool's logic */
|
|
58
|
+
execute: (args: {
|
|
59
|
+
input: z.infer<TInput>;
|
|
60
|
+
runtime: AgentRuntime & TRuntimeExtension;
|
|
61
|
+
messages: UIMessage[];
|
|
62
|
+
}) => Promise<z.infer<TOutput>>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Factory function to create tools with custom runtime extensions.
|
|
66
|
+
* Provides proper type inference for input/output schemas and runtime extensions.
|
|
67
|
+
*/
|
|
68
|
+
declare function toolFactory<TRuntimeExtension = DefaultRuntimeExtension>(): <TInput extends z.ZodTypeAny, TOutput extends z.ZodTypeAny = z.ZodTypeAny>(config: ToolConfig<TInput, TOutput, TRuntimeExtension>) => Tool<TInput, TOutput, TRuntimeExtension>;
|
|
69
|
+
/**
|
|
70
|
+
* Default tool factory with no runtime extensions.
|
|
71
|
+
* Type-safe at creation time with proper schema inference.
|
|
72
|
+
*/
|
|
73
|
+
declare const createTool: <TInput extends z.ZodTypeAny, TOutput extends z.ZodTypeAny = z.ZodTypeAny>(config: ToolConfig<TInput, TOutput, DefaultRuntimeExtension>) => Tool<TInput, TOutput, DefaultRuntimeExtension>;
|
|
74
|
+
|
|
75
|
+
declare const SUPPORTED_CHAINS: {
|
|
76
|
+
readonly mainnet: {
|
|
77
|
+
blockExplorers: {
|
|
78
|
+
readonly default: {
|
|
79
|
+
readonly name: "Etherscan";
|
|
80
|
+
readonly url: "https://etherscan.io";
|
|
81
|
+
readonly apiUrl: "https://api.etherscan.io/api";
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
blockTime: 12000;
|
|
85
|
+
contracts: {
|
|
86
|
+
readonly ensRegistry: {
|
|
87
|
+
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
|
|
88
|
+
};
|
|
89
|
+
readonly ensUniversalResolver: {
|
|
90
|
+
readonly address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67";
|
|
91
|
+
readonly blockCreated: 19258213;
|
|
92
|
+
};
|
|
93
|
+
readonly multicall3: {
|
|
94
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
95
|
+
readonly blockCreated: 14353601;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
ensTlds?: readonly string[] | undefined;
|
|
99
|
+
id: 1;
|
|
100
|
+
name: "Ethereum";
|
|
101
|
+
nativeCurrency: {
|
|
102
|
+
readonly name: "Ether";
|
|
103
|
+
readonly symbol: "ETH";
|
|
104
|
+
readonly decimals: 18;
|
|
105
|
+
};
|
|
106
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
107
|
+
rpcUrls: {
|
|
108
|
+
readonly default: {
|
|
109
|
+
readonly http: readonly ["https://eth.merkle.io"];
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
sourceId?: number | undefined | undefined;
|
|
113
|
+
testnet?: boolean | undefined | undefined;
|
|
114
|
+
custom?: Record<string, unknown> | undefined;
|
|
115
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
116
|
+
formatters?: undefined;
|
|
117
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
118
|
+
};
|
|
119
|
+
readonly sepolia: {
|
|
120
|
+
blockExplorers: {
|
|
121
|
+
readonly default: {
|
|
122
|
+
readonly name: "Etherscan";
|
|
123
|
+
readonly url: "https://sepolia.etherscan.io";
|
|
124
|
+
readonly apiUrl: "https://api-sepolia.etherscan.io/api";
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
blockTime?: number | undefined | undefined;
|
|
128
|
+
contracts: {
|
|
129
|
+
readonly multicall3: {
|
|
130
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
131
|
+
readonly blockCreated: 751532;
|
|
132
|
+
};
|
|
133
|
+
readonly ensRegistry: {
|
|
134
|
+
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
|
|
135
|
+
};
|
|
136
|
+
readonly ensUniversalResolver: {
|
|
137
|
+
readonly address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC";
|
|
138
|
+
readonly blockCreated: 5317080;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
ensTlds?: readonly string[] | undefined;
|
|
142
|
+
id: 11155111;
|
|
143
|
+
name: "Sepolia";
|
|
144
|
+
nativeCurrency: {
|
|
145
|
+
readonly name: "Sepolia Ether";
|
|
146
|
+
readonly symbol: "ETH";
|
|
147
|
+
readonly decimals: 18;
|
|
148
|
+
};
|
|
149
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
150
|
+
rpcUrls: {
|
|
151
|
+
readonly default: {
|
|
152
|
+
readonly http: readonly ["https://sepolia.drpc.org"];
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
sourceId?: number | undefined | undefined;
|
|
156
|
+
testnet: true;
|
|
157
|
+
custom?: Record<string, unknown> | undefined;
|
|
158
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
159
|
+
formatters?: undefined;
|
|
160
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
161
|
+
};
|
|
162
|
+
readonly polygon: {
|
|
163
|
+
blockExplorers: {
|
|
164
|
+
readonly default: {
|
|
165
|
+
readonly name: "PolygonScan";
|
|
166
|
+
readonly url: "https://polygonscan.com";
|
|
167
|
+
readonly apiUrl: "https://api.polygonscan.com/api";
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
blockTime?: number | undefined | undefined;
|
|
171
|
+
contracts: {
|
|
172
|
+
readonly multicall3: {
|
|
173
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
174
|
+
readonly blockCreated: 25770160;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
ensTlds?: readonly string[] | undefined;
|
|
178
|
+
id: 137;
|
|
179
|
+
name: "Polygon";
|
|
180
|
+
nativeCurrency: {
|
|
181
|
+
readonly name: "POL";
|
|
182
|
+
readonly symbol: "POL";
|
|
183
|
+
readonly decimals: 18;
|
|
184
|
+
};
|
|
185
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
186
|
+
rpcUrls: {
|
|
187
|
+
readonly default: {
|
|
188
|
+
readonly http: readonly ["https://polygon-rpc.com"];
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
sourceId?: number | undefined | undefined;
|
|
192
|
+
testnet?: boolean | undefined | undefined;
|
|
193
|
+
custom?: Record<string, unknown> | undefined;
|
|
194
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
195
|
+
formatters?: undefined;
|
|
196
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
197
|
+
};
|
|
198
|
+
readonly arbitrum: {
|
|
199
|
+
blockExplorers: {
|
|
200
|
+
readonly default: {
|
|
201
|
+
readonly name: "Arbiscan";
|
|
202
|
+
readonly url: "https://arbiscan.io";
|
|
203
|
+
readonly apiUrl: "https://api.arbiscan.io/api";
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
blockTime: 250;
|
|
207
|
+
contracts: {
|
|
208
|
+
readonly multicall3: {
|
|
209
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
210
|
+
readonly blockCreated: 7654707;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
ensTlds?: readonly string[] | undefined;
|
|
214
|
+
id: 42161;
|
|
215
|
+
name: "Arbitrum One";
|
|
216
|
+
nativeCurrency: {
|
|
217
|
+
readonly name: "Ether";
|
|
218
|
+
readonly symbol: "ETH";
|
|
219
|
+
readonly decimals: 18;
|
|
220
|
+
};
|
|
221
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
222
|
+
rpcUrls: {
|
|
223
|
+
readonly default: {
|
|
224
|
+
readonly http: readonly ["https://arb1.arbitrum.io/rpc"];
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
sourceId?: number | undefined | undefined;
|
|
228
|
+
testnet?: boolean | undefined | undefined;
|
|
229
|
+
custom?: Record<string, unknown> | undefined;
|
|
230
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
231
|
+
formatters?: undefined;
|
|
232
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
233
|
+
};
|
|
234
|
+
readonly optimism: {
|
|
235
|
+
blockExplorers: {
|
|
236
|
+
readonly default: {
|
|
237
|
+
readonly name: "Optimism Explorer";
|
|
238
|
+
readonly url: "https://optimistic.etherscan.io";
|
|
239
|
+
readonly apiUrl: "https://api-optimistic.etherscan.io/api";
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
blockTime: 2000;
|
|
243
|
+
contracts: {
|
|
244
|
+
readonly disputeGameFactory: {
|
|
245
|
+
readonly 1: {
|
|
246
|
+
readonly address: "0xe5965Ab5962eDc7477C8520243A95517CD252fA9";
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
readonly l2OutputOracle: {
|
|
250
|
+
readonly 1: {
|
|
251
|
+
readonly address: "0xdfe97868233d1aa22e815a266982f2cf17685a27";
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
readonly multicall3: {
|
|
255
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
256
|
+
readonly blockCreated: 4286263;
|
|
257
|
+
};
|
|
258
|
+
readonly portal: {
|
|
259
|
+
readonly 1: {
|
|
260
|
+
readonly address: "0xbEb5Fc579115071764c7423A4f12eDde41f106Ed";
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
readonly l1StandardBridge: {
|
|
264
|
+
readonly 1: {
|
|
265
|
+
readonly address: "0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1";
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
readonly gasPriceOracle: {
|
|
269
|
+
readonly address: "0x420000000000000000000000000000000000000F";
|
|
270
|
+
};
|
|
271
|
+
readonly l1Block: {
|
|
272
|
+
readonly address: "0x4200000000000000000000000000000000000015";
|
|
273
|
+
};
|
|
274
|
+
readonly l2CrossDomainMessenger: {
|
|
275
|
+
readonly address: "0x4200000000000000000000000000000000000007";
|
|
276
|
+
};
|
|
277
|
+
readonly l2Erc721Bridge: {
|
|
278
|
+
readonly address: "0x4200000000000000000000000000000000000014";
|
|
279
|
+
};
|
|
280
|
+
readonly l2StandardBridge: {
|
|
281
|
+
readonly address: "0x4200000000000000000000000000000000000010";
|
|
282
|
+
};
|
|
283
|
+
readonly l2ToL1MessagePasser: {
|
|
284
|
+
readonly address: "0x4200000000000000000000000000000000000016";
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
ensTlds?: readonly string[] | undefined;
|
|
288
|
+
id: 10;
|
|
289
|
+
name: "OP Mainnet";
|
|
290
|
+
nativeCurrency: {
|
|
291
|
+
readonly name: "Ether";
|
|
292
|
+
readonly symbol: "ETH";
|
|
293
|
+
readonly decimals: 18;
|
|
294
|
+
};
|
|
295
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
296
|
+
rpcUrls: {
|
|
297
|
+
readonly default: {
|
|
298
|
+
readonly http: readonly ["https://mainnet.optimism.io"];
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
sourceId: 1;
|
|
302
|
+
testnet?: boolean | undefined | undefined;
|
|
303
|
+
custom?: Record<string, unknown> | undefined;
|
|
304
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
305
|
+
formatters: {
|
|
306
|
+
readonly block: {
|
|
307
|
+
exclude: [] | undefined;
|
|
308
|
+
format: (args: viem_chains.OpStackRpcBlock) => {
|
|
309
|
+
baseFeePerGas: bigint | null;
|
|
310
|
+
blobGasUsed: bigint;
|
|
311
|
+
difficulty: bigint;
|
|
312
|
+
excessBlobGas: bigint;
|
|
313
|
+
extraData: viem.Hex;
|
|
314
|
+
gasLimit: bigint;
|
|
315
|
+
gasUsed: bigint;
|
|
316
|
+
hash: `0x${string}` | null;
|
|
317
|
+
logsBloom: `0x${string}` | null;
|
|
318
|
+
miner: `0x${string}`;
|
|
319
|
+
mixHash: viem.Hash;
|
|
320
|
+
nonce: `0x${string}` | null;
|
|
321
|
+
number: bigint | null;
|
|
322
|
+
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
323
|
+
parentHash: viem.Hash;
|
|
324
|
+
receiptsRoot: viem.Hex;
|
|
325
|
+
sealFields: viem.Hex[];
|
|
326
|
+
sha3Uncles: viem.Hash;
|
|
327
|
+
size: bigint;
|
|
328
|
+
stateRoot: viem.Hash;
|
|
329
|
+
timestamp: bigint;
|
|
330
|
+
totalDifficulty: bigint | null;
|
|
331
|
+
transactions: `0x${string}`[] | viem_chains.OpStackTransaction<boolean>[];
|
|
332
|
+
transactionsRoot: viem.Hash;
|
|
333
|
+
uncles: viem.Hash[];
|
|
334
|
+
withdrawals?: viem.Withdrawal[] | undefined | undefined;
|
|
335
|
+
withdrawalsRoot?: `0x${string}` | undefined;
|
|
336
|
+
} & {};
|
|
337
|
+
type: "block";
|
|
338
|
+
};
|
|
339
|
+
readonly transaction: {
|
|
340
|
+
exclude: [] | undefined;
|
|
341
|
+
format: (args: viem_chains.OpStackRpcTransaction) => ({
|
|
342
|
+
blockHash: `0x${string}` | null;
|
|
343
|
+
blockNumber: bigint | null;
|
|
344
|
+
from: `0x${string}`;
|
|
345
|
+
gas: bigint;
|
|
346
|
+
hash: viem.Hash;
|
|
347
|
+
input: viem.Hex;
|
|
348
|
+
nonce: number;
|
|
349
|
+
r: viem.Hex;
|
|
350
|
+
s: viem.Hex;
|
|
351
|
+
to: `0x${string}` | null;
|
|
352
|
+
transactionIndex: number | null;
|
|
353
|
+
typeHex: viem.Hex | null;
|
|
354
|
+
v: bigint;
|
|
355
|
+
value: bigint;
|
|
356
|
+
yParity: number;
|
|
357
|
+
gasPrice?: undefined | undefined;
|
|
358
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
359
|
+
maxFeePerGas: bigint;
|
|
360
|
+
maxPriorityFeePerGas: bigint;
|
|
361
|
+
isSystemTx?: boolean;
|
|
362
|
+
mint?: bigint | undefined | undefined;
|
|
363
|
+
sourceHash: viem.Hex;
|
|
364
|
+
type: "deposit";
|
|
365
|
+
} | {
|
|
366
|
+
r: viem.Hex;
|
|
367
|
+
s: viem.Hex;
|
|
368
|
+
v: bigint;
|
|
369
|
+
to: `0x${string}` | null;
|
|
370
|
+
from: `0x${string}`;
|
|
371
|
+
gas: bigint;
|
|
372
|
+
nonce: number;
|
|
373
|
+
value: bigint;
|
|
374
|
+
blockHash: `0x${string}` | null;
|
|
375
|
+
blockNumber: bigint | null;
|
|
376
|
+
hash: viem.Hash;
|
|
377
|
+
input: viem.Hex;
|
|
378
|
+
transactionIndex: number | null;
|
|
379
|
+
typeHex: viem.Hex | null;
|
|
380
|
+
accessList?: undefined | undefined;
|
|
381
|
+
authorizationList?: undefined | undefined;
|
|
382
|
+
blobVersionedHashes?: undefined | undefined;
|
|
383
|
+
chainId?: number | undefined;
|
|
384
|
+
yParity?: undefined | undefined;
|
|
385
|
+
type: "legacy";
|
|
386
|
+
gasPrice: bigint;
|
|
387
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
388
|
+
maxFeePerGas?: undefined | undefined;
|
|
389
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
390
|
+
isSystemTx?: undefined | undefined;
|
|
391
|
+
mint?: undefined | undefined;
|
|
392
|
+
sourceHash?: undefined | undefined;
|
|
393
|
+
} | {
|
|
394
|
+
blockHash: `0x${string}` | null;
|
|
395
|
+
blockNumber: bigint | null;
|
|
396
|
+
from: `0x${string}`;
|
|
397
|
+
gas: bigint;
|
|
398
|
+
hash: viem.Hash;
|
|
399
|
+
input: viem.Hex;
|
|
400
|
+
nonce: number;
|
|
401
|
+
r: viem.Hex;
|
|
402
|
+
s: viem.Hex;
|
|
403
|
+
to: `0x${string}` | null;
|
|
404
|
+
transactionIndex: number | null;
|
|
405
|
+
typeHex: viem.Hex | null;
|
|
406
|
+
v: bigint;
|
|
407
|
+
value: bigint;
|
|
408
|
+
yParity: number;
|
|
409
|
+
accessList: viem.AccessList;
|
|
410
|
+
authorizationList?: undefined | undefined;
|
|
411
|
+
blobVersionedHashes?: undefined | undefined;
|
|
412
|
+
chainId: number;
|
|
413
|
+
type: "eip2930";
|
|
414
|
+
gasPrice: bigint;
|
|
415
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
416
|
+
maxFeePerGas?: undefined | undefined;
|
|
417
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
418
|
+
isSystemTx?: undefined | undefined;
|
|
419
|
+
mint?: undefined | undefined;
|
|
420
|
+
sourceHash?: undefined | undefined;
|
|
421
|
+
} | {
|
|
422
|
+
blockHash: `0x${string}` | null;
|
|
423
|
+
blockNumber: bigint | null;
|
|
424
|
+
from: `0x${string}`;
|
|
425
|
+
gas: bigint;
|
|
426
|
+
hash: viem.Hash;
|
|
427
|
+
input: viem.Hex;
|
|
428
|
+
nonce: number;
|
|
429
|
+
r: viem.Hex;
|
|
430
|
+
s: viem.Hex;
|
|
431
|
+
to: `0x${string}` | null;
|
|
432
|
+
transactionIndex: number | null;
|
|
433
|
+
typeHex: viem.Hex | null;
|
|
434
|
+
v: bigint;
|
|
435
|
+
value: bigint;
|
|
436
|
+
yParity: number;
|
|
437
|
+
accessList: viem.AccessList;
|
|
438
|
+
authorizationList?: undefined | undefined;
|
|
439
|
+
blobVersionedHashes?: undefined | undefined;
|
|
440
|
+
chainId: number;
|
|
441
|
+
type: "eip1559";
|
|
442
|
+
gasPrice?: undefined | undefined;
|
|
443
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
444
|
+
maxFeePerGas: bigint;
|
|
445
|
+
maxPriorityFeePerGas: bigint;
|
|
446
|
+
isSystemTx?: undefined | undefined;
|
|
447
|
+
mint?: undefined | undefined;
|
|
448
|
+
sourceHash?: undefined | undefined;
|
|
449
|
+
} | {
|
|
450
|
+
blockHash: `0x${string}` | null;
|
|
451
|
+
blockNumber: bigint | null;
|
|
452
|
+
from: `0x${string}`;
|
|
453
|
+
gas: bigint;
|
|
454
|
+
hash: viem.Hash;
|
|
455
|
+
input: viem.Hex;
|
|
456
|
+
nonce: number;
|
|
457
|
+
r: viem.Hex;
|
|
458
|
+
s: viem.Hex;
|
|
459
|
+
to: `0x${string}` | null;
|
|
460
|
+
transactionIndex: number | null;
|
|
461
|
+
typeHex: viem.Hex | null;
|
|
462
|
+
v: bigint;
|
|
463
|
+
value: bigint;
|
|
464
|
+
yParity: number;
|
|
465
|
+
accessList: viem.AccessList;
|
|
466
|
+
authorizationList?: undefined | undefined;
|
|
467
|
+
blobVersionedHashes: readonly viem.Hex[];
|
|
468
|
+
chainId: number;
|
|
469
|
+
type: "eip4844";
|
|
470
|
+
gasPrice?: undefined | undefined;
|
|
471
|
+
maxFeePerBlobGas: bigint;
|
|
472
|
+
maxFeePerGas: bigint;
|
|
473
|
+
maxPriorityFeePerGas: bigint;
|
|
474
|
+
isSystemTx?: undefined | undefined;
|
|
475
|
+
mint?: undefined | undefined;
|
|
476
|
+
sourceHash?: undefined | undefined;
|
|
477
|
+
} | {
|
|
478
|
+
blockHash: `0x${string}` | null;
|
|
479
|
+
blockNumber: bigint | null;
|
|
480
|
+
from: `0x${string}`;
|
|
481
|
+
gas: bigint;
|
|
482
|
+
hash: viem.Hash;
|
|
483
|
+
input: viem.Hex;
|
|
484
|
+
nonce: number;
|
|
485
|
+
r: viem.Hex;
|
|
486
|
+
s: viem.Hex;
|
|
487
|
+
to: `0x${string}` | null;
|
|
488
|
+
transactionIndex: number | null;
|
|
489
|
+
typeHex: viem.Hex | null;
|
|
490
|
+
v: bigint;
|
|
491
|
+
value: bigint;
|
|
492
|
+
yParity: number;
|
|
493
|
+
accessList: viem.AccessList;
|
|
494
|
+
authorizationList: viem.SignedAuthorizationList;
|
|
495
|
+
blobVersionedHashes?: undefined | undefined;
|
|
496
|
+
chainId: number;
|
|
497
|
+
type: "eip7702";
|
|
498
|
+
gasPrice?: undefined | undefined;
|
|
499
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
500
|
+
maxFeePerGas: bigint;
|
|
501
|
+
maxPriorityFeePerGas: bigint;
|
|
502
|
+
isSystemTx?: undefined | undefined;
|
|
503
|
+
mint?: undefined | undefined;
|
|
504
|
+
sourceHash?: undefined | undefined;
|
|
505
|
+
}) & {};
|
|
506
|
+
type: "transaction";
|
|
507
|
+
};
|
|
508
|
+
readonly transactionReceipt: {
|
|
509
|
+
exclude: [] | undefined;
|
|
510
|
+
format: (args: viem_chains.OpStackRpcTransactionReceipt) => {
|
|
511
|
+
blobGasPrice?: bigint | undefined;
|
|
512
|
+
blobGasUsed?: bigint | undefined;
|
|
513
|
+
blockHash: viem.Hash;
|
|
514
|
+
blockNumber: bigint;
|
|
515
|
+
contractAddress: `0x${string}` | null | undefined;
|
|
516
|
+
cumulativeGasUsed: bigint;
|
|
517
|
+
effectiveGasPrice: bigint;
|
|
518
|
+
from: `0x${string}`;
|
|
519
|
+
gasUsed: bigint;
|
|
520
|
+
logs: viem.Log<bigint, number, false>[];
|
|
521
|
+
logsBloom: viem.Hex;
|
|
522
|
+
root?: `0x${string}` | undefined;
|
|
523
|
+
status: "success" | "reverted";
|
|
524
|
+
to: `0x${string}` | null;
|
|
525
|
+
transactionHash: viem.Hash;
|
|
526
|
+
transactionIndex: number;
|
|
527
|
+
type: viem.TransactionType;
|
|
528
|
+
l1GasPrice: bigint | null;
|
|
529
|
+
l1GasUsed: bigint | null;
|
|
530
|
+
l1Fee: bigint | null;
|
|
531
|
+
l1FeeScalar: number | null;
|
|
532
|
+
} & {};
|
|
533
|
+
type: "transactionReceipt";
|
|
534
|
+
};
|
|
535
|
+
};
|
|
536
|
+
serializers: {
|
|
537
|
+
readonly transaction: typeof viem_chains.serializeTransactionOpStack;
|
|
538
|
+
};
|
|
539
|
+
};
|
|
540
|
+
readonly base: {
|
|
541
|
+
blockExplorers: {
|
|
542
|
+
readonly default: {
|
|
543
|
+
readonly name: "Basescan";
|
|
544
|
+
readonly url: "https://basescan.org";
|
|
545
|
+
readonly apiUrl: "https://api.basescan.org/api";
|
|
546
|
+
};
|
|
547
|
+
};
|
|
548
|
+
blockTime: 2000;
|
|
549
|
+
contracts: {
|
|
550
|
+
readonly disputeGameFactory: {
|
|
551
|
+
readonly 1: {
|
|
552
|
+
readonly address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e";
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
readonly l2OutputOracle: {
|
|
556
|
+
readonly 1: {
|
|
557
|
+
readonly address: "0x56315b90c40730925ec5485cf004d835058518A0";
|
|
558
|
+
};
|
|
559
|
+
};
|
|
560
|
+
readonly multicall3: {
|
|
561
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
562
|
+
readonly blockCreated: 5022;
|
|
563
|
+
};
|
|
564
|
+
readonly portal: {
|
|
565
|
+
readonly 1: {
|
|
566
|
+
readonly address: "0x49048044D57e1C92A77f79988d21Fa8fAF74E97e";
|
|
567
|
+
readonly blockCreated: 17482143;
|
|
568
|
+
};
|
|
569
|
+
};
|
|
570
|
+
readonly l1StandardBridge: {
|
|
571
|
+
readonly 1: {
|
|
572
|
+
readonly address: "0x3154Cf16ccdb4C6d922629664174b904d80F2C35";
|
|
573
|
+
readonly blockCreated: 17482143;
|
|
574
|
+
};
|
|
575
|
+
};
|
|
576
|
+
readonly gasPriceOracle: {
|
|
577
|
+
readonly address: "0x420000000000000000000000000000000000000F";
|
|
578
|
+
};
|
|
579
|
+
readonly l1Block: {
|
|
580
|
+
readonly address: "0x4200000000000000000000000000000000000015";
|
|
581
|
+
};
|
|
582
|
+
readonly l2CrossDomainMessenger: {
|
|
583
|
+
readonly address: "0x4200000000000000000000000000000000000007";
|
|
584
|
+
};
|
|
585
|
+
readonly l2Erc721Bridge: {
|
|
586
|
+
readonly address: "0x4200000000000000000000000000000000000014";
|
|
587
|
+
};
|
|
588
|
+
readonly l2StandardBridge: {
|
|
589
|
+
readonly address: "0x4200000000000000000000000000000000000010";
|
|
590
|
+
};
|
|
591
|
+
readonly l2ToL1MessagePasser: {
|
|
592
|
+
readonly address: "0x4200000000000000000000000000000000000016";
|
|
593
|
+
};
|
|
594
|
+
};
|
|
595
|
+
ensTlds?: readonly string[] | undefined;
|
|
596
|
+
id: 8453;
|
|
597
|
+
name: "Base";
|
|
598
|
+
nativeCurrency: {
|
|
599
|
+
readonly name: "Ether";
|
|
600
|
+
readonly symbol: "ETH";
|
|
601
|
+
readonly decimals: 18;
|
|
602
|
+
};
|
|
603
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
604
|
+
rpcUrls: {
|
|
605
|
+
readonly default: {
|
|
606
|
+
readonly http: readonly ["https://mainnet.base.org"];
|
|
607
|
+
};
|
|
608
|
+
};
|
|
609
|
+
sourceId: 1;
|
|
610
|
+
testnet?: boolean | undefined | undefined;
|
|
611
|
+
custom?: Record<string, unknown> | undefined;
|
|
612
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
613
|
+
formatters: {
|
|
614
|
+
readonly block: {
|
|
615
|
+
exclude: [] | undefined;
|
|
616
|
+
format: (args: viem_chains.OpStackRpcBlock) => {
|
|
617
|
+
baseFeePerGas: bigint | null;
|
|
618
|
+
blobGasUsed: bigint;
|
|
619
|
+
difficulty: bigint;
|
|
620
|
+
excessBlobGas: bigint;
|
|
621
|
+
extraData: viem.Hex;
|
|
622
|
+
gasLimit: bigint;
|
|
623
|
+
gasUsed: bigint;
|
|
624
|
+
hash: `0x${string}` | null;
|
|
625
|
+
logsBloom: `0x${string}` | null;
|
|
626
|
+
miner: `0x${string}`;
|
|
627
|
+
mixHash: viem.Hash;
|
|
628
|
+
nonce: `0x${string}` | null;
|
|
629
|
+
number: bigint | null;
|
|
630
|
+
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
631
|
+
parentHash: viem.Hash;
|
|
632
|
+
receiptsRoot: viem.Hex;
|
|
633
|
+
sealFields: viem.Hex[];
|
|
634
|
+
sha3Uncles: viem.Hash;
|
|
635
|
+
size: bigint;
|
|
636
|
+
stateRoot: viem.Hash;
|
|
637
|
+
timestamp: bigint;
|
|
638
|
+
totalDifficulty: bigint | null;
|
|
639
|
+
transactions: `0x${string}`[] | viem_chains.OpStackTransaction<boolean>[];
|
|
640
|
+
transactionsRoot: viem.Hash;
|
|
641
|
+
uncles: viem.Hash[];
|
|
642
|
+
withdrawals?: viem.Withdrawal[] | undefined | undefined;
|
|
643
|
+
withdrawalsRoot?: `0x${string}` | undefined;
|
|
644
|
+
} & {};
|
|
645
|
+
type: "block";
|
|
646
|
+
};
|
|
647
|
+
readonly transaction: {
|
|
648
|
+
exclude: [] | undefined;
|
|
649
|
+
format: (args: viem_chains.OpStackRpcTransaction) => ({
|
|
650
|
+
blockHash: `0x${string}` | null;
|
|
651
|
+
blockNumber: bigint | null;
|
|
652
|
+
from: `0x${string}`;
|
|
653
|
+
gas: bigint;
|
|
654
|
+
hash: viem.Hash;
|
|
655
|
+
input: viem.Hex;
|
|
656
|
+
nonce: number;
|
|
657
|
+
r: viem.Hex;
|
|
658
|
+
s: viem.Hex;
|
|
659
|
+
to: `0x${string}` | null;
|
|
660
|
+
transactionIndex: number | null;
|
|
661
|
+
typeHex: viem.Hex | null;
|
|
662
|
+
v: bigint;
|
|
663
|
+
value: bigint;
|
|
664
|
+
yParity: number;
|
|
665
|
+
gasPrice?: undefined | undefined;
|
|
666
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
667
|
+
maxFeePerGas: bigint;
|
|
668
|
+
maxPriorityFeePerGas: bigint;
|
|
669
|
+
isSystemTx?: boolean;
|
|
670
|
+
mint?: bigint | undefined | undefined;
|
|
671
|
+
sourceHash: viem.Hex;
|
|
672
|
+
type: "deposit";
|
|
673
|
+
} | {
|
|
674
|
+
r: viem.Hex;
|
|
675
|
+
s: viem.Hex;
|
|
676
|
+
v: bigint;
|
|
677
|
+
to: `0x${string}` | null;
|
|
678
|
+
from: `0x${string}`;
|
|
679
|
+
gas: bigint;
|
|
680
|
+
nonce: number;
|
|
681
|
+
value: bigint;
|
|
682
|
+
blockHash: `0x${string}` | null;
|
|
683
|
+
blockNumber: bigint | null;
|
|
684
|
+
hash: viem.Hash;
|
|
685
|
+
input: viem.Hex;
|
|
686
|
+
transactionIndex: number | null;
|
|
687
|
+
typeHex: viem.Hex | null;
|
|
688
|
+
accessList?: undefined | undefined;
|
|
689
|
+
authorizationList?: undefined | undefined;
|
|
690
|
+
blobVersionedHashes?: undefined | undefined;
|
|
691
|
+
chainId?: number | undefined;
|
|
692
|
+
yParity?: undefined | undefined;
|
|
693
|
+
type: "legacy";
|
|
694
|
+
gasPrice: bigint;
|
|
695
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
696
|
+
maxFeePerGas?: undefined | undefined;
|
|
697
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
698
|
+
isSystemTx?: undefined | undefined;
|
|
699
|
+
mint?: undefined | undefined;
|
|
700
|
+
sourceHash?: undefined | undefined;
|
|
701
|
+
} | {
|
|
702
|
+
blockHash: `0x${string}` | null;
|
|
703
|
+
blockNumber: bigint | null;
|
|
704
|
+
from: `0x${string}`;
|
|
705
|
+
gas: bigint;
|
|
706
|
+
hash: viem.Hash;
|
|
707
|
+
input: viem.Hex;
|
|
708
|
+
nonce: number;
|
|
709
|
+
r: viem.Hex;
|
|
710
|
+
s: viem.Hex;
|
|
711
|
+
to: `0x${string}` | null;
|
|
712
|
+
transactionIndex: number | null;
|
|
713
|
+
typeHex: viem.Hex | null;
|
|
714
|
+
v: bigint;
|
|
715
|
+
value: bigint;
|
|
716
|
+
yParity: number;
|
|
717
|
+
accessList: viem.AccessList;
|
|
718
|
+
authorizationList?: undefined | undefined;
|
|
719
|
+
blobVersionedHashes?: undefined | undefined;
|
|
720
|
+
chainId: number;
|
|
721
|
+
type: "eip2930";
|
|
722
|
+
gasPrice: bigint;
|
|
723
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
724
|
+
maxFeePerGas?: undefined | undefined;
|
|
725
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
726
|
+
isSystemTx?: undefined | undefined;
|
|
727
|
+
mint?: undefined | undefined;
|
|
728
|
+
sourceHash?: undefined | undefined;
|
|
729
|
+
} | {
|
|
730
|
+
blockHash: `0x${string}` | null;
|
|
731
|
+
blockNumber: bigint | null;
|
|
732
|
+
from: `0x${string}`;
|
|
733
|
+
gas: bigint;
|
|
734
|
+
hash: viem.Hash;
|
|
735
|
+
input: viem.Hex;
|
|
736
|
+
nonce: number;
|
|
737
|
+
r: viem.Hex;
|
|
738
|
+
s: viem.Hex;
|
|
739
|
+
to: `0x${string}` | null;
|
|
740
|
+
transactionIndex: number | null;
|
|
741
|
+
typeHex: viem.Hex | null;
|
|
742
|
+
v: bigint;
|
|
743
|
+
value: bigint;
|
|
744
|
+
yParity: number;
|
|
745
|
+
accessList: viem.AccessList;
|
|
746
|
+
authorizationList?: undefined | undefined;
|
|
747
|
+
blobVersionedHashes?: undefined | undefined;
|
|
748
|
+
chainId: number;
|
|
749
|
+
type: "eip1559";
|
|
750
|
+
gasPrice?: undefined | undefined;
|
|
751
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
752
|
+
maxFeePerGas: bigint;
|
|
753
|
+
maxPriorityFeePerGas: bigint;
|
|
754
|
+
isSystemTx?: undefined | undefined;
|
|
755
|
+
mint?: undefined | undefined;
|
|
756
|
+
sourceHash?: undefined | undefined;
|
|
757
|
+
} | {
|
|
758
|
+
blockHash: `0x${string}` | null;
|
|
759
|
+
blockNumber: bigint | null;
|
|
760
|
+
from: `0x${string}`;
|
|
761
|
+
gas: bigint;
|
|
762
|
+
hash: viem.Hash;
|
|
763
|
+
input: viem.Hex;
|
|
764
|
+
nonce: number;
|
|
765
|
+
r: viem.Hex;
|
|
766
|
+
s: viem.Hex;
|
|
767
|
+
to: `0x${string}` | null;
|
|
768
|
+
transactionIndex: number | null;
|
|
769
|
+
typeHex: viem.Hex | null;
|
|
770
|
+
v: bigint;
|
|
771
|
+
value: bigint;
|
|
772
|
+
yParity: number;
|
|
773
|
+
accessList: viem.AccessList;
|
|
774
|
+
authorizationList?: undefined | undefined;
|
|
775
|
+
blobVersionedHashes: readonly viem.Hex[];
|
|
776
|
+
chainId: number;
|
|
777
|
+
type: "eip4844";
|
|
778
|
+
gasPrice?: undefined | undefined;
|
|
779
|
+
maxFeePerBlobGas: bigint;
|
|
780
|
+
maxFeePerGas: bigint;
|
|
781
|
+
maxPriorityFeePerGas: bigint;
|
|
782
|
+
isSystemTx?: undefined | undefined;
|
|
783
|
+
mint?: undefined | undefined;
|
|
784
|
+
sourceHash?: undefined | undefined;
|
|
785
|
+
} | {
|
|
786
|
+
blockHash: `0x${string}` | null;
|
|
787
|
+
blockNumber: bigint | null;
|
|
788
|
+
from: `0x${string}`;
|
|
789
|
+
gas: bigint;
|
|
790
|
+
hash: viem.Hash;
|
|
791
|
+
input: viem.Hex;
|
|
792
|
+
nonce: number;
|
|
793
|
+
r: viem.Hex;
|
|
794
|
+
s: viem.Hex;
|
|
795
|
+
to: `0x${string}` | null;
|
|
796
|
+
transactionIndex: number | null;
|
|
797
|
+
typeHex: viem.Hex | null;
|
|
798
|
+
v: bigint;
|
|
799
|
+
value: bigint;
|
|
800
|
+
yParity: number;
|
|
801
|
+
accessList: viem.AccessList;
|
|
802
|
+
authorizationList: viem.SignedAuthorizationList;
|
|
803
|
+
blobVersionedHashes?: undefined | undefined;
|
|
804
|
+
chainId: number;
|
|
805
|
+
type: "eip7702";
|
|
806
|
+
gasPrice?: undefined | undefined;
|
|
807
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
808
|
+
maxFeePerGas: bigint;
|
|
809
|
+
maxPriorityFeePerGas: bigint;
|
|
810
|
+
isSystemTx?: undefined | undefined;
|
|
811
|
+
mint?: undefined | undefined;
|
|
812
|
+
sourceHash?: undefined | undefined;
|
|
813
|
+
}) & {};
|
|
814
|
+
type: "transaction";
|
|
815
|
+
};
|
|
816
|
+
readonly transactionReceipt: {
|
|
817
|
+
exclude: [] | undefined;
|
|
818
|
+
format: (args: viem_chains.OpStackRpcTransactionReceipt) => {
|
|
819
|
+
blobGasPrice?: bigint | undefined;
|
|
820
|
+
blobGasUsed?: bigint | undefined;
|
|
821
|
+
blockHash: viem.Hash;
|
|
822
|
+
blockNumber: bigint;
|
|
823
|
+
contractAddress: `0x${string}` | null | undefined;
|
|
824
|
+
cumulativeGasUsed: bigint;
|
|
825
|
+
effectiveGasPrice: bigint;
|
|
826
|
+
from: `0x${string}`;
|
|
827
|
+
gasUsed: bigint;
|
|
828
|
+
logs: viem.Log<bigint, number, false>[];
|
|
829
|
+
logsBloom: viem.Hex;
|
|
830
|
+
root?: `0x${string}` | undefined;
|
|
831
|
+
status: "success" | "reverted";
|
|
832
|
+
to: `0x${string}` | null;
|
|
833
|
+
transactionHash: viem.Hash;
|
|
834
|
+
transactionIndex: number;
|
|
835
|
+
type: viem.TransactionType;
|
|
836
|
+
l1GasPrice: bigint | null;
|
|
837
|
+
l1GasUsed: bigint | null;
|
|
838
|
+
l1Fee: bigint | null;
|
|
839
|
+
l1FeeScalar: number | null;
|
|
840
|
+
} & {};
|
|
841
|
+
type: "transactionReceipt";
|
|
842
|
+
};
|
|
843
|
+
};
|
|
844
|
+
serializers: {
|
|
845
|
+
readonly transaction: typeof viem_chains.serializeTransactionOpStack;
|
|
846
|
+
};
|
|
847
|
+
};
|
|
848
|
+
};
|
|
849
|
+
type SupportedChain = keyof typeof SUPPORTED_CHAINS;
|
|
850
|
+
interface BlockchainRuntimeExtension {
|
|
851
|
+
rpcUrl?: string;
|
|
852
|
+
privateKey?: string;
|
|
853
|
+
defaultChain?: SupportedChain;
|
|
854
|
+
}
|
|
855
|
+
/**
|
|
856
|
+
* Get Balance Tool
|
|
857
|
+
*
|
|
858
|
+
* Retrieves the native token balance for a given address on a specified chain.
|
|
859
|
+
*
|
|
860
|
+
* @tool getBalance
|
|
861
|
+
* @category Blockchain
|
|
862
|
+
*
|
|
863
|
+
* @param {string} address - The wallet address to check balance for
|
|
864
|
+
* @param {string} [chain] - The blockchain network (defaults to mainnet)
|
|
865
|
+
*
|
|
866
|
+
* @returns {Promise<{success: boolean, balance: string, balanceWei: string, address: string, chain: string, error?: string}>}
|
|
867
|
+
*/
|
|
868
|
+
declare const getBalanceTool: Tool<z.ZodObject<{
|
|
869
|
+
address: z.ZodString;
|
|
870
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]>>;
|
|
871
|
+
}, "strip", z.ZodTypeAny, {
|
|
872
|
+
chain: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base";
|
|
873
|
+
address: string;
|
|
874
|
+
}, {
|
|
875
|
+
address: string;
|
|
876
|
+
chain?: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base" | undefined;
|
|
877
|
+
}>, z.ZodObject<{
|
|
878
|
+
success: z.ZodBoolean;
|
|
879
|
+
balance: z.ZodString;
|
|
880
|
+
balanceWei: z.ZodString;
|
|
881
|
+
address: z.ZodString;
|
|
882
|
+
chain: z.ZodString;
|
|
883
|
+
error: z.ZodOptional<z.ZodString>;
|
|
884
|
+
}, "strip", z.ZodTypeAny, {
|
|
885
|
+
chain: string;
|
|
886
|
+
address: string;
|
|
887
|
+
success: boolean;
|
|
888
|
+
balance: string;
|
|
889
|
+
balanceWei: string;
|
|
890
|
+
error?: string | undefined;
|
|
891
|
+
}, {
|
|
892
|
+
chain: string;
|
|
893
|
+
address: string;
|
|
894
|
+
success: boolean;
|
|
895
|
+
balance: string;
|
|
896
|
+
balanceWei: string;
|
|
897
|
+
error?: string | undefined;
|
|
898
|
+
}>, {
|
|
899
|
+
[x: string]: never;
|
|
900
|
+
}>;
|
|
901
|
+
/**
|
|
902
|
+
* Get Transaction Tool
|
|
903
|
+
*
|
|
904
|
+
* Retrieves transaction details by transaction hash.
|
|
905
|
+
*
|
|
906
|
+
* @tool getTransaction
|
|
907
|
+
* @category Blockchain
|
|
908
|
+
*
|
|
909
|
+
* @param {string} hash - The transaction hash to look up
|
|
910
|
+
* @param {string} [chain] - The blockchain network (defaults to mainnet)
|
|
911
|
+
*
|
|
912
|
+
* @returns {Promise<{success: boolean, transaction?: object, error?: string}>}
|
|
913
|
+
*/
|
|
914
|
+
declare const getTransactionTool: Tool<z.ZodObject<{
|
|
915
|
+
hash: z.ZodString;
|
|
916
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]>>;
|
|
917
|
+
}, "strip", z.ZodTypeAny, {
|
|
918
|
+
chain: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base";
|
|
919
|
+
hash: string;
|
|
920
|
+
}, {
|
|
921
|
+
hash: string;
|
|
922
|
+
chain?: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base" | undefined;
|
|
923
|
+
}>, z.ZodObject<{
|
|
924
|
+
success: z.ZodBoolean;
|
|
925
|
+
transaction: z.ZodOptional<z.ZodObject<{
|
|
926
|
+
hash: z.ZodString;
|
|
927
|
+
from: z.ZodString;
|
|
928
|
+
to: z.ZodNullable<z.ZodString>;
|
|
929
|
+
value: z.ZodString;
|
|
930
|
+
gasUsed: z.ZodOptional<z.ZodString>;
|
|
931
|
+
gasPrice: z.ZodOptional<z.ZodString>;
|
|
932
|
+
blockNumber: z.ZodOptional<z.ZodString>;
|
|
933
|
+
status: z.ZodOptional<z.ZodString>;
|
|
934
|
+
}, "strip", z.ZodTypeAny, {
|
|
935
|
+
from: string;
|
|
936
|
+
hash: string;
|
|
937
|
+
to: string | null;
|
|
938
|
+
value: string;
|
|
939
|
+
status?: string | undefined;
|
|
940
|
+
blockNumber?: string | undefined;
|
|
941
|
+
gasPrice?: string | undefined;
|
|
942
|
+
gasUsed?: string | undefined;
|
|
943
|
+
}, {
|
|
944
|
+
from: string;
|
|
945
|
+
hash: string;
|
|
946
|
+
to: string | null;
|
|
947
|
+
value: string;
|
|
948
|
+
status?: string | undefined;
|
|
949
|
+
blockNumber?: string | undefined;
|
|
950
|
+
gasPrice?: string | undefined;
|
|
951
|
+
gasUsed?: string | undefined;
|
|
952
|
+
}>>;
|
|
953
|
+
error: z.ZodOptional<z.ZodString>;
|
|
954
|
+
}, "strip", z.ZodTypeAny, {
|
|
955
|
+
success: boolean;
|
|
956
|
+
transaction?: {
|
|
957
|
+
from: string;
|
|
958
|
+
hash: string;
|
|
959
|
+
to: string | null;
|
|
960
|
+
value: string;
|
|
961
|
+
status?: string | undefined;
|
|
962
|
+
blockNumber?: string | undefined;
|
|
963
|
+
gasPrice?: string | undefined;
|
|
964
|
+
gasUsed?: string | undefined;
|
|
965
|
+
} | undefined;
|
|
966
|
+
error?: string | undefined;
|
|
967
|
+
}, {
|
|
968
|
+
success: boolean;
|
|
969
|
+
transaction?: {
|
|
970
|
+
from: string;
|
|
971
|
+
hash: string;
|
|
972
|
+
to: string | null;
|
|
973
|
+
value: string;
|
|
974
|
+
status?: string | undefined;
|
|
975
|
+
blockNumber?: string | undefined;
|
|
976
|
+
gasPrice?: string | undefined;
|
|
977
|
+
gasUsed?: string | undefined;
|
|
978
|
+
} | undefined;
|
|
979
|
+
error?: string | undefined;
|
|
980
|
+
}>, {
|
|
981
|
+
[x: string]: never;
|
|
982
|
+
}>;
|
|
983
|
+
/**
|
|
984
|
+
* Send Transaction Tool
|
|
985
|
+
*
|
|
986
|
+
* Sends a native token transaction to another address.
|
|
987
|
+
* Requires a private key to be configured in the runtime.
|
|
988
|
+
*
|
|
989
|
+
* @tool sendTransaction
|
|
990
|
+
* @category Blockchain
|
|
991
|
+
*
|
|
992
|
+
* @param {string} to - The recipient address
|
|
993
|
+
* @param {string} amount - The amount to send (in ETH, MATIC, etc.)
|
|
994
|
+
* @param {string} [chain] - The blockchain network (defaults to mainnet)
|
|
995
|
+
*
|
|
996
|
+
* @returns {Promise<{success: boolean, hash?: string, error?: string}>}
|
|
997
|
+
*/
|
|
998
|
+
declare const sendTransactionTool: Tool<z.ZodObject<{
|
|
999
|
+
to: z.ZodString;
|
|
1000
|
+
amount: z.ZodString;
|
|
1001
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]>>;
|
|
1002
|
+
}, "strip", z.ZodTypeAny, {
|
|
1003
|
+
chain: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base";
|
|
1004
|
+
to: string;
|
|
1005
|
+
amount: string;
|
|
1006
|
+
}, {
|
|
1007
|
+
to: string;
|
|
1008
|
+
amount: string;
|
|
1009
|
+
chain?: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base" | undefined;
|
|
1010
|
+
}>, z.ZodObject<{
|
|
1011
|
+
success: z.ZodBoolean;
|
|
1012
|
+
hash: z.ZodOptional<z.ZodString>;
|
|
1013
|
+
from: z.ZodOptional<z.ZodString>;
|
|
1014
|
+
to: z.ZodString;
|
|
1015
|
+
amount: z.ZodString;
|
|
1016
|
+
chain: z.ZodString;
|
|
1017
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1018
|
+
}, "strip", z.ZodTypeAny, {
|
|
1019
|
+
chain: string;
|
|
1020
|
+
to: string;
|
|
1021
|
+
success: boolean;
|
|
1022
|
+
amount: string;
|
|
1023
|
+
from?: string | undefined;
|
|
1024
|
+
hash?: string | undefined;
|
|
1025
|
+
error?: string | undefined;
|
|
1026
|
+
}, {
|
|
1027
|
+
chain: string;
|
|
1028
|
+
to: string;
|
|
1029
|
+
success: boolean;
|
|
1030
|
+
amount: string;
|
|
1031
|
+
from?: string | undefined;
|
|
1032
|
+
hash?: string | undefined;
|
|
1033
|
+
error?: string | undefined;
|
|
1034
|
+
}>, {
|
|
1035
|
+
[x: string]: never;
|
|
1036
|
+
}>;
|
|
1037
|
+
/**
|
|
1038
|
+
* Get Block Tool
|
|
1039
|
+
*
|
|
1040
|
+
* Retrieves information about a specific block.
|
|
1041
|
+
*
|
|
1042
|
+
* @tool getBlock
|
|
1043
|
+
* @category Blockchain
|
|
1044
|
+
*
|
|
1045
|
+
* @param {string} [blockNumber] - Block number (defaults to latest)
|
|
1046
|
+
* @param {string} [chain] - The blockchain network (defaults to mainnet)
|
|
1047
|
+
*
|
|
1048
|
+
* @returns {Promise<{success: boolean, block?: object, error?: string}>}
|
|
1049
|
+
*/
|
|
1050
|
+
declare const getBlockTool: Tool<z.ZodObject<{
|
|
1051
|
+
blockNumber: z.ZodOptional<z.ZodString>;
|
|
1052
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]>>;
|
|
1053
|
+
}, "strip", z.ZodTypeAny, {
|
|
1054
|
+
chain: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base";
|
|
1055
|
+
blockNumber?: string | undefined;
|
|
1056
|
+
}, {
|
|
1057
|
+
chain?: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base" | undefined;
|
|
1058
|
+
blockNumber?: string | undefined;
|
|
1059
|
+
}>, z.ZodObject<{
|
|
1060
|
+
success: z.ZodBoolean;
|
|
1061
|
+
block: z.ZodOptional<z.ZodObject<{
|
|
1062
|
+
number: z.ZodString;
|
|
1063
|
+
hash: z.ZodString;
|
|
1064
|
+
timestamp: z.ZodString;
|
|
1065
|
+
transactionCount: z.ZodNumber;
|
|
1066
|
+
gasUsed: z.ZodString;
|
|
1067
|
+
gasLimit: z.ZodString;
|
|
1068
|
+
}, "strip", z.ZodTypeAny, {
|
|
1069
|
+
number: string;
|
|
1070
|
+
hash: string;
|
|
1071
|
+
gasLimit: string;
|
|
1072
|
+
gasUsed: string;
|
|
1073
|
+
timestamp: string;
|
|
1074
|
+
transactionCount: number;
|
|
1075
|
+
}, {
|
|
1076
|
+
number: string;
|
|
1077
|
+
hash: string;
|
|
1078
|
+
gasLimit: string;
|
|
1079
|
+
gasUsed: string;
|
|
1080
|
+
timestamp: string;
|
|
1081
|
+
transactionCount: number;
|
|
1082
|
+
}>>;
|
|
1083
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1084
|
+
}, "strip", z.ZodTypeAny, {
|
|
1085
|
+
success: boolean;
|
|
1086
|
+
block?: {
|
|
1087
|
+
number: string;
|
|
1088
|
+
hash: string;
|
|
1089
|
+
gasLimit: string;
|
|
1090
|
+
gasUsed: string;
|
|
1091
|
+
timestamp: string;
|
|
1092
|
+
transactionCount: number;
|
|
1093
|
+
} | undefined;
|
|
1094
|
+
error?: string | undefined;
|
|
1095
|
+
}, {
|
|
1096
|
+
success: boolean;
|
|
1097
|
+
block?: {
|
|
1098
|
+
number: string;
|
|
1099
|
+
hash: string;
|
|
1100
|
+
gasLimit: string;
|
|
1101
|
+
gasUsed: string;
|
|
1102
|
+
timestamp: string;
|
|
1103
|
+
transactionCount: number;
|
|
1104
|
+
} | undefined;
|
|
1105
|
+
error?: string | undefined;
|
|
1106
|
+
}>, {
|
|
1107
|
+
[x: string]: never;
|
|
1108
|
+
}>;
|
|
1109
|
+
/**
|
|
1110
|
+
* Get Gas Price Tool
|
|
1111
|
+
*
|
|
1112
|
+
* Retrieves current gas price information for a blockchain.
|
|
1113
|
+
*
|
|
1114
|
+
* @tool getGasPrice
|
|
1115
|
+
* @category Blockchain
|
|
1116
|
+
*
|
|
1117
|
+
* @param {string} [chain] - The blockchain network (defaults to mainnet)
|
|
1118
|
+
*
|
|
1119
|
+
* @returns {Promise<{success: boolean, gasPrice?: string, error?: string}>}
|
|
1120
|
+
*/
|
|
1121
|
+
declare const getGasPriceTool: Tool<z.ZodObject<{
|
|
1122
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]>>;
|
|
1123
|
+
}, "strip", z.ZodTypeAny, {
|
|
1124
|
+
chain: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base";
|
|
1125
|
+
}, {
|
|
1126
|
+
chain?: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base" | undefined;
|
|
1127
|
+
}>, z.ZodObject<{
|
|
1128
|
+
success: z.ZodBoolean;
|
|
1129
|
+
gasPrice: z.ZodOptional<z.ZodString>;
|
|
1130
|
+
gasPriceWei: z.ZodOptional<z.ZodString>;
|
|
1131
|
+
chain: z.ZodString;
|
|
1132
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1133
|
+
}, "strip", z.ZodTypeAny, {
|
|
1134
|
+
chain: string;
|
|
1135
|
+
success: boolean;
|
|
1136
|
+
gasPrice?: string | undefined;
|
|
1137
|
+
error?: string | undefined;
|
|
1138
|
+
gasPriceWei?: string | undefined;
|
|
1139
|
+
}, {
|
|
1140
|
+
chain: string;
|
|
1141
|
+
success: boolean;
|
|
1142
|
+
gasPrice?: string | undefined;
|
|
1143
|
+
error?: string | undefined;
|
|
1144
|
+
gasPriceWei?: string | undefined;
|
|
1145
|
+
}>, {
|
|
1146
|
+
[x: string]: never;
|
|
1147
|
+
}>;
|
|
1148
|
+
/**
|
|
1149
|
+
* Estimate Gas Tool
|
|
1150
|
+
*
|
|
1151
|
+
* Estimates gas required for a transaction.
|
|
1152
|
+
*
|
|
1153
|
+
* @tool estimateGas
|
|
1154
|
+
* @category Blockchain
|
|
1155
|
+
*
|
|
1156
|
+
* @param {string} to - The recipient address
|
|
1157
|
+
* @param {string} [amount] - The amount to send (defaults to 0)
|
|
1158
|
+
* @param {string} [data] - Transaction data (for contract calls)
|
|
1159
|
+
* @param {string} [chain] - The blockchain network (defaults to mainnet)
|
|
1160
|
+
*
|
|
1161
|
+
* @returns {Promise<{success: boolean, gasEstimate?: string, error?: string}>}
|
|
1162
|
+
*/
|
|
1163
|
+
declare const estimateGasTool: Tool<z.ZodObject<{
|
|
1164
|
+
to: z.ZodString;
|
|
1165
|
+
amount: z.ZodDefault<z.ZodString>;
|
|
1166
|
+
data: z.ZodOptional<z.ZodString>;
|
|
1167
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]>>;
|
|
1168
|
+
}, "strip", z.ZodTypeAny, {
|
|
1169
|
+
chain: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base";
|
|
1170
|
+
to: string;
|
|
1171
|
+
amount: string;
|
|
1172
|
+
data?: string | undefined;
|
|
1173
|
+
}, {
|
|
1174
|
+
to: string;
|
|
1175
|
+
chain?: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base" | undefined;
|
|
1176
|
+
data?: string | undefined;
|
|
1177
|
+
amount?: string | undefined;
|
|
1178
|
+
}>, z.ZodObject<{
|
|
1179
|
+
success: z.ZodBoolean;
|
|
1180
|
+
gasEstimate: z.ZodOptional<z.ZodString>;
|
|
1181
|
+
to: z.ZodString;
|
|
1182
|
+
amount: z.ZodString;
|
|
1183
|
+
chain: z.ZodString;
|
|
1184
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1185
|
+
}, "strip", z.ZodTypeAny, {
|
|
1186
|
+
chain: string;
|
|
1187
|
+
to: string;
|
|
1188
|
+
success: boolean;
|
|
1189
|
+
amount: string;
|
|
1190
|
+
error?: string | undefined;
|
|
1191
|
+
gasEstimate?: string | undefined;
|
|
1192
|
+
}, {
|
|
1193
|
+
chain: string;
|
|
1194
|
+
to: string;
|
|
1195
|
+
success: boolean;
|
|
1196
|
+
amount: string;
|
|
1197
|
+
error?: string | undefined;
|
|
1198
|
+
gasEstimate?: string | undefined;
|
|
1199
|
+
}>, {
|
|
1200
|
+
[x: string]: never;
|
|
1201
|
+
}>;
|
|
1202
|
+
/**
|
|
1203
|
+
* Collection of blockchain tools for crypto agents
|
|
1204
|
+
*
|
|
1205
|
+
* These tools provide comprehensive blockchain interaction capabilities including
|
|
1206
|
+
* balance checking, transaction sending, gas estimation, and more.
|
|
1207
|
+
*
|
|
1208
|
+
* @namespace blockchainTools
|
|
1209
|
+
*
|
|
1210
|
+
* @property {Tool} getBalance - Get native token balance for an address
|
|
1211
|
+
* @property {Tool} getTransaction - Get transaction details by hash
|
|
1212
|
+
* @property {Tool} sendTransaction - Send native tokens to another address
|
|
1213
|
+
* @property {Tool} getBlock - Get information about a blockchain block
|
|
1214
|
+
* @property {Tool} getGasPrice - Get current gas price for a blockchain
|
|
1215
|
+
* @property {Tool} estimateGas - Estimate gas required for a transaction
|
|
1216
|
+
*/
|
|
1217
|
+
declare const blockchainTools: {
|
|
1218
|
+
getBalance: Tool<z.ZodObject<{
|
|
1219
|
+
address: z.ZodString;
|
|
1220
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]>>;
|
|
1221
|
+
}, "strip", z.ZodTypeAny, {
|
|
1222
|
+
chain: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base";
|
|
1223
|
+
address: string;
|
|
1224
|
+
}, {
|
|
1225
|
+
address: string;
|
|
1226
|
+
chain?: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base" | undefined;
|
|
1227
|
+
}>, z.ZodObject<{
|
|
1228
|
+
success: z.ZodBoolean;
|
|
1229
|
+
balance: z.ZodString;
|
|
1230
|
+
balanceWei: z.ZodString;
|
|
1231
|
+
address: z.ZodString;
|
|
1232
|
+
chain: z.ZodString;
|
|
1233
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1234
|
+
}, "strip", z.ZodTypeAny, {
|
|
1235
|
+
chain: string;
|
|
1236
|
+
address: string;
|
|
1237
|
+
success: boolean;
|
|
1238
|
+
balance: string;
|
|
1239
|
+
balanceWei: string;
|
|
1240
|
+
error?: string | undefined;
|
|
1241
|
+
}, {
|
|
1242
|
+
chain: string;
|
|
1243
|
+
address: string;
|
|
1244
|
+
success: boolean;
|
|
1245
|
+
balance: string;
|
|
1246
|
+
balanceWei: string;
|
|
1247
|
+
error?: string | undefined;
|
|
1248
|
+
}>, {
|
|
1249
|
+
[x: string]: never;
|
|
1250
|
+
}>;
|
|
1251
|
+
getTransaction: Tool<z.ZodObject<{
|
|
1252
|
+
hash: z.ZodString;
|
|
1253
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]>>;
|
|
1254
|
+
}, "strip", z.ZodTypeAny, {
|
|
1255
|
+
chain: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base";
|
|
1256
|
+
hash: string;
|
|
1257
|
+
}, {
|
|
1258
|
+
hash: string;
|
|
1259
|
+
chain?: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base" | undefined;
|
|
1260
|
+
}>, z.ZodObject<{
|
|
1261
|
+
success: z.ZodBoolean;
|
|
1262
|
+
transaction: z.ZodOptional<z.ZodObject<{
|
|
1263
|
+
hash: z.ZodString;
|
|
1264
|
+
from: z.ZodString;
|
|
1265
|
+
to: z.ZodNullable<z.ZodString>;
|
|
1266
|
+
value: z.ZodString;
|
|
1267
|
+
gasUsed: z.ZodOptional<z.ZodString>;
|
|
1268
|
+
gasPrice: z.ZodOptional<z.ZodString>;
|
|
1269
|
+
blockNumber: z.ZodOptional<z.ZodString>;
|
|
1270
|
+
status: z.ZodOptional<z.ZodString>;
|
|
1271
|
+
}, "strip", z.ZodTypeAny, {
|
|
1272
|
+
from: string;
|
|
1273
|
+
hash: string;
|
|
1274
|
+
to: string | null;
|
|
1275
|
+
value: string;
|
|
1276
|
+
status?: string | undefined;
|
|
1277
|
+
blockNumber?: string | undefined;
|
|
1278
|
+
gasPrice?: string | undefined;
|
|
1279
|
+
gasUsed?: string | undefined;
|
|
1280
|
+
}, {
|
|
1281
|
+
from: string;
|
|
1282
|
+
hash: string;
|
|
1283
|
+
to: string | null;
|
|
1284
|
+
value: string;
|
|
1285
|
+
status?: string | undefined;
|
|
1286
|
+
blockNumber?: string | undefined;
|
|
1287
|
+
gasPrice?: string | undefined;
|
|
1288
|
+
gasUsed?: string | undefined;
|
|
1289
|
+
}>>;
|
|
1290
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1291
|
+
}, "strip", z.ZodTypeAny, {
|
|
1292
|
+
success: boolean;
|
|
1293
|
+
transaction?: {
|
|
1294
|
+
from: string;
|
|
1295
|
+
hash: string;
|
|
1296
|
+
to: string | null;
|
|
1297
|
+
value: string;
|
|
1298
|
+
status?: string | undefined;
|
|
1299
|
+
blockNumber?: string | undefined;
|
|
1300
|
+
gasPrice?: string | undefined;
|
|
1301
|
+
gasUsed?: string | undefined;
|
|
1302
|
+
} | undefined;
|
|
1303
|
+
error?: string | undefined;
|
|
1304
|
+
}, {
|
|
1305
|
+
success: boolean;
|
|
1306
|
+
transaction?: {
|
|
1307
|
+
from: string;
|
|
1308
|
+
hash: string;
|
|
1309
|
+
to: string | null;
|
|
1310
|
+
value: string;
|
|
1311
|
+
status?: string | undefined;
|
|
1312
|
+
blockNumber?: string | undefined;
|
|
1313
|
+
gasPrice?: string | undefined;
|
|
1314
|
+
gasUsed?: string | undefined;
|
|
1315
|
+
} | undefined;
|
|
1316
|
+
error?: string | undefined;
|
|
1317
|
+
}>, {
|
|
1318
|
+
[x: string]: never;
|
|
1319
|
+
}>;
|
|
1320
|
+
sendTransaction: Tool<z.ZodObject<{
|
|
1321
|
+
to: z.ZodString;
|
|
1322
|
+
amount: z.ZodString;
|
|
1323
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]>>;
|
|
1324
|
+
}, "strip", z.ZodTypeAny, {
|
|
1325
|
+
chain: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base";
|
|
1326
|
+
to: string;
|
|
1327
|
+
amount: string;
|
|
1328
|
+
}, {
|
|
1329
|
+
to: string;
|
|
1330
|
+
amount: string;
|
|
1331
|
+
chain?: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base" | undefined;
|
|
1332
|
+
}>, z.ZodObject<{
|
|
1333
|
+
success: z.ZodBoolean;
|
|
1334
|
+
hash: z.ZodOptional<z.ZodString>;
|
|
1335
|
+
from: z.ZodOptional<z.ZodString>;
|
|
1336
|
+
to: z.ZodString;
|
|
1337
|
+
amount: z.ZodString;
|
|
1338
|
+
chain: z.ZodString;
|
|
1339
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1340
|
+
}, "strip", z.ZodTypeAny, {
|
|
1341
|
+
chain: string;
|
|
1342
|
+
to: string;
|
|
1343
|
+
success: boolean;
|
|
1344
|
+
amount: string;
|
|
1345
|
+
from?: string | undefined;
|
|
1346
|
+
hash?: string | undefined;
|
|
1347
|
+
error?: string | undefined;
|
|
1348
|
+
}, {
|
|
1349
|
+
chain: string;
|
|
1350
|
+
to: string;
|
|
1351
|
+
success: boolean;
|
|
1352
|
+
amount: string;
|
|
1353
|
+
from?: string | undefined;
|
|
1354
|
+
hash?: string | undefined;
|
|
1355
|
+
error?: string | undefined;
|
|
1356
|
+
}>, {
|
|
1357
|
+
[x: string]: never;
|
|
1358
|
+
}>;
|
|
1359
|
+
getBlock: Tool<z.ZodObject<{
|
|
1360
|
+
blockNumber: z.ZodOptional<z.ZodString>;
|
|
1361
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]>>;
|
|
1362
|
+
}, "strip", z.ZodTypeAny, {
|
|
1363
|
+
chain: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base";
|
|
1364
|
+
blockNumber?: string | undefined;
|
|
1365
|
+
}, {
|
|
1366
|
+
chain?: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base" | undefined;
|
|
1367
|
+
blockNumber?: string | undefined;
|
|
1368
|
+
}>, z.ZodObject<{
|
|
1369
|
+
success: z.ZodBoolean;
|
|
1370
|
+
block: z.ZodOptional<z.ZodObject<{
|
|
1371
|
+
number: z.ZodString;
|
|
1372
|
+
hash: z.ZodString;
|
|
1373
|
+
timestamp: z.ZodString;
|
|
1374
|
+
transactionCount: z.ZodNumber;
|
|
1375
|
+
gasUsed: z.ZodString;
|
|
1376
|
+
gasLimit: z.ZodString;
|
|
1377
|
+
}, "strip", z.ZodTypeAny, {
|
|
1378
|
+
number: string;
|
|
1379
|
+
hash: string;
|
|
1380
|
+
gasLimit: string;
|
|
1381
|
+
gasUsed: string;
|
|
1382
|
+
timestamp: string;
|
|
1383
|
+
transactionCount: number;
|
|
1384
|
+
}, {
|
|
1385
|
+
number: string;
|
|
1386
|
+
hash: string;
|
|
1387
|
+
gasLimit: string;
|
|
1388
|
+
gasUsed: string;
|
|
1389
|
+
timestamp: string;
|
|
1390
|
+
transactionCount: number;
|
|
1391
|
+
}>>;
|
|
1392
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1393
|
+
}, "strip", z.ZodTypeAny, {
|
|
1394
|
+
success: boolean;
|
|
1395
|
+
block?: {
|
|
1396
|
+
number: string;
|
|
1397
|
+
hash: string;
|
|
1398
|
+
gasLimit: string;
|
|
1399
|
+
gasUsed: string;
|
|
1400
|
+
timestamp: string;
|
|
1401
|
+
transactionCount: number;
|
|
1402
|
+
} | undefined;
|
|
1403
|
+
error?: string | undefined;
|
|
1404
|
+
}, {
|
|
1405
|
+
success: boolean;
|
|
1406
|
+
block?: {
|
|
1407
|
+
number: string;
|
|
1408
|
+
hash: string;
|
|
1409
|
+
gasLimit: string;
|
|
1410
|
+
gasUsed: string;
|
|
1411
|
+
timestamp: string;
|
|
1412
|
+
transactionCount: number;
|
|
1413
|
+
} | undefined;
|
|
1414
|
+
error?: string | undefined;
|
|
1415
|
+
}>, {
|
|
1416
|
+
[x: string]: never;
|
|
1417
|
+
}>;
|
|
1418
|
+
getGasPrice: Tool<z.ZodObject<{
|
|
1419
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]>>;
|
|
1420
|
+
}, "strip", z.ZodTypeAny, {
|
|
1421
|
+
chain: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base";
|
|
1422
|
+
}, {
|
|
1423
|
+
chain?: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base" | undefined;
|
|
1424
|
+
}>, z.ZodObject<{
|
|
1425
|
+
success: z.ZodBoolean;
|
|
1426
|
+
gasPrice: z.ZodOptional<z.ZodString>;
|
|
1427
|
+
gasPriceWei: z.ZodOptional<z.ZodString>;
|
|
1428
|
+
chain: z.ZodString;
|
|
1429
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1430
|
+
}, "strip", z.ZodTypeAny, {
|
|
1431
|
+
chain: string;
|
|
1432
|
+
success: boolean;
|
|
1433
|
+
gasPrice?: string | undefined;
|
|
1434
|
+
error?: string | undefined;
|
|
1435
|
+
gasPriceWei?: string | undefined;
|
|
1436
|
+
}, {
|
|
1437
|
+
chain: string;
|
|
1438
|
+
success: boolean;
|
|
1439
|
+
gasPrice?: string | undefined;
|
|
1440
|
+
error?: string | undefined;
|
|
1441
|
+
gasPriceWei?: string | undefined;
|
|
1442
|
+
}>, {
|
|
1443
|
+
[x: string]: never;
|
|
1444
|
+
}>;
|
|
1445
|
+
estimateGas: Tool<z.ZodObject<{
|
|
1446
|
+
to: z.ZodString;
|
|
1447
|
+
amount: z.ZodDefault<z.ZodString>;
|
|
1448
|
+
data: z.ZodOptional<z.ZodString>;
|
|
1449
|
+
chain: z.ZodDefault<z.ZodEnum<["mainnet", "sepolia", "polygon", "arbitrum", "optimism", "base"]>>;
|
|
1450
|
+
}, "strip", z.ZodTypeAny, {
|
|
1451
|
+
chain: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base";
|
|
1452
|
+
to: string;
|
|
1453
|
+
amount: string;
|
|
1454
|
+
data?: string | undefined;
|
|
1455
|
+
}, {
|
|
1456
|
+
to: string;
|
|
1457
|
+
chain?: "mainnet" | "sepolia" | "polygon" | "arbitrum" | "optimism" | "base" | undefined;
|
|
1458
|
+
data?: string | undefined;
|
|
1459
|
+
amount?: string | undefined;
|
|
1460
|
+
}>, z.ZodObject<{
|
|
1461
|
+
success: z.ZodBoolean;
|
|
1462
|
+
gasEstimate: z.ZodOptional<z.ZodString>;
|
|
1463
|
+
to: z.ZodString;
|
|
1464
|
+
amount: z.ZodString;
|
|
1465
|
+
chain: z.ZodString;
|
|
1466
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1467
|
+
}, "strip", z.ZodTypeAny, {
|
|
1468
|
+
chain: string;
|
|
1469
|
+
to: string;
|
|
1470
|
+
success: boolean;
|
|
1471
|
+
amount: string;
|
|
1472
|
+
error?: string | undefined;
|
|
1473
|
+
gasEstimate?: string | undefined;
|
|
1474
|
+
}, {
|
|
1475
|
+
chain: string;
|
|
1476
|
+
to: string;
|
|
1477
|
+
success: boolean;
|
|
1478
|
+
amount: string;
|
|
1479
|
+
error?: string | undefined;
|
|
1480
|
+
gasEstimate?: string | undefined;
|
|
1481
|
+
}>, {
|
|
1482
|
+
[x: string]: never;
|
|
1483
|
+
}>;
|
|
1484
|
+
};
|
|
1485
|
+
|
|
1486
|
+
/**
|
|
1487
|
+
* Send Reaction Tool
|
|
1488
|
+
*
|
|
1489
|
+
* Sends an emoji reaction to a specific message to indicate the message has been seen.
|
|
1490
|
+
* This is used to acknowledge receipt of messages before responding.
|
|
1491
|
+
*
|
|
1492
|
+
* @tool sendReaction
|
|
1493
|
+
* @category Communication
|
|
1494
|
+
*
|
|
1495
|
+
* @param {string} emoji - The emoji to send as a reaction (defaults to 👀)
|
|
1496
|
+
* @param {string} [referenceMessageId] - The message ID to react to (uses current message if not provided)
|
|
1497
|
+
*
|
|
1498
|
+
* @returns {Promise<{success: boolean, emoji: string, error?: string}>}
|
|
1499
|
+
*/
|
|
1500
|
+
declare const sendReactionTool: Tool<z.ZodObject<{
|
|
1501
|
+
emoji: z.ZodDefault<z.ZodString>;
|
|
1502
|
+
referenceMessageId: z.ZodOptional<z.ZodString>;
|
|
1503
|
+
}, "strip", z.ZodTypeAny, {
|
|
1504
|
+
emoji: string;
|
|
1505
|
+
referenceMessageId?: string | undefined;
|
|
1506
|
+
}, {
|
|
1507
|
+
referenceMessageId?: string | undefined;
|
|
1508
|
+
emoji?: string | undefined;
|
|
1509
|
+
}>, z.ZodObject<{
|
|
1510
|
+
success: z.ZodBoolean;
|
|
1511
|
+
emoji: z.ZodString;
|
|
1512
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1513
|
+
}, "strip", z.ZodTypeAny, {
|
|
1514
|
+
emoji: string;
|
|
1515
|
+
success: boolean;
|
|
1516
|
+
error?: string | undefined;
|
|
1517
|
+
}, {
|
|
1518
|
+
emoji: string;
|
|
1519
|
+
success: boolean;
|
|
1520
|
+
error?: string | undefined;
|
|
1521
|
+
}>, {
|
|
1522
|
+
[x: string]: never;
|
|
1523
|
+
}>;
|
|
1524
|
+
/**
|
|
1525
|
+
* Send Message Tool
|
|
1526
|
+
*
|
|
1527
|
+
* Sends a message to an XMTP conversation or creates a new conversation.
|
|
1528
|
+
*
|
|
1529
|
+
* @tool sendMessage
|
|
1530
|
+
* @category Communication
|
|
1531
|
+
*
|
|
1532
|
+
* @param {string} content - The message content to send
|
|
1533
|
+
* @param {string} [recipientAddress] - Recipient address for new conversations
|
|
1534
|
+
* @param {string} [conversationId] - Existing conversation ID to send to
|
|
1535
|
+
*
|
|
1536
|
+
* @returns {Promise<{success: boolean, messageId?: string, conversationId?: string, error?: string}>}
|
|
1537
|
+
*/
|
|
1538
|
+
declare const sendMessageTool: Tool<z.ZodEffects<z.ZodObject<{
|
|
1539
|
+
content: z.ZodString;
|
|
1540
|
+
recipientAddress: z.ZodOptional<z.ZodString>;
|
|
1541
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
1542
|
+
}, "strip", z.ZodTypeAny, {
|
|
1543
|
+
content: string;
|
|
1544
|
+
conversationId?: string | undefined;
|
|
1545
|
+
recipientAddress?: string | undefined;
|
|
1546
|
+
}, {
|
|
1547
|
+
content: string;
|
|
1548
|
+
conversationId?: string | undefined;
|
|
1549
|
+
recipientAddress?: string | undefined;
|
|
1550
|
+
}>, {
|
|
1551
|
+
content: string;
|
|
1552
|
+
conversationId?: string | undefined;
|
|
1553
|
+
recipientAddress?: string | undefined;
|
|
1554
|
+
}, {
|
|
1555
|
+
content: string;
|
|
1556
|
+
conversationId?: string | undefined;
|
|
1557
|
+
recipientAddress?: string | undefined;
|
|
1558
|
+
}>, z.ZodObject<{
|
|
1559
|
+
success: z.ZodBoolean;
|
|
1560
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
1561
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
1562
|
+
content: z.ZodString;
|
|
1563
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1564
|
+
}, "strip", z.ZodTypeAny, {
|
|
1565
|
+
content: string;
|
|
1566
|
+
success: boolean;
|
|
1567
|
+
conversationId?: string | undefined;
|
|
1568
|
+
error?: string | undefined;
|
|
1569
|
+
messageId?: string | undefined;
|
|
1570
|
+
}, {
|
|
1571
|
+
content: string;
|
|
1572
|
+
success: boolean;
|
|
1573
|
+
conversationId?: string | undefined;
|
|
1574
|
+
error?: string | undefined;
|
|
1575
|
+
messageId?: string | undefined;
|
|
1576
|
+
}>, {
|
|
1577
|
+
[x: string]: never;
|
|
1578
|
+
}>;
|
|
1579
|
+
/**
|
|
1580
|
+
* Send Reply Tool
|
|
1581
|
+
*
|
|
1582
|
+
* Sends a reply to a specific message in an XMTP conversation.
|
|
1583
|
+
*
|
|
1584
|
+
* @tool sendReply
|
|
1585
|
+
* @category Communication
|
|
1586
|
+
*
|
|
1587
|
+
* @param {string} content - The reply content to send
|
|
1588
|
+
* @param {string} [replyToMessageId] - Message ID to reply to (uses current message if not provided)
|
|
1589
|
+
*
|
|
1590
|
+
* @returns {Promise<{success: boolean, messageId?: string, replyToMessageId?: string, error?: string}>}
|
|
1591
|
+
*/
|
|
1592
|
+
declare const sendReplyTool: Tool<z.ZodObject<{
|
|
1593
|
+
content: z.ZodString;
|
|
1594
|
+
replyToMessageId: z.ZodOptional<z.ZodString>;
|
|
1595
|
+
}, "strip", z.ZodTypeAny, {
|
|
1596
|
+
content: string;
|
|
1597
|
+
replyToMessageId?: string | undefined;
|
|
1598
|
+
}, {
|
|
1599
|
+
content: string;
|
|
1600
|
+
replyToMessageId?: string | undefined;
|
|
1601
|
+
}>, z.ZodObject<{
|
|
1602
|
+
success: z.ZodBoolean;
|
|
1603
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
1604
|
+
replyToMessageId: z.ZodOptional<z.ZodString>;
|
|
1605
|
+
content: z.ZodString;
|
|
1606
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1607
|
+
}, "strip", z.ZodTypeAny, {
|
|
1608
|
+
content: string;
|
|
1609
|
+
success: boolean;
|
|
1610
|
+
error?: string | undefined;
|
|
1611
|
+
messageId?: string | undefined;
|
|
1612
|
+
replyToMessageId?: string | undefined;
|
|
1613
|
+
}, {
|
|
1614
|
+
content: string;
|
|
1615
|
+
success: boolean;
|
|
1616
|
+
error?: string | undefined;
|
|
1617
|
+
messageId?: string | undefined;
|
|
1618
|
+
replyToMessageId?: string | undefined;
|
|
1619
|
+
}>, {
|
|
1620
|
+
[x: string]: never;
|
|
1621
|
+
}>;
|
|
1622
|
+
/**
|
|
1623
|
+
* Get Message Tool
|
|
1624
|
+
*
|
|
1625
|
+
* Retrieves a specific message by ID from the XMTP service.
|
|
1626
|
+
*
|
|
1627
|
+
* @tool getMessage
|
|
1628
|
+
* @category Communication
|
|
1629
|
+
*
|
|
1630
|
+
* @param {string} messageId - The message ID to retrieve
|
|
1631
|
+
*
|
|
1632
|
+
* @returns {Promise<{success: boolean, message?: object, error?: string}>}
|
|
1633
|
+
*/
|
|
1634
|
+
declare const getMessageTool: Tool<z.ZodObject<{
|
|
1635
|
+
messageId: z.ZodString;
|
|
1636
|
+
}, "strip", z.ZodTypeAny, {
|
|
1637
|
+
messageId: string;
|
|
1638
|
+
}, {
|
|
1639
|
+
messageId: string;
|
|
1640
|
+
}>, z.ZodObject<{
|
|
1641
|
+
success: z.ZodBoolean;
|
|
1642
|
+
message: z.ZodOptional<z.ZodObject<{
|
|
1643
|
+
id: z.ZodString;
|
|
1644
|
+
conversationId: z.ZodString;
|
|
1645
|
+
content: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
1646
|
+
senderInboxId: z.ZodString;
|
|
1647
|
+
sentAt: z.ZodString;
|
|
1648
|
+
contentType: z.ZodOptional<z.ZodObject<{
|
|
1649
|
+
typeId: z.ZodString;
|
|
1650
|
+
authorityId: z.ZodOptional<z.ZodString>;
|
|
1651
|
+
versionMajor: z.ZodOptional<z.ZodNumber>;
|
|
1652
|
+
versionMinor: z.ZodOptional<z.ZodNumber>;
|
|
1653
|
+
}, "strip", z.ZodTypeAny, {
|
|
1654
|
+
typeId: string;
|
|
1655
|
+
authorityId?: string | undefined;
|
|
1656
|
+
versionMajor?: number | undefined;
|
|
1657
|
+
versionMinor?: number | undefined;
|
|
1658
|
+
}, {
|
|
1659
|
+
typeId: string;
|
|
1660
|
+
authorityId?: string | undefined;
|
|
1661
|
+
versionMajor?: number | undefined;
|
|
1662
|
+
versionMinor?: number | undefined;
|
|
1663
|
+
}>>;
|
|
1664
|
+
}, "strip", z.ZodTypeAny, {
|
|
1665
|
+
conversationId: string;
|
|
1666
|
+
content: string | Record<string, unknown>;
|
|
1667
|
+
id: string;
|
|
1668
|
+
senderInboxId: string;
|
|
1669
|
+
sentAt: string;
|
|
1670
|
+
contentType?: {
|
|
1671
|
+
typeId: string;
|
|
1672
|
+
authorityId?: string | undefined;
|
|
1673
|
+
versionMajor?: number | undefined;
|
|
1674
|
+
versionMinor?: number | undefined;
|
|
1675
|
+
} | undefined;
|
|
1676
|
+
}, {
|
|
1677
|
+
conversationId: string;
|
|
1678
|
+
content: string | Record<string, unknown>;
|
|
1679
|
+
id: string;
|
|
1680
|
+
senderInboxId: string;
|
|
1681
|
+
sentAt: string;
|
|
1682
|
+
contentType?: {
|
|
1683
|
+
typeId: string;
|
|
1684
|
+
authorityId?: string | undefined;
|
|
1685
|
+
versionMajor?: number | undefined;
|
|
1686
|
+
versionMinor?: number | undefined;
|
|
1687
|
+
} | undefined;
|
|
1688
|
+
}>>;
|
|
1689
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1690
|
+
}, "strip", z.ZodTypeAny, {
|
|
1691
|
+
success: boolean;
|
|
1692
|
+
message?: {
|
|
1693
|
+
conversationId: string;
|
|
1694
|
+
content: string | Record<string, unknown>;
|
|
1695
|
+
id: string;
|
|
1696
|
+
senderInboxId: string;
|
|
1697
|
+
sentAt: string;
|
|
1698
|
+
contentType?: {
|
|
1699
|
+
typeId: string;
|
|
1700
|
+
authorityId?: string | undefined;
|
|
1701
|
+
versionMajor?: number | undefined;
|
|
1702
|
+
versionMinor?: number | undefined;
|
|
1703
|
+
} | undefined;
|
|
1704
|
+
} | undefined;
|
|
1705
|
+
error?: string | undefined;
|
|
1706
|
+
}, {
|
|
1707
|
+
success: boolean;
|
|
1708
|
+
message?: {
|
|
1709
|
+
conversationId: string;
|
|
1710
|
+
content: string | Record<string, unknown>;
|
|
1711
|
+
id: string;
|
|
1712
|
+
senderInboxId: string;
|
|
1713
|
+
sentAt: string;
|
|
1714
|
+
contentType?: {
|
|
1715
|
+
typeId: string;
|
|
1716
|
+
authorityId?: string | undefined;
|
|
1717
|
+
versionMajor?: number | undefined;
|
|
1718
|
+
versionMinor?: number | undefined;
|
|
1719
|
+
} | undefined;
|
|
1720
|
+
} | undefined;
|
|
1721
|
+
error?: string | undefined;
|
|
1722
|
+
}>, {
|
|
1723
|
+
[x: string]: never;
|
|
1724
|
+
}>;
|
|
1725
|
+
/**
|
|
1726
|
+
* Collection of XMTP communication tools for crypto agents
|
|
1727
|
+
*
|
|
1728
|
+
* These tools provide comprehensive messaging capabilities including sending messages,
|
|
1729
|
+
* replies, reactions, and retrieving message information.
|
|
1730
|
+
*
|
|
1731
|
+
* @namespace xmtpTools
|
|
1732
|
+
*
|
|
1733
|
+
* @property {Tool} sendMessage - Send a message to an XMTP conversation
|
|
1734
|
+
* @property {Tool} sendReply - Send a reply to a specific message
|
|
1735
|
+
* @property {Tool} sendReaction - Send an emoji reaction to a message
|
|
1736
|
+
* @property {Tool} getMessage - Get a specific message by ID
|
|
1737
|
+
*/
|
|
1738
|
+
declare const xmtpTools: {
|
|
1739
|
+
sendMessage: Tool<z.ZodEffects<z.ZodObject<{
|
|
1740
|
+
content: z.ZodString;
|
|
1741
|
+
recipientAddress: z.ZodOptional<z.ZodString>;
|
|
1742
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
1743
|
+
}, "strip", z.ZodTypeAny, {
|
|
1744
|
+
content: string;
|
|
1745
|
+
conversationId?: string | undefined;
|
|
1746
|
+
recipientAddress?: string | undefined;
|
|
1747
|
+
}, {
|
|
1748
|
+
content: string;
|
|
1749
|
+
conversationId?: string | undefined;
|
|
1750
|
+
recipientAddress?: string | undefined;
|
|
1751
|
+
}>, {
|
|
1752
|
+
content: string;
|
|
1753
|
+
conversationId?: string | undefined;
|
|
1754
|
+
recipientAddress?: string | undefined;
|
|
1755
|
+
}, {
|
|
1756
|
+
content: string;
|
|
1757
|
+
conversationId?: string | undefined;
|
|
1758
|
+
recipientAddress?: string | undefined;
|
|
1759
|
+
}>, z.ZodObject<{
|
|
1760
|
+
success: z.ZodBoolean;
|
|
1761
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
1762
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
1763
|
+
content: z.ZodString;
|
|
1764
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1765
|
+
}, "strip", z.ZodTypeAny, {
|
|
1766
|
+
content: string;
|
|
1767
|
+
success: boolean;
|
|
1768
|
+
conversationId?: string | undefined;
|
|
1769
|
+
error?: string | undefined;
|
|
1770
|
+
messageId?: string | undefined;
|
|
1771
|
+
}, {
|
|
1772
|
+
content: string;
|
|
1773
|
+
success: boolean;
|
|
1774
|
+
conversationId?: string | undefined;
|
|
1775
|
+
error?: string | undefined;
|
|
1776
|
+
messageId?: string | undefined;
|
|
1777
|
+
}>, {
|
|
1778
|
+
[x: string]: never;
|
|
1779
|
+
}>;
|
|
1780
|
+
sendReply: Tool<z.ZodObject<{
|
|
1781
|
+
content: z.ZodString;
|
|
1782
|
+
replyToMessageId: z.ZodOptional<z.ZodString>;
|
|
1783
|
+
}, "strip", z.ZodTypeAny, {
|
|
1784
|
+
content: string;
|
|
1785
|
+
replyToMessageId?: string | undefined;
|
|
1786
|
+
}, {
|
|
1787
|
+
content: string;
|
|
1788
|
+
replyToMessageId?: string | undefined;
|
|
1789
|
+
}>, z.ZodObject<{
|
|
1790
|
+
success: z.ZodBoolean;
|
|
1791
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
1792
|
+
replyToMessageId: z.ZodOptional<z.ZodString>;
|
|
1793
|
+
content: z.ZodString;
|
|
1794
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1795
|
+
}, "strip", z.ZodTypeAny, {
|
|
1796
|
+
content: string;
|
|
1797
|
+
success: boolean;
|
|
1798
|
+
error?: string | undefined;
|
|
1799
|
+
messageId?: string | undefined;
|
|
1800
|
+
replyToMessageId?: string | undefined;
|
|
1801
|
+
}, {
|
|
1802
|
+
content: string;
|
|
1803
|
+
success: boolean;
|
|
1804
|
+
error?: string | undefined;
|
|
1805
|
+
messageId?: string | undefined;
|
|
1806
|
+
replyToMessageId?: string | undefined;
|
|
1807
|
+
}>, {
|
|
1808
|
+
[x: string]: never;
|
|
1809
|
+
}>;
|
|
1810
|
+
sendReaction: Tool<z.ZodObject<{
|
|
1811
|
+
emoji: z.ZodDefault<z.ZodString>;
|
|
1812
|
+
referenceMessageId: z.ZodOptional<z.ZodString>;
|
|
1813
|
+
}, "strip", z.ZodTypeAny, {
|
|
1814
|
+
emoji: string;
|
|
1815
|
+
referenceMessageId?: string | undefined;
|
|
1816
|
+
}, {
|
|
1817
|
+
referenceMessageId?: string | undefined;
|
|
1818
|
+
emoji?: string | undefined;
|
|
1819
|
+
}>, z.ZodObject<{
|
|
1820
|
+
success: z.ZodBoolean;
|
|
1821
|
+
emoji: z.ZodString;
|
|
1822
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1823
|
+
}, "strip", z.ZodTypeAny, {
|
|
1824
|
+
emoji: string;
|
|
1825
|
+
success: boolean;
|
|
1826
|
+
error?: string | undefined;
|
|
1827
|
+
}, {
|
|
1828
|
+
emoji: string;
|
|
1829
|
+
success: boolean;
|
|
1830
|
+
error?: string | undefined;
|
|
1831
|
+
}>, {
|
|
1832
|
+
[x: string]: never;
|
|
1833
|
+
}>;
|
|
1834
|
+
getMessage: Tool<z.ZodObject<{
|
|
1835
|
+
messageId: z.ZodString;
|
|
1836
|
+
}, "strip", z.ZodTypeAny, {
|
|
1837
|
+
messageId: string;
|
|
1838
|
+
}, {
|
|
1839
|
+
messageId: string;
|
|
1840
|
+
}>, z.ZodObject<{
|
|
1841
|
+
success: z.ZodBoolean;
|
|
1842
|
+
message: z.ZodOptional<z.ZodObject<{
|
|
1843
|
+
id: z.ZodString;
|
|
1844
|
+
conversationId: z.ZodString;
|
|
1845
|
+
content: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
1846
|
+
senderInboxId: z.ZodString;
|
|
1847
|
+
sentAt: z.ZodString;
|
|
1848
|
+
contentType: z.ZodOptional<z.ZodObject<{
|
|
1849
|
+
typeId: z.ZodString;
|
|
1850
|
+
authorityId: z.ZodOptional<z.ZodString>;
|
|
1851
|
+
versionMajor: z.ZodOptional<z.ZodNumber>;
|
|
1852
|
+
versionMinor: z.ZodOptional<z.ZodNumber>;
|
|
1853
|
+
}, "strip", z.ZodTypeAny, {
|
|
1854
|
+
typeId: string;
|
|
1855
|
+
authorityId?: string | undefined;
|
|
1856
|
+
versionMajor?: number | undefined;
|
|
1857
|
+
versionMinor?: number | undefined;
|
|
1858
|
+
}, {
|
|
1859
|
+
typeId: string;
|
|
1860
|
+
authorityId?: string | undefined;
|
|
1861
|
+
versionMajor?: number | undefined;
|
|
1862
|
+
versionMinor?: number | undefined;
|
|
1863
|
+
}>>;
|
|
1864
|
+
}, "strip", z.ZodTypeAny, {
|
|
1865
|
+
conversationId: string;
|
|
1866
|
+
content: string | Record<string, unknown>;
|
|
1867
|
+
id: string;
|
|
1868
|
+
senderInboxId: string;
|
|
1869
|
+
sentAt: string;
|
|
1870
|
+
contentType?: {
|
|
1871
|
+
typeId: string;
|
|
1872
|
+
authorityId?: string | undefined;
|
|
1873
|
+
versionMajor?: number | undefined;
|
|
1874
|
+
versionMinor?: number | undefined;
|
|
1875
|
+
} | undefined;
|
|
1876
|
+
}, {
|
|
1877
|
+
conversationId: string;
|
|
1878
|
+
content: string | Record<string, unknown>;
|
|
1879
|
+
id: string;
|
|
1880
|
+
senderInboxId: string;
|
|
1881
|
+
sentAt: string;
|
|
1882
|
+
contentType?: {
|
|
1883
|
+
typeId: string;
|
|
1884
|
+
authorityId?: string | undefined;
|
|
1885
|
+
versionMajor?: number | undefined;
|
|
1886
|
+
versionMinor?: number | undefined;
|
|
1887
|
+
} | undefined;
|
|
1888
|
+
}>>;
|
|
1889
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1890
|
+
}, "strip", z.ZodTypeAny, {
|
|
1891
|
+
success: boolean;
|
|
1892
|
+
message?: {
|
|
1893
|
+
conversationId: string;
|
|
1894
|
+
content: string | Record<string, unknown>;
|
|
1895
|
+
id: string;
|
|
1896
|
+
senderInboxId: string;
|
|
1897
|
+
sentAt: string;
|
|
1898
|
+
contentType?: {
|
|
1899
|
+
typeId: string;
|
|
1900
|
+
authorityId?: string | undefined;
|
|
1901
|
+
versionMajor?: number | undefined;
|
|
1902
|
+
versionMinor?: number | undefined;
|
|
1903
|
+
} | undefined;
|
|
1904
|
+
} | undefined;
|
|
1905
|
+
error?: string | undefined;
|
|
1906
|
+
}, {
|
|
1907
|
+
success: boolean;
|
|
1908
|
+
message?: {
|
|
1909
|
+
conversationId: string;
|
|
1910
|
+
content: string | Record<string, unknown>;
|
|
1911
|
+
id: string;
|
|
1912
|
+
senderInboxId: string;
|
|
1913
|
+
sentAt: string;
|
|
1914
|
+
contentType?: {
|
|
1915
|
+
typeId: string;
|
|
1916
|
+
authorityId?: string | undefined;
|
|
1917
|
+
versionMajor?: number | undefined;
|
|
1918
|
+
versionMinor?: number | undefined;
|
|
1919
|
+
} | undefined;
|
|
1920
|
+
} | undefined;
|
|
1921
|
+
error?: string | undefined;
|
|
1922
|
+
}>, {
|
|
1923
|
+
[x: string]: never;
|
|
1924
|
+
}>;
|
|
1925
|
+
};
|
|
1926
|
+
|
|
1927
|
+
export { type AgentRuntime as A, type BaseRuntime as B, type Tool as T, type XmtpCredentials as X, type ToolConfig as a, blockchainTools as b, createTool as c, getBlockTool as d, estimateGasTool as e, getGasPriceTool as f, getBalanceTool as g, getTransactionTool as h, type BlockchainRuntimeExtension as i, getMessageTool as j, sendMessageTool as k, sendReactionTool as l, sendReplyTool as m, sendTransactionTool as s, toolFactory as t, xmtpTools as x };
|