levr-sdk 0.0.1 → 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 (156) hide show
  1. package/README.md +109 -13
  2. package/dist/esm/abis/LevrFactory_v1.js +63 -0
  3. package/dist/esm/abis/LevrGovernor_v1.js +15 -24
  4. package/dist/esm/abis/LevrStaking_v1.js +7 -1
  5. package/dist/esm/abis/StateView.js +149 -0
  6. package/dist/esm/abis/V3QuoterV2.js +26 -0
  7. package/dist/esm/abis/index.js +4 -0
  8. package/dist/esm/balance.js +48 -4
  9. package/dist/esm/balance.js.map +1 -1
  10. package/dist/esm/client/hook/index.js +14 -3
  11. package/dist/esm/client/hook/index.js.map +1 -1
  12. package/dist/esm/client/hook/use-fee-receivers.js +11 -30
  13. package/dist/esm/client/hook/use-fee-receivers.js.map +1 -1
  14. package/dist/esm/client/hook/use-governance.js +20 -274
  15. package/dist/esm/client/hook/use-governance.js.map +1 -1
  16. package/dist/esm/client/hook/use-pool.js +26 -0
  17. package/dist/esm/client/hook/use-pool.js.map +1 -0
  18. package/dist/esm/client/hook/use-prepare.js +6 -3
  19. package/dist/esm/client/hook/use-prepare.js.map +1 -1
  20. package/dist/esm/client/hook/use-project.js +28 -16
  21. package/dist/esm/client/hook/use-project.js.map +1 -1
  22. package/dist/esm/client/hook/use-proposal.js +48 -0
  23. package/dist/esm/client/hook/use-proposal.js.map +1 -0
  24. package/dist/esm/client/hook/use-stake.js +29 -215
  25. package/dist/esm/client/hook/use-stake.js.map +1 -1
  26. package/dist/esm/client/hook/use-swap.js +23 -19
  27. package/dist/esm/client/hook/use-swap.js.map +1 -1
  28. package/dist/esm/client/hook/use-user.js +25 -0
  29. package/dist/esm/client/hook/use-user.js.map +1 -0
  30. package/dist/esm/client/levr-provider.js +73 -108
  31. package/dist/esm/client/levr-provider.js.map +1 -1
  32. package/dist/esm/client/query-keys.js +10 -22
  33. package/dist/esm/client/query-keys.js.map +1 -1
  34. package/dist/esm/constants.js +42 -1
  35. package/dist/esm/constants.js.map +1 -1
  36. package/dist/esm/fee-receivers.js +28 -13
  37. package/dist/esm/fee-receivers.js.map +1 -1
  38. package/dist/esm/governance.js +35 -399
  39. package/dist/esm/governance.js.map +1 -1
  40. package/dist/esm/index.js +7 -3
  41. package/dist/esm/index.js.map +1 -1
  42. package/dist/esm/pool-key.js +152 -0
  43. package/dist/esm/pool-key.js.map +1 -0
  44. package/dist/esm/pool.js +70 -0
  45. package/dist/esm/pool.js.map +1 -0
  46. package/dist/esm/project.js +415 -118
  47. package/dist/esm/project.js.map +1 -1
  48. package/dist/esm/proposal.js +156 -0
  49. package/dist/esm/proposal.js.map +1 -0
  50. package/dist/esm/quote/index.js +98 -0
  51. package/dist/esm/quote/index.js.map +1 -0
  52. package/dist/esm/quote/v3.js +62 -0
  53. package/dist/esm/quote/v3.js.map +1 -0
  54. package/dist/esm/quote/v4.js +228 -0
  55. package/dist/esm/quote/v4.js.map +1 -0
  56. package/dist/esm/stake.js +34 -237
  57. package/dist/esm/stake.js.map +1 -1
  58. package/dist/esm/treasury.js +162 -0
  59. package/dist/esm/treasury.js.map +1 -0
  60. package/dist/esm/usd-price.js +149 -0
  61. package/dist/esm/usd-price.js.map +1 -0
  62. package/dist/esm/user.js +153 -0
  63. package/dist/esm/user.js.map +1 -0
  64. package/dist/esm/util.js +45 -1
  65. package/dist/esm/util.js.map +1 -1
  66. package/dist/types/abis/LevrFactory_v1.d.ts +48 -0
  67. package/dist/types/abis/LevrGovernor_v1.d.ts +12 -18
  68. package/dist/types/abis/LevrStaking_v1.d.ts +5 -1
  69. package/dist/types/abis/StateView.d.ts +278 -0
  70. package/dist/types/abis/V3QuoterV2.d.ts +39 -0
  71. package/dist/types/abis/index.d.ts +2 -0
  72. package/dist/types/balance.d.ts +19 -6
  73. package/dist/types/balance.d.ts.map +1 -1
  74. package/dist/types/client/hook/index.d.ts +12 -4
  75. package/dist/types/client/hook/index.d.ts.map +1 -1
  76. package/dist/types/client/hook/use-fee-receivers.d.ts +6 -16
  77. package/dist/types/client/hook/use-fee-receivers.d.ts.map +1 -1
  78. package/dist/types/client/hook/use-governance.d.ts +4 -93
  79. package/dist/types/client/hook/use-governance.d.ts.map +1 -1
  80. package/dist/types/client/hook/use-pool.d.ts +12 -0
  81. package/dist/types/client/hook/use-pool.d.ts.map +1 -0
  82. package/dist/types/client/hook/use-prepare.d.ts +1 -2
  83. package/dist/types/client/hook/use-prepare.d.ts.map +1 -1
  84. package/dist/types/client/hook/use-project.d.ts +8 -1
  85. package/dist/types/client/hook/use-project.d.ts.map +1 -1
  86. package/dist/types/client/hook/use-proposal.d.ts +18 -0
  87. package/dist/types/client/hook/use-proposal.d.ts.map +1 -0
  88. package/dist/types/client/hook/use-stake.d.ts +14 -168
  89. package/dist/types/client/hook/use-stake.d.ts.map +1 -1
  90. package/dist/types/client/hook/use-swap.d.ts +5 -9
  91. package/dist/types/client/hook/use-swap.d.ts.map +1 -1
  92. package/dist/types/client/hook/use-user.d.ts +13 -0
  93. package/dist/types/client/hook/use-user.d.ts.map +1 -0
  94. package/dist/types/client/levr-provider.d.ts +41 -68
  95. package/dist/types/client/levr-provider.d.ts.map +1 -1
  96. package/dist/types/client/query-keys.d.ts +14 -26
  97. package/dist/types/client/query-keys.d.ts.map +1 -1
  98. package/dist/types/constants.d.ts +18 -0
  99. package/dist/types/constants.d.ts.map +1 -1
  100. package/dist/types/fee-receivers.d.ts +29 -2
  101. package/dist/types/fee-receivers.d.ts.map +1 -1
  102. package/dist/types/governance.d.ts +8 -108
  103. package/dist/types/governance.d.ts.map +1 -1
  104. package/dist/types/index.d.ts +7 -3
  105. package/dist/types/index.d.ts.map +1 -1
  106. package/dist/types/pool-key.d.ts +121 -0
  107. package/dist/types/pool-key.d.ts.map +1 -0
  108. package/dist/types/pool.d.ts +590 -0
  109. package/dist/types/pool.d.ts.map +1 -0
  110. package/dist/types/project.d.ts +61 -11
  111. package/dist/types/project.d.ts.map +1 -1
  112. package/dist/types/proposal.d.ts +1161 -0
  113. package/dist/types/proposal.d.ts.map +1 -0
  114. package/dist/types/quote/index.d.ts +97 -0
  115. package/dist/types/quote/index.d.ts.map +1 -0
  116. package/dist/types/quote/v3.d.ts +78 -0
  117. package/dist/types/quote/v3.d.ts.map +1 -0
  118. package/dist/types/quote/v4.d.ts +95 -0
  119. package/dist/types/quote/v4.d.ts.map +1 -0
  120. package/dist/types/stake.d.ts +41 -87
  121. package/dist/types/stake.d.ts.map +1 -1
  122. package/dist/types/treasury.d.ts +16 -0
  123. package/dist/types/treasury.d.ts.map +1 -0
  124. package/dist/types/types.d.ts +15 -0
  125. package/dist/types/types.d.ts.map +1 -1
  126. package/dist/types/usd-price.d.ts +141 -0
  127. package/dist/types/usd-price.d.ts.map +1 -0
  128. package/dist/types/user.d.ts +188 -0
  129. package/dist/types/user.d.ts.map +1 -0
  130. package/dist/types/util.d.ts +17 -0
  131. package/dist/types/util.d.ts.map +1 -1
  132. package/package.json +5 -2
  133. package/dist/esm/client/hook/use-balance.js +0 -56
  134. package/dist/esm/client/hook/use-balance.js.map +0 -1
  135. package/dist/esm/client/hook/use-projects.js +0 -22
  136. package/dist/esm/client/hook/use-projects.js.map +0 -1
  137. package/dist/esm/client/hook/use-proposals.js +0 -31
  138. package/dist/esm/client/hook/use-proposals.js.map +0 -1
  139. package/dist/esm/projects.js +0 -212
  140. package/dist/esm/projects.js.map +0 -1
  141. package/dist/esm/proposals.js +0 -98
  142. package/dist/esm/proposals.js.map +0 -1
  143. package/dist/esm/quote-v4.js +0 -169
  144. package/dist/esm/quote-v4.js.map +0 -1
  145. package/dist/types/client/hook/use-balance.d.ts +0 -18
  146. package/dist/types/client/hook/use-balance.d.ts.map +0 -1
  147. package/dist/types/client/hook/use-projects.d.ts +0 -6
  148. package/dist/types/client/hook/use-projects.d.ts.map +0 -1
  149. package/dist/types/client/hook/use-proposals.d.ts +0 -16
  150. package/dist/types/client/hook/use-proposals.d.ts.map +0 -1
  151. package/dist/types/projects.d.ts +0 -20
  152. package/dist/types/projects.d.ts.map +0 -1
  153. package/dist/types/proposals.d.ts +0 -20
  154. package/dist/types/proposals.d.ts.map +0 -1
  155. package/dist/types/quote-v4.d.ts +0 -54
  156. package/dist/types/quote-v4.d.ts.map +0 -1
