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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,285 @@
1
+ # mcp-server-TLD
2
+
3
+ ![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)
4
+ ![TRON Network](https://img.shields.io/badge/Network-TRON-red)
5
+ ![TypeScript](https://img.shields.io/badge/TypeScript-5.8+-3178C6)
6
+ ![MCP](https://img.shields.io/badge/MCP-1.22.0+-blue)
7
+ ![JustLend](https://img.shields.io/badge/Protocol-JustLend_DAO-green)
8
+ ![npm](https://img.shields.io/badge/npm-mcp--server--tld-CB3837)
9
+
10
+ A Model Context Protocol (MCP) server that enables AI agents to interact with the **JustLend DAO** lending protocol on TRON. Supply assets, borrow against collateral, manage positions, and analyze DeFi portfolios — all through a unified AI interface.
11
+
12
+ Beyond JustLend-specific operations, the server also exposes a full set of **general-purpose TRON chain utilities** — balance queries, block/transaction data, token metadata, TRX transfers, smart contract reads/writes, staking (Stake 2.0), multicall, and more.
13
+
14
+ ## Overview
15
+
16
+ [JustLend DAO](https://justlend.org) is the largest lending protocol on TRON, based on the Compound V2 architecture. This MCP server wraps the full protocol functionality into tools and guided prompts that AI agents (Claude Desktop, Cursor, etc.) can use.
17
+
18
+ ### Key Capabilities
19
+
20
+ #### JustLend Protocol
21
+ - **Market Data**: Real-time APYs, TVL, utilization rates, prices for all markets
22
+ - **Supply**: Deposit TRX or TRC20 tokens to earn interest (mint jTokens)
23
+ - **Borrow**: Borrow assets against your collateral with health factor monitoring
24
+ - **Repay**: Repay outstanding borrows with full or partial amounts
25
+ - **Withdraw**: Redeem jTokens back to underlying assets
26
+ - **Collateral Management**: Enter/exit markets, manage what counts as collateral
27
+ - **Portfolio Analysis**: AI-guided risk assessment, health factor monitoring, optimization
28
+ - **Token Approvals**: Manage TRC20 approvals for jToken contracts
29
+
30
+ #### General TRON Chain
31
+ - **Balances**: TRX balance (with Sun/TRX conversion), TRC20/TRC1155 token balances
32
+ - **Blocks**: Latest block, block by number/hash, block number, chain ID
33
+ - **Transactions**: Fetch transaction details, receipts, wait for confirmation
34
+ - **Contracts**: Read/write any contract, fetch on-chain ABI, multicall (v2 & v3), deploy, estimate energy
35
+ - **Token Metadata**: TRC20 info (name/symbol/decimals/supply), TRC721 metadata, TRC1155 URI
36
+ - **Transfers**: Send TRX, transfer TRC20 tokens, approve spenders
37
+ - **Staking (Stake 2.0)**: Freeze/unfreeze TRX for BANDWIDTH or ENERGY, withdraw expired unfreeze
38
+ - **Address Utilities**: Hex ↔ Base58 conversion, address validation, resolution
39
+ - **Wallet**: Sign messages, sign typed data (EIP-712), HD wallet derivation from mnemonic
40
+
41
+ ## Supported Markets
42
+
43
+ | jToken | Underlying | Description |
44
+ |--------|-----------|-------------|
45
+ | jTRX | TRX | Native TRON token |
46
+ | jUSDT | USDT | Tether USD |
47
+ | jUSDC | USDC | USD Coin |
48
+ | jBTC | BTC | Bitcoin (wrapped) |
49
+ | jETH | ETH | Ethereum (wrapped) |
50
+ | jSUN | SUN | SUN token |
51
+ | jWIN | WIN | WINkLink |
52
+ | jTUSD | TUSD | TrueUSD |
53
+
54
+ ## Prerequisites
55
+
56
+ - [Node.js](https://nodejs.org/) 20.0.0 or higher
57
+ - Optional: [TronGrid API key](https://www.trongrid.io/) for reliable mainnet access (strongly recommended)
58
+
59
+ ## Installation
60
+
61
+ ```bash
62
+ git clone https://github.com/your-org/mcp-server-TLD.git
63
+ cd mcp-server-TLD
64
+ npm install
65
+ ```
66
+
67
+ ## Configuration
68
+
69
+ ### Environment Variables
70
+
71
+ > **SECURITY**: Never save private keys in config files. Use environment variables.
72
+
73
+ ```bash
74
+ # Required for write operations (supply, borrow, transfer, stake, etc.)
75
+ export TRON_PRIVATE_KEY="your_private_key_hex"
76
+ # OR use a mnemonic phrase
77
+ export TRON_MNEMONIC="word1 word2 ... word12"
78
+ export TRON_ACCOUNT_INDEX="0" # Optional HD wallet account index, default: 0
79
+
80
+ # Strongly recommended — avoids TronGrid 429 rate limiting on mainnet
81
+ export TRONGRID_API_KEY="your_trongrid_api_key"
82
+ ```
83
+
84
+ ### Client Configuration
85
+
86
+ #### Claude Desktop
87
+
88
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
89
+
90
+ ```json
91
+ {
92
+ "mcpServers": {
93
+ "justlend": {
94
+ "command": "npx",
95
+ "args": ["tsx", "/path/to/mcp-server-TLD/src/index.ts"],
96
+ "env": {
97
+ "TRONGRID_API_KEY": "your_key"
98
+ }
99
+ }
100
+ }
101
+ }
102
+ ```
103
+
104
+ #### Cursor
105
+
106
+ Add to `.cursor/mcp.json`:
107
+
108
+ ```json
109
+ {
110
+ "mcpServers": {
111
+ "justlend": {
112
+ "command": "npx",
113
+ "args": ["tsx", "/path/to/mcp-server-TLD/src/index.ts"]
114
+ }
115
+ }
116
+ }
117
+ ```
118
+
119
+ ## Usage
120
+
121
+ ```bash
122
+ # Stdio mode (for MCP clients)
123
+ npm start
124
+
125
+ # HTTP/SSE mode (for remote clients)
126
+ npm run start:http
127
+
128
+ # Development with auto-reload
129
+ npm run dev
130
+ ```
131
+
132
+ ## API Reference
133
+
134
+ ### Tools (20 total)
135
+
136
+ #### Wallet & Network
137
+ | Tool | Description | Write? |
138
+ |------|-------------|--------|
139
+ | `get_wallet_address` | Show configured wallet address | No |
140
+ | `get_supported_networks` | List available networks | No |
141
+ | `get_supported_markets` | List all jToken markets with addresses | No |
142
+
143
+ #### Market Data
144
+ | Tool | Description | Write? |
145
+ |------|-------------|--------|
146
+ | `get_market_data` | Detailed data for one market (APY, TVL, rates) | No |
147
+ | `get_all_markets` | Overview of all markets | No |
148
+ | `get_protocol_summary` | Comptroller config & protocol parameters | No |
149
+
150
+ #### Account & Balances
151
+ | Tool | Description | Write? |
152
+ |------|-------------|--------|
153
+ | `get_account_summary` | Full position: supplies, borrows, health factor | No |
154
+ | `check_allowance` | Check TRC20 approval for jToken | No |
155
+ | `get_trx_balance` | TRX balance | No |
156
+ | `get_token_balance` | TRC20 token balance | No |
157
+
158
+ #### Lending Operations
159
+ | Tool | Description | Write? |
160
+ |------|-------------|--------|
161
+ | `supply` | Deposit assets to earn interest | **Yes** |
162
+ | `withdraw` | Withdraw supplied assets | **Yes** |
163
+ | `withdraw_all` | Withdraw all from a market | **Yes** |
164
+ | `borrow` | Borrow against collateral | **Yes** |
165
+ | `repay` | Repay outstanding borrows | **Yes** |
166
+ | `enter_market` | Enable market as collateral | **Yes** |
167
+ | `exit_market` | Disable market as collateral | **Yes** |
168
+ | `approve_underlying` | Approve TRC20 for jToken | **Yes** |
169
+ | `claim_rewards` | Claim mining rewards | **Yes** |
170
+
171
+ ### Prompts (AI-Guided Workflows)
172
+
173
+ | Prompt | Description |
174
+ |--------|-------------|
175
+ | `supply_assets` | Step-by-step supply with balance checks and approval |
176
+ | `borrow_assets` | Safe borrowing with risk assessment and health factor checks |
177
+ | `repay_borrow` | Guided repayment with verification |
178
+ | `analyze_portfolio` | Comprehensive portfolio analysis with risk scoring |
179
+ | `compare_markets` | Find best supply/borrow opportunities |
180
+
181
+ ## Architecture
182
+
183
+ ```
184
+ mcp-server-TLD/
185
+ ├── src/
186
+ │ ├── core/
187
+ │ │ ├── chains.ts # Network configs + JustLend contract addresses
188
+ │ │ ├── abis.ts # jToken, Comptroller, Oracle, TRC20 ABIs
189
+ │ │ ├── tools.ts # MCP tool registrations
190
+ │ │ ├── prompts.ts # AI-guided workflow prompts
191
+ │ │ ├── resources.ts # Static protocol info resource
192
+ │ │ └── services/
193
+ │ │ ├── # — JustLend-specific —
194
+ │ │ ├── clients.ts # TronWeb client factory (cached)
195
+ │ │ ├── wallet.ts # Key/mnemonic management, signMessage, signTypedData
196
+ │ │ ├── markets.ts # APY, TVL, utilization, prices
197
+ │ │ ├── account.ts # User positions, liquidity, allowances
198
+ │ │ ├── lending.ts # supply, borrow, repay, withdraw, collateral
199
+ │ │ ├── # — General TRON chain —
200
+ │ │ ├── address.ts # Hex ↔ Base58 conversion, validation
201
+ │ │ ├── balance.ts # TRX balance (rich), TRC20/TRC1155 balances
202
+ │ │ ├── blocks.ts # Block queries, block number, chain ID
203
+ │ │ ├── transactions.ts# getTransaction, getTransactionInfo, waitForTransaction
204
+ │ │ ├── transfer.ts # transferTRX, transferTRC20, approveTRC20
205
+ │ │ ├── tokens.ts # TRC20/TRC721/TRC1155 metadata
206
+ │ │ ├── contracts.ts # readContract, writeContract, multicall, deploy, estimateEnergy
207
+ │ │ ├── multicall-abi.ts # Multicall2 & Multicall3 ABIs
208
+ │ │ ├── staking.ts # Stake 2.0: freeze, unfreeze, withdrawExpireUnfreeze
209
+ │ │ └── utils.ts # toSun/fromSun, formatJson, hexToNumber, isAddress, …
210
+ │ ├── server/
211
+ │ │ ├── server.ts # MCP server init
212
+ │ │ └── http-server.ts # Express HTTP/SSE transport
213
+ │ └── index.ts # Stdio entry point
214
+ ├── bin/cli.js # CLI entry for npx
215
+ └── tests/
216
+ └── core/
217
+ ├── chains.test.ts
218
+ └── services/
219
+ ├── services.test.ts # Client cache, legacy balance tests
220
+ ├── address.test.ts # Pure: address format conversion (16 tests)
221
+ ├── utils.test.ts # Pure: unit conversions, formatters (26 tests)
222
+ ├── balance.test.ts # Integration: TRX & TRC20 balances
223
+ ├── blocks.test.ts # Integration: block queries
224
+ ├── contracts.test.ts # Mixed: pure ABI helpers + integration reads
225
+ ├── tokens.test.ts # Integration: TRC20 token metadata
226
+ ├── transactions.test.ts# Integration: transaction fetch
227
+ ├── transfer.test.ts # Write: skipped by default (TEST_TRANSFER=1)
228
+ ├── staking.test.ts # Write: skipped by default (TEST_STAKING=1)
229
+ └── wallet.test.ts # Unit: skipped without TRON_PRIVATE_KEY
230
+ ```
231
+
232
+ ## Testing
233
+
234
+ ```bash
235
+ # Run all tests (pure/unit tests always pass; integration tests need network)
236
+ npm test
237
+
238
+ # Run individual test files (recommended to avoid TronGrid rate limits)
239
+ npx vitest run tests/core/services/utils.test.ts
240
+ npx vitest run tests/core/services/address.test.ts
241
+ npx vitest run tests/core/services/balance.test.ts
242
+ npx vitest run tests/core/services/blocks.test.ts
243
+ npx vitest run tests/core/services/contracts.test.ts
244
+ npx vitest run tests/core/services/transactions.test.ts
245
+ npx vitest run tests/core/services/tokens.test.ts
246
+
247
+ # Enable write/staking tests (uses real funds — use Nile testnet!)
248
+ TRON_PRIVATE_KEY=xxx TEST_TRANSFER=1 npx vitest run tests/core/services/transfer.test.ts
249
+ TRON_PRIVATE_KEY=xxx TEST_STAKING=1 npx vitest run tests/core/services/staking.test.ts
250
+ ```
251
+
252
+ > **Rate limiting**: Integration tests make real RPC calls to TronGrid. Without `TRONGRID_API_KEY` the free tier limits to a few requests per second. Run test files individually, or set `TRONGRID_API_KEY` to avoid 429 errors.
253
+
254
+ ## Security Considerations
255
+
256
+ - **Private keys** are read from environment variables only, never exposed via MCP tools
257
+ - **Write operations** are clearly marked with `destructiveHint: true` in MCP annotations
258
+ - **Health factor checks** in prompts prevent dangerous borrowing
259
+ - Always **test on Nile testnet** before mainnet operations
260
+ - Be cautious with **unlimited approvals** (`approve_underlying` with `max`)
261
+ - **Never share** your `claude_desktop_config.json` if it contains keys
262
+
263
+ ## Example Conversations
264
+
265
+ **"What are the best supply rates on JustLend right now?"**
266
+ → AI calls `get_all_markets`, sorts by supplyAPY, presents ranking
267
+
268
+ **"I want to supply 10,000 USDT to earn interest"**
269
+ → AI uses `supply_assets` prompt: checks balance → approves USDT → supplies → verifies
270
+
271
+ **"Am I at risk of liquidation?"**
272
+ → AI calls `get_account_summary`, analyzes health factor, warns if < 1.5
273
+
274
+ **"Borrow 500 USDT against my TRX collateral"**
275
+ → AI uses `borrow_assets` prompt: checks collateral → calculates new health factor → executes if safe
276
+
277
+ **"What is the TRX balance of address TXxx...?"**
278
+ → AI calls the general-purpose TRX balance tool, returns balance in both TRX and Sun
279
+
280
+ **"Freeze 100 TRX for ENERGY"**
281
+ → AI calls staking service to freeze via Stake 2.0, returns transaction hash
282
+
283
+ ## License
284
+
285
+ MIT
package/bin/cli.js ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * CLI entry point for mcp-server-TLD
5
+ *
6
+ * Usage:
7
+ * npx mcp-server-TLD # stdio mode (default)
8
+ * npx mcp-server-TLD --http # HTTP/SSE mode
9
+ */
10
+
11
+ const args = process.argv.slice(2);
12
+
13
+ if (args.includes("--http") || args.includes("-h")) {
14
+ import("../build/server/http-server.js").catch((err) => {
15
+ console.error("Failed to start HTTP server:", err.message);
16
+ console.error("Did you run `npm run build` first?");
17
+ process.exit(1);
18
+ });
19
+ } else {
20
+ import("../build/index.js").catch((err) => {
21
+ console.error("Failed to start stdio server:", err.message);
22
+ console.error("Did you run `npm run build` first?");
23
+ process.exit(1);
24
+ });
25
+ }
@@ -0,0 +1,101 @@
1
+ /**
2
+ * JustLend Contract ABIs (Compound V2 fork)
3
+ *
4
+ * Only the function signatures used by this MCP server are included.
5
+ * Full ABIs can be fetched on-chain via TronWeb for verified contracts.
6
+ */
7
+ export declare const JTOKEN_ABI: ({
8
+ type: string;
9
+ name: string;
10
+ inputs: {
11
+ type: string;
12
+ name: string;
13
+ }[];
14
+ outputs: {
15
+ type: string;
16
+ }[];
17
+ stateMutability: string;
18
+ } | {
19
+ type: string;
20
+ name: string;
21
+ inputs: {
22
+ type: string;
23
+ name: string;
24
+ }[];
25
+ outputs: {
26
+ type: string;
27
+ name: string;
28
+ }[];
29
+ stateMutability: string;
30
+ })[];
31
+ /**
32
+ * jTRX-specific mint (payable, no params — callValue carries TRX amount)
33
+ */
34
+ export declare const JTRX_MINT_ABI: {
35
+ type: string;
36
+ name: string;
37
+ inputs: never[];
38
+ outputs: never[];
39
+ stateMutability: string;
40
+ }[];
41
+ export declare const COMPTROLLER_ABI: ({
42
+ type: string;
43
+ name: string;
44
+ inputs: {
45
+ type: string;
46
+ name: string;
47
+ }[];
48
+ outputs: {
49
+ type: string;
50
+ }[];
51
+ stateMutability: string;
52
+ } | {
53
+ type: string;
54
+ name: string;
55
+ inputs: {
56
+ type: string;
57
+ name: string;
58
+ }[];
59
+ outputs: {
60
+ type: string;
61
+ name: string;
62
+ }[];
63
+ stateMutability: string;
64
+ })[];
65
+ export declare const PRICE_ORACLE_ABI: {
66
+ type: string;
67
+ name: string;
68
+ inputs: {
69
+ type: string;
70
+ name: string;
71
+ }[];
72
+ outputs: {
73
+ type: string;
74
+ }[];
75
+ stateMutability: string;
76
+ }[];
77
+ export declare const TRC20_ABI: {
78
+ type: string;
79
+ name: string;
80
+ inputs: {
81
+ type: string;
82
+ name: string;
83
+ }[];
84
+ outputs: {
85
+ type: string;
86
+ }[];
87
+ stateMutability: string;
88
+ }[];
89
+ export declare const INTEREST_RATE_MODEL_ABI: {
90
+ type: string;
91
+ name: string;
92
+ inputs: {
93
+ type: string;
94
+ name: string;
95
+ }[];
96
+ outputs: {
97
+ type: string;
98
+ }[];
99
+ stateMutability: string;
100
+ }[];
101
+ //# sourceMappingURL=abis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abis.d.ts","sourceRoot":"","sources":["../../src/core/abis.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;IAsDtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;GAEzB,CAAC;AAKF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;IAkC3B,CAAC;AAKF,eAAO,MAAM,gBAAgB;;;;;;;;;;;GAO5B,CAAC;AAKF,eAAO,MAAM,SAAS;;;;;;;;;;;GASrB,CAAC;AAKF,eAAO,MAAM,uBAAuB;;;;;;;;;;;GAiBnC,CAAC"}
@@ -0,0 +1,152 @@
1
+ /**
2
+ * JustLend Contract ABIs (Compound V2 fork)
3
+ *
4
+ * Only the function signatures used by this MCP server are included.
5
+ * Full ABIs can be fetched on-chain via TronWeb for verified contracts.
6
+ */
7
+ // ============================================================================
8
+ // jToken (CErc20 / CTRX) ABI — shared by all jToken markets
9
+ // ============================================================================
10
+ export const JTOKEN_ABI = [
11
+ // --- Read (view/pure) ---
12
+ { type: "function", name: "name", inputs: [], outputs: [{ type: "string" }], stateMutability: "view" },
13
+ { type: "function", name: "symbol", inputs: [], outputs: [{ type: "string" }], stateMutability: "view" },
14
+ { type: "function", name: "decimals", inputs: [], outputs: [{ type: "uint8" }], stateMutability: "view" },
15
+ { type: "function", name: "totalSupply", inputs: [], outputs: [{ type: "uint256" }], stateMutability: "view" },
16
+ { type: "function", name: "totalBorrows", inputs: [], outputs: [{ type: "uint256" }], stateMutability: "view" },
17
+ { type: "function", name: "totalReserves", inputs: [], outputs: [{ type: "uint256" }], stateMutability: "view" },
18
+ { type: "function", name: "reserveFactorMantissa", inputs: [], outputs: [{ type: "uint256" }], stateMutability: "view" },
19
+ { type: "function", name: "exchangeRateStored", inputs: [], outputs: [{ type: "uint256" }], stateMutability: "view" },
20
+ { type: "function", name: "exchangeRateCurrent", inputs: [], outputs: [{ type: "uint256" }], stateMutability: "nonpayable" },
21
+ { type: "function", name: "supplyRatePerBlock", inputs: [], outputs: [{ type: "uint256" }], stateMutability: "view" },
22
+ { type: "function", name: "borrowRatePerBlock", inputs: [], outputs: [{ type: "uint256" }], stateMutability: "view" },
23
+ { type: "function", name: "getCash", inputs: [], outputs: [{ type: "uint256" }], stateMutability: "view" },
24
+ { type: "function", name: "underlying", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
25
+ { type: "function", name: "comptroller", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
26
+ { type: "function", name: "interestRateModel", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
27
+ { type: "function", name: "balanceOf", inputs: [{ type: "address", name: "owner" }], outputs: [{ type: "uint256" }], stateMutability: "view" },
28
+ {
29
+ type: "function", name: "getAccountSnapshot",
30
+ inputs: [{ type: "address", name: "account" }],
31
+ outputs: [
32
+ { type: "uint256", name: "error" },
33
+ { type: "uint256", name: "jTokenBalance" },
34
+ { type: "uint256", name: "borrowBalance" },
35
+ { type: "uint256", name: "exchangeRateMantissa" },
36
+ ],
37
+ stateMutability: "view",
38
+ },
39
+ { type: "function", name: "borrowBalanceStored", inputs: [{ type: "address", name: "account" }], outputs: [{ type: "uint256" }], stateMutability: "view" },
40
+ { type: "function", name: "balanceOfUnderlying", inputs: [{ type: "address", name: "owner" }], outputs: [{ type: "uint256" }], stateMutability: "nonpayable" },
41
+ { type: "function", name: "allowance", inputs: [{ type: "address", name: "owner" }, { type: "address", name: "spender" }], outputs: [{ type: "uint256" }], stateMutability: "view" },
42
+ // --- Write (state-changing) ---
43
+ // CErc20: mint requires prior ERC20 approval of underlying
44
+ { type: "function", name: "mint", inputs: [{ type: "uint256", name: "mintAmount" }], outputs: [{ type: "uint256" }], stateMutability: "nonpayable" },
45
+ // CTRX (jTRX): mint is payable, amount is msg.value
46
+ // { type: "function", name: "mint", inputs: [], outputs: [], stateMutability: "payable" },
47
+ { type: "function", name: "redeem", inputs: [{ type: "uint256", name: "redeemTokens" }], outputs: [{ type: "uint256" }], stateMutability: "nonpayable" },
48
+ { type: "function", name: "redeemUnderlying", inputs: [{ type: "uint256", name: "redeemAmount" }], outputs: [{ type: "uint256" }], stateMutability: "nonpayable" },
49
+ { type: "function", name: "borrow", inputs: [{ type: "uint256", name: "borrowAmount" }], outputs: [{ type: "uint256" }], stateMutability: "nonpayable" },
50
+ { type: "function", name: "repayBorrow", inputs: [{ type: "uint256", name: "repayAmount" }], outputs: [{ type: "uint256" }], stateMutability: "nonpayable" },
51
+ { type: "function", name: "repayBorrowBehalf", inputs: [{ type: "address", name: "borrower" }, { type: "uint256", name: "repayAmount" }], outputs: [{ type: "uint256" }], stateMutability: "nonpayable" },
52
+ {
53
+ type: "function", name: "liquidateBorrow",
54
+ inputs: [
55
+ { type: "address", name: "borrower" },
56
+ { type: "uint256", name: "repayAmount" },
57
+ { type: "address", name: "jTokenCollateral" },
58
+ ],
59
+ outputs: [{ type: "uint256" }],
60
+ stateMutability: "nonpayable",
61
+ },
62
+ { type: "function", name: "approve", inputs: [{ type: "address", name: "spender" }, { type: "uint256", name: "amount" }], outputs: [{ type: "bool" }], stateMutability: "nonpayable" },
63
+ ];
64
+ /**
65
+ * jTRX-specific mint (payable, no params — callValue carries TRX amount)
66
+ */
67
+ export const JTRX_MINT_ABI = [
68
+ { type: "function", name: "mint", inputs: [], outputs: [], stateMutability: "payable" },
69
+ ];
70
+ // ============================================================================
71
+ // Comptroller ABI
72
+ // ============================================================================
73
+ export const COMPTROLLER_ABI = [
74
+ // --- Read ---
75
+ { type: "function", name: "oracle", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
76
+ { type: "function", name: "closeFactorMantissa", inputs: [], outputs: [{ type: "uint256" }], stateMutability: "view" },
77
+ { type: "function", name: "liquidationIncentiveMantissa", inputs: [], outputs: [{ type: "uint256" }], stateMutability: "view" },
78
+ { type: "function", name: "getAllMarkets", inputs: [], outputs: [{ type: "address[]" }], stateMutability: "view" },
79
+ { type: "function", name: "getAssetsIn", inputs: [{ type: "address", name: "account" }], outputs: [{ type: "address[]" }], stateMutability: "view" },
80
+ {
81
+ type: "function", name: "markets",
82
+ inputs: [{ type: "address", name: "jToken" }],
83
+ outputs: [
84
+ { type: "bool", name: "isListed" },
85
+ { type: "uint256", name: "collateralFactorMantissa" },
86
+ ],
87
+ stateMutability: "view",
88
+ },
89
+ {
90
+ type: "function", name: "getAccountLiquidity",
91
+ inputs: [{ type: "address", name: "account" }],
92
+ outputs: [
93
+ { type: "uint256", name: "error" },
94
+ { type: "uint256", name: "liquidity" },
95
+ { type: "uint256", name: "shortfall" },
96
+ ],
97
+ stateMutability: "view",
98
+ },
99
+ { type: "function", name: "checkMembership", inputs: [{ type: "address", name: "account" }, { type: "address", name: "jToken" }], outputs: [{ type: "bool" }], stateMutability: "view" },
100
+ { type: "function", name: "mintGuardianPaused", inputs: [{ type: "address", name: "jToken" }], outputs: [{ type: "bool" }], stateMutability: "view" },
101
+ { type: "function", name: "borrowGuardianPaused", inputs: [{ type: "address", name: "jToken" }], outputs: [{ type: "bool" }], stateMutability: "view" },
102
+ // --- Write ---
103
+ { type: "function", name: "enterMarkets", inputs: [{ type: "address[]", name: "jTokens" }], outputs: [{ type: "uint256[]" }], stateMutability: "nonpayable" },
104
+ { type: "function", name: "exitMarket", inputs: [{ type: "address", name: "jToken" }], outputs: [{ type: "uint256" }], stateMutability: "nonpayable" },
105
+ { type: "function", name: "claimReward", inputs: [{ type: "address", name: "holder" }], outputs: [], stateMutability: "nonpayable" },
106
+ ];
107
+ // ============================================================================
108
+ // Price Oracle ABI
109
+ // ============================================================================
110
+ export const PRICE_ORACLE_ABI = [
111
+ {
112
+ type: "function", name: "getUnderlyingPrice",
113
+ inputs: [{ type: "address", name: "jToken" }],
114
+ outputs: [{ type: "uint256" }],
115
+ stateMutability: "view",
116
+ },
117
+ ];
118
+ // ============================================================================
119
+ // TRC20 Token ABI (for approvals before supplying)
120
+ // ============================================================================
121
+ export const TRC20_ABI = [
122
+ { type: "function", name: "name", inputs: [], outputs: [{ type: "string" }], stateMutability: "view" },
123
+ { type: "function", name: "symbol", inputs: [], outputs: [{ type: "string" }], stateMutability: "view" },
124
+ { type: "function", name: "decimals", inputs: [], outputs: [{ type: "uint8" }], stateMutability: "view" },
125
+ { type: "function", name: "totalSupply", inputs: [], outputs: [{ type: "uint256" }], stateMutability: "view" },
126
+ { type: "function", name: "balanceOf", inputs: [{ type: "address", name: "account" }], outputs: [{ type: "uint256" }], stateMutability: "view" },
127
+ { type: "function", name: "allowance", inputs: [{ type: "address", name: "owner" }, { type: "address", name: "spender" }], outputs: [{ type: "uint256" }], stateMutability: "view" },
128
+ { type: "function", name: "approve", inputs: [{ type: "address", name: "spender" }, { type: "uint256", name: "amount" }], outputs: [{ type: "bool" }], stateMutability: "nonpayable" },
129
+ { type: "function", name: "transfer", inputs: [{ type: "address", name: "to" }, { type: "uint256", name: "amount" }], outputs: [{ type: "bool" }], stateMutability: "nonpayable" },
130
+ ];
131
+ // ============================================================================
132
+ // Interest Rate Model ABI (JumpRateModelV2)
133
+ // ============================================================================
134
+ export const INTEREST_RATE_MODEL_ABI = [
135
+ { type: "function", name: "baseRatePerBlock", inputs: [], outputs: [{ type: "uint256" }], stateMutability: "view" },
136
+ { type: "function", name: "multiplierPerBlock", inputs: [], outputs: [{ type: "uint256" }], stateMutability: "view" },
137
+ { type: "function", name: "jumpMultiplierPerBlock", inputs: [], outputs: [{ type: "uint256" }], stateMutability: "view" },
138
+ { type: "function", name: "kink", inputs: [], outputs: [{ type: "uint256" }], stateMutability: "view" },
139
+ {
140
+ type: "function", name: "getBorrowRate",
141
+ inputs: [{ type: "uint256", name: "cash" }, { type: "uint256", name: "borrows" }, { type: "uint256", name: "reserves" }],
142
+ outputs: [{ type: "uint256" }],
143
+ stateMutability: "view",
144
+ },
145
+ {
146
+ type: "function", name: "getSupplyRate",
147
+ inputs: [{ type: "uint256", name: "cash" }, { type: "uint256", name: "borrows" }, { type: "uint256", name: "reserves" }, { type: "uint256", name: "reserveFactorMantissa" }],
148
+ outputs: [{ type: "uint256" }],
149
+ stateMutability: "view",
150
+ },
151
+ ];
152
+ //# sourceMappingURL=abis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abis.js","sourceRoot":"","sources":["../../src/core/abis.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,+EAA+E;AAC/E,4DAA4D;AAC5D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,2BAA2B;IAC3B,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,eAAe,EAAE,MAAM,EAAE;IACtG,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,eAAe,EAAE,MAAM,EAAE;IACxG,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,eA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