@truecarry/mcp 0.1.3 → 0.1.5
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/cli.js +654 -1579
- package/dist/factory.d.ts +35 -21
- package/dist/factory.d.ts.map +1 -1
- package/dist/index.cjs +781 -4180
- package/dist/index.d.ts +5 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +781 -4167
- package/dist/services/McpWalletService.d.ts +74 -133
- package/dist/services/McpWalletService.d.ts.map +1 -1
- package/dist/tools/balance-tools.d.ts +61 -0
- package/dist/tools/balance-tools.d.ts.map +1 -0
- package/dist/tools/index.d.ts +5 -7
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/known-jettons-tools.d.ts +44 -0
- package/dist/tools/known-jettons-tools.d.ts.map +1 -0
- package/dist/tools/nft-tools.d.ts +85 -0
- package/dist/tools/nft-tools.d.ts.map +1 -0
- package/dist/tools/swap-tools.d.ts +49 -0
- package/dist/tools/swap-tools.d.ts.map +1 -0
- package/dist/tools/transfer-tools.d.ts +159 -0
- package/dist/tools/transfer-tools.d.ts.map +1 -0
- package/dist/tools/types.d.ts +21 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/types/config.d.ts +12 -36
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -4
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/adapters/InMemoryStorageAdapter.d.ts +0 -49
- package/dist/adapters/InMemoryStorageAdapter.d.ts.map +0 -1
- package/dist/adapters/LocalSignerAdapter.d.ts +0 -107
- package/dist/adapters/LocalSignerAdapter.d.ts.map +0 -1
- package/dist/adapters/SqliteSignerAdapter.d.ts +0 -119
- package/dist/adapters/SqliteSignerAdapter.d.ts.map +0 -1
- package/dist/adapters/SqliteStorageAdapter.d.ts +0 -81
- package/dist/adapters/SqliteStorageAdapter.d.ts.map +0 -1
- package/dist/adapters/TelegramUserContextProvider.d.ts +0 -70
- package/dist/adapters/TelegramUserContextProvider.d.ts.map +0 -1
- package/dist/adapters/index.d.ts +0 -19
- package/dist/adapters/index.d.ts.map +0 -1
- package/dist/core/LimitsManager.d.ts +0 -59
- package/dist/core/LimitsManager.d.ts.map +0 -1
- package/dist/core/PendingTransactionManager.d.ts +0 -122
- package/dist/core/PendingTransactionManager.d.ts.map +0 -1
- package/dist/core/UserScopedSigner.d.ts +0 -96
- package/dist/core/UserScopedSigner.d.ts.map +0 -1
- package/dist/core/UserScopedStorage.d.ts +0 -59
- package/dist/core/UserScopedStorage.d.ts.map +0 -1
- package/dist/core/index.d.ts +0 -15
- package/dist/core/index.d.ts.map +0 -1
- package/dist/services/WalletService.d.ts +0 -144
- package/dist/services/WalletService.d.ts.map +0 -1
- package/dist/storage/SecureStorage.d.ts +0 -79
- package/dist/storage/SecureStorage.d.ts.map +0 -1
- package/dist/tools/balance.d.ts +0 -167
- package/dist/tools/balance.d.ts.map +0 -1
- package/dist/tools/mcp-tools.d.ts +0 -439
- package/dist/tools/mcp-tools.d.ts.map +0 -1
- package/dist/tools/swap.d.ts +0 -110
- package/dist/tools/swap.d.ts.map +0 -1
- package/dist/tools/transfer.d.ts +0 -146
- package/dist/tools/transfer.d.ts.map +0 -1
- package/dist/tools/wallet.d.ts +0 -138
- package/dist/tools/wallet.d.ts.map +0 -1
- package/dist/types/signer.d.ts +0 -120
- package/dist/types/signer.d.ts.map +0 -1
- package/dist/types/storage.d.ts +0 -41
- package/dist/types/storage.d.ts.map +0 -1
- package/dist/types/user-context.d.ts +0 -48
- package/dist/types/user-context.d.ts.map +0 -1
|
@@ -5,42 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import type {
|
|
9
|
-
import type { LimitsConfig } from '../types/config.js';
|
|
10
|
-
import type { IStorageAdapter } from '../types/storage.js';
|
|
11
|
-
import type { ISignerAdapter } from '../types/signer.js';
|
|
8
|
+
import type { WalletAdapter } from '@ton/walletkit';
|
|
12
9
|
import type { IContactResolver } from '../types/contacts.js';
|
|
13
|
-
import { UserScopedStorage } from '../core/UserScopedStorage.js';
|
|
14
|
-
import { UserScopedSigner } from '../core/UserScopedSigner.js';
|
|
15
|
-
import { LimitsManager } from '../core/LimitsManager.js';
|
|
16
|
-
import { PendingTransactionManager } from '../core/PendingTransactionManager.js';
|
|
17
|
-
import type { PendingTransaction } from '../core/PendingTransactionManager.js';
|
|
18
|
-
/**
|
|
19
|
-
* Wallet info returned to tools (no sensitive data)
|
|
20
|
-
*/
|
|
21
|
-
export interface McpWalletInfo {
|
|
22
|
-
name: string;
|
|
23
|
-
address: string;
|
|
24
|
-
network: 'mainnet' | 'testnet';
|
|
25
|
-
version: 'v5r1' | 'v4r2';
|
|
26
|
-
createdAt: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Result of creating a wallet (no mnemonic!)
|
|
30
|
-
*/
|
|
31
|
-
export interface CreateWalletResult {
|
|
32
|
-
name: string;
|
|
33
|
-
address: string;
|
|
34
|
-
network: 'mainnet' | 'testnet';
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Result of importing a wallet
|
|
38
|
-
*/
|
|
39
|
-
export interface ImportWalletResult {
|
|
40
|
-
name: string;
|
|
41
|
-
address: string;
|
|
42
|
-
network: 'mainnet' | 'testnet';
|
|
43
|
-
}
|
|
44
10
|
/**
|
|
45
11
|
* Jetton information
|
|
46
12
|
*/
|
|
@@ -51,6 +17,27 @@ export interface JettonInfoResult {
|
|
|
51
17
|
symbol?: string;
|
|
52
18
|
decimals?: number;
|
|
53
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* NFT information
|
|
22
|
+
*/
|
|
23
|
+
export interface NftInfoResult {
|
|
24
|
+
address: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
image?: string;
|
|
28
|
+
collection?: {
|
|
29
|
+
address: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
};
|
|
32
|
+
attributes?: Array<{
|
|
33
|
+
trait_type?: string;
|
|
34
|
+
value?: string;
|
|
35
|
+
}>;
|
|
36
|
+
ownerAddress?: string;
|
|
37
|
+
isOnSale?: boolean;
|
|
38
|
+
isSoulbound?: boolean;
|
|
39
|
+
saleContractAddress?: string;
|
|
40
|
+
}
|
|
54
41
|
/**
|
|
55
42
|
* Transaction info (from events API)
|
|
56
43
|
*/
|
|
@@ -78,13 +65,11 @@ export interface TransactionInfo {
|
|
|
78
65
|
export interface TransferResult {
|
|
79
66
|
success: boolean;
|
|
80
67
|
message: string;
|
|
81
|
-
pendingTransactionId?: string;
|
|
82
68
|
}
|
|
83
69
|
/**
|
|
84
|
-
* Swap quote result
|
|
70
|
+
* Swap quote result with transaction params
|
|
85
71
|
*/
|
|
86
72
|
export interface SwapQuoteResult {
|
|
87
|
-
quote: SwapQuote;
|
|
88
73
|
fromToken: string;
|
|
89
74
|
toToken: string;
|
|
90
75
|
fromAmount: string;
|
|
@@ -92,14 +77,16 @@ export interface SwapQuoteResult {
|
|
|
92
77
|
minReceived: string;
|
|
93
78
|
provider: string;
|
|
94
79
|
expiresAt?: number;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
80
|
+
/** Raw transaction params ready to send */
|
|
81
|
+
transaction: {
|
|
82
|
+
messages: Array<{
|
|
83
|
+
address: string;
|
|
84
|
+
amount: string;
|
|
85
|
+
stateInit?: string;
|
|
86
|
+
payload?: string;
|
|
87
|
+
}>;
|
|
88
|
+
validUntil?: number;
|
|
89
|
+
};
|
|
103
90
|
}
|
|
104
91
|
/**
|
|
105
92
|
* Network configuration with optional API key
|
|
@@ -112,12 +99,8 @@ export interface NetworkConfig {
|
|
|
112
99
|
* Configuration for McpWalletService
|
|
113
100
|
*/
|
|
114
101
|
export interface McpWalletServiceConfig {
|
|
115
|
-
|
|
116
|
-
signer: ISignerAdapter;
|
|
102
|
+
wallet: WalletAdapter;
|
|
117
103
|
contacts?: IContactResolver;
|
|
118
|
-
defaultNetwork?: 'mainnet' | 'testnet';
|
|
119
|
-
limits?: LimitsConfig;
|
|
120
|
-
requireConfirmation?: boolean;
|
|
121
104
|
/** Network-specific configuration */
|
|
122
105
|
networks?: {
|
|
123
106
|
mainnet?: NetworkConfig;
|
|
@@ -125,126 +108,84 @@ export interface McpWalletServiceConfig {
|
|
|
125
108
|
};
|
|
126
109
|
}
|
|
127
110
|
/**
|
|
128
|
-
* McpWalletService manages wallet operations for
|
|
111
|
+
* McpWalletService manages wallet operations for a single wallet.
|
|
129
112
|
*/
|
|
130
113
|
export declare class McpWalletService {
|
|
131
114
|
private readonly config;
|
|
132
|
-
private readonly
|
|
133
|
-
private readonly pendingManager;
|
|
115
|
+
private readonly wallet;
|
|
134
116
|
private kit;
|
|
135
|
-
private
|
|
136
|
-
|
|
117
|
+
private constructor();
|
|
118
|
+
static create(config: McpWalletServiceConfig): Promise<McpWalletService>;
|
|
137
119
|
/**
|
|
138
|
-
* Get
|
|
120
|
+
* Get wallet address
|
|
139
121
|
*/
|
|
140
|
-
|
|
122
|
+
getAddress(): string;
|
|
141
123
|
/**
|
|
142
|
-
*
|
|
124
|
+
* Get wallet network
|
|
143
125
|
*/
|
|
144
|
-
|
|
126
|
+
getNetwork(): 'mainnet' | 'testnet';
|
|
145
127
|
/**
|
|
146
|
-
*
|
|
128
|
+
* Initialize TonWalletKit (for swap operations)
|
|
147
129
|
*/
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Create user-scoped signer wrapper
|
|
151
|
-
*/
|
|
152
|
-
createUserSigner(userId: string): UserScopedSigner;
|
|
153
|
-
/**
|
|
154
|
-
* Get limits manager
|
|
155
|
-
*/
|
|
156
|
-
getLimitsManager(): LimitsManager;
|
|
157
|
-
/**
|
|
158
|
-
* Get pending transaction manager
|
|
159
|
-
*/
|
|
160
|
-
getPendingManager(): PendingTransactionManager;
|
|
161
|
-
/**
|
|
162
|
-
* Check if confirmation is required
|
|
163
|
-
*/
|
|
164
|
-
requiresConfirmation(): boolean;
|
|
165
|
-
/**
|
|
166
|
-
* Create a new wallet for a user
|
|
167
|
-
*/
|
|
168
|
-
createWallet(userSigner: UserScopedSigner, userStorage: UserScopedStorage, name: string, version?: 'v5r1' | 'v4r2', networkName?: 'mainnet' | 'testnet'): Promise<CreateWalletResult>;
|
|
169
|
-
/**
|
|
170
|
-
* Import a wallet for a user
|
|
171
|
-
*/
|
|
172
|
-
importWallet(userSigner: UserScopedSigner, userStorage: UserScopedStorage, name: string, mnemonic: string[], version?: 'v5r1' | 'v4r2', networkName?: 'mainnet' | 'testnet'): Promise<ImportWalletResult>;
|
|
173
|
-
/**
|
|
174
|
-
* List all wallets for a user
|
|
175
|
-
*/
|
|
176
|
-
listWallets(userSigner: UserScopedSigner): Promise<McpWalletInfo[]>;
|
|
177
|
-
/**
|
|
178
|
-
* Remove a wallet for a user
|
|
179
|
-
*/
|
|
180
|
-
removeWallet(userSigner: UserScopedSigner, userStorage: UserScopedStorage, name: string): Promise<boolean>;
|
|
181
|
-
/**
|
|
182
|
-
* Get or load a wallet for balance/transfer operations
|
|
183
|
-
*/
|
|
184
|
-
private getWalletForOperations;
|
|
130
|
+
private getKit;
|
|
185
131
|
/**
|
|
186
132
|
* Get TON balance
|
|
187
133
|
*/
|
|
188
|
-
getBalance(
|
|
134
|
+
getBalance(): Promise<string>;
|
|
189
135
|
/**
|
|
190
136
|
* Get Jetton balance
|
|
191
137
|
*/
|
|
192
|
-
getJettonBalance(
|
|
138
|
+
getJettonBalance(jettonAddress: string): Promise<string>;
|
|
193
139
|
/**
|
|
194
140
|
* Get all Jettons
|
|
195
141
|
*/
|
|
196
|
-
getJettons(
|
|
197
|
-
/**
|
|
198
|
-
* Get transaction history for a wallet
|
|
199
|
-
*/
|
|
200
|
-
/**
|
|
201
|
-
* Get transaction history using events API (like demo wallet)
|
|
202
|
-
*/
|
|
203
|
-
getTransactions(userSigner: UserScopedSigner, walletName: string, limit?: number): Promise<TransactionInfo[]>;
|
|
204
|
-
/**
|
|
205
|
-
* Send TON (with optional confirmation flow)
|
|
206
|
-
*/
|
|
207
|
-
sendTon(userSigner: UserScopedSigner, userStorage: UserScopedStorage, walletName: string, toAddress: string, amountNano: string, amountTon: string, comment?: string): Promise<TransferResult>;
|
|
208
|
-
/**
|
|
209
|
-
* Execute TON transfer (internal)
|
|
210
|
-
*/
|
|
211
|
-
executeTonTransfer(userSigner: UserScopedSigner, userStorage: UserScopedStorage, walletName: string, toAddress: string, amountNano: string, comment?: string): Promise<TransferResult>;
|
|
142
|
+
getJettons(): Promise<JettonInfoResult[]>;
|
|
212
143
|
/**
|
|
213
|
-
*
|
|
144
|
+
* Get transaction history using events API
|
|
214
145
|
*/
|
|
215
|
-
|
|
146
|
+
getTransactions(limit?: number): Promise<TransactionInfo[]>;
|
|
216
147
|
/**
|
|
217
|
-
*
|
|
148
|
+
* Send TON
|
|
218
149
|
*/
|
|
219
|
-
|
|
150
|
+
sendTon(toAddress: string, amountNano: string, comment?: string): Promise<TransferResult>;
|
|
220
151
|
/**
|
|
221
|
-
*
|
|
152
|
+
* Send Jetton
|
|
222
153
|
*/
|
|
223
|
-
|
|
154
|
+
sendJetton(toAddress: string, jettonAddress: string, amountRaw: string, comment?: string): Promise<TransferResult>;
|
|
224
155
|
/**
|
|
225
|
-
*
|
|
156
|
+
* Send a raw transaction request directly
|
|
226
157
|
*/
|
|
227
|
-
|
|
158
|
+
sendRawTransaction(request: {
|
|
159
|
+
messages: Array<{
|
|
160
|
+
address: string;
|
|
161
|
+
amount: string;
|
|
162
|
+
mode?: number;
|
|
163
|
+
stateInit?: string;
|
|
164
|
+
payload?: string;
|
|
165
|
+
}>;
|
|
166
|
+
validUntil?: number;
|
|
167
|
+
fromAddress?: string;
|
|
168
|
+
}): Promise<TransferResult>;
|
|
228
169
|
/**
|
|
229
|
-
*
|
|
170
|
+
* Get swap quote with transaction params ready to execute
|
|
230
171
|
*/
|
|
231
|
-
|
|
172
|
+
getSwapQuote(fromToken: string, toToken: string, amount: string, slippageBps?: number): Promise<SwapQuoteResult>;
|
|
232
173
|
/**
|
|
233
|
-
*
|
|
174
|
+
* Get all NFTs
|
|
234
175
|
*/
|
|
235
|
-
|
|
176
|
+
getNfts(limit?: number, offset?: number): Promise<NftInfoResult[]>;
|
|
236
177
|
/**
|
|
237
|
-
*
|
|
178
|
+
* Get a specific NFT by address
|
|
238
179
|
*/
|
|
239
|
-
|
|
180
|
+
getNft(nftAddress: string): Promise<NftInfoResult | null>;
|
|
240
181
|
/**
|
|
241
|
-
*
|
|
182
|
+
* Send NFT
|
|
242
183
|
*/
|
|
243
|
-
|
|
184
|
+
sendNft(nftAddress: string, toAddress: string, comment?: string): Promise<TransferResult>;
|
|
244
185
|
/**
|
|
245
186
|
* Resolve contact name to address
|
|
246
187
|
*/
|
|
247
|
-
resolveContact(
|
|
188
|
+
resolveContact(name: string): Promise<string | null>;
|
|
248
189
|
/**
|
|
249
190
|
* Close and cleanup
|
|
250
191
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpWalletService.d.ts","sourceRoot":"","sources":["../../src/services/McpWalletService.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"McpWalletService.d.ts","sourceRoot":"","sources":["../../src/services/McpWalletService.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,OAAO,KAAK,EAKR,aAAa,EAEhB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED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M,GAAE,MAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAyB/E;;OAEG;IACG,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IA6B/D;;OAEG;IACG,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAsB/F;;OAEG;IACG,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAO1D;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAM/B"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import type { McpWalletService } from '../services/McpWalletService.js';
|
|
10
|
+
import type { ToolResponse } from './types.js';
|
|
11
|
+
export declare const getBalanceSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
12
|
+
export declare const getJettonBalanceSchema: z.ZodObject<{
|
|
13
|
+
jettonAddress: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
jettonAddress: string;
|
|
16
|
+
}, {
|
|
17
|
+
jettonAddress: string;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const getJettonsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
20
|
+
export declare const getTransactionsSchema: z.ZodObject<{
|
|
21
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
limit?: number | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
limit?: number | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function createMcpBalanceTools(service: McpWalletService): {
|
|
28
|
+
get_balance: {
|
|
29
|
+
description: string;
|
|
30
|
+
inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
31
|
+
handler: () => Promise<ToolResponse>;
|
|
32
|
+
};
|
|
33
|
+
get_jetton_balance: {
|
|
34
|
+
description: string;
|
|
35
|
+
inputSchema: z.ZodObject<{
|
|
36
|
+
jettonAddress: z.ZodString;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
jettonAddress: string;
|
|
39
|
+
}, {
|
|
40
|
+
jettonAddress: string;
|
|
41
|
+
}>;
|
|
42
|
+
handler: (args: z.infer<typeof getJettonBalanceSchema>) => Promise<ToolResponse>;
|
|
43
|
+
};
|
|
44
|
+
get_jettons: {
|
|
45
|
+
description: string;
|
|
46
|
+
inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
47
|
+
handler: () => Promise<ToolResponse>;
|
|
48
|
+
};
|
|
49
|
+
get_transactions: {
|
|
50
|
+
description: string;
|
|
51
|
+
inputSchema: z.ZodObject<{
|
|
52
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
limit?: number | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
limit?: number | undefined;
|
|
57
|
+
}>;
|
|
58
|
+
handler: (args: z.infer<typeof getTransactionsSchema>) => Promise<ToolResponse>;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=balance-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balance-tools.d.ts","sourceRoot":"","sources":["../../src/tools/balance-tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,eAAO,MAAM,gBAAgB,gDAAe,CAAC;AAE7C,eAAO,MAAM,sBAAsB;;;;;;EAEjC,CAAC;AAEH,eAAO,MAAM,gBAAgB,gDAAe,CAAC;AAE7C,eAAO,MAAM,qBAAqB;;;;;;EAOhC,CAAC;AAEH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,gBAAgB;;;;uBAKhC,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;;wBA0ClB,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,KAAG,OAAO,CAAC,YAAY,CAAC;;;;;uBAwCjE,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;;wBAyClB,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,KAAG,OAAO,CAAC,YAAY,CAAC;;EAyE9F"}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -5,11 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export { createTransferTools } from './transfer.js';
|
|
14
|
-
export { createSwapTools } from './swap.js';
|
|
8
|
+
export { createMcpBalanceTools } from './balance-tools.js';
|
|
9
|
+
export { createMcpTransferTools } from './transfer-tools.js';
|
|
10
|
+
export { createMcpSwapTools } from './swap-tools.js';
|
|
11
|
+
export { createMcpKnownJettonsTools, KNOWN_JETTONS } from './known-jettons-tools.js';
|
|
12
|
+
export { createMcpNftTools } from './nft-tools.js';
|
|
15
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import type { ToolResponse } from './types.js';
|
|
10
|
+
export declare const getKnownJettonsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
11
|
+
export declare const KNOWN_JETTONS: readonly [{
|
|
12
|
+
readonly symbol: "USD₮";
|
|
13
|
+
readonly name: "Tether USD";
|
|
14
|
+
readonly address: "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs";
|
|
15
|
+
readonly decimals: 6;
|
|
16
|
+
}, {
|
|
17
|
+
readonly symbol: "NOT";
|
|
18
|
+
readonly name: "Notcoin";
|
|
19
|
+
readonly address: "EQAvlWFDxGF2lXm67y4yzC17wYKD9A0guwPkMs1gOsM__NOT";
|
|
20
|
+
readonly decimals: 9;
|
|
21
|
+
}, {
|
|
22
|
+
readonly symbol: "DOGS";
|
|
23
|
+
readonly name: "Dogs";
|
|
24
|
+
readonly address: "EQCvxJy4eG8hyHBFsZ7eePxrRsUQSFE_jpptRAYBmcG_DOGS";
|
|
25
|
+
readonly decimals: 9;
|
|
26
|
+
}, {
|
|
27
|
+
readonly symbol: "DUST";
|
|
28
|
+
readonly name: "DeDust";
|
|
29
|
+
readonly address: "EQBlqsm144Dq6SjbPI4jjZvA1hqTIP3CvHovbIfW_t-SCALE";
|
|
30
|
+
readonly decimals: 9;
|
|
31
|
+
}, {
|
|
32
|
+
readonly symbol: "GRAM";
|
|
33
|
+
readonly name: "Gram";
|
|
34
|
+
readonly address: "EQC47093oX5Xhb0xuk2lCr2RhS8rj-vul61u4W2UH5ORmG_O";
|
|
35
|
+
readonly decimals: 9;
|
|
36
|
+
}];
|
|
37
|
+
export declare function createMcpKnownJettonsTools(): {
|
|
38
|
+
get_known_jettons: {
|
|
39
|
+
description: string;
|
|
40
|
+
inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
41
|
+
handler: () => Promise<ToolResponse>;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=known-jettons-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"known-jettons-tools.d.ts","sourceRoot":"","sources":["../../src/tools/known-jettons-tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,eAAO,MAAM,qBAAqB,gDAAe,CAAC;AAElD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;EA+BhB,CAAC;AAEX,wBAAgB,0BAA0B;;;;uBAMX,OAAO,CAAC,YAAY,CAAC;;EAoBnD"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import type { McpWalletService } from '../services/McpWalletService.js';
|
|
10
|
+
import type { ToolResponse } from './types.js';
|
|
11
|
+
export declare const getNftsSchema: z.ZodObject<{
|
|
12
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
limit?: number | undefined;
|
|
16
|
+
offset?: number | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
limit?: number | undefined;
|
|
19
|
+
offset?: number | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const getNftSchema: z.ZodObject<{
|
|
22
|
+
nftAddress: z.ZodString;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
nftAddress: string;
|
|
25
|
+
}, {
|
|
26
|
+
nftAddress: string;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const sendNftSchema: z.ZodObject<{
|
|
29
|
+
nftAddress: z.ZodString;
|
|
30
|
+
toAddress: z.ZodString;
|
|
31
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
toAddress: string;
|
|
34
|
+
nftAddress: string;
|
|
35
|
+
comment?: string | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
toAddress: string;
|
|
38
|
+
nftAddress: string;
|
|
39
|
+
comment?: string | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
export declare function createMcpNftTools(service: McpWalletService): {
|
|
42
|
+
get_nfts: {
|
|
43
|
+
description: string;
|
|
44
|
+
inputSchema: z.ZodObject<{
|
|
45
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
limit?: number | undefined;
|
|
49
|
+
offset?: number | undefined;
|
|
50
|
+
}, {
|
|
51
|
+
limit?: number | undefined;
|
|
52
|
+
offset?: number | undefined;
|
|
53
|
+
}>;
|
|
54
|
+
handler: (args: z.infer<typeof getNftsSchema>) => Promise<ToolResponse>;
|
|
55
|
+
};
|
|
56
|
+
get_nft: {
|
|
57
|
+
description: string;
|
|
58
|
+
inputSchema: z.ZodObject<{
|
|
59
|
+
nftAddress: z.ZodString;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
nftAddress: string;
|
|
62
|
+
}, {
|
|
63
|
+
nftAddress: string;
|
|
64
|
+
}>;
|
|
65
|
+
handler: (args: z.infer<typeof getNftSchema>) => Promise<ToolResponse>;
|
|
66
|
+
};
|
|
67
|
+
send_nft: {
|
|
68
|
+
description: string;
|
|
69
|
+
inputSchema: z.ZodObject<{
|
|
70
|
+
nftAddress: z.ZodString;
|
|
71
|
+
toAddress: z.ZodString;
|
|
72
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
toAddress: string;
|
|
75
|
+
nftAddress: string;
|
|
76
|
+
comment?: string | undefined;
|
|
77
|
+
}, {
|
|
78
|
+
toAddress: string;
|
|
79
|
+
nftAddress: string;
|
|
80
|
+
comment?: string | undefined;
|
|
81
|
+
}>;
|
|
82
|
+
handler: (args: z.infer<typeof sendNftSchema>) => Promise<ToolResponse>;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=nft-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nft-tools.d.ts","sourceRoot":"","sources":["../../src/tools/nft-tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,eAAO,MAAM,aAAa;;;;;;;;;EAGxB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;EAEvB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;EAIxB,CAAC;AAEH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB;;;;;;;;;;;;;wBAMzB,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,KAAG,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;;wBAiDrD,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,KAAG,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;wBAiEpD,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,KAAG,OAAO,CAAC,YAAY,CAAC;;EAuCtF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import type { McpWalletService } from '../services/McpWalletService.js';
|
|
10
|
+
import type { ToolResponse } from './types.js';
|
|
11
|
+
export declare const getSwapQuoteSchema: z.ZodObject<{
|
|
12
|
+
fromToken: z.ZodString;
|
|
13
|
+
toToken: z.ZodString;
|
|
14
|
+
amount: z.ZodString;
|
|
15
|
+
slippageBps: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
fromToken: string;
|
|
18
|
+
toToken: string;
|
|
19
|
+
amount: string;
|
|
20
|
+
slippageBps?: number | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
fromToken: string;
|
|
23
|
+
toToken: string;
|
|
24
|
+
amount: string;
|
|
25
|
+
slippageBps?: number | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function createMcpSwapTools(service: McpWalletService): {
|
|
28
|
+
get_swap_quote: {
|
|
29
|
+
description: string;
|
|
30
|
+
inputSchema: z.ZodObject<{
|
|
31
|
+
fromToken: z.ZodString;
|
|
32
|
+
toToken: z.ZodString;
|
|
33
|
+
amount: z.ZodString;
|
|
34
|
+
slippageBps: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
fromToken: string;
|
|
37
|
+
toToken: string;
|
|
38
|
+
amount: string;
|
|
39
|
+
slippageBps?: number | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
fromToken: string;
|
|
42
|
+
toToken: string;
|
|
43
|
+
amount: string;
|
|
44
|
+
slippageBps?: number | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
handler: (args: z.infer<typeof getSwapQuoteSchema>) => Promise<ToolResponse>;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=swap-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swap-tools.d.ts","sourceRoot":"","sources":["../../src/tools/swap-tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;EAK7B,CAAC;AAEH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB;;;;;;;;;;;;;;;;;;;wBAM1B,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,KAAG,OAAO,CAAC,YAAY,CAAC;;EAqD3F"}
|