@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,451 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import * as services from "../services/index.js";
|
|
3
|
+
export function registerAccountTools(registerTool) {
|
|
4
|
+
// ============================================================================
|
|
5
|
+
// ACCOUNT QUERY TOOLS (Read-only)
|
|
6
|
+
// ============================================================================
|
|
7
|
+
registerTool("get_account", {
|
|
8
|
+
description: "Get full account information including balance, resources, permissions, frozen balance, and votes.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
address: z.string().describe("Account address (Base58 or Hex)"),
|
|
11
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
12
|
+
},
|
|
13
|
+
annotations: {
|
|
14
|
+
title: "Get Account",
|
|
15
|
+
readOnlyHint: true,
|
|
16
|
+
destructiveHint: false,
|
|
17
|
+
idempotentHint: true,
|
|
18
|
+
openWorldHint: true,
|
|
19
|
+
},
|
|
20
|
+
}, async ({ address, network = "mainnet" }) => {
|
|
21
|
+
try {
|
|
22
|
+
const account = await services.getAccount(address, network);
|
|
23
|
+
return {
|
|
24
|
+
content: [{ type: "text", text: services.helpers.formatJson({ network, ...account }) }],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
return {
|
|
29
|
+
content: [
|
|
30
|
+
{
|
|
31
|
+
type: "text",
|
|
32
|
+
text: `Error fetching account: ${error instanceof Error ? error.message : String(error)}`,
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
isError: true,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
registerTool("get_account_balance", {
|
|
40
|
+
description: "Get account TRX balance at a specific block height.",
|
|
41
|
+
inputSchema: {
|
|
42
|
+
address: z.string().describe("Account address (Base58)"),
|
|
43
|
+
blockHash: z.string().describe("Block hash (hex string)"),
|
|
44
|
+
blockNumber: z.number().describe("Block number"),
|
|
45
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
46
|
+
},
|
|
47
|
+
annotations: {
|
|
48
|
+
title: "Get Account Balance at Block",
|
|
49
|
+
readOnlyHint: true,
|
|
50
|
+
destructiveHint: false,
|
|
51
|
+
idempotentHint: true,
|
|
52
|
+
openWorldHint: true,
|
|
53
|
+
},
|
|
54
|
+
}, async ({ address, blockHash, blockNumber, network = "mainnet" }) => {
|
|
55
|
+
try {
|
|
56
|
+
const result = await services.getAccountBalance(address, blockHash, blockNumber, network);
|
|
57
|
+
return {
|
|
58
|
+
content: [{ type: "text", text: services.helpers.formatJson({ network, ...result }) }],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
return {
|
|
63
|
+
content: [
|
|
64
|
+
{
|
|
65
|
+
type: "text",
|
|
66
|
+
text: `Error fetching account balance: ${error instanceof Error ? error.message : String(error)}`,
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
isError: true,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
registerTool("generate_account", {
|
|
74
|
+
description: "Generate a new TRON account offline (keypair generation). Returns privateKey, publicKey, and address. No network interaction needed.",
|
|
75
|
+
legacyOnly: true,
|
|
76
|
+
inputSchema: {},
|
|
77
|
+
annotations: {
|
|
78
|
+
title: "Generate Account",
|
|
79
|
+
readOnlyHint: true,
|
|
80
|
+
destructiveHint: false,
|
|
81
|
+
idempotentHint: false,
|
|
82
|
+
openWorldHint: false,
|
|
83
|
+
},
|
|
84
|
+
}, async () => {
|
|
85
|
+
try {
|
|
86
|
+
const account = await services.generateAccount();
|
|
87
|
+
return {
|
|
88
|
+
content: [
|
|
89
|
+
{
|
|
90
|
+
type: "text",
|
|
91
|
+
text: JSON.stringify(account, null, 2),
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
return {
|
|
98
|
+
content: [
|
|
99
|
+
{
|
|
100
|
+
type: "text",
|
|
101
|
+
text: `Error generating account: ${error instanceof Error ? error.message : String(error)}`,
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
isError: true,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
registerTool("validate_address", {
|
|
109
|
+
description: "Validate a TRON address and detect its format (Base58 or Hex).",
|
|
110
|
+
inputSchema: {
|
|
111
|
+
address: z.string().describe("Address to validate"),
|
|
112
|
+
},
|
|
113
|
+
annotations: {
|
|
114
|
+
title: "Validate Address",
|
|
115
|
+
readOnlyHint: true,
|
|
116
|
+
destructiveHint: false,
|
|
117
|
+
idempotentHint: true,
|
|
118
|
+
openWorldHint: false,
|
|
119
|
+
},
|
|
120
|
+
}, async ({ address }) => {
|
|
121
|
+
try {
|
|
122
|
+
const result = services.validateAddress(address);
|
|
123
|
+
return {
|
|
124
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
return {
|
|
129
|
+
content: [
|
|
130
|
+
{
|
|
131
|
+
type: "text",
|
|
132
|
+
text: `Error validating address: ${error instanceof Error ? error.message : String(error)}`,
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
isError: true,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
registerTool("get_account_net", {
|
|
140
|
+
description: "Get bandwidth (net) resource information for an account.",
|
|
141
|
+
inputSchema: {
|
|
142
|
+
address: z.string().describe("Account address (Base58 or Hex)"),
|
|
143
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
144
|
+
},
|
|
145
|
+
annotations: {
|
|
146
|
+
title: "Get Account Bandwidth",
|
|
147
|
+
readOnlyHint: true,
|
|
148
|
+
destructiveHint: false,
|
|
149
|
+
idempotentHint: true,
|
|
150
|
+
openWorldHint: true,
|
|
151
|
+
},
|
|
152
|
+
}, async ({ address, network = "mainnet" }) => {
|
|
153
|
+
try {
|
|
154
|
+
const result = await services.getAccountNet(address, network);
|
|
155
|
+
return {
|
|
156
|
+
content: [{ type: "text", text: JSON.stringify({ network, ...result }, null, 2) }],
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
return {
|
|
161
|
+
content: [
|
|
162
|
+
{
|
|
163
|
+
type: "text",
|
|
164
|
+
text: `Error fetching account net: ${error instanceof Error ? error.message : String(error)}`,
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
isError: true,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
registerTool("get_account_resource", {
|
|
172
|
+
description: "Get account resource details including energy, bandwidth, frozen balance, and delegation info.",
|
|
173
|
+
inputSchema: {
|
|
174
|
+
address: z.string().describe("Account address (Base58 or Hex)"),
|
|
175
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
176
|
+
},
|
|
177
|
+
annotations: {
|
|
178
|
+
title: "Get Account Resources",
|
|
179
|
+
readOnlyHint: true,
|
|
180
|
+
destructiveHint: false,
|
|
181
|
+
idempotentHint: true,
|
|
182
|
+
openWorldHint: true,
|
|
183
|
+
},
|
|
184
|
+
}, async ({ address, network = "mainnet" }) => {
|
|
185
|
+
try {
|
|
186
|
+
const resources = await services.getAccountResource(address, network);
|
|
187
|
+
return {
|
|
188
|
+
content: [
|
|
189
|
+
{ type: "text", text: services.helpers.formatJson({ network, address, ...resources }) },
|
|
190
|
+
],
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
return {
|
|
195
|
+
content: [
|
|
196
|
+
{
|
|
197
|
+
type: "text",
|
|
198
|
+
text: `Error fetching account resources: ${error instanceof Error ? error.message : String(error)}`,
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
isError: true,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
registerTool("get_delegated_resource", {
|
|
206
|
+
description: "Query the amount of resources delegated from one account to another (Stake 2.0).",
|
|
207
|
+
inputSchema: {
|
|
208
|
+
fromAddress: z.string().describe("Delegator address"),
|
|
209
|
+
toAddress: z.string().describe("Recipient address"),
|
|
210
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
211
|
+
},
|
|
212
|
+
annotations: {
|
|
213
|
+
title: "Get Delegated Resource",
|
|
214
|
+
readOnlyHint: true,
|
|
215
|
+
destructiveHint: false,
|
|
216
|
+
idempotentHint: true,
|
|
217
|
+
openWorldHint: true,
|
|
218
|
+
},
|
|
219
|
+
}, async ({ fromAddress, toAddress, network = "mainnet" }) => {
|
|
220
|
+
try {
|
|
221
|
+
const result = await services.getDelegatedResource(fromAddress, toAddress, network);
|
|
222
|
+
return {
|
|
223
|
+
content: [
|
|
224
|
+
{
|
|
225
|
+
type: "text",
|
|
226
|
+
text: services.helpers.formatJson({ network, fromAddress, toAddress, ...result }),
|
|
227
|
+
},
|
|
228
|
+
],
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
catch (error) {
|
|
232
|
+
return {
|
|
233
|
+
content: [
|
|
234
|
+
{
|
|
235
|
+
type: "text",
|
|
236
|
+
text: `Error fetching delegated resource: ${error instanceof Error ? error.message : String(error)}`,
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
isError: true,
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
registerTool("get_delegated_resource_index", {
|
|
244
|
+
description: "Query the resource delegation index for an account: who delegated to this account, and who this account delegated to.",
|
|
245
|
+
inputSchema: {
|
|
246
|
+
address: z.string().describe("Account address"),
|
|
247
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
248
|
+
},
|
|
249
|
+
annotations: {
|
|
250
|
+
title: "Get Delegated Resource Index",
|
|
251
|
+
readOnlyHint: true,
|
|
252
|
+
destructiveHint: false,
|
|
253
|
+
idempotentHint: true,
|
|
254
|
+
openWorldHint: true,
|
|
255
|
+
},
|
|
256
|
+
}, async ({ address, network = "mainnet" }) => {
|
|
257
|
+
try {
|
|
258
|
+
const result = await services.getDelegatedResourceIndex(address, network);
|
|
259
|
+
return {
|
|
260
|
+
content: [
|
|
261
|
+
{ type: "text", text: services.helpers.formatJson({ network, address, ...result }) },
|
|
262
|
+
],
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
catch (error) {
|
|
266
|
+
return {
|
|
267
|
+
content: [
|
|
268
|
+
{
|
|
269
|
+
type: "text",
|
|
270
|
+
text: `Error fetching delegated resource index: ${error instanceof Error ? error.message : String(error)}`,
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
isError: true,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
// ============================================================================
|
|
278
|
+
// ACCOUNT WRITE TOOLS
|
|
279
|
+
// ============================================================================
|
|
280
|
+
registerTool("create_account", {
|
|
281
|
+
description: "Activate a new account on the TRON network. Costs bandwidth from the configured wallet. The target address must be generated beforehand.",
|
|
282
|
+
inputSchema: {
|
|
283
|
+
address: z.string().describe("Address to activate (Base58 or Hex)"),
|
|
284
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
285
|
+
},
|
|
286
|
+
annotations: {
|
|
287
|
+
title: "Create (Activate) Account",
|
|
288
|
+
readOnlyHint: false,
|
|
289
|
+
destructiveHint: true,
|
|
290
|
+
idempotentHint: false,
|
|
291
|
+
openWorldHint: true,
|
|
292
|
+
},
|
|
293
|
+
}, async ({ address, network = "mainnet" }) => {
|
|
294
|
+
try {
|
|
295
|
+
const senderAddress = await services.getOwnerAddress();
|
|
296
|
+
const txHash = await services.createAccount(address, network);
|
|
297
|
+
return {
|
|
298
|
+
content: [
|
|
299
|
+
{
|
|
300
|
+
type: "text",
|
|
301
|
+
text: JSON.stringify({
|
|
302
|
+
network,
|
|
303
|
+
from: senderAddress,
|
|
304
|
+
newAccount: address,
|
|
305
|
+
txHash,
|
|
306
|
+
message: "Account activation transaction sent.",
|
|
307
|
+
}, null, 2),
|
|
308
|
+
},
|
|
309
|
+
],
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
catch (error) {
|
|
313
|
+
return {
|
|
314
|
+
content: [
|
|
315
|
+
{
|
|
316
|
+
type: "text",
|
|
317
|
+
text: `Error creating account: ${error instanceof Error ? error.message : String(error)}`,
|
|
318
|
+
},
|
|
319
|
+
],
|
|
320
|
+
isError: true,
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
registerTool("update_account", {
|
|
325
|
+
description: "Update the name of the configured wallet's account. Can only be set once.",
|
|
326
|
+
inputSchema: {
|
|
327
|
+
accountName: z.string().describe("New account name"),
|
|
328
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
329
|
+
},
|
|
330
|
+
annotations: {
|
|
331
|
+
title: "Update Account Name",
|
|
332
|
+
readOnlyHint: false,
|
|
333
|
+
destructiveHint: true,
|
|
334
|
+
idempotentHint: false,
|
|
335
|
+
openWorldHint: true,
|
|
336
|
+
},
|
|
337
|
+
}, async ({ accountName, network = "mainnet" }) => {
|
|
338
|
+
try {
|
|
339
|
+
const senderAddress = await services.getOwnerAddress();
|
|
340
|
+
const txHash = await services.updateAccount(accountName, network);
|
|
341
|
+
return {
|
|
342
|
+
content: [
|
|
343
|
+
{
|
|
344
|
+
type: "text",
|
|
345
|
+
text: JSON.stringify({
|
|
346
|
+
network,
|
|
347
|
+
address: senderAddress,
|
|
348
|
+
accountName,
|
|
349
|
+
txHash,
|
|
350
|
+
message: "Account name update transaction sent.",
|
|
351
|
+
}, null, 2),
|
|
352
|
+
},
|
|
353
|
+
],
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
catch (error) {
|
|
357
|
+
return {
|
|
358
|
+
content: [
|
|
359
|
+
{
|
|
360
|
+
type: "text",
|
|
361
|
+
text: `Error updating account: ${error instanceof Error ? error.message : String(error)}`,
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
isError: true,
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
registerTool("account_permission_update", {
|
|
369
|
+
description: "Update account permissions for multi-signature configuration. Set owner, active, and optional witness permissions.",
|
|
370
|
+
inputSchema: {
|
|
371
|
+
ownerPermission: z
|
|
372
|
+
.object({
|
|
373
|
+
type: z.number().describe("Permission type (0 for Owner)"),
|
|
374
|
+
permission_name: z.string().describe("Permission name"),
|
|
375
|
+
threshold: z.number().describe("Approval threshold"),
|
|
376
|
+
keys: z
|
|
377
|
+
.array(z.object({
|
|
378
|
+
address: z.string().describe("Key holder address"),
|
|
379
|
+
weight: z.number().describe("Key weight"),
|
|
380
|
+
}))
|
|
381
|
+
.describe("List of key holders"),
|
|
382
|
+
})
|
|
383
|
+
.describe("Owner permission configuration"),
|
|
384
|
+
activePermissions: z
|
|
385
|
+
.union([
|
|
386
|
+
z.object({
|
|
387
|
+
type: z.number().describe("Permission type (2 for Active)"),
|
|
388
|
+
permission_name: z.string(),
|
|
389
|
+
threshold: z.number(),
|
|
390
|
+
operations: z.string().describe("Hex string of allowed operations bitmask"),
|
|
391
|
+
keys: z.array(z.object({ address: z.string(), weight: z.number() })),
|
|
392
|
+
}),
|
|
393
|
+
z.array(z.object({
|
|
394
|
+
type: z.number(),
|
|
395
|
+
permission_name: z.string(),
|
|
396
|
+
threshold: z.number(),
|
|
397
|
+
operations: z.string(),
|
|
398
|
+
keys: z.array(z.object({ address: z.string(), weight: z.number() })),
|
|
399
|
+
})),
|
|
400
|
+
])
|
|
401
|
+
.describe("Active permission(s) configuration"),
|
|
402
|
+
witnessPermission: z
|
|
403
|
+
.object({
|
|
404
|
+
type: z.number().describe("Permission type (1 for Witness)"),
|
|
405
|
+
permission_name: z.string(),
|
|
406
|
+
threshold: z.number(),
|
|
407
|
+
keys: z.array(z.object({ address: z.string(), weight: z.number() })),
|
|
408
|
+
})
|
|
409
|
+
.optional()
|
|
410
|
+
.describe("Witness permission (only for Super Representatives)"),
|
|
411
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
412
|
+
},
|
|
413
|
+
annotations: {
|
|
414
|
+
title: "Update Account Permissions",
|
|
415
|
+
readOnlyHint: false,
|
|
416
|
+
destructiveHint: true,
|
|
417
|
+
idempotentHint: false,
|
|
418
|
+
openWorldHint: true,
|
|
419
|
+
},
|
|
420
|
+
}, async ({ ownerPermission, activePermissions, witnessPermission, network = "mainnet" }) => {
|
|
421
|
+
try {
|
|
422
|
+
const senderAddress = await services.getOwnerAddress();
|
|
423
|
+
const txHash = await services.updateAccountPermissions(ownerPermission, activePermissions, witnessPermission, network);
|
|
424
|
+
return {
|
|
425
|
+
content: [
|
|
426
|
+
{
|
|
427
|
+
type: "text",
|
|
428
|
+
text: JSON.stringify({
|
|
429
|
+
network,
|
|
430
|
+
address: senderAddress,
|
|
431
|
+
txHash,
|
|
432
|
+
message: "Account permission update transaction sent.",
|
|
433
|
+
}, null, 2),
|
|
434
|
+
},
|
|
435
|
+
],
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
catch (error) {
|
|
439
|
+
return {
|
|
440
|
+
content: [
|
|
441
|
+
{
|
|
442
|
+
type: "text",
|
|
443
|
+
text: `Error updating account permissions: ${error instanceof Error ? error.message : String(error)}`,
|
|
444
|
+
},
|
|
445
|
+
],
|
|
446
|
+
isError: true,
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
//# sourceMappingURL=account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/core/tools/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AAGjD,MAAM,UAAU,oBAAoB,CAAC,YAA4B;IAC/D,+EAA+E;IAC/E,kCAAkC;IAClC,+E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eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,OAAO,CACR,CAAC;YACF,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;4BACE,OAAO;4BACP,OAAO,EAAE,aAAa;4BACtB,MAAM;4BACN,OAAO,EAAE,6CAA6C;yBACvD,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,uCAAuC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBACtG;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import * as services from "../services/index.js";
|
|
3
|
+
export function registerAddressTools(registerTool) {
|
|
4
|
+
registerTool("convert_address", {
|
|
5
|
+
description: "Convert addresses between Hex and Base58 formats",
|
|
6
|
+
inputSchema: {
|
|
7
|
+
address: z.string().describe("Address to convert (Hex or Base58)"),
|
|
8
|
+
},
|
|
9
|
+
annotations: {
|
|
10
|
+
title: "Convert Address",
|
|
11
|
+
readOnlyHint: true,
|
|
12
|
+
destructiveHint: false,
|
|
13
|
+
idempotentHint: true,
|
|
14
|
+
openWorldHint: true,
|
|
15
|
+
},
|
|
16
|
+
}, async ({ address }) => {
|
|
17
|
+
try {
|
|
18
|
+
return {
|
|
19
|
+
content: [
|
|
20
|
+
{
|
|
21
|
+
type: "text",
|
|
22
|
+
text: JSON.stringify({
|
|
23
|
+
original: address,
|
|
24
|
+
base58: services.toBase58Address(address),
|
|
25
|
+
hex: services.toHexAddress(address),
|
|
26
|
+
isValid: services.utils.isAddress(address),
|
|
27
|
+
}, null, 2),
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
return {
|
|
34
|
+
content: [
|
|
35
|
+
{
|
|
36
|
+
type: "text",
|
|
37
|
+
text: `Error converting address: ${error instanceof Error ? error.message : String(error)}`,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
isError: true,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=address.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../src/core/tools/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AAGjD,MAAM,UAAU,oBAAoB,CAAC,YAA4B;IAC/D,YAAY,CACV,iBAAiB,EACjB;QACE,WAAW,EAAE,kDAAkD;QAC/D,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;SACnE;QACD,WAAW,EAAE;YACX,KAAK,EAAE,iBAAiB;YACxB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,IAAI;SACpB;KACF,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACpB,IAAI,CAAC;YACH,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;4BACE,QAAQ,EAAE,OAAO;4BACjB,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC;4BACzC,GAAG,EAAE,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC;4BACnC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC;yBAC3C,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,94 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import * as services from "../services/index.js";
|
|
3
|
+
export function registerBalanceTools(registerTool) {
|
|
4
|
+
registerTool("get_balance", {
|
|
5
|
+
description: "Get the TRX balance for an address",
|
|
6
|
+
inputSchema: {
|
|
7
|
+
address: z.string().describe("The wallet address (Base58)"),
|
|
8
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
9
|
+
},
|
|
10
|
+
annotations: {
|
|
11
|
+
title: "Get TRX Balance",
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
destructiveHint: false,
|
|
14
|
+
idempotentHint: true,
|
|
15
|
+
openWorldHint: true,
|
|
16
|
+
},
|
|
17
|
+
}, async ({ address, network = "mainnet" }) => {
|
|
18
|
+
try {
|
|
19
|
+
const balance = await services.getTRXBalance(address, network);
|
|
20
|
+
return {
|
|
21
|
+
content: [
|
|
22
|
+
{
|
|
23
|
+
type: "text",
|
|
24
|
+
text: JSON.stringify({
|
|
25
|
+
network,
|
|
26
|
+
address,
|
|
27
|
+
balance: { sun: balance.wei.toString(), trx: balance.formatted },
|
|
28
|
+
}, null, 2),
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
return {
|
|
35
|
+
content: [
|
|
36
|
+
{
|
|
37
|
+
type: "text",
|
|
38
|
+
text: `Error fetching balance: ${error instanceof Error ? error.message : String(error)}`,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
isError: true,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
registerTool("get_token_balance", {
|
|
46
|
+
description: "Get the TRC20 token balance for an address",
|
|
47
|
+
inputSchema: {
|
|
48
|
+
address: z.string().describe("The wallet address"),
|
|
49
|
+
tokenAddress: z.string().describe("The TRC20 token contract address"),
|
|
50
|
+
network: z.string().optional().describe("Network name. Defaults to mainnet."),
|
|
51
|
+
},
|
|
52
|
+
annotations: {
|
|
53
|
+
title: "Get TRC20 Token Balance",
|
|
54
|
+
readOnlyHint: true,
|
|
55
|
+
destructiveHint: false,
|
|
56
|
+
idempotentHint: true,
|
|
57
|
+
openWorldHint: true,
|
|
58
|
+
},
|
|
59
|
+
}, async ({ address, tokenAddress, network = "mainnet" }) => {
|
|
60
|
+
try {
|
|
61
|
+
const balance = await services.getTRC20Balance(tokenAddress, address, network);
|
|
62
|
+
return {
|
|
63
|
+
content: [
|
|
64
|
+
{
|
|
65
|
+
type: "text",
|
|
66
|
+
text: JSON.stringify({
|
|
67
|
+
network,
|
|
68
|
+
tokenAddress,
|
|
69
|
+
address,
|
|
70
|
+
balance: {
|
|
71
|
+
raw: balance.raw.toString(),
|
|
72
|
+
formatted: balance.formatted,
|
|
73
|
+
symbol: balance.token.symbol,
|
|
74
|
+
decimals: balance.token.decimals,
|
|
75
|
+
},
|
|
76
|
+
}, null, 2),
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
return {
|
|
83
|
+
content: [
|
|
84
|
+
{
|
|
85
|
+
type: "text",
|
|
86
|
+
text: `Error fetching token balance: ${error instanceof Error ? error.message : String(error)}`,
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
isError: true,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=balance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balance.js","sourceRoot":"","sources":["../../../src/core/tools/balance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AAGjD,MAAM,UAAU,oBAAoB,CAAC,YAA4B;IAC/D,YAAY,CACV,aAAa,EACb;QACE,WAAW,EAAE,oCAAoC;QACjD,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;YAC3D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;SAC9E;QACD,WAAW,EAAE;YACX,KAAK,EAAE,iBAAiB;YACxB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,IAAI;SACpB;KACF,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,EAAE,EAAE;QACzC,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC/D,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;4BACE,OAAO;4BACP,OAAO;4BACP,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,SAAS,EAAE;yBACjE,EAC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