@ton/mcp 0.1.10

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.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +282 -0
  3. package/dist/cli.d.ts +9 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +89425 -0
  6. package/dist/contracts/w5_ownable/WalletOwnable.d.ts +87 -0
  7. package/dist/contracts/w5_ownable/WalletOwnable.d.ts.map +1 -0
  8. package/dist/contracts/w5_ownable/WalletOwnable.source.d.ts +11 -0
  9. package/dist/contracts/w5_ownable/WalletOwnable.source.d.ts.map +1 -0
  10. package/dist/contracts/w5_ownable/WalletOwnableAdapter.d.ts +111 -0
  11. package/dist/contracts/w5_ownable/WalletOwnableAdapter.d.ts.map +1 -0
  12. package/dist/contracts/w5_ownable/actions.d.ts +43 -0
  13. package/dist/contracts/w5_ownable/actions.d.ts.map +1 -0
  14. package/dist/contracts/w5_ownable/index.d.ts +12 -0
  15. package/dist/contracts/w5_ownable/index.d.ts.map +1 -0
  16. package/dist/factory.d.ts +67 -0
  17. package/dist/factory.d.ts.map +1 -0
  18. package/dist/index.cjs +89134 -0
  19. package/dist/index.d.ts +22 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +89131 -0
  22. package/dist/serverless.cjs +108356 -0
  23. package/dist/serverless.d.ts +38 -0
  24. package/dist/serverless.d.ts.map +1 -0
  25. package/dist/serverless.js +108355 -0
  26. package/dist/services/KeyManager.d.ts +57 -0
  27. package/dist/services/KeyManager.d.ts.map +1 -0
  28. package/dist/services/McpWalletService.d.ts +202 -0
  29. package/dist/services/McpWalletService.d.ts.map +1 -0
  30. package/dist/tools/balance-tools.d.ts +61 -0
  31. package/dist/tools/balance-tools.d.ts.map +1 -0
  32. package/dist/tools/dns-tools.d.ts +49 -0
  33. package/dist/tools/dns-tools.d.ts.map +1 -0
  34. package/dist/tools/index.d.ts +13 -0
  35. package/dist/tools/index.d.ts.map +1 -0
  36. package/dist/tools/known-jettons-tools.d.ts +44 -0
  37. package/dist/tools/known-jettons-tools.d.ts.map +1 -0
  38. package/dist/tools/nft-tools.d.ts +85 -0
  39. package/dist/tools/nft-tools.d.ts.map +1 -0
  40. package/dist/tools/swap-tools.d.ts +49 -0
  41. package/dist/tools/swap-tools.d.ts.map +1 -0
  42. package/dist/tools/transfer-tools.d.ts +159 -0
  43. package/dist/tools/transfer-tools.d.ts.map +1 -0
  44. package/dist/tools/types.d.ts +21 -0
  45. package/dist/tools/types.d.ts.map +1 -0
  46. package/dist/types/config.d.ts +41 -0
  47. package/dist/types/config.d.ts.map +1 -0
  48. package/dist/types/contacts.d.ts +61 -0
  49. package/dist/types/contacts.d.ts.map +1 -0
  50. package/dist/types/index.d.ts +13 -0
  51. package/dist/types/index.d.ts.map +1 -0
  52. package/llms.txt +114 -0
  53. package/package.json +86 -0
  54. package/skills/SKILL.md +67 -0
