@openzeppelin/contracts-mcp 0.6.4 → 0.6.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.
Files changed (53) hide show
  1. package/apps/cairo.html +1 -1
  2. package/apps/confidential.html +1 -1
  3. package/apps/solidity.html +2 -2
  4. package/apps/stellar.html +1 -1
  5. package/apps/stylus.html +1 -1
  6. package/apps/tron.html +22 -0
  7. package/apps/uniswap-hooks.html +1 -1
  8. package/dist/apps/register.d.ts +1 -1
  9. package/dist/apps/register.d.ts.map +1 -1
  10. package/dist/apps/register.js +5 -0
  11. package/dist/apps/register.js.map +1 -1
  12. package/dist/cli.js +0 -0
  13. package/dist/index.d.ts +1 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +5 -3
  16. package/dist/index.js.map +1 -1
  17. package/dist/server.d.ts.map +1 -1
  18. package/dist/server.js +4 -2
  19. package/dist/server.js.map +1 -1
  20. package/dist/tron/tools/custom.d.ts +3 -0
  21. package/dist/tron/tools/custom.d.ts.map +1 -0
  22. package/dist/tron/tools/custom.js +26 -0
  23. package/dist/tron/tools/custom.js.map +1 -0
  24. package/dist/tron/tools/erc1155.d.ts +3 -0
  25. package/dist/tron/tools/erc1155.d.ts.map +1 -0
  26. package/dist/tron/tools/erc1155.js +33 -0
  27. package/dist/tron/tools/erc1155.js.map +1 -0
  28. package/dist/tron/tools/erc20.d.ts +3 -0
  29. package/dist/tron/tools/erc20.d.ts.map +1 -0
  30. package/dist/tron/tools/erc20.js +38 -0
  31. package/dist/tron/tools/erc20.js.map +1 -0
  32. package/dist/tron/tools/erc721.d.ts +3 -0
  33. package/dist/tron/tools/erc721.d.ts.map +1 -0
  34. package/dist/tron/tools/erc721.js +37 -0
  35. package/dist/tron/tools/erc721.js.map +1 -0
  36. package/dist/tron/tools/governor.d.ts +3 -0
  37. package/dist/tron/tools/governor.d.ts.map +1 -0
  38. package/dist/tron/tools/governor.js +41 -0
  39. package/dist/tron/tools/governor.js.map +1 -0
  40. package/dist/tron/tools.d.ts +3 -0
  41. package/dist/tron/tools.d.ts.map +1 -0
  42. package/dist/tron/tools.js +21 -0
  43. package/dist/tron/tools.js.map +1 -0
  44. package/package.json +3 -3
  45. package/src/apps/register.ts +7 -1
  46. package/src/index.ts +1 -0
  47. package/src/server.ts +2 -0
  48. package/src/tron/tools/custom.ts +30 -0
  49. package/src/tron/tools/erc1155.ts +50 -0
  50. package/src/tron/tools/erc20.ts +60 -0
  51. package/src/tron/tools/erc721.ts +58 -0
  52. package/src/tron/tools/governor.ts +69 -0
  53. package/src/tron/tools.ts +19 -0
