@clober/v2-sdk 0.0.5-6.dev → 0.0.6-0.dev

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 (154) hide show
  1. package/dist/cjs/abis/rebalancer/minter-abi.js +262 -0
  2. package/dist/cjs/abis/rebalancer/minter-abi.js.map +1 -0
  3. package/dist/cjs/abis/rebalancer/mock-swap-abi.js +95 -0
  4. package/dist/cjs/abis/rebalancer/mock-swap-abi.js.map +1 -0
  5. package/dist/cjs/abis/rebalancer/operator-abi.js +370 -0
  6. package/dist/cjs/abis/rebalancer/operator-abi.js.map +1 -0
  7. package/dist/cjs/abis/rebalancer/rebalancer-abi.js +1235 -0
  8. package/dist/cjs/abis/rebalancer/rebalancer-abi.js.map +1 -0
  9. package/dist/cjs/abis/rebalancer/strategy-abi.js +633 -0
  10. package/dist/cjs/abis/rebalancer/strategy-abi.js.map +1 -0
  11. package/dist/cjs/apis/chart-logs.js +14 -5
  12. package/dist/cjs/apis/chart-logs.js.map +1 -1
  13. package/dist/cjs/apis/market.js +3 -3
  14. package/dist/cjs/apis/market.js.map +1 -1
  15. package/dist/cjs/apis/odos.js +100 -0
  16. package/dist/cjs/apis/odos.js.map +1 -0
  17. package/dist/cjs/apis/open-order.js +6 -6
  18. package/dist/cjs/apis/open-order.js.map +1 -1
  19. package/dist/cjs/apis/pool.js +61 -0
  20. package/dist/cjs/apis/pool.js.map +1 -0
  21. package/dist/cjs/apis/strategy.js +23 -0
  22. package/dist/cjs/apis/strategy.js.map +1 -0
  23. package/dist/cjs/call.js +359 -1
  24. package/dist/cjs/call.js.map +1 -1
  25. package/dist/cjs/constants/addresses.js +21 -1
  26. package/dist/cjs/constants/addresses.js.map +1 -1
  27. package/dist/cjs/constants/chain.js +5 -1
  28. package/dist/cjs/constants/chain.js.map +1 -1
  29. package/dist/cjs/constants/permit.js +13 -0
  30. package/dist/cjs/constants/permit.js.map +1 -0
  31. package/dist/cjs/constants/subgraph.js +1 -1
  32. package/dist/cjs/model/market.js +45 -0
  33. package/dist/cjs/model/market.js.map +1 -1
  34. package/dist/cjs/model/pool.js +136 -0
  35. package/dist/cjs/model/pool.js.map +1 -0
  36. package/dist/cjs/model/strategy.js +3 -0
  37. package/dist/cjs/model/strategy.js.map +1 -0
  38. package/dist/cjs/type.js.map +1 -1
  39. package/dist/cjs/utils/market.js +1 -1
  40. package/dist/cjs/utils/market.js.map +1 -1
  41. package/dist/cjs/utils/math.js +3 -1
  42. package/dist/cjs/utils/math.js.map +1 -1
  43. package/dist/cjs/utils/open.js +34 -35
  44. package/dist/cjs/utils/open.js.map +1 -1
  45. package/dist/cjs/utils/pool-key.js +17 -0
  46. package/dist/cjs/utils/pool-key.js.map +1 -0
  47. package/dist/cjs/utils/pool.js +88 -0
  48. package/dist/cjs/utils/pool.js.map +1 -0
  49. package/dist/cjs/utils/prices.js +7 -2
  50. package/dist/cjs/utils/prices.js.map +1 -1
  51. package/dist/cjs/view.js +43 -30
  52. package/dist/cjs/view.js.map +1 -1
  53. package/dist/esm/abis/rebalancer/minter-abi.js +259 -0
  54. package/dist/esm/abis/rebalancer/minter-abi.js.map +1 -0
  55. package/dist/esm/abis/rebalancer/mock-swap-abi.js +92 -0
  56. package/dist/esm/abis/rebalancer/mock-swap-abi.js.map +1 -0
  57. package/dist/esm/abis/rebalancer/operator-abi.js +367 -0
  58. package/dist/esm/abis/rebalancer/operator-abi.js.map +1 -0
  59. package/dist/esm/abis/rebalancer/rebalancer-abi.js +1232 -0
  60. package/dist/esm/abis/rebalancer/rebalancer-abi.js.map +1 -0
  61. package/dist/esm/abis/rebalancer/strategy-abi.js +630 -0
  62. package/dist/esm/abis/rebalancer/strategy-abi.js.map +1 -0
  63. package/dist/esm/apis/chart-logs.js +14 -5
  64. package/dist/esm/apis/chart-logs.js.map +1 -1
  65. package/dist/esm/apis/market.js +4 -4
  66. package/dist/esm/apis/market.js.map +1 -1
  67. package/dist/esm/apis/odos.js +94 -0
  68. package/dist/esm/apis/odos.js.map +1 -0
  69. package/dist/esm/apis/open-order.js +6 -6
  70. package/dist/esm/apis/open-order.js.map +1 -1
  71. package/dist/esm/apis/pool.js +57 -0
  72. package/dist/esm/apis/pool.js.map +1 -0
  73. package/dist/esm/apis/strategy.js +19 -0
  74. package/dist/esm/apis/strategy.js.map +1 -0
  75. package/dist/esm/call.js +388 -28
  76. package/dist/esm/call.js.map +1 -1
  77. package/dist/esm/constants/addresses.js +22 -2
  78. package/dist/esm/constants/addresses.js.map +1 -1
  79. package/dist/esm/constants/chain.js +3 -0
  80. package/dist/esm/constants/chain.js.map +1 -1
  81. package/dist/esm/constants/permit.js +10 -0
  82. package/dist/esm/constants/permit.js.map +1 -0
  83. package/dist/esm/constants/subgraph.js +1 -1
  84. package/dist/esm/model/market.js +46 -1
  85. package/dist/esm/model/market.js.map +1 -1
  86. package/dist/esm/model/pool.js +133 -0
  87. package/dist/esm/model/pool.js.map +1 -0
  88. package/dist/esm/model/strategy.js +2 -0
  89. package/dist/esm/model/strategy.js.map +1 -0
  90. package/dist/esm/type.js.map +1 -1
  91. package/dist/esm/utils/market.js +1 -1
  92. package/dist/esm/utils/market.js.map +1 -1
  93. package/dist/esm/utils/math.js +1 -0
  94. package/dist/esm/utils/math.js.map +1 -1
  95. package/dist/esm/utils/open.js +32 -33
  96. package/dist/esm/utils/open.js.map +1 -1
  97. package/dist/esm/utils/pool-key.js +12 -0
  98. package/dist/esm/utils/pool-key.js.map +1 -0
  99. package/dist/esm/utils/pool.js +84 -0
  100. package/dist/esm/utils/pool.js.map +1 -0
  101. package/dist/esm/utils/prices.js +5 -1
  102. package/dist/esm/utils/prices.js.map +1 -1
  103. package/dist/esm/view.js +78 -43
  104. package/dist/esm/view.js.map +1 -1
  105. package/dist/tsconfig.build.tsbuildinfo +1 -1
  106. package/dist/types/abis/rebalancer/minter-abi.d.ts +198 -0
  107. package/dist/types/abis/rebalancer/minter-abi.d.ts.map +1 -0
  108. package/dist/types/abis/rebalancer/mock-swap-abi.d.ts +70 -0
  109. package/dist/types/abis/rebalancer/mock-swap-abi.d.ts.map +1 -0
  110. package/dist/types/abis/rebalancer/operator-abi.d.ts +283 -0
  111. package/dist/types/abis/rebalancer/operator-abi.d.ts.map +1 -0
  112. package/dist/types/abis/rebalancer/rebalancer-abi.d.ts +952 -0
  113. package/dist/types/abis/rebalancer/rebalancer-abi.d.ts.map +1 -0
  114. package/dist/types/abis/rebalancer/strategy-abi.d.ts +487 -0
  115. package/dist/types/abis/rebalancer/strategy-abi.d.ts.map +1 -0
  116. package/dist/types/apis/chart-logs.d.ts.map +1 -1
  117. package/dist/types/apis/odos.d.ts +28 -0
  118. package/dist/types/apis/odos.d.ts.map +1 -0
  119. package/dist/types/apis/open-order.d.ts.map +1 -1
  120. package/dist/types/apis/pool.d.ts +5 -0
  121. package/dist/types/apis/pool.d.ts.map +1 -0
  122. package/dist/types/apis/strategy.d.ts +5 -0
  123. package/dist/types/apis/strategy.d.ts.map +1 -0
  124. package/dist/types/call.d.ts +106 -27
  125. package/dist/types/call.d.ts.map +1 -1
  126. package/dist/types/constants/addresses.d.ts +4 -0
  127. package/dist/types/constants/addresses.d.ts.map +1 -1
  128. package/dist/types/constants/chain.d.ts +1 -0
  129. package/dist/types/constants/chain.d.ts.map +1 -1
  130. package/dist/types/constants/permit.d.ts +10 -0
  131. package/dist/types/constants/permit.d.ts.map +1 -0
  132. package/dist/types/model/currency.d.ts +7 -0
  133. package/dist/types/model/currency.d.ts.map +1 -1
  134. package/dist/types/model/market.d.ts +3 -0
  135. package/dist/types/model/market.d.ts.map +1 -1
  136. package/dist/types/model/pool.d.ts +38 -0
  137. package/dist/types/model/pool.d.ts.map +1 -0
  138. package/dist/types/model/strategy.d.ts +6 -0
  139. package/dist/types/model/strategy.d.ts.map +1 -0
  140. package/dist/types/type.d.ts +20 -1
  141. package/dist/types/type.d.ts.map +1 -1
  142. package/dist/types/utils/math.d.ts +1 -0
  143. package/dist/types/utils/math.d.ts.map +1 -1
  144. package/dist/types/utils/open.d.ts +1 -1
  145. package/dist/types/utils/open.d.ts.map +1 -1
  146. package/dist/types/utils/pool-key.d.ts +3 -0
  147. package/dist/types/utils/pool-key.d.ts.map +1 -0
  148. package/dist/types/utils/pool.d.ts +11 -0
  149. package/dist/types/utils/pool.d.ts.map +1 -0
  150. package/dist/types/utils/prices.d.ts +1 -0
  151. package/dist/types/utils/prices.d.ts.map +1 -1
  152. package/dist/types/view.d.ts +66 -17
  153. package/dist/types/view.d.ts.map +1 -1
  154. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { CHAIN_IDS } from './constants/chain';