@@ -0,0 +1,590 @@
1
+ import type { Project } from './project';
2
+ import type { BalanceResult, PoolKey, PopPublicClient } from './types';
3
+ export type PoolParams = {
4
+ publicClient: PopPublicClient;
5
+ project: Project;
6
+ };
7
+ export type PoolData = {
8
+ poolKey: PoolKey;
9
+ sqrtPriceX96: bigint;
10
+ tick: number;
11
+ liquidity: BalanceResult;
12
+ protocolFee: number;
13
+ lpFee: number;
14
+ feeDisplay: string;
15
+ };
16
+ /**
17
+ * Helper: Get pool state contracts for multicall composition
18
+ */
19
+ export declare function poolStateContracts(params: {
20
+ stateViewAddress: `0x${string}`;
21
+ poolId: `0x${string}`;
22
+ }): ({
23
+ address: `0x${string}`;
24
+ abi: readonly [{
25
+ readonly inputs: readonly [{
26
+ readonly internalType: "contract IPoolManager";
27
+ readonly name: "_poolManager";
28
+ readonly type: "address";
29
+ }];
30
+ readonly stateMutability: "nonpayable";
31
+ readonly type: "constructor";
32
+ }, {
33
+ readonly inputs: readonly [{
34
+ readonly internalType: "PoolId";
35
+ readonly name: "poolId";
36
+ readonly type: "bytes32";
37
+ }];
38
+ readonly name: "getFeeGrowthGlobals";
39
+ readonly outputs: readonly [{
40
+ readonly internalType: "uint256";
41
+ readonly name: "feeGrowthGlobal0";
42
+ readonly type: "uint256";
43
+ }, {
44
+ readonly internalType: "uint256";
45
+ readonly name: "feeGrowthGlobal1";
46
+ readonly type: "uint256";
47
+ }];
48
+ readonly stateMutability: "view";
49
+ readonly type: "function";
50
+ }, {
51
+ readonly inputs: readonly [{
52
+ readonly internalType: "PoolId";
53
+ readonly name: "poolId";
54
+ readonly type: "bytes32";
55
+ }, {
56
+ readonly internalType: "int24";
57
+ readonly name: "tickLower";
58
+ readonly type: "int24";
59
+ }, {
60
+ readonly internalType: "int24";
61
+ readonly name: "tickUpper";
62
+ readonly type: "int24";
63
+ }];
64
+ readonly name: "getFeeGrowthInside";
65
+ readonly outputs: readonly [{
66
+ readonly internalType: "uint256";
67
+ readonly name: "feeGrowthInside0X128";
68
+ readonly type: "uint256";
69
+ }, {
70
+ readonly internalType: "uint256";
71
+ readonly name: "feeGrowthInside1X128";
72
+ readonly type: "uint256";
73
+ }];
74
+ readonly stateMutability: "view";
75
+ readonly type: "function";
76
+ }, {
77
+ readonly inputs: readonly [{
78
+ readonly internalType: "PoolId";
79
+ readonly name: "poolId";
80
+ readonly type: "bytes32";
81
+ }];
82
+ readonly name: "getLiquidity";
83
+ readonly outputs: readonly [{
84
+ readonly internalType: "uint128";
85
+ readonly name: "liquidity";
86
+ readonly type: "uint128";
87
+ }];
88
+ readonly stateMutability: "view";
89
+ readonly type: "function";
90
+ }, {
91
+ readonly inputs: readonly [{
92
+ readonly internalType: "PoolId";
93
+ readonly name: "poolId";
94
+ readonly type: "bytes32";
95
+ }, {
96
+ readonly internalType: "bytes32";
97
+ readonly name: "positionId";
98
+ readonly type: "bytes32";
99
+ }];
100
+ readonly name: "getPositionInfo";
101
+ readonly outputs: readonly [{
102
+ readonly internalType: "uint128";
103
+ readonly name: "liquidity";
104
+ readonly type: "uint128";
105
+ }, {
106
+ readonly internalType: "uint256";
107
+ readonly name: "feeGrowthInside0LastX128";
108
+ readonly type: "uint256";
109
+ }, {
110
+ readonly internalType: "uint256";
111
+ readonly name: "feeGrowthInside1LastX128";
112
+ readonly type: "uint256";
113
+ }];
114
+ readonly stateMutability: "view";
115
+ readonly type: "function";
116
+ }, {
117
+ readonly inputs: readonly [{
118
+ readonly internalType: "PoolId";
119
+ readonly name: "poolId";
120
+ readonly type: "bytes32";
121
+ }, {
122
+ readonly internalType: "address";
123
+ readonly name: "owner";
124
+ readonly type: "address";
125
+ }, {
126
+ readonly internalType: "int24";
127
+ readonly name: "tickLower";
128
+ readonly type: "int24";
129
+ }, {
130
+ readonly internalType: "int24";
131
+ readonly name: "tickUpper";
132
+ readonly type: "int24";
133
+ }, {
134
+ readonly internalType: "bytes32";
135
+ readonly name: "salt";
136
+ readonly type: "bytes32";
137
+ }];
138
+ readonly name: "getPositionInfo";
139
+ readonly outputs: readonly [{
140
+ readonly internalType: "uint128";
141
+ readonly name: "liquidity";
142
+ readonly type: "uint128";
143
+ }, {
144
+ readonly internalType: "uint256";
145
+ readonly name: "feeGrowthInside0LastX128";
146
+ readonly type: "uint256";
147
+ }, {
148
+ readonly internalType: "uint256";
149
+ readonly name: "feeGrowthInside1LastX128";
150
+ readonly type: "uint256";
151
+ }];
152
+ readonly stateMutability: "view";
153
+ readonly type: "function";
154
+ }, {
155
+ readonly inputs: readonly [{
156
+ readonly internalType: "PoolId";
157
+ readonly name: "poolId";
158
+ readonly type: "bytes32";
159
+ }, {
160
+ readonly internalType: "bytes32";
161
+ readonly name: "positionId";
162
+ readonly type: "bytes32";
163
+ }];
164
+ readonly name: "getPositionLiquidity";
165
+ readonly outputs: readonly [{
166
+ readonly internalType: "uint128";
167
+ readonly name: "liquidity";
168
+ readonly type: "uint128";
169
+ }];
170
+ readonly stateMutability: "view";
171
+ readonly type: "function";
172
+ }, {
173
+ readonly inputs: readonly [{
174
+ readonly internalType: "PoolId";
175
+ readonly name: "poolId";
176
+ readonly type: "bytes32";
177
+ }];
178
+ readonly name: "getSlot0";
179
+ readonly outputs: readonly [{
180
+ readonly internalType: "uint160";
181
+ readonly name: "sqrtPriceX96";
182
+ readonly type: "uint160";
183
+ }, {
184
+ readonly internalType: "int24";
185
+ readonly name: "tick";
186
+ readonly type: "int24";
187
+ }, {
188
+ readonly internalType: "uint24";
189
+ readonly name: "protocolFee";
190
+ readonly type: "uint24";
191
+ }, {
192
+ readonly internalType: "uint24";
193
+ readonly name: "lpFee";
194
+ readonly type: "uint24";
195
+ }];
196
+ readonly stateMutability: "view";
197
+ readonly type: "function";
198
+ }, {
199
+ readonly inputs: readonly [{
200
+ readonly internalType: "PoolId";
201
+ readonly name: "poolId";
202
+ readonly type: "bytes32";
203
+ }, {
204
+ readonly internalType: "int16";
205
+ readonly name: "tick";
206
+ readonly type: "int16";
207
+ }];
208
+ readonly name: "getTickBitmap";
209
+ readonly outputs: readonly [{
210
+ readonly internalType: "uint256";
211
+ readonly name: "tickBitmap";
212
+ readonly type: "uint256";
213
+ }];
214
+ readonly stateMutability: "view";
215
+ readonly type: "function";
216
+ }, {
217
+ readonly inputs: readonly [{
218
+ readonly internalType: "PoolId";
219
+ readonly name: "poolId";
220
+ readonly type: "bytes32";
221
+ }, {
222
+ readonly internalType: "int24";
223
+ readonly name: "tick";
224
+ readonly type: "int24";
225
+ }];
226
+ readonly name: "getTickFeeGrowthOutside";
227
+ readonly outputs: readonly [{
228
+ readonly internalType: "uint256";
229
+ readonly name: "feeGrowthOutside0X128";
230
+ readonly type: "uint256";
231
+ }, {
232
+ readonly internalType: "uint256";
233
+ readonly name: "feeGrowthOutside1X128";
234
+ readonly type: "uint256";
235
+ }];
236
+ readonly stateMutability: "view";
237
+ readonly type: "function";
238
+ }, {
239
+ readonly inputs: readonly [{
240
+ readonly internalType: "PoolId";
241
+ readonly name: "poolId";
242
+ readonly type: "bytes32";
243
+ }, {
244
+ readonly internalType: "int24";
245
+ readonly name: "tick";
246
+ readonly type: "int24";
247
+ }];
248
+ readonly name: "getTickInfo";
249
+ readonly outputs: readonly [{
250
+ readonly internalType: "uint128";
251
+ readonly name: "liquidityGross";
252
+ readonly type: "uint128";
253
+ }, {
254
+ readonly internalType: "int128";
255
+ readonly name: "liquidityNet";
256
+ readonly type: "int128";
257
+ }, {
258
+ readonly internalType: "uint256";
259
+ readonly name: "feeGrowthOutside0X128";
260
+ readonly type: "uint256";
261
+ }, {
262
+ readonly internalType: "uint256";
263
+ readonly name: "feeGrowthOutside1X128";
264
+ readonly type: "uint256";
265
+ }];
266
+ readonly stateMutability: "view";
267
+ readonly type: "function";
268
+ }, {
269
+ readonly inputs: readonly [{
270
+ readonly internalType: "PoolId";
271
+ readonly name: "poolId";
272
+ readonly type: "bytes32";
273
+ }, {
274
+ readonly internalType: "int24";
275
+ readonly name: "tick";
276
+ readonly type: "int24";
277
+ }];
278
+ readonly name: "getTickLiquidity";
279
+ readonly outputs: readonly [{
280
+ readonly internalType: "uint128";
281
+ readonly name: "liquidityGross";
282
+ readonly type: "uint128";
283
+ }, {
284
+ readonly internalType: "int128";
285
+ readonly name: "liquidityNet";
286
+ readonly type: "int128";
287
+ }];
288
+ readonly stateMutability: "view";
289
+ readonly type: "function";
290
+ }, {
291
+ readonly inputs: readonly [];
292
+ readonly name: "poolManager";
293
+ readonly outputs: readonly [{
294
+ readonly internalType: "contract IPoolManager";
295
+ readonly name: "";
296
+ readonly type: "address";
297
+ }];
298
+ readonly stateMutability: "view";
299
+ readonly type: "function";
300
+ }];
301
+ functionName: "getSlot0";
302
+ args: `0x${string}`[];
303
+ } | {
304
+ address: `0x${string}`;
305
+ abi: readonly [{
306
+ readonly inputs: readonly [{
307
+ readonly internalType: "contract IPoolManager";
308
+ readonly name: "_poolManager";
309
+ readonly type: "address";
310
+ }];
311
+ readonly stateMutability: "nonpayable";
312
+ readonly type: "constructor";
313
+ }, {
314
+ readonly inputs: readonly [{
315
+ readonly internalType: "PoolId";
316
+ readonly name: "poolId";
317
+ readonly type: "bytes32";
318
+ }];
319
+ readonly name: "getFeeGrowthGlobals";
320
+ readonly outputs: readonly [{
321
+ readonly internalType: "uint256";
322
+ readonly name: "feeGrowthGlobal0";
323
+ readonly type: "uint256";
324
+ }, {
325
+ readonly internalType: "uint256";
326
+ readonly name: "feeGrowthGlobal1";
327
+ readonly type: "uint256";
328
+ }];
329
+ readonly stateMutability: "view";
330
+ readonly type: "function";
331
+ }, {
332
+ readonly inputs: readonly [{
333
+ readonly internalType: "PoolId";
334
+ readonly name: "poolId";
335
+ readonly type: "bytes32";
336
+ }, {
337
+ readonly internalType: "int24";
338
+ readonly name: "tickLower";
339
+ readonly type: "int24";
340
+ }, {
341
+ readonly internalType: "int24";
342
+ readonly name: "tickUpper";
343
+ readonly type: "int24";
344
+ }];
345
+ readonly name: "getFeeGrowthInside";
346
+ readonly outputs: readonly [{
347
+ readonly internalType: "uint256";
348
+ readonly name: "feeGrowthInside0X128";
349
+ readonly type: "uint256";
350
+ }, {
351
+ readonly internalType: "uint256";
352
+ readonly name: "feeGrowthInside1X128";
353
+ readonly type: "uint256";
354
+ }];
355
+ readonly stateMutability: "view";
356
+ readonly type: "function";
357
+ }, {
358
+ readonly inputs: readonly [{
359
+ readonly internalType: "PoolId";
360
+ readonly name: "poolId";
361
+ readonly type: "bytes32";
362
+ }];
363
+ readonly name: "getLiquidity";
364
+ readonly outputs: readonly [{
365
+ readonly internalType: "uint128";
366
+ readonly name: "liquidity";
367
+ readonly type: "uint128";
368
+ }];
369
+ readonly stateMutability: "view";
370
+ readonly type: "function";
371
+ }, {
372
+ readonly inputs: readonly [{
373
+ readonly internalType: "PoolId";
374
+ readonly name: "poolId";
375
+ readonly type: "bytes32";
376
+ }, {
377
+ readonly internalType: "bytes32";
378
+ readonly name: "positionId";
379
+ readonly type: "bytes32";
380
+ }];
381
+ readonly name: "getPositionInfo";
382
+ readonly outputs: readonly [{
383
+ readonly internalType: "uint128";
384
+ readonly name: "liquidity";
385
+ readonly type: "uint128";
386
+ }, {
387
+ readonly internalType: "uint256";
388
+ readonly name: "feeGrowthInside0LastX128";
389
+ readonly type: "uint256";
390
+ }, {
391
+ readonly internalType: "uint256";
392
+ readonly name: "feeGrowthInside1LastX128";
393
+ readonly type: "uint256";
394
+ }];
395
+ readonly stateMutability: "view";
396
+ readonly type: "function";
397
+ }, {
398
+ readonly inputs: readonly [{
399
+ readonly internalType: "PoolId";
400
+ readonly name: "poolId";
401
+ readonly type: "bytes32";
402
+ }, {
403
+ readonly internalType: "address";
404
+ readonly name: "owner";
405
+ readonly type: "address";
406
+ }, {
407
+ readonly internalType: "int24";
408
+ readonly name: "tickLower";
409
+ readonly type: "int24";
410
+ }, {
411
+ readonly internalType: "int24";
412
+ readonly name: "tickUpper";
413
+ readonly type: "int24";
414
+ }, {
415
+ readonly internalType: "bytes32";
416
+ readonly name: "salt";
417
+ readonly type: "bytes32";
418
+ }];
419
+ readonly name: "getPositionInfo";
420
+ readonly outputs: readonly [{
421
+ readonly internalType: "uint128";
422
+ readonly name: "liquidity";
423
+ readonly type: "uint128";
424
+ }, {
425
+ readonly internalType: "uint256";
426
+ readonly name: "feeGrowthInside0LastX128";
427
+ readonly type: "uint256";
428
+ }, {
429
+ readonly internalType: "uint256";
430
+ readonly name: "feeGrowthInside1LastX128";
431
+ readonly type: "uint256";
432
+ }];
433
+ readonly stateMutability: "view";
434
+ readonly type: "function";
435
+ }, {
436
+ readonly inputs: readonly [{
437
+ readonly internalType: "PoolId";
438
+ readonly name: "poolId";
439
+ readonly type: "bytes32";
440
+ }, {
441
+ readonly internalType: "bytes32";
442
+ readonly name: "positionId";
443
+ readonly type: "bytes32";
444
+ }];
445
+ readonly name: "getPositionLiquidity";
446
+ readonly outputs: readonly [{
447
+ readonly internalType: "uint128";
448
+ readonly name: "liquidity";
449
+ readonly type: "uint128";
450
+ }];
451
+ readonly stateMutability: "view";
452
+ readonly type: "function";
453
+ }, {
454
+ readonly inputs: readonly [{
455
+ readonly internalType: "PoolId";
456
+ readonly name: "poolId";
457
+ readonly type: "bytes32";
458
+ }];
459
+ readonly name: "getSlot0";
460
+ readonly outputs: readonly [{
461
+ readonly internalType: "uint160";
462
+ readonly name: "sqrtPriceX96";
463
+ readonly type: "uint160";
464
+ }, {
465
+ readonly internalType: "int24";
466
+ readonly name: "tick";
467
+ readonly type: "int24";
468
+ }, {
469
+ readonly internalType: "uint24";
470
+ readonly name: "protocolFee";
471
+ readonly type: "uint24";
472
+ }, {
473
+ readonly internalType: "uint24";
474
+ readonly name: "lpFee";
475
+ readonly type: "uint24";
476
+ }];
477
+ readonly stateMutability: "view";
478
+ readonly type: "function";
479
+ }, {
480
+ readonly inputs: readonly [{
481
+ readonly internalType: "PoolId";
482
+ readonly name: "poolId";
483
+ readonly type: "bytes32";
484
+ }, {
485
+ readonly internalType: "int16";
486
+ readonly name: "tick";
487
+ readonly type: "int16";
488
+ }];
489
+ readonly name: "getTickBitmap";
490
+ readonly outputs: readonly [{
491
+ readonly internalType: "uint256";
492
+ readonly name: "tickBitmap";
493
+ readonly type: "uint256";
494
+ }];
495
+ readonly stateMutability: "view";
496
+ readonly type: "function";
497
+ }, {
498
+ readonly inputs: readonly [{
499
+ readonly internalType: "PoolId";
500
+ readonly name: "poolId";
501
+ readonly type: "bytes32";
502
+ }, {
503
+ readonly internalType: "int24";
504
+ readonly name: "tick";
505
+ readonly type: "int24";
506
+ }];
507
+ readonly name: "getTickFeeGrowthOutside";
508
+ readonly outputs: readonly [{
509
+ readonly internalType: "uint256";
510
+ readonly name: "feeGrowthOutside0X128";
511
+ readonly type: "uint256";
512
+ }, {
513
+ readonly internalType: "uint256";
514
+ readonly name: "feeGrowthOutside1X128";
515
+ readonly type: "uint256";
516
+ }];
517
+ readonly stateMutability: "view";
518
+ readonly type: "function";
519
+ }, {
520
+ readonly inputs: readonly [{
521
+ readonly internalType: "PoolId";
522
+ readonly name: "poolId";
523
+ readonly type: "bytes32";
524
+ }, {
525
+ readonly internalType: "int24";
526
+ readonly name: "tick";
527
+ readonly type: "int24";
528
+ }];
529
+ readonly name: "getTickInfo";
530
+ readonly outputs: readonly [{
531
+ readonly internalType: "uint128";
532
+ readonly name: "liquidityGross";
533
+ readonly type: "uint128";
534
+ }, {
535
+ readonly internalType: "int128";
536
+ readonly name: "liquidityNet";
537
+ readonly type: "int128";
538
+ }, {
539
+ readonly internalType: "uint256";
540
+ readonly name: "feeGrowthOutside0X128";
541
+ readonly type: "uint256";
542
+ }, {
543
+ readonly internalType: "uint256";
544
+ readonly name: "feeGrowthOutside1X128";
545
+ readonly type: "uint256";
546
+ }];
547
+ readonly stateMutability: "view";
548
+ readonly type: "function";
549
+ }, {
550
+ readonly inputs: readonly [{
551
+ readonly internalType: "PoolId";
552
+ readonly name: "poolId";
553
+ readonly type: "bytes32";
554
+ }, {
555
+ readonly internalType: "int24";
556
+ readonly name: "tick";
557
+ readonly type: "int24";
558
+ }];
559
+ readonly name: "getTickLiquidity";
560
+ readonly outputs: readonly [{
561
+ readonly internalType: "uint128";
562
+ readonly name: "liquidityGross";
563
+ readonly type: "uint128";
564
+ }, {
565
+ readonly internalType: "int128";
566
+ readonly name: "liquidityNet";
567
+ readonly type: "int128";
568
+ }];
569
+ readonly stateMutability: "view";
570
+ readonly type: "function";
571
+ }, {
572
+ readonly inputs: readonly [];
573
+ readonly name: "poolManager";
574
+ readonly outputs: readonly [{
575
+ readonly internalType: "contract IPoolManager";
576
+ readonly name: "";
577
+ readonly type: "address";
578
+ }];
579
+ readonly stateMutability: "view";
580
+ readonly type: "function";
581
+ }];
582
+ functionName: "getLiquidity";
583
+ args: `0x${string}`[];
584
+ })[];
585
+ /**
586
+ * Get pool-specific data including liquidity, price, and fees
587
+ * Uses StateView contract for efficient state queries
588
+ */
589
+ export declare function pool({ publicClient, project }: PoolParams): Promise<PoolData | null>;
590
+ //# sourceMappingURL=pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../src/pool.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEtE,MAAM,MAAM,UAAU,GAAG;IACvB,YAAY,EAAE,eAAe,CAAA;IAC7B,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,aAAa,CAAA;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAMD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IACzC,gBAAgB,EAAE,KAAK,MAAM,EAAE,CAAA;IAC/B,MAAM,EAAE,KAAK,MAAM,EAAE,CAAA;CACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAeA;AAMD;;;GAGG;AACH,wBAAsB,IAAI,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CA2C1F"}
@@ -1,9 +1,11 @@
1
- import type { PoolKey, PopPublicClient } from './types';
1
+ import type { FeeReceiverAdmin } from './fee-receivers';
2
+ import type { AirdropStatus } from './treasury';
3
+ import type { BalanceResult, PoolKey, PopPublicClient, PricingResult } from './types';
2
4
  export type ProjectParams = {
3
5
  publicClient: PopPublicClient;
4
- factoryAddress: `0x${string}`;
5
- chainId: number;
6
6
  clankerToken: `0x${string}`;
7
+ oraclePublicClient?: PopPublicClient;
8
+ userAddress?: `0x${string}`;
7
9
  };
