@bankofai/mcp-server-tron 1.1.3 → 1.1.4

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 (61) hide show
  1. package/README.md +56 -73
  2. package/build/core/services/account-resource.d.ts +56 -0
  3. package/build/core/services/account-resource.js +133 -0
  4. package/build/core/services/account-resource.js.map +1 -0
  5. package/build/core/services/account.d.ts +12 -8
  6. package/build/core/services/account.js +29 -39
  7. package/build/core/services/account.js.map +1 -1
  8. package/build/core/services/accountResource.d.ts +2 -2
  9. package/build/core/services/accountResource.js +11 -30
  10. package/build/core/services/accountResource.js.map +1 -1
  11. package/build/core/services/agent-wallet.d.ts +75 -0
  12. package/build/core/services/agent-wallet.js +272 -0
  13. package/build/core/services/agent-wallet.js.map +1 -0
  14. package/build/core/services/clients.d.ts +2 -1
  15. package/build/core/services/clients.js +2 -1
  16. package/build/core/services/clients.js.map +1 -1
  17. package/build/core/services/contracts.d.ts +9 -8
  18. package/build/core/services/contracts.js +53 -53
  19. package/build/core/services/contracts.js.map +1 -1
  20. package/build/core/services/governance.d.ts +5 -10
  21. package/build/core/services/governance.js +31 -63
  22. package/build/core/services/governance.js.map +1 -1
  23. package/build/core/services/index.d.ts +2 -1
  24. package/build/core/services/index.js +5 -2
  25. package/build/core/services/index.js.map +1 -1
  26. package/build/core/services/proposals.d.ts +3 -6
  27. package/build/core/services/proposals.js +17 -40
  28. package/build/core/services/proposals.js.map +1 -1
  29. package/build/core/services/staking.d.ts +4 -20
  30. package/build/core/services/staking.js +24 -64
  31. package/build/core/services/staking.js.map +1 -1
  32. package/build/core/services/transfer.d.ts +4 -4
  33. package/build/core/services/transfer.js +40 -26
  34. package/build/core/services/transfer.js.map +1 -1
  35. package/build/core/services/wallet.d.ts +6 -26
  36. package/build/core/services/wallet.js +9 -104
  37. package/build/core/services/wallet.js.map +1 -1
  38. package/build/core/tools/account-resource.js +14 -12
  39. package/build/core/tools/account-resource.js.map +1 -1
  40. package/build/core/tools/account.js +7 -15
  41. package/build/core/tools/account.js.map +1 -1
  42. package/build/core/tools/broadcast.js +1 -1
  43. package/build/core/tools/broadcast.js.map +1 -1
  44. package/build/core/tools/contract.js +11 -16
  45. package/build/core/tools/contract.js.map +1 -1
  46. package/build/core/tools/governance.js +10 -15
  47. package/build/core/tools/governance.js.map +1 -1
  48. package/build/core/tools/proposals.js +6 -9
  49. package/build/core/tools/proposals.js.map +1 -1
  50. package/build/core/tools/staking.js +10 -14
  51. package/build/core/tools/staking.js.map +1 -1
  52. package/build/core/tools/transfer.js +6 -8
  53. package/build/core/tools/transfer.js.map +1 -1
  54. package/build/core/tools/wallet.js +87 -2
  55. package/build/core/tools/wallet.js.map +1 -1
  56. package/build/server/http-server.js +7 -8
  57. package/build/server/http-server.js.map +1 -1
  58. package/build/server/server.d.ts +3 -0
  59. package/build/server/server.js +4 -2
  60. package/build/server/server.js.map +1 -1
  61. package/package.json +2 -1
package/README.md CHANGED
@@ -36,7 +36,7 @@ Key capabilities:
36
36
  - **Smart Contracts**: Interact with any TRON smart contract (Read/Write).
37
37
  - **Tokens**: Transfer TRX and TRC20 tokens; check balances.
38
38
  - **Address Management**: Convert between Hex (0x...) and Base58 (T...) formats.
39
- - **Wallet Integration**: Support for Private Key and Mnemonic (BIP-39) wallets.
39
+ - **Wallet Integration**: Agent-wallet (encrypted keystore), Private Key, and Mnemonic (BIP-39) wallets.
40
40
  - **Multi-Network**: Seamless support for Mainnet, Nile, and Shasta.
41
41
  - **Dynamic Access Control**: Automatically hides write tools if no wallet is configured or if `--readonly` mode is active.
42
42
 
