@alephium/powfi-sdk 0.0.1-rc.1

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 (146) hide show
  1. package/README.md +4 -0
  2. package/clmm/artifacts/BitmapWord.ral.json +125 -0
  3. package/clmm/artifacts/BitmapWordDeployer.ral.json +31 -0
  4. package/clmm/artifacts/CreateConfig.ral.json +37 -0
  5. package/clmm/artifacts/CreateLiquidPool.ral.json +55 -0
  6. package/clmm/artifacts/DexAccount.ral.json +110 -0
  7. package/clmm/artifacts/LiquidityAmountsTest.ral.json +161 -0
  8. package/clmm/artifacts/LiquidityManagmentTest.ral.json +384 -0
  9. package/clmm/artifacts/Pool.ral.json +1530 -0
  10. package/clmm/artifacts/PoolConfig.ral.json +31 -0
  11. package/clmm/artifacts/PoolFactory.ral.json +300 -0
  12. package/clmm/artifacts/PoolRouterDemo.ral.json +49 -0
  13. package/clmm/artifacts/PoolUser.ral.json +89 -0
  14. package/clmm/artifacts/Position.ral.json +183 -0
  15. package/clmm/artifacts/PositionManager.ral.json +416 -0
  16. package/clmm/artifacts/SwapWithoutAccount.ral.json +46 -0
  17. package/clmm/artifacts/TestToken.ral.json +68 -0
  18. package/clmm/artifacts/Tick.ral.json +161 -0
  19. package/clmm/artifacts/TickBitmapTest.ral.json +220 -0
  20. package/clmm/artifacts/constants.ral.json +81 -0
  21. package/clmm/artifacts/structs.ral.json +335 -0
  22. package/clmm/artifacts/ts/BitmapWord.ts +337 -0
  23. package/clmm/artifacts/ts/BitmapWordDeployer.ts +164 -0
  24. package/clmm/artifacts/ts/DexAccount.ts +330 -0
  25. package/clmm/artifacts/ts/LiquidityAmountsTest.ts +464 -0
  26. package/clmm/artifacts/ts/LiquidityManagmentTest.ts +859 -0
  27. package/clmm/artifacts/ts/Pool.ts +2535 -0
  28. package/clmm/artifacts/ts/PoolConfig.ts +179 -0
  29. package/clmm/artifacts/ts/PoolFactory.ts +640 -0
  30. package/clmm/artifacts/ts/PoolUser.ts +237 -0
  31. package/clmm/artifacts/ts/Position.ts +440 -0
  32. package/clmm/artifacts/ts/PositionManager.ts +929 -0
  33. package/clmm/artifacts/ts/TestToken.ts +277 -0
  34. package/clmm/artifacts/ts/Tick.ts +351 -0
  35. package/clmm/artifacts/ts/TickBitmapTest.ts +512 -0
  36. package/clmm/artifacts/ts/constants.ts +17 -0
  37. package/clmm/artifacts/ts/contracts.ts +26 -0
  38. package/clmm/artifacts/ts/deployments.ts +160 -0
  39. package/clmm/artifacts/ts/index.ts +20 -0
  40. package/clmm/artifacts/ts/scripts.ts +76 -0
  41. package/clmm/artifacts/ts/types.ts +105 -0
  42. package/clmm/deployments/.deployments.devnet.json +350 -0
  43. package/clmm/deployments/.deployments.testnet.json +350 -0
  44. package/cpmm/artifacts/dex/DexAccount.ral.json +110 -0
  45. package/cpmm/artifacts/dex/Router.ral.json +361 -0
  46. package/cpmm/artifacts/dex/TokenPair.ral.json +512 -0
  47. package/cpmm/artifacts/dex/TokenPairFactory.ral.json +297 -0
  48. package/cpmm/artifacts/examples/ExampleOracleSimple.ral.json +192 -0
  49. package/cpmm/artifacts/examples/FeeCollectorFactoryImpl.ral.json +185 -0
  50. package/cpmm/artifacts/examples/FeeCollectorPerTokenPairImpl.ral.json +216 -0
  51. package/cpmm/artifacts/examples/FullMathTest.ral.json +123 -0
  52. package/cpmm/artifacts/scripts/AddLiquidity.ral.json +46 -0
  53. package/cpmm/artifacts/scripts/Burn.ral.json +31 -0
  54. package/cpmm/artifacts/scripts/CollectFee.ral.json +25 -0
  55. package/cpmm/artifacts/scripts/CreatePair.ral.json +37 -0
  56. package/cpmm/artifacts/scripts/CreatePairAndAddLiquidity.ral.json +43 -0
  57. package/cpmm/artifacts/scripts/EnableFeeCollector.ral.json +28 -0
  58. package/cpmm/artifacts/scripts/Mint.ral.json +34 -0
  59. package/cpmm/artifacts/scripts/RemoveLiquidity.ral.json +43 -0
  60. package/cpmm/artifacts/scripts/SetFeeCollectorFactory.ral.json +28 -0
  61. package/cpmm/artifacts/scripts/Swap.ral.json +46 -0
  62. package/cpmm/artifacts/scripts/SwapMaxIn.ral.json +46 -0
  63. package/cpmm/artifacts/scripts/SwapMinOut.ral.json +46 -0
  64. package/cpmm/artifacts/test/GetToken.ral.json +31 -0
  65. package/cpmm/artifacts/test/MathTest.ral.json +49 -0
  66. package/cpmm/artifacts/test/TestToken.ral.json +87 -0
  67. package/cpmm/artifacts/ts/DexAccount.ts +329 -0
  68. package/cpmm/artifacts/ts/ExampleOracleSimple.ts +383 -0
  69. package/cpmm/artifacts/ts/FeeCollectorFactoryImpl.ts +227 -0
  70. package/cpmm/artifacts/ts/FeeCollectorPerTokenPairImpl.ts +327 -0
  71. package/cpmm/artifacts/ts/FullMathTest.ts +251 -0
  72. package/cpmm/artifacts/ts/MathTest.ts +183 -0
  73. package/cpmm/artifacts/ts/Router.ts +554 -0
  74. package/cpmm/artifacts/ts/TestToken.ts +312 -0
  75. package/cpmm/artifacts/ts/TokenPair.ts +947 -0
  76. package/cpmm/artifacts/ts/TokenPairFactory.ts +501 -0
  77. package/cpmm/artifacts/ts/contracts.ts +26 -0
  78. package/cpmm/artifacts/ts/deployments.ts +109 -0
  79. package/cpmm/artifacts/ts/index.ts +16 -0
  80. package/cpmm/artifacts/ts/scripts.ts +142 -0
  81. package/cpmm/deployments/.deployments.devnet.json +77 -0
  82. package/cpmm/deployments/.deployments.testnet.json +79 -0
  83. package/lib/index.d.mts +8800 -0
  84. package/lib/index.d.ts +8800 -0
  85. package/lib/index.js +21769 -0
  86. package/lib/index.js.map +1 -0
  87. package/lib/index.mjs +22118 -0
  88. package/lib/index.mjs.map +1 -0
  89. package/package.json +80 -0
  90. package/src/clmm/clmm.ts +607 -0
  91. package/src/clmm/constants.ts +7 -0
  92. package/src/clmm/index.ts +6 -0
  93. package/src/clmm/liquidity.ts +163 -0
  94. package/src/clmm/pool.ts +154 -0
  95. package/src/clmm/tick.ts +335 -0
  96. package/src/clmm/types.ts +155 -0
  97. package/src/common/constants.ts +1 -0
  98. package/src/common/error.ts +46 -0
  99. package/src/common/index.ts +7 -0
  100. package/src/common/logger.ts +82 -0
  101. package/src/common/math.ts +88 -0
  102. package/src/common/numeric.ts +64 -0
  103. package/src/common/types.ts +49 -0
  104. package/src/common/utils.ts +3 -0
  105. package/src/cpmm/constants.ts +2 -0
  106. package/src/cpmm/cpmm.ts +631 -0
  107. package/src/cpmm/index.ts +3 -0
  108. package/src/cpmm/types.ts +113 -0
  109. package/src/index.ts +25 -0
  110. package/src/moduleBase.ts +64 -0
  111. package/src/staking/index.ts +4 -0
  112. package/src/staking/settings.ts +38 -0
  113. package/src/staking/staking.ts +277 -0
  114. package/src/staking/types.ts +15 -0
  115. package/src/staking/utils.ts +25 -0
  116. package/src/token/index.ts +1 -0
  117. package/src/token/token.ts +163 -0
  118. package/src/zeta.ts +105 -0
  119. package/staking/artifacts/AlphStakeAndLock.ral.json +31 -0
  120. package/staking/artifacts/AlphUnstakeVault.ral.json +151 -0
  121. package/staking/artifacts/XAlphStakeVault.ral.json +559 -0
  122. package/staking/artifacts/XAlphToken.ral.json +404 -0
  123. package/staking/artifacts/XAlphUnlockAndStartUnstake.ral.json +31 -0
  124. package/staking/artifacts/examples/GovernanceDemo.ral.json +282 -0
  125. package/staking/artifacts/examples/RewardSharingVault.ral.json +253 -0
  126. package/staking/artifacts/structs.ral.json +47 -0
  127. package/staking/artifacts/ts/AlphUnstakeVault.ts +354 -0
  128. package/staking/artifacts/ts/FullMathTest.ts +175 -0
  129. package/staking/artifacts/ts/GovernanceDemo.ts +726 -0
  130. package/staking/artifacts/ts/RewardSharingVault.ts +559 -0
  131. package/staking/artifacts/ts/TestDynamicArrayByteVec32.ts +431 -0
  132. package/staking/artifacts/ts/TestDynamicSortedArrayForU256.ts +516 -0
  133. package/staking/artifacts/ts/TestMerkleProof.ts +343 -0
  134. package/staking/artifacts/ts/XAlphStakeVault.ts +1120 -0
  135. package/staking/artifacts/ts/XAlphToken.ts +835 -0
  136. package/staking/artifacts/ts/contracts.ts +26 -0
  137. package/staking/artifacts/ts/deployments.ts +109 -0
  138. package/staking/artifacts/ts/index.ts +15 -0
  139. package/staking/artifacts/ts/scripts.ts +35 -0
  140. package/staking/artifacts/ts/types.ts +19 -0
  141. package/staking/artifacts/utils/FullMathTest.ral.json +57 -0
  142. package/staking/artifacts/utils/TestDynamicArrayByteVec32.ral.json +165 -0
  143. package/staking/artifacts/utils/TestDynamicSortedArrayForU256.ral.json +189 -0
  144. package/staking/artifacts/utils/TestMerkleProof.ral.json +134 -0
  145. package/staking/deployments/.deployments.devnet.json +77 -0
  146. package/staking/deployments/.deployments.testnet.json +78 -0