8
10
  export type ProjectMetadata = {
9
11
  description: string;
@@ -16,22 +18,52 @@ export type PoolInfo = {
16
18
  numPositions: bigint;
17
19
  };
18
20
  export type TreasuryStats = {
19
- balance: {
20
- raw: bigint;
21
- formatted: string;
21
+ balance: BalanceResult;
22
+ totalAllocated: BalanceResult;
23
+ utilization: number;
24
+ };
25
+ export type StakingStats = {
26
+ totalStaked: BalanceResult;
27
+ apr: {
28
+ token: {
29
+ raw: bigint;
30
+ percentage: number;
31
+ };
32
+ weth: {
33
+ raw: bigint;
34
+ percentage: number;
35
+ } | null;
22
36
  };
23
- totalAllocated: {
24
- raw: bigint;
25
- formatted: string;
37
+ outstandingRewards: {
38
+ staking: {
39
+ available: BalanceResult;
40
+ pending: BalanceResult;
41
+ };
42
+ weth: {
43
+ available: BalanceResult;
44
+ pending: BalanceResult;
45
+ } | null;
46
+ };
47
+ rewardRates: {
48
+ token: BalanceResult;
49
+ weth: BalanceResult | null;
50
+ };
51
+ };
52
+ export type GovernanceStats = {
53
+ currentCycleId: bigint;
54
+ activeProposalCount: {
55
+ boost: bigint;
56
+ transfer: bigint;
26
57
  };
27
- utilization: number;
28
58
  };
29
59
  export type Project = {
60
+ chainId: number;
30
61
  treasury: `0x${string}`;
31
62
  governor: `0x${string}`;
32
63
  staking: `0x${string}`;
33
64
  stakedToken: `0x${string}`;
34
65
  forwarder: `0x${string}`;
66
+ factory: `0x${string}`;
35
67
  token: {
36
68
  address: `0x${string}`;
37
69
  decimals: number;
@@ -43,9 +75,27 @@ export type Project = {
43
75
  };
44
76
  pool?: PoolInfo;
45
77
  treasuryStats?: TreasuryStats;
78
+ stakingStats?: StakingStats;
79
+ governanceStats?: GovernanceStats;
80
+ feeReceivers?: FeeReceiverAdmin[];
81
+ pricing?: PricingResult;
82
+ airdrop?: AirdropStatus | null;
83
+ };
84
+ export type ProjectsParams = {
85
+ publicClient: PopPublicClient;
86
+ offset?: number;
87
+ limit?: number;
46
88
  };
89
+ export type ProjectsResult = {
90
+ projects: Omit<Project, 'forwarder' | 'pool' | 'pricing' | 'stakingStats' | 'governanceStats' | 'feeReceivers' | 'airdrop'>[];
91
+ total: number;
92
+ };
93
+ /**
94
+ * Get multiple projects data using factory's paginated getProjects()
95
+ */
96
+ export declare function getProjects({ publicClient, offset, limit, }: ProjectsParams): Promise<ProjectsResult>;
47
97
  /**
48
98
  * Get project data for a clanker token
49
99
  */
50
- export declare function project({ publicClient, factoryAddress, chainId, clankerToken, }: ProjectParams): Promise<Project | null>;
100
+ export declare function getProject({ publicClient, clankerToken, oraclePublicClient, userAddress, }: ProjectParams): Promise<Project | null>;
51
101
  //# sourceMappingURL=project.d.ts.map