recon-crypto-mcp 0.1.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 (204) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +153 -0
  3. package/dist/abis/aave-pool.d.ts +174 -0
  4. package/dist/abis/aave-pool.js +101 -0
  5. package/dist/abis/aave-pool.js.map +1 -0
  6. package/dist/abis/aave-ui-pool-data-provider.d.ts +232 -0
  7. package/dist/abis/aave-ui-pool-data-provider.js +107 -0
  8. package/dist/abis/aave-ui-pool-data-provider.js.map +1 -0
  9. package/dist/abis/access-control.d.ts +94 -0
  10. package/dist/abis/access-control.js +51 -0
  11. package/dist/abis/access-control.js.map +1 -0
  12. package/dist/abis/compound-comet.d.ts +120 -0
  13. package/dist/abis/compound-comet.js +84 -0
  14. package/dist/abis/compound-comet.js.map +1 -0
  15. package/dist/abis/eigenlayer-delegation-manager.d.ts +23 -0
  16. package/dist/abis/eigenlayer-delegation-manager.js +18 -0
  17. package/dist/abis/eigenlayer-delegation-manager.js.map +1 -0
  18. package/dist/abis/eigenlayer-strategy-manager.d.ts +53 -0
  19. package/dist/abis/eigenlayer-strategy-manager.js +47 -0
  20. package/dist/abis/eigenlayer-strategy-manager.js.map +1 -0
  21. package/dist/abis/erc20.d.ts +78 -0
  22. package/dist/abis/erc20.js +10 -0
  23. package/dist/abis/erc20.js.map +1 -0
  24. package/dist/abis/lido.d.ts +80 -0
  25. package/dist/abis/lido.js +60 -0
  26. package/dist/abis/lido.js.map +1 -0
  27. package/dist/abis/morpho-blue.d.ts +321 -0
  28. package/dist/abis/morpho-blue.js +193 -0
  29. package/dist/abis/morpho-blue.js.map +1 -0
  30. package/dist/abis/uniswap-pool.d.ts +70 -0
  31. package/dist/abis/uniswap-pool.js +53 -0
  32. package/dist/abis/uniswap-pool.js.map +1 -0
  33. package/dist/abis/uniswap-position-manager.d.ts +71 -0
  34. package/dist/abis/uniswap-position-manager.js +41 -0
  35. package/dist/abis/uniswap-position-manager.js.map +1 -0
  36. package/dist/config/cache.d.ts +12 -0
  37. package/dist/config/cache.js +12 -0
  38. package/dist/config/cache.js.map +1 -0
  39. package/dist/config/chains.d.ts +24 -0
  40. package/dist/config/chains.js +158 -0
  41. package/dist/config/chains.js.map +1 -0
  42. package/dist/config/contracts.d.ts +107 -0
  43. package/dist/config/contracts.js +123 -0
  44. package/dist/config/contracts.js.map +1 -0
  45. package/dist/config/user-config.d.ts +15 -0
  46. package/dist/config/user-config.js +93 -0
  47. package/dist/config/user-config.js.map +1 -0
  48. package/dist/data/apis/etherscan.d.ts +30 -0
  49. package/dist/data/apis/etherscan.js +109 -0
  50. package/dist/data/apis/etherscan.js.map +1 -0
  51. package/dist/data/cache.d.ts +18 -0
  52. package/dist/data/cache.js +47 -0
  53. package/dist/data/cache.js.map +1 -0
  54. package/dist/data/format.d.ts +6 -0
  55. package/dist/data/format.js +44 -0
  56. package/dist/data/format.js.map +1 -0
  57. package/dist/data/prices.d.ts +12 -0
  58. package/dist/data/prices.js +81 -0
  59. package/dist/data/prices.js.map +1 -0
  60. package/dist/data/rpc.d.ts +17 -0
  61. package/dist/data/rpc.js +68 -0
  62. package/dist/data/rpc.js.map +1 -0
  63. package/dist/index.d.ts +2 -0
  64. package/dist/index.js +344 -0
  65. package/dist/index.js.map +1 -0
  66. package/dist/modules/balances/index.d.ts +20 -0
  67. package/dist/modules/balances/index.js +49 -0
  68. package/dist/modules/balances/index.js.map +1 -0
  69. package/dist/modules/balances/schemas.d.ts +32 -0
  70. package/dist/modules/balances/schemas.js +21 -0
  71. package/dist/modules/balances/schemas.js.map +1 -0
  72. package/dist/modules/bitcoin/index.d.ts +26 -0
  73. package/dist/modules/bitcoin/index.js +128 -0
  74. package/dist/modules/bitcoin/index.js.map +1 -0
  75. package/dist/modules/bitcoin/schemas.d.ts +49 -0
  76. package/dist/modules/bitcoin/schemas.js +51 -0
  77. package/dist/modules/bitcoin/schemas.js.map +1 -0
  78. package/dist/modules/bitcoin/send.d.ts +52 -0
  79. package/dist/modules/bitcoin/send.js +158 -0
  80. package/dist/modules/bitcoin/send.js.map +1 -0
  81. package/dist/modules/bitcoin/utxo.d.ts +99 -0
  82. package/dist/modules/bitcoin/utxo.js +116 -0
  83. package/dist/modules/bitcoin/utxo.js.map +1 -0
  84. package/dist/modules/compound/actions.d.ts +8 -0
  85. package/dist/modules/compound/actions.js +154 -0
  86. package/dist/modules/compound/actions.js.map +1 -0
  87. package/dist/modules/compound/index.d.ts +26 -0
  88. package/dist/modules/compound/index.js +141 -0
  89. package/dist/modules/compound/index.js.map +1 -0
  90. package/dist/modules/compound/schemas.d.ts +95 -0
  91. package/dist/modules/compound/schemas.js +37 -0
  92. package/dist/modules/compound/schemas.js.map +1 -0
  93. package/dist/modules/execution/index.d.ts +51 -0
  94. package/dist/modules/execution/index.js +271 -0
  95. package/dist/modules/execution/index.js.map +1 -0
  96. package/dist/modules/execution/schemas.d.ts +183 -0
  97. package/dist/modules/execution/schemas.js +88 -0
  98. package/dist/modules/execution/schemas.js.map +1 -0
  99. package/dist/modules/feedback/index.d.ts +28 -0
  100. package/dist/modules/feedback/index.js +161 -0
  101. package/dist/modules/feedback/index.js.map +1 -0
  102. package/dist/modules/feedback/rate-limit.d.ts +15 -0
  103. package/dist/modules/feedback/rate-limit.js +110 -0
  104. package/dist/modules/feedback/rate-limit.js.map +1 -0
  105. package/dist/modules/feedback/schemas.d.ts +41 -0
  106. package/dist/modules/feedback/schemas.js +40 -0
  107. package/dist/modules/feedback/schemas.js.map +1 -0
  108. package/dist/modules/morpho/actions.d.ts +8 -0
  109. package/dist/modules/morpho/actions.js +265 -0
  110. package/dist/modules/morpho/actions.js.map +1 -0
  111. package/dist/modules/morpho/index.d.ts +26 -0
  112. package/dist/modules/morpho/index.js +94 -0
  113. package/dist/modules/morpho/index.js.map +1 -0
  114. package/dist/modules/morpho/schemas.d.ts +130 -0
  115. package/dist/modules/morpho/schemas.js +34 -0
  116. package/dist/modules/morpho/schemas.js.map +1 -0
  117. package/dist/modules/portfolio/index.d.ts +3 -0
  118. package/dist/modules/portfolio/index.js +197 -0
  119. package/dist/modules/portfolio/index.js.map +1 -0
  120. package/dist/modules/portfolio/schemas.d.ts +20 -0
  121. package/dist/modules/portfolio/schemas.js +15 -0
  122. package/dist/modules/portfolio/schemas.js.map +1 -0
  123. package/dist/modules/positions/aave.d.ts +22 -0
  124. package/dist/modules/positions/aave.js +197 -0
  125. package/dist/modules/positions/aave.js.map +1 -0
  126. package/dist/modules/positions/actions.d.ts +18 -0
  127. package/dist/modules/positions/actions.js +205 -0
  128. package/dist/modules/positions/actions.js.map +1 -0
  129. package/dist/modules/positions/index.d.ts +37 -0
  130. package/dist/modules/positions/index.js +59 -0
  131. package/dist/modules/positions/index.js.map +1 -0
  132. package/dist/modules/positions/schemas.d.ts +55 -0
  133. package/dist/modules/positions/schemas.js +25 -0
  134. package/dist/modules/positions/schemas.js.map +1 -0
  135. package/dist/modules/positions/uniswap.d.ts +4 -0
  136. package/dist/modules/positions/uniswap.js +181 -0
  137. package/dist/modules/positions/uniswap.js.map +1 -0
  138. package/dist/modules/prices/index.d.ts +19 -0
  139. package/dist/modules/prices/index.js +22 -0
  140. package/dist/modules/prices/index.js.map +1 -0
  141. package/dist/modules/security/index.d.ts +26 -0
  142. package/dist/modules/security/index.js +13 -0
  143. package/dist/modules/security/index.js.map +1 -0
  144. package/dist/modules/security/permissions.d.ts +8 -0
  145. package/dist/modules/security/permissions.js +96 -0
  146. package/dist/modules/security/permissions.js.map +1 -0
  147. package/dist/modules/security/risk-score.d.ts +18 -0
  148. package/dist/modules/security/risk-score.js +116 -0
  149. package/dist/modules/security/risk-score.js.map +1 -0
  150. package/dist/modules/security/schemas.d.ts +31 -0
  151. package/dist/modules/security/schemas.js +16 -0
  152. package/dist/modules/security/schemas.js.map +1 -0
  153. package/dist/modules/security/verification.d.ts +4 -0
  154. package/dist/modules/security/verification.js +82 -0
  155. package/dist/modules/security/verification.js.map +1 -0
  156. package/dist/modules/shared/approval.d.ts +71 -0
  157. package/dist/modules/shared/approval.js +130 -0
  158. package/dist/modules/shared/approval.js.map +1 -0
  159. package/dist/modules/staking/actions.d.ts +22 -0
  160. package/dist/modules/staking/actions.js +100 -0
  161. package/dist/modules/staking/actions.js.map +1 -0
  162. package/dist/modules/staking/eigenlayer.d.ts +14 -0
  163. package/dist/modules/staking/eigenlayer.js +105 -0
  164. package/dist/modules/staking/eigenlayer.js.map +1 -0
  165. package/dist/modules/staking/index.d.ts +24 -0
  166. package/dist/modules/staking/index.js +59 -0
  167. package/dist/modules/staking/index.js.map +1 -0
  168. package/dist/modules/staking/lido.d.ts +14 -0
  169. package/dist/modules/staking/lido.js +113 -0
  170. package/dist/modules/staking/lido.js.map +1 -0
  171. package/dist/modules/staking/schemas.d.ts +34 -0
  172. package/dist/modules/staking/schemas.js +20 -0
  173. package/dist/modules/staking/schemas.js.map +1 -0
  174. package/dist/modules/swap/index.d.ts +47 -0
  175. package/dist/modules/swap/index.js +376 -0
  176. package/dist/modules/swap/index.js.map +1 -0
  177. package/dist/modules/swap/lifi.d.ts +17 -0
  178. package/dist/modules/swap/lifi.js +44 -0
  179. package/dist/modules/swap/lifi.js.map +1 -0
  180. package/dist/modules/swap/oneinch.d.ts +26 -0
  181. package/dist/modules/swap/oneinch.js +33 -0
  182. package/dist/modules/swap/oneinch.js.map +1 -0
  183. package/dist/modules/swap/schemas.d.ts +65 -0
  184. package/dist/modules/swap/schemas.js +46 -0
  185. package/dist/modules/swap/schemas.js.map +1 -0
  186. package/dist/setup.d.ts +2 -0
  187. package/dist/setup.js +257 -0
  188. package/dist/setup.js.map +1 -0
  189. package/dist/signing/pre-sign-check.d.ts +8 -0
  190. package/dist/signing/pre-sign-check.js +231 -0
  191. package/dist/signing/pre-sign-check.js.map +1 -0
  192. package/dist/signing/session.d.ts +28 -0
  193. package/dist/signing/session.js +26 -0
  194. package/dist/signing/session.js.map +1 -0
  195. package/dist/signing/tx-store.d.ts +29 -0
  196. package/dist/signing/tx-store.js +85 -0
  197. package/dist/signing/tx-store.js.map +1 -0
  198. package/dist/signing/walletconnect.d.ts +33 -0
  199. package/dist/signing/walletconnect.js +226 -0
  200. package/dist/signing/walletconnect.js.map +1 -0
  201. package/dist/types/index.d.ts +222 -0
  202. package/dist/types/index.js +18 -0
  203. package/dist/types/index.js.map +1 -0
  204. package/package.json +134 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Viacheslav Zhygulin
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,153 @@
1
+ # Recon Crypto MCP
2
+
3
+ [![npm version](https://img.shields.io/npm/v/recon-crypto-mcp.svg)](https://www.npmjs.com/package/recon-crypto-mcp)
4
+ [![license](https://img.shields.io/npm/l/recon-crypto-mcp.svg)](./LICENSE)
5
+ [![node](https://img.shields.io/node/v/recon-crypto-mcp.svg)](package.json)
6
+
7
+ **Self-custodial crypto portfolio and DeFi, managed by AI agents — signed on your Ledger hardware wallet.**
8
+
9
+ Recon Crypto MCP is a Model Context Protocol server that lets AI agents — **Claude Code, Claude Desktop, Cursor**, and any MCP-compatible client — read your on-chain positions across **Ethereum, Arbitrum, and Polygon** and prepare EVM transactions that you sign on your **Ledger device via WalletConnect**. Your private keys never leave the hardware wallet, and every transaction is previewed in human-readable form before you approve it on the device.
10
+
11
+ Supported protocols: **Aave V3, Compound V3 (Comet), Morpho Blue, Uniswap V3 LP, Lido (stETH/wstETH), EigenLayer**, plus **LiFi** for swap/bridge aggregation and **1inch** for optional intra-chain quote comparison.
12
+
13
+ Use it when you want to:
14
+
15
+ - Ask an agent *"what are my DeFi positions across Ethereum, Arbitrum, and Polygon?"* and get a unified portfolio view (wallet balances + Aave/Compound/Morpho lending + Uniswap V3 LP + Lido/EigenLayer staking) with USD totals.
16
+ - Get liquidation-risk alerts (*"any position below health factor 1.5?"*) without manually checking dashboards.
17
+ - Swap or bridge tokens — the agent prepares the route via LiFi, you sign on Ledger.
18
+ - Supply, borrow, repay, withdraw on lending protocols; stake ETH on Lido; deposit into EigenLayer strategies; send ETH or ERC-20 tokens — all through Ledger-signed transactions.
19
+ - Assess protocol security before interacting with it: contract verification, EIP-1967 proxy/admin keys, privileged roles (Ownable, AccessControl, Gnosis Safe multisig, Timelock), and a DefiLlama-backed 0–100 risk score.
20
+ - Look up token prices, resolve ENS names, and poll transaction status.
21
+
22
+ This is an **agent-driven portfolio management** tool, not a wallet replacement. The MCP never holds keys or broadcasts anything you haven't approved on your Ledger device.
23
+
24
+ ## Features
25
+
26
+ - **Positions** — lending/borrowing (Aave, Compound, Morpho), LP positions, and health-factor alerts
27
+ - **Portfolio** — cross-chain balances, DeFi position aggregation, USD-denominated summaries
28
+ - **Staking** — Lido, EigenLayer, reward aggregation, yield estimation
29
+ - **Security** — contract verification, upgradeability checks, privileged-role enumeration, protocol risk scoring
30
+ - **Swaps** — LiFi-routed intra-chain and cross-chain quotes; intra-chain routes are also cross-checked against 1inch (when an API key is configured) with a `bestSource` hint and output-delta savings
31
+ - **Execution** — tx preparation for Aave, Compound, Morpho, Lido, EigenLayer, native/token sends, swaps; signing via Ledger Live (WalletConnect) for EVM chains
32
+ - **Utilities** — ENS forward/reverse resolution, token balances, transaction status
33
+
34
+ ## Supported chains
35
+
36
+ EVM: Ethereum, Arbitrum, Polygon.
37
+
38
+ ## Roadmap
39
+
40
+ - **MetaMask support** (WalletConnect) — planned for the next release, alongside the existing Ledger Live integration. Will let users sign through a MetaMask-paired session when a hardware wallet isn't available.
41
+ - **Base** — coming soon. EVM L2, reuses the existing viem/Aave V3/LiFi tooling.
42
+ - **Solana** — coming soon. Non-EVM: introduces a separate SDK (`@solana/web3.js`), base58 addresses, and the WalletConnect `solana:` namespace for signing.
43
+
44
+ ## Tools exposed to the agent
45
+
46
+ Read-only (no Ledger pairing required):
47
+
48
+ - `get_portfolio_summary` — cross-chain portfolio aggregation with USD totals
49
+ - `get_lending_positions` — Aave V3 collateral/debt/health-factor per wallet
50
+ - `get_compound_positions` — Compound V3 (Comet) base + collateral positions
51
+ - `get_morpho_positions` — Morpho Blue positions across specified markets
52
+ - `get_lp_positions` — Uniswap V3 LP positions, fee tier, in-range, IL estimate
53
+ - `get_staking_positions`, `get_staking_rewards`, `estimate_staking_yield` — Lido + EigenLayer
54
+ - `get_health_alerts` — Aave positions near liquidation
55
+ - `simulate_position_change` — projected Aave health factor for a hypothetical action
56
+ - `get_token_balance`, `get_token_price` — balances and DefiLlama prices
57
+ - `resolve_ens_name`, `reverse_resolve_ens` — ENS forward/reverse
58
+ - `get_swap_quote` — LiFi quote (optionally cross-checked against 1inch)
59
+ - `check_contract_security`, `check_permission_risks`, `get_protocol_risk_score` — risk tooling
60
+ - `get_transaction_status` — poll inclusion by hash
61
+
62
+ Meta:
63
+
64
+ - `request_capability` — agent-facing escape hatch: files a GitHub issue on this repo when the user asks for something recon-crypto-mcp can't do (new protocol, new chain, missing tool). Default mode returns a pre-filled issue URL (zero spam risk — user must click to submit). Operators can set `RECON_FEEDBACK_ENDPOINT` to a proxy that posts directly. Rate-limited: 30s between calls, 3/hour, 10/day, 7-day dedupe on identical summaries.
65
+
66
+ Execution (Ledger-signed via WalletConnect):
67
+
68
+ - `pair_ledger_live`, `get_ledger_status` — session management and account discovery
69
+ - `prepare_aave_supply` / `_withdraw` / `_borrow` / `_repay`
70
+ - `prepare_compound_supply` / `_withdraw` / `_borrow` / `_repay`
71
+ - `prepare_morpho_supply` / `_withdraw` / `_borrow` / `_repay` / `_supply_collateral` / `_withdraw_collateral`
72
+ - `prepare_lido_stake`, `prepare_lido_unstake`
73
+ - `prepare_eigenlayer_deposit`
74
+ - `prepare_swap` — LiFi-routed intra- or cross-chain swap/bridge
75
+ - `prepare_native_send`, `prepare_token_send`
76
+ - `send_transaction` — forwards a prepared tx to Ledger Live for user approval
77
+
78
+ ## Requirements
79
+
80
+ - Node.js >= 18.17
81
+ - An RPC provider (Infura, Alchemy, or custom) for the EVM chains
82
+ - Optional: Etherscan API key, 1inch Developer Portal API key (enables swap-quote comparison), WalletConnect Cloud project ID (required for Ledger signing)
83
+
84
+ ## Install
85
+
86
+ ### From npm (recommended)
87
+
88
+ ```bash
89
+ npm install -g recon-crypto-mcp
90
+ recon-crypto-mcp-setup
91
+ ```
92
+
93
+ ### From source
94
+
95
+ ```bash
96
+ git clone https://github.com/szhygulin/recon-crypto-mcp.git
97
+ cd recon-crypto-mcp
98
+ npm install
99
+ npm run build
100
+ ```
101
+
102
+ ## Setup
103
+
104
+ Run the interactive setup to pick an RPC provider, validate the key, optionally pair Ledger Live, and write `~/.recon-crypto-mcp/config.json`:
105
+
106
+ ```bash
107
+ npm run setup
108
+ ```
109
+
110
+ Environment variables always override the config file at runtime.
111
+
112
+ ## Use with Claude Desktop
113
+
114
+ Add to `claude_desktop_config.json`:
115
+
116
+ ```json
117
+ {
118
+ "mcpServers": {
119
+ "recon-crypto-mcp": {
120
+ "command": "recon-crypto-mcp"
121
+ }
122
+ }
123
+ }
124
+ ```
125
+
126
+ (If you installed from source rather than via `npm i -g`, swap `"command": "recon-crypto-mcp"` for `"command": "node"` and `"args": ["/absolute/path/to/recon-crypto-mcp/dist/index.js"]`.)
127
+
128
+ The setup script prints a ready-to-paste snippet.
129
+
130
+ ## Environment variables
131
+
132
+ All are optional if the matching field is in `~/.recon-crypto-mcp/config.json`; env vars take precedence when both are set.
133
+
134
+ - `ETHEREUM_RPC_URL`, `ARBITRUM_RPC_URL`, `POLYGON_RPC_URL` — custom RPC endpoints
135
+ - `RPC_PROVIDER` (`infura` | `alchemy`) + `RPC_API_KEY` — alternative to custom URLs
136
+ - `ETHERSCAN_API_KEY` — contract verification lookups
137
+ - `ONEINCH_API_KEY` — enables 1inch quote comparison in `get_swap_quote`
138
+ - `WALLETCONNECT_PROJECT_ID` — required for Ledger Live signing
139
+ - `RPC_BATCH=1` — opt into JSON-RPC batching (off by default; many public endpoints mishandle batched POSTs)
140
+ - `RECON_ALLOW_INSECURE_RPC=1` — opt out of the https/private-IP check on RPC URLs. Only set this when pointing at a local anvil/hardhat fork; never in production.
141
+ - `RECON_FEEDBACK_ENDPOINT` — optional https URL for `request_capability` to POST directly (e.g. a maintainer-operated proxy that creates GitHub issues with a bot token). When unset (the default), `request_capability` returns a pre-filled GitHub issue URL for the user to click through; nothing is transmitted automatically. **Operator responsibility:** the recon-crypto-mcp client does not sign or authenticate POST requests. If you set this endpoint, the proxy MUST enforce its own auth (IP allowlist, Cloudflare Access, HMAC header validation, etc.) — otherwise any caller who learns the URL can submit to it. The on-process rate limiter (3/hour, 10/day) is a courtesy, not a security control.
142
+
143
+ ## Development
144
+
145
+ ```bash
146
+ npm run dev # tsc --watch
147
+ npm test # vitest run
148
+ npm run test:watch
149
+ ```
150
+
151
+ ## License
152
+
153
+ MIT — see [LICENSE](./LICENSE).
@@ -0,0 +1,174 @@
1
+ export declare const aavePoolAbi: readonly [{
2
+ readonly type: "function";
3
+ readonly name: "getUserAccountData";
4
+ readonly stateMutability: "view";
5
+ readonly inputs: readonly [{
6
+ readonly name: "user";
7
+ readonly type: "address";
8
+ }];
9
+ readonly outputs: readonly [{
10
+ readonly name: "totalCollateralBase";
11
+ readonly type: "uint256";
12
+ }, {
13
+ readonly name: "totalDebtBase";
14
+ readonly type: "uint256";
15
+ }, {
16
+ readonly name: "availableBorrowsBase";
17
+ readonly type: "uint256";
18
+ }, {
19
+ readonly name: "currentLiquidationThreshold";
20
+ readonly type: "uint256";
21
+ }, {
22
+ readonly name: "ltv";
23
+ readonly type: "uint256";
24
+ }, {
25
+ readonly name: "healthFactor";
26
+ readonly type: "uint256";
27
+ }];
28
+ }, {
29
+ readonly type: "function";
30
+ readonly name: "supply";
31
+ readonly stateMutability: "nonpayable";
32
+ readonly inputs: readonly [{
33
+ readonly name: "asset";
34
+ readonly type: "address";
35
+ }, {
36
+ readonly name: "amount";
37
+ readonly type: "uint256";
38
+ }, {
39
+ readonly name: "onBehalfOf";
40
+ readonly type: "address";
41
+ }, {
42
+ readonly name: "referralCode";
43
+ readonly type: "uint16";
44
+ }];
45
+ readonly outputs: readonly [];
46
+ }, {
47
+ readonly type: "function";
48
+ readonly name: "withdraw";
49
+ readonly stateMutability: "nonpayable";
50
+ readonly inputs: readonly [{
51
+ readonly name: "asset";
52
+ readonly type: "address";
53
+ }, {
54
+ readonly name: "amount";
55
+ readonly type: "uint256";
56
+ }, {
57
+ readonly name: "to";
58
+ readonly type: "address";
59
+ }];
60
+ readonly outputs: readonly [{
61
+ readonly type: "uint256";
62
+ }];
63
+ }, {
64
+ readonly type: "function";
65
+ readonly name: "borrow";
66
+ readonly stateMutability: "nonpayable";
67
+ readonly inputs: readonly [{
68
+ readonly name: "asset";
69
+ readonly type: "address";
70
+ }, {
71
+ readonly name: "amount";
72
+ readonly type: "uint256";
73
+ }, {
74
+ readonly name: "interestRateMode";
75
+ readonly type: "uint256";
76
+ }, {
77
+ readonly name: "referralCode";
78
+ readonly type: "uint16";
79
+ }, {
80
+ readonly name: "onBehalfOf";
81
+ readonly type: "address";
82
+ }];
83
+ readonly outputs: readonly [];
84
+ }, {
85
+ readonly type: "function";
86
+ readonly name: "repay";
87
+ readonly stateMutability: "nonpayable";
88
+ readonly inputs: readonly [{
89
+ readonly name: "asset";
90
+ readonly type: "address";
91
+ }, {
92
+ readonly name: "amount";
93
+ readonly type: "uint256";
94
+ }, {
95
+ readonly name: "interestRateMode";
96
+ readonly type: "uint256";
97
+ }, {
98
+ readonly name: "onBehalfOf";
99
+ readonly type: "address";
100
+ }];
101
+ readonly outputs: readonly [{
102
+ readonly type: "uint256";
103
+ }];
104
+ }, {
105
+ readonly type: "function";
106
+ readonly name: "getReserveData";
107
+ readonly stateMutability: "view";
108
+ readonly inputs: readonly [{
109
+ readonly name: "asset";
110
+ readonly type: "address";
111
+ }];
112
+ readonly outputs: readonly [{
113
+ readonly type: "tuple";
114
+ readonly components: readonly [{
115
+ readonly name: "configuration";
116
+ readonly type: "tuple";
117
+ readonly components: readonly [{
118
+ readonly name: "data";
119
+ readonly type: "uint256";
120
+ }];
121
+ }, {
122
+ readonly name: "liquidityIndex";
123
+ readonly type: "uint128";
124
+ }, {
125
+ readonly name: "currentLiquidityRate";
126
+ readonly type: "uint128";
127
+ }, {
128
+ readonly name: "variableBorrowIndex";
129
+ readonly type: "uint128";
130
+ }, {
131
+ readonly name: "currentVariableBorrowRate";
132
+ readonly type: "uint128";
133
+ }, {
134
+ readonly name: "currentStableBorrowRate";
135
+ readonly type: "uint128";
136
+ }, {
137
+ readonly name: "lastUpdateTimestamp";
138
+ readonly type: "uint40";
139
+ }, {
140
+ readonly name: "id";
141
+ readonly type: "uint16";
142
+ }, {
143
+ readonly name: "aTokenAddress";
144
+ readonly type: "address";
145
+ }, {
146
+ readonly name: "stableDebtTokenAddress";
147
+ readonly type: "address";
148
+ }, {
149
+ readonly name: "variableDebtTokenAddress";
150
+ readonly type: "address";
151
+ }, {
152
+ readonly name: "interestRateStrategyAddress";
153
+ readonly type: "address";
154
+ }, {
155
+ readonly name: "accruedToTreasury";
156
+ readonly type: "uint128";
157
+ }, {
158
+ readonly name: "unbacked";
159
+ readonly type: "uint128";
160
+ }, {
161
+ readonly name: "isolationModeTotalDebt";
162
+ readonly type: "uint128";
163
+ }];
164
+ }];
165
+ }];
166
+ export declare const aavePoolAddressProviderAbi: readonly [{
167
+ readonly type: "function";
168
+ readonly name: "getPool";
169
+ readonly stateMutability: "view";
170
+ readonly inputs: readonly [];
171
+ readonly outputs: readonly [{
172
+ readonly type: "address";
173
+ }];
174
+ }];
@@ -0,0 +1,101 @@
1
+ // Aave V3 Pool — subset of functions used.
2
+ export const aavePoolAbi = [
3
+ {
4
+ type: "function",
5
+ name: "getUserAccountData",
6
+ stateMutability: "view",
7
+ inputs: [{ name: "user", type: "address" }],
8
+ outputs: [
9
+ { name: "totalCollateralBase", type: "uint256" },
10
+ { name: "totalDebtBase", type: "uint256" },
11
+ { name: "availableBorrowsBase", type: "uint256" },
12
+ { name: "currentLiquidationThreshold", type: "uint256" },
13
+ { name: "ltv", type: "uint256" },
14
+ { name: "healthFactor", type: "uint256" },
15
+ ],
16
+ },
17
+ {
18
+ type: "function",
19
+ name: "supply",
20
+ stateMutability: "nonpayable",
21
+ inputs: [
22
+ { name: "asset", type: "address" },
23
+ { name: "amount", type: "uint256" },
24
+ { name: "onBehalfOf", type: "address" },
25
+ { name: "referralCode", type: "uint16" },
26
+ ],
27
+ outputs: [],
28
+ },
29
+ {
30
+ type: "function",
31
+ name: "withdraw",
32
+ stateMutability: "nonpayable",
33
+ inputs: [
34
+ { name: "asset", type: "address" },
35
+ { name: "amount", type: "uint256" },
36
+ { name: "to", type: "address" },
37
+ ],
38
+ outputs: [{ type: "uint256" }],
39
+ },
40
+ {
41
+ type: "function",
42
+ name: "borrow",
43
+ stateMutability: "nonpayable",
44
+ inputs: [
45
+ { name: "asset", type: "address" },
46
+ { name: "amount", type: "uint256" },
47
+ { name: "interestRateMode", type: "uint256" },
48
+ { name: "referralCode", type: "uint16" },
49
+ { name: "onBehalfOf", type: "address" },
50
+ ],
51
+ outputs: [],
52
+ },
53
+ {
54
+ type: "function",
55
+ name: "repay",
56
+ stateMutability: "nonpayable",
57
+ inputs: [
58
+ { name: "asset", type: "address" },
59
+ { name: "amount", type: "uint256" },
60
+ { name: "interestRateMode", type: "uint256" },
61
+ { name: "onBehalfOf", type: "address" },
62
+ ],
63
+ outputs: [{ type: "uint256" }],
64
+ },
65
+ {
66
+ type: "function",
67
+ name: "getReserveData",
68
+ stateMutability: "view",
69
+ inputs: [{ name: "asset", type: "address" }],
70
+ outputs: [
71
+ {
72
+ type: "tuple",
73
+ components: [
74
+ {
75
+ name: "configuration",
76
+ type: "tuple",
77
+ components: [{ name: "data", type: "uint256" }],
78
+ },
79
+ { name: "liquidityIndex", type: "uint128" },
80
+ { name: "currentLiquidityRate", type: "uint128" },
81
+ { name: "variableBorrowIndex", type: "uint128" },
82
+ { name: "currentVariableBorrowRate", type: "uint128" },
83
+ { name: "currentStableBorrowRate", type: "uint128" },
84
+ { name: "lastUpdateTimestamp", type: "uint40" },
85
+ { name: "id", type: "uint16" },
86
+ { name: "aTokenAddress", type: "address" },
87
+ { name: "stableDebtTokenAddress", type: "address" },
88
+ { name: "variableDebtTokenAddress", type: "address" },
89
+ { name: "interestRateStrategyAddress", type: "address" },
90
+ { name: "accruedToTreasury", type: "uint128" },
91
+ { name: "unbacked", type: "uint128" },
92
+ { name: "isolationModeTotalDebt", type: "uint128" },
93
+ ],
94
+ },
95
+ ],
96
+ },
97
+ ];
98
+ export const aavePoolAddressProviderAbi = [
99
+ { type: "function", name: "getPool", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
100
+ ];
101
+ //# sourceMappingURL=aave-pool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aave-pool.js","sourceRoot":"","sources":["../../src/abis/aave-pool.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB;Q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