@@ -0,0 +1,87 @@
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 type { Cell, Contract, Sender, ContractProvider, AccountStatus } from '@ton/core';
9
+ import type { Address } from '@ton/core';
10
+ import { Dictionary } from '@ton/core';
11
+ import type { ApiClient } from '@ton/walletkit';
12
+ export interface WalletOptions {
13
+ code: Cell;
14
+ workchain: number;
15
+ client: ApiClient;
16
+ }
17
+ export type NftItemStorageNotInitialized = {
18
+ itemIndex: bigint;
19
+ collectionAddress: Address;
20
+ };
21
+ export declare function nftItemStorageNotInitializedToCell(config: NftItemStorageNotInitialized): Cell;
22
+ export type WalletOwnableConfig = {
23
+ signatureAllowed: boolean;
24
+ seqno: number;
25
+ walletId: number;
26
+ publicKey: bigint;
27
+ extensions: Dictionary<bigint, boolean>;
28
+ owner: Address;
29
+ nftInfo: NftItemStorageNotInitialized;
30
+ };
31
+ export declare function walletOwnableStateInitToCell(config: WalletOwnableConfig): Cell;
32
+ export declare function walletOwnableConfigToCell(config: WalletOwnableConfig): Cell;
33
+ export declare const Opcodes: {
34
+ action_send_msg: number;
35
+ action_set_code: number;
36
+ action_extended_set_data: number;
37
+ action_extended_add_extension: number;
38
+ action_extended_remove_extension: number;
39
+ action_extended_set_signature_auth_allowed: number;
40
+ auth_extension: number;
41
+ auth_signed: number;
42
+ auth_signed_internal: number;
43
+ internal_request_from_owner: number;
44
+ ask_to_change_ownership: number;
45
+ notification_for_new_owner: number;
46
+ return_excesses_back: number;
47
+ };
48
+ export declare class WalletOwnableId {
49
+ static deserialize(walletId: number): WalletOwnableId;
50
+ readonly subwalletNumber: number;
51
+ readonly serialized: bigint;
52
+ constructor(args?: {
53
+ subwalletNumber?: number;
54
+ });
55
+ }
56
+ export declare class WalletOwnable implements Contract {
57
+ readonly client: ApiClient;
58
+ readonly address: Address;
59
+ readonly init?: {
60
+ code: Cell;
61
+ data: Cell;
62
+ } | undefined;
63
+ private subwalletId;
64
+ constructor(client: ApiClient, address: Address, init?: {
65
+ code: Cell;
66
+ data: Cell;
67
+ } | undefined);
68
+ static createFromAddress(client: ApiClient, address: Address): WalletOwnable;
69
+ static createFromConfig(config: WalletOwnableConfig, options: WalletOptions): WalletOwnable;
70
+ sendInternalSignedMessage(provider: ContractProvider, via: Sender, opts: {
71
+ value: bigint;
72
+ body: Cell;
73
+ }): Promise<void>;
74
+ sendInternalMessageFromExtension(provider: ContractProvider, via: Sender, opts: {
75
+ value: bigint;
76
+ body: Cell;
77
+ }): Promise<void>;
78
+ sendInternal(provider: ContractProvider, via: Sender, opts: Parameters<ContractProvider['internal']>[1]): Promise<void>;
79
+ sendExternalSignedMessage(provider: ContractProvider, body: Cell): Promise<void>;
80
+ sendExternal(provider: ContractProvider, body: Cell): Promise<void>;
81
+ get publicKey(): Promise<bigint>;
82
+ get status(): Promise<AccountStatus>;
83
+ get seqno(): Promise<number>;
84
+ get isSignatureAuthAllowed(): Promise<boolean>;
85
+ get walletId(): WalletOwnableId;
86
+ }
87
+ //# sourceMappingURL=WalletOwnable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WalletOwnable.d.ts","sourceRoot":"","sources":["../../../src/contracts/w5_ownable/WalletOwnable.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACzF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAA8B,UAAU,EAAY,MAAM,WAAW,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,MAAM,4BAA4B,GAAG;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,4BAA4B,GAAG,IAAI,CAE7F;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,4BAA4B,CAAC;CACzC,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAU9E;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAK3E;AAED,eAAO,MAAM,OAAO;;;;;;;;;;;;;;CAmBnB,CAAC;AA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vG,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI;IAIhE,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI;IAIzD,IAAI,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAkB/B;IAED,IAAI,MAAM,IAAI,OAAO,CAAC,aAAa,CAAC,CAEnC;IAED,IAAI,KAAK,oBAaR;IAED,IAAI,sBAAsB,IAAI,OAAO,CAAC,OAAO,CAAC,CAa7C;IAED,IAAI,QAAQ,IAAI,eAAe,CAE9B;CAuCJ"}
@@ -0,0 +1,11 @@
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 { Cell } from '@ton/core';
9
+ export declare const WalletOwnableCodeBoc = "b5ee9c7241021c01000439000114ff00f4a413f4bcf2c80b01020120021b020148030f0202ce040a0397420d72c239b091a748e2331f404f404d20003f003ed44d0810141d721f401fa4830f892c705f2e521587070f002e0d72c22fe61e8a4e302d72c239b4b73a4e30231d72c232bc3a374e30230805080902fe31ed44d0d640d3ff31f404fa48f89222c705f2e19104d33ffa48fa50f401fa0020d749f2e2c423fa4430f2d14df89370f83af8276f10820afaf080a123945331a0a1de246e91319824fa4430f2d14da2e220c2fff2e1922292365be30d206e93135f038e19c8cf8508fa525003fa028210d53276dbcf0b8acb3fc971fb00e206070048c8cf90144e364626cf0b3f17fa52cec9c8cf85085240fa5258fa0271cf0b6accc971fb00012288f90003c8ce13cbfff400fa52cec9ed541900d0d31fd31fd31ff404f404d20003f00326d749810280be925f07e1268308d722078308d723ed44d0d200d31f20d31fd3fff40506f90140ddf910925f0be1036e12b1f2e0845155baf2e0855067baf2e08603f823bcf2e08801a4c8cf83cb1f14cec9ed54027070f002006ad33f31f404f404d20003f003f892fa44f828fa443058bd925f04e0ed44d0810141d721f4058307f40e6fa131925f03e158707ff0020201200b0e01a5091ba48d0c23909c0975ce4c238b8835d2f000bcb824f00a3cb824f5cb081d8790db3cb824f535c2c1c9255cac3cb822644c38b5ce4c00690871c004b98c1b04a101eefcb824c0fb55788063a0c076cf3816e00c0192eda2edfbeb21d72c08148e2efa4830fa44f828fa443058baf2e091ed44d0810141d718f404c8cf8350428307f453f2e08b01c8cef400cec9ed54e30e21d74a935bdb31e101d74cd0010d00eed72c081c8e37fa4830fa44f828fa443058baf2e091ed44d0d200810140d718f40450448307f45bf2e08c2295206ef2d090df02c8ca00cef400cec9ed548e37d72c082493f2c08de121f2e092ed44d001d70a0001d20020810140d721f4055123bdf2e08f22913195016ef2d08ee201c8ca00cec9ed54e200953b51340835d2b0802456f8085bbcb42534fffe923448be4008aebcb82540b4348034c7f4fffd013e9234417232ffc5be94b240f2328033e40000000084b2c7f2ffc4fd003e94b3327b55200201201017020120111402016e12130017adce76a26869a018eb85ffc00017af1df6a268699018eb858fc002014815160017b325fb513434c00c75c2c7e00011b262fb513435c28020020120181a0163b8fcfed44d020d74ac20099d3fffa48d170596d6de1d20031d31f31d31f31d3ff31f40431fa48d4d1d0d3fffa48d17f881481900000019b8be1ed44d0810141d721f405800d6f2208308d722018308d72320d72c239b4b3b74f2e08ad31fd31fd31ff404f404d20003f003ed44d0d200d31f20d31fd3fff4050cf90140ddf910f2e087096e12b1f2e0845144baf2e0855057baf2e08602f823bcf2e088f800a4c8cf83cb1f13cec9ed54f80f597f70f0023cbf4a56";
10
+ export declare const WalletOwnableCodeCell: Cell;
11
+ //# sourceMappingURL=WalletOwnable.source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WalletOwnable.source.d.ts","sourceRoot":"","sources":["../../../src/contracts/w5_ownable/WalletOwnable.source.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,eAAO,MAAM,oBAAoB,upEACunE,CAAC;AAEzpE,eAAO,MAAM,qBAAqB,MAA4D,CAAC"}
@@ -0,0 +1,111 @@
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 { Address, Cell } from '@ton/core';
9
+ import type { ApiClient, WalletAdapter, WalletSigner, Network, PreparedSignData, ProofMessage, TransactionRequest, UserFriendlyAddress, Hex, Base64String, Feature, WalletId } from '@ton/walletkit';
10
+ import { WalletOwnable, WalletOwnableId } from './WalletOwnable.js';
11
+ export declare const defaultWalletOwnableId = 2147483409;
12
+ /**
13
+ * Configuration for creating a WalletOwnable adapter
14
+ */
15
+ export interface WalletOwnableAdapterConfig {
16
+ /** Signer function */
17
+ signer: WalletSigner;
18
+ /** Public key */
19
+ publicKey: Hex;
20
+ /** Wallet ID configuration */
21
+ walletId?: number | bigint;
22
+ /** Shared TON client instance */
23
+ tonClient: ApiClient;
24
+ /** Network */
25
+ network: Network;
26
+ /** Workchain */
27
+ workchain?: number;
28
+ /** NFT owner address */
29
+ owner: Address;
30
+ /** NFT info (itemIndex + collectionAddress) */
31
+ nftInfo: {
32
+ itemIndex: bigint;
33
+ collectionAddress: Address;
34
+ };
35
+ }
36
+ /**
37
+ * WalletOwnable adapter that implements WalletInterface
38
+ * Used when MCP controls a user's wallet with its own keypair
39
+ */
40
+ export declare class WalletOwnableAdapter implements WalletAdapter {
41
+ private signer;
42
+ private config;
43
+ readonly walletContract: WalletOwnable;
44
+ readonly client: ApiClient;
45
+ readonly publicKey: Hex;
46
+ readonly version = "w5_ownable";
47
+ private walletId;
48
+ /**
49
+ * Static factory method to create a WalletOwnableAdapter
50
+ * @param signer - Signer function with publicKey property (from Signer utility)
51
+ * @param options - Configuration options for the wallet
52
+ */
53
+ static create(signer: WalletSigner, options: {
54
+ client: ApiClient;
55
+ network: Network;
56
+ walletId?: number | bigint;
57
+ workchain?: number;
58
+ owner: Address;
59
+ nftInfo: {
60
+ itemIndex: bigint;
61
+ collectionAddress: Address;
62
+ };
63
+ }): Promise<WalletOwnableAdapter>;
64
+ constructor(config: WalletOwnableAdapterConfig);
65
+ getPublicKey(): Hex;
66
+ getClient(): ApiClient;
67
+ /**
68
+ * Sign raw bytes with wallet's private key
69
+ */
70
+ sign(bytes: Iterable<number>): Promise<Hex>;
71
+ getNetwork(): Network;
72
+ /**
73
+ * Get wallet's TON address
74
+ */
75
+ getAddress(options?: {
76
+ testnet?: boolean;
77
+ }): UserFriendlyAddress;
78
+ getWalletId(): WalletId;
79
+ getSignedSendTransaction(input: TransactionRequest, options: {
80
+ fakeSignature: boolean;
81
+ }): Promise<Base64String>;
82
+ /**
83
+ * Get state init for wallet deployment
84
+ */
85
+ getStateInit(): Promise<Base64String>;
86
+ /**
87
+ * Get the underlying WalletOwnable contract
88
+ */
89
+ getContract(): WalletOwnable;
90
+ /**
91
+ * Get current sequence number
92
+ */
93
+ getSeqno(): Promise<number>;
94
+ /**
95
+ * Get wallet ID
96
+ */
97
+ getWalletOwnableId(): Promise<WalletOwnableId>;
98
+ /**
99
+ * Check if wallet is deployed on the network
100
+ */
101
+ isDeployed(): Promise<boolean>;
102
+ createItemInitAtDeployment(): Cell;
103
+ createBody(seqno: number, walletId: bigint, actionsList: Cell, options: {
104
+ validUntil: number | undefined;
105
+ fakeSignature: boolean;
106
+ }): Promise<Cell>;
107
+ getSignedSignData(input: PreparedSignData): Promise<Hex>;
108
+ getSignedTonProof(input: ProofMessage): Promise<Hex>;
109
+ getSupportedFeatures(): Feature[];
110
+ }
111
+ //# sourceMappingURL=WalletOwnableAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WalletOwnableAdapter.d.ts","sourceRoot":"","sources":["../../../src/contracts/w5_ownable/WalletOwnableAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,EAAE,OAAO,EAAa,IAAI,EAAqE,MAAM,WAAW,CAAC;AAExH,OAAO,KAAK,EACR,SAAS,EACT,aAAa,EACb,YAAY,EACZ,OAAO,EAC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oBAAoB,IAAI,OAAO,EAAE;CAYpC"}
@@ -0,0 +1,43 @@
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 type { Address, Cell, MessageRelaxed } from '@ton/core';
9
+ import { SendMode } from '@ton/core';
10
+ export declare class ActionSendMsg {
11
+ readonly mode: SendMode;
12
+ readonly outMsg: MessageRelaxed;
13
+ static readonly tag = 247711853;
14
+ readonly tag = 247711853;
15
+ constructor(mode: SendMode, outMsg: MessageRelaxed);
16
+ serialize(): Cell;
17
+ }
18
+ export declare class ActionAddExtension {
19
+ readonly address: Address;
20
+ static readonly tag = 2;
21
+ readonly tag = 2;
22
+ constructor(address: Address);
23
+ serialize(): Cell;
24
+ }
25
+ export declare class ActionRemoveExtension {
26
+ readonly address: Address;
27
+ static readonly tag = 3;
28
+ readonly tag = 3;
29
+ constructor(address: Address);
30
+ serialize(): Cell;
31
+ }
32
+ export declare class ActionSetSignatureAuthAllowed {
33
+ readonly allowed: boolean;
34
+ static readonly tag = 4;
35
+ readonly tag = 4;
36
+ constructor(allowed: boolean);
37
+ serialize(): Cell;
38
+ }
39
+ export type OutAction = ActionSendMsg;
40
+ export type ExtendedAction = ActionAddExtension | ActionRemoveExtension | ActionSetSignatureAuthAllowed;
41
+ export declare function isExtendedAction(action: OutAction | ExtendedAction): action is ExtendedAction;
42
+ export declare function packActionsList(actions: (OutAction | ExtendedAction)[]): Cell;
43
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/contracts/w5_ownable/actions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAa,QAAQ,EAAuB,MAAM,WAAW,CAAC;AAErE,qBAAa,aAAa;aAMF,IAAI,EAAE,QAAQ;aACd,MAAM,EAAE,cAAc;IAN1C,gBAAuB,GAAG,aAAc;IAExC,SAAgB,GAAG,aAAqB;gBAGpB,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,cAAc;IAGnC,SAAS,IAAI,IAAI;CAO3B;AAED,qBAAa,kBAAkB;aAKC,OAAO,EAAE,OAAO;IAJ5C,gBAAuB,GAAG,KAAQ;IAElC,SAAgB,GAAG,KAA0B;gBAEjB,OAAO,EAAE,OAAO;IAErC,SAAS,IAAI,IAAI;CAG3B;AAED,qBAAa,qBAAqB;aAKF,OAAO,EAAE,OAAO;IAJ5C,gBAAuB,GAAG,KAAQ;IAElC,SAAgB,GAAG,KAA6B;gBAEpB,OAAO,EAAE,OAAO;IAErC,SAAS,IAAI,IAAI;CAG3B;AAED,qBAAa,6BAA6B;aAKV,OAAO,EAAE,OAAO;IAJ5C,gBAAuB,GAAG,KAAQ;IAElC,SAAgB,GAAG,KAAqC;gBAE5B,OAAO,EAAE,OAAO;IAErC,SAAS,IAAI,IAAI;CAM3B;AAED,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC;AACtC,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG,qBAAqB,GAAG,6BAA6B,CAAC;AAExG,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,cAAc,GAAG,MAAM,IAAI,cAAc,CAM7F;AAwDD,wBAAgB,eAAe,CAAC,OAAO,EAAE,CAAC,SAAS,GAAG,cAAc,CAAC,EAAE,GAAG,IAAI,CAE7E"}
@@ -0,0 +1,12 @@
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
+ export * from './WalletOwnable.js';
9
+ export * from './WalletOwnable.source.js';
10
+ export * from './WalletOwnableAdapter.js';
11
+ export * from './actions.js';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contracts/w5_ownable/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,cAAc,CAAC"}
@@ -0,0 +1,67 @@
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
+ /**
9
+ * Factory function for creating configured MCP server instances
10
+ */
11
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
12
+ import type { WalletAdapter } from '@ton/walletkit';
13
+ import type { IContactResolver } from './types/contacts.js';
14
+ import type { NetworkConfig } from './services/McpWalletService.js';
15
+ import { McpWalletService } from './services/McpWalletService.js';
16
+ /**
17
+ * Configuration for createTonWalletMCP factory
18
+ */
19
+ export interface TonMcpFactoryConfig {
20
+ /**
21
+ * Wallet instance to use for operations.
22
+ * Required.
23
+ */
24
+ wallet: WalletAdapter;
25
+ /**
26
+ * Optional contact resolver for name-to-address resolution.
27
+ */
28
+ contacts?: IContactResolver;
29
+ /**
30
+ * Network-specific configuration (API keys).
31
+ */
32
+ networks?: {
33
+ mainnet?: NetworkConfig;
34
+ testnet?: NetworkConfig;
35
+ };
36
+ }
37
+ /**
38
+ * Create a configured TON Wallet MCP server
39
+ *
40
+ * @param config - Configuration with wallet instance
41
+ * @returns Configured McpServer instance
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * import { createTonWalletMCP } from '@ton/mcp';
46
+ * import { Signer, WalletV5R1Adapter, TonWalletKit, Network } from '@ton/walletkit';
47
+ *
48
+ * // Create wallet adapter
49
+ * const kit = new TonWalletKit({ ... });
50
+ * const signer = await Signer.fromMnemonic(mnemonic, { type: 'ton' });
51
+ * const walletAdapter = await WalletV5R1Adapter.create(signer, {
52
+ * client: kit.getApiClient(Network.mainnet()),
53
+ * network: Network.mainnet(),
54
+ * });
55
+ * const wallet = await kit.addWallet(walletAdapter);
56
+ *
57
+ * // Create MCP server
58
+ * const server = createTonWalletMCP({ wallet });
59
+ * ```
60
+ */
61
+ export declare function createTonWalletMCP(config: TonMcpFactoryConfig): Promise<McpServer>;
62
+ /**
63
+ * Get the wallet service shutdown handler
64
+ * Call this to properly cleanup when shutting down
65
+ */
66
+ export declare function createShutdownHandler(walletService: McpWalletService): () => Promise<void>;
67
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAQlE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC;;;OAGG;IACH,MAAM,EAAE,aAAa,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,aAAa,CAAC;QACxB,OAAO,CAAC,EAAE,aAAa,CAAC;KAC3B,CAAC;CACL;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC,CAuDxF;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,gBAAgB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAE1F"}