@@ -0,0 +1,60 @@
1
+ import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { ERC20Options } from '@openzeppelin/wizard';
3
+ import { buildGeneric, printContract, tronPrintProfile, sanitizeTronOptions } from '@openzeppelin/wizard';
4
+ import { makeDetailedPrompt } from '../../utils';
5
+ import { solidityERC20Schema } from '@openzeppelin/wizard-common/schemas';
6
+ import { tronPrompts } from '@openzeppelin/wizard-common';
7
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
8
+
9
+ export function registerTronTRC20(server: McpServer): RegisteredTool {
10
+ return registerWizardAppTool(
11
+ server,
12
+ 'tron-trc20',
13
+ {
14
+ description: makeDetailedPrompt(tronPrompts.TRC20),
15
+ inputSchema: solidityERC20Schema,
16
+ title: 'TRON TRC20',
17
+ },
18
+ async ({
19
+ name,
20
+ symbol,
21
+ decimals,
22
+ burnable,
23
+ pausable,
24
+ premint,
25
+ premintChainId,
26
+ mintable,
27
+ callback,
28
+ permit,
29
+ votes,
30
+ flashmint,
31
+ crossChainBridging,
32
+ crossChainLinkAllowOverride,
33
+ access,
34
+ upgradeable,
35
+ info,
36
+ }) => {
37
+ const opts: ERC20Options = {
38
+ name,
39
+ symbol,
40
+ decimals,
41
+ burnable,
42
+ pausable,
43
+ premint,
44
+ premintChainId,
45
+ mintable,
46
+ callback,
47
+ permit,
48
+ votes,
49
+ flashmint,
50
+ crossChainBridging,
51
+ crossChainLinkAllowOverride,
52
+ access,
53
+ upgradeable,
54
+ info,
55
+ };
56
+ const tronOpts = sanitizeTronOptions({ kind: 'ERC20' as const, ...opts });
57
+ return wizardAppPrintResult(tronOpts, () => printContract(buildGeneric(tronOpts), tronPrintProfile), 'solidity');
58
+ },
59
+ );
60
+ }
@@ -0,0 +1,58 @@
1
+ import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { ERC721Options } from '@openzeppelin/wizard';
3
+ import { buildGeneric, printContract, tronPrintProfile, sanitizeTronOptions } from '@openzeppelin/wizard';
4
+ import { makeDetailedPrompt } from '../../utils';
5
+ import { solidityERC721Schema } from '@openzeppelin/wizard-common/schemas';
6
+ import { tronPrompts } from '@openzeppelin/wizard-common';
7
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
8
+
9
+ export function registerTronTRC721(server: McpServer): RegisteredTool {
10
+ return registerWizardAppTool(
11
+ server,
12
+ 'tron-trc721',
13
+ {
14
+ description: makeDetailedPrompt(tronPrompts.TRC721),
15
+ inputSchema: solidityERC721Schema,
16
+ title: 'TRON TRC721',
17
+ },
18
+ async ({
19
+ name,
20
+ symbol,
21
+ baseUri,
22
+ enumerable,
23
+ uriStorage,
24
+ burnable,
25
+ pausable,
26
+ mintable,
27
+ incremental,
28
+ votes,
29
+ crossChainBridging,
30
+ crossChainLinkAllowOverride,
31
+ access,
32
+ upgradeable,
33
+ namespacePrefix,
34
+ info,
35
+ }) => {
36
+ const opts: ERC721Options = {
37
+ name,
38
+ symbol,
39
+ baseUri,
40
+ enumerable,
41
+ uriStorage,
42
+ burnable,
43
+ pausable,
44
+ mintable,
45
+ incremental,
46
+ votes,
47
+ crossChainBridging,
48
+ crossChainLinkAllowOverride,
49
+ access,
50
+ upgradeable,
51
+ namespacePrefix,
52
+ info,
53
+ };
54
+ const tronOpts = sanitizeTronOptions({ kind: 'ERC721' as const, ...opts });
55
+ return wizardAppPrintResult(tronOpts, () => printContract(buildGeneric(tronOpts), tronPrintProfile), 'solidity');
56
+ },
57
+ );
58
+ }
@@ -0,0 +1,69 @@
1
+ import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { GovernorOptions } from '@openzeppelin/wizard';
3
+ import {
4
+ buildGeneric,
5
+ printContract,
6
+ tronPrintProfile,
7
+ TRON_DEFAULT_BLOCK_TIME,
8
+ sanitizeTronOptions,
9
+ } from '@openzeppelin/wizard';
10
+ import { makeDetailedPrompt } from '../../utils';
11
+ import { tronGovernorSchema } from '@openzeppelin/wizard-common/schemas';
12
+ import { tronPrompts } from '@openzeppelin/wizard-common';
13
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
14
+
15
+ export function registerTronGovernor(server: McpServer): RegisteredTool {
16
+ return registerWizardAppTool(
17
+ server,
18
+ 'tron-governor',
19
+ {
20
+ description: makeDetailedPrompt(tronPrompts.Governor),
21
+ inputSchema: tronGovernorSchema,
22
+ title: 'TRON Governor',
23
+ },
24
+ async ({
25
+ name,
26
+ delay,
27
+ period,
28
+ votes,
29
+ clockMode,
30
+ timelock,
31
+ blockTime,
32
+ decimals,
33
+ proposalThreshold,
34
+ quorumMode,
35
+ quorumPercent,
36
+ quorumAbsolute,
37
+ storage,
38
+ settings,
39
+ crossChainExecution,
40
+ upgradeable,
41
+ info,
42
+ }) => {
43
+ const opts: GovernorOptions = {
44
+ name,
45
+ delay,
46
+ period,
47
+ votes,
48
+ clockMode,
49
+ timelock,
50
+ // TRON produces blocks every ~3s (vs ~12s on Ethereum); apply that
51
+ // default when the caller hasn't supplied one so the generated
52
+ // voting delay/period in blocks matches TRON's chain.
53
+ blockTime: blockTime ?? TRON_DEFAULT_BLOCK_TIME,
54
+ decimals,
55
+ proposalThreshold,
56
+ quorumMode,
57
+ quorumPercent,
58
+ quorumAbsolute,
59
+ storage,
60
+ settings,
61
+ crossChainExecution,
62
+ upgradeable,
63
+ info,
64
+ };
65
+ const tronOpts = sanitizeTronOptions({ kind: 'Governor' as const, ...opts });
66
+ return wizardAppPrintResult(tronOpts, () => printContract(buildGeneric(tronOpts), tronPrintProfile), 'solidity');
67
+ },
68
+ );
69
+ }
@@ -0,0 +1,19 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { registerTronTRC20 } from './tools/erc20.js';
3
+ import { registerTronTRC721 } from './tools/erc721.js';
4
+ import { registerTronTRC1155 } from './tools/erc1155.js';
5
+ import { registerTronGovernor } from './tools/governor.js';
6
+ import { registerTronCustom } from './tools/custom.js';
7
+
8
+ // TRON tools reuse the Solidity schemas (options are identical) and render the
9
+ // output through `tronPrintProfile` so token standards become TRC* and imports
10
+ // resolve from `@openzeppelin/tron-contracts`. Excluded on purpose: Account
11
+ // (ERC-4337 EntryPoint out of scope) and Stablecoin / RealWorldAsset (they
12
+ // depend on @openzeppelin/community-contracts, which is not ported to TRON).
13
+ export function registerTronTools(server: McpServer) {
14
+ registerTronTRC20(server);
15
+ registerTronTRC721(server);
16
+ registerTronTRC1155(server);
17
+ registerTronGovernor(server);
18
+ registerTronCustom(server);
19
+ }