2
- import type { CurrencyFlow, DefaultOptions, ERC20PermitParam, Transaction } from './type';
2
+ import type { Currency6909Flow, CurrencyFlow, DefaultOptions, ERC20PermitParam, Transaction } from './type';
3
3
  /**
4
4
  * Build a transaction to open a market.
5
5
  *
@@ -7,8 +7,7 @@ import type { CurrencyFlow, DefaultOptions, ERC20PermitParam, Transaction } from
7
7
  * @param userAddress The address of the user.
8
8
  * @param inputToken The address of the input token.
9
9
  * @param outputToken The address of the output token.
10
- * @param options
11
- * @param options.rpcUrl The RPC URL of the blockchain.
10
+ * @param options {@link DefaultOptions} options.
12
11
  * @returns A Promise resolving to a transaction object. If the market is already open, returns undefined.
13
12
  * @example
14
13
  * import { openMarket } from '@clober/v2-sdk'
@@ -36,14 +35,15 @@ export declare const openMarket: ({ chainId, userAddress, inputToken, outputToke
36
35
  * @param {`0x${string}`} outputToken The address of the token to be received as output.
37
36
  * @param {string} amount The amount of input tokens for the order.
38
37
  * @param {string} price The price at which the order should be executed.
39
- * @param {Object} [options] Optional parameters for the limit order.
38
+ * @param options {@link DefaultOptions} options.
40
39
  * @param {erc20PermitParam} [options.erc20PermitParam] The permit signature for token approval.
41
40
  * @param {boolean} [options.postOnly] A boolean indicating whether the order is only to be made not taken.
42
- * @param {string} [options.rpcUrl] The RPC URL of the blockchain.
43
- * @param {number} [options.gasLimit] The gas limit to use for the transaction.
44
41
  * @param {bigint} [options.makeTick] The tick for the make order.
45
42
  * @param {bigint} [options.takeLimitTick] The tick for the take order.
46
- * @param {boolean} [options.useSubgraph] A boolean indicating whether to use the subgraph for fetching orders.
43
+ * @param {boolean} [options.roundingUpMakeBid] A boolean indicating whether to round up the make bid.
44
+ * @param {boolean} [options.roundingDownMakeAsk] A boolean indicating whether to round down the make ask.
45
+ * @param {boolean} [options.roundingDownTakenBid] A boolean indicating whether to round down the taken bid.
46
+ * @param {boolean} [options.roundingUpTakenAsk] A boolean indicating whether to round up the taken ask.
47
47
  * @returns {Promise<{ transaction: Transaction, result: { make: CurrencyFlow, take: CurrencyFlow, spent: CurrencyFlow }>}
48
48
  * Promise resolving to the transaction object representing the limit order with the result of the order.
49
49
  * @example
@@ -127,12 +127,11 @@ export declare const limitOrder: ({ chainId, userAddress, inputToken, outputToke
127
127
  * @param {`0x${string}`} outputToken The address of the token to be received as output.
128
128
  * @param {string} amountIn The amount of input tokens for the order to spend.
129
129
  * @param {string} amountOut The amount of output tokens for the order to take.
130
- * @param {Object} [options] Optional parameters for the market order.
130
+ * @param options {@link DefaultOptions} options.
131
131
  * @param {erc20PermitParam} [options.erc20PermitParam] The permit signature for token approval.
132
- * @param {string} [options.rpcUrl] The RPC URL of the blockchain.
133
- * @param {number} [options.gasLimit] The gas limit to use for the transaction.
134
- * @param {boolean} [options.useSubgraph] A boolean indicating whether to use the subgraph for fetching orders.
135
132
  * @param {number} [options.slippage] The maximum slippage percentage allowed for the order.
133
+ * @param {boolean} [options.roundingDownTakenBid] A boolean indicating whether to round down the taken bid.
134
+ * @param {boolean} [options.roundingUpTakenAsk] A boolean indicating whether to round up the taken ask.
136
135
  * if the slippage is not provided, unlimited slippage is allowed.
137
136
  * @returns {Promise<{ transaction: Transaction, result: { spent: CurrencyFlow, taken: CurrencyFlow } }>}
138
137
  * Promise resolving to the transaction object representing the market order with the result of the order.
@@ -194,10 +193,7 @@ export declare const marketOrder: ({ chainId, userAddress, inputToken, outputTok
194
193
  * @param {CHAIN_IDS} chainId The chain ID.
195
194
  * @param {`0x${string}`} userAddress The Ethereum address of the user.
196
195
  * @param {string} id An ID representing the open order to be claimed.
197
- * @param {Object} [options] Optional parameters for claiming orders.
198
- * @param {string} [options.rpcUrl] The RPC URL to use for executing the transaction.
199
- * @param {number} [options.gasLimit] The gas limit to use for the transaction.
200
- * @param {boolean} [options.useSubgraph] A boolean indicating whether to use the subgraph for fetching orders.
196
+ * @param options {@link DefaultOptions} options.
201
197
  * @returns {Promise<{ transaction: Transaction, result: CurrencyFlow }>}
202
198
  * Promise resolving to the transaction object representing the claim action with the result of the order.
203
199
  * @throws {Error} Throws an error if no open orders are found for the specified user.
@@ -230,10 +226,7 @@ export declare const claimOrder: ({ chainId, userAddress, id, options, }: {
230
226
  * @param {CHAIN_IDS} chainId The chain ID.
231
227
  * @param {`0x${string}`} userAddress The Ethereum address of the user.
232
228
  * @param {string[]} ids An array of IDs representing the open orders to be claimed.
233
- * @param {Object} [options] Optional parameters for claiming orders.
234
- * @param {string} [options.rpcUrl] The RPC URL to use for executing the transaction.
235
- * @param {number} [options.gasLimit] The gas limit to use for the transaction.
236
- * @param {boolean} [options.useSubgraph] A boolean indicating whether to use the subgraph for fetching orders.
229
+ * @param options {@link DefaultOptions} options.
237
230
  * @returns {Promise<{ transaction: Transaction, result: CurrencyFlow[] }>}
238
231
  * Promise resolving to the transaction object representing the claim action with the result of the orders.
239
232
  * @throws {Error} Throws an error if no open orders are found for the specified user.
@@ -266,10 +259,7 @@ export declare const claimOrders: ({ chainId, userAddress, ids, options, }: {
266
259
  * @param {CHAIN_IDS} chainId The chain ID.
267
260
  * @param {`0x${string}`} userAddress The Ethereum address of the user.
268
261
  * @param {string} id An ID representing the open order to be canceled
269
- * @param {Object} [options] Optional parameters for canceling orders.
270
- * @param {string} [options.rpcUrl] The RPC URL to use for executing the transaction.
271
- * @param {number} [options.gasLimit] The gas limit to use for the transaction.
272
- * @param {boolean} [options.useSubgraph] A boolean indicating whether to use the subgraph for fetching orders.
262
+ * @param options {@link DefaultOptions} options.
273
263
  * @returns {Promise<{ transaction: Transaction, result: CurrencyFlow }>}
274
264
  * Promise resolving to the transaction object representing the cancel action with the result of the order.
275
265
  * @throws {Error} Throws an error if no open orders are found for the specified user.
@@ -302,10 +292,7 @@ export declare const cancelOrder: ({ chainId, userAddress, id, options, }: {
302
292
  * @param {CHAIN_IDS} chainId The chain ID.
303
293
  * @param {`0x${string}`} userAddress The Ethereum address of the user.
304
294
  * @param {string[]} ids An array of IDs representing the open orders to be canceled.
305
- * @param {Object} [options] Optional parameters for canceling orders.
306
- * @param {string} [options.rpcUrl] The RPC URL to use for executing the transaction.
307
- * @param {number} [options.gasLimit] The gas limit to use for the transaction.
308
- * @param {boolean} [options.useSubgraph] A boolean indicating whether to use the subgraph for fetching orders.
295
+ * @param options {@link DefaultOptions} options.
309
296
  * @returns {Promise<{ transaction: Transaction, result: CurrencyFlow[] }>
310
297
  * Promise resolving to the transaction object representing the cancel action with the result of the orders.
311
298
  * @throws {Error} Throws an error if no open orders are found for the specified user.
@@ -331,4 +318,96 @@ export declare const cancelOrders: ({ chainId, userAddress, ids, options, }: {
331
318
  transaction: Transaction;
332
319
  result: CurrencyFlow[];
333
320
  }>;
321
+ /**
322
+ * Build a transaction to open a pool,
323
+ *
324
+ * @param chainId The chain ID of the blockchain.
325
+ * @param userAddress The address of the user.
326
+ * @param inputToken The address of the input token.
327
+ * @param outputToken The address of the output token.
328
+ * @param options {@link DefaultOptions} options.
329
+ * @returns A Promise resolving to a transaction object. If the market is already open, returns undefined.
330
+ * @example
331
+ * import { openPool } from '@clober/v2-sdk'
332
+ *
333
+ * const transaction = await openPool({
334
+ * chainId: 421614,
335
+ * userAddress: '0xF8c1869Ecd4df136693C45EcE1b67f85B6bDaE69',
336
+ * inputToken: '0x00bfd44e79fb7f6dd5887a9426c8ef85a0cd23e0',
337
+ * outputToken: '0x0000000000000000000000000000000000000000'
338
+ * })
339
+ */
340
+ export declare const openPool: ({ chainId, userAddress, tokenA, tokenB, salt, options, }: {
341
+ chainId: CHAIN_IDS;
342
+ userAddress: `0x${string}`;
343
+ tokenA: `0x${string}`;
344
+ tokenB: `0x${string}`;
345
+ salt: `0x${string}`;
346
+ options?: DefaultOptions;
347
+ }) => Promise<Transaction | undefined>;
348
+ export declare const addLiquidity: ({ chainId, userAddress, token0, token1, salt, amount0, amount1, options, }: {
349
+ chainId: CHAIN_IDS;
350
+ userAddress: `0x${string}`;
351
+ token0: `0x${string}`;
352
+ token1: `0x${string}`;
353
+ salt: `0x${string}`;
354
+ amount0?: string;
355
+ amount1?: string;
356
+ options?: {
357
+ slippage?: number;
358
+ disableSwap?: boolean;
359
+ testnetPrice?: string;
360
+ token0PermitParams?: ERC20PermitParam;
361
+ token1PermitParams?: ERC20PermitParam;
362
+ } & DefaultOptions;
363
+ }) => Promise<{
364
+ transaction: Transaction | undefined;
365
+ result: {
366
+ currencyA: CurrencyFlow;
367
+ currencyB: CurrencyFlow;
368
+ lpCurrency: Currency6909Flow;
369
+ };
370
+ }>;
371
+ export declare const removeLiquidity: ({ chainId, userAddress, token0, token1, salt, amount, options, }: {
372
+ chainId: CHAIN_IDS;
373
+ userAddress: `0x${string}`;
374
+ token0: `0x${string}`;
375
+ token1: `0x${string}`;
376
+ salt: `0x${string}`;
377
+ amount: string;
378
+ options?: {
379
+ slippage?: number;
380
+ } & DefaultOptions;
381
+ }) => Promise<{
382
+ transaction: Transaction | undefined;
383
+ result: {
384
+ currencyA: CurrencyFlow;
385
+ currencyB: CurrencyFlow;
386
+ lpCurrency: Currency6909Flow;
387
+ };
388
+ }>;
389
+ export declare const rebalance: ({ chainId, userAddress, token0, token1, salt, options, }: {
390
+ chainId: CHAIN_IDS;
391
+ userAddress: `0x${string}`;
392
+ token0: `0x${string}`;
393
+ token1: `0x${string}`;
394
+ salt: `0x${string}`;
395
+ options?: DefaultOptions;
396
+ }) => Promise<Transaction>;
397
+ export declare const updateStrategyPrice: ({ chainId, userAddress, token0, token1, salt, oraclePrice, priceA, priceB, options, }: {
398
+ chainId: CHAIN_IDS;
399
+ userAddress: `0x${string}`;
400
+ token0: `0x${string}`;
401
+ token1: `0x${string}`;
402
+ salt: `0x${string}`;
403
+ oraclePrice: string;
404
+ priceA: string;
405
+ priceB: string;
406
+ options?: {
407
+ tickA?: bigint;
408
+ tickB?: bigint;
409
+ roundingUpPriceA?: boolean;
410
+ roundingUpPriceB?: boolean;
411
+ } & DefaultOptions;
412
+ }) => Promise<Transaction>;
334
413
  //# sourceMappingURL=call.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../src/call.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAA;AACxD,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,WAAW,EACZ,MAAM,QAAQ,CAAA;AAgBf;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,UAAU,gEAMpB;IACD,OAAO,EAAE,SAAS,CAAA;IAClB,WAAW,EAAE,KAAK,MAAM,EAAE,CAAA;IAC1B,UAAU,EAAE,KAAK,MAAM,EAAE,CAAA;IACzB,WAAW,EAAE,KAAK,MAAM,EAAE,CAAA;IAC1B,OAAO,CAAC,EAAE,cAAc,CAAA;CACzB,KAAG,QAAQ,WAAW,GAAG,SAAS,CAkDlC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,eAAO,MAAM,UAAU,+EAQpB;IACD,OAAO,EAAE,SAAS,CAAA;IAClB,WAAW,EAAE,KAAK,MAAM,EAAE,CAAA;IAC1B,UAAU,EAAE,KAAK,MAAM,EAAE,CAAA;IACzB,WAAW,EAAE,KAAK,MAAM,EAAE,CAAA;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE;QACR,gBAAgB,CAAC,EAAE,gBA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AG,QAAQ,WAAW,CAqCtB,CAAA;AAED,eAAO,MAAM,mBAAmB,0FAU7B;IACD,OAAO,EAAE,SAAS,CAAA;IAClB,WAAW,EAAE,KAAK,MAAM,EAAE,CAAA;IAC1B,MAAM,EAAE,KAAK,MAAM,EAAE,CAAA;IACrB,MAAM,EAAE,KAAK,MAAM,EAAE,CAAA;IACrB,IAAI,EAAE,KAAK,MAAM,EAAE,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,gBAAgB,CAAC,EAAE,OAAO,CAAA;QAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAC3B,GAAG,cAAc,CAAA;CACnB,KAAG,QAAQ,WAAW,CAqEtB,CAAA"}
