@mcp-dockmaster/mcp-cryptowallet-evm 1.0.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/.eslintrc/index.js +12 -0
- package/LICENSE +21 -0
- package/README.md +179 -0
- package/build/handlers/utils.d.ts +29 -0
- package/build/handlers/utils.js +86 -0
- package/build/handlers/utils.js.map +1 -0
- package/build/handlers/wallet.d.ts +36 -0
- package/build/handlers/wallet.js +781 -0
- package/build/handlers/wallet.js.map +1 -0
- package/build/handlers/wallet.types.d.ts +14 -0
- package/build/handlers/wallet.types.js +2 -0
- package/build/handlers/wallet.types.js.map +1 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +32 -0
- package/build/index.js.map +1 -0
- package/build/tools.d.ts +1143 -0
- package/build/tools.js +571 -0
- package/build/tools.js.map +1 -0
- package/build/types.d.ts +20 -0
- package/build/types.js +2 -0
- package/build/types.js.map +1 -0
- package/jest.config.js +17 -0
- package/package.json +48 -0
- package/required-methods.md +53 -0
- package/src/handlers/utils.ts +97 -0
- package/src/handlers/wallet.ts +901 -0
- package/src/handlers/wallet.types.ts +16 -0
- package/src/index.ts +40 -0
- package/src/tools.ts +621 -0
- package/src/types.ts +21 -0
- package/tests/handlers/network.test.ts +73 -0
- package/tests/handlers/provider.test.ts +197 -0
- package/tests/handlers/wallet.test.ts +289 -0
- package/tsconfig.json +17 -0
package/build/tools.js
ADDED
@@ -0,0 +1,571 @@
|
|
1
|
+
import { createWalletHandler, fromPrivateKeyHandler, fromMnemonicHandler, fromEncryptedJsonHandler, encryptWalletHandler, getAddressHandler, getPublicKeyHandler, getPrivateKeyHandler, getBalanceHandler, getChainIdHandler, getGasPriceHandler, getTransactionCountHandler, callHandler, sendTransactionHandler, signTransactionHandler, populateTransactionHandler, signMessageHandler, signTypedDataHandler, verifyMessageHandler, verifyTypedDataHandler, getBlockHandler, getTransactionHandler, getTransactionReceiptHandler, getCodeHandler, getStorageAtHandler, estimateGasHandler, getLogsHandler, getEnsResolverHandler, lookupAddressHandler, resolveNameHandler, getNetworkHandler, getBlockNumberHandler, getFeeDataHandler, createMnemonicPhraseHandler } from "./handlers/wallet.js";
|
2
|
+
export const tools = [
|
3
|
+
// Wallet Creation and Management
|
4
|
+
{
|
5
|
+
name: "wallet_create_random",
|
6
|
+
description: "Create a new wallet with a random private key",
|
7
|
+
inputSchema: {
|
8
|
+
type: "object",
|
9
|
+
properties: {
|
10
|
+
password: { type: "string", description: "Optional password to encrypt the wallet" },
|
11
|
+
path: { type: "string", description: "Optional HD path" },
|
12
|
+
locale: { type: "string", description: "Optional locale for the wordlist" }
|
13
|
+
},
|
14
|
+
required: []
|
15
|
+
}
|
16
|
+
},
|
17
|
+
{
|
18
|
+
name: "wallet_from_private_key",
|
19
|
+
description: "Create a wallet from a private key",
|
20
|
+
inputSchema: {
|
21
|
+
type: "object",
|
22
|
+
properties: {
|
23
|
+
privateKey: { type: "string", description: "The private key" },
|
24
|
+
provider: { type: "string", description: "Optional JSON RPC provider URL" }
|
25
|
+
},
|
26
|
+
required: ["privateKey"]
|
27
|
+
}
|
28
|
+
},
|
29
|
+
{
|
30
|
+
name: "wallet_create_mnemonic_phrase",
|
31
|
+
description: "Create a mnemonic phrase",
|
32
|
+
inputSchema: {
|
33
|
+
type: "object",
|
34
|
+
properties: {
|
35
|
+
length: { type: "number", description: "The length of the mnemonic phrase", enum: [12, 15, 18, 21, 24] },
|
36
|
+
locale: { type: "string", description: "Optional locale for the wordlist" }
|
37
|
+
},
|
38
|
+
required: ["length"]
|
39
|
+
}
|
40
|
+
},
|
41
|
+
{
|
42
|
+
name: "wallet_from_mnemonic",
|
43
|
+
description: "Create a wallet from a mnemonic phrase",
|
44
|
+
inputSchema: {
|
45
|
+
type: "object",
|
46
|
+
properties: {
|
47
|
+
mnemonic: { type: "string", description: "The mnemonic phrase" },
|
48
|
+
path: { type: "string", description: "Optional HD path" },
|
49
|
+
locale: { type: "string", description: "Optional locale for the wordlist" },
|
50
|
+
provider: { type: "string", description: "Optional JSON RPC provider URL" }
|
51
|
+
},
|
52
|
+
required: ["mnemonic"]
|
53
|
+
}
|
54
|
+
},
|
55
|
+
{
|
56
|
+
name: "wallet_from_encrypted_json",
|
57
|
+
description: "Create a wallet by decrypting an encrypted JSON wallet",
|
58
|
+
inputSchema: {
|
59
|
+
type: "object",
|
60
|
+
properties: {
|
61
|
+
json: { type: "string", description: "The encrypted JSON wallet" },
|
62
|
+
password: { type: "string", description: "The password to decrypt the wallet" },
|
63
|
+
provider: { type: "string", description: "Optional JSON RPC provider URL" }
|
64
|
+
},
|
65
|
+
required: ["json", "password"]
|
66
|
+
}
|
67
|
+
},
|
68
|
+
{
|
69
|
+
name: "wallet_encrypt",
|
70
|
+
description: "Encrypt a wallet with a password",
|
71
|
+
inputSchema: {
|
72
|
+
type: "object",
|
73
|
+
properties: {
|
74
|
+
wallet: { type: "string", description: "The wallet to encrypt (private key, mnemonic, or JSON)" },
|
75
|
+
password: { type: "string", description: "The password to encrypt the wallet" },
|
76
|
+
options: {
|
77
|
+
type: "object",
|
78
|
+
description: "Optional encryption options",
|
79
|
+
properties: {
|
80
|
+
scrypt: {
|
81
|
+
type: "object",
|
82
|
+
properties: {
|
83
|
+
N: { type: "number" },
|
84
|
+
r: { type: "number" },
|
85
|
+
p: { type: "number" }
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
90
|
+
},
|
91
|
+
required: ["wallet", "password"]
|
92
|
+
}
|
93
|
+
},
|
94
|
+
// Wallet Properties
|
95
|
+
{
|
96
|
+
name: "wallet_get_address",
|
97
|
+
description: "Get the wallet address",
|
98
|
+
inputSchema: {
|
99
|
+
type: "object",
|
100
|
+
properties: {
|
101
|
+
wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" }
|
102
|
+
},
|
103
|
+
required: ["wallet"]
|
104
|
+
}
|
105
|
+
},
|
106
|
+
{
|
107
|
+
name: "wallet_get_public_key",
|
108
|
+
description: "Get the wallet public key",
|
109
|
+
inputSchema: {
|
110
|
+
type: "object",
|
111
|
+
properties: {
|
112
|
+
wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" }
|
113
|
+
},
|
114
|
+
required: ["wallet"]
|
115
|
+
}
|
116
|
+
},
|
117
|
+
{
|
118
|
+
name: "wallet_get_private_key",
|
119
|
+
description: "Get the wallet private key (with appropriate security warnings)",
|
120
|
+
inputSchema: {
|
121
|
+
type: "object",
|
122
|
+
properties: {
|
123
|
+
wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
|
124
|
+
password: { type: "string", description: "The password to decrypt the wallet if it's encrypted" }
|
125
|
+
},
|
126
|
+
required: ["wallet"]
|
127
|
+
}
|
128
|
+
},
|
129
|
+
// Blockchain Methods
|
130
|
+
{
|
131
|
+
name: "wallet_get_balance",
|
132
|
+
description: "Get the balance of the wallet",
|
133
|
+
inputSchema: {
|
134
|
+
type: "object",
|
135
|
+
properties: {
|
136
|
+
wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
|
137
|
+
provider: { type: "string", description: "Optional JSON RPC provider URL" },
|
138
|
+
blockTag: { type: "string", description: "Optional block tag (latest, pending, etc.)" }
|
139
|
+
},
|
140
|
+
required: ["wallet", "provider"]
|
141
|
+
}
|
142
|
+
},
|
143
|
+
{
|
144
|
+
name: "wallet_get_chain_id",
|
145
|
+
description: "Get the chain ID the wallet is connected to",
|
146
|
+
inputSchema: {
|
147
|
+
type: "object",
|
148
|
+
properties: {
|
149
|
+
wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
|
150
|
+
provider: { type: "string", description: "Optional JSON RPC provider URL" }
|
151
|
+
},
|
152
|
+
required: ["wallet"]
|
153
|
+
}
|
154
|
+
},
|
155
|
+
{
|
156
|
+
name: "wallet_get_gas_price",
|
157
|
+
description: "Get the current gas price",
|
158
|
+
inputSchema: {
|
159
|
+
type: "object",
|
160
|
+
properties: {
|
161
|
+
wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
|
162
|
+
provider: { type: "string", description: "Optional JSON RPC provider URL" }
|
163
|
+
},
|
164
|
+
required: ["wallet"]
|
165
|
+
}
|
166
|
+
},
|
167
|
+
{
|
168
|
+
name: "wallet_get_transaction_count",
|
169
|
+
description: "Get the number of transactions sent from this account (nonce)",
|
170
|
+
inputSchema: {
|
171
|
+
type: "object",
|
172
|
+
properties: {
|
173
|
+
wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
|
174
|
+
provider: { type: "string", description: "Optional JSON RPC provider URL" },
|
175
|
+
blockTag: { type: "string", description: "Optional block tag (latest, pending, etc.)" }
|
176
|
+
},
|
177
|
+
required: ["wallet"]
|
178
|
+
}
|
179
|
+
},
|
180
|
+
{
|
181
|
+
name: "wallet_call",
|
182
|
+
description: "Call a contract method without sending a transaction",
|
183
|
+
inputSchema: {
|
184
|
+
type: "object",
|
185
|
+
properties: {
|
186
|
+
wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
|
187
|
+
provider: { type: "string", description: "Optional JSON RPC provider URL" },
|
188
|
+
transaction: {
|
189
|
+
type: "object",
|
190
|
+
description: "The transaction to call",
|
191
|
+
properties: {
|
192
|
+
to: { type: "string" },
|
193
|
+
from: { type: "string" },
|
194
|
+
data: { type: "string" },
|
195
|
+
value: { type: "string" },
|
196
|
+
gasLimit: { type: "string" },
|
197
|
+
gasPrice: { type: "string" }
|
198
|
+
},
|
199
|
+
required: ["to"]
|
200
|
+
},
|
201
|
+
blockTag: { type: "string", description: "Optional block tag (latest, pending, etc.)" }
|
202
|
+
},
|
203
|
+
required: ["wallet", "transaction"]
|
204
|
+
}
|
205
|
+
},
|
206
|
+
// Transaction Methods
|
207
|
+
{
|
208
|
+
name: "wallet_send_transaction",
|
209
|
+
description: "Send a transaction",
|
210
|
+
inputSchema: {
|
211
|
+
type: "object",
|
212
|
+
properties: {
|
213
|
+
wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
|
214
|
+
provider: { type: "string", description: "Optional JSON RPC provider URL" },
|
215
|
+
transaction: {
|
216
|
+
type: "object",
|
217
|
+
description: "The transaction to send",
|
218
|
+
properties: {
|
219
|
+
to: { type: "string" },
|
220
|
+
from: { type: "string" },
|
221
|
+
data: { type: "string" },
|
222
|
+
value: { type: "string" },
|
223
|
+
gasLimit: { type: "string" },
|
224
|
+
gasPrice: { type: "string" },
|
225
|
+
nonce: { type: "number" },
|
226
|
+
type: { type: "number" },
|
227
|
+
maxFeePerGas: { type: "string" },
|
228
|
+
maxPriorityFeePerGas: { type: "string" }
|
229
|
+
},
|
230
|
+
required: ["to"]
|
231
|
+
}
|
232
|
+
},
|
233
|
+
required: ["wallet", "transaction"]
|
234
|
+
}
|
235
|
+
},
|
236
|
+
{
|
237
|
+
name: "wallet_sign_transaction",
|
238
|
+
description: "Sign a transaction without sending it",
|
239
|
+
inputSchema: {
|
240
|
+
type: "object",
|
241
|
+
properties: {
|
242
|
+
wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
|
243
|
+
provider: { type: "string", description: "Optional JSON RPC provider URL" },
|
244
|
+
transaction: {
|
245
|
+
type: "object",
|
246
|
+
description: "The transaction to sign",
|
247
|
+
properties: {
|
248
|
+
to: { type: "string" },
|
249
|
+
from: { type: "string" },
|
250
|
+
data: { type: "string" },
|
251
|
+
value: { type: "string" },
|
252
|
+
gasLimit: { type: "string" },
|
253
|
+
gasPrice: { type: "string" },
|
254
|
+
nonce: { type: "number" },
|
255
|
+
type: { type: "number" },
|
256
|
+
maxFeePerGas: { type: "string" },
|
257
|
+
maxPriorityFeePerGas: { type: "string" }
|
258
|
+
},
|
259
|
+
required: ["to"]
|
260
|
+
}
|
261
|
+
},
|
262
|
+
required: ["wallet", "transaction"]
|
263
|
+
}
|
264
|
+
},
|
265
|
+
{
|
266
|
+
name: "wallet_populate_transaction",
|
267
|
+
description: "Populate a transaction with missing fields",
|
268
|
+
inputSchema: {
|
269
|
+
type: "object",
|
270
|
+
properties: {
|
271
|
+
wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
|
272
|
+
provider: { type: "string", description: "Optional JSON RPC provider URL" },
|
273
|
+
transaction: {
|
274
|
+
type: "object",
|
275
|
+
description: "The transaction to populate",
|
276
|
+
properties: {
|
277
|
+
to: { type: "string" },
|
278
|
+
from: { type: "string" },
|
279
|
+
data: { type: "string" },
|
280
|
+
value: { type: "string" },
|
281
|
+
gasLimit: { type: "string" },
|
282
|
+
gasPrice: { type: "string" },
|
283
|
+
nonce: { type: "number" },
|
284
|
+
type: { type: "number" },
|
285
|
+
maxFeePerGas: { type: "string" },
|
286
|
+
maxPriorityFeePerGas: { type: "string" }
|
287
|
+
},
|
288
|
+
required: ["to"]
|
289
|
+
}
|
290
|
+
},
|
291
|
+
required: ["wallet", "transaction"]
|
292
|
+
}
|
293
|
+
},
|
294
|
+
// Signing Methods
|
295
|
+
{
|
296
|
+
name: "wallet_sign_message",
|
297
|
+
description: "Sign a message",
|
298
|
+
inputSchema: {
|
299
|
+
type: "object",
|
300
|
+
properties: {
|
301
|
+
wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
|
302
|
+
message: { type: "string", description: "The message to sign" }
|
303
|
+
},
|
304
|
+
required: ["wallet", "message"]
|
305
|
+
}
|
306
|
+
},
|
307
|
+
{
|
308
|
+
name: "wallet_sign_typed_data",
|
309
|
+
description: "Sign typed data (EIP-712)",
|
310
|
+
inputSchema: {
|
311
|
+
type: "object",
|
312
|
+
properties: {
|
313
|
+
wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
|
314
|
+
domain: { type: "object", description: "The domain data" },
|
315
|
+
types: { type: "object", description: "The type definitions" },
|
316
|
+
value: { type: "object", description: "The value to sign" }
|
317
|
+
},
|
318
|
+
required: ["wallet", "domain", "types", "value"]
|
319
|
+
}
|
320
|
+
},
|
321
|
+
{
|
322
|
+
name: "wallet_verify_message",
|
323
|
+
description: "Verify a signed message",
|
324
|
+
inputSchema: {
|
325
|
+
type: "object",
|
326
|
+
properties: {
|
327
|
+
message: { type: "string", description: "The original message" },
|
328
|
+
signature: { type: "string", description: "The signature to verify" },
|
329
|
+
address: { type: "string", description: "The address that supposedly signed the message" }
|
330
|
+
},
|
331
|
+
required: ["message", "signature", "address"]
|
332
|
+
}
|
333
|
+
},
|
334
|
+
{
|
335
|
+
name: "wallet_verify_typed_data",
|
336
|
+
description: "Verify signed typed data",
|
337
|
+
inputSchema: {
|
338
|
+
type: "object",
|
339
|
+
properties: {
|
340
|
+
domain: { type: "object", description: "The domain data" },
|
341
|
+
types: { type: "object", description: "The type definitions" },
|
342
|
+
value: { type: "object", description: "The value that was signed" },
|
343
|
+
signature: { type: "string", description: "The signature to verify" },
|
344
|
+
address: { type: "string", description: "The address that supposedly signed the data" }
|
345
|
+
},
|
346
|
+
required: ["domain", "types", "value", "signature", "address"]
|
347
|
+
}
|
348
|
+
},
|
349
|
+
// Provider Methods
|
350
|
+
{
|
351
|
+
name: "provider_get_block",
|
352
|
+
description: "Get a block by number or hash",
|
353
|
+
inputSchema: {
|
354
|
+
type: "object",
|
355
|
+
properties: {
|
356
|
+
provider: { type: "string", description: "JSON RPC provider URL" },
|
357
|
+
blockHashOrBlockTag: { type: "string", description: "Block hash or block tag (latest, pending, etc.)" },
|
358
|
+
includeTransactions: { type: "boolean", description: "Whether to include full transactions or just hashes" }
|
359
|
+
},
|
360
|
+
required: ["provider", "blockHashOrBlockTag"]
|
361
|
+
}
|
362
|
+
},
|
363
|
+
{
|
364
|
+
name: "provider_get_transaction",
|
365
|
+
description: "Get a transaction by hash",
|
366
|
+
inputSchema: {
|
367
|
+
type: "object",
|
368
|
+
properties: {
|
369
|
+
provider: { type: "string", description: "JSON RPC provider URL" },
|
370
|
+
transactionHash: { type: "string", description: "The transaction hash" }
|
371
|
+
},
|
372
|
+
required: ["provider", "transactionHash"]
|
373
|
+
}
|
374
|
+
},
|
375
|
+
{
|
376
|
+
name: "provider_get_transaction_receipt",
|
377
|
+
description: "Get a transaction receipt",
|
378
|
+
inputSchema: {
|
379
|
+
type: "object",
|
380
|
+
properties: {
|
381
|
+
provider: { type: "string", description: "JSON RPC provider URL" },
|
382
|
+
transactionHash: { type: "string", description: "The transaction hash" }
|
383
|
+
},
|
384
|
+
required: ["provider", "transactionHash"]
|
385
|
+
}
|
386
|
+
},
|
387
|
+
{
|
388
|
+
name: "provider_get_code",
|
389
|
+
description: "Get the code at an address",
|
390
|
+
inputSchema: {
|
391
|
+
type: "object",
|
392
|
+
properties: {
|
393
|
+
provider: { type: "string", description: "JSON RPC provider URL" },
|
394
|
+
address: { type: "string", description: "The address to get code from" },
|
395
|
+
blockTag: { type: "string", description: "Optional block tag (latest, pending, etc.)" }
|
396
|
+
},
|
397
|
+
required: ["provider", "address"]
|
398
|
+
}
|
399
|
+
},
|
400
|
+
{
|
401
|
+
name: "provider_get_storage_at",
|
402
|
+
description: "Get the storage at a position for an address",
|
403
|
+
inputSchema: {
|
404
|
+
type: "object",
|
405
|
+
properties: {
|
406
|
+
provider: { type: "string", description: "JSON RPC provider URL" },
|
407
|
+
address: { type: "string", description: "The address to get storage from" },
|
408
|
+
position: { type: "string", description: "The storage position" },
|
409
|
+
blockTag: { type: "string", description: "Optional block tag (latest, pending, etc.)" }
|
410
|
+
},
|
411
|
+
required: ["provider", "address", "position"]
|
412
|
+
}
|
413
|
+
},
|
414
|
+
{
|
415
|
+
name: "provider_estimate_gas",
|
416
|
+
description: "Estimate the gas required for a transaction",
|
417
|
+
inputSchema: {
|
418
|
+
type: "object",
|
419
|
+
properties: {
|
420
|
+
provider: { type: "string", description: "JSON RPC provider URL" },
|
421
|
+
transaction: {
|
422
|
+
type: "object",
|
423
|
+
description: "The transaction to estimate gas for",
|
424
|
+
properties: {
|
425
|
+
to: { type: "string" },
|
426
|
+
from: { type: "string" },
|
427
|
+
data: { type: "string" },
|
428
|
+
value: { type: "string" }
|
429
|
+
}
|
430
|
+
}
|
431
|
+
},
|
432
|
+
required: ["provider", "transaction"]
|
433
|
+
}
|
434
|
+
},
|
435
|
+
{
|
436
|
+
name: "provider_get_logs",
|
437
|
+
description: "Get logs that match a filter",
|
438
|
+
inputSchema: {
|
439
|
+
type: "object",
|
440
|
+
properties: {
|
441
|
+
provider: { type: "string", description: "JSON RPC provider URL" },
|
442
|
+
filter: {
|
443
|
+
type: "object",
|
444
|
+
description: "The filter to apply",
|
445
|
+
properties: {
|
446
|
+
address: { type: "string" },
|
447
|
+
topics: { type: "array", items: { type: "string" } },
|
448
|
+
fromBlock: { type: "string" },
|
449
|
+
toBlock: { type: "string" }
|
450
|
+
}
|
451
|
+
}
|
452
|
+
},
|
453
|
+
required: ["provider", "filter"]
|
454
|
+
}
|
455
|
+
},
|
456
|
+
{
|
457
|
+
name: "provider_get_ens_resolver",
|
458
|
+
description: "Get the ENS resolver for a name",
|
459
|
+
inputSchema: {
|
460
|
+
type: "object",
|
461
|
+
properties: {
|
462
|
+
provider: { type: "string", description: "JSON RPC provider URL" },
|
463
|
+
name: { type: "string", description: "The ENS name" }
|
464
|
+
},
|
465
|
+
required: ["provider", "name"]
|
466
|
+
}
|
467
|
+
},
|
468
|
+
{
|
469
|
+
name: "provider_lookup_address",
|
470
|
+
description: "Lookup the ENS name for an address",
|
471
|
+
inputSchema: {
|
472
|
+
type: "object",
|
473
|
+
properties: {
|
474
|
+
provider: { type: "string", description: "JSON RPC provider URL" },
|
475
|
+
address: { type: "string", description: "The address to lookup" }
|
476
|
+
},
|
477
|
+
required: ["provider", "address"]
|
478
|
+
}
|
479
|
+
},
|
480
|
+
{
|
481
|
+
name: "provider_resolve_name",
|
482
|
+
description: "Resolve an ENS name to an address",
|
483
|
+
inputSchema: {
|
484
|
+
type: "object",
|
485
|
+
properties: {
|
486
|
+
provider: { type: "string", description: "JSON RPC provider URL" },
|
487
|
+
name: { type: "string", description: "The ENS name to resolve" }
|
488
|
+
},
|
489
|
+
required: ["provider", "name"]
|
490
|
+
}
|
491
|
+
},
|
492
|
+
// Network Methods
|
493
|
+
{
|
494
|
+
name: "network_get_network",
|
495
|
+
description: "Get the current network information",
|
496
|
+
inputSchema: {
|
497
|
+
type: "object",
|
498
|
+
properties: {
|
499
|
+
provider: { type: "string", description: "JSON RPC provider URL" }
|
500
|
+
},
|
501
|
+
required: ["provider"]
|
502
|
+
}
|
503
|
+
},
|
504
|
+
{
|
505
|
+
name: "network_get_block_number",
|
506
|
+
description: "Get the current block number",
|
507
|
+
inputSchema: {
|
508
|
+
type: "object",
|
509
|
+
properties: {
|
510
|
+
provider: { type: "string", description: "JSON RPC provider URL" }
|
511
|
+
},
|
512
|
+
required: ["provider"]
|
513
|
+
}
|
514
|
+
},
|
515
|
+
{
|
516
|
+
name: "network_get_fee_data",
|
517
|
+
description: "Get the current fee data (base fee, max priority fee, etc.)",
|
518
|
+
inputSchema: {
|
519
|
+
type: "object",
|
520
|
+
properties: {
|
521
|
+
provider: { type: "string", description: "JSON RPC provider URL" }
|
522
|
+
},
|
523
|
+
required: ["provider"]
|
524
|
+
}
|
525
|
+
}
|
526
|
+
];
|
527
|
+
export const handlers = {
|
528
|
+
// Wallet Creation and Management
|
529
|
+
"wallet_create_random": createWalletHandler,
|
530
|
+
"wallet_from_private_key": fromPrivateKeyHandler,
|
531
|
+
"wallet_from_mnemonic": fromMnemonicHandler,
|
532
|
+
"wallet_from_encrypted_json": fromEncryptedJsonHandler,
|
533
|
+
"wallet_encrypt": encryptWalletHandler,
|
534
|
+
// Wallet Properties
|
535
|
+
"wallet_get_address": getAddressHandler,
|
536
|
+
"wallet_get_public_key": getPublicKeyHandler,
|
537
|
+
"wallet_get_private_key": getPrivateKeyHandler,
|
538
|
+
// Blockchain Methods
|
539
|
+
"wallet_get_balance": getBalanceHandler,
|
540
|
+
"wallet_get_chain_id": getChainIdHandler,
|
541
|
+
"wallet_get_gas_price": getGasPriceHandler,
|
542
|
+
"wallet_get_transaction_count": getTransactionCountHandler,
|
543
|
+
"wallet_call": callHandler,
|
544
|
+
// Transaction Methods
|
545
|
+
"wallet_send_transaction": sendTransactionHandler,
|
546
|
+
"wallet_sign_transaction": signTransactionHandler,
|
547
|
+
"wallet_populate_transaction": populateTransactionHandler,
|
548
|
+
// Signing Methods
|
549
|
+
"wallet_sign_message": signMessageHandler,
|
550
|
+
"wallet_sign_typed_data": signTypedDataHandler,
|
551
|
+
"wallet_verify_message": verifyMessageHandler,
|
552
|
+
"wallet_verify_typed_data": verifyTypedDataHandler,
|
553
|
+
// Provider Methods
|
554
|
+
"provider_get_block": getBlockHandler,
|
555
|
+
"provider_get_transaction": getTransactionHandler,
|
556
|
+
"provider_get_transaction_receipt": getTransactionReceiptHandler,
|
557
|
+
"provider_get_code": getCodeHandler,
|
558
|
+
"provider_get_storage_at": getStorageAtHandler,
|
559
|
+
"provider_estimate_gas": estimateGasHandler,
|
560
|
+
"provider_get_logs": getLogsHandler,
|
561
|
+
"provider_get_ens_resolver": getEnsResolverHandler,
|
562
|
+
"provider_lookup_address": lookupAddressHandler,
|
563
|
+
"provider_resolve_name": resolveNameHandler,
|
564
|
+
// Network Methods
|
565
|
+
"network_get_network": getNetworkHandler,
|
566
|
+
"network_get_block_number": getBlockNumberHandler,
|
567
|
+
"network_get_fee_data": getFeeDataHandler,
|
568
|
+
// Mnemonic Methods
|
569
|
+
"wallet_create_mnemonic_phrase": createMnemonicPhraseHandler
|
570
|
+
};
|
571
|
+
//# sourceMappingURL=tools.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAC1B,WAAW,EACX,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACt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
+
content: ToolResultContent[];
|
3
|
+
isError?: boolean;
|
4
|
+
toolResult?: T;
|
5
|
+
};
|
6
|
+
export type ToolResultContent = {
|
7
|
+
type: "text";
|
8
|
+
text: string;
|
9
|
+
} | {
|
10
|
+
type: "image";
|
11
|
+
data: string;
|
12
|
+
mimeType: string;
|
13
|
+
} | {
|
14
|
+
type: "resource";
|
15
|
+
resource: {
|
16
|
+
url: string;
|
17
|
+
mimeType: string;
|
18
|
+
text: string;
|
19
|
+
};
|
20
|
+
};
|
package/build/types.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/jest.config.js
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
/** @type {import('ts-jest').JestConfigWithTsJest} */
|
2
|
+
export default {
|
3
|
+
preset: 'ts-jest',
|
4
|
+
testEnvironment: 'node',
|
5
|
+
extensionsToTreatAsEsm: ['.ts'],
|
6
|
+
moduleNameMapper: {
|
7
|
+
'^(\\.{1,2}/.*)\\.js$': '$1',
|
8
|
+
},
|
9
|
+
transform: {
|
10
|
+
'^.+\\.tsx?$': [
|
11
|
+
'ts-jest',
|
12
|
+
{
|
13
|
+
useESM: true,
|
14
|
+
},
|
15
|
+
],
|
16
|
+
},
|
17
|
+
};
|