@@ -91,9 +91,10 @@ Key capabilities:
91
91
 
92
92
  ### Wallet & Security
93
93
 
94
- - **Flexible Wallet**: Configure via `TRON_PRIVATE_KEY` or `TRON_MNEMONIC`.
94
+ - **Agent-Wallet (Recommended)**: Encrypted key storage via agent-wallet SDK — private keys never leave the keystore.
95
+ - **Legacy Wallet**: Configure via `TRON_PRIVATE_KEY` or `TRON_MNEMONIC` environment variables.
95
96
  - **HD Wallet**: Supports BIP-44 derivation path `m/44'/195'/0'/0/{index}`.
96
- - **Signing**: Sign arbitrary messages.
97
+ - **Signing**: Sign arbitrary messages and transactions.
97
98
 
98
99
  ## Supported Networks
99
100
 
@@ -110,7 +111,7 @@ Key capabilities:
110
111
 
111
112
  ```bash
112
113
  # Clone the repository
113
- git clone https://github.com/bankofai/mcp-server-tron.git
114
+ git clone https://github.com/BofAI/mcp-server-tron.git
114
115
  cd mcp-server-tron
115
116
 
116
117
  # Install dependencies
@@ -134,23 +135,40 @@ To enable write operations (transfers, contract calls) and ensure reliable API a
134
135
  export TRONGRID_API_KEY="<YOUR_TRONGRID_API_KEY_HERE>"
135
136
  ```
136
137
 
137
- #### Wallet Configuration (Use Environment Variables)
138
+ #### Wallet Configuration
138
139
 