@@ -4,6 +4,10 @@ export declare const CONTRACT_ADDRESSES: {
4
4
  Controller: `0x${string}`;
5
5
  BookManager: `0x${string}`;
6
6
  BookViewer: `0x${string}`;
7
+ Rebalancer: `0x${string}`;
8
+ Strategy: `0x${string}`;
9
+ Minter: `0x${string}`;
10
+ Operator: `0x${string}`;
7
11
  };
8
12
  };
9
13
  //# sourceMappingURL=addresses.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../../src/constants/addresses.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC,eAAO,MAAM,kBAAkB,EAAE;KAC9B,KAAK,IAAI,SAAS,GAAG;QACpB,UAAU,EAAE,KAAK,MAAM,EAAE,CAAA;QACzB,WAAW,EAAE,KAAK,MAAM,EAAE,CAAA;QAC1B,UAAU,EAAE,KAAK,MAAM,EAAE,CAAA;KAC1B;CA2BF,CAAA"}
1
+ {"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../../src/constants/addresses.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC,eAAO,MAAM,kBAAkB,EAAE;KAC9B,KAAK,IAAI,SAAS,GAAG;QACpB,UAAU,EAAE,KAAK,MAAM,EAAE,CAAA;QACzB,WAAW,EAAE,KAAK,MAAM,EAAE,CAAA;QAC1B,UAAU,EAAE,KAAK,MAAM,EAAE,CAAA;QACzB,UAAU,EAAE,KAAK,MAAM,EAAE,CAAA;QACzB,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAA;QACvB,MAAM,EAAE,KAAK,MAAM,EAAE,CAAA;QACrB,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAA;KACxB;CA+CF,CAAA"}
@@ -9,4 +9,5 @@ export declare enum CHAIN_IDS {
9
9
  export declare const CHAIN_MAP: {
10
10
  [chain in CHAIN_IDS]: Chain;
11
11
  };
12
+ export declare const isTestnetChain: (chainId: CHAIN_IDS) => boolean;
12
13
  //# sourceMappingURL=chain.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../../src/constants/chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,KAAK,EAEX,MAAM,aAAa,CAAA;AAIpB,oBAAY,SAAS;IACnB,cAAmC;IACnC,gBAAqC;IACrC,IAAc;IACd,iBAAuC;IACvC,MAAkB;CACnB;AAED,eAAO,MAAM,SAAS,EAAE;KACrB,KAAK,IAAI,SAAS,GAAG,KAAK;CAe5B,CAAA"}
1
+ {"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../../src/constants/chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,KAAK,EAEX,MAAM,aAAa,CAAA;AAIpB,oBAAY,SAAS;IACnB,cAAmC;IACnC,gBAAqC;IACrC,IAAc;IACd,iBAAuC;IACvC,MAAkB;CACnB;AAED,eAAO,MAAM,SAAS,EAAE;KACrB,KAAK,IAAI,SAAS,GAAG,KAAK;CAe5B,CAAA;AAED,eAAO,MAAM,cAAc,YAAa,SAAS,KAAG,OAGX,CAAA"}
@@ -0,0 +1,10 @@
1
+ export declare const emptyERC20PermitParams: {
2
+ permitAmount: bigint;
3
+ signature: {
4
+ deadline: bigint;
5
+ v: number;
6
+ r: string;
7
+ s: string;
8
+ };
9
+ };
10
+ //# sourceMappingURL=permit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permit.d.ts","sourceRoot":"","sources":["../../../src/constants/permit.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB;;;;;;;;CAQlC,CAAA"}
@@ -4,4 +4,11 @@ export type Currency = {
4
4
  symbol: string;
5
5
  decimals: number;
6
6
  };
7
+ export type Currency6909 = {
8
+ address: `0x${string}`;
9
+ id: bigint;
10
+ name: string;
11
+ symbol: string;
12
+ decimals: number;
13
+ };
7
14
  //# sourceMappingURL=currency.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../../src/model/currency.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,KAAK,MAAM,EAAE,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA"}
1
+ {"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../../src/model/currency.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,KAAK,MAAM,EAAE,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,KAAK,MAAM,EAAE,CAAA;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA"}
@@ -1,8 +1,10 @@
1
1
  import { CHAIN_IDS } from '../constants/chain';
2
+ import { Market as MarketType } from '../type';
2
3
  import { Book } from './book';
3
4
  import type { Currency } from './currency';
4
5
  import type { Depth } from './depth';
5
6
  export declare class Market {
7
+ chainId: CHAIN_IDS;
6
8
  makerFee: number;
7
9
  takerFee: number;
8
10
  id: string;
@@ -46,5 +48,6 @@ export declare class Market {
46
48
  }[];
47
49
  bookId: bigint;
48
50
  };
51
+ toJson: () => MarketType;
49
52
  }