@@ -0,0 +1,2535 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import {
6
+ Address,
7
+ Contract,
8
+ ContractState,
9
+ TestContractResult,
10
+ HexString,
11
+ ContractFactory,
12
+ EventSubscribeOptions,
13
+ EventSubscription,
14
+ CallContractParams,
15
+ CallContractResult,
16
+ TestContractParams,
17
+ ContractEvent,
18
+ subscribeContractEvent,
19
+ subscribeContractEvents,
20
+ testMethod,
21
+ callMethod,
22
+ multicallMethods,
23
+ fetchContractState,
24
+ Asset,
25
+ ContractInstance,
26
+ getContractEventsCurrentCount,
27
+ TestContractParamsWithoutMaps,
28
+ TestContractResultWithoutMaps,
29
+ SignExecuteContractMethodParams,
30
+ SignExecuteScriptTxResult,
31
+ signExecuteMethod,
32
+ addStdIdToFields,
33
+ encodeContractFields,
34
+ Narrow,
35
+ } from "@alephium/web3";
36
+ import { default as PoolContractJson } from "../Pool.ral.json";
37
+ import { getContractByCodeHash, registerContract } from "./contracts";
38
+ import * as types from "./types";
39
+
40
+ // Custom types for the contract
41
+ export namespace PoolTypes {
42
+ export type Fields = {
43
+ parent: HexString;
44
+ positionTemplate: HexString;
45
+ dexAccountTemplate: HexString;
46
+ tickTemplate: HexString;
47
+ wordTemplate: HexString;
48
+ configIndex: bigint;
49
+ token0: HexString;
50
+ token1: HexString;
51
+ token2: HexString;
52
+ fee: bigint;
53
+ tickSpacing: bigint;
54
+ maxLiquidityPerTick: bigint;
55
+ nextNftIndex: bigint;
56
+ slot0: types.Slot0;
57
+ liquidity: bigint;
58
+ rewardInfos: [types.Reward, types.Reward, types.Reward];
59
+ feeGrowths: [bigint, bigint, bigint];
60
+ protocolFees: types.ProtocolFees;
61
+ };
62
+
63
+ export type State = ContractState<Fields>;
64
+
65
+ export type InitializeEvent = ContractEvent<{
66
+ sqrtPriceX96: bigint;
67
+ tick: bigint;
68
+ }>;
69
+ export type SwapStartEvent = ContractEvent<{ sqrtPriceX96: bigint }>;
70
+ export type SwapStepEvent = ContractEvent<{
71
+ sqrtPriceX96: bigint;
72
+ liquidity: bigint;
73
+ }>;
74
+ export type SwapEvent = ContractEvent<{
75
+ sender: Address;
76
+ recipient: Address;
77
+ amount0: bigint;
78
+ amount1: bigint;
79
+ sqrtPriceX96: bigint;
80
+ liquidity: bigint;
81
+ tick: bigint;
82
+ }>;
83
+ export type MintEvent = ContractEvent<{
84
+ sender: Address;
85
+ owner: Address;
86
+ tickLower: bigint;
87
+ tickUpper: bigint;
88
+ liquidity: bigint;
89
+ amount0: bigint;
90
+ amount1: bigint;
91
+ timestamp: bigint;
92
+ }>;
93
+ export type BurnEvent = ContractEvent<{
94
+ operator: Address;
95
+ owner: Address;
96
+ tickLower: bigint;
97
+ tickUpper: bigint;
98
+ liquidity: bigint;
99
+ amount0: bigint;
100
+ amount1: bigint;
101
+ }>;
102
+ export type CollectEvent = ContractEvent<{
103
+ operator: Address;
104
+ recipient: Address;
105
+ owner: Address;
106
+ tickLower: bigint;
107
+ tickUpper: bigint;
108
+ amount0: bigint;
109
+ amount1: bigint;
110
+ amount2: bigint;
111
+ }>;
112
+ export type FeesEvent = ContractEvent<{
113
+ owner: Address;
114
+ tickLower: bigint;
115
+ tickUpper: bigint;
116
+ amount0: bigint;
117
+ amount1: bigint;
118
+ amount2: bigint;
119
+ timestamp: bigint;
120
+ }>;
121
+ export type CollectProtocolEvent = ContractEvent<{
122
+ sender: Address;
123
+ recipient: Address;
124
+ amount0: bigint;
125
+ amount1: bigint;
126
+ }>;
127
+
128
+ export interface CallMethodTable {
129
+ getCollectionUri: {
130
+ params: Omit<CallContractParams<{}>, "args">;
131
+ result: CallContractResult<HexString>;
132
+ };
133
+ totalSupply: {
134
+ params: Omit<CallContractParams<{}>, "args">;
135
+ result: CallContractResult<bigint>;
136
+ };
137
+ nftByIndex: {
138
+ params: CallContractParams<{ index: bigint }>;
139
+ result: CallContractResult<HexString>;
140
+ };
141
+ validateNFT: {
142
+ params: CallContractParams<{ nftId: HexString; nftIndex: bigint }>;
143
+ result: CallContractResult<null>;
144
+ };
145
+ getSqrtRatioAtTick: {
146
+ params: CallContractParams<{ tick: bigint }>;
147
+ result: CallContractResult<bigint>;
148
+ };
149
+ getTickAtSqrtRatio: {
150
+ params: CallContractParams<{ sqrtPriceX96: bigint }>;
151
+ result: CallContractResult<bigint>;
152
+ };
153
+ computeSwapStep: {
154
+ params: CallContractParams<{
155
+ sqrtRatioCurrentX96: bigint;
156
+ sqrtRatioTargetX96: bigint;
157
+ liquidity_: bigint;
158
+ amountRemaining: bigint;
159
+ feePips: bigint;
160
+ }>;
161
+ result: CallContractResult<[bigint, bigint, bigint, bigint]>;
162
+ };
163
+ divRoundingUp: {
164
+ params: CallContractParams<{ x: bigint; y: bigint }>;
165
+ result: CallContractResult<bigint>;
166
+ };
167
+ getNextSqrtPriceFromAmount0RoundingUp: {
168
+ params: CallContractParams<{
169
+ sqrtPX96: bigint;
170
+ liquidity_: bigint;
171
+ amount: bigint;
172
+ add: boolean;
173
+ }>;
174
+ result: CallContractResult<bigint>;
175
+ };
176
+ getNextSqrtPriceFromAmount1RoundingDown: {
177
+ params: CallContractParams<{
178
+ sqrtPX96: bigint;
179
+ liquidity_: bigint;
180
+ amount: bigint;
181
+ add: boolean;
182
+ }>;
183
+ result: CallContractResult<bigint>;
184
+ };
185
+ getNextSqrtPriceFromInput: {
186
+ params: CallContractParams<{
187
+ sqrtPX96: bigint;
188
+ liquidity_: bigint;
189
+ amountIn: bigint;
190
+ zeroForOne: boolean;
191
+ }>;
192
+ result: CallContractResult<bigint>;
193
+ };
194
+ getNextSqrtPriceFromOutput: {
195
+ params: CallContractParams<{
196
+ sqrtPX96: bigint;
197
+ liquidity_: bigint;
198
+ amountOut: bigint;
199
+ zeroForOne: boolean;
200
+ }>;
201
+ result: CallContractResult<bigint>;
202
+ };
203
+ getAmount0DeltaEx: {
204
+ params: CallContractParams<{
205
+ sqrtRatioAX96: bigint;
206
+ sqrtRatioBX96: bigint;
207
+ liquidityDelta: bigint;
208
+ roundUp: boolean;
209
+ }>;
210
+ result: CallContractResult<bigint>;
211
+ };
212
+ getAmount0Delta: {
213
+ params: CallContractParams<{
214
+ sqrtRatioAX96: bigint;
215
+ sqrtRatioBX96: bigint;
216
+ liquidityDelta: bigint;
217
+ }>;
218
+ result: CallContractResult<bigint>;
219
+ };
220
+ getAmount1DeltaEx: {
221
+ params: CallContractParams<{
222
+ sqrtRatioAX96: bigint;
223
+ sqrtRatioBX96: bigint;
224
+ liquidityDelta: bigint;
225
+ roundUp: boolean;
226
+ }>;
227
+ result: CallContractResult<bigint>;
228
+ };
229
+ getAmount1Delta: {
230
+ params: CallContractParams<{
231
+ sqrtRatioAX96: bigint;
232
+ sqrtRatioBX96: bigint;
233
+ liquidityDelta: bigint;
234
+ }>;
235
+ result: CallContractResult<bigint>;
236
+ };
237
+ mulDiv: {
238
+ params: CallContractParams<{ a: bigint; b: bigint; denominator: bigint }>;
239
+ result: CallContractResult<bigint>;
240
+ };
241
+ mulDivRoundingUp: {
242
+ params: CallContractParams<{ a: bigint; b: bigint; denominator: bigint }>;
243
+ result: CallContractResult<bigint>;
244
+ };
245
+ wordPath: {
246
+ params: CallContractParams<{ compressed: bigint }>;
247
+ result: CallContractResult<HexString>;
248
+ };
249
+ getWord: {
250
+ params: CallContractParams<{ compressed: bigint }>;
251
+ result: CallContractResult<HexString>;
252
+ };
253
+ getWordOrTemplate: {
254
+ params: CallContractParams<{ compressed: bigint }>;
255
+ result: CallContractResult<HexString>;
256
+ };
257
+ flipTick: {
258
+ params: CallContractParams<{ tick: bigint }>;
259
+ result: CallContractResult<null>;
260
+ };
261
+ nextInitializedTickWithinOneWord: {
262
+ params: CallContractParams<{ tick: bigint; zeroForOne: boolean }>;
263
+ result: CallContractResult<[bigint, boolean]>;
264
+ };
265
+ positionPath: {
266
+ params: CallContractParams<{
267
+ o: Address;
268
+ tickLower: bigint;
269
+ tickUpper: bigint;
270
+ }>;
271
+ result: CallContractResult<HexString>;
272
+ };
273
+ positionContractId: {
274
+ params: CallContractParams<{
275
+ pool: HexString;
276
+ o: Address;
277
+ tickLower: bigint;
278
+ tickUpper: bigint;
279
+ }>;
280
+ result: CallContractResult<HexString>;
281
+ };
282
+ configPath: {
283
+ params: CallContractParams<{ configIndex_: bigint }>;
284
+ result: CallContractResult<HexString>;
285
+ };
286
+ poolPath: {
287
+ params: CallContractParams<{
288
+ factory: HexString;
289
+ tokens: HexString;
290
+ configIndex_: bigint;
291
+ }>;
292
+ result: CallContractResult<HexString>;
293
+ };
294
+ poolContractId: {
295
+ params: CallContractParams<{
296
+ factory: HexString;
297
+ tokens: HexString;
298
+ configIndex_: bigint;
299
+ }>;
300
+ result: CallContractResult<HexString>;
301
+ };
302
+ checkTicks: {
303
+ params: CallContractParams<{ tickLower: bigint; tickUpper: bigint }>;
304
+ result: CallContractResult<null>;
305
+ };
306
+ tickPath: {
307
+ params: CallContractParams<{ tick: bigint }>;
308
+ result: CallContractResult<HexString>;
309
+ };
310
+ toTick: {
311
+ params: CallContractParams<{ tick: bigint }>;
312
+ result: CallContractResult<HexString>;
313
+ };
314
+ getTick: {
315
+ params: CallContractParams<{ tick: bigint }>;
316
+ result: CallContractResult<[HexString, boolean]>;
317
+ };
318
+ toPosition: {
319
+ params: CallContractParams<{
320
+ owner: Address;
321
+ tickLower: bigint;
322
+ tickUpper: bigint;
323
+ }>;
324
+ result: CallContractResult<HexString>;
325
+ };
326
+ getPosition: {
327
+ params: CallContractParams<{
328
+ owner: Address;
329
+ tickLower: bigint;
330
+ tickUpper: bigint;
331
+ }>;
332
+ result: CallContractResult<[HexString, boolean]>;
333
+ };
334
+ getFeeGrowthInside: {
335
+ params: CallContractParams<{
336
+ tickLower: HexString;
337
+ tickUpper: HexString;
338
+ }>;
339
+ result: CallContractResult<[bigint, bigint, bigint]>;
340
+ };
341
+ updatePosition: {
342
+ params: CallContractParams<{
343
+ position: HexString;
344
+ owner: Address;
345
+ tickLower: bigint;
346
+ tickUpper: bigint;
347
+ liquidityDelta: bigint;
348
+ }>;
349
+ result: CallContractResult<[bigint, bigint, bigint]>;
350
+ };
351
+ modifyPosition: {
352
+ params: CallContractParams<{
353
+ position: HexString;
354
+ params: types.ModifyPositionParams;
355
+ }>;
356
+ result: CallContractResult<[bigint, bigint, [bigint, bigint, bigint]]>;
357
+ };
358
+ mint: {
359
+ params: CallContractParams<{
360
+ payer: Address;
361
+ owner: Address;
362
+ tickLower: bigint;
363
+ tickUpper: bigint;
364
+ amount: bigint;
365
+ }>;
366
+ result: CallContractResult<[bigint, bigint]>;
367
+ };
368
+ burn: {
369
+ params: CallContractParams<{
370
+ operator: Address;
371
+ owner: Address;
372
+ tickLower: bigint;
373
+ tickUpper: bigint;
374
+ amount: bigint;
375
+ }>;
376
+ result: CallContractResult<[bigint, bigint]>;
377
+ };
378
+ collect: {
379
+ params: CallContractParams<{
380
+ operator: Address;
381
+ recipient: Address;
382
+ owner: Address;
383
+ tickLower: bigint;
384
+ tickUpper: bigint;
385
+ maxAmounts: [bigint, bigint, bigint];
386
+ }>;
387
+ result: CallContractResult<[bigint, bigint, bigint]>;
388
+ };
389
+ withdraw: {
390
+ params: CallContractParams<{
391
+ recipient: Address;
392
+ amounts: [bigint, bigint, bigint];
393
+ }>;
394
+ result: CallContractResult<null>;
395
+ };
396
+ simulateSwap: {
397
+ params: CallContractParams<{
398
+ zeroForOne: boolean;
399
+ amountSpecified: bigint;
400
+ data: HexString;
401
+ maxSteps: bigint;
402
+ }>;
403
+ result: CallContractResult<null>;
404
+ };
405
+ swap: {
406
+ params: CallContractParams<{
407
+ payer: Address;
408
+ recipient: Address;
409
+ token: HexString;
410
+ zeroForOne: boolean;
411
+ amountSpecified: bigint;
412
+ sqrtPriceLimitX96: bigint;
413
+ data: HexString;
414
+ }>;
415
+ result: CallContractResult<[bigint, bigint]>;
416
+ };
417
+ pop: {
418
+ params: CallContractParams<{
419
+ data: HexString;
420
+ t: HexString;
421
+ exactInput: boolean;
422
+ }>;
423
+ result: CallContractResult<[boolean, bigint, HexString, HexString]>;
424
+ };
425
+ swapExactOut: {
426
+ params: CallContractParams<{ p: types.SwapParams; refRewards: bigint }>;
427
+ result: CallContractResult<null>;
428
+ };
429
+ swapExactIn: {
430
+ params: CallContractParams<{ p: types.SwapParams; refRewards: bigint }>;
431
+ result: CallContractResult<null>;
432
+ };
433
+ getSqrtPricesX96: {
434
+ params: CallContractParams<{ tickLower: bigint; tickUpper: bigint }>;
435
+ result: CallContractResult<[bigint, bigint, bigint]>;
436
+ };
437
+ updateReward: {
438
+ params: CallContractParams<{ index: bigint; blockTime: bigint }>;
439
+ result: CallContractResult<null>;
440
+ };
441
+ updateRewards: {
442
+ params: CallContractParams<{ blockTime: bigint }>;
443
+ result: CallContractResult<null>;
444
+ };
445
+ extendRewards: {
446
+ params: CallContractParams<{
447
+ payer: Address;
448
+ index: bigint;
449
+ amount: bigint;
450
+ }>;
451
+ result: CallContractResult<null>;
452
+ };
453
+ setRewardParams: {
454
+ params: CallContractParams<{
455
+ payer: Address;
456
+ index: bigint;
457
+ openTime: bigint;
458
+ endTime: bigint;
459
+ amount: bigint;
460
+ }>;
461
+ result: CallContractResult<null>;
462
+ };
463
+ collectProtocolFees: {
464
+ params: CallContractParams<{ recipient: Address }>;
465
+ result: CallContractResult<null>;
466
+ };
467
+ positionInfo: {
468
+ params: CallContractParams<{
469
+ owner: Address;
470
+ tickLower: bigint;
471
+ tickUpper: bigint;
472
+ acc: bigint;
473
+ iacc0: bigint;
474
+ iacc1: bigint;
475
+ t0: bigint;
476
+ acct0: bigint;
477
+ }>;
478
+ result: CallContractResult<types.PositionInfo>;
479
+ };
480
+ getTokenUri: {
481
+ params: Omit<CallContractParams<{}>, "args">;
482
+ result: CallContractResult<HexString>;
483
+ };
484
+ }
485
+ export type CallMethodParams<T extends keyof CallMethodTable> =
486
+ CallMethodTable[T]["params"];
487
+ export type CallMethodResult<T extends keyof CallMethodTable> =
488
+ CallMethodTable[T]["result"];
489
+ export type MultiCallParams = Partial<{
490
+ [Name in keyof CallMethodTable]: CallMethodTable[Name]["params"];
491
+ }>;
492
+ export type MultiCallResults<T extends MultiCallParams> = {
493
+ [MaybeName in keyof T]: MaybeName extends keyof CallMethodTable
494
+ ? CallMethodTable[MaybeName]["result"]
495
+ : undefined;
496
+ };
497
+ export type MulticallReturnType<Callss extends MultiCallParams[]> = {
498
+ [index in keyof Callss]: MultiCallResults<Callss[index]>;
499
+ };
500
+
501
+ export interface SignExecuteMethodTable {
502
+ getCollectionUri: {
503
+ params: Omit<SignExecuteContractMethodParams<{}>, "args">;
504
+ result: SignExecuteScriptTxResult;
505
+ };
506
+ totalSupply: {
507
+ params: Omit<SignExecuteContractMethodParams<{}>, "args">;
508
+ result: SignExecuteScriptTxResult;
509
+ };
510
+ nftByIndex: {
511
+ params: SignExecuteContractMethodParams<{ index: bigint }>;
512
+ result: SignExecuteScriptTxResult;
513
+ };
514
+ validateNFT: {
515
+ params: SignExecuteContractMethodParams<{
516
+ nftId: HexString;
517
+ nftIndex: bigint;
518
+ }>;
519
+ result: SignExecuteScriptTxResult;
520
+ };
521
+ getSqrtRatioAtTick: {
522
+ params: SignExecuteContractMethodParams<{ tick: bigint }>;
523
+ result: SignExecuteScriptTxResult;
524
+ };
525
+ getTickAtSqrtRatio: {
526
+ params: SignExecuteContractMethodParams<{ sqrtPriceX96: bigint }>;
527
+ result: SignExecuteScriptTxResult;
528
+ };
529
+ computeSwapStep: {
530
+ params: SignExecuteContractMethodParams<{
531
+ sqrtRatioCurrentX96: bigint;
532
+ sqrtRatioTargetX96: bigint;
533
+ liquidity_: bigint;
534
+ amountRemaining: bigint;
535
+ feePips: bigint;
536
+ }>;
537
+ result: SignExecuteScriptTxResult;
538
+ };
539
+ divRoundingUp: {
540
+ params: SignExecuteContractMethodParams<{ x: bigint; y: bigint }>;
541
+ result: SignExecuteScriptTxResult;
542
+ };
543
+ getNextSqrtPriceFromAmount0RoundingUp: {
544
+ params: SignExecuteContractMethodParams<{
545
+ sqrtPX96: bigint;
546
+ liquidity_: bigint;
547
+ amount: bigint;
548
+ add: boolean;
549
+ }>;
550
+ result: SignExecuteScriptTxResult;
551
+ };
552
+ getNextSqrtPriceFromAmount1RoundingDown: {
553
+ params: SignExecuteContractMethodParams<{
554
+ sqrtPX96: bigint;
555
+ liquidity_: bigint;
556
+ amount: bigint;
557
+ add: boolean;
558
+ }>;
559
+ result: SignExecuteScriptTxResult;
560
+ };
561
+ getNextSqrtPriceFromInput: {
562
+ params: SignExecuteContractMethodParams<{
563
+ sqrtPX96: bigint;
564
+ liquidity_: bigint;
565
+ amountIn: bigint;
566
+ zeroForOne: boolean;
567
+ }>;
568
+ result: SignExecuteScriptTxResult;
569
+ };
570
+ getNextSqrtPriceFromOutput: {
571
+ params: SignExecuteContractMethodParams<{
572
+ sqrtPX96: bigint;
573
+ liquidity_: bigint;
574
+ amountOut: bigint;
575
+ zeroForOne: boolean;
576
+ }>;
577
+ result: SignExecuteScriptTxResult;
578
+ };
579
+ getAmount0DeltaEx: {
580
+ params: SignExecuteContractMethodParams<{
581
+ sqrtRatioAX96: bigint;
582
+ sqrtRatioBX96: bigint;
583
+ liquidityDelta: bigint;
584
+ roundUp: boolean;
585
+ }>;
586
+ result: SignExecuteScriptTxResult;
587
+ };
588
+ getAmount0Delta: {
589
+ params: SignExecuteContractMethodParams<{
590
+ sqrtRatioAX96: bigint;
591
+ sqrtRatioBX96: bigint;
592
+ liquidityDelta: bigint;
593
+ }>;
594
+ result: SignExecuteScriptTxResult;
595
+ };
596
+ getAmount1DeltaEx: {
597
+ params: SignExecuteContractMethodParams<{
598
+ sqrtRatioAX96: bigint;
599
+ sqrtRatioBX96: bigint;
600
+ liquidityDelta: bigint;
601
+ roundUp: boolean;
602
+ }>;
603
+ result: SignExecuteScriptTxResult;
604
+ };
605
+ getAmount1Delta: {
606
+ params: SignExecuteContractMethodParams<{
607
+ sqrtRatioAX96: bigint;
608
+ sqrtRatioBX96: bigint;
609
+ liquidityDelta: bigint;
610
+ }>;
611
+ result: SignExecuteScriptTxResult;
612
+ };
613
+ mulDiv: {
614
+ params: SignExecuteContractMethodParams<{
615
+ a: bigint;
616
+ b: bigint;
617
+ denominator: bigint;
618
+ }>;
619
+ result: SignExecuteScriptTxResult;
620
+ };
621
+ mulDivRoundingUp: {
622
+ params: SignExecuteContractMethodParams<{
623
+ a: bigint;
624
+ b: bigint;
625
+ denominator: bigint;
626
+ }>;
627
+ result: SignExecuteScriptTxResult;
628
+ };
629
+ wordPath: {
630
+ params: SignExecuteContractMethodParams<{ compressed: bigint }>;
631
+ result: SignExecuteScriptTxResult;
632
+ };
633
+ getWord: {
634
+ params: SignExecuteContractMethodParams<{ compressed: bigint }>;
635
+ result: SignExecuteScriptTxResult;
636
+ };
637
+ getWordOrTemplate: {
638
+ params: SignExecuteContractMethodParams<{ compressed: bigint }>;
639
+ result: SignExecuteScriptTxResult;
640
+ };
641
+ flipTick: {
642
+ params: SignExecuteContractMethodParams<{ tick: bigint }>;
643
+ result: SignExecuteScriptTxResult;
644
+ };
645
+ nextInitializedTickWithinOneWord: {
646
+ params: SignExecuteContractMethodParams<{
647
+ tick: bigint;
648
+ zeroForOne: boolean;
649
+ }>;
650
+ result: SignExecuteScriptTxResult;
651
+ };
652
+ positionPath: {
653
+ params: SignExecuteContractMethodParams<{
654
+ o: Address;
655
+ tickLower: bigint;
656
+ tickUpper: bigint;
657
+ }>;
658
+ result: SignExecuteScriptTxResult;
659
+ };
660
+ positionContractId: {
661
+ params: SignExecuteContractMethodParams<{
662
+ pool: HexString;
663
+ o: Address;
664
+ tickLower: bigint;
665
+ tickUpper: bigint;
666
+ }>;
667
+ result: SignExecuteScriptTxResult;
668
+ };
669
+ configPath: {
670
+ params: SignExecuteContractMethodParams<{ configIndex_: bigint }>;
671
+ result: SignExecuteScriptTxResult;
672
+ };
673
+ poolPath: {
674
+ params: SignExecuteContractMethodParams<{
675
+ factory: HexString;
676
+ tokens: HexString;
677
+ configIndex_: bigint;
678
+ }>;
679
+ result: SignExecuteScriptTxResult;
680
+ };
681
+ poolContractId: {
682
+ params: SignExecuteContractMethodParams<{
683
+ factory: HexString;
684
+ tokens: HexString;
685
+ configIndex_: bigint;
686
+ }>;
687
+ result: SignExecuteScriptTxResult;
688
+ };
689
+ checkTicks: {
690
+ params: SignExecuteContractMethodParams<{
691
+ tickLower: bigint;
692
+ tickUpper: bigint;
693
+ }>;
694
+ result: SignExecuteScriptTxResult;
695
+ };
696
+ tickPath: {
697
+ params: SignExecuteContractMethodParams<{ tick: bigint }>;
698
+ result: SignExecuteScriptTxResult;
699
+ };
700
+ toTick: {
701
+ params: SignExecuteContractMethodParams<{ tick: bigint }>;
702
+ result: SignExecuteScriptTxResult;
703
+ };
704
+ getTick: {
705
+ params: SignExecuteContractMethodParams<{ tick: bigint }>;
706
+ result: SignExecuteScriptTxResult;
707
+ };
708
+ toPosition: {
709
+ params: SignExecuteContractMethodParams<{
710
+ owner: Address;
711
+ tickLower: bigint;
712
+ tickUpper: bigint;
713
+ }>;
714
+ result: SignExecuteScriptTxResult;
715
+ };
716
+ getPosition: {
717
+ params: SignExecuteContractMethodParams<{
718
+ owner: Address;
719
+ tickLower: bigint;
720
+ tickUpper: bigint;
721
+ }>;
722
+ result: SignExecuteScriptTxResult;
723
+ };
724
+ getFeeGrowthInside: {
725
+ params: SignExecuteContractMethodParams<{
726
+ tickLower: HexString;
727
+ tickUpper: HexString;
728
+ }>;
729
+ result: SignExecuteScriptTxResult;
730
+ };
731
+ updatePosition: {
732
+ params: SignExecuteContractMethodParams<{
733
+ position: HexString;
734
+ owner: Address;
735
+ tickLower: bigint;
736
+ tickUpper: bigint;
737
+ liquidityDelta: bigint;
738
+ }>;
739
+ result: SignExecuteScriptTxResult;
740
+ };
741
+ modifyPosition: {
742
+ params: SignExecuteContractMethodParams<{
743
+ position: HexString;
744
+ params: types.ModifyPositionParams;
745
+ }>;
746
+ result: SignExecuteScriptTxResult;
747
+ };
748
+ mint: {
749
+ params: SignExecuteContractMethodParams<{
750
+ payer: Address;
751
+ owner: Address;
752
+ tickLower: bigint;
753
+ tickUpper: bigint;
754
+ amount: bigint;
755
+ }>;
756
+ result: SignExecuteScriptTxResult;
757
+ };
758
+ burn: {
759
+ params: SignExecuteContractMethodParams<{
760
+ operator: Address;
761
+ owner: Address;
762
+ tickLower: bigint;
763
+ tickUpper: bigint;
764
+ amount: bigint;
765
+ }>;
766
+ result: SignExecuteScriptTxResult;
767
+ };
768
+ collect: {
769
+ params: SignExecuteContractMethodParams<{
770
+ operator: Address;
771
+ recipient: Address;
772
+ owner: Address;
773
+ tickLower: bigint;
774
+ tickUpper: bigint;
775
+ maxAmounts: [bigint, bigint, bigint];
776
+ }>;
777
+ result: SignExecuteScriptTxResult;
778
+ };
779
+ withdraw: {
780
+ params: SignExecuteContractMethodParams<{
781
+ recipient: Address;
782
+ amounts: [bigint, bigint, bigint];
783
+ }>;
784
+ result: SignExecuteScriptTxResult;
785
+ };
786
+ simulateSwap: {
787
+ params: SignExecuteContractMethodParams<{
788
+ zeroForOne: boolean;
789
+ amountSpecified: bigint;
790
+ data: HexString;
791
+ maxSteps: bigint;
792
+ }>;
793
+ result: SignExecuteScriptTxResult;
794
+ };
795
+ swap: {
796
+ params: SignExecuteContractMethodParams<{
797
+ payer: Address;
798
+ recipient: Address;
799
+ token: HexString;
800
+ zeroForOne: boolean;
801
+ amountSpecified: bigint;
802
+ sqrtPriceLimitX96: bigint;
803
+ data: HexString;
804
+ }>;
805
+ result: SignExecuteScriptTxResult;
806
+ };
807
+ pop: {
808
+ params: SignExecuteContractMethodParams<{
809
+ data: HexString;
810
+ t: HexString;
811
+ exactInput: boolean;
812
+ }>;
813
+ result: SignExecuteScriptTxResult;
814
+ };
815
+ swapExactOut: {
816
+ params: SignExecuteContractMethodParams<{
817
+ p: types.SwapParams;
818
+ refRewards: bigint;
819
+ }>;
820
+ result: SignExecuteScriptTxResult;
821
+ };
822
+ swapExactIn: {
823
+ params: SignExecuteContractMethodParams<{
824
+ p: types.SwapParams;
825
+ refRewards: bigint;
826
+ }>;
827
+ result: SignExecuteScriptTxResult;
828
+ };
829
+ getSqrtPricesX96: {
830
+ params: SignExecuteContractMethodParams<{
831
+ tickLower: bigint;
832
+ tickUpper: bigint;
833
+ }>;
834
+ result: SignExecuteScriptTxResult;
835
+ };
836
+ updateReward: {
837
+ params: SignExecuteContractMethodParams<{
838
+ index: bigint;
839
+ blockTime: bigint;
840
+ }>;
841
+ result: SignExecuteScriptTxResult;
842
+ };
843
+ updateRewards: {
844
+ params: SignExecuteContractMethodParams<{ blockTime: bigint }>;
845
+ result: SignExecuteScriptTxResult;
846
+ };
847
+ extendRewards: {
848
+ params: SignExecuteContractMethodParams<{
849
+ payer: Address;
850
+ index: bigint;
851
+ amount: bigint;
852
+ }>;
853
+ result: SignExecuteScriptTxResult;
854
+ };
855
+ setRewardParams: {
856
+ params: SignExecuteContractMethodParams<{
857
+ payer: Address;
858
+ index: bigint;
859
+ openTime: bigint;
860
+ endTime: bigint;
861
+ amount: bigint;
862
+ }>;
863
+ result: SignExecuteScriptTxResult;
864
+ };
865
+ collectProtocolFees: {
866
+ params: SignExecuteContractMethodParams<{ recipient: Address }>;
867
+ result: SignExecuteScriptTxResult;
868
+ };
869
+ positionInfo: {
870
+ params: SignExecuteContractMethodParams<{
871
+ owner: Address;
872
+ tickLower: bigint;
873
+ tickUpper: bigint;
874
+ acc: bigint;
875
+ iacc0: bigint;
876
+ iacc1: bigint;
877
+ t0: bigint;
878
+ acct0: bigint;
879
+ }>;
880
+ result: SignExecuteScriptTxResult;
881
+ };
882
+ getTokenUri: {
883
+ params: Omit<SignExecuteContractMethodParams<{}>, "args">;
884
+ result: SignExecuteScriptTxResult;
885
+ };
886
+ }
887
+ export type SignExecuteMethodParams<T extends keyof SignExecuteMethodTable> =
888
+ SignExecuteMethodTable[T]["params"];
889
+ export type SignExecuteMethodResult<T extends keyof SignExecuteMethodTable> =
890
+ SignExecuteMethodTable[T]["result"];
891
+ }
892
+
893
+ class Factory extends ContractFactory<PoolInstance, PoolTypes.Fields> {
894
+ encodeFields(fields: PoolTypes.Fields) {
895
+ return encodeContractFields(
896
+ addStdIdToFields(this.contract, fields),
897
+ this.contract.fieldsSig,
898
+ types.AllStructs
899
+ );
900
+ }
901
+
902
+ eventIndex = {
903
+ Initialize: 0,
904
+ SwapStart: 1,
905
+ SwapStep: 2,
906
+ Swap: 3,
907
+ Mint: 4,
908
+ Burn: 5,
909
+ Collect: 6,
910
+ Fees: 7,
911
+ CollectProtocol: 8,
912
+ };
913
+ consts = {
914
+ MAX_PIPS: BigInt("1000000"),
915
+ TickMathError: {
916
+ SqrtPriceX96OutOfBounds: BigInt("201"),
917
+ TickOutOfBounds: BigInt("202"),
918
+ },
919
+ SqrtPriceMathError: {
920
+ SqrtFromAmountOverflow: BigInt("221"),
921
+ QuotientTooHigh: BigInt("222"),
922
+ PriceZero: BigInt("223"),
923
+ NoLiquidity: BigInt("224"),
924
+ PriceNotFitIn160: BigInt("225"),
925
+ },
926
+ FullMathError: { MulDivOverflow: BigInt("351") },
927
+ TickBitmapError: { TickNotAligned: BigInt("301") },
928
+ PathPrefixes: {
929
+ Tick: BigInt("0"),
930
+ Position: BigInt("1"),
931
+ Word: BigInt("2"),
932
+ },
933
+ PoolError: {
934
+ TLU: BigInt("102"),
935
+ TLM: BigInt("103"),
936
+ TUM: BigInt("104"),
937
+ AS: BigInt("105"),
938
+ SPL: BigInt("106"),
939
+ NP: BigInt("107"),
940
+ UnauthorizedMint: BigInt("108"),
941
+ NFTNotPartOfCollection: BigInt("109"),
942
+ NFTByIndexNotSupported: BigInt("110"),
943
+ UnauthorizedRewardSender: BigInt("111"),
944
+ InvalidRewardParams: BigInt("112"),
945
+ DexAccountNotFound: BigInt("113"),
946
+ InvalidRewardIndex: BigInt("114"),
947
+ RewardPeriodEnded: BigInt("115"),
948
+ ZeroRewardAmount: BigInt("116"),
949
+ },
950
+ };
951
+
952
+ at(address: string): PoolInstance {
953
+ return new PoolInstance(address);
954
+ }
955
+
956
+ tests = {
957
+ getCollectionUri: async (
958
+ params: Omit<
959
+ TestContractParamsWithoutMaps<PoolTypes.Fields, never>,
960
+ "args"
961
+ >
962
+ ): Promise<TestContractResultWithoutMaps<HexString>> => {
963
+ return testMethod(
964
+ this,
965
+ "getCollectionUri",
966
+ params,
967
+ getContractByCodeHash
968
+ );
969
+ },
970
+ totalSupply: async (
971
+ params: Omit<
972
+ TestContractParamsWithoutMaps<PoolTypes.Fields, never>,
973
+ "args"
974
+ >
975
+ ): Promise<TestContractResultWithoutMaps<bigint>> => {
976
+ return testMethod(this, "totalSupply", params, getContractByCodeHash);
977
+ },
978
+ nftByIndex: async (
979
+ params: TestContractParamsWithoutMaps<PoolTypes.Fields, { index: bigint }>
980
+ ): Promise<TestContractResultWithoutMaps<HexString>> => {
981
+ return testMethod(this, "nftByIndex", params, getContractByCodeHash);
982
+ },
983
+ validateNFT: async (
984
+ params: TestContractParamsWithoutMaps<
985
+ PoolTypes.Fields,
986
+ { nftId: HexString; nftIndex: bigint }
987
+ >
988
+ ): Promise<TestContractResultWithoutMaps<null>> => {
989
+ return testMethod(this, "validateNFT", params, getContractByCodeHash);
990
+ },
991
+ getSqrtRatioAtTick: async (
992
+ params: TestContractParamsWithoutMaps<PoolTypes.Fields, { tick: bigint }>
993
+ ): Promise<TestContractResultWithoutMaps<bigint>> => {
994
+ return testMethod(
995
+ this,
996
+ "getSqrtRatioAtTick",
997
+ params,
998
+ getContractByCodeHash
999
+ );
1000
+ },
1001
+ getTickAtSqrtRatio: async (
1002
+ params: TestContractParamsWithoutMaps<
1003
+ PoolTypes.Fields,
1004
+ { sqrtPriceX96: bigint }
1005
+ >
1006
+ ): Promise<TestContractResultWithoutMaps<bigint>> => {
1007
+ return testMethod(
1008
+ this,
1009
+ "getTickAtSqrtRatio",
1010
+ params,
1011
+ getContractByCodeHash
1012
+ );
1013
+ },
1014
+ computeSwapStep: async (
1015
+ params: TestContractParamsWithoutMaps<
1016
+ PoolTypes.Fields,
1017
+ {
1018
+ sqrtRatioCurrentX96: bigint;
1019
+ sqrtRatioTargetX96: bigint;
1020
+ liquidity_: bigint;
1021
+ amountRemaining: bigint;
1022
+ feePips: bigint;
1023
+ }
1024
+ >
1025
+ ): Promise<
1026
+ TestContractResultWithoutMaps<[bigint, bigint, bigint, bigint]>
1027
+ > => {
1028
+ return testMethod(this, "computeSwapStep", params, getContractByCodeHash);
1029
+ },
1030
+ divRoundingUp: async (
1031
+ params: TestContractParamsWithoutMaps<
1032
+ PoolTypes.Fields,
1033
+ { x: bigint; y: bigint }
1034
+ >
1035
+ ): Promise<TestContractResultWithoutMaps<bigint>> => {
1036
+ return testMethod(this, "divRoundingUp", params, getContractByCodeHash);
1037
+ },
1038
+ getNextSqrtPriceFromAmount0RoundingUp: async (
1039
+ params: TestContractParamsWithoutMaps<
1040
+ PoolTypes.Fields,
1041
+ { sqrtPX96: bigint; liquidity_: bigint; amount: bigint; add: boolean }
1042
+ >
1043
+ ): Promise<TestContractResultWithoutMaps<bigint>> => {
1044
+ return testMethod(
1045
+ this,
1046
+ "getNextSqrtPriceFromAmount0RoundingUp",
1047
+ params,
1048
+ getContractByCodeHash
1049
+ );
1050
+ },
1051
+ getNextSqrtPriceFromAmount1RoundingDown: async (
1052
+ params: TestContractParamsWithoutMaps<
1053
+ PoolTypes.Fields,
1054
+ { sqrtPX96: bigint; liquidity_: bigint; amount: bigint; add: boolean }
1055
+ >
1056
+ ): Promise<TestContractResultWithoutMaps<bigint>> => {
1057
+ return testMethod(
1058
+ this,
1059
+ "getNextSqrtPriceFromAmount1RoundingDown",
1060
+ params,
1061
+ getContractByCodeHash
1062
+ );
1063
+ },
1064
+ getNextSqrtPriceFromInput: async (
1065
+ params: TestContractParamsWithoutMaps<
1066
+ PoolTypes.Fields,
1067
+ {
1068
+ sqrtPX96: bigint;
1069
+ liquidity_: bigint;
1070
+ amountIn: bigint;
1071
+ zeroForOne: boolean;
1072
+ }
1073
+ >
1074
+ ): Promise<TestContractResultWithoutMaps<bigint>> => {
1075
+ return testMethod(
1076
+ this,
1077
+ "getNextSqrtPriceFromInput",
1078
+ params,
1079
+ getContractByCodeHash
1080
+ );
1081
+ },
1082
+ getNextSqrtPriceFromOutput: async (
1083
+ params: TestContractParamsWithoutMaps<
1084
+ PoolTypes.Fields,
1085
+ {
1086
+ sqrtPX96: bigint;
1087
+ liquidity_: bigint;
1088
+ amountOut: bigint;
1089
+ zeroForOne: boolean;
1090
+ }
1091
+ >
1092
+ ): Promise<TestContractResultWithoutMaps<bigint>> => {
1093
+ return testMethod(
1094
+ this,
1095
+ "getNextSqrtPriceFromOutput",
1096
+ params,
1097
+ getContractByCodeHash
1098
+ );
1099
+ },
1100
+ getAmount0DeltaEx: async (
1101
+ params: TestContractParamsWithoutMaps<
1102
+ PoolTypes.Fields,
1103
+ {
1104
+ sqrtRatioAX96: bigint;
1105
+ sqrtRatioBX96: bigint;
1106
+ liquidityDelta: bigint;
1107
+ roundUp: boolean;
1108
+ }
1109
+ >
1110
+ ): Promise<TestContractResultWithoutMaps<bigint>> => {
1111
+ return testMethod(
1112
+ this,
1113
+ "getAmount0DeltaEx",
1114
+ params,
1115
+ getContractByCodeHash
1116
+ );
1117
+ },
1118
+ getAmount0Delta: async (
1119
+ params: TestContractParamsWithoutMaps<
1120
+ PoolTypes.Fields,
1121
+ { sqrtRatioAX96: bigint; sqrtRatioBX96: bigint; liquidityDelta: bigint }
1122
+ >
1123
+ ): Promise<TestContractResultWithoutMaps<bigint>> => {
1124
+ return testMethod(this, "getAmount0Delta", params, getContractByCodeHash);
1125
+ },
1126
+ getAmount1DeltaEx: async (
1127
+ params: TestContractParamsWithoutMaps<
1128
+ PoolTypes.Fields,
1129
+ {
1130
+ sqrtRatioAX96: bigint;
1131
+ sqrtRatioBX96: bigint;
1132
+ liquidityDelta: bigint;
1133
+ roundUp: boolean;
1134
+ }
1135
+ >
1136
+ ): Promise<TestContractResultWithoutMaps<bigint>> => {
1137
+ return testMethod(
1138
+ this,
1139
+ "getAmount1DeltaEx",
1140
+ params,
1141
+ getContractByCodeHash
1142
+ );
1143
+ },
1144
+ getAmount1Delta: async (
1145
+ params: TestContractParamsWithoutMaps<
1146
+ PoolTypes.Fields,
1147
+ { sqrtRatioAX96: bigint; sqrtRatioBX96: bigint; liquidityDelta: bigint }
1148
+ >
1149
+ ): Promise<TestContractResultWithoutMaps<bigint>> => {
1150
+ return testMethod(this, "getAmount1Delta", params, getContractByCodeHash);
1151
+ },
1152
+ mulDiv: async (
1153
+ params: TestContractParamsWithoutMaps<
1154
+ PoolTypes.Fields,
1155
+ { a: bigint; b: bigint; denominator: bigint }
1156
+ >
1157
+ ): Promise<TestContractResultWithoutMaps<bigint>> => {
1158
+ return testMethod(this, "mulDiv", params, getContractByCodeHash);
1159
+ },
1160
+ mulDivRoundingUp: async (
1161
+ params: TestContractParamsWithoutMaps<
1162
+ PoolTypes.Fields,
1163
+ { a: bigint; b: bigint; denominator: bigint }
1164
+ >
1165
+ ): Promise<TestContractResultWithoutMaps<bigint>> => {
1166
+ return testMethod(
1167
+ this,
1168
+ "mulDivRoundingUp",
1169
+ params,
1170
+ getContractByCodeHash
1171
+ );
1172
+ },
1173
+ wordPath: async (
1174
+ params: TestContractParamsWithoutMaps<
1175
+ PoolTypes.Fields,
1176
+ { compressed: bigint }
1177
+ >
1178
+ ): Promise<TestContractResultWithoutMaps<HexString>> => {
1179
+ return testMethod(this, "wordPath", params, getContractByCodeHash);
1180
+ },
1181
+ getWord: async (
1182
+ params: TestContractParamsWithoutMaps<
1183
+ PoolTypes.Fields,
1184
+ { compressed: bigint }
1185
+ >
1186
+ ): Promise<TestContractResultWithoutMaps<HexString>> => {
1187
+ return testMethod(this, "getWord", params, getContractByCodeHash);
1188
+ },
1189
+ getWordOrTemplate: async (
1190
+ params: TestContractParamsWithoutMaps<
1191
+ PoolTypes.Fields,
1192
+ { compressed: bigint }
1193
+ >
1194
+ ): Promise<TestContractResultWithoutMaps<HexString>> => {
1195
+ return testMethod(
1196
+ this,
1197
+ "getWordOrTemplate",
1198
+ params,
1199
+ getContractByCodeHash
1200
+ );
1201
+ },
1202
+ flipTick: async (
1203
+ params: TestContractParamsWithoutMaps<PoolTypes.Fields, { tick: bigint }>
1204
+ ): Promise<TestContractResultWithoutMaps<null>> => {
1205
+ return testMethod(this, "flipTick", params, getContractByCodeHash);
1206
+ },
1207
+ nextInitializedTickWithinOneWord: async (
1208
+ params: TestContractParamsWithoutMaps<
1209
+ PoolTypes.Fields,
1210
+ { tick: bigint; zeroForOne: boolean }
1211
+ >
1212
+ ): Promise<TestContractResultWithoutMaps<[bigint, boolean]>> => {
1213
+ return testMethod(
1214
+ this,
1215
+ "nextInitializedTickWithinOneWord",
1216
+ params,
1217
+ getContractByCodeHash
1218
+ );
1219
+ },
1220
+ positionPath: async (
1221
+ params: TestContractParamsWithoutMaps<
1222
+ PoolTypes.Fields,
1223
+ { o: Address; tickLower: bigint; tickUpper: bigint }
1224
+ >
1225
+ ): Promise<TestContractResultWithoutMaps<HexString>> => {
1226
+ return testMethod(this, "positionPath", params, getContractByCodeHash);
1227
+ },
1228
+ positionContractId: async (
1229
+ params: TestContractParamsWithoutMaps<
1230
+ PoolTypes.Fields,
1231
+ { pool: HexString; o: Address; tickLower: bigint; tickUpper: bigint }
1232
+ >
1233
+ ): Promise<TestContractResultWithoutMaps<HexString>> => {
1234
+ return testMethod(
1235
+ this,
1236
+ "positionContractId",
1237
+ params,
1238
+ getContractByCodeHash
1239
+ );
1240
+ },
1241
+ configPath: async (
1242
+ params: TestContractParamsWithoutMaps<
1243
+ PoolTypes.Fields,
1244
+ { configIndex_: bigint }
1245
+ >
1246
+ ): Promise<TestContractResultWithoutMaps<HexString>> => {
1247
+ return testMethod(this, "configPath", params, getContractByCodeHash);
1248
+ },
1249
+ poolPath: async (
1250
+ params: TestContractParamsWithoutMaps<
1251
+ PoolTypes.Fields,
1252
+ { factory: HexString; tokens: HexString; configIndex_: bigint }
1253
+ >
1254
+ ): Promise<TestContractResultWithoutMaps<HexString>> => {
1255
+ return testMethod(this, "poolPath", params, getContractByCodeHash);
1256
+ },
1257
+ poolContractId: async (
1258
+ params: TestContractParamsWithoutMaps<
1259
+ PoolTypes.Fields,
1260
+ { factory: HexString; tokens: HexString; configIndex_: bigint }
1261
+ >
1262
+ ): Promise<TestContractResultWithoutMaps<HexString>> => {
1263
+ return testMethod(this, "poolContractId", params, getContractByCodeHash);
1264
+ },
1265
+ checkTicks: async (
1266
+ params: TestContractParamsWithoutMaps<
1267
+ PoolTypes.Fields,
1268
+ { tickLower: bigint; tickUpper: bigint }
1269
+ >
1270
+ ): Promise<TestContractResultWithoutMaps<null>> => {
1271
+ return testMethod(this, "checkTicks", params, getContractByCodeHash);
1272
+ },
1273
+ tickPath: async (
1274
+ params: TestContractParamsWithoutMaps<PoolTypes.Fields, { tick: bigint }>
1275
+ ): Promise<TestContractResultWithoutMaps<HexString>> => {
1276
+ return testMethod(this, "tickPath", params, getContractByCodeHash);
1277
+ },
1278
+ toTick: async (
1279
+ params: TestContractParamsWithoutMaps<PoolTypes.Fields, { tick: bigint }>
1280
+ ): Promise<TestContractResultWithoutMaps<HexString>> => {
1281
+ return testMethod(this, "toTick", params, getContractByCodeHash);
1282
+ },
1283
+ getTick: async (
1284
+ params: TestContractParamsWithoutMaps<PoolTypes.Fields, { tick: bigint }>
1285
+ ): Promise<TestContractResultWithoutMaps<[HexString, boolean]>> => {
1286
+ return testMethod(this, "getTick", params, getContractByCodeHash);
1287
+ },
1288
+ toPosition: async (
1289
+ params: TestContractParamsWithoutMaps<
1290
+ PoolTypes.Fields,
1291
+ { owner: Address; tickLower: bigint; tickUpper: bigint }
1292
+ >
1293
+ ): Promise<TestContractResultWithoutMaps<HexString>> => {
1294
+ return testMethod(this, "toPosition", params, getContractByCodeHash);
1295
+ },
1296
+ getPosition: async (
1297
+ params: TestContractParamsWithoutMaps<
1298
+ PoolTypes.Fields,
1299
+ { owner: Address; tickLower: bigint; tickUpper: bigint }
1300
+ >
1301
+ ): Promise<TestContractResultWithoutMaps<[HexString, boolean]>> => {
1302
+ return testMethod(this, "getPosition", params, getContractByCodeHash);
1303
+ },
1304
+ getFeeGrowthInside: async (
1305
+ params: TestContractParamsWithoutMaps<
1306
+ PoolTypes.Fields,
1307
+ { tickLower: HexString; tickUpper: HexString }
1308
+ >
1309
+ ): Promise<TestContractResultWithoutMaps<[bigint, bigint, bigint]>> => {
1310
+ return testMethod(
1311
+ this,
1312
+ "getFeeGrowthInside",
1313
+ params,
1314
+ getContractByCodeHash
1315
+ );
1316
+ },
1317
+ updatePosition: async (
1318
+ params: TestContractParamsWithoutMaps<
1319
+ PoolTypes.Fields,
1320
+ {
1321
+ position: HexString;
1322
+ owner: Address;
1323
+ tickLower: bigint;
1324
+ tickUpper: bigint;
1325
+ liquidityDelta: bigint;
1326
+ }
1327
+ >
1328
+ ): Promise<TestContractResultWithoutMaps<[bigint, bigint, bigint]>> => {
1329
+ return testMethod(this, "updatePosition", params, getContractByCodeHash);
1330
+ },
1331
+ modifyPosition: async (
1332
+ params: TestContractParamsWithoutMaps<
1333
+ PoolTypes.Fields,
1334
+ { position: HexString; params: types.ModifyPositionParams }
1335
+ >
1336
+ ): Promise<
1337
+ TestContractResultWithoutMaps<[bigint, bigint, [bigint, bigint, bigint]]>
1338
+ > => {
1339
+ return testMethod(this, "modifyPosition", params, getContractByCodeHash);
1340
+ },
1341
+ mint: async (
1342
+ params: TestContractParamsWithoutMaps<
1343
+ PoolTypes.Fields,
1344
+ {
1345
+ payer: Address;
1346
+ owner: Address;
1347
+ tickLower: bigint;
1348
+ tickUpper: bigint;
1349
+ amount: bigint;
1350
+ }
1351
+ >
1352
+ ): Promise<TestContractResultWithoutMaps<[bigint, bigint]>> => {
1353
+ return testMethod(this, "mint", params, getContractByCodeHash);
1354
+ },
1355
+ burn: async (
1356
+ params: TestContractParamsWithoutMaps<
1357
+ PoolTypes.Fields,
1358
+ {
1359
+ operator: Address;
1360
+ owner: Address;
1361
+ tickLower: bigint;
1362
+ tickUpper: bigint;
1363
+ amount: bigint;
1364
+ }
1365
+ >
1366
+ ): Promise<TestContractResultWithoutMaps<[bigint, bigint]>> => {
1367
+ return testMethod(this, "burn", params, getContractByCodeHash);
1368
+ },
1369
+ collect: async (
1370
+ params: TestContractParamsWithoutMaps<
1371
+ PoolTypes.Fields,
1372
+ {
1373
+ operator: Address;
1374
+ recipient: Address;
1375
+ owner: Address;
1376
+ tickLower: bigint;
1377
+ tickUpper: bigint;
1378
+ maxAmounts: [bigint, bigint, bigint];
1379
+ }
1380
+ >
1381
+ ): Promise<TestContractResultWithoutMaps<[bigint, bigint, bigint]>> => {
1382
+ return testMethod(this, "collect", params, getContractByCodeHash);
1383
+ },
1384
+ withdraw: async (
1385
+ params: TestContractParamsWithoutMaps<
1386
+ PoolTypes.Fields,
1387
+ { recipient: Address; amounts: [bigint, bigint, bigint] }
1388
+ >
1389
+ ): Promise<TestContractResultWithoutMaps<null>> => {
1390
+ return testMethod(this, "withdraw", params, getContractByCodeHash);
1391
+ },
1392
+ simulateSwap: async (
1393
+ params: TestContractParamsWithoutMaps<
1394
+ PoolTypes.Fields,
1395
+ {
1396
+ zeroForOne: boolean;
1397
+ amountSpecified: bigint;
1398
+ data: HexString;
1399
+ maxSteps: bigint;
1400
+ }
1401
+ >
1402
+ ): Promise<TestContractResultWithoutMaps<null>> => {
1403
+ return testMethod(this, "simulateSwap", params, getContractByCodeHash);
1404
+ },
1405
+ swap: async (
1406
+ params: TestContractParamsWithoutMaps<
1407
+ PoolTypes.Fields,
1408
+ {
1409
+ payer: Address;
1410
+ recipient: Address;
1411
+ token: HexString;
1412
+ zeroForOne: boolean;
1413
+ amountSpecified: bigint;
1414
+ sqrtPriceLimitX96: bigint;
1415
+ data: HexString;
1416
+ }
1417
+ >
1418
+ ): Promise<TestContractResultWithoutMaps<[bigint, bigint]>> => {
1419
+ return testMethod(this, "swap", params, getContractByCodeHash);
1420
+ },
1421
+ pop: async (
1422
+ params: TestContractParamsWithoutMaps<
1423
+ PoolTypes.Fields,
1424
+ { data: HexString; t: HexString; exactInput: boolean }
1425
+ >
1426
+ ): Promise<
1427
+ TestContractResultWithoutMaps<[boolean, bigint, HexString, HexString]>
1428
+ > => {
1429
+ return testMethod(this, "pop", params, getContractByCodeHash);
1430
+ },
1431
+ swapExactOut: async (
1432
+ params: TestContractParamsWithoutMaps<
1433
+ PoolTypes.Fields,
1434
+ { p: types.SwapParams; refRewards: bigint }
1435
+ >
1436
+ ): Promise<TestContractResultWithoutMaps<null>> => {
1437
+ return testMethod(this, "swapExactOut", params, getContractByCodeHash);
1438
+ },
1439
+ swapExactIn: async (
1440
+ params: TestContractParamsWithoutMaps<
1441
+ PoolTypes.Fields,
1442
+ { p: types.SwapParams; refRewards: bigint }
1443
+ >
1444
+ ): Promise<TestContractResultWithoutMaps<null>> => {
1445
+ return testMethod(this, "swapExactIn", params, getContractByCodeHash);
1446
+ },
1447
+ getSqrtPricesX96: async (
1448
+ params: TestContractParamsWithoutMaps<
1449
+ PoolTypes.Fields,
1450
+ { tickLower: bigint; tickUpper: bigint }
1451
+ >
1452
+ ): Promise<TestContractResultWithoutMaps<[bigint, bigint, bigint]>> => {
1453
+ return testMethod(
1454
+ this,
1455
+ "getSqrtPricesX96",
1456
+ params,
1457
+ getContractByCodeHash
1458
+ );
1459
+ },
1460
+ updateReward: async (
1461
+ params: TestContractParamsWithoutMaps<
1462
+ PoolTypes.Fields,
1463
+ { index: bigint; blockTime: bigint }
1464
+ >
1465
+ ): Promise<TestContractResultWithoutMaps<null>> => {
1466
+ return testMethod(this, "updateReward", params, getContractByCodeHash);
1467
+ },
1468
+ updateRewards: async (
1469
+ params: TestContractParamsWithoutMaps<
1470
+ PoolTypes.Fields,
1471
+ { blockTime: bigint }
1472
+ >
1473
+ ): Promise<TestContractResultWithoutMaps<null>> => {
1474
+ return testMethod(this, "updateRewards", params, getContractByCodeHash);
1475
+ },
1476
+ extendRewards: async (
1477
+ params: TestContractParamsWithoutMaps<
1478
+ PoolTypes.Fields,
1479
+ { payer: Address; index: bigint; amount: bigint }
1480
+ >
1481
+ ): Promise<TestContractResultWithoutMaps<null>> => {
1482
+ return testMethod(this, "extendRewards", params, getContractByCodeHash);
1483
+ },
1484
+ setRewardParams: async (
1485
+ params: TestContractParamsWithoutMaps<
1486
+ PoolTypes.Fields,
1487
+ {
1488
+ payer: Address;
1489
+ index: bigint;
1490
+ openTime: bigint;
1491
+ endTime: bigint;
1492
+ amount: bigint;
1493
+ }
1494
+ >
1495
+ ): Promise<TestContractResultWithoutMaps<null>> => {
1496
+ return testMethod(this, "setRewardParams", params, getContractByCodeHash);
1497
+ },
1498
+ collectProtocolFees: async (
1499
+ params: TestContractParamsWithoutMaps<
1500
+ PoolTypes.Fields,
1501
+ { recipient: Address }
1502
+ >
1503
+ ): Promise<TestContractResultWithoutMaps<null>> => {
1504
+ return testMethod(
1505
+ this,
1506
+ "collectProtocolFees",
1507
+ params,
1508
+ getContractByCodeHash
1509
+ );
1510
+ },
1511
+ positionInfo: async (
1512
+ params: TestContractParamsWithoutMaps<
1513
+ PoolTypes.Fields,
1514
+ {
1515
+ owner: Address;
1516
+ tickLower: bigint;
1517
+ tickUpper: bigint;
1518
+ acc: bigint;
1519
+ iacc0: bigint;
1520
+ iacc1: bigint;
1521
+ t0: bigint;
1522
+ acct0: bigint;
1523
+ }
1524
+ >
1525
+ ): Promise<TestContractResultWithoutMaps<types.PositionInfo>> => {
1526
+ return testMethod(this, "positionInfo", params, getContractByCodeHash);
1527
+ },
1528
+ getTokenUri: async (
1529
+ params: Omit<
1530
+ TestContractParamsWithoutMaps<PoolTypes.Fields, never>,
1531
+ "args"
1532
+ >
1533
+ ): Promise<TestContractResultWithoutMaps<HexString>> => {
1534
+ return testMethod(this, "getTokenUri", params, getContractByCodeHash);
1535
+ },
1536
+ };
1537
+
1538
+ stateForTest(initFields: PoolTypes.Fields, asset?: Asset, address?: string) {
1539
+ return this.stateForTest_(initFields, asset, address, undefined);
1540
+ }
1541
+ }
1542
+
1543
+ // Use this object to test and deploy the contract
1544
+ export const Pool = new Factory(
1545
+ Contract.fromJson(
1546
+ PoolContractJson,
1547
+ "",
1548
+ "cdb37fb2772ba9c976a4dc34db15994ecaeef82d8690b9a94c600a81c67f98c4",
1549
+ types.AllStructs
1550
+ )
1551
+ );
1552
+ registerContract(Pool);
1553
+
1554
+ // Use this class to interact with the blockchain
1555
+ export class PoolInstance extends ContractInstance {
1556
+ constructor(address: Address) {
1557
+ super(address);
1558
+ }
1559
+
1560
+ async fetchState(): Promise<PoolTypes.State> {
1561
+ return fetchContractState(Pool, this);
1562
+ }
1563
+
1564
+ async getContractEventsCurrentCount(): Promise<number> {
1565
+ return getContractEventsCurrentCount(this.address);
1566
+ }
1567
+
1568
+ subscribeInitializeEvent(
1569
+ options: EventSubscribeOptions<PoolTypes.InitializeEvent>,
1570
+ fromCount?: number
1571
+ ): EventSubscription {
1572
+ return subscribeContractEvent(
1573
+ Pool.contract,
1574
+ this,
1575
+ options,
1576
+ "Initialize",
1577
+ fromCount
1578
+ );
1579
+ }
1580
+
1581
+ subscribeSwapStartEvent(
1582
+ options: EventSubscribeOptions<PoolTypes.SwapStartEvent>,
1583
+ fromCount?: number
1584
+ ): EventSubscription {
1585
+ return subscribeContractEvent(
1586
+ Pool.contract,
1587
+ this,
1588
+ options,
1589
+ "SwapStart",
1590
+ fromCount
1591
+ );
1592
+ }
1593
+
1594
+ subscribeSwapStepEvent(
1595
+ options: EventSubscribeOptions<PoolTypes.SwapStepEvent>,
1596
+ fromCount?: number
1597
+ ): EventSubscription {
1598
+ return subscribeContractEvent(
1599
+ Pool.contract,
1600
+ this,
1601
+ options,
1602
+ "SwapStep",
1603
+ fromCount
1604
+ );
1605
+ }
1606
+
1607
+ subscribeSwapEvent(
1608
+ options: EventSubscribeOptions<PoolTypes.SwapEvent>,
1609
+ fromCount?: number
1610
+ ): EventSubscription {
1611
+ return subscribeContractEvent(
1612
+ Pool.contract,
1613
+ this,
1614
+ options,
1615
+ "Swap",
1616
+ fromCount
1617
+ );
1618
+ }
1619
+
1620
+ subscribeMintEvent(
1621
+ options: EventSubscribeOptions<PoolTypes.MintEvent>,
1622
+ fromCount?: number
1623
+ ): EventSubscription {
1624
+ return subscribeContractEvent(
1625
+ Pool.contract,
1626
+ this,
1627
+ options,
1628
+ "Mint",
1629
+ fromCount
1630
+ );
1631
+ }
1632
+
1633
+ subscribeBurnEvent(
1634
+ options: EventSubscribeOptions<PoolTypes.BurnEvent>,
1635
+ fromCount?: number
1636
+ ): EventSubscription {
1637
+ return subscribeContractEvent(
1638
+ Pool.contract,
1639
+ this,
1640
+ options,
1641
+ "Burn",
1642
+ fromCount
1643
+ );
1644
+ }
1645
+
1646
+ subscribeCollectEvent(
1647
+ options: EventSubscribeOptions<PoolTypes.CollectEvent>,
1648
+ fromCount?: number
1649
+ ): EventSubscription {
1650
+ return subscribeContractEvent(
1651
+ Pool.contract,
1652
+ this,
1653
+ options,
1654
+ "Collect",
1655
+ fromCount
1656
+ );
1657
+ }
1658
+
1659
+ subscribeFeesEvent(
1660
+ options: EventSubscribeOptions<PoolTypes.FeesEvent>,
1661
+ fromCount?: number
1662
+ ): EventSubscription {
1663
+ return subscribeContractEvent(
1664
+ Pool.contract,
1665
+ this,
1666
+ options,
1667
+ "Fees",
1668
+ fromCount
1669
+ );
1670
+ }
1671
+
1672
+ subscribeCollectProtocolEvent(
1673
+ options: EventSubscribeOptions<PoolTypes.CollectProtocolEvent>,
1674
+ fromCount?: number
1675
+ ): EventSubscription {
1676
+ return subscribeContractEvent(
1677
+ Pool.contract,
1678
+ this,
1679
+ options,
1680
+ "CollectProtocol",
1681
+ fromCount
1682
+ );
1683
+ }
1684
+
1685
+ subscribeAllEvents(
1686
+ options: EventSubscribeOptions<
1687
+ | PoolTypes.InitializeEvent
1688
+ | PoolTypes.SwapStartEvent
1689
+ | PoolTypes.SwapStepEvent
1690
+ | PoolTypes.SwapEvent
1691
+ | PoolTypes.MintEvent
1692
+ | PoolTypes.BurnEvent
1693
+ | PoolTypes.CollectEvent
1694
+ | PoolTypes.FeesEvent
1695
+ | PoolTypes.CollectProtocolEvent
1696
+ >,
1697
+ fromCount?: number
1698
+ ): EventSubscription {
1699
+ return subscribeContractEvents(Pool.contract, this, options, fromCount);
1700
+ }
1701
+
1702
+ view = {
1703
+ getCollectionUri: async (
1704
+ params?: PoolTypes.CallMethodParams<"getCollectionUri">
1705
+ ): Promise<PoolTypes.CallMethodResult<"getCollectionUri">> => {
1706
+ return callMethod(
1707
+ Pool,
1708
+ this,
1709
+ "getCollectionUri",
1710
+ params === undefined ? {} : params,
1711
+ getContractByCodeHash
1712
+ );
1713
+ },
1714
+ totalSupply: async (
1715
+ params?: PoolTypes.CallMethodParams<"totalSupply">
1716
+ ): Promise<PoolTypes.CallMethodResult<"totalSupply">> => {
1717
+ return callMethod(
1718
+ Pool,
1719
+ this,
1720
+ "totalSupply",
1721
+ params === undefined ? {} : params,
1722
+ getContractByCodeHash
1723
+ );
1724
+ },
1725
+ nftByIndex: async (
1726
+ params: PoolTypes.CallMethodParams<"nftByIndex">
1727
+ ): Promise<PoolTypes.CallMethodResult<"nftByIndex">> => {
1728
+ return callMethod(
1729
+ Pool,
1730
+ this,
1731
+ "nftByIndex",
1732
+ params,
1733
+ getContractByCodeHash
1734
+ );
1735
+ },
1736
+ validateNFT: async (
1737
+ params: PoolTypes.CallMethodParams<"validateNFT">
1738
+ ): Promise<PoolTypes.CallMethodResult<"validateNFT">> => {
1739
+ return callMethod(
1740
+ Pool,
1741
+ this,
1742
+ "validateNFT",
1743
+ params,
1744
+ getContractByCodeHash
1745
+ );
1746
+ },
1747
+ getSqrtRatioAtTick: async (
1748
+ params: PoolTypes.CallMethodParams<"getSqrtRatioAtTick">
1749
+ ): Promise<PoolTypes.CallMethodResult<"getSqrtRatioAtTick">> => {
1750
+ return callMethod(
1751
+ Pool,
1752
+ this,
1753
+ "getSqrtRatioAtTick",
1754
+ params,
1755
+ getContractByCodeHash
1756
+ );
1757
+ },
1758
+ getTickAtSqrtRatio: async (
1759
+ params: PoolTypes.CallMethodParams<"getTickAtSqrtRatio">
1760
+ ): Promise<PoolTypes.CallMethodResult<"getTickAtSqrtRatio">> => {
1761
+ return callMethod(
1762
+ Pool,
1763
+ this,
1764
+ "getTickAtSqrtRatio",
1765
+ params,
1766
+ getContractByCodeHash
1767
+ );
1768
+ },
1769
+ computeSwapStep: async (
1770
+ params: PoolTypes.CallMethodParams<"computeSwapStep">
1771
+ ): Promise<PoolTypes.CallMethodResult<"computeSwapStep">> => {
1772
+ return callMethod(
1773
+ Pool,
1774
+ this,
1775
+ "computeSwapStep",
1776
+ params,
1777
+ getContractByCodeHash
1778
+ );
1779
+ },
1780
+ divRoundingUp: async (
1781
+ params: PoolTypes.CallMethodParams<"divRoundingUp">
1782
+ ): Promise<PoolTypes.CallMethodResult<"divRoundingUp">> => {
1783
+ return callMethod(
1784
+ Pool,
1785
+ this,
1786
+ "divRoundingUp",
1787
+ params,
1788
+ getContractByCodeHash
1789
+ );
1790
+ },
1791
+ getNextSqrtPriceFromAmount0RoundingUp: async (
1792
+ params: PoolTypes.CallMethodParams<"getNextSqrtPriceFromAmount0RoundingUp">
1793
+ ): Promise<
1794
+ PoolTypes.CallMethodResult<"getNextSqrtPriceFromAmount0RoundingUp">
1795
+ > => {
1796
+ return callMethod(
1797
+ Pool,
1798
+ this,
1799
+ "getNextSqrtPriceFromAmount0RoundingUp",
1800
+ params,
1801
+ getContractByCodeHash
1802
+ );
1803
+ },
1804
+ getNextSqrtPriceFromAmount1RoundingDown: async (
1805
+ params: PoolTypes.CallMethodParams<"getNextSqrtPriceFromAmount1RoundingDown">
1806
+ ): Promise<
1807
+ PoolTypes.CallMethodResult<"getNextSqrtPriceFromAmount1RoundingDown">
1808
+ > => {
1809
+ return callMethod(
1810
+ Pool,
1811
+ this,
1812
+ "getNextSqrtPriceFromAmount1RoundingDown",
1813
+ params,
1814
+ getContractByCodeHash
1815
+ );
1816
+ },
1817
+ getNextSqrtPriceFromInput: async (
1818
+ params: PoolTypes.CallMethodParams<"getNextSqrtPriceFromInput">
1819
+ ): Promise<PoolTypes.CallMethodResult<"getNextSqrtPriceFromInput">> => {
1820
+ return callMethod(
1821
+ Pool,
1822
+ this,
1823
+ "getNextSqrtPriceFromInput",
1824
+ params,
1825
+ getContractByCodeHash
1826
+ );
1827
+ },
1828
+ getNextSqrtPriceFromOutput: async (
1829
+ params: PoolTypes.CallMethodParams<"getNextSqrtPriceFromOutput">
1830
+ ): Promise<PoolTypes.CallMethodResult<"getNextSqrtPriceFromOutput">> => {
1831
+ return callMethod(
1832
+ Pool,
1833
+ this,
1834
+ "getNextSqrtPriceFromOutput",
1835
+ params,
1836
+ getContractByCodeHash
1837
+ );
1838
+ },
1839
+ getAmount0DeltaEx: async (
1840
+ params: PoolTypes.CallMethodParams<"getAmount0DeltaEx">
1841
+ ): Promise<PoolTypes.CallMethodResult<"getAmount0DeltaEx">> => {
1842
+ return callMethod(
1843
+ Pool,
1844
+ this,
1845
+ "getAmount0DeltaEx",
1846
+ params,
1847
+ getContractByCodeHash
1848
+ );
1849
+ },
1850
+ getAmount0Delta: async (
1851
+ params: PoolTypes.CallMethodParams<"getAmount0Delta">
1852
+ ): Promise<PoolTypes.CallMethodResult<"getAmount0Delta">> => {
1853
+ return callMethod(
1854
+ Pool,
1855
+ this,
1856
+ "getAmount0Delta",
1857
+ params,
1858
+ getContractByCodeHash
1859
+ );
1860
+ },
1861
+ getAmount1DeltaEx: async (
1862
+ params: PoolTypes.CallMethodParams<"getAmount1DeltaEx">
1863
+ ): Promise<PoolTypes.CallMethodResult<"getAmount1DeltaEx">> => {
1864
+ return callMethod(
1865
+ Pool,
1866
+ this,
1867
+ "getAmount1DeltaEx",
1868
+ params,
1869
+ getContractByCodeHash
1870
+ );
1871
+ },
1872
+ getAmount1Delta: async (
1873
+ params: PoolTypes.CallMethodParams<"getAmount1Delta">
1874
+ ): Promise<PoolTypes.CallMethodResult<"getAmount1Delta">> => {
1875
+ return callMethod(
1876
+ Pool,
1877
+ this,
1878
+ "getAmount1Delta",
1879
+ params,
1880
+ getContractByCodeHash
1881
+ );
1882
+ },
1883
+ mulDiv: async (
1884
+ params: PoolTypes.CallMethodParams<"mulDiv">
1885
+ ): Promise<PoolTypes.CallMethodResult<"mulDiv">> => {
1886
+ return callMethod(Pool, this, "mulDiv", params, getContractByCodeHash);
1887
+ },
1888
+ mulDivRoundingUp: async (
1889
+ params: PoolTypes.CallMethodParams<"mulDivRoundingUp">
1890
+ ): Promise<PoolTypes.CallMethodResult<"mulDivRoundingUp">> => {
1891
+ return callMethod(
1892
+ Pool,
1893
+ this,
1894
+ "mulDivRoundingUp",
1895
+ params,
1896
+ getContractByCodeHash
1897
+ );
1898
+ },
1899
+ wordPath: async (
1900
+ params: PoolTypes.CallMethodParams<"wordPath">
1901
+ ): Promise<PoolTypes.CallMethodResult<"wordPath">> => {
1902
+ return callMethod(Pool, this, "wordPath", params, getContractByCodeHash);
1903
+ },
1904
+ getWord: async (
1905
+ params: PoolTypes.CallMethodParams<"getWord">
1906
+ ): Promise<PoolTypes.CallMethodResult<"getWord">> => {
1907
+ return callMethod(Pool, this, "getWord", params, getContractByCodeHash);
1908
+ },
1909
+ getWordOrTemplate: async (
1910
+ params: PoolTypes.CallMethodParams<"getWordOrTemplate">
1911
+ ): Promise<PoolTypes.CallMethodResult<"getWordOrTemplate">> => {
1912
+ return callMethod(
1913
+ Pool,
1914
+ this,
1915
+ "getWordOrTemplate",
1916
+ params,
1917
+ getContractByCodeHash
1918
+ );
1919
+ },
1920
+ flipTick: async (
1921
+ params: PoolTypes.CallMethodParams<"flipTick">
1922
+ ): Promise<PoolTypes.CallMethodResult<"flipTick">> => {
1923
+ return callMethod(Pool, this, "flipTick", params, getContractByCodeHash);
1924
+ },
1925
+ nextInitializedTickWithinOneWord: async (
1926
+ params: PoolTypes.CallMethodParams<"nextInitializedTickWithinOneWord">
1927
+ ): Promise<
1928
+ PoolTypes.CallMethodResult<"nextInitializedTickWithinOneWord">
1929
+ > => {
1930
+ return callMethod(
1931
+ Pool,
1932
+ this,
1933
+ "nextInitializedTickWithinOneWord",
1934
+ params,
1935
+ getContractByCodeHash
1936
+ );
1937
+ },
1938
+ positionPath: async (
1939
+ params: PoolTypes.CallMethodParams<"positionPath">
1940
+ ): Promise<PoolTypes.CallMethodResult<"positionPath">> => {
1941
+ return callMethod(
1942
+ Pool,
1943
+ this,
1944
+ "positionPath",
1945
+ params,
1946
+ getContractByCodeHash
1947
+ );
1948
+ },
1949
+ positionContractId: async (
1950
+ params: PoolTypes.CallMethodParams<"positionContractId">
1951
+ ): Promise<PoolTypes.CallMethodResult<"positionContractId">> => {
1952
+ return callMethod(
1953
+ Pool,
1954
+ this,
1955
+ "positionContractId",
1956
+ params,
1957
+ getContractByCodeHash
1958
+ );
1959
+ },
1960
+ configPath: async (
1961
+ params: PoolTypes.CallMethodParams<"configPath">
1962
+ ): Promise<PoolTypes.CallMethodResult<"configPath">> => {
1963
+ return callMethod(
1964
+ Pool,
1965
+ this,
1966
+ "configPath",
1967
+ params,
1968
+ getContractByCodeHash
1969
+ );
1970
+ },
1971
+ poolPath: async (
1972
+ params: PoolTypes.CallMethodParams<"poolPath">
1973
+ ): Promise<PoolTypes.CallMethodResult<"poolPath">> => {
1974
+ return callMethod(Pool, this, "poolPath", params, getContractByCodeHash);
1975
+ },
1976
+ poolContractId: async (
1977
+ params: PoolTypes.CallMethodParams<"poolContractId">
1978
+ ): Promise<PoolTypes.CallMethodResult<"poolContractId">> => {
1979
+ return callMethod(
1980
+ Pool,
1981
+ this,
1982
+ "poolContractId",
1983
+ params,
1984
+ getContractByCodeHash
1985
+ );
1986
+ },
1987
+ checkTicks: async (
1988
+ params: PoolTypes.CallMethodParams<"checkTicks">
1989
+ ): Promise<PoolTypes.CallMethodResult<"checkTicks">> => {
1990
+ return callMethod(
1991
+ Pool,
1992
+ this,
1993
+ "checkTicks",
1994
+ params,
1995
+ getContractByCodeHash
1996
+ );
1997
+ },
1998
+ tickPath: async (
1999
+ params: PoolTypes.CallMethodParams<"tickPath">
2000
+ ): Promise<PoolTypes.CallMethodResult<"tickPath">> => {
2001
+ return callMethod(Pool, this, "tickPath", params, getContractByCodeHash);
2002
+ },
2003
+ toTick: async (
2004
+ params: PoolTypes.CallMethodParams<"toTick">
2005
+ ): Promise<PoolTypes.CallMethodResult<"toTick">> => {
2006
+ return callMethod(Pool, this, "toTick", params, getContractByCodeHash);
2007
+ },
2008
+ getTick: async (
2009
+ params: PoolTypes.CallMethodParams<"getTick">
2010
+ ): Promise<PoolTypes.CallMethodResult<"getTick">> => {
2011
+ return callMethod(Pool, this, "getTick", params, getContractByCodeHash);
2012
+ },
2013
+ toPosition: async (
2014
+ params: PoolTypes.CallMethodParams<"toPosition">
2015
+ ): Promise<PoolTypes.CallMethodResult<"toPosition">> => {
2016
+ return callMethod(
2017
+ Pool,
2018
+ this,
2019
+ "toPosition",
2020
+ params,
2021
+ getContractByCodeHash
2022
+ );
2023
+ },
2024
+ getPosition: async (
2025
+ params: PoolTypes.CallMethodParams<"getPosition">
2026
+ ): Promise<PoolTypes.CallMethodResult<"getPosition">> => {
2027
+ return callMethod(
2028
+ Pool,
2029
+ this,
2030
+ "getPosition",
2031
+ params,
2032
+ getContractByCodeHash
2033
+ );
2034
+ },
2035
+ getFeeGrowthInside: async (
2036
+ params: PoolTypes.CallMethodParams<"getFeeGrowthInside">
2037
+ ): Promise<PoolTypes.CallMethodResult<"getFeeGrowthInside">> => {
2038
+ return callMethod(
2039
+ Pool,
2040
+ this,
2041
+ "getFeeGrowthInside",
2042
+ params,
2043
+ getContractByCodeHash
2044
+ );
2045
+ },
2046
+ updatePosition: async (
2047
+ params: PoolTypes.CallMethodParams<"updatePosition">
2048
+ ): Promise<PoolTypes.CallMethodResult<"updatePosition">> => {
2049
+ return callMethod(
2050
+ Pool,
2051
+ this,
2052
+ "updatePosition",
2053
+ params,
2054
+ getContractByCodeHash
2055
+ );
2056
+ },
2057
+ modifyPosition: async (
2058
+ params: PoolTypes.CallMethodParams<"modifyPosition">
2059
+ ): Promise<PoolTypes.CallMethodResult<"modifyPosition">> => {
2060
+ return callMethod(
2061
+ Pool,
2062
+ this,
2063
+ "modifyPosition",
2064
+ params,
2065
+ getContractByCodeHash
2066
+ );
2067
+ },
2068
+ mint: async (
2069
+ params: PoolTypes.CallMethodParams<"mint">
2070
+ ): Promise<PoolTypes.CallMethodResult<"mint">> => {
2071
+ return callMethod(Pool, this, "mint", params, getContractByCodeHash);
2072
+ },
2073
+ burn: async (
2074
+ params: PoolTypes.CallMethodParams<"burn">
2075
+ ): Promise<PoolTypes.CallMethodResult<"burn">> => {
2076
+ return callMethod(Pool, this, "burn", params, getContractByCodeHash);
2077
+ },
2078
+ collect: async (
2079
+ params: PoolTypes.CallMethodParams<"collect">
2080
+ ): Promise<PoolTypes.CallMethodResult<"collect">> => {
2081
+ return callMethod(Pool, this, "collect", params, getContractByCodeHash);
2082
+ },
2083
+ withdraw: async (
2084
+ params: PoolTypes.CallMethodParams<"withdraw">
2085
+ ): Promise<PoolTypes.CallMethodResult<"withdraw">> => {
2086
+ return callMethod(Pool, this, "withdraw", params, getContractByCodeHash);
2087
+ },
2088
+ simulateSwap: async (
2089
+ params: PoolTypes.CallMethodParams<"simulateSwap">
2090
+ ): Promise<PoolTypes.CallMethodResult<"simulateSwap">> => {
2091
+ return callMethod(
2092
+ Pool,
2093
+ this,
2094
+ "simulateSwap",
2095
+ params,
2096
+ getContractByCodeHash
2097
+ );
2098
+ },
2099
+ swap: async (
2100
+ params: PoolTypes.CallMethodParams<"swap">
2101
+ ): Promise<PoolTypes.CallMethodResult<"swap">> => {
2102
+ return callMethod(Pool, this, "swap", params, getContractByCodeHash);
2103
+ },
2104
+ pop: async (
2105
+ params: PoolTypes.CallMethodParams<"pop">
2106
+ ): Promise<PoolTypes.CallMethodResult<"pop">> => {
2107
+ return callMethod(Pool, this, "pop", params, getContractByCodeHash);
2108
+ },
2109
+ swapExactOut: async (
2110
+ params: PoolTypes.CallMethodParams<"swapExactOut">
2111
+ ): Promise<PoolTypes.CallMethodResult<"swapExactOut">> => {
2112
+ return callMethod(
2113
+ Pool,
2114
+ this,
2115
+ "swapExactOut",
2116
+ params,
2117
+ getContractByCodeHash
2118
+ );
2119
+ },
2120
+ swapExactIn: async (
2121
+ params: PoolTypes.CallMethodParams<"swapExactIn">
2122
+ ): Promise<PoolTypes.CallMethodResult<"swapExactIn">> => {
2123
+ return callMethod(
2124
+ Pool,
2125
+ this,
2126
+ "swapExactIn",
2127
+ params,
2128
+ getContractByCodeHash
2129
+ );
2130
+ },
2131
+ getSqrtPricesX96: async (
2132
+ params: PoolTypes.CallMethodParams<"getSqrtPricesX96">
2133
+ ): Promise<PoolTypes.CallMethodResult<"getSqrtPricesX96">> => {
2134
+ return callMethod(
2135
+ Pool,
2136
+ this,
2137
+ "getSqrtPricesX96",
2138
+ params,
2139
+ getContractByCodeHash
2140
+ );
2141
+ },
2142
+ updateReward: async (
2143
+ params: PoolTypes.CallMethodParams<"updateReward">
2144
+ ): Promise<PoolTypes.CallMethodResult<"updateReward">> => {
2145
+ return callMethod(
2146
+ Pool,
2147
+ this,
2148
+ "updateReward",
2149
+ params,
2150
+ getContractByCodeHash
2151
+ );
2152
+ },
2153
+ updateRewards: async (
2154
+ params: PoolTypes.CallMethodParams<"updateRewards">
2155
+ ): Promise<PoolTypes.CallMethodResult<"updateRewards">> => {
2156
+ return callMethod(
2157
+ Pool,
2158
+ this,
2159
+ "updateRewards",
2160
+ params,
2161
+ getContractByCodeHash
2162
+ );
2163
+ },
2164
+ extendRewards: async (
2165
+ params: PoolTypes.CallMethodParams<"extendRewards">
2166
+ ): Promise<PoolTypes.CallMethodResult<"extendRewards">> => {
2167
+ return callMethod(
2168
+ Pool,
2169
+ this,
2170
+ "extendRewards",
2171
+ params,
2172
+ getContractByCodeHash
2173
+ );
2174
+ },
2175
+ setRewardParams: async (
2176
+ params: PoolTypes.CallMethodParams<"setRewardParams">
2177
+ ): Promise<PoolTypes.CallMethodResult<"setRewardParams">> => {
2178
+ return callMethod(
2179
+ Pool,
2180
+ this,
2181
+ "setRewardParams",
2182
+ params,
2183
+ getContractByCodeHash
2184
+ );
2185
+ },
2186
+ collectProtocolFees: async (
2187
+ params: PoolTypes.CallMethodParams<"collectProtocolFees">
2188
+ ): Promise<PoolTypes.CallMethodResult<"collectProtocolFees">> => {
2189
+ return callMethod(
2190
+ Pool,
2191
+ this,
2192
+ "collectProtocolFees",
2193
+ params,
2194
+ getContractByCodeHash
2195
+ );
2196
+ },
2197
+ positionInfo: async (
2198
+ params: PoolTypes.CallMethodParams<"positionInfo">
2199
+ ): Promise<PoolTypes.CallMethodResult<"positionInfo">> => {
2200
+ return callMethod(
2201
+ Pool,
2202
+ this,
2203
+ "positionInfo",
2204
+ params,
2205
+ getContractByCodeHash
2206
+ );
2207
+ },
2208
+ getTokenUri: async (
2209
+ params?: PoolTypes.CallMethodParams<"getTokenUri">
2210
+ ): Promise<PoolTypes.CallMethodResult<"getTokenUri">> => {
2211
+ return callMethod(
2212
+ Pool,
2213
+ this,
2214
+ "getTokenUri",
2215
+ params === undefined ? {} : params,
2216
+ getContractByCodeHash
2217
+ );
2218
+ },
2219
+ };
2220
+
2221
+ transact = {
2222
+ getCollectionUri: async (
2223
+ params: PoolTypes.SignExecuteMethodParams<"getCollectionUri">
2224
+ ): Promise<PoolTypes.SignExecuteMethodResult<"getCollectionUri">> => {
2225
+ return signExecuteMethod(Pool, this, "getCollectionUri", params);
2226
+ },
2227
+ totalSupply: async (
2228
+ params: PoolTypes.SignExecuteMethodParams<"totalSupply">
2229
+ ): Promise<PoolTypes.SignExecuteMethodResult<"totalSupply">> => {
2230
+ return signExecuteMethod(Pool, this, "totalSupply", params);
2231
+ },
2232
+ nftByIndex: async (
2233
+ params: PoolTypes.SignExecuteMethodParams<"nftByIndex">
2234
+ ): Promise<PoolTypes.SignExecuteMethodResult<"nftByIndex">> => {
2235
+ return signExecuteMethod(Pool, this, "nftByIndex", params);
2236
+ },
2237
+ validateNFT: async (
2238
+ params: PoolTypes.SignExecuteMethodParams<"validateNFT">
2239
+ ): Promise<PoolTypes.SignExecuteMethodResult<"validateNFT">> => {
2240
+ return signExecuteMethod(Pool, this, "validateNFT", params);
2241
+ },
2242
+ getSqrtRatioAtTick: async (
2243
+ params: PoolTypes.SignExecuteMethodParams<"getSqrtRatioAtTick">
2244
+ ): Promise<PoolTypes.SignExecuteMethodResult<"getSqrtRatioAtTick">> => {
2245
+ return signExecuteMethod(Pool, this, "getSqrtRatioAtTick", params);
2246
+ },
2247
+ getTickAtSqrtRatio: async (
2248
+ params: PoolTypes.SignExecuteMethodParams<"getTickAtSqrtRatio">
2249
+ ): Promise<PoolTypes.SignExecuteMethodResult<"getTickAtSqrtRatio">> => {
2250
+ return signExecuteMethod(Pool, this, "getTickAtSqrtRatio", params);
2251
+ },
2252
+ computeSwapStep: async (
2253
+ params: PoolTypes.SignExecuteMethodParams<"computeSwapStep">
2254
+ ): Promise<PoolTypes.SignExecuteMethodResult<"computeSwapStep">> => {
2255
+ return signExecuteMethod(Pool, this, "computeSwapStep", params);
2256
+ },
2257
+ divRoundingUp: async (
2258
+ params: PoolTypes.SignExecuteMethodParams<"divRoundingUp">
2259
+ ): Promise<PoolTypes.SignExecuteMethodResult<"divRoundingUp">> => {
2260
+ return signExecuteMethod(Pool, this, "divRoundingUp", params);
2261
+ },
2262
+ getNextSqrtPriceFromAmount0RoundingUp: async (
2263
+ params: PoolTypes.SignExecuteMethodParams<"getNextSqrtPriceFromAmount0RoundingUp">
2264
+ ): Promise<
2265
+ PoolTypes.SignExecuteMethodResult<"getNextSqrtPriceFromAmount0RoundingUp">
2266
+ > => {
2267
+ return signExecuteMethod(
2268
+ Pool,
2269
+ this,
2270
+ "getNextSqrtPriceFromAmount0RoundingUp",
2271
+ params
2272
+ );
2273
+ },
2274
+ getNextSqrtPriceFromAmount1RoundingDown: async (
2275
+ params: PoolTypes.SignExecuteMethodParams<"getNextSqrtPriceFromAmount1RoundingDown">
2276
+ ): Promise<
2277
+ PoolTypes.SignExecuteMethodResult<"getNextSqrtPriceFromAmount1RoundingDown">
2278
+ > => {
2279
+ return signExecuteMethod(
2280
+ Pool,
2281
+ this,
2282
+ "getNextSqrtPriceFromAmount1RoundingDown",
2283
+ params
2284
+ );
2285
+ },
2286
+ getNextSqrtPriceFromInput: async (
2287
+ params: PoolTypes.SignExecuteMethodParams<"getNextSqrtPriceFromInput">
2288
+ ): Promise<
2289
+ PoolTypes.SignExecuteMethodResult<"getNextSqrtPriceFromInput">
2290
+ > => {
2291
+ return signExecuteMethod(Pool, this, "getNextSqrtPriceFromInput", params);
2292
+ },
2293
+ getNextSqrtPriceFromOutput: async (
2294
+ params: PoolTypes.SignExecuteMethodParams<"getNextSqrtPriceFromOutput">
2295
+ ): Promise<
2296
+ PoolTypes.SignExecuteMethodResult<"getNextSqrtPriceFromOutput">
2297
+ > => {
2298
+ return signExecuteMethod(
2299
+ Pool,
2300
+ this,
2301
+ "getNextSqrtPriceFromOutput",
2302
+ params
2303
+ );
2304
+ },
2305
+ getAmount0DeltaEx: async (
2306
+ params: PoolTypes.SignExecuteMethodParams<"getAmount0DeltaEx">
2307
+ ): Promise<PoolTypes.SignExecuteMethodResult<"getAmount0DeltaEx">> => {
2308
+ return signExecuteMethod(Pool, this, "getAmount0DeltaEx", params);
2309
+ },
2310
+ getAmount0Delta: async (
2311
+ params: PoolTypes.SignExecuteMethodParams<"getAmount0Delta">
2312
+ ): Promise<PoolTypes.SignExecuteMethodResult<"getAmount0Delta">> => {
2313
+ return signExecuteMethod(Pool, this, "getAmount0Delta", params);
2314
+ },
2315
+ getAmount1DeltaEx: async (
2316
+ params: PoolTypes.SignExecuteMethodParams<"getAmount1DeltaEx">
2317
+ ): Promise<PoolTypes.SignExecuteMethodResult<"getAmount1DeltaEx">> => {
2318
+ return signExecuteMethod(Pool, this, "getAmount1DeltaEx", params);
2319
+ },
2320
+ getAmount1Delta: async (
2321
+ params: PoolTypes.SignExecuteMethodParams<"getAmount1Delta">
2322
+ ): Promise<PoolTypes.SignExecuteMethodResult<"getAmount1Delta">> => {
2323
+ return signExecuteMethod(Pool, this, "getAmount1Delta", params);
2324
+ },
2325
+ mulDiv: async (
2326
+ params: PoolTypes.SignExecuteMethodParams<"mulDiv">
2327
+ ): Promise<PoolTypes.SignExecuteMethodResult<"mulDiv">> => {
2328
+ return signExecuteMethod(Pool, this, "mulDiv", params);
2329
+ },
2330
+ mulDivRoundingUp: async (
2331
+ params: PoolTypes.SignExecuteMethodParams<"mulDivRoundingUp">
2332
+ ): Promise<PoolTypes.SignExecuteMethodResult<"mulDivRoundingUp">> => {
2333
+ return signExecuteMethod(Pool, this, "mulDivRoundingUp", params);
2334
+ },
2335
+ wordPath: async (
2336
+ params: PoolTypes.SignExecuteMethodParams<"wordPath">
2337
+ ): Promise<PoolTypes.SignExecuteMethodResult<"wordPath">> => {
2338
+ return signExecuteMethod(Pool, this, "wordPath", params);
2339
+ },
2340
+ getWord: async (
2341
+ params: PoolTypes.SignExecuteMethodParams<"getWord">
2342
+ ): Promise<PoolTypes.SignExecuteMethodResult<"getWord">> => {
2343
+ return signExecuteMethod(Pool, this, "getWord", params);
2344
+ },
2345
+ getWordOrTemplate: async (
2346
+ params: PoolTypes.SignExecuteMethodParams<"getWordOrTemplate">
2347
+ ): Promise<PoolTypes.SignExecuteMethodResult<"getWordOrTemplate">> => {
2348
+ return signExecuteMethod(Pool, this, "getWordOrTemplate", params);
2349
+ },
2350
+ flipTick: async (
2351
+ params: PoolTypes.SignExecuteMethodParams<"flipTick">
2352
+ ): Promise<PoolTypes.SignExecuteMethodResult<"flipTick">> => {
2353
+ return signExecuteMethod(Pool, this, "flipTick", params);
2354
+ },
2355
+ nextInitializedTickWithinOneWord: async (
2356
+ params: PoolTypes.SignExecuteMethodParams<"nextInitializedTickWithinOneWord">
2357
+ ): Promise<
2358
+ PoolTypes.SignExecuteMethodResult<"nextInitializedTickWithinOneWord">
2359
+ > => {
2360
+ return signExecuteMethod(
2361
+ Pool,
2362
+ this,
2363
+ "nextInitializedTickWithinOneWord",
2364
+ params
2365
+ );
2366
+ },
2367
+ positionPath: async (
2368
+ params: PoolTypes.SignExecuteMethodParams<"positionPath">
2369
+ ): Promise<PoolTypes.SignExecuteMethodResult<"positionPath">> => {
2370
+ return signExecuteMethod(Pool, this, "positionPath", params);
2371
+ },
2372
+ positionContractId: async (
2373
+ params: PoolTypes.SignExecuteMethodParams<"positionContractId">
2374
+ ): Promise<PoolTypes.SignExecuteMethodResult<"positionContractId">> => {
2375
+ return signExecuteMethod(Pool, this, "positionContractId", params);
2376
+ },
2377
+ configPath: async (
2378
+ params: PoolTypes.SignExecuteMethodParams<"configPath">
2379
+ ): Promise<PoolTypes.SignExecuteMethodResult<"configPath">> => {
2380
+ return signExecuteMethod(Pool, this, "configPath", params);
2381
+ },
2382
+ poolPath: async (
2383
+ params: PoolTypes.SignExecuteMethodParams<"poolPath">
2384
+ ): Promise<PoolTypes.SignExecuteMethodResult<"poolPath">> => {
2385
+ return signExecuteMethod(Pool, this, "poolPath", params);
2386
+ },
2387
+ poolContractId: async (
2388
+ params: PoolTypes.SignExecuteMethodParams<"poolContractId">
2389
+ ): Promise<PoolTypes.SignExecuteMethodResult<"poolContractId">> => {
2390
+ return signExecuteMethod(Pool, this, "poolContractId", params);
2391
+ },
2392
+ checkTicks: async (
2393
+ params: PoolTypes.SignExecuteMethodParams<"checkTicks">
2394
+ ): Promise<PoolTypes.SignExecuteMethodResult<"checkTicks">> => {
2395
+ return signExecuteMethod(Pool, this, "checkTicks", params);
2396
+ },
2397
+ tickPath: async (
2398
+ params: PoolTypes.SignExecuteMethodParams<"tickPath">
2399
+ ): Promise<PoolTypes.SignExecuteMethodResult<"tickPath">> => {
2400
+ return signExecuteMethod(Pool, this, "tickPath", params);
2401
+ },
2402
+ toTick: async (
2403
+ params: PoolTypes.SignExecuteMethodParams<"toTick">
2404
+ ): Promise<PoolTypes.SignExecuteMethodResult<"toTick">> => {
2405
+ return signExecuteMethod(Pool, this, "toTick", params);
2406
+ },
2407
+ getTick: async (
2408
+ params: PoolTypes.SignExecuteMethodParams<"getTick">
2409
+ ): Promise<PoolTypes.SignExecuteMethodResult<"getTick">> => {
2410
+ return signExecuteMethod(Pool, this, "getTick", params);
2411
+ },
2412
+ toPosition: async (
2413
+ params: PoolTypes.SignExecuteMethodParams<"toPosition">
2414
+ ): Promise<PoolTypes.SignExecuteMethodResult<"toPosition">> => {
2415
+ return signExecuteMethod(Pool, this, "toPosition", params);
2416
+ },
2417
+ getPosition: async (
2418
+ params: PoolTypes.SignExecuteMethodParams<"getPosition">
2419
+ ): Promise<PoolTypes.SignExecuteMethodResult<"getPosition">> => {
2420
+ return signExecuteMethod(Pool, this, "getPosition", params);
2421
+ },
2422
+ getFeeGrowthInside: async (
2423
+ params: PoolTypes.SignExecuteMethodParams<"getFeeGrowthInside">
2424
+ ): Promise<PoolTypes.SignExecuteMethodResult<"getFeeGrowthInside">> => {
2425
+ return signExecuteMethod(Pool, this, "getFeeGrowthInside", params);
2426
+ },
2427
+ updatePosition: async (
2428
+ params: PoolTypes.SignExecuteMethodParams<"updatePosition">
2429
+ ): Promise<PoolTypes.SignExecuteMethodResult<"updatePosition">> => {
2430
+ return signExecuteMethod(Pool, this, "updatePosition", params);
2431
+ },
2432
+ modifyPosition: async (
2433
+ params: PoolTypes.SignExecuteMethodParams<"modifyPosition">
2434
+ ): Promise<PoolTypes.SignExecuteMethodResult<"modifyPosition">> => {
2435
+ return signExecuteMethod(Pool, this, "modifyPosition", params);
2436
+ },
2437
+ mint: async (
2438
+ params: PoolTypes.SignExecuteMethodParams<"mint">
2439
+ ): Promise<PoolTypes.SignExecuteMethodResult<"mint">> => {
2440
+ return signExecuteMethod(Pool, this, "mint", params);
2441
+ },
2442
+ burn: async (
2443
+ params: PoolTypes.SignExecuteMethodParams<"burn">
2444
+ ): Promise<PoolTypes.SignExecuteMethodResult<"burn">> => {
2445
+ return signExecuteMethod(Pool, this, "burn", params);
2446
+ },
2447
+ collect: async (
2448
+ params: PoolTypes.SignExecuteMethodParams<"collect">
2449
+ ): Promise<PoolTypes.SignExecuteMethodResult<"collect">> => {
2450
+ return signExecuteMethod(Pool, this, "collect", params);
2451
+ },
2452
+ withdraw: async (
2453
+ params: PoolTypes.SignExecuteMethodParams<"withdraw">
2454
+ ): Promise<PoolTypes.SignExecuteMethodResult<"withdraw">> => {
2455
+ return signExecuteMethod(Pool, this, "withdraw", params);
2456
+ },
2457
+ simulateSwap: async (
2458
+ params: PoolTypes.SignExecuteMethodParams<"simulateSwap">
2459
+ ): Promise<PoolTypes.SignExecuteMethodResult<"simulateSwap">> => {
2460
+ return signExecuteMethod(Pool, this, "simulateSwap", params);
2461
+ },
2462
+ swap: async (
2463
+ params: PoolTypes.SignExecuteMethodParams<"swap">
2464
+ ): Promise<PoolTypes.SignExecuteMethodResult<"swap">> => {
2465
+ return signExecuteMethod(Pool, this, "swap", params);
2466
+ },
2467
+ pop: async (
2468
+ params: PoolTypes.SignExecuteMethodParams<"pop">
2469
+ ): Promise<PoolTypes.SignExecuteMethodResult<"pop">> => {
2470
+ return signExecuteMethod(Pool, this, "pop", params);
2471
+ },
2472
+ swapExactOut: async (
2473
+ params: PoolTypes.SignExecuteMethodParams<"swapExactOut">
2474
+ ): Promise<PoolTypes.SignExecuteMethodResult<"swapExactOut">> => {
2475
+ return signExecuteMethod(Pool, this, "swapExactOut", params);
2476
+ },
2477
+ swapExactIn: async (
2478
+ params: PoolTypes.SignExecuteMethodParams<"swapExactIn">
2479
+ ): Promise<PoolTypes.SignExecuteMethodResult<"swapExactIn">> => {
2480
+ return signExecuteMethod(Pool, this, "swapExactIn", params);
2481
+ },
2482
+ getSqrtPricesX96: async (
2483
+ params: PoolTypes.SignExecuteMethodParams<"getSqrtPricesX96">
2484
+ ): Promise<PoolTypes.SignExecuteMethodResult<"getSqrtPricesX96">> => {
2485
+ return signExecuteMethod(Pool, this, "getSqrtPricesX96", params);
2486
+ },
2487
+ updateReward: async (
2488
+ params: PoolTypes.SignExecuteMethodParams<"updateReward">
2489
+ ): Promise<PoolTypes.SignExecuteMethodResult<"updateReward">> => {
2490
+ return signExecuteMethod(Pool, this, "updateReward", params);
2491
+ },
2492
+ updateRewards: async (
2493
+ params: PoolTypes.SignExecuteMethodParams<"updateRewards">
2494
+ ): Promise<PoolTypes.SignExecuteMethodResult<"updateRewards">> => {
2495
+ return signExecuteMethod(Pool, this, "updateRewards", params);
2496
+ },
2497
+ extendRewards: async (
2498
+ params: PoolTypes.SignExecuteMethodParams<"extendRewards">
2499
+ ): Promise<PoolTypes.SignExecuteMethodResult<"extendRewards">> => {
2500
+ return signExecuteMethod(Pool, this, "extendRewards", params);
2501
+ },
2502
+ setRewardParams: async (
2503
+ params: PoolTypes.SignExecuteMethodParams<"setRewardParams">
2504
+ ): Promise<PoolTypes.SignExecuteMethodResult<"setRewardParams">> => {
2505
+ return signExecuteMethod(Pool, this, "setRewardParams", params);
2506
+ },
2507
+ collectProtocolFees: async (
2508
+ params: PoolTypes.SignExecuteMethodParams<"collectProtocolFees">
2509
+ ): Promise<PoolTypes.SignExecuteMethodResult<"collectProtocolFees">> => {
2510
+ return signExecuteMethod(Pool, this, "collectProtocolFees", params);
2511
+ },
2512
+ positionInfo: async (
2513
+ params: PoolTypes.SignExecuteMethodParams<"positionInfo">
2514
+ ): Promise<PoolTypes.SignExecuteMethodResult<"positionInfo">> => {
2515
+ return signExecuteMethod(Pool, this, "positionInfo", params);
2516
+ },
2517
+ getTokenUri: async (
2518
+ params: PoolTypes.SignExecuteMethodParams<"getTokenUri">
2519
+ ): Promise<PoolTypes.SignExecuteMethodResult<"getTokenUri">> => {
2520
+ return signExecuteMethod(Pool, this, "getTokenUri", params);
2521
+ },
2522
+ };
2523
+
2524
+ async multicall<Calls extends PoolTypes.MultiCallParams>(
2525
+ calls: Calls
2526
+ ): Promise<PoolTypes.MultiCallResults<Calls>>;
2527
+ async multicall<Callss extends PoolTypes.MultiCallParams[]>(
2528
+ callss: Narrow<Callss>
2529
+ ): Promise<PoolTypes.MulticallReturnType<Callss>>;
2530
+ async multicall<
2531
+ Callss extends PoolTypes.MultiCallParams | PoolTypes.MultiCallParams[]
2532
+ >(callss: Callss): Promise<unknown> {
2533
+ return await multicallMethods(Pool, this, callss, getContractByCodeHash);
2534
+ }
2535
+ }