139
- **Option 1: Private Key**
140
+ Choose **one** of the following modes. If none is configured, the server runs in **read-only mode**.
141
+
142
+ **Option 1: Agent-Wallet Mode (Recommended)**
143
+
144
+ Private keys are encrypted at rest and never exposed in environment variables.
145
+
146
+ > **Prerequisites**: Install and configure [agent-wallet](https://github.com/BofAI/agent-wallet/blob/main/doc/getting-started.md)
147
+
148
+ ```bash
149
+ export AGENT_WALLET_PASSWORD="<YOUR_MASTER_PASSWORD>"
150
+ export AGENT_WALLET_DIR="<YOUR_WALLET_DIR>" # Optional, default: ~/.agent-wallet
151
+ ```
152
+
153
+ > `AGENT_WALLET_PASSWORD` must match the master password used during `agent-wallet`. If not set, agent-wallet mode is disabled and the server falls back to legacy mode or read-only mode.
154
+
155
+ **Option 2: Private Key**
140
156
 
141
157
  ```bash
142
- # Recommended: Add this to your ~/.zshrc or ~/.bashrc
143
158
  export TRON_PRIVATE_KEY="<YOUR_PRIVATE_KEY_HERE>"
144
159
  ```
145
160
 
146
- **Option 2: Mnemonic Phrase**
161
+ **Option 3: Mnemonic Phrase**
147
162
 
148
163
  ```bash
149
- # Recommended: Add this to your ~/.zshrc or ~/.bashrc
150
164
  export TRON_MNEMONIC="<WORD1> <WORD2> ... <WORD12>"
151
- export TRON_ACCOUNT_INDEX="0" # Optional, default: 0
165
+ export TRON_ACCOUNT_INDEX="0" # Optional, default: 0
152
166
  ```
153
167
 
168
+ > **Security Note**: Legacy modes store keys in plaintext environment variables. Agent-wallet mode is strongly recommended for production use.
169
+
170
+ > See [`.env.example`](.env.example) for a complete list of all supported environment variables.
171
+
154
172
  ### Server Configuration
155
173
 
156
174
  The server runs on port **3001** by default in HTTP mode.
@@ -166,7 +184,7 @@ npm start
166
184
  # Start in readonly mode (disables write tools)
167
185
  npm start -- --readonly
168
186
 
169
- # Start in HTTP mode (Server-Sent Events)
187
+ # Start in HTTP mode (Streamable HTTP)
170
188
  npm run start:http
171
189
  ```
172
190
 
@@ -181,65 +199,46 @@ npm test
181
199
  # Unit tests (mocked services, no network)
182
200
  npx vitest tests/core/tools.test.ts # All MCP tools registration & handlers
183
201
  npx vitest tests/core/services/contracts.test.ts # Contract services
184
- npx vitest tests/core/services/accountResource.test.ts # Account resource services
202
+ npx vitest tests/core/services/account-resource.test.ts # Account resource services
185
203
  npx vitest tests/core/services/staking.test.ts # Staking services
186
204
 
187
- # Integration tests (real Nile RPC; write tests require TRON_PRIVATE_KEY)
205
+ # Integration tests (real Nile RPC; write tests require AGENT_WALLET_PASSWORD or TRON_PRIVATE_KEY)
188
206
  npx vitest tests/core/tools_integration.test.ts # Full tool flow on Nile
189
207
  npx vitest tests/core/services/multicall.test.ts # Multicall integration
190
208
  npx vitest tests/core/services/services.test.ts # Services integration
191
209
  ```
192
210
 
193
211
  - **Unit tests** use mocks and do not need network or wallet.
194
- - **Integration tests** (`tools_integration.test.ts`) call Nile RPC; most cases are read-only. Tests that broadcast transactions (e.g. `vote_witness`, `withdraw_balance`) run only when `TRON_PRIVATE_KEY` is set in the environment and are skipped otherwise.
212
+ - **Integration tests** (`tools_integration.test.ts`) call Nile RPC; most cases are read-only. Tests that broadcast transactions (e.g. `vote_witness`, `withdraw_balance`) run only when a wallet is configured (`AGENT_WALLET_PASSWORD` or `TRON_PRIVATE_KEY`) and are skipped otherwise.
195
213
 
196
214
  ### Client Configuration
197
215
 
198
- To use this server with MCP clients like Claude Desktop, Cursor, or Google Antigravity, you need to add it to your configuration file.
199
-
200
- #### 1. Locate your Configuration File
216
+ #### Option A: Quick Start (Recommended)
201
217
 
202
- | Application | OS | Config Path |
203
- | :--------------------- | :------ | :---------------------------------------------------------------- |
204
- | **Claude Desktop** | macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
205
- | | Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
206
- | **Cursor** | All | Project root: `.cursor/mcp.json` |
207
- | **Google Antigravity** | All | `~/.config/antigravity/mcp.json` |
208
- | **Opencode** | All | `~/.config/opencode/mcp.json` |
218
+ Runs the latest version directly from npm via stdio transport.
209
219
 
210
- #### 2. Add Server Definition
220
+ **Claude Code:**
211
221
 
212
- Choose one of the following methods to add to your `mcpServers` object.
222
+ ```bash
223
+ claude mcp add mcp-server-tron -- npx -y @bankofai/mcp-server-tron
224
+ ```
213
225
 
214
- **Option A: Quick Start (Recommended)**
215
- Runs the latest version directly from npm.
226
+ With environment variables:
216
227
 
217
- ```json
218
- {
219
- "mcpServers": {
220
- "mcp-server-tron": {
221
- "command": "npx",
222
- "args": ["-y", "@bankofai/mcp-server-tron"],
223
- "env": {
224
- "TRON_PRIVATE_KEY": "YOUR_KEY_HERE (Or set in system env)",
225
- "TRONGRID_API_KEY": "YOUR_KEY_HERE (Or set in system env)"
226
- }
227
- }
228
- }
229
- }
228
+ ```bash
229
+ claude mcp add -e AGENT_WALLET_PASSWORD=xxx -e TRONGRID_API_KEY=xxx mcp-server-tron -- npx -y @bankofai/mcp-server-tron
230
230
  ```
231
231
 
232
- **Option B: Local Development**
233
- For developers running from the cloned repository.
232
+ **Cursor** (`.cursor/mcp.json`):
234
233
 
235
234
  ```json
236
235
  {
237
236
  "mcpServers": {
238
237
  "mcp-server-tron": {
239
238
  "command": "npx",
240
- "args": ["tsx", "/ABSOLUTE/PATH/TO/mcp-server-tron/src/index.ts"],
239
+ "args": ["-y", "@bankofai/mcp-server-tron"],
241
240
  "env": {
242
- "TRON_PRIVATE_KEY": "YOUR_KEY_HERE (Or set in system env)",
241
+ "AGENT_WALLET_PASSWORD": "YOUR_PASSWORD (Or set in system env)",
243
242
  "TRONGRID_API_KEY": "YOUR_KEY_HERE (Or set in system env)"
244
243
  }
245
244
  }
@@ -247,48 +246,28 @@ For developers running from the cloned repository.
247
246
  }
248
247
  ```
249
248
 
250
- **Option C: Official Hosted Server (Remote)**
251
- Connect to the official hosted server at `https://mcp-server.bankofai.io`. No installation required, readonly mode.
249
+ #### Option B: Official Hosted Server (Remote)
252
250
 
253
- Claude Desktop / Cursor / Claude Code:
251
+ Connect to the official hosted server at `https://tron-mcp-server.bankofai.io`. No installation required, readonly mode.
254
252
 
255
- ```json
256
- {
257
- "mcpServers": {
258
- "mcp-server-tron": {
259
- "url": "https://mcp-server.bankofai.io/mcp"
260
- }
261
- }
262
- }
263
- ```
253
+ **Claude Code:**
264
254
 
265
- Google Antigravity:
266
-
267
- ```json
268
- {
269
- "mcpServers": {
270
- "mcp-server-tron": {
271
- "serverUrl": "https://mcp-server.bankofai.io/mcp"
272
- }
273
- }
274
- }
255
+ ```bash
256
+ claude mcp add -transport http mcp-server-tron https://tron-mcp-server.bankofai.io/mcp
275
257
  ```
276
258
 
277
- Opencode:
259
+ **Cursor** (`.cursor/mcp.json`):
278
260
 
279
261
  ```json
280
262
  {
281
- "mcp": {
263
+ "mcpServers": {
282
264
  "mcp-server-tron": {
283
- "type": "remote",
284
- "url": "https://mcp-server.bankofai.io/mcp"
265
+ "url": "https://tron-mcp-server.bankofai.io/mcp"
285
266
  }
286
267
  }
287
268
  }
288
269
  ```
289
270
 
290
- **Important**: We recommend omitting the `env` section if you have already set these variables in your system environment. If your MCP client doesn't inherit system variables, use placeholders or ensure the config file is not shared or committed to version control.
291
-
292
271
  ## API Reference
293
272
 
294
273
  ### Tools
@@ -298,6 +277,8 @@ Opencode:
298
277
  | Tool Name | Description | Key Parameters |
299
278
  | :------------------- | :-------------------------------------------------- | :------------- |
300
279
  | `get_wallet_address` | Get the configured wallet's address (Base58 & Hex). | - |
280
+ | `list_wallets` | List all available wallets with IDs and addresses. | - |
281
+ | `select_wallet` | Switch the active wallet at runtime (agent-wallet mode). | `walletId` |
301
282
  | `convert_address` | Convert between Hex and Base58 formats. | `address` |
302
283
 
303
284
  #### Network & Resources
@@ -481,7 +462,9 @@ Opencode:
481
462
  ### Prompts
482
463
 
483
464
  - `prepare_transfer`: Interactive guide to prepare TRX/TRC20 transfers.
465
+ - `interact_with_contract`: Step-by-step guide to interact with a smart contract.
484
466
  - `diagnose_transaction`: Analyze a transaction hash for status and errors.
467
+ - `explain_tron_concept`: Explain a TRON blockchain concept with examples.
485
468
  - `analyze_wallet`: Comprehensive report of wallet assets.
486
469
  - `check_network_status`: Report on network health and resource costs.
487
470
 
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Delegate staked resources (BANDWIDTH or ENERGY) to another address.
3
+ * Wraps TronWeb's transactionBuilder.delegateResource.
4
+ */
5
+ export declare function delegateResource(params: {
6
+ amount: number;
7
+ receiverAddress: string;
8
+ resource: "BANDWIDTH" | "ENERGY";
9
+ lock?: boolean;
10
+ lockPeriod?: number;
11
+ }, network?: string): Promise<string>;
12
+ /**
13
+ * Revoke delegated resources (BANDWIDTH or ENERGY) from a receiver address.
14
+ * Wraps TronWeb's transactionBuilder.undelegateResource.
15
+ */
16
+ export declare function undelegateResource(params: {
17
+ amount: number;
18
+ receiverAddress: string;
19
+ resource: "BANDWIDTH" | "ENERGY";
20
+ }, network?: string): Promise<string>;
21
+ /**
22
+ * Get the maximum amount of resources that can currently be delegated by an address.
23
+ * Wraps TronWeb's trx.getCanDelegatedMaxSize / walletsolidity.getcandelegatedmaxsize.
24
+ */
25
+ export declare function getCanDelegatedMaxSize(address: string, resource: "BANDWIDTH" | "ENERGY", network?: string): Promise<{
26
+ address: string;
27
+ resource: "BANDWIDTH" | "ENERGY";
28
+ maxSizeSun: bigint;
29
+ }>;
30
+ /**
31
+ * Get delegated resource details between two addresses under Stake 2.0.
32
+ * Wraps TronWeb's trx.getDelegatedResourceV2 / wallet.getdelegatedresourcev2.
33
+ */
34
+ export declare function getDelegatedResourceV2(fromAddress: string, toAddress: string, network?: string): Promise<{
35
+ from: string;
36
+ to: string;
37
+ delegatedResource: {
38
+ from: any;
39
+ to: any;
40
+ frozenBalanceForBandwidthSun: string;
41
+ frozenBalanceForEnergySun: string;
42
+ expireTimeForBandwidth: any;
43
+ expireTimeForEnergy: any;
44
+ }[];
45
+ raw: any;
46
+ }>;
47
+ /**
48
+ * Get delegated resource account index for an address under Stake 2.0.
49
+ * Wraps walletsolidity.getdelegatedresourceaccountindexv2.
50
+ */
51
+ export declare function getDelegatedResourceAccountIndexV2(address: string, network?: string): Promise<{
52
+ account: any;
53
+ fromAccounts: any;
54
+ toAccounts: any;
55
+ raw: unknown;
56
+ }>;
@@ -0,0 +1,133 @@
1
+ import { getTronWeb } from "./clients.js";
2
+ import { getOwnerAddress, buildSignBroadcast } from "./agent-wallet.js";
3
+ /**
4
+ * Delegate staked resources (BANDWIDTH or ENERGY) to another address.
5
+ * Wraps TronWeb's transactionBuilder.delegateResource.
6
+ */
7
+ export async function delegateResource(params, network = "mainnet") {
8
+ const tronWeb = getTronWeb(network);
9
+ const ownerAddress = await getOwnerAddress();
10
+ try {
11
+ const { amount, receiverAddress, resource, lock = false, lockPeriod = 0 } = params;
12
+ const tx = await tronWeb.transactionBuilder.delegateResource(amount, receiverAddress, resource, ownerAddress, lock, lockPeriod, {});
13
+ return await buildSignBroadcast(tx, network);
14
+ }
15
+ catch (error) {
16
+ throw new Error(`Failed to delegate resource: ${error.message}`);
17
+ }
18
+ }
19
+ /**
20
+ * Revoke delegated resources (BANDWIDTH or ENERGY) from a receiver address.
21
+ * Wraps TronWeb's transactionBuilder.undelegateResource.
22
+ */
23
+ export async function undelegateResource(params, network = "mainnet") {
24
+ const tronWeb = getTronWeb(network);
25
+ const ownerAddress = await getOwnerAddress();
26
+ try {
27
+ const { amount, receiverAddress, resource } = params;
28
+ const tx = await tronWeb.transactionBuilder.undelegateResource(amount, receiverAddress, resource, ownerAddress, {});
29
+ return await buildSignBroadcast(tx, network);
30
+ }
31
+ catch (error) {
32
+ throw new Error(`Failed to undelegate resource: ${error.message}`);
33
+ }
34
+ }
35
+ /**
36
+ * Get the maximum amount of resources that can currently be delegated by an address.
37
+ * Wraps TronWeb's trx.getCanDelegatedMaxSize / walletsolidity.getcandelegatedmaxsize.
38
+ */
39
+ export async function getCanDelegatedMaxSize(address, resource, network = "mainnet") {
40
+ const tronWeb = getTronWeb(network);
41
+ try {
42
+ // Prefer TronWeb helper if available
43
+ const type = resource === "ENERGY" ? 1 : 0;
44
+ // tronWeb.trx.getCanDelegatedMaxSize(address, resourceType)
45
+ const res = typeof tronWeb.trx.getCanDelegatedMaxSize === "function"
46
+ ? await tronWeb.trx.getCanDelegatedMaxSize(address, resource)
47
+ : await tronWeb.fullNode.request("wallet/getcandelegatedmaxsize", {
48
+ owner_address: tronWeb.address.toHex(address),
49
+ type,
50
+ visible: false,
51
+ }, "post");
52
+ const raw = res?.max_size;
53
+ if (raw === undefined || (typeof raw !== "number" && typeof raw !== "string")) {
54
+ throw new Error(`Unexpected response from getCanDelegatedMaxSize: ${JSON.stringify(res)}`);
55
+ }
56
+ const maxSizeSun = BigInt(raw);
57
+ return {
58
+ address,
59
+ resource,
60
+ maxSizeSun,
61
+ };
62
+ }
63
+ catch (error) {
64
+ throw new Error(`Failed to get can delegated max size: ${error.message}`);
65
+ }
66
+ }
67
+ /**
68
+ * Get delegated resource details between two addresses under Stake 2.0.
69
+ * Wraps TronWeb's trx.getDelegatedResourceV2 / wallet.getdelegatedresourcev2.
70
+ */
71
+ export async function getDelegatedResourceV2(fromAddress, toAddress, network = "mainnet") {
72
+ const tronWeb = getTronWeb(network);
73
+ try {
74
+ const res = typeof tronWeb.trx.getDelegatedResourceV2 === "function"
75
+ ? await tronWeb.trx.getDelegatedResourceV2(fromAddress, toAddress, {
76
+ confirmed: true,
77
+ })
78
+ : await tronWeb.fullNode.request("wallet/getdelegatedresourcev2", {
79
+ fromAddress: tronWeb.address.toHex(fromAddress),
80
+ toAddress: tronWeb.address.toHex(toAddress),
81
+ visible: false,
82
+ }, "post");
83
+ const delegated = res?.delegatedResource || (Array.isArray(res) ? res : []);
84
+ // Normalize numeric fields to BigInt/string form for safety
85
+ const normalized = delegated.map((item) => {
86
+ const bandwidth = item.frozen_balance_for_bandwidth ?? 0;
87
+ const energy = item.frozen_balance_for_energy ?? 0;
88
+ return {
89
+ from: item.from || fromAddress,
90
+ to: item.to || toAddress,
91
+ frozenBalanceForBandwidthSun: BigInt(bandwidth).toString(),
92
+ frozenBalanceForEnergySun: BigInt(energy).toString(),
93
+ expireTimeForBandwidth: item.expire_time_for_bandwidth ?? 0,
94
+ expireTimeForEnergy: item.expire_time_for_energy ?? 0,
95
+ };
96
+ });
97
+ return {
98
+ from: fromAddress,
99
+ to: toAddress,
100
+ delegatedResource: normalized,
101
+ raw: res,
102
+ };
103
+ }
104
+ catch (error) {
105
+ throw new Error(`Failed to get delegated resource v2: ${error.message}`);
106
+ }
107
+ }
108
+ /**
109
+ * Get delegated resource account index for an address under Stake 2.0.
110
+ * Wraps walletsolidity.getdelegatedresourceaccountindexv2.
111
+ */
112
+ export async function getDelegatedResourceAccountIndexV2(address, network = "mainnet") {
113
+ const tronWeb = getTronWeb(network);
114
+ try {
115
+ const res = await tronWeb.fullNode.request("wallet/getdelegatedresourceaccountindexv2", {
116
+ value: tronWeb.address.toHex(address),
117
+ visible: false,
118
+ }, "post");
119
+ const account = res?.account ?? address;
120
+ const fromAccounts = res?.fromAccounts ?? [];
121
+ const toAccounts = res?.toAccounts ?? [];
122
+ return {
123
+ account,
124
+ fromAccounts,
125
+ toAccounts,
126
+ raw: res,
127
+ };
128
+ }
129
+ catch (error) {
130
+ throw new Error(`Failed to get delegated resource account index v2: ${error.message}`);
131
+ }
132
+ }
133
+ //# sourceMappingURL=account-resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-resource.js","sourceRoot":"","sources":["../../../src/core/services/account-resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAExE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAMC,EACD,OAAO,GAAG,SAAS;IAEnB,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,YAAY,GAAG,MAAM,eAAe,EAAE,CAAC;IAE7C,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,GAAG,KAAK,EAAE,UAAU,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC;QAEnF,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC,gBAAgB,CAC1D,MAAM,EACN,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,IAAI,EACJ,UAAU,EACV,EAAE,CACH,CAAC;QACF,OAAO,MAAM,kBAAkB,CAAC,EAAS,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,gCAAgC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAIC,EACD,OAAO,GAAG,SAAS;IAEnB,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,YAAY,GAAG,MAAM,eAAe,EAAE,CAAC;IAE7C,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,QAA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AC;QACtD,MAAM,UAAU,GAAI,GAAW,EAAE,UAAU,IAAI,EAAE,CAAC;QAElD,OAAO;YACL,OAAO;YACP,YAAY;YACZ,UAAU;YACV,GAAG,EAAE,GAAG;SACT,CAAC;IACJ,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,sDAAsD,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;AACH,CAAC"}
@@ -18,8 +18,9 @@ export declare function getAccountBalance(address: string, blockHash: string, bl
18
18
  block_identifier?: any;
19
19
  }>;
20
20
  /**
21
- * Generate a new account offline (keypair generation, no network interaction)
22
- * @returns Object with privateKey, publicKey, and address (base58 + hex)
21
+ * Generate a new account.
22
+ * - agent-wallet mode: generates key, stores encrypted, returns walletId + address
23
+ * - legacy mode: generates offline keypair (no network interaction)
23
24
  */
24
25
  export declare function generateAccount(): Promise<{
25
26
  privateKey: string;
@@ -28,6 +29,12 @@ export declare function generateAccount(): Promise<{
28
29
  base58: string;
29
30
  hex: string;
30
31
  };
32
+ } | {
33
+ walletId: string;
34
+ address: {
35
+ base58: string;
36
+ };
37
+ message: string;
31
38
  }>;
32
39
  /**
33
40
  * Validate a TRON address
@@ -85,30 +92,27 @@ export declare function getDelegatedResourceIndex(address: string, network?: str
85
92
  }>;
86
93
  /**
87
94
  * Activate a new account on the TRON network (costs bandwidth from the creator)
88
- * @param privateKey Creator's private key
89
95
  * @param newAddress Address to activate
90
96
  * @param network Network name
91
97
  * @returns Transaction hash
92
98
  */
93
- export declare function createAccount(privateKey: string, newAddress: string, network?: string): Promise<string>;
99
+ export declare function createAccount(newAddress: string, network?: string): Promise<string>;
94
100
  /**
95
101
  * Update account name (can only be set once)
96
- * @param privateKey Account's private key
97
102
  * @param accountName New account name
98
103
  * @param network Network name
99
104
  * @returns Transaction hash
100
105
  */
101
- export declare function updateAccount(privateKey: string, accountName: string, network?: string): Promise<string>;
106
+ export declare function updateAccount(accountName: string, network?: string): Promise<string>;
102
107
  /**
103
108
  * Update account permissions (multi-signature configuration)
104
- * @param privateKey Account's private key
105
109
  * @param ownerPermission Owner permission configuration
106
110
  * @param activePermissions Active permission(s) configuration
107
111
  * @param witnessPermission Optional witness permission (for Super Representatives)
108
112
  * @param network Network name
109
113
  * @returns Transaction hash
110
114
  */
111
- export declare function updateAccountPermissions(privateKey: string, ownerPermission: {
115
+ export declare function updateAccountPermissions(ownerPermission: {
112
116
  type: number;
113
117
  permission_name: string;
114
118
  threshold: number;
@@ -1,5 +1,6 @@
1
1
  import { TronWeb } from "tronweb";
2
- import { getTronWeb, getWallet } from "./clients.js";
2
+ import { getTronWeb } from "./clients.js";
3
+ import { getOwnerAddress, buildSignBroadcast, generateAndStoreAccount, isAgentWalletConfigured, } from "./agent-wallet.js";
3
4
  /**
4
5
  * Get full account information from the TRON network
5
6
  * @param address Account address (Base58 or Hex)
@@ -39,11 +40,21 @@ export async function getAccountBalance(address, blockHash, blockNumber, network
39
40
  }
40
41
  }
41
42
  /**
42
- * Generate a new account offline (keypair generation, no network interaction)
43
- * @returns Object with privateKey, publicKey, and address (base58 + hex)
43
+ * Generate a new account.
44
+ * - agent-wallet mode: generates key, stores encrypted, returns walletId + address
45
+ * - legacy mode: generates offline keypair (no network interaction)
44
46
  */
45
47
  export async function generateAccount() {
46
48
  try {
49
+ if (isAgentWalletConfigured()) {
50
+ const result = await generateAndStoreAccount();
51
+ return {
52
+ walletId: result.walletId,
53
+ address: { base58: result.address },
54
+ message: "Account generated and stored in agent-wallet (private key encrypted at rest)",
55
+ };
56
+ }
57
+ // Legacy mode: generate offline keypair
47
58
  const account = await TronWeb.createAccount();
48
59
  return account;
49
60
  }
@@ -132,23 +143,16 @@ export async function getDelegatedResourceIndex(address, network = "mainnet") {
132
143
  }
133
144
  /**
134
145
  * Activate a new account on the TRON network (costs bandwidth from the creator)
135
- * @param privateKey Creator's private key
136
146
  * @param newAddress Address to activate
137
147
  * @param network Network name
138
148
  * @returns Transaction hash
139
149
  */
140
- export async function createAccount(privateKey, newAddress, network = "mainnet") {
141
- const tronWeb = getWallet(privateKey, network);
150
+ export async function createAccount(newAddress, network = "mainnet") {
151
+ const tronWeb = getTronWeb(network);
152
+ const ownerAddress = await getOwnerAddress();
142
153
  try {
143
- const transaction = await tronWeb.transactionBuilder.createAccount(newAddress, tronWeb.defaultAddress.base58 || undefined);
144
- const signedTx = await tronWeb.trx.sign(transaction, privateKey);
145
- const result = await tronWeb.trx.sendRawTransaction(signedTx);
146
- if (result.result) {
147
- return result.txid;
148
- }
149
- else {
150
- throw new Error(`CreateAccount failed: ${JSON.stringify(result)}`);
151
- }
154
+ const transaction = await tronWeb.transactionBuilder.createAccount(newAddress, ownerAddress);
155
+ return await buildSignBroadcast(transaction, network);
152
156
  }
153
157
  catch (error) {
154
158
  throw new Error(`Failed to create account: ${error.message}`);
@@ -156,23 +160,16 @@ export async function createAccount(privateKey, newAddress, network = "mainnet")
156
160
  }
157
161
  /**
158
162
  * Update account name (can only be set once)
159
- * @param privateKey Account's private key
160
163
  * @param accountName New account name
161
164
  * @param network Network name
162
165
  * @returns Transaction hash
163
166
  */
164
- export async function updateAccount(privateKey, accountName, network = "mainnet") {
165
- const tronWeb = getWallet(privateKey, network);
167
+ export async function updateAccount(accountName, network = "mainnet") {
168
+ const tronWeb = getTronWeb(network);
169
+ const ownerAddress = await getOwnerAddress();
166
170
  try {
167
- const transaction = await tronWeb.transactionBuilder.updateAccount(accountName, tronWeb.defaultAddress.base58 || undefined);
168
- const signedTx = await tronWeb.trx.sign(transaction, privateKey);
169
- const result = await tronWeb.trx.sendRawTransaction(signedTx);
170
- if (result.result) {
171
- return result.txid;
172
- }
173
- else {
174
- throw new Error(`UpdateAccount failed: ${JSON.stringify(result)}`);
175
- }
171
+ const transaction = await tronWeb.transactionBuilder.updateAccount(accountName, ownerAddress);
172
+ return await buildSignBroadcast(transaction, network);
176
173
  }
177
174
  catch (error) {
178
175
  throw new Error(`Failed to update account: ${error.message}`);
@@ -180,25 +177,18 @@ export async function updateAccount(privateKey, accountName, network = "mainnet"
180
177
  }
181
178
  /**
182
179
  * Update account permissions (multi-signature configuration)
183
- * @param privateKey Account's private key
184
180
  * @param ownerPermission Owner permission configuration
185
181
  * @param activePermissions Active permission(s) configuration
186
182
  * @param witnessPermission Optional witness permission (for Super Representatives)
187
183
  * @param network Network name
188
184
  * @returns Transaction hash
189
185
  */
190
- export async function updateAccountPermissions(privateKey, ownerPermission, activePermissions, witnessPermission, network = "mainnet") {
191
- const tronWeb = getWallet(privateKey, network);
186
+ export async function updateAccountPermissions(ownerPermission, activePermissions, witnessPermission, network = "mainnet") {
187
+ const tronWeb = getTronWeb(network);
188
+ const ownerAddress = await getOwnerAddress();
192
189
  try {
193
- const transaction = await tronWeb.transactionBuilder.updateAccountPermissions(tronWeb.defaultAddress.base58 || undefined, ownerPermission, witnessPermission, activePermissions);
194
- const signedTx = await tronWeb.trx.sign(transaction, privateKey);
195
- const result = await tronWeb.trx.sendRawTransaction(signedTx);
196
- if (result.result) {
197
- return result.txid;
198
- }
199
- else {
200
- throw new Error(`AccountPermissionUpdate failed: ${JSON.stringify(result)}`);
201
- }
190
+ const transaction = await tronWeb.transactionBuilder.updateAccountPermissions(ownerAddress, ownerPermission, witnessPermission, activePermissions);
191
+ return await buildSignBroadcast(transaction, network);
202
192
  }
203
193
  catch (error) {
204
194
  throw new Error(`Failed to update account permissions: ${error.message}`);
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/core/services/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAe,EAAE,OAAO,GAAG,SAAS;IACnE,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,IAAI,CAAC;QACH,MAA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