50
53
  //# sourceMappingURL=market.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"market.d.ts","sourceRoot":"","sources":["../../../src/model/market.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAM9C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,qBAAa,MAAM;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAEhB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,QAAQ,CAAA;IACf,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,KAAK,EAAE,CAAA;IACb,IAAI,EAAE,KAAK,EAAE,CAAA;IACb,OAAO,EAAE,IAAI,CAAA;IACb,OAAO,EAAE,IAAI,CAAA;gBAED,EACV,OAAO,EACP,MAAM,EACN,OAAO,EACP,OAAO,GACR,EAAE;QACD,OAAO,EAAE,SAAS,CAAA;QAClB,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;QAC5B,OAAO,EAAE,IAAI,CAAA;QACb,OAAO,EAAE,IAAI,CAAA;KACd;IAoDD,IAAI,yCA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AE,MAAM,CAAA;KAClB;;;;;;;;;MAkBA;IAED,KAAK,wCAIF;QACD,SAAS,EAAE,OAAO,CAAA;QAClB,SAAS,EAAE,MAAM,CAAA;QACjB,QAAQ,EAAE,MAAM,CAAA;KACjB;;;;;;;;;MAkBA;IAED,MAAM,QAAO,UAAU,CAgCtB;CACF"}
@@ -0,0 +1,38 @@
1
+ import { CHAIN_IDS, Currency, OpenOrder } from '../type';
2
+ import { Market } from './market';
3
+ import { Currency6909 } from './currency';
4
+ export declare class Pool {
5
+ key: `0x${string}`;
6
+ market: Market;
7
+ isOpened: boolean;
8
+ strategy: `0x${string}`;
9
+ currencyA: Currency;
10
+ currencyB: Currency;
11
+ currencyLp: Currency6909;
12
+ totalSupply: bigint;
13
+ decimals: number;
14
+ reserveA: string;
15
+ reserveB: string;
16
+ liquidityA: bigint;
17
+ liquidityB: bigint;
18
+ orderListA: OpenOrder[];
19
+ orderListB: OpenOrder[];
20
+ constructor({ chainId, market, isOpened, bookIdA, bookIdB, salt, poolKey, totalSupply, decimals, reserveA, reserveB, liquidityA, liquidityB, orderListA, orderListB, }: {
21
+ chainId: CHAIN_IDS;
22
+ market: Market;
23
+ isOpened: boolean;
24
+ bookIdA: bigint;
25
+ bookIdB: bigint;
26
+ salt: `0x${string}`;
27
+ poolKey: `0x${string}`;
28
+ totalSupply: bigint;
29
+ decimals: number;
30
+ reserveA: bigint;
31
+ reserveB: bigint;
32
+ liquidityA: bigint;
33
+ liquidityB: bigint;
34
+ orderListA: OpenOrder[];
35
+ orderListB: OpenOrder[];
36
+ });
37
+ }
38
+ //# sourceMappingURL=pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../../src/model/pool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAIxD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAA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"}
@@ -0,0 +1,6 @@
1
+ export type StrategyPrice = {
2
+ oraclePrice: string;
3
+ tickA: bigint;
4
+ tickB: bigint;
5
+ };
6
+ //# sourceMappingURL=strategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strategy.d.ts","sourceRoot":"","sources":["../../../src/model/strategy.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import type { Account } from 'viem';
2
2
  import { CHAIN_IDS } from './constants/chain';
3
- import type { Currency } from './model/currency';
3
+ import type { Currency, Currency6909 } from './model/currency';
4
+ import { OpenOrder } from './model/open-order';
4
5
  export { CHAIN_IDS } from './constants/chain';
5
6
  export type { Currency } from './model/currency';
6
7
  export type { OpenOrder } from './model/open-order';
@@ -27,6 +28,19 @@ export type Market = {
27
28
  asks: Depth[];
28
29
  askBook: Book;
29
30
  };
31
+ export type Pool = {
32
+ chainId: CHAIN_IDS;
33
+ key: `0x${string}`;
34
+ market: Market;
35
+ isOpened: boolean;
36
+ strategy: `0x${string}`;
37
+ currencyA: Currency;
38
+ currencyB: Currency;
39
+ reserveA: string;
40
+ reserveB: string;
41
+ orderListA: OpenOrder[];
42
+ orderListB: OpenOrder[];
43
+ };
30
44
  export type Transaction = {
31
45
  data: `0x${string}`;
32
46
  gas: bigint;
@@ -56,6 +70,11 @@ export type CurrencyFlow = {
56
70
  amount: string;
57
71
  direction: 'in' | 'out';
58
72
  };
73
+ export type Currency6909Flow = {
74
+ currency: Currency6909;
75
+ amount: string;
76
+ direction: 'in' | 'out';
77
+ };
59
78
  export type ChartLog = {
60
79
  timestamp: number;
61
80
  open: string;
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,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EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,oBAAY,mBAAmB;IAC7B,SAAS,OAAO;IAChB,YAAY,OAAO;IACnB,WAAW,OAAO;IAClB,UAAU,QAAQ;IAClB,cAAc,QAAQ;IACtB,aAAa,QAAQ;IACrB,OAAO,OAAO;IACd,QAAQ,OAAO;IACf,SAAS,OAAO;IAChB,QAAQ,OAAO;IACf,MAAM,OAAO;IACb,OAAO,OAAO;CACf"}
@@ -1,3 +1,4 @@
1
+ export declare const abs: (x: bigint) => bigint;
1
2
  export declare const divide: (x: bigint, y: bigint, roundUp: boolean) => bigint;
2
3
  export declare const lnWad: (x: bigint) => bigint;
3
4
  //# sourceMappingURL=math.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../src/utils/math.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,MAAO,MAAM,KAAK,MAAM,WAAW,OAAO,KAAG,MAU/D,CAAA;AAED,eAAO,MAAM,KAAK,MAAO,MAAM,KAAG,MAwGjC,CAAA"}
1
+ {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../src/utils/math.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,GAAG,MAAO,MAAM,KAAG,MAA2B,CAAA;AAE3D,eAAO,MAAM,MAAM,MAAO,MAAM,KAAK,MAAM,WAAW,OAAO,KAAG,MAU/D,CAAA;AAED,eAAO,MAAM,KAAK,MAAO,MAAM,KAAG,MAwGjC,CAAA"}
@@ -1,4 +1,4 @@
1
1
  import { PublicClient } from 'viem';
2
2
  import { CHAIN_IDS } from '../constants/chain';
3
- export declare function fetchIsOpened(publicClient: PublicClient, chainId: CHAIN_IDS, bookId: bigint): Promise<boolean>;
3
+ export declare function fetchIsMarketOpened(publicClient: PublicClient, chainId: CHAIN_IDS, bookId: bigint): Promise<boolean>;
4
4
  //# sourceMappingURL=open.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../../../src/utils/open.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAoC9C,wBAAsB,aAAa,CACjC,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,SAAS,EAClB,MAAM,EAAE,MAAM,oBAgBf"}
1
+ {"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../../../src/utils/open.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAc9C,wBAAsB,mBAAmB,CACvC,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,SAAS,EAClB,MAAM,EAAE,MAAM,oBAoCf"}
@@ -0,0 +1,3 @@
1
+ export declare const toPoolKey: (bookIdA: bigint, bookIdB: bigint, salt: `0x${string}`) => `0x${string}`;
2
+ export declare const toBytes32: (value: `0x${string}`) => `0x${string}`;
3
+ //# sourceMappingURL=pool-key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool-key.d.ts","sourceRoot":"","sources":["../../../src/utils/pool-key.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,YACX,MAAM,WACN,MAAM,QACT,KAAK,MAAM,EAAE,kBAWpB,CAAA;AAED,eAAO,MAAM,SAAS,UAAW,KAAK,MAAM,EAAE,KAAG,KAAK,MAAM,EAE3D,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { Currency } from '../model/currency';
2
+ export declare function getExpectedMintResult(totalSupply: bigint, liquidityA: bigint, liquidityB: bigint, amountA: bigint, amountB: bigint, currencyA: Currency, currencyB: Currency): {
3
+ mintAmount: bigint;
4
+ inAmountA: bigint;
5
+ inAmountB: bigint;
6
+ };
7
+ export declare function getIdealDelta(amountA: bigint, amountB: bigint, liquidityA: bigint, liquidityB: bigint, swapAmountA: bigint, swapAmountB: bigint): {
8
+ deltaA: bigint;
9
+ deltaB: bigint;
10
+ };
11
+ //# sourceMappingURL=pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../../src/utils/pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,QAAQ,EACnB,SAAS,EAAE,QAAQ,GAClB;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,CAuDA;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB;IACD,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf,CAqBA"}
@@ -1,5 +1,6 @@
1
1
  import { Currency } from '../model/currency';
2
2
  export declare const formatPrice: (price: bigint, quoteDecimals: number, baseDecimals: number) => string;
3
+ export declare const convertHumanReadablePriceToRawPrice: (humanReadablePrice: number, quoteDecimals: number, baseDecimals: number) => bigint;
3
4
  export declare const parsePrice: (humanReadablePrice: number, quoteDecimals: number, baseDecimals: number) => {
4
5
  roundingDownTick: bigint;
5
6
  roundingUpTick: bigint;
@@ -1 +1 @@
1
- {"version":3,"file":"prices.d.ts","sourceRoot":"","sources":["../../../src/utils/prices.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAU5C,eAAO,MAAM,WAAW,UACf,MAAM,iBACE,MAAM,gBACP,MAAM,KACnB,MAMF,CAAA;AAED,eAAO,MAAM,UAAU,uBACD,MAAM,iBACX,MAAM,gBACP,MAAM,KACnB;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,cAAc,EAAE,MAAM,CAAA;CAsBvB,CAAA;AAED,eAAO,MAAM,cAAc,mEAKxB;IACD,mBAAmB,EAAE,QAAQ,CAAA;IAC7B,kBAAkB,EAAE,QAAQ,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,KAAG,MAgBH,CAAA"}
1
+ {"version":3,"file":"prices.d.ts","sourceRoot":"","sources":["../../../src/utils/prices.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAU5C,eAAO,MAAM,WAAW,UACf,MAAM,iBACE,MAAM,gBACP,MAAM,KACnB,MAMF,CAAA;AAED,eAAO,MAAM,mCAAmC,uBAC1B,MAAM,iBACX,MAAM,gBACP,MAAM,KACnB,MASF,CAAA;AAED,eAAO,MAAM,UAAU,uBACD,MAAM,iBACX,MAAM,gBACP,MAAM,KACnB;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,cAAc,EAAE,MAAM,CAAA;CAoBvB,CAAA;AAED,eAAO,MAAM,cAAc,mEAKxB;IACD,mBAAmB,EAAE,QAAQ,CAAA;IAC7B,kBAAkB,EAAE,QAAQ,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,KAAG,MAgBH,CAAA"}
@@ -1,7 +1,8 @@
1
1
  import { CHAIN_IDS } from './constants/chain';
2
- import type { ChartLog, Currency, DefaultOptions, Market } from './type';
2
+ import type { ChartLog, Currency, DefaultOptions, Market, Pool } from './type';
3
3
  import { CHART_LOG_INTERVALS } from './type';
4
- import { type OpenOrder } from './model/open-order';
4
+ import { OpenOrder } from './model/open-order';
5
+ import { StrategyPrice } from './model/strategy';
5
6
  /**
6
7
  * Get contract addresses by chain id
7
8
  * @param chainId - chain id from {@link CHAIN_IDS}
@@ -20,16 +21,33 @@ export declare const getContractAddresses: ({ chainId }: {
20
21
  Controller: `0x${string}`;
21
22
  BookManager: `0x${string}`;
22
23
  BookViewer: `0x${string}`;
24
+ Rebalancer: `0x${string}`;
25
+ Strategy: `0x${string}`;
26
+ Minter: `0x${string}`;
27
+ Operator: `0x${string}`;
23
28
  };
29
+ /**
30
+ * Get subgraph block number by chain id
31
+ * @param chainId - chain id from {@link CHAIN_IDS}
32
+ * @returns Contract addresses
33
+ *
34
+ * @example
35
+ * import { getContractAddresses } from '@clober/v2-sdk'
36
+ *
37
+ * const blockNumber = await getSubgraphBlockNumber({
38
+ * chainId: 421614,
39
+ * })
40
+ */
41
+ export declare const getSubgraphBlockNumber: ({ chainId, }: {
42
+ chainId: CHAIN_IDS;
43
+ }) => Promise<number>;
24
44
  /**
25
45
  * Get market information by chain id and token addresses
26
46
  * @param chainId - chain id from {@link CHAIN_IDS}
27
47
  * @param token0 - token0 address
28
48
  * @param token1 - token1 address
29
- * @param options
49
+ * @param options {@link DefaultOptions} options.
30
50
  * @param options.n - number of depth levels to fetch
31
- * @param options.rpcUrl - RPC URL of the blockchain
32
- * @param options.useSubgraph Whether to use the subgraph to fetch the market data.
33
51
  * @returns A market {@link Market}
34
52
  *
35
53
  * @example
@@ -49,6 +67,40 @@ export declare const getMarket: ({ chainId, token0, token1, options, }: {
49
67
  n?: number;
50
68
  } & DefaultOptions;
51
69
  }) => Promise<Market>;
70
+ /**
71
+ * Get pool information by chain id and token addresses
72
+ * @param chainId - chain id from {@link CHAIN_IDS}
73
+ * @param token0 - token0 address
74
+ * @param token1 - token1 address
75
+ * @param options {@link DefaultOptions} options.
76
+ * @param options.n - number of depth levels to fetch
77
+ * @returns A pool {@link Pool}
78
+ *
79
+ * @example
80
+ * import { getPool } from '@clober/v2-sdk'
81
+ *
82
+ * const market = await getPool({
83
+ * chainId: 421614,
84
+ * token0: '0x00bfd44e79fb7f6dd5887a9426c8ef85a0cd23e0',
85
+ * token1: '0x0000000000000000000000000000000000000000',
86
+ * })
87
+ */
88
+ export declare const getPool: ({ chainId, token0, token1, salt, options, }: {
89
+ chainId: CHAIN_IDS;
90
+ token0: `0x${string}`;
91
+ token1: `0x${string}`;
92
+ salt: `0x${string}`;
93
+ options?: {
94
+ n?: number;
95
+ } & DefaultOptions;
96
+ }) => Promise<Pool>;
97
+ export declare const getStrategyPrice: ({ chainId, token0, token1, salt, options, }: {
98
+ chainId: CHAIN_IDS;
99
+ token0: `0x${string}`;
100
+ token1: `0x${string}`;
101
+ salt: `0x${string}`;
102
+ options?: DefaultOptions;
103
+ }) => Promise<StrategyPrice>;
52
104
  /**
53
105
  * Calculates and returns the neighboring price ticks and their corresponding prices for a given input price.
54
106
  *
@@ -130,10 +182,10 @@ export declare const getPriceNeighborhood: ({ chainId, price, currency0, currenc
130
182
  * @param inputToken The address of the input token.
131
183
  * @param outputToken The address of the output token.
132
184
  * @param amountIn The amount of expected input amount. (ex 1.2 ETH -> 1.2)
133
- * @param options
134
- * @param options.limitPrice The maximum limit price to spend.
135
- * @param options.rpcUrl The RPC URL of the blockchain.
136
- * @param options.useSubgraph Whether to use the subgraph to fetch the market data.
185
+ * @param options {@link DefaultOptions} options.
186
+ * @param options.limitPrice The maximum limit price to take.
187
+ * @param options.roundingDownTakenBid Whether to round down the taken bid.
188
+ * @param options.roundingUpTakenAsk Whether to round up the taken ask.
137
189
  * @returns A Promise resolving to an object containing the taken amount, spend amount and result of the calculation.
138
190
  * @example
139
191
  * import { getExpectedOutput } from '@clober/v2-sdk'
@@ -172,9 +224,10 @@ export declare const getExpectedOutput: ({ chainId, inputToken, outputToken, amo
172
224
  * @param inputToken The address of the input token.
173
225
  * @param outputToken The address of the output token.
174
226
  * @param amountOut The amount of expected output amount. (ex 1.2 ETH -> 1.2)
175
- * @param options
227
+ * @param options {@link DefaultOptions} options.
176
228
  * @param options.limitPrice The maximum limit price to take.
177
- * @param options.rpcUrl The RPC URL of the blockchain.
229
+ * @param options.roundingDownTakenBid Whether to round down the taken bid.
230
+ * @param options.roundingUpTakenAsk Whether to round up the taken ask.
178
231
  * @param options.useSubgraph Whether to use the subgraph to fetch the market data.
179
232
  * @returns A Promise resolving to an object containing the taken amount, spent amount and result of the calculation.
180
233
  * @example
@@ -212,9 +265,7 @@ export declare const getExpectedInput: ({ chainId, inputToken, outputToken, amou
212
265
  *
213
266
  * @param {CHAIN_IDS} chainId The chain ID.
214
267
  * @param {string} id The ID of the open order.
215
- * @param options
216
- * @param options.rpcUrl The RPC URL of the blockchain.
217
- * @param options.useSubgraph Whether to use the subgraph to fetch the market data.
268
+ * @param options {@link DefaultOptions} options.
218
269
  * @returns {Promise<OpenOrder>} Promise resolving to the open order object, or undefined if not found.
219
270
  * @example
220
271
  * import { getOpenOrder } from '@clober/v2-sdk'
@@ -234,9 +285,7 @@ export declare const getOpenOrder: ({ chainId, id, options, }: {
234
285
  *
235
286
  * @param {CHAIN_IDS} chainId The chain ID.
236
287
  * @param {`0x${string}`} userAddress The Ethereum address of the user.
237
- * @param options
238
- * @param options.rpcUrl The RPC URL of the blockchain.
239
- * @param options.useSubgraph Whether to use the subgraph to fetch the market data.
288
+ * @param options {@link DefaultOptions} options.
240
289
  * @returns {Promise<OpenOrder[]>} Promise resolving to an array of open orders.
241
290
  * @example
242
291
  * import { getOpenOrders } from '@clober/v2-sdk'