@avaprotocol/protocols 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 (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +164 -0
  3. package/dist/chains.d.ts +9 -0
  4. package/dist/chains.d.ts.map +1 -0
  5. package/dist/index.cjs +848 -0
  6. package/dist/index.d.ts +3 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +803 -0
  9. package/dist/protocols/aave-v3.d.ts +21 -0
  10. package/dist/protocols/aave-v3.d.ts.map +1 -0
  11. package/dist/protocols/aerodrome.d.ts +4 -0
  12. package/dist/protocols/aerodrome.d.ts.map +1 -0
  13. package/dist/protocols/chainlink.d.ts +7 -0
  14. package/dist/protocols/chainlink.d.ts.map +1 -0
  15. package/dist/protocols/common.d.ts +16 -0
  16. package/dist/protocols/common.d.ts.map +1 -0
  17. package/dist/protocols/compound-v3.d.ts +4 -0
  18. package/dist/protocols/compound-v3.d.ts.map +1 -0
  19. package/dist/protocols/erc20.d.ts +5 -0
  20. package/dist/protocols/erc20.d.ts.map +1 -0
  21. package/dist/protocols/ethena.d.ts +7 -0
  22. package/dist/protocols/ethena.d.ts.map +1 -0
  23. package/dist/protocols/frax-ether.d.ts +7 -0
  24. package/dist/protocols/frax-ether.d.ts.map +1 -0
  25. package/dist/protocols/index.d.ts +133 -0
  26. package/dist/protocols/index.d.ts.map +1 -0
  27. package/dist/protocols/lido.d.ts +7 -0
  28. package/dist/protocols/lido.d.ts.map +1 -0
  29. package/dist/protocols/morpho.d.ts +6 -0
  30. package/dist/protocols/morpho.d.ts.map +1 -0
  31. package/dist/protocols/rocket-pool.d.ts +6 -0
  32. package/dist/protocols/rocket-pool.d.ts.map +1 -0
  33. package/dist/protocols/sky.d.ts +6 -0
  34. package/dist/protocols/sky.d.ts.map +1 -0
  35. package/dist/protocols/spark.d.ts +4 -0
  36. package/dist/protocols/spark.d.ts.map +1 -0
  37. package/dist/protocols/superfluid.d.ts +6 -0
  38. package/dist/protocols/superfluid.d.ts.map +1 -0
  39. package/dist/protocols/types.d.ts +17 -0
  40. package/dist/protocols/types.d.ts.map +1 -0
  41. package/dist/protocols/uniswap-v3.d.ts +27 -0
  42. package/dist/protocols/uniswap-v3.d.ts.map +1 -0
  43. package/dist/protocols/wrapped.d.ts +6 -0
  44. package/dist/protocols/wrapped.d.ts.map +1 -0
  45. package/package.json +71 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,848 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ Chains: () => Chains,
24
+ Protocols: () => Protocols,
25
+ aaveV3: () => aaveV3,
26
+ aerodrome: () => aerodrome,
27
+ aggregatorV3Abi: () => aggregatorV3Abi,
28
+ chainlink: () => chainlink,
29
+ compoundV3: () => compoundV3,
30
+ erc20: () => erc20,
31
+ erc4626VaultAbi: () => erc4626VaultAbi,
32
+ ethena: () => ethena,
33
+ fraxEther: () => fraxEther,
34
+ lido: () => lido,
35
+ morphoBlue: () => morphoBlue,
36
+ rocketPool: () => rocketPool,
37
+ sky: () => sky,
38
+ spark: () => spark,
39
+ superfluid: () => superfluid,
40
+ uniswapV3: () => uniswapV3,
41
+ wrapped: () => wrapped
42
+ });
43
+ module.exports = __toCommonJS(index_exports);
44
+
45
+ // src/chains.ts
46
+ var Chains = Object.freeze({
47
+ EthereumMainnet: 1,
48
+ Sepolia: 11155111,
49
+ Holesky: 17e3,
50
+ BaseMainnet: 8453,
51
+ BaseSepolia: 84532
52
+ });
53
+
54
+ // src/protocols/aave-v3.ts
55
+ var pool = {
56
+ [Chains.EthereumMainnet]: "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
57
+ [Chains.Sepolia]: "0x6Ae43d3271ff6888e7Fc43Fd7321a503ff738951",
58
+ [Chains.BaseMainnet]: "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5",
59
+ [Chains.BaseSepolia]: "0x8bAB6d1b75f19e9eD9fCe8b9BD338844fF79aE27"
60
+ };
61
+ var oracle = {
62
+ [Chains.EthereumMainnet]: "0x54586bE62E3c3580375aE3723C145253060Ca0C2",
63
+ [Chains.Sepolia]: "0x2da88497588bf89281816106C7259e31AF45a663",
64
+ [Chains.BaseMainnet]: "0x2Cc0Fc26eD4563A5ce5e8bdcfe1A2878676Ae156",
65
+ [Chains.BaseSepolia]: "0x943b0dE18d4abf4eF02A85912F8fc07684C141dF"
66
+ };
67
+ var wethGateway = {
68
+ [Chains.EthereumMainnet]: "0xd01607c3C5eCABa394D8be377a08590149325722",
69
+ [Chains.Sepolia]: "0x387d311e47e80b498169e6fb51d3193167d89F7D",
70
+ [Chains.BaseMainnet]: "0xa0d9C1E9E48Ca30c8d8C3B5D69FF5dc1f6DFfC24",
71
+ [Chains.BaseSepolia]: "0x0568130e794429D2eEBC4dafE18f25Ff1a1ed8b6"
72
+ };
73
+ var eventTopics = Object.freeze({
74
+ Supply: "0x2b627736bca15cd5381dcf80b0bf11fd197d01a037c52b927a881a10fb73ba61",
75
+ Withdraw: "0x3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7",
76
+ Borrow: "0xb3d084820fb1a9decffb176436bd02558d15fac9b0ddfed8c465bc7359d7dce0",
77
+ Repay: "0xa534c8dbe71f871f9f3530e97a74601fea17b426cae02e1c5aee42c96c784051",
78
+ LiquidationCall: "0xe413a321e8681d831f4dbccbca790d2952b56f977908e45be37335533e005286"
79
+ });
80
+ var poolEventsAbi = Object.freeze([
81
+ {
82
+ anonymous: false,
83
+ inputs: [
84
+ { indexed: true, internalType: "address", name: "reserve", type: "address" },
85
+ { indexed: false, internalType: "address", name: "user", type: "address" },
86
+ { indexed: true, internalType: "address", name: "onBehalfOf", type: "address" },
87
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
88
+ { indexed: true, internalType: "uint16", name: "referralCode", type: "uint16" }
89
+ ],
90
+ name: "Supply",
91
+ type: "event"
92
+ },
93
+ {
94
+ anonymous: false,
95
+ inputs: [
96
+ { indexed: true, internalType: "address", name: "reserve", type: "address" },
97
+ { indexed: true, internalType: "address", name: "user", type: "address" },
98
+ { indexed: true, internalType: "address", name: "to", type: "address" },
99
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }
100
+ ],
101
+ name: "Withdraw",
102
+ type: "event"
103
+ },
104
+ {
105
+ anonymous: false,
106
+ inputs: [
107
+ { indexed: true, internalType: "address", name: "reserve", type: "address" },
108
+ { indexed: false, internalType: "address", name: "user", type: "address" },
109
+ { indexed: true, internalType: "address", name: "onBehalfOf", type: "address" },
110
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
111
+ { indexed: false, internalType: "uint8", name: "interestRateMode", type: "uint8" },
112
+ { indexed: false, internalType: "uint256", name: "borrowRate", type: "uint256" },
113
+ { indexed: true, internalType: "uint16", name: "referralCode", type: "uint16" }
114
+ ],
115
+ name: "Borrow",
116
+ type: "event"
117
+ },
118
+ {
119
+ anonymous: false,
120
+ inputs: [
121
+ { indexed: true, internalType: "address", name: "reserve", type: "address" },
122
+ { indexed: true, internalType: "address", name: "user", type: "address" },
123
+ { indexed: true, internalType: "address", name: "repayer", type: "address" },
124
+ { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
125
+ { indexed: false, internalType: "bool", name: "useATokens", type: "bool" }
126
+ ],
127
+ name: "Repay",
128
+ type: "event"
129
+ },
130
+ {
131
+ anonymous: false,
132
+ inputs: [
133
+ { indexed: true, internalType: "address", name: "collateralAsset", type: "address" },
134
+ { indexed: true, internalType: "address", name: "debtAsset", type: "address" },
135
+ { indexed: true, internalType: "address", name: "user", type: "address" },
136
+ { indexed: false, internalType: "uint256", name: "debtToCover", type: "uint256" },
137
+ { indexed: false, internalType: "uint256", name: "liquidatedCollateralAmount", type: "uint256" },
138
+ { indexed: false, internalType: "address", name: "liquidator", type: "address" },
139
+ { indexed: false, internalType: "bool", name: "receiveAToken", type: "bool" }
140
+ ],
141
+ name: "LiquidationCall",
142
+ type: "event"
143
+ }
144
+ ]);
145
+ var poolMethodsAbi = Object.freeze([
146
+ {
147
+ inputs: [{ internalType: "address", name: "user", type: "address" }],
148
+ name: "getUserAccountData",
149
+ outputs: [
150
+ { internalType: "uint256", name: "totalCollateralBase", type: "uint256" },
151
+ { internalType: "uint256", name: "totalDebtBase", type: "uint256" },
152
+ { internalType: "uint256", name: "availableBorrowsBase", type: "uint256" },
153
+ { internalType: "uint256", name: "currentLiquidationThreshold", type: "uint256" },
154
+ { internalType: "uint256", name: "ltv", type: "uint256" },
155
+ { internalType: "uint256", name: "healthFactor", type: "uint256" }
156
+ ],
157
+ stateMutability: "view",
158
+ type: "function"
159
+ },
160
+ {
161
+ inputs: [
162
+ { internalType: "address", name: "asset", type: "address" },
163
+ { internalType: "uint256", name: "amount", type: "uint256" },
164
+ { internalType: "address", name: "onBehalfOf", type: "address" },
165
+ { internalType: "uint16", name: "referralCode", type: "uint16" }
166
+ ],
167
+ name: "supply",
168
+ outputs: [],
169
+ stateMutability: "nonpayable",
170
+ type: "function"
171
+ },
172
+ {
173
+ inputs: [
174
+ { internalType: "address", name: "asset", type: "address" },
175
+ { internalType: "uint256", name: "amount", type: "uint256" },
176
+ { internalType: "uint256", name: "interestRateMode", type: "uint256" },
177
+ { internalType: "uint16", name: "referralCode", type: "uint16" },
178
+ { internalType: "address", name: "onBehalfOf", type: "address" }
179
+ ],
180
+ name: "borrow",
181
+ outputs: [],
182
+ stateMutability: "nonpayable",
183
+ type: "function"
184
+ },
185
+ {
186
+ inputs: [
187
+ { internalType: "address", name: "asset", type: "address" },
188
+ { internalType: "uint256", name: "amount", type: "uint256" },
189
+ { internalType: "uint256", name: "interestRateMode", type: "uint256" },
190
+ { internalType: "address", name: "onBehalfOf", type: "address" }
191
+ ],
192
+ name: "repay",
193
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
194
+ stateMutability: "nonpayable",
195
+ type: "function"
196
+ },
197
+ {
198
+ inputs: [
199
+ { internalType: "address", name: "asset", type: "address" },
200
+ { internalType: "uint256", name: "amount", type: "uint256" },
201
+ { internalType: "address", name: "to", type: "address" }
202
+ ],
203
+ name: "withdraw",
204
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
205
+ stateMutability: "nonpayable",
206
+ type: "function"
207
+ },
208
+ {
209
+ inputs: [
210
+ { internalType: "address", name: "asset", type: "address" },
211
+ { internalType: "bool", name: "useAsCollateral", type: "bool" }
212
+ ],
213
+ name: "setUserUseReserveAsCollateral",
214
+ outputs: [],
215
+ stateMutability: "nonpayable",
216
+ type: "function"
217
+ }
218
+ ]);
219
+ var tokens = Object.freeze({
220
+ LINK: {
221
+ [Chains.Sepolia]: "0xf8Fb3713D459D7C1018BD0A49D19b4C44290EBE5"
222
+ }
223
+ });
224
+ var aaveV3 = Object.freeze({
225
+ pool,
226
+ oracle,
227
+ wethGateway,
228
+ eventTopics,
229
+ poolEventsAbi,
230
+ poolMethodsAbi,
231
+ tokens
232
+ });
233
+
234
+ // src/protocols/aerodrome.ts
235
+ var router = {
236
+ [Chains.BaseMainnet]: "0xcF77a3Ba9A5CA399B7c97c74d54e5b1Beb874E43"
237
+ };
238
+ var aerodrome = Object.freeze({
239
+ router
240
+ });
241
+
242
+ // src/protocols/common.ts
243
+ var aggregatorV3Abi = Object.freeze([
244
+ {
245
+ inputs: [],
246
+ name: "latestRoundData",
247
+ outputs: [
248
+ { internalType: "uint80", name: "roundId", type: "uint80" },
249
+ { internalType: "int256", name: "answer", type: "int256" },
250
+ { internalType: "uint256", name: "startedAt", type: "uint256" },
251
+ { internalType: "uint256", name: "updatedAt", type: "uint256" },
252
+ { internalType: "uint80", name: "answeredInRound", type: "uint80" }
253
+ ],
254
+ stateMutability: "view",
255
+ type: "function"
256
+ },
257
+ {
258
+ inputs: [],
259
+ name: "decimals",
260
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
261
+ stateMutability: "view",
262
+ type: "function"
263
+ }
264
+ ]);
265
+ var erc4626VaultAbi = Object.freeze([
266
+ {
267
+ inputs: [
268
+ { internalType: "uint256", name: "assets", type: "uint256" },
269
+ { internalType: "address", name: "receiver", type: "address" }
270
+ ],
271
+ name: "deposit",
272
+ outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
273
+ stateMutability: "nonpayable",
274
+ type: "function"
275
+ },
276
+ {
277
+ inputs: [
278
+ { internalType: "uint256", name: "shares", type: "uint256" },
279
+ { internalType: "address", name: "receiver", type: "address" },
280
+ { internalType: "address", name: "owner", type: "address" }
281
+ ],
282
+ name: "redeem",
283
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
284
+ stateMutability: "nonpayable",
285
+ type: "function"
286
+ },
287
+ {
288
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
289
+ name: "previewRedeem",
290
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
291
+ stateMutability: "view",
292
+ type: "function"
293
+ },
294
+ {
295
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
296
+ name: "convertToAssets",
297
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
298
+ stateMutability: "view",
299
+ type: "function"
300
+ }
301
+ ]);
302
+
303
+ // src/protocols/chainlink.ts
304
+ var ethUsdFeed = {
305
+ [Chains.EthereumMainnet]: "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419",
306
+ [Chains.Sepolia]: "0x694AA1769357215DE4FAC081bf1f309aDC325306"
307
+ };
308
+ var btcUsdFeed = {
309
+ [Chains.EthereumMainnet]: "0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c"
310
+ };
311
+ var chainlink = Object.freeze({
312
+ ethUsdFeed,
313
+ btcUsdFeed,
314
+ /** Shared AggregatorV3 ABI — works for any Chainlink feed. */
315
+ aggregatorV3Abi
316
+ });
317
+
318
+ // src/protocols/compound-v3.ts
319
+ var cometUsdc = {
320
+ [Chains.EthereumMainnet]: "0xc3d688B66703497DAA19211EEdff47f25384cdc3",
321
+ [Chains.BaseMainnet]: "0xb125E6687d4313864e53df431d5425969c15Eb2F"
322
+ };
323
+ var compoundV3 = Object.freeze({
324
+ cometUsdc
325
+ });
326
+
327
+ // src/protocols/erc20.ts
328
+ var erc20 = Object.freeze({
329
+ approveAbi: Object.freeze([
330
+ {
331
+ inputs: [
332
+ { internalType: "address", name: "spender", type: "address" },
333
+ { internalType: "uint256", name: "amount", type: "uint256" }
334
+ ],
335
+ name: "approve",
336
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
337
+ stateMutability: "nonpayable",
338
+ type: "function"
339
+ }
340
+ ])
341
+ });
342
+
343
+ // src/protocols/ethena.ts
344
+ var susde = {
345
+ [Chains.EthereumMainnet]: "0x9D39A5DE30e57443BfF2A8307A4256c8797A3497"
346
+ };
347
+ var usde = {
348
+ [Chains.EthereumMainnet]: "0x4c9EDD5852cd905f086C759E8383e09bff1E68B3"
349
+ };
350
+ var susdeAbi = Object.freeze([
351
+ {
352
+ inputs: [
353
+ { internalType: "uint256", name: "assets", type: "uint256" },
354
+ { internalType: "address", name: "receiver", type: "address" }
355
+ ],
356
+ name: "deposit",
357
+ outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
358
+ stateMutability: "nonpayable",
359
+ type: "function"
360
+ },
361
+ {
362
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
363
+ name: "cooldownShares",
364
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
365
+ stateMutability: "nonpayable",
366
+ type: "function"
367
+ },
368
+ {
369
+ inputs: [{ internalType: "address", name: "receiver", type: "address" }],
370
+ name: "unstake",
371
+ outputs: [],
372
+ stateMutability: "nonpayable",
373
+ type: "function"
374
+ },
375
+ {
376
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
377
+ name: "previewRedeem",
378
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
379
+ stateMutability: "view",
380
+ type: "function"
381
+ },
382
+ {
383
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
384
+ name: "convertToAssets",
385
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
386
+ stateMutability: "view",
387
+ type: "function"
388
+ }
389
+ ]);
390
+ var ethena = Object.freeze({
391
+ susde,
392
+ usde,
393
+ susdeAbi
394
+ });
395
+
396
+ // src/protocols/frax-ether.ts
397
+ var sfrxeth = {
398
+ [Chains.EthereumMainnet]: "0xac3E018457B222d93114458476f3E3416Abbe38F"
399
+ };
400
+ var frxeth = {
401
+ [Chains.EthereumMainnet]: "0x5E8422345238F34275888049021821E8E08CAa1f"
402
+ };
403
+ var fraxEther = Object.freeze({
404
+ sfrxeth,
405
+ frxeth,
406
+ /** Standard ERC-4626 surface — sfrxETH conforms exactly. */
407
+ vaultAbi: erc4626VaultAbi
408
+ });
409
+
410
+ // src/protocols/lido.ts
411
+ var wsteth = {
412
+ [Chains.EthereumMainnet]: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
413
+ [Chains.BaseMainnet]: "0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452"
414
+ };
415
+ var steth = {
416
+ [Chains.EthereumMainnet]: "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84"
417
+ };
418
+ var wstethAbi = Object.freeze([
419
+ {
420
+ inputs: [{ internalType: "uint256", name: "_stETHAmount", type: "uint256" }],
421
+ name: "wrap",
422
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
423
+ stateMutability: "nonpayable",
424
+ type: "function"
425
+ },
426
+ {
427
+ inputs: [{ internalType: "uint256", name: "_wstETHAmount", type: "uint256" }],
428
+ name: "unwrap",
429
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
430
+ stateMutability: "nonpayable",
431
+ type: "function"
432
+ },
433
+ {
434
+ inputs: [{ internalType: "uint256", name: "_wstETHAmount", type: "uint256" }],
435
+ name: "getStETHByWstETH",
436
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
437
+ stateMutability: "view",
438
+ type: "function"
439
+ }
440
+ ]);
441
+ var lido = Object.freeze({
442
+ wsteth,
443
+ steth,
444
+ wstethAbi
445
+ });
446
+
447
+ // src/protocols/morpho.ts
448
+ var morpho = {
449
+ [Chains.EthereumMainnet]: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
450
+ [Chains.BaseMainnet]: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb"
451
+ };
452
+ var morphoAbi = Object.freeze([
453
+ {
454
+ inputs: [
455
+ {
456
+ components: [
457
+ { internalType: "address", name: "loanToken", type: "address" },
458
+ { internalType: "address", name: "collateralToken", type: "address" },
459
+ { internalType: "address", name: "oracle", type: "address" },
460
+ { internalType: "address", name: "irm", type: "address" },
461
+ { internalType: "uint256", name: "lltv", type: "uint256" }
462
+ ],
463
+ internalType: "struct MarketParams",
464
+ name: "marketParams",
465
+ type: "tuple"
466
+ },
467
+ { internalType: "uint256", name: "assets", type: "uint256" },
468
+ { internalType: "uint256", name: "shares", type: "uint256" },
469
+ { internalType: "address", name: "onBehalf", type: "address" },
470
+ { internalType: "bytes", name: "data", type: "bytes" }
471
+ ],
472
+ name: "supply",
473
+ outputs: [
474
+ { internalType: "uint256", name: "assetsSupplied", type: "uint256" },
475
+ { internalType: "uint256", name: "sharesSupplied", type: "uint256" }
476
+ ],
477
+ stateMutability: "nonpayable",
478
+ type: "function"
479
+ },
480
+ {
481
+ inputs: [
482
+ {
483
+ components: [
484
+ { internalType: "address", name: "loanToken", type: "address" },
485
+ { internalType: "address", name: "collateralToken", type: "address" },
486
+ { internalType: "address", name: "oracle", type: "address" },
487
+ { internalType: "address", name: "irm", type: "address" },
488
+ { internalType: "uint256", name: "lltv", type: "uint256" }
489
+ ],
490
+ internalType: "struct MarketParams",
491
+ name: "marketParams",
492
+ type: "tuple"
493
+ },
494
+ { internalType: "uint256", name: "assets", type: "uint256" },
495
+ { internalType: "uint256", name: "shares", type: "uint256" },
496
+ { internalType: "address", name: "onBehalf", type: "address" },
497
+ { internalType: "address", name: "receiver", type: "address" }
498
+ ],
499
+ name: "borrow",
500
+ outputs: [
501
+ { internalType: "uint256", name: "assetsBorrowed", type: "uint256" },
502
+ { internalType: "uint256", name: "sharesBorrowed", type: "uint256" }
503
+ ],
504
+ stateMutability: "nonpayable",
505
+ type: "function"
506
+ },
507
+ {
508
+ inputs: [
509
+ { internalType: "bytes32", name: "id", type: "bytes32" },
510
+ { internalType: "address", name: "user", type: "address" }
511
+ ],
512
+ name: "position",
513
+ outputs: [
514
+ { internalType: "uint256", name: "supplyShares", type: "uint256" },
515
+ { internalType: "uint128", name: "borrowShares", type: "uint128" },
516
+ { internalType: "uint128", name: "collateral", type: "uint128" }
517
+ ],
518
+ stateMutability: "view",
519
+ type: "function"
520
+ }
521
+ ]);
522
+ var morphoBlue = Object.freeze({
523
+ morpho,
524
+ morphoAbi
525
+ });
526
+
527
+ // src/protocols/rocket-pool.ts
528
+ var reth = {
529
+ [Chains.EthereumMainnet]: "0xae78736Cd615f374D3085123A210448E74Fc6393",
530
+ [Chains.BaseMainnet]: "0xB6fe221Fe9EeF5aBa221c348bA20A1Bf5e73624c"
531
+ };
532
+ var rethAbi = Object.freeze([
533
+ {
534
+ inputs: [{ internalType: "uint256", name: "_rethAmount", type: "uint256" }],
535
+ name: "burn",
536
+ outputs: [],
537
+ stateMutability: "nonpayable",
538
+ type: "function"
539
+ },
540
+ {
541
+ inputs: [],
542
+ name: "getExchangeRate",
543
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
544
+ stateMutability: "view",
545
+ type: "function"
546
+ },
547
+ {
548
+ inputs: [{ internalType: "uint256", name: "_rethAmount", type: "uint256" }],
549
+ name: "getEthValue",
550
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
551
+ stateMutability: "view",
552
+ type: "function"
553
+ }
554
+ ]);
555
+ var rocketPool = Object.freeze({
556
+ reth,
557
+ rethAbi
558
+ });
559
+
560
+ // src/protocols/sky.ts
561
+ var sdai = {
562
+ [Chains.EthereumMainnet]: "0x83F20F44975D03b1b09e64809B757c47f942BEeA"
563
+ };
564
+ var sky = Object.freeze({
565
+ sdai,
566
+ /** Standard ERC-4626 surface — sDAI conforms exactly. */
567
+ vaultAbi: erc4626VaultAbi
568
+ });
569
+
570
+ // src/protocols/spark.ts
571
+ var pool2 = {
572
+ [Chains.EthereumMainnet]: "0xC13e21B648A5Ee794902342038FF3aDAB66BE987"
573
+ };
574
+ var spark = Object.freeze({
575
+ pool: pool2
576
+ });
577
+
578
+ // src/protocols/superfluid.ts
579
+ var cfaForwarder = {
580
+ [Chains.EthereumMainnet]: "0xcfA132E353cB4E398080B9700609bb008eceB125",
581
+ [Chains.BaseMainnet]: "0xcfA132E353cB4E398080B9700609bb008eceB125"
582
+ };
583
+ var cfaForwarderAbi = Object.freeze([
584
+ {
585
+ inputs: [
586
+ { internalType: "address", name: "token", type: "address" },
587
+ { internalType: "address", name: "receiver", type: "address" },
588
+ { internalType: "int96", name: "flowrate", type: "int96" }
589
+ ],
590
+ name: "setFlowrate",
591
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
592
+ stateMutability: "nonpayable",
593
+ type: "function"
594
+ },
595
+ {
596
+ inputs: [
597
+ { internalType: "address", name: "token", type: "address" },
598
+ { internalType: "address", name: "sender", type: "address" },
599
+ { internalType: "address", name: "receiver", type: "address" },
600
+ { internalType: "int96", name: "flowrate", type: "int96" },
601
+ { internalType: "bytes", name: "userData", type: "bytes" }
602
+ ],
603
+ name: "createFlow",
604
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
605
+ stateMutability: "nonpayable",
606
+ type: "function"
607
+ }
608
+ ]);
609
+ var superfluid = Object.freeze({
610
+ cfaForwarder,
611
+ cfaForwarderAbi
612
+ });
613
+
614
+ // src/protocols/uniswap-v3.ts
615
+ var swapRouter02 = {
616
+ [Chains.EthereumMainnet]: "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
617
+ [Chains.Sepolia]: "0x3bFA4769FB09eefC5a80d6E87c3B9C650f7Ae48E",
618
+ [Chains.BaseMainnet]: "0x2626664c2603336E57B271c5C0b26F421741e481",
619
+ [Chains.BaseSepolia]: "0x94cC0AaC535CCDB3C01d6787D6413C739ae12bc4"
620
+ };
621
+ var quoterV2 = {
622
+ [Chains.EthereumMainnet]: "0x61fFE014bA17989E743c5F6cB21bF9697530B21e",
623
+ [Chains.Sepolia]: "0xEd1f6473345F45b75F8179591dd5bA1888cf2FB3",
624
+ [Chains.BaseMainnet]: "0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",
625
+ [Chains.BaseSepolia]: "0xC5290058841028F1614F3A6F0F5816cAd0df5E27"
626
+ };
627
+ var permit2 = {
628
+ [Chains.EthereumMainnet]: "0x000000000022d473030F116dDEE9F6B43aC78BA3",
629
+ [Chains.Sepolia]: "0x000000000022d473030F116dDEE9F6B43aC78BA3",
630
+ [Chains.BaseMainnet]: "0x000000000022d473030F116dDEE9F6B43aC78BA3",
631
+ [Chains.BaseSepolia]: "0x000000000022d473030F116dDEE9F6B43aC78BA3"
632
+ };
633
+ var factory = {
634
+ [Chains.EthereumMainnet]: "0x1F98431c8aD98523631AE4a59f267346ea31F984",
635
+ [Chains.Sepolia]: "0x0227628f3F023bb0B980b67D528571c95c6DaC1c",
636
+ [Chains.BaseMainnet]: "0x33128a8fC17869897dcE68Ed026d694621f6FDfD",
637
+ [Chains.BaseSepolia]: "0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24"
638
+ };
639
+ var nonfungiblePositionManager = {
640
+ [Chains.EthereumMainnet]: "0xC36442b4a4522E871399CD717aBDD847Ab11FE88",
641
+ [Chains.Sepolia]: "0x1238536071E1c677A632429e3655c799b22cDA52",
642
+ [Chains.BaseMainnet]: "0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1",
643
+ [Chains.BaseSepolia]: "0x27F971cb582BF9E50F397e4d29a5C7A34f11faA2"
644
+ };
645
+ var universalRouter = {
646
+ [Chains.EthereumMainnet]: "0x66a9893cc07d91d95644aedd05d03f95e1dba8af",
647
+ [Chains.Sepolia]: "0x3A9D48AB9751398BbFa63ad67599Bb04e4BdF98b",
648
+ [Chains.BaseMainnet]: "0x6ff5693b99212da76ad316178a184ab56d299b43",
649
+ [Chains.BaseSepolia]: "0x492e6456d9528771018deb9e87ef7750ef184104"
650
+ };
651
+ var swapRouter02Abi = Object.freeze([
652
+ {
653
+ inputs: [
654
+ {
655
+ components: [
656
+ { internalType: "address", name: "tokenIn", type: "address" },
657
+ { internalType: "address", name: "tokenOut", type: "address" },
658
+ { internalType: "uint24", name: "fee", type: "uint24" },
659
+ { internalType: "address", name: "recipient", type: "address" },
660
+ { internalType: "uint256", name: "amountIn", type: "uint256" },
661
+ { internalType: "uint256", name: "amountOutMinimum", type: "uint256" },
662
+ { internalType: "uint160", name: "sqrtPriceLimitX96", type: "uint160" }
663
+ ],
664
+ internalType: "struct IV3SwapRouter.ExactInputSingleParams",
665
+ name: "params",
666
+ type: "tuple"
667
+ }
668
+ ],
669
+ name: "exactInputSingle",
670
+ outputs: [{ internalType: "uint256", name: "amountOut", type: "uint256" }],
671
+ stateMutability: "payable",
672
+ type: "function"
673
+ },
674
+ {
675
+ inputs: [
676
+ {
677
+ components: [
678
+ { internalType: "address", name: "tokenIn", type: "address" },
679
+ { internalType: "address", name: "tokenOut", type: "address" },
680
+ { internalType: "uint24", name: "fee", type: "uint24" },
681
+ { internalType: "address", name: "recipient", type: "address" },
682
+ { internalType: "uint256", name: "amountOut", type: "uint256" },
683
+ { internalType: "uint256", name: "amountInMaximum", type: "uint256" },
684
+ { internalType: "uint160", name: "sqrtPriceLimitX96", type: "uint160" }
685
+ ],
686
+ internalType: "struct IV3SwapRouter.ExactOutputSingleParams",
687
+ name: "params",
688
+ type: "tuple"
689
+ }
690
+ ],
691
+ name: "exactOutputSingle",
692
+ outputs: [{ internalType: "uint256", name: "amountIn", type: "uint256" }],
693
+ stateMutability: "payable",
694
+ type: "function"
695
+ }
696
+ ]);
697
+ var quoterV2Abi = Object.freeze([
698
+ {
699
+ inputs: [
700
+ {
701
+ components: [
702
+ { internalType: "address", name: "tokenIn", type: "address" },
703
+ { internalType: "address", name: "tokenOut", type: "address" },
704
+ { internalType: "uint256", name: "amountIn", type: "uint256" },
705
+ { internalType: "uint24", name: "fee", type: "uint24" },
706
+ { internalType: "uint160", name: "sqrtPriceLimitX96", type: "uint160" }
707
+ ],
708
+ internalType: "struct IQuoterV2.QuoteExactInputSingleParams",
709
+ name: "params",
710
+ type: "tuple"
711
+ }
712
+ ],
713
+ name: "quoteExactInputSingle",
714
+ outputs: [
715
+ { internalType: "uint256", name: "amountOut", type: "uint256" },
716
+ { internalType: "uint160", name: "sqrtPriceX96After", type: "uint160" },
717
+ { internalType: "uint32", name: "initializedTicksCrossed", type: "uint32" },
718
+ { internalType: "uint256", name: "gasEstimate", type: "uint256" }
719
+ ],
720
+ stateMutability: "nonpayable",
721
+ type: "function"
722
+ }
723
+ ]);
724
+ var factoryAbi = Object.freeze([
725
+ {
726
+ inputs: [
727
+ { internalType: "address", name: "tokenA", type: "address" },
728
+ { internalType: "address", name: "tokenB", type: "address" },
729
+ { internalType: "uint24", name: "fee", type: "uint24" }
730
+ ],
731
+ name: "getPool",
732
+ outputs: [{ internalType: "address", name: "pool", type: "address" }],
733
+ stateMutability: "view",
734
+ type: "function"
735
+ }
736
+ ]);
737
+ var tokens2 = Object.freeze({
738
+ WETH: {
739
+ [Chains.Sepolia]: "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14",
740
+ [Chains.EthereumMainnet]: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
741
+ [Chains.BaseMainnet]: "0x4200000000000000000000000000000000000006",
742
+ [Chains.BaseSepolia]: "0x4200000000000000000000000000000000000006"
743
+ },
744
+ USDC: {
745
+ [Chains.Sepolia]: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
746
+ [Chains.EthereumMainnet]: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
747
+ [Chains.BaseMainnet]: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
748
+ [Chains.BaseSepolia]: "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
749
+ }
750
+ });
751
+ var uniswapV3 = Object.freeze({
752
+ swapRouter02,
753
+ quoterV2,
754
+ permit2,
755
+ factory,
756
+ nonfungiblePositionManager,
757
+ universalRouter,
758
+ swapRouter02Abi,
759
+ quoterV2Abi,
760
+ factoryAbi,
761
+ tokens: tokens2
762
+ });
763
+
764
+ // src/protocols/wrapped.ts
765
+ var weth = {
766
+ [Chains.EthereumMainnet]: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
767
+ [Chains.Sepolia]: "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14",
768
+ [Chains.BaseMainnet]: "0x4200000000000000000000000000000000000006",
769
+ [Chains.BaseSepolia]: "0x4200000000000000000000000000000000000006"
770
+ };
771
+ var wethAbi = Object.freeze([
772
+ {
773
+ inputs: [],
774
+ name: "deposit",
775
+ outputs: [],
776
+ stateMutability: "payable",
777
+ type: "function"
778
+ },
779
+ {
780
+ inputs: [{ internalType: "uint256", name: "wad", type: "uint256" }],
781
+ name: "withdraw",
782
+ outputs: [],
783
+ stateMutability: "nonpayable",
784
+ type: "function"
785
+ },
786
+ {
787
+ inputs: [
788
+ { internalType: "address", name: "guy", type: "address" },
789
+ { internalType: "uint256", name: "wad", type: "uint256" }
790
+ ],
791
+ name: "approve",
792
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
793
+ stateMutability: "nonpayable",
794
+ type: "function"
795
+ },
796
+ {
797
+ inputs: [{ internalType: "address", name: "", type: "address" }],
798
+ name: "balanceOf",
799
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
800
+ stateMutability: "view",
801
+ type: "function"
802
+ }
803
+ ]);
804
+ var wrapped = Object.freeze({
805
+ weth,
806
+ wethAbi
807
+ });
808
+
809
+ // src/protocols/index.ts
810
+ var Protocols = Object.freeze({
811
+ aaveV3,
812
+ aerodrome,
813
+ chainlink,
814
+ compoundV3,
815
+ erc20,
816
+ ethena,
817
+ fraxEther,
818
+ lido,
819
+ morphoBlue,
820
+ rocketPool,
821
+ sky,
822
+ spark,
823
+ superfluid,
824
+ uniswapV3,
825
+ wrapped
826
+ });
827
+ // Annotate the CommonJS export names for ESM import in node:
828
+ 0 && (module.exports = {
829
+ Chains,
830
+ Protocols,
831
+ aaveV3,
832
+ aerodrome,
833
+ aggregatorV3Abi,
834
+ chainlink,
835
+ compoundV3,
836
+ erc20,
837
+ erc4626VaultAbi,
838
+ ethena,
839
+ fraxEther,
840
+ lido,
841
+ morphoBlue,
842
+ rocketPool,
843
+ sky,
844
+ spark,
845
+ superfluid,
846
+ uniswapV3,
847
+ wrapped
848
+ });