mcp-server-tld 1.0.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.
Files changed (100) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +285 -0
  3. package/bin/cli.js +25 -0
  4. package/build/core/abis.d.ts +101 -0
  5. package/build/core/abis.d.ts.map +1 -0
  6. package/build/core/abis.js +152 -0
  7. package/build/core/abis.js.map +1 -0
  8. package/build/core/chains.d.ts +54 -0
  9. package/build/core/chains.d.ts.map +1 -0
  10. package/build/core/chains.js +149 -0
  11. package/build/core/chains.js.map +1 -0
  12. package/build/core/prompts.d.ts +8 -0
  13. package/build/core/prompts.d.ts.map +1 -0
  14. package/build/core/prompts.js +271 -0
  15. package/build/core/prompts.js.map +1 -0
  16. package/build/core/resources.d.ts +6 -0
  17. package/build/core/resources.d.ts.map +1 -0
  18. package/build/core/resources.js +47 -0
  19. package/build/core/resources.js.map +1 -0
  20. package/build/core/services/account.d.ts +65 -0
  21. package/build/core/services/account.d.ts.map +1 -0
  22. package/build/core/services/account.js +157 -0
  23. package/build/core/services/account.js.map +1 -0
  24. package/build/core/services/address.d.ts +24 -0
  25. package/build/core/services/address.d.ts.map +1 -0
  26. package/build/core/services/address.js +56 -0
  27. package/build/core/services/address.js.map +1 -0
  28. package/build/core/services/balance.d.ts +28 -0
  29. package/build/core/services/balance.d.ts.map +1 -0
  30. package/build/core/services/balance.js +59 -0
  31. package/build/core/services/balance.js.map +1 -0
  32. package/build/core/services/blocks.d.ts +24 -0
  33. package/build/core/services/blocks.d.ts.map +1 -0
  34. package/build/core/services/blocks.js +43 -0
  35. package/build/core/services/blocks.js.map +1 -0
  36. package/build/core/services/clients.d.ts +11 -0
  37. package/build/core/services/clients.d.ts.map +1 -0
  38. package/build/core/services/clients.js +40 -0
  39. package/build/core/services/clients.js.map +1 -0
  40. package/build/core/services/contracts.d.ts +82 -0
  41. package/build/core/services/contracts.d.ts.map +1 -0
  42. package/build/core/services/contracts.js +300 -0
  43. package/build/core/services/contracts.js.map +1 -0
  44. package/build/core/services/index.d.ts +16 -0
  45. package/build/core/services/index.d.ts.map +1 -0
  46. package/build/core/services/index.js +18 -0
  47. package/build/core/services/index.js.map +1 -0
  48. package/build/core/services/lending.d.ts +96 -0
  49. package/build/core/services/lending.d.ts.map +1 -0
  50. package/build/core/services/lending.js +203 -0
  51. package/build/core/services/lending.js.map +1 -0
  52. package/build/core/services/markets.d.ts +42 -0
  53. package/build/core/services/markets.d.ts.map +1 -0
  54. package/build/core/services/markets.js +134 -0
  55. package/build/core/services/markets.js.map +1 -0
  56. package/build/core/services/multicall-abi.d.ts +56 -0
  57. package/build/core/services/multicall-abi.d.ts.map +1 -0
  58. package/build/core/services/multicall-abi.js +61 -0
  59. package/build/core/services/multicall-abi.js.map +1 -0
  60. package/build/core/services/staking.d.ts +20 -0
  61. package/build/core/services/staking.d.ts.map +1 -0
  62. package/build/core/services/staking.js +60 -0
  63. package/build/core/services/staking.js.map +1 -0
  64. package/build/core/services/tokens.d.ts +23 -0
  65. package/build/core/services/tokens.d.ts.map +1 -0
  66. package/build/core/services/tokens.js +63 -0
  67. package/build/core/services/tokens.js.map +1 -0
  68. package/build/core/services/transactions.d.ts +19 -0
  69. package/build/core/services/transactions.d.ts.map +1 -0
  70. package/build/core/services/transactions.js +39 -0
  71. package/build/core/services/transactions.js.map +1 -0
  72. package/build/core/services/transfer.d.ts +26 -0
  73. package/build/core/services/transfer.d.ts.map +1 -0
  74. package/build/core/services/transfer.js +58 -0
  75. package/build/core/services/transfer.js.map +1 -0
  76. package/build/core/services/utils.d.ts +23 -0
  77. package/build/core/services/utils.d.ts.map +1 -0
  78. package/build/core/services/utils.js +28 -0
  79. package/build/core/services/utils.js.map +1 -0
  80. package/build/core/services/wallet.d.ts +25 -0
  81. package/build/core/services/wallet.d.ts.map +1 -0
  82. package/build/core/services/wallet.js +82 -0
  83. package/build/core/services/wallet.js.map +1 -0
  84. package/build/core/tools.d.ts +9 -0
  85. package/build/core/tools.d.ts.map +1 -0
  86. package/build/core/tools.js +388 -0
  87. package/build/core/tools.js.map +1 -0
  88. package/build/index.d.ts +2 -0
  89. package/build/index.d.ts.map +1 -0
  90. package/build/index.js +19 -0
  91. package/build/index.js.map +1 -0
  92. package/build/server/http-server.d.ts +2 -0
  93. package/build/server/http-server.d.ts.map +1 -0
  94. package/build/server/http-server.js +41 -0
  95. package/build/server/http-server.js.map +1 -0
  96. package/build/server/server.d.ts +4 -0
  97. package/build/server/server.d.ts.map +1 -0
  98. package/build/server/server.js +33 -0
  99. package/build/server/server.js.map +1 -0
  100. package/package.json +59 -0
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Get TRC20 token metadata (name, symbol, decimals, totalSupply).
3
+ */
4
+ export declare function getTRC20TokenInfo(tokenAddress: string, network?: string): Promise<{
5
+ name: string;
6
+ symbol: string;
7
+ decimals: number;
8
+ totalSupply: bigint;
9
+ formattedTotalSupply: string;
10
+ }>;
11
+ /**
12
+ * Get TRC721 (NFT) token metadata for a specific tokenId.
13
+ */
14
+ export declare function getTRC721TokenMetadata(tokenAddress: string, tokenId: bigint, network?: string): Promise<{
15
+ name: string;
16
+ symbol: string;
17
+ tokenURI: string;
18
+ }>;
19
+ /**
20
+ * Get the URI for a TRC1155 token ID.
21
+ */
22
+ export declare function getTRC1155TokenURI(tokenAddress: string, tokenId: bigint, network?: string): Promise<string>;
23
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../src/core/services/tokens.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,YAAY,EAAE,MAAM,EACpB,OAAO,SAAY,GAClB,OAAO,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC,CA4BD;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,SAAY,GAClB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAgB7D;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,SAAY,GAClB,OAAO,CAAC,MAAM,CAAC,CAUjB"}
@@ -0,0 +1,63 @@
1
+ import { getTronWeb } from "./clients.js";
2
+ /**
3
+ * Get TRC20 token metadata (name, symbol, decimals, totalSupply).
4
+ */
5
+ export async function getTRC20TokenInfo(tokenAddress, network = "mainnet") {
6
+ const tronWeb = getTronWeb(network);
7
+ try {
8
+ const contract = await tronWeb.contract().at(tokenAddress);
9
+ const [name, symbol, decimals, totalSupply] = await Promise.all([
10
+ contract.methods.name().call(),
11
+ contract.methods.symbol().call(),
12
+ contract.methods.decimals().call(),
13
+ contract.methods.totalSupply().call(),
14
+ ]);
15
+ const decimalsNum = Number(decimals);
16
+ const totalSupplyBigInt = BigInt(totalSupply.toString());
17
+ const divisor = BigInt(10) ** BigInt(decimalsNum);
18
+ const formattedTotalSupply = (Number(totalSupplyBigInt) / Number(divisor)).toString();
19
+ return {
20
+ name: String(name),
21
+ symbol: String(symbol),
22
+ decimals: decimalsNum,
23
+ totalSupply: totalSupplyBigInt,
24
+ formattedTotalSupply,
25
+ };
26
+ }
27
+ catch (error) {
28
+ throw new Error(`Failed to get TRC20 token info: ${error.message}`);
29
+ }
30
+ }
31
+ /**
32
+ * Get TRC721 (NFT) token metadata for a specific tokenId.
33
+ */
34
+ export async function getTRC721TokenMetadata(tokenAddress, tokenId, network = "mainnet") {
35
+ const tronWeb = getTronWeb(network);
36
+ try {
37
+ const contract = await tronWeb.contract().at(tokenAddress);
38
+ const [name, symbol, tokenURI] = await Promise.all([
39
+ contract.methods.name().call(),
40
+ contract.methods.symbol().call(),
41
+ contract.methods.tokenURI(tokenId.toString()).call(),
42
+ ]);
43
+ return { name: String(name), symbol: String(symbol), tokenURI: String(tokenURI) };
44
+ }
45
+ catch (error) {
46
+ throw new Error(`Failed to get TRC721 metadata: ${error.message}`);
47
+ }
48
+ }
49
+ /**
50
+ * Get the URI for a TRC1155 token ID.
51
+ */
52
+ export async function getTRC1155TokenURI(tokenAddress, tokenId, network = "mainnet") {
53
+ const tronWeb = getTronWeb(network);
54
+ try {
55
+ const contract = await tronWeb.contract().at(tokenAddress);
56
+ const uri = await contract.methods.uri(tokenId.toString()).call();
57
+ return String(uri);
58
+ }
59
+ catch (error) {
60
+ throw new Error(`Failed to get TRC1155 URI: ${error.message}`);
61
+ }
62
+ }
63
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/core/services/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,YAAoB,EACpB,OAAO,GAAG,SAAS;IAQnB,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAEpC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;QAE3D,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC9D,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE;YAC9B,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;YAChC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,C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C,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE;SACrD,CAAC,CAAC;QAEH,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IACpF,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,YAAoB,EACpB,OAAe,EACf,OAAO,GAAG,SAAS;IAEnB,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAEpC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;QAC3D,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAClE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,8BAA8B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;AACH,CAAC"}
@@ -0,0 +1,19 @@
1
+ type Transaction = any;
2
+ type TransactionInfo = any;
3
+ /**
4
+ * Get full transaction details by hash.
5
+ */
6
+ export declare function getTransaction(txHash: string, network?: string): Promise<Transaction>;
7
+ /**
8
+ * Get transaction info (receipt) by hash.
9
+ */
10
+ export declare function getTransactionInfo(txHash: string, network?: string): Promise<TransactionInfo>;
11
+ /** Alias for tools expecting 'receipt'. */
12
+ export declare const getTransactionReceipt: typeof getTransactionInfo;
13
+ /**
14
+ * Poll until a transaction is confirmed and return its info.
15
+ * Throws after maxAttempts * 2s.
16
+ */
17
+ export declare function waitForTransaction(txHash: string, network?: string): Promise<TransactionInfo>;
18
+ export {};
19
+ //# sourceMappingURL=transactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../../src/core/services/transactions.ts"],"names":[],"mappings":"AAEA,KAAK,WAAW,GAAG,GAAG,CAAC;AACvB,KAAK,eAAe,GAAG,GAAG,CAAC;AAE3B;;GAEG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,SAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAG9F;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,OAAO,SAAY,GAClB,OAAO,CAAC,eAAe,CAAC,CAG1B;AAED,2CAA2C;AAC3C,eAAO,MAAM,qBAAqB,2BAAqB,CAAC;AAExD;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,OAAO,SAAY,GAClB,OAAO,CAAC,eAAe,CAAC,CAgB1B"}
@@ -0,0 +1,39 @@
1
+ import { getTronWeb } from "./clients.js";
2
+ /**
3
+ * Get full transaction details by hash.
4
+ */
5
+ export async function getTransaction(txHash, network = "mainnet") {
6
+ const tronWeb = getTronWeb(network);
7
+ return tronWeb.trx.getTransaction(txHash);
8
+ }
9
+ /**
10
+ * Get transaction info (receipt) by hash.
11
+ */
12
+ export async function getTransactionInfo(txHash, network = "mainnet") {
13
+ const tronWeb = getTronWeb(network);
14
+ return tronWeb.trx.getTransactionInfo(txHash);
15
+ }
16
+ /** Alias for tools expecting 'receipt'. */
17
+ export const getTransactionReceipt = getTransactionInfo;
18
+ /**
19
+ * Poll until a transaction is confirmed and return its info.
20
+ * Throws after maxAttempts * 2s.
21
+ */
22
+ export async function waitForTransaction(txHash, network = "mainnet") {
23
+ const tronWeb = getTronWeb(network);
24
+ const maxAttempts = 30;
25
+ const interval = 2000;
26
+ for (let i = 0; i < maxAttempts; i++) {
27
+ try {
28
+ const info = await tronWeb.trx.getTransactionInfo(txHash);
29
+ if (info && info.id)
30
+ return info;
31
+ }
32
+ catch {
33
+ // not confirmed yet, keep polling
34
+ }
35
+ await new Promise((resolve) => setTimeout(resolve, interval));
36
+ }
37
+ throw new Error(`Transaction ${txHash} not confirmed after ${maxAttempts * interval}ms`);
38
+ }
39
+ //# sourceMappingURL=transactions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../../src/core/services/transactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAc,EAAE,OAAO,GAAG,SAAS;IACtE,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAAc,EACd,OAAO,GAAG,SAAS;IAEnB,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AAED,2CAA2C;AAC3C,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAExD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAAc,EACd,OAAO,GAAG,SAAS;IAEnB,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,WAAW,GAAG,EAAE,CAAC;IACvB,MAAM,QAAQ,GAAG,IAAI,CAAC;IAEtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;YAC1D,IAAI,IAAI,IAAI,IAAI,CAAC,EAAE;gBAAE,OAAO,IAAI,CAAC;QACnC,CAAC;QAAC,MAAM,CAAC;YACP,kCAAkC;QACpC,CAAC;QACD,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,eAAe,MAAM,wBAAwB,WAAW,GAAG,QAAQ,IAAI,CAAC,CAAC;AAC3F,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Transfer TRX to an address.
3
+ * @param amount - Amount in TRX (not Sun).
4
+ */
5
+ export declare function transferTRX(privateKey: string, to: string, amount: string, network?: string): Promise<any>;
6
+ /**
7
+ * Transfer TRC20 tokens.
8
+ * @param amount - Raw token amount (accounting for decimals).
9
+ */
10
+ export declare function transferTRC20(tokenAddress: string, to: string, amount: string, privateKey: string, network?: string): Promise<{
11
+ txHash: any;
12
+ amount: {
13
+ raw: string;
14
+ formatted: string;
15
+ };
16
+ token: {
17
+ symbol: string;
18
+ decimals: number;
19
+ };
20
+ }>;
21
+ /**
22
+ * Approve a spender to spend TRC20 tokens.
23
+ * @param amount - Raw approval amount.
24
+ */
25
+ export declare function approveTRC20(tokenAddress: string, spenderAddress: string, amount: string, privateKey: string, network?: string): Promise<any>;
26
+ //# sourceMappingURL=transfer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../../src/core/services/transfer.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,EACd,OAAO,SAAY,gBAcpB;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,YAAY,EAAE,MAAM,EACpB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,SAAY;;;;;;;;;;GAuBpB;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,SAAY,gBAWpB"}
@@ -0,0 +1,58 @@
1
+ import { getWallet } from "./clients.js";
2
+ import { utils } from "./utils.js";
3
+ /**
4
+ * Transfer TRX to an address.
5
+ * @param amount - Amount in TRX (not Sun).
6
+ */
7
+ export async function transferTRX(privateKey, to, amount, network = "mainnet") {
8
+ const tronWeb = getWallet(privateKey, network);
9
+ const amountSun = utils.toSun(amount);
10
+ const tx = await tronWeb.trx.sendTransaction(to, amountSun);
11
+ if (tx.result === true && tx.transaction) {
12
+ return tx.transaction.txID;
13
+ }
14
+ if (tx.txID) {
15
+ return tx.txID;
16
+ }
17
+ throw new Error(`Transaction failed: ${JSON.stringify(tx)}`);
18
+ }
19
+ /**
20
+ * Transfer TRC20 tokens.
21
+ * @param amount - Raw token amount (accounting for decimals).
22
+ */
23
+ export async function transferTRC20(tokenAddress, to, amount, privateKey, network = "mainnet") {
24
+ const tronWeb = getWallet(privateKey, network);
25
+ try {
26
+ const contract = await tronWeb.contract().at(tokenAddress);
27
+ const txId = await contract.methods.transfer(to, amount).send();
28
+ const symbol = await contract.methods.symbol().call();
29
+ const decimals = await contract.methods.decimals().call();
30
+ const decimalsNum = Number(decimals);
31
+ const divisor = BigInt(10) ** BigInt(decimalsNum);
32
+ const formatted = (Number(BigInt(amount)) / Number(divisor)).toString();
33
+ return {
34
+ txHash: txId,
35
+ amount: { raw: amount, formatted },
36
+ token: { symbol: String(symbol), decimals: decimalsNum },
37
+ };
38
+ }
39
+ catch (error) {
40
+ throw new Error(`Failed to transfer TRC20: ${error.message}`);
41
+ }
42
+ }
43
+ /**
44
+ * Approve a spender to spend TRC20 tokens.
45
+ * @param amount - Raw approval amount.
46
+ */
47
+ export async function approveTRC20(tokenAddress, spenderAddress, amount, privateKey, network = "mainnet") {
48
+ const tronWeb = getWallet(privateKey, network);
49
+ try {
50
+ const contract = await tronWeb.contract().at(tokenAddress);
51
+ const txId = await contract.methods.approve(spenderAddress, amount).send();
52
+ return txId;
53
+ }
54
+ catch (error) {
55
+ throw new Error(`Failed to approve TRC20: ${error.message}`);
56
+ }
57
+ }
58
+ //# sourceMappingURL=transfer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transfer.js","sourceRoot":"","sources":["../../../src/core/services/transfer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,UAAkB,EAClB,EAAU,EACV,MAAc,EACd,OAAO,GAAG,SAAS;IAEnB,MAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC/C,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,MAAa,CAAC,CAAC;IAE7C,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,EAAE,SAAgB,CAAC,CAAC;IAEnE,IAAK,EAAU,CAAC,MAAM,KAAK,IAAI,IAAK,EAAU,CAAC,WAAW,EAAE,CAAC;QAC3D,OAAQ,EAAU,CAAC,WAAW,CAAC,IAAI,CAAC;IACtC,CAAC;IACD,IAAK,EAAU,CAAC,IAAI,EAAE,CAAC;QACrB,OAAQ,EAAU,CAAC,IAAI,CAAC;IAC1B,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,uBAAuB,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AC,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,YAAoB,EACpB,cAAsB,EACtB,MAAc,EACd,UAAkB,EAClB,OAAO,GAAG,SAAS;IAEnB,MAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAE/C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;QAC3D,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QAC3E,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Utility functions for formatting and converting TRON values.
3
+ * 1 TRX = 1,000,000 SUN
4
+ */
5
+ export declare const utils: {
6
+ /** Convert TRX to Sun (smallest unit). */
7
+ toSun: (trx: number | string) => string;
8
+ /** Convert Sun to TRX. */
9
+ fromSun: (sun: number | string | bigint) => string;
10
+ /** Stringify a bigint or number. */
11
+ formatBigInt: (value: bigint | number) => string;
12
+ /** JSON-serialize an object, converting BigInts to strings. */
13
+ formatJson: (obj: unknown) => string;
14
+ /** Format a number with locale comma separators. */
15
+ formatNumber: (value: number | string) => string;
16
+ /** Convert a hex string to a decimal number. */
17
+ hexToNumber: (hex: string) => number;
18
+ /** Convert a decimal number to a hex string (0x-prefixed). */
19
+ numberToHex: (num: number) => string;
20
+ /** Check whether a string is a valid TRON address. */
21
+ isAddress: (address: string) => boolean;
22
+ };
23
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/core/services/utils.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,KAAK;IAChB,0CAA0C;iBAC7B,MAAM,GAAG,MAAM,KAAG,MAAM;IAIrC,0BAA0B;mBACX,MAAM,GAAG,MAAM,GAAG,MAAM,KAAG,MAAM;IAIhD,oCAAoC;0BACd,MAAM,GAAG,MAAM,KAAG,MAAM;IAE9C,+DAA+D;sBAC7C,OAAO,KAAG,MAAM;IAGlC,oDAAoD;0BAC9B,MAAM,GAAG,MAAM,KAAG,MAAM;IAE9C,gDAAgD;uBAC7B,MAAM,KAAG,MAAM;IAElC,8DAA8D;uBAC3C,MAAM,KAAG,MAAM;IAElC,sDAAsD;yBACjC,MAAM,KAAG,OAAO;CACtC,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { TronWeb } from "tronweb";
2
+ /**
3
+ * Utility functions for formatting and converting TRON values.
4
+ * 1 TRX = 1,000,000 SUN
5
+ */
6
+ export const utils = {
7
+ /** Convert TRX to Sun (smallest unit). */
8
+ toSun: (trx) => {
9
+ return TronWeb.toSun(trx).toString();
10
+ },
11
+ /** Convert Sun to TRX. */
12
+ fromSun: (sun) => {
13
+ return TronWeb.fromSun(sun.toString()).toString();
14
+ },
15
+ /** Stringify a bigint or number. */
16
+ formatBigInt: (value) => value.toString(),
17
+ /** JSON-serialize an object, converting BigInts to strings. */
18
+ formatJson: (obj) => JSON.stringify(obj, (_, value) => (typeof value === "bigint" ? value.toString() : value), 2),
19
+ /** Format a number with locale comma separators. */
20
+ formatNumber: (value) => Number(value).toLocaleString(),
21
+ /** Convert a hex string to a decimal number. */
22
+ hexToNumber: (hex) => parseInt(hex, 16),
23
+ /** Convert a decimal number to a hex string (0x-prefixed). */
24
+ numberToHex: (num) => "0x" + num.toString(16),
25
+ /** Check whether a string is a valid TRON address. */
26
+ isAddress: (address) => TronWeb.isAddress(address),
27
+ };
28
+ //# sourceMappingURL=utils.js.map
@@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AO,CAAC,SAAS,CAAC,OAAO,CAAC;CACpE,CAAC"}
@@ -0,0 +1,25 @@
1
+ export interface ConfiguredWallet {
2
+ privateKey: string;
3
+ address: string;
4
+ }
5
+ /**
6
+ * Get the configured wallet from environment variables.
7
+ * Supports TRON_PRIVATE_KEY or TRON_MNEMONIC + TRON_ACCOUNT_INDEX.
8
+ */
9
+ export declare function getConfiguredWallet(): ConfiguredWallet;
10
+ export declare function getConfiguredPrivateKey(): string;
11
+ export declare function getWalletAddress(): string;
12
+ /** Alias matching the mcp-server-tron API. */
13
+ export declare const getWalletAddressFromKey: typeof getWalletAddress;
14
+ /**
15
+ * Sign an arbitrary message using the configured wallet.
16
+ * TronWeb prefixes the message with the standard TRON message prefix.
17
+ * @returns Signature as a hex string.
18
+ */
19
+ export declare function signMessage(message: string): Promise<string>;
20
+ /**
21
+ * Sign typed data (EIP-712 / TRON-712) using the configured wallet.
22
+ * Requires a TronWeb version that supports _signTypedData.
23
+ */
24
+ export declare function signTypedData(domain: object, types: object, value: object): Promise<string>;
25
+ //# sourceMappingURL=wallet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../src/core/services/wallet.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,CAmCtD;AAED,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,8CAA8C;AAC9C,eAAO,MAAM,uBAAuB,yBAAmB,CAAC;AAExD;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAWlE;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC,CAiBjB"}
@@ -0,0 +1,82 @@
1
+ import { TronWeb } from "tronweb";
2
+ import * as bip39 from "@scure/bip39";
3
+ import { wordlist } from "@scure/bip39/wordlists/english.js";
4
+ import { HDKey } from "@scure/bip32";
5
+ /**
6
+ * Get the configured wallet from environment variables.
7
+ * Supports TRON_PRIVATE_KEY or TRON_MNEMONIC + TRON_ACCOUNT_INDEX.
8
+ */
9
+ export function getConfiguredWallet() {
10
+ const privateKey = process.env.TRON_PRIVATE_KEY;
11
+ const mnemonic = process.env.TRON_MNEMONIC;
12
+ const accountIndexStr = process.env.TRON_ACCOUNT_INDEX || "0";
13
+ const accountIndex = parseInt(accountIndexStr, 10);
14
+ if (isNaN(accountIndex) || accountIndex < 0 || !Number.isInteger(accountIndex)) {
15
+ throw new Error(`Invalid TRON_ACCOUNT_INDEX: "${accountIndexStr}". Must be a non-negative integer.`);
16
+ }
17
+ if (privateKey) {
18
+ const cleanKey = privateKey.startsWith("0x") ? privateKey.slice(2) : privateKey;
19
+ const address = TronWeb.address.fromPrivateKey(cleanKey);
20
+ if (!address)
21
+ throw new Error("Invalid private key provided in TRON_PRIVATE_KEY");
22
+ return { privateKey: cleanKey, address };
23
+ }
24
+ if (mnemonic) {
25
+ if (!bip39.validateMnemonic(mnemonic, wordlist)) {
26
+ throw new Error("Invalid mnemonic provided in TRON_MNEMONIC");
27
+ }
28
+ const seed = bip39.mnemonicToSeedSync(mnemonic);
29
+ const hdKey = HDKey.fromMasterSeed(seed);
30
+ const child = hdKey.derive(`m/44'/195'/0'/0/${accountIndex}`);
31
+ if (!child.privateKey)
32
+ throw new Error("Failed to derive private key from mnemonic");
33
+ const privateKeyHex = Buffer.from(child.privateKey).toString("hex");
34
+ const address = TronWeb.address.fromPrivateKey(privateKeyHex);
35
+ return { privateKey: privateKeyHex, address: address };
36
+ }
37
+ throw new Error("Neither TRON_PRIVATE_KEY nor TRON_MNEMONIC environment variable is set.\n" +
38
+ "Configure one to enable write operations (supply, borrow, repay, etc.).");
39
+ }
40
+ export function getConfiguredPrivateKey() {
41
+ return getConfiguredWallet().privateKey;
42
+ }
43
+ export function getWalletAddress() {
44
+ return getConfiguredWallet().address;
45
+ }
46
+ /** Alias matching the mcp-server-tron API. */
47
+ export const getWalletAddressFromKey = getWalletAddress;
48
+ /**
49
+ * Sign an arbitrary message using the configured wallet.
50
+ * TronWeb prefixes the message with the standard TRON message prefix.
51
+ * @returns Signature as a hex string.
52
+ */
53
+ export async function signMessage(message) {
54
+ const { privateKey } = getConfiguredWallet();
55
+ const apiKey = process.env.TRONGRID_API_KEY;
56
+ const tronWeb = new TronWeb({
57
+ fullHost: "https://api.trongrid.io",
58
+ privateKey,
59
+ headers: apiKey ? { "TRON-PRO-API-KEY": apiKey } : undefined,
60
+ });
61
+ return tronWeb.trx.sign(message);
62
+ }
63
+ /**
64
+ * Sign typed data (EIP-712 / TRON-712) using the configured wallet.
65
+ * Requires a TronWeb version that supports _signTypedData.
66
+ */
67
+ export async function signTypedData(domain, types, value) {
68
+ const { privateKey } = getConfiguredWallet();
69
+ const apiKey = process.env.TRONGRID_API_KEY;
70
+ const tronWeb = new TronWeb({
71
+ fullHost: "https://api.trongrid.io",
72
+ privateKey,
73
+ headers: apiKey ? { "TRON-PRO-API-KEY": apiKey } : undefined,
74
+ });
75
+ // @ts-ignore — TronWeb types may not expose _signTypedData yet
76
+ if (typeof tronWeb.trx._signTypedData === "function") {
77
+ // @ts-ignore
78
+ return tronWeb.trx._signTypedData(domain, types, value);
79
+ }
80
+ throw new Error("signTypedData not supported by this TronWeb version or configuration");
81
+ }
82
+ //# sourceMappingURL=wallet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../../src/core/services/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC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H,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAc,EACd,KAAa,EACb,KAAa;IAEb,MAAM,EAAE,UAAU,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAE5C,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC;QAC1B,QAAQ,EAAE,yBAAyB;QACnC,UAAU;QACV,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS;KAC7D,CAAC,CAAC;IAEH,+DAA+D;IAC/D,IAAI,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,UAAU,EAAE,CAAC;QACrD,aAAa;QACb,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;AAC1F,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ /**
3
+ * Register all JustLend MCP tools.
4
+ *
5
+ * SECURITY: Private keys are read from environment variables, never passed as tool arguments.
6
+ * Write operations require TRON_PRIVATE_KEY or TRON_MNEMONIC to be set.
7
+ */
8
+ export declare function registerJustLendTools(server: McpServer): void;
9
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/core/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAQpE;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,QAmdtD"}