@missionsquad/mcp-server-tron 1.2.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/LICENSE +21 -0
- package/README.md +537 -0
- package/bin/cli.js +51 -0
- package/build/core/chains.d.ts +17 -0
- package/build/core/chains.js +87 -0
- package/build/core/chains.js.map +1 -0
- package/build/core/prompts.d.ts +19 -0
- package/build/core/prompts.js +485 -0
- package/build/core/prompts.js.map +1 -0
- package/build/core/resources.d.ts +14 -0
- package/build/core/resources.js +42 -0
- package/build/core/resources.js.map +1 -0
- package/build/core/services/account-data.d.ts +144 -0
- package/build/core/services/account-data.js +228 -0
- package/build/core/services/account-data.js.map +1 -0
- package/build/core/services/account-resource.d.ts +56 -0
- package/build/core/services/account-resource.js +133 -0
- package/build/core/services/account-resource.js.map +1 -0
- package/build/core/services/account.d.ts +141 -0
- package/build/core/services/account.js +191 -0
- package/build/core/services/account.js.map +1 -0
- package/build/core/services/address.d.ts +8 -0
- package/build/core/services/address.js +52 -0
- package/build/core/services/address.js.map +1 -0
- package/build/core/services/agent-wallet.d.ts +62 -0
- package/build/core/services/agent-wallet.js +234 -0
- package/build/core/services/agent-wallet.js.map +1 -0
- package/build/core/services/balance.d.ts +26 -0
- package/build/core/services/balance.js +60 -0
- package/build/core/services/balance.js.map +1 -0
- package/build/core/services/blocks.d.ts +25 -0
- package/build/core/services/blocks.js +65 -0
- package/build/core/services/blocks.js.map +1 -0
- package/build/core/services/broadcast.d.ts +13 -0
- package/build/core/services/broadcast.js +24 -0
- package/build/core/services/broadcast.js.map +1 -0
- package/build/core/services/clients.d.ts +5 -0
- package/build/core/services/clients.js +29 -0
- package/build/core/services/clients.js.map +1 -0
- package/build/core/services/contract-data.d.ts +31 -0
- package/build/core/services/contract-data.js +54 -0
- package/build/core/services/contract-data.js.map +1 -0
- package/build/core/services/contracts.d.ts +108 -0
- package/build/core/services/contracts.js +482 -0
- package/build/core/services/contracts.js.map +1 -0
- package/build/core/services/events.d.ts +56 -0
- package/build/core/services/events.js +99 -0
- package/build/core/services/events.js.map +1 -0
- package/build/core/services/governance.d.ts +78 -0
- package/build/core/services/governance.js +207 -0
- package/build/core/services/governance.js.map +1 -0
- package/build/core/services/index.d.ts +28 -0
- package/build/core/services/index.js +81 -0
- package/build/core/services/index.js.map +1 -0
- package/build/core/services/mempool.d.ts +12 -0
- package/build/core/services/mempool.js +32 -0
- package/build/core/services/mempool.js.map +1 -0
- package/build/core/services/multicall-abi.d.ts +55 -0
- package/build/core/services/multicall-abi.js +61 -0
- package/build/core/services/multicall-abi.js.map +1 -0
- package/build/core/services/nodes.d.ts +8 -0
- package/build/core/services/nodes.js +18 -0
- package/build/core/services/nodes.js.map +1 -0
- package/build/core/services/proposals.d.ts +33 -0
- package/build/core/services/proposals.js +95 -0
- package/build/core/services/proposals.js.map +1 -0
- package/build/core/services/query.d.ts +34 -0
- package/build/core/services/query.js +60 -0
- package/build/core/services/query.js.map +1 -0
- package/build/core/services/staking.d.ts +40 -0
- package/build/core/services/staking.js +113 -0
- package/build/core/services/staking.js.map +1 -0
- package/build/core/services/tokens.d.ts +22 -0
- package/build/core/services/tokens.js +68 -0
- package/build/core/services/tokens.js.map +1 -0
- package/build/core/services/transactions.d.ts +16 -0
- package/build/core/services/transactions.js +42 -0
- package/build/core/services/transactions.js.map +1 -0
- package/build/core/services/transfer.d.ts +24 -0
- package/build/core/services/transfer.js +84 -0
- package/build/core/services/transfer.js.map +1 -0
- package/build/core/services/trongrid-client.d.ts +14 -0
- package/build/core/services/trongrid-client.js +19 -0
- package/build/core/services/trongrid-client.js.map +1 -0
- package/build/core/services/utils.d.ts +13 -0
- package/build/core/services/utils.js +39 -0
- package/build/core/services/utils.js.map +1 -0
- package/build/core/services/wallet.d.ts +13 -0
- package/build/core/services/wallet.js +18 -0
- package/build/core/services/wallet.js.map +1 -0
- package/build/core/tools/account-data.d.ts +2 -0
- package/build/core/tools/account-data.js +253 -0
- package/build/core/tools/account-data.js.map +1 -0
- package/build/core/tools/account-resource.d.ts +2 -0
- package/build/core/tools/account-resource.js +269 -0
- package/build/core/tools/account-resource.js.map +1 -0
- package/build/core/tools/account.d.ts +2 -0
- package/build/core/tools/account.js +451 -0
- package/build/core/tools/account.js.map +1 -0
- package/build/core/tools/address.d.ts +2 -0
- package/build/core/tools/address.js +45 -0
- package/build/core/tools/address.js.map +1 -0
- package/build/core/tools/balance.d.ts +2 -0
- package/build/core/tools/balance.js +94 -0
- package/build/core/tools/balance.js.map +1 -0
- package/build/core/tools/block.d.ts +2 -0
- package/build/core/tools/block.js +74 -0
- package/build/core/tools/block.js.map +1 -0
- package/build/core/tools/broadcast.d.ts +2 -0
- package/build/core/tools/broadcast.js +102 -0
- package/build/core/tools/broadcast.js.map +1 -0
- package/build/core/tools/contract-data.d.ts +2 -0
- package/build/core/tools/contract-data.js +159 -0
- package/build/core/tools/contract-data.js.map +1 -0
- package/build/core/tools/contract.d.ts +2 -0
- package/build/core/tools/contract.js +600 -0
- package/build/core/tools/contract.js.map +1 -0
- package/build/core/tools/event.d.ts +2 -0
- package/build/core/tools/event.js +159 -0
- package/build/core/tools/event.js.map +1 -0
- package/build/core/tools/governance.d.ts +6 -0
- package/build/core/tools/governance.js +424 -0
- package/build/core/tools/governance.js.map +1 -0
- package/build/core/tools/index.d.ts +15 -0
- package/build/core/tools/index.js +93 -0
- package/build/core/tools/index.js.map +1 -0
- package/build/core/tools/mempool.d.ts +2 -0
- package/build/core/tools/mempool.js +116 -0
- package/build/core/tools/mempool.js.map +1 -0
- package/build/core/tools/network.d.ts +2 -0
- package/build/core/tools/network.js +114 -0
- package/build/core/tools/network.js.map +1 -0
- package/build/core/tools/node.d.ts +2 -0
- package/build/core/tools/node.js +75 -0
- package/build/core/tools/node.js.map +1 -0
- package/build/core/tools/proposals.d.ts +6 -0
- package/build/core/tools/proposals.js +219 -0
- package/build/core/tools/proposals.js.map +1 -0
- package/build/core/tools/query.d.ts +2 -0
- package/build/core/tools/query.js +399 -0
- package/build/core/tools/query.js.map +1 -0
- package/build/core/tools/staking.d.ts +2 -0
- package/build/core/tools/staking.js +281 -0
- package/build/core/tools/staking.js.map +1 -0
- package/build/core/tools/transaction.d.ts +2 -0
- package/build/core/tools/transaction.js +65 -0
- package/build/core/tools/transaction.js.map +1 -0
- package/build/core/tools/transfer.d.ts +2 -0
- package/build/core/tools/transfer.js +101 -0
- package/build/core/tools/transfer.js.map +1 -0
- package/build/core/tools/types.d.ts +13 -0
- package/build/core/tools/types.js +2 -0
- package/build/core/tools/types.js.map +1 -0
- package/build/core/tools/wallet.d.ts +2 -0
- package/build/core/tools/wallet.js +172 -0
- package/build/core/tools/wallet.js.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +21 -0
- package/build/index.js.map +1 -0
- package/build/middleware/auth.d.ts +16 -0
- package/build/middleware/auth.js +44 -0
- package/build/middleware/auth.js.map +1 -0
- package/build/oauth/OAuthService.d.ts +100 -0
- package/build/oauth/OAuthService.js +507 -0
- package/build/oauth/OAuthService.js.map +1 -0
- package/build/oauth/page.d.ts +1 -0
- package/build/oauth/page.js +255 -0
- package/build/oauth/page.js.map +1 -0
- package/build/oauth/types.d.ts +65 -0
- package/build/oauth/types.js +2 -0
- package/build/oauth/types.js.map +1 -0
- package/build/server/http-app.d.ts +9 -0
- package/build/server/http-app.js +128 -0
- package/build/server/http-app.js.map +1 -0
- package/build/server/http-server.d.ts +1 -0
- package/build/server/http-server.js +35 -0
- package/build/server/http-server.js.map +1 -0
- package/build/server/oauth-routes.d.ts +7 -0
- package/build/server/oauth-routes.js +157 -0
- package/build/server/oauth-routes.js.map +1 -0
- package/build/server/server.d.ts +9 -0
- package/build/server/server.js +54 -0
- package/build/server/server.js.map +1 -0
- package/build/tenant/TenantManager.d.ts +35 -0
- package/build/tenant/TenantManager.js +167 -0
- package/build/tenant/TenantManager.js.map +1 -0
- package/build/tenant/context.d.ts +11 -0
- package/build/tenant/context.js +23 -0
- package/build/tenant/context.js.map +1 -0
- package/build/tenant/types.d.ts +16 -0
- package/build/tenant/types.js +2 -0
- package/build/tenant/types.js.map +1 -0
- package/package.json +95 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import * as services from "../services/index.js";
|
|
3
|
+
export function registerEventTools(registerTool) {
|
|
4
|
+
registerTool("get_events_by_transaction_id", {
|
|
5
|
+
description: "Get all events emitted by a specific transaction.",
|
|
6
|
+
inputSchema: {
|
|
7
|
+
transactionId: z.string().min(1).describe("The transaction ID (hash) to query events for"),
|
|
8
|
+
onlyConfirmed: z
|
|
9
|
+
.boolean()
|
|
10
|
+
.optional()
|
|
11
|
+
.describe("Only return confirmed events. Defaults to unset (both)."),
|
|
12
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
13
|
+
},
|
|
14
|
+
annotations: {
|
|
15
|
+
title: "Get Events by Transaction ID",
|
|
16
|
+
readOnlyHint: true,
|
|
17
|
+
destructiveHint: false,
|
|
18
|
+
idempotentHint: true,
|
|
19
|
+
openWorldHint: true,
|
|
20
|
+
},
|
|
21
|
+
}, async ({ transactionId, onlyConfirmed, network = "mainnet" }) => {
|
|
22
|
+
try {
|
|
23
|
+
const result = await services.getEventsByTransactionId(transactionId, { onlyConfirmed }, network);
|
|
24
|
+
return {
|
|
25
|
+
content: [
|
|
26
|
+
{ type: "text", text: services.helpers.formatJson(services.formatEventData(result)) },
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
return {
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: "text",
|
|
35
|
+
text: `Error fetching events by transaction: ${error instanceof Error ? error.message : String(error)}`,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
isError: true,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
registerTool("get_events_by_contract_address", {
|
|
43
|
+
description: "Get recent events emitted by a specific contract address.",
|
|
44
|
+
inputSchema: {
|
|
45
|
+
contractAddress: z.string().describe("The contract address (base58 or hex)"),
|
|
46
|
+
eventName: z.string().optional().describe("Filter by event name (e.g. Transfer)"),
|
|
47
|
+
limit: z.number().optional().describe("Max events per page (default 20, max 200)"),
|
|
48
|
+
fingerprint: z.string().optional().describe("Pagination token from previous response"),
|
|
49
|
+
onlyConfirmed: z.boolean().optional().describe("Only return confirmed events"),
|
|
50
|
+
orderBy: z
|
|
51
|
+
.enum(["block_timestamp,desc", "block_timestamp,asc"])
|
|
52
|
+
.optional()
|
|
53
|
+
.describe("Sort order"),
|
|
54
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
55
|
+
},
|
|
56
|
+
annotations: {
|
|
57
|
+
title: "Get Events by Contract Address",
|
|
58
|
+
readOnlyHint: true,
|
|
59
|
+
destructiveHint: false,
|
|
60
|
+
idempotentHint: false,
|
|
61
|
+
openWorldHint: true,
|
|
62
|
+
},
|
|
63
|
+
}, async ({ contractAddress, eventName, limit, fingerprint, onlyConfirmed, orderBy, network = "mainnet", }) => {
|
|
64
|
+
try {
|
|
65
|
+
const result = await services.getEventsByContractAddress(contractAddress, { eventName, limit, fingerprint, onlyConfirmed, orderBy }, network);
|
|
66
|
+
return {
|
|
67
|
+
content: [
|
|
68
|
+
{ type: "text", text: services.helpers.formatJson(services.formatEventData(result)) },
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
return {
|
|
74
|
+
content: [
|
|
75
|
+
{
|
|
76
|
+
type: "text",
|
|
77
|
+
text: `Error fetching events by contract: ${error instanceof Error ? error.message : String(error)}`,
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
isError: true,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
registerTool("get_events_by_block_number", {
|
|
85
|
+
description: "Get events emitted in a specific block. Supports pagination via limit and fingerprint. " +
|
|
86
|
+
"Preferred over get_events_of_latest_block when you need precise block targeting or full event retrieval.",
|
|
87
|
+
inputSchema: {
|
|
88
|
+
blockNumber: z.number().describe("The block number to query events for"),
|
|
89
|
+
onlyConfirmed: z.boolean().optional().describe("Only return confirmed events"),
|
|
90
|
+
limit: z.number().optional().describe("Max events per page (default 20, max 200)"),
|
|
91
|
+
fingerprint: z.string().optional().describe("Pagination token from previous response"),
|
|
92
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
93
|
+
},
|
|
94
|
+
annotations: {
|
|
95
|
+
title: "Get Events by Block Number",
|
|
96
|
+
readOnlyHint: true,
|
|
97
|
+
destructiveHint: false,
|
|
98
|
+
idempotentHint: true,
|
|
99
|
+
openWorldHint: true,
|
|
100
|
+
},
|
|
101
|
+
}, async ({ blockNumber, onlyConfirmed, limit, fingerprint, network = "mainnet" }) => {
|
|
102
|
+
try {
|
|
103
|
+
const result = await services.getEventsByBlockNumber(blockNumber, { onlyConfirmed, limit, fingerprint }, network);
|
|
104
|
+
return {
|
|
105
|
+
content: [
|
|
106
|
+
{ type: "text", text: services.helpers.formatJson(services.formatEventData(result)) },
|
|
107
|
+
],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
return {
|
|
112
|
+
content: [
|
|
113
|
+
{
|
|
114
|
+
type: "text",
|
|
115
|
+
text: `Error fetching events by block: ${error instanceof Error ? error.message : String(error)}`,
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
isError: true,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
registerTool("get_events_of_latest_block", {
|
|
123
|
+
description: "Get events from the most recent block that contains events (skips empty blocks). " +
|
|
124
|
+
"Results may be limited by the API default page size and subject to event indexing lag. " +
|
|
125
|
+
"For precise control, use get_events_by_block_number with a specific block number and limit/fingerprint pagination.",
|
|
126
|
+
inputSchema: {
|
|
127
|
+
onlyConfirmed: z.boolean().optional().describe("Only return confirmed events"),
|
|
128
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
129
|
+
},
|
|
130
|
+
annotations: {
|
|
131
|
+
title: "Get Events of Latest Block",
|
|
132
|
+
readOnlyHint: true,
|
|
133
|
+
destructiveHint: false,
|
|
134
|
+
idempotentHint: false,
|
|
135
|
+
openWorldHint: true,
|
|
136
|
+
},
|
|
137
|
+
}, async ({ onlyConfirmed, network = "mainnet" }) => {
|
|
138
|
+
try {
|
|
139
|
+
const result = await services.getEventsOfLatestBlock({ onlyConfirmed }, network);
|
|
140
|
+
return {
|
|
141
|
+
content: [
|
|
142
|
+
{ type: "text", text: services.helpers.formatJson(services.formatEventData(result)) },
|
|
143
|
+
],
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
return {
|
|
148
|
+
content: [
|
|
149
|
+
{
|
|
150
|
+
type: "text",
|
|
151
|
+
text: `Error fetching events of latest block: ${error instanceof Error ? error.message : String(error)}`,
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
isError: true,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../../src/core/tools/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AAGjD,MAAM,UAAU,kBAAkB,CAAC,YAA4B;IAC7D,YAAY,CACV,8BAA8B,EAC9B;QACE,WAAW,EAAE,mDAAmD;QAChE,WAAW,EAAE;YACX,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,+CAA+C,CAAC;YAC1F,aAAa,EAAE,CAAC;iBACb,OAAO,EAAE;iBACT,QAAQ,EAAE;iBACV,QAAQ,CAAC,yDAAyD,CAAC;YACtE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F,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,0CAA0C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBACzG;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RegisterToolFn } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Register all governance / Super Representative tools.
|
|
4
|
+
* Separated from the main tools file to reduce merge conflicts in multi-developer workflows.
|
|
5
|
+
*/
|
|
6
|
+
export declare function registerGovernanceTools(registerTool: RegisterToolFn): void;
|
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import * as services from "../services/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Register all governance / Super Representative tools.
|
|
5
|
+
* Separated from the main tools file to reduce merge conflicts in multi-developer workflows.
|
|
6
|
+
*/
|
|
7
|
+
export function registerGovernanceTools(registerTool) {
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// GOVERNANCE — SUPER REPRESENTATIVE TOOLS (Read-only)
|
|
10
|
+
// ============================================================================
|
|
11
|
+
registerTool("list_witnesses", {
|
|
12
|
+
description: "Get the full list of all Super Representatives (SR / witnesses) on the network.",
|
|
13
|
+
inputSchema: {
|
|
14
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
15
|
+
},
|
|
16
|
+
annotations: {
|
|
17
|
+
title: "List Super Representatives",
|
|
18
|
+
readOnlyHint: true,
|
|
19
|
+
destructiveHint: false,
|
|
20
|
+
idempotentHint: false,
|
|
21
|
+
openWorldHint: true,
|
|
22
|
+
},
|
|
23
|
+
}, async ({ network = "mainnet" }) => {
|
|
24
|
+
try {
|
|
25
|
+
const witnesses = await services.listWitnesses(network);
|
|
26
|
+
return {
|
|
27
|
+
content: [{ type: "text", text: services.helpers.formatJson(witnesses) }],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
return {
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: "text",
|
|
35
|
+
text: `Error listing witnesses: ${error instanceof Error ? error.message : String(error)}`,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
isError: true,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
registerTool("get_paginated_witnesses", {
|
|
43
|
+
description: "Get a paginated list of current active Super Representatives.",
|
|
44
|
+
inputSchema: {
|
|
45
|
+
offset: z.number().optional().describe("Pagination offset (default: 0)"),
|
|
46
|
+
limit: z.number().optional().describe("Number of results per page (default: 20)"),
|
|
47
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
48
|
+
},
|
|
49
|
+
annotations: {
|
|
50
|
+
title: "Get Paginated Witness List",
|
|
51
|
+
readOnlyHint: true,
|
|
52
|
+
destructiveHint: false,
|
|
53
|
+
idempotentHint: false,
|
|
54
|
+
openWorldHint: true,
|
|
55
|
+
},
|
|
56
|
+
}, async ({ offset = 0, limit = 20, network = "mainnet" }) => {
|
|
57
|
+
try {
|
|
58
|
+
const result = await services.getPaginatedWitnessList(offset, limit, network);
|
|
59
|
+
return {
|
|
60
|
+
content: [{ type: "text", text: services.helpers.formatJson(result) }],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
return {
|
|
65
|
+
content: [
|
|
66
|
+
{
|
|
67
|
+
type: "text",
|
|
68
|
+
text: `Error fetching paginated witnesses: ${error instanceof Error ? error.message : String(error)}`,
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
isError: true,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
registerTool("get_next_maintenance_time", {
|
|
76
|
+
description: "Get the timestamp of the next network maintenance window.",
|
|
77
|
+
inputSchema: {
|
|
78
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
79
|
+
},
|
|
80
|
+
annotations: {
|
|
81
|
+
title: "Get Next Maintenance Time",
|
|
82
|
+
readOnlyHint: true,
|
|
83
|
+
destructiveHint: false,
|
|
84
|
+
idempotentHint: false,
|
|
85
|
+
openWorldHint: true,
|
|
86
|
+
},
|
|
87
|
+
}, async ({ network = "mainnet" }) => {
|
|
88
|
+
try {
|
|
89
|
+
const result = await services.getNextMaintenanceTime(network);
|
|
90
|
+
return {
|
|
91
|
+
content: [
|
|
92
|
+
{
|
|
93
|
+
type: "text",
|
|
94
|
+
text: JSON.stringify({ network, nextMaintenanceTime: result }, null, 2),
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
return {
|
|
101
|
+
content: [
|
|
102
|
+
{
|
|
103
|
+
type: "text",
|
|
104
|
+
text: `Error fetching maintenance time: ${error instanceof Error ? error.message : String(error)}`,
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
isError: true,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
registerTool("get_reward", {
|
|
112
|
+
description: "Query the current unclaimed voting reward for an address.",
|
|
113
|
+
inputSchema: {
|
|
114
|
+
address: z.string().describe("The address to query rewards for"),
|
|
115
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
116
|
+
},
|
|
117
|
+
annotations: {
|
|
118
|
+
title: "Get Voting Reward",
|
|
119
|
+
readOnlyHint: true,
|
|
120
|
+
destructiveHint: false,
|
|
121
|
+
idempotentHint: false,
|
|
122
|
+
openWorldHint: true,
|
|
123
|
+
},
|
|
124
|
+
}, async ({ address, network = "mainnet" }) => {
|
|
125
|
+
try {
|
|
126
|
+
const reward = await services.getReward(address, network);
|
|
127
|
+
return {
|
|
128
|
+
content: [
|
|
129
|
+
{
|
|
130
|
+
type: "text",
|
|
131
|
+
text: JSON.stringify({ network, address, reward }, null, 2),
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
return {
|
|
138
|
+
content: [
|
|
139
|
+
{
|
|
140
|
+
type: "text",
|
|
141
|
+
text: `Error fetching reward: ${error instanceof Error ? error.message : String(error)}`,
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
isError: true,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
registerTool("get_brokerage", {
|
|
149
|
+
description: "Query the brokerage ratio (dividend percentage) of a Super Representative. The brokerage value is the percentage that the SR keeps; the rest is distributed to voters.",
|
|
150
|
+
inputSchema: {
|
|
151
|
+
witnessAddress: z.string().describe("The SR witness address"),
|
|
152
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
153
|
+
},
|
|
154
|
+
annotations: {
|
|
155
|
+
title: "Get SR Brokerage Ratio",
|
|
156
|
+
readOnlyHint: true,
|
|
157
|
+
destructiveHint: false,
|
|
158
|
+
idempotentHint: true,
|
|
159
|
+
openWorldHint: true,
|
|
160
|
+
},
|
|
161
|
+
}, async ({ witnessAddress, network = "mainnet" }) => {
|
|
162
|
+
try {
|
|
163
|
+
const brokerage = await services.getBrokerage(witnessAddress, network);
|
|
164
|
+
return {
|
|
165
|
+
content: [
|
|
166
|
+
{
|
|
167
|
+
type: "text",
|
|
168
|
+
text: JSON.stringify({
|
|
169
|
+
network,
|
|
170
|
+
witnessAddress,
|
|
171
|
+
brokerage,
|
|
172
|
+
description: `SR keeps ${brokerage}% of rewards; voters receive ${100 - brokerage}%`,
|
|
173
|
+
}, null, 2),
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
return {
|
|
180
|
+
content: [
|
|
181
|
+
{
|
|
182
|
+
type: "text",
|
|
183
|
+
text: `Error fetching brokerage: ${error instanceof Error ? error.message : String(error)}`,
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
isError: true,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
// ============================================================================
|
|
191
|
+
// GOVERNANCE — SUPER REPRESENTATIVE TOOLS (Write operations)
|
|
192
|
+
// ============================================================================
|
|
193
|
+
registerTool("create_witness", {
|
|
194
|
+
description: "Apply to become a Super Representative (SR). Requires the configured wallet and burns 9999 TRX as application fee.",
|
|
195
|
+
inputSchema: {
|
|
196
|
+
url: z.string().describe("The official website URL of the SR candidate"),
|
|
197
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
198
|
+
},
|
|
199
|
+
annotations: {
|
|
200
|
+
title: "Apply to Become SR",
|
|
201
|
+
readOnlyHint: false,
|
|
202
|
+
destructiveHint: true,
|
|
203
|
+
idempotentHint: false,
|
|
204
|
+
openWorldHint: true,
|
|
205
|
+
},
|
|
206
|
+
}, async ({ url, network = "mainnet" }) => {
|
|
207
|
+
try {
|
|
208
|
+
const senderAddress = await services.getOwnerAddress();
|
|
209
|
+
const txHash = await services.createWitness(url, network);
|
|
210
|
+
return {
|
|
211
|
+
content: [
|
|
212
|
+
{
|
|
213
|
+
type: "text",
|
|
214
|
+
text: JSON.stringify({
|
|
215
|
+
network,
|
|
216
|
+
from: senderAddress,
|
|
217
|
+
url,
|
|
218
|
+
txHash,
|
|
219
|
+
message: "SR application submitted. Use get_transaction_info to check confirmation.",
|
|
220
|
+
}, null, 2),
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
return {
|
|
227
|
+
content: [
|
|
228
|
+
{
|
|
229
|
+
type: "text",
|
|
230
|
+
text: `Error creating witness: ${error instanceof Error ? error.message : String(error)}`,
|
|
231
|
+
},
|
|
232
|
+
],
|
|
233
|
+
isError: true,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
registerTool("update_witness", {
|
|
238
|
+
description: "Update the SR node website URL for the configured wallet (must already be an SR).",
|
|
239
|
+
inputSchema: {
|
|
240
|
+
url: z.string().describe("The new official website URL for the SR"),
|
|
241
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
242
|
+
},
|
|
243
|
+
annotations: {
|
|
244
|
+
title: "Update SR Node Info",
|
|
245
|
+
readOnlyHint: false,
|
|
246
|
+
destructiveHint: false,
|
|
247
|
+
idempotentHint: false,
|
|
248
|
+
openWorldHint: true,
|
|
249
|
+
},
|
|
250
|
+
}, async ({ url, network = "mainnet" }) => {
|
|
251
|
+
try {
|
|
252
|
+
const senderAddress = await services.getOwnerAddress();
|
|
253
|
+
const txHash = await services.updateWitness(url, network);
|
|
254
|
+
return {
|
|
255
|
+
content: [
|
|
256
|
+
{
|
|
257
|
+
type: "text",
|
|
258
|
+
text: JSON.stringify({
|
|
259
|
+
network,
|
|
260
|
+
from: senderAddress,
|
|
261
|
+
url,
|
|
262
|
+
txHash,
|
|
263
|
+
message: "SR info update submitted.",
|
|
264
|
+
}, null, 2),
|
|
265
|
+
},
|
|
266
|
+
],
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
catch (error) {
|
|
270
|
+
return {
|
|
271
|
+
content: [
|
|
272
|
+
{
|
|
273
|
+
type: "text",
|
|
274
|
+
text: `Error updating witness: ${error instanceof Error ? error.message : String(error)}`,
|
|
275
|
+
},
|
|
276
|
+
],
|
|
277
|
+
isError: true,
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
registerTool("vote_witness", {
|
|
282
|
+
description: "Vote for Super Representatives using TRON Power (obtained by freezing TRX). Each frozen TRX = 1 vote.",
|
|
283
|
+
inputSchema: {
|
|
284
|
+
votes: z
|
|
285
|
+
.array(z.object({
|
|
286
|
+
address: z.string().describe("SR address to vote for"),
|
|
287
|
+
voteCount: z.number().int().positive().describe("Number of votes to allocate"),
|
|
288
|
+
}))
|
|
289
|
+
.min(1)
|
|
290
|
+
.describe("List of SR addresses and vote counts"),
|
|
291
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
292
|
+
},
|
|
293
|
+
annotations: {
|
|
294
|
+
title: "Vote for Super Representatives",
|
|
295
|
+
readOnlyHint: false,
|
|
296
|
+
destructiveHint: false,
|
|
297
|
+
idempotentHint: false,
|
|
298
|
+
openWorldHint: true,
|
|
299
|
+
},
|
|
300
|
+
}, async ({ votes, network = "mainnet" }) => {
|
|
301
|
+
try {
|
|
302
|
+
const senderAddress = await services.getOwnerAddress();
|
|
303
|
+
const txHash = await services.voteWitness(votes, network);
|
|
304
|
+
return {
|
|
305
|
+
content: [
|
|
306
|
+
{
|
|
307
|
+
type: "text",
|
|
308
|
+
text: JSON.stringify({
|
|
309
|
+
network,
|
|
310
|
+
from: senderAddress,
|
|
311
|
+
votes,
|
|
312
|
+
txHash,
|
|
313
|
+
message: "Vote submitted. Use get_transaction_info to check confirmation.",
|
|
314
|
+
}, null, 2),
|
|
315
|
+
},
|
|
316
|
+
],
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
return {
|
|
321
|
+
content: [
|
|
322
|
+
{
|
|
323
|
+
type: "text",
|
|
324
|
+
text: `Error voting for witness: ${error instanceof Error ? error.message : String(error)}`,
|
|
325
|
+
},
|
|
326
|
+
],
|
|
327
|
+
isError: true,
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
registerTool("withdraw_balance", {
|
|
332
|
+
description: "Withdraw accumulated voting rewards to the configured wallet's available balance.",
|
|
333
|
+
inputSchema: {
|
|
334
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
335
|
+
},
|
|
336
|
+
annotations: {
|
|
337
|
+
title: "Withdraw Voting Rewards",
|
|
338
|
+
readOnlyHint: false,
|
|
339
|
+
destructiveHint: false,
|
|
340
|
+
idempotentHint: false,
|
|
341
|
+
openWorldHint: true,
|
|
342
|
+
},
|
|
343
|
+
}, async ({ network = "mainnet" }) => {
|
|
344
|
+
try {
|
|
345
|
+
const senderAddress = await services.getOwnerAddress();
|
|
346
|
+
const txHash = await services.withdrawBalance(network);
|
|
347
|
+
return {
|
|
348
|
+
content: [
|
|
349
|
+
{
|
|
350
|
+
type: "text",
|
|
351
|
+
text: JSON.stringify({
|
|
352
|
+
network,
|
|
353
|
+
from: senderAddress,
|
|
354
|
+
txHash,
|
|
355
|
+
message: "Reward withdrawal submitted.",
|
|
356
|
+
}, null, 2),
|
|
357
|
+
},
|
|
358
|
+
],
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
catch (error) {
|
|
362
|
+
return {
|
|
363
|
+
content: [
|
|
364
|
+
{
|
|
365
|
+
type: "text",
|
|
366
|
+
text: `Error withdrawing balance: ${error instanceof Error ? error.message : String(error)}`,
|
|
367
|
+
},
|
|
368
|
+
],
|
|
369
|
+
isError: true,
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
registerTool("update_brokerage", {
|
|
374
|
+
description: "Update the SR brokerage ratio (dividend ratio). Only callable by an SR. Value is the percentage the SR keeps (0-100); the remainder goes to voters.",
|
|
375
|
+
inputSchema: {
|
|
376
|
+
brokerage: z
|
|
377
|
+
.number()
|
|
378
|
+
.int()
|
|
379
|
+
.min(0)
|
|
380
|
+
.max(100)
|
|
381
|
+
.describe("Brokerage percentage kept by the SR (0-100). E.g. 20 means SR keeps 20%."),
|
|
382
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
383
|
+
},
|
|
384
|
+
annotations: {
|
|
385
|
+
title: "Update SR Brokerage Ratio",
|
|
386
|
+
readOnlyHint: false,
|
|
387
|
+
destructiveHint: false,
|
|
388
|
+
idempotentHint: false,
|
|
389
|
+
openWorldHint: true,
|
|
390
|
+
},
|
|
391
|
+
}, async ({ brokerage, network = "mainnet" }) => {
|
|
392
|
+
try {
|
|
393
|
+
const senderAddress = await services.getOwnerAddress();
|
|
394
|
+
const txHash = await services.updateBrokerage(brokerage, network);
|
|
395
|
+
return {
|
|
396
|
+
content: [
|
|
397
|
+
{
|
|
398
|
+
type: "text",
|
|
399
|
+
text: JSON.stringify({
|
|
400
|
+
network,
|
|
401
|
+
from: senderAddress,
|
|
402
|
+
brokerage,
|
|
403
|
+
voterShare: 100 - brokerage,
|
|
404
|
+
txHash,
|
|
405
|
+
message: "Brokerage update submitted.",
|
|
406
|
+
}, null, 2),
|
|
407
|
+
},
|
|
408
|
+
],
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
catch (error) {
|
|
412
|
+
return {
|
|
413
|
+
content: [
|
|
414
|
+
{
|
|
415
|
+
type: "text",
|
|
416
|
+
text: `Error updating brokerage: ${error instanceof Error ? error.message : String(error)}`,
|
|
417
|
+
},
|
|
418
|
+
],
|
|
419
|
+
isError: true,
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
//# sourceMappingURL=governance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governance.js","sourceRoot":"","sources":["../../../src/core/tools/governance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AAGjD;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAA4B;IAClE,+EAA+E;IAC/E,sDAAsD;IACtD,+EAA+E;IAE/E,YAAY,CACV,gBAAgB,EAChB;QACE,WAAW,EACT,iFAAiF;QACnF,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;SAC9E;QACD,WAAW,EAAE;YACX,KAAK,EAAE,4BAA4B;YACnC,YAAY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EACD,IAAI,EACJ,CAAC,CACF;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,6BAA6B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBAC5F;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
/**
|
|
3
|
+
* Register all TRON-related tools with the MCP server
|
|
4
|
+
*
|
|
5
|
+
* Write operations are registered up front and validate wallet availability
|
|
6
|
+
* when the tool handler runs. Private keys and mnemonics are never passed as
|
|
7
|
+
* tool arguments for security reasons.
|
|
8
|
+
*
|
|
9
|
+
* @param server The MCP server instance
|
|
10
|
+
* @param options Registration options (e.g., readOnly mode)
|
|
11
|
+
*/
|
|
12
|
+
export declare function registerTRONTools(server: McpServer, options?: {
|
|
13
|
+
readOnly?: boolean;
|
|
14
|
+
transport?: "stdio" | "http";
|
|
15
|
+
}): void;
|