wagmi 3.1.4 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/esm/exports/tempo.js +9 -0
  2. package/dist/esm/exports/tempo.js.map +1 -0
  3. package/dist/esm/tempo/hooks/amm.js +485 -0
  4. package/dist/esm/tempo/hooks/amm.js.map +1 -0
  5. package/dist/esm/tempo/hooks/dex.js +1020 -0
  6. package/dist/esm/tempo/hooks/dex.js.map +1 -0
  7. package/dist/esm/tempo/hooks/faucet.js +76 -0
  8. package/dist/esm/tempo/hooks/faucet.js.map +1 -0
  9. package/dist/esm/tempo/hooks/fee.js +155 -0
  10. package/dist/esm/tempo/hooks/fee.js.map +1 -0
  11. package/dist/esm/tempo/hooks/index.js +11 -0
  12. package/dist/esm/tempo/hooks/index.js.map +1 -0
  13. package/dist/esm/tempo/hooks/nonce.js +85 -0
  14. package/dist/esm/tempo/hooks/nonce.js.map +1 -0
  15. package/dist/esm/tempo/hooks/policy.js +545 -0
  16. package/dist/esm/tempo/hooks/policy.js.map +1 -0
  17. package/dist/esm/tempo/hooks/reward.js +385 -0
  18. package/dist/esm/tempo/hooks/reward.js.map +1 -0
  19. package/dist/esm/tempo/hooks/token.js +1730 -0
  20. package/dist/esm/tempo/hooks/token.js.map +1 -0
  21. package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
  22. package/dist/esm/version.js +1 -1
  23. package/dist/types/exports/tempo.d.ts +4 -0
  24. package/dist/types/exports/tempo.d.ts.map +1 -0
  25. package/dist/types/tempo/hooks/amm.d.ts +384 -0
  26. package/dist/types/tempo/hooks/amm.d.ts.map +1 -0
  27. package/dist/types/tempo/hooks/dex.d.ts +841 -0
  28. package/dist/types/tempo/hooks/dex.d.ts.map +1 -0
  29. package/dist/types/tempo/hooks/faucet.d.ts +70 -0
  30. package/dist/types/tempo/hooks/faucet.d.ts.map +1 -0
  31. package/dist/types/tempo/hooks/fee.d.ts +123 -0
  32. package/dist/types/tempo/hooks/fee.d.ts.map +1 -0
  33. package/dist/types/tempo/hooks/index.d.ts +10 -0
  34. package/dist/types/tempo/hooks/index.d.ts.map +1 -0
  35. package/dist/types/tempo/hooks/nonce.d.ts +60 -0
  36. package/dist/types/tempo/hooks/nonce.d.ts.map +1 -0
  37. package/dist/types/tempo/hooks/policy.d.ts +422 -0
  38. package/dist/types/tempo/hooks/policy.d.ts.map +1 -0
  39. package/dist/types/tempo/hooks/reward.d.ts +304 -0
  40. package/dist/types/tempo/hooks/reward.d.ts.map +1 -0
  41. package/dist/types/tempo/hooks/token.d.ts +1387 -0
  42. package/dist/types/tempo/hooks/token.d.ts.map +1 -0
  43. package/dist/types/version.d.ts +1 -1
  44. package/package.json +12 -4
  45. package/src/exports/tempo.ts +17 -0
  46. package/src/tempo/hooks/amm.ts +776 -0
  47. package/src/tempo/hooks/dex.ts +1737 -0
  48. package/src/tempo/hooks/faucet.ts +142 -0
  49. package/src/tempo/hooks/fee.ts +264 -0
  50. package/src/tempo/hooks/index.ts +10 -0
  51. package/src/tempo/hooks/nonce.ts +126 -0
  52. package/src/tempo/hooks/policy.ts +907 -0
  53. package/src/tempo/hooks/reward.ts +668 -0
  54. package/src/tempo/hooks/token.ts +2979 -0
  55. package/src/version.ts +1 -1
  56. package/tempo/package.json +5 -0
@@ -0,0 +1,841 @@
1
+ import type { UseMutationResult } from '@tanstack/react-query';
2
+ import type { Config, ResolvedRegister } from '@wagmi/core';
3
+ import type { ExactPartial, UnionCompute } from '@wagmi/core/internal';
4
+ import { Actions } from '@wagmi/core/tempo';
5
+ import type { ConfigParameter, QueryParameter } from '../../types/properties.js';
6
+ import { type UseMutationParameters, type UseQueryReturnType } from '../../utils/query.js';
7
+ /**
8
+ * Hook for buying a specific amount of tokens.
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * import { Hooks } from 'wagmi/tempo'
13
+ *
14
+ * function App() {
15
+ * const { mutate, isPending } = Hooks.dex.useBuy()
16
+ *
17
+ * return (
18
+ * <button
19
+ * onClick={() => mutate({
20
+ * tokenIn: '0x20c...11',
21
+ * tokenOut: '0x20c...20',
22
+ * amountOut: parseUnits('100', 6),
23
+ * maxAmountIn: parseUnits('105', 6),
24
+ * })}
25
+ * disabled={isPending}
26
+ * >
27
+ * Buy Tokens
28
+ * </button>
29
+ * )
30
+ * }
31
+ * ```
32
+ *
33
+ * @param parameters - Parameters.
34
+ * @returns Mutation result.
35
+ */
36
+ export declare function useBuy<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useBuy.Parameters<config, context>): useBuy.ReturnType<config, context>;
37
+ export declare namespace useBuy {
38
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
39
+ mutation?: UseMutationParameters<Actions.dex.buy.ReturnValue, Actions.dex.buy.ErrorType, Actions.dex.buy.Parameters<config>, context> | undefined;
40
+ };
41
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.buy.ReturnValue, Actions.dex.buy.ErrorType, Actions.dex.buy.Parameters<config>, context>;
42
+ }
43
+ /**
44
+ * Hook for buying a specific amount of tokens.
45
+ *
46
+ * Note: This is a synchronous hook that waits for the transaction
47
+ * to be included on a block before returning a response.
48
+ *
49
+ * @example
50
+ * ```tsx
51
+ * import { Hooks } from 'wagmi/tempo'
52
+ *
53
+ * function App() {
54
+ * const { mutate, isPending } = Hooks.dex.useBuySync()
55
+ *
56
+ * return (
57
+ * <button
58
+ * onClick={() => mutate({
59
+ * tokenIn: '0x20c...11',
60
+ * tokenOut: '0x20c...20',
61
+ * amountOut: parseUnits('100', 6),
62
+ * maxAmountIn: parseUnits('105', 6),
63
+ * })}
64
+ * disabled={isPending}
65
+ * >
66
+ * Buy Tokens
67
+ * </button>
68
+ * )
69
+ * }
70
+ * ```
71
+ *
72
+ * @param parameters - Parameters.
73
+ * @returns Mutation result.
74
+ */
75
+ export declare function useBuySync<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useBuySync.Parameters<config, context>): useBuySync.ReturnType<config, context>;
76
+ export declare namespace useBuySync {
77
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
78
+ mutation?: UseMutationParameters<Actions.dex.buySync.ReturnValue, Actions.dex.buySync.ErrorType, Actions.dex.buySync.Parameters<config>, context> | undefined;
79
+ };
80
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.buySync.ReturnValue, Actions.dex.buySync.ErrorType, Actions.dex.buySync.Parameters<config>, context>;
81
+ }
82
+ /**
83
+ * Hook for canceling an order from the orderbook.
84
+ *
85
+ * @example
86
+ * ```tsx
87
+ * import { Hooks } from 'wagmi/tempo'
88
+ *
89
+ * function App() {
90
+ * const { mutate, isPending } = Hooks.dex.useCancel()
91
+ *
92
+ * return (
93
+ * <button
94
+ * onClick={() => mutate({ orderId: 123n })}
95
+ * disabled={isPending}
96
+ * >
97
+ * Cancel Order
98
+ * </button>
99
+ * )
100
+ * }
101
+ * ```
102
+ *
103
+ * @param parameters - Parameters.
104
+ * @returns Mutation result.
105
+ */
106
+ export declare function useCancel<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useCancel.Parameters<config, context>): useCancel.ReturnType<config, context>;
107
+ export declare namespace useCancel {
108
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
109
+ mutation?: UseMutationParameters<Actions.dex.cancel.ReturnValue, Actions.dex.cancel.ErrorType, Actions.dex.cancel.Parameters<config>, context> | undefined;
110
+ };
111
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.cancel.ReturnValue, Actions.dex.cancel.ErrorType, Actions.dex.cancel.Parameters<config>, context>;
112
+ }
113
+ /**
114
+ * Hook for canceling an order from the orderbook.
115
+ *
116
+ * Note: This is a synchronous hook that waits for the transaction
117
+ * to be included on a block before returning a response.
118
+ *
119
+ * @example
120
+ * ```tsx
121
+ * import { Hooks } from 'wagmi/tempo'
122
+ *
123
+ * function App() {
124
+ * const { mutate, isPending } = Hooks.dex.useCancelSync()
125
+ *
126
+ * return (
127
+ * <button
128
+ * onClick={() => mutate({ orderId: 123n })}
129
+ * disabled={isPending}
130
+ * >
131
+ * Cancel Order
132
+ * </button>
133
+ * )
134
+ * }
135
+ * ```
136
+ *
137
+ * @param parameters - Parameters.
138
+ * @returns Mutation result.
139
+ */
140
+ export declare function useCancelSync<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useCancelSync.Parameters<config, context>): useCancelSync.ReturnType<config, context>;
141
+ export declare namespace useCancelSync {
142
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
143
+ mutation?: UseMutationParameters<Actions.dex.cancelSync.ReturnValue, Actions.dex.cancelSync.ErrorType, Actions.dex.cancelSync.Parameters<config>, context> | undefined;
144
+ };
145
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.cancelSync.ReturnValue, Actions.dex.cancelSync.ErrorType, Actions.dex.cancelSync.Parameters<config>, context>;
146
+ }
147
+ /**
148
+ * Hook for cancelling a stale order from the orderbook.
149
+ *
150
+ * A stale order is one where the owner's balance or allowance has dropped
151
+ * below the order amount.
152
+ *
153
+ * @example
154
+ * ```tsx
155
+ * import { Hooks } from 'wagmi/tempo'
156
+ *
157
+ * function App() {
158
+ * const { mutate, isPending } = Hooks.dex.useCancelStale()
159
+ *
160
+ * return (
161
+ * <button
162
+ * onClick={() => mutate({ orderId: 123n })}
163
+ * disabled={isPending}
164
+ * >
165
+ * Cancel Stale Order
166
+ * </button>
167
+ * )
168
+ * }
169
+ * ```
170
+ *
171
+ * @param parameters - Parameters.
172
+ * @returns Mutation result.
173
+ */
174
+ export declare function useCancelStale<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useCancelStale.Parameters<config, context>): useCancelStale.ReturnType<config, context>;
175
+ export declare namespace useCancelStale {
176
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
177
+ mutation?: UseMutationParameters<Actions.dex.cancelStale.ReturnValue, Actions.dex.cancelStale.ErrorType, Actions.dex.cancelStale.Parameters<config>, context> | undefined;
178
+ };
179
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.cancelStale.ReturnValue, Actions.dex.cancelStale.ErrorType, Actions.dex.cancelStale.Parameters<config>, context>;
180
+ }
181
+ /**
182
+ * Hook for cancelling a stale order and waiting for confirmation.
183
+ *
184
+ * A stale order is one where the owner's balance or allowance has dropped
185
+ * below the order amount.
186
+ *
187
+ * @example
188
+ * ```tsx
189
+ * import { Hooks } from 'wagmi/tempo'
190
+ *
191
+ * function App() {
192
+ * const { mutate, isPending } = Hooks.dex.useCancelStaleSync()
193
+ *
194
+ * return (
195
+ * <button
196
+ * onClick={() => mutate({ orderId: 123n })}
197
+ * disabled={isPending}
198
+ * >
199
+ * Cancel Stale Order
200
+ * </button>
201
+ * )
202
+ * }
203
+ * ```
204
+ *
205
+ * @param parameters - Parameters.
206
+ * @returns Mutation result.
207
+ */
208
+ export declare function useCancelStaleSync<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useCancelStaleSync.Parameters<config, context>): useCancelStaleSync.ReturnType<config, context>;
209
+ export declare namespace useCancelStaleSync {
210
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
211
+ mutation?: UseMutationParameters<Actions.dex.cancelStaleSync.ReturnValue, Actions.dex.cancelStaleSync.ErrorType, Actions.dex.cancelStaleSync.Parameters<config>, context> | undefined;
212
+ };
213
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.cancelStaleSync.ReturnValue, Actions.dex.cancelStaleSync.ErrorType, Actions.dex.cancelStaleSync.Parameters<config>, context>;
214
+ }
215
+ /**
216
+ * Hook for creating a new trading pair on the DEX.
217
+ *
218
+ * @example
219
+ * ```tsx
220
+ * import { Hooks } from 'wagmi/tempo'
221
+ *
222
+ * function App() {
223
+ * const { mutate, isPending } = Hooks.dex.useCreatePair()
224
+ *
225
+ * return (
226
+ * <button
227
+ * onClick={() => mutate({ base: '0x20c...11' })}
228
+ * disabled={isPending}
229
+ * >
230
+ * Create Pair
231
+ * </button>
232
+ * )
233
+ * }
234
+ * ```
235
+ *
236
+ * @param parameters - Parameters.
237
+ * @returns Mutation result.
238
+ */
239
+ export declare function useCreatePair<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useCreatePair.Parameters<config, context>): useCreatePair.ReturnType<config, context>;
240
+ export declare namespace useCreatePair {
241
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
242
+ mutation?: UseMutationParameters<Actions.dex.createPair.ReturnValue, Actions.dex.createPair.ErrorType, Actions.dex.createPair.Parameters<config>, context> | undefined;
243
+ };
244
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.createPair.ReturnValue, Actions.dex.createPair.ErrorType, Actions.dex.createPair.Parameters<config>, context>;
245
+ }
246
+ /**
247
+ * Hook for creating a new trading pair on the DEX.
248
+ *
249
+ * Note: This is a synchronous hook that waits for the transaction
250
+ * to be included on a block before returning a response.
251
+ *
252
+ * @example
253
+ * ```tsx
254
+ * import { Hooks } from 'wagmi/tempo'
255
+ *
256
+ * function App() {
257
+ * const { mutate, isPending } = Hooks.dex.useCreatePairSync()
258
+ *
259
+ * return (
260
+ * <button
261
+ * onClick={() => mutate({ base: '0x20c...11' })}
262
+ * disabled={isPending}
263
+ * >
264
+ * Create Pair
265
+ * </button>
266
+ * )
267
+ * }
268
+ * ```
269
+ *
270
+ * @param parameters - Parameters.
271
+ * @returns Mutation result.
272
+ */
273
+ export declare function useCreatePairSync<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useCreatePairSync.Parameters<config, context>): useCreatePairSync.ReturnType<config, context>;
274
+ export declare namespace useCreatePairSync {
275
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
276
+ mutation?: UseMutationParameters<Actions.dex.createPairSync.ReturnValue, Actions.dex.createPairSync.ErrorType, Actions.dex.createPairSync.Parameters<config>, context> | undefined;
277
+ };
278
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.createPairSync.ReturnValue, Actions.dex.createPairSync.ErrorType, Actions.dex.createPairSync.Parameters<config>, context>;
279
+ }
280
+ /**
281
+ * Hook for getting a user's token balance on the DEX.
282
+ *
283
+ * @example
284
+ * ```tsx
285
+ * import { Hooks } from 'wagmi/tempo'
286
+ *
287
+ * function App() {
288
+ * const { data, isLoading } = Hooks.dex.useBalance({
289
+ * account: '0x...',
290
+ * token: '0x20c...11',
291
+ * })
292
+ *
293
+ * if (isLoading) return <div>Loading...</div>
294
+ * return <div>Balance: {data}</div>
295
+ * }
296
+ * ```
297
+ *
298
+ * @param parameters - Parameters.
299
+ * @returns Query result with the user's token balance on the DEX.
300
+ */
301
+ export declare function useBalance<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getBalance.ReturnValue>(parameters: useBalance.Parameters<config, selectData>): useBalance.ReturnValue<selectData>;
302
+ export declare namespace useBalance {
303
+ type Parameters<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getBalance.ReturnValue> = ConfigParameter<config> & QueryParameter<Actions.dex.getBalance.ReturnValue, Actions.dex.getBalance.ErrorType, selectData, Actions.dex.getBalance.QueryKey<config>> & Omit<Actions.dex.getBalance.queryOptions.Parameters<config, selectData>, 'query'>;
304
+ type ReturnValue<selectData = Actions.dex.getBalance.ReturnValue> = UseQueryReturnType<selectData, Error>;
305
+ }
306
+ /**
307
+ * Hook for getting the quote for buying a specific amount of tokens.
308
+ *
309
+ * @example
310
+ * ```tsx
311
+ * import { Hooks } from 'wagmi/tempo'
312
+ *
313
+ * function App() {
314
+ * const { data, isLoading } = Hooks.dex.useBuyQuote({
315
+ * amountOut: parseUnits('100', 6),
316
+ * tokenIn: '0x20c...11',
317
+ * tokenOut: '0x20c...20',
318
+ * })
319
+ *
320
+ * if (isLoading) return <div>Loading...</div>
321
+ * return <div>Required Input: {data}</div>
322
+ * }
323
+ * ```
324
+ *
325
+ * @param parameters - Parameters.
326
+ * @returns Query result with the amount of tokenIn needed.
327
+ */
328
+ export declare function useBuyQuote<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getBuyQuote.ReturnValue>(parameters: useBuyQuote.Parameters<config, selectData>): useBuyQuote.ReturnValue<selectData>;
329
+ export declare namespace useBuyQuote {
330
+ type Parameters<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getBuyQuote.ReturnValue> = ConfigParameter<config> & QueryParameter<Actions.dex.getBuyQuote.ReturnValue, Actions.dex.getBuyQuote.ErrorType, selectData, Actions.dex.getBuyQuote.QueryKey<config>> & Omit<Actions.dex.getBuyQuote.queryOptions.Parameters<config, selectData>, 'query'>;
331
+ type ReturnValue<selectData = Actions.dex.getBuyQuote.ReturnValue> = UseQueryReturnType<selectData, Error>;
332
+ }
333
+ /**
334
+ * Hook for getting an order's details from the orderbook.
335
+ *
336
+ * @example
337
+ * ```tsx
338
+ * import { Hooks } from 'wagmi/tempo'
339
+ *
340
+ * function App() {
341
+ * const { data, isLoading } = Hooks.dex.useOrder({
342
+ * orderId: 123n,
343
+ * })
344
+ *
345
+ * if (isLoading) return <div>Loading...</div>
346
+ * return <div>Order: {JSON.stringify(data)}</div>
347
+ * }
348
+ * ```
349
+ *
350
+ * @param parameters - Parameters.
351
+ * @returns Query result with the order details.
352
+ */
353
+ export declare function useOrder<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getOrder.ReturnValue>(parameters: useOrder.Parameters<config, selectData>): useOrder.ReturnValue<selectData>;
354
+ export declare namespace useOrder {
355
+ type Parameters<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getOrder.ReturnValue> = ConfigParameter<config> & QueryParameter<Actions.dex.getOrder.ReturnValue, Actions.dex.getOrder.ErrorType, selectData, Actions.dex.getOrder.QueryKey<config>> & Omit<Actions.dex.getOrder.queryOptions.Parameters<config, selectData>, 'query'>;
356
+ type ReturnValue<selectData = Actions.dex.getOrder.ReturnValue> = UseQueryReturnType<selectData, Error>;
357
+ }
358
+ /**
359
+ * Hook for getting orderbook information for a trading pair.
360
+ *
361
+ * @example
362
+ * ```tsx
363
+ * import { Hooks } from 'wagmi/tempo'
364
+ *
365
+ * function App() {
366
+ * const { data, isLoading } = Hooks.dex.useOrderbook({
367
+ * base: '0x20c...11',
368
+ * quote: '0x20c...20',
369
+ * })
370
+ *
371
+ * if (isLoading) return <div>Loading...</div>
372
+ * return <div>Orderbook: {JSON.stringify(data)}</div>
373
+ * }
374
+ * ```
375
+ *
376
+ * @param parameters - Parameters.
377
+ * @returns Query result with the orderbook information.
378
+ */
379
+ export declare function useOrderbook<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getOrderbook.ReturnValue>(parameters: useOrderbook.Parameters<config, selectData>): useOrderbook.ReturnValue<selectData>;
380
+ export declare namespace useOrderbook {
381
+ type Parameters<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getOrderbook.ReturnValue> = ConfigParameter<config> & QueryParameter<Actions.dex.getOrderbook.ReturnValue, Actions.dex.getOrderbook.ErrorType, selectData, Actions.dex.getOrderbook.QueryKey<config>> & Omit<Actions.dex.getOrderbook.queryOptions.Parameters<config, selectData>, 'query'>;
382
+ type ReturnValue<selectData = Actions.dex.getOrderbook.ReturnValue> = UseQueryReturnType<selectData, Error>;
383
+ }
384
+ /**
385
+ * Hook for getting the tick level information at a specific tick.
386
+ *
387
+ * @example
388
+ * ```tsx
389
+ * import { Hooks } from 'wagmi/tempo'
390
+ * import { Tick } from 'viem/tempo'
391
+ *
392
+ * function App() {
393
+ * const { data, isLoading } = Hooks.dex.useTickLevel({
394
+ * base: '0x20c...11',
395
+ * tick: Tick.fromPrice('1.001'),
396
+ * isBid: true,
397
+ * })
398
+ *
399
+ * if (isLoading) return <div>Loading...</div>
400
+ * return <div>Tick Level: {JSON.stringify(data)}</div>
401
+ * }
402
+ * ```
403
+ *
404
+ * @param parameters - Parameters.
405
+ * @returns Query result with the tick level information.
406
+ */
407
+ export declare function useTickLevel<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getTickLevel.ReturnValue>(parameters: useTickLevel.Parameters<config, selectData>): useTickLevel.ReturnValue<selectData>;
408
+ export declare namespace useTickLevel {
409
+ type Parameters<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getTickLevel.ReturnValue> = ConfigParameter<config> & QueryParameter<Actions.dex.getTickLevel.ReturnValue, Actions.dex.getTickLevel.ErrorType, selectData, Actions.dex.getTickLevel.QueryKey<config>> & Omit<Actions.dex.getTickLevel.queryOptions.Parameters<config, selectData>, 'query'>;
410
+ type ReturnValue<selectData = Actions.dex.getTickLevel.ReturnValue> = UseQueryReturnType<selectData, Error>;
411
+ }
412
+ /**
413
+ * Hook for getting the quote for selling a specific amount of tokens.
414
+ *
415
+ * @example
416
+ * ```tsx
417
+ * import { Hooks } from 'wagmi/tempo'
418
+ *
419
+ * function App() {
420
+ * const { data, isLoading } = Hooks.dex.useSellQuote({
421
+ * amountIn: parseUnits('100', 6),
422
+ * tokenIn: '0x20c...11',
423
+ * tokenOut: '0x20c...20',
424
+ * })
425
+ *
426
+ * if (isLoading) return <div>Loading...</div>
427
+ * return <div>Expected Output: {data}</div>
428
+ * }
429
+ * ```
430
+ *
431
+ * @param parameters - Parameters.
432
+ * @returns Query result with the amount of tokenOut received.
433
+ */
434
+ export declare function useSellQuote<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getSellQuote.ReturnValue>(parameters: useSellQuote.Parameters<config, selectData>): useSellQuote.ReturnValue<selectData>;
435
+ export declare namespace useSellQuote {
436
+ type Parameters<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getSellQuote.ReturnValue> = ConfigParameter<config> & QueryParameter<Actions.dex.getSellQuote.ReturnValue, Actions.dex.getSellQuote.ErrorType, selectData, Actions.dex.getSellQuote.QueryKey<config>> & Omit<Actions.dex.getSellQuote.queryOptions.Parameters<config, selectData>, 'query'>;
437
+ type ReturnValue<selectData = Actions.dex.getSellQuote.ReturnValue> = UseQueryReturnType<selectData, Error>;
438
+ }
439
+ /**
440
+ * Hook for placing a limit order on the orderbook.
441
+ *
442
+ * @example
443
+ * ```tsx
444
+ * import { Hooks } from 'wagmi/tempo'
445
+ *
446
+ * function App() {
447
+ * const { mutate, isPending } = Hooks.dex.usePlace()
448
+ *
449
+ * return (
450
+ * <button
451
+ * onClick={() => mutate({
452
+ * amount: parseUnits('100', 6),
453
+ * tick: Tick.fromPrice('0.99'),
454
+ * token: '0x20c...11',
455
+ * type: 'buy',
456
+ * })}
457
+ * disabled={isPending}
458
+ * >
459
+ * Place Order
460
+ * </button>
461
+ * )
462
+ * }
463
+ * ```
464
+ *
465
+ * @param parameters - Parameters.
466
+ * @returns Mutation result.
467
+ */
468
+ export declare function usePlace<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: usePlace.Parameters<config, context>): usePlace.ReturnType<config, context>;
469
+ export declare namespace usePlace {
470
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
471
+ mutation?: UseMutationParameters<Actions.dex.place.ReturnValue, Actions.dex.place.ErrorType, Actions.dex.place.Parameters<config>, context> | undefined;
472
+ };
473
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.place.ReturnValue, Actions.dex.place.ErrorType, Actions.dex.place.Parameters<config>, context>;
474
+ }
475
+ /**
476
+ * Hook for placing a flip order that automatically flips when filled.
477
+ *
478
+ * @example
479
+ * ```tsx
480
+ * import { Hooks } from 'wagmi/tempo'
481
+ *
482
+ * function App() {
483
+ * const { mutate, isPending } = Hooks.dex.usePlaceFlip()
484
+ *
485
+ * return (
486
+ * <button
487
+ * onClick={() => mutate({
488
+ * amount: parseUnits('100', 6),
489
+ * flipTick: Tick.fromPrice('1.01'),
490
+ * tick: Tick.fromPrice('0.99'),
491
+ * token: '0x20c...11',
492
+ * type: 'buy',
493
+ * })}
494
+ * disabled={isPending}
495
+ * >
496
+ * Place Flip Order
497
+ * </button>
498
+ * )
499
+ * }
500
+ * ```
501
+ *
502
+ * @param parameters - Parameters.
503
+ * @returns Mutation result.
504
+ */
505
+ export declare function usePlaceFlip<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: usePlaceFlip.Parameters<config, context>): usePlaceFlip.ReturnType<config, context>;
506
+ export declare namespace usePlaceFlip {
507
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
508
+ mutation?: UseMutationParameters<Actions.dex.placeFlip.ReturnValue, Actions.dex.placeFlip.ErrorType, Actions.dex.placeFlip.Parameters<config>, context> | undefined;
509
+ };
510
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.placeFlip.ReturnValue, Actions.dex.placeFlip.ErrorType, Actions.dex.placeFlip.Parameters<config>, context>;
511
+ }
512
+ /**
513
+ * Hook for placing a flip order that automatically flips when filled.
514
+ *
515
+ * Note: This is a synchronous hook that waits for the transaction
516
+ * to be included on a block before returning a response.
517
+ *
518
+ * @example
519
+ * ```tsx
520
+ * import { Hooks } from 'wagmi/tempo'
521
+ *
522
+ * function App() {
523
+ * const { mutate, isPending } = Hooks.dex.usePlaceFlipSync()
524
+ *
525
+ * return (
526
+ * <button
527
+ * onClick={() => mutate({
528
+ * amount: parseUnits('100', 6),
529
+ * flipTick: Tick.fromPrice('1.01'),
530
+ * tick: Tick.fromPrice('0.99'),
531
+ * token: '0x20c...11',
532
+ * type: 'buy',
533
+ * })}
534
+ * disabled={isPending}
535
+ * >
536
+ * Place Flip Order
537
+ * </button>
538
+ * )
539
+ * }
540
+ * ```
541
+ *
542
+ * @param parameters - Parameters.
543
+ * @returns Mutation result.
544
+ */
545
+ export declare function usePlaceFlipSync<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: usePlaceFlipSync.Parameters<config, context>): usePlaceFlipSync.ReturnType<config, context>;
546
+ export declare namespace usePlaceFlipSync {
547
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
548
+ mutation?: UseMutationParameters<Actions.dex.placeFlipSync.ReturnValue, Actions.dex.placeFlipSync.ErrorType, Actions.dex.placeFlipSync.Parameters<config>, context> | undefined;
549
+ };
550
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.placeFlipSync.ReturnValue, Actions.dex.placeFlipSync.ErrorType, Actions.dex.placeFlipSync.Parameters<config>, context>;
551
+ }
552
+ /**
553
+ * Hook for placing a limit order on the orderbook.
554
+ *
555
+ * Note: This is a synchronous hook that waits for the transaction
556
+ * to be included on a block before returning a response.
557
+ *
558
+ * @example
559
+ * ```tsx
560
+ * import { Hooks } from 'wagmi/tempo'
561
+ *
562
+ * function App() {
563
+ * const { mutate, isPending } = Hooks.dex.usePlaceSync()
564
+ *
565
+ * return (
566
+ * <button
567
+ * onClick={() => mutate({
568
+ * amount: parseUnits('100', 6),
569
+ * tick: Tick.fromPrice('0.99'),
570
+ * token: '0x20c...11',
571
+ * type: 'buy',
572
+ * })}
573
+ * disabled={isPending}
574
+ * >
575
+ * Place Order
576
+ * </button>
577
+ * )
578
+ * }
579
+ * ```
580
+ *
581
+ * @param parameters - Parameters.
582
+ * @returns Mutation result.
583
+ */
584
+ export declare function usePlaceSync<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: usePlaceSync.Parameters<config, context>): usePlaceSync.ReturnType<config, context>;
585
+ export declare namespace usePlaceSync {
586
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
587
+ mutation?: UseMutationParameters<Actions.dex.placeSync.ReturnValue, Actions.dex.placeSync.ErrorType, Actions.dex.placeSync.Parameters<config>, context> | undefined;
588
+ };
589
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.placeSync.ReturnValue, Actions.dex.placeSync.ErrorType, Actions.dex.placeSync.Parameters<config>, context>;
590
+ }
591
+ /**
592
+ * Hook for selling a specific amount of tokens.
593
+ *
594
+ * @example
595
+ * ```tsx
596
+ * import { Hooks } from 'wagmi/tempo'
597
+ *
598
+ * function App() {
599
+ * const { mutate, isPending } = Hooks.dex.useSell()
600
+ *
601
+ * return (
602
+ * <button
603
+ * onClick={() => mutate({
604
+ * amountIn: parseUnits('100', 6),
605
+ * minAmountOut: parseUnits('95', 6),
606
+ * tokenIn: '0x20c...11',
607
+ * tokenOut: '0x20c...20',
608
+ * })}
609
+ * disabled={isPending}
610
+ * >
611
+ * Sell Tokens
612
+ * </button>
613
+ * )
614
+ * }
615
+ * ```
616
+ *
617
+ * @param parameters - Parameters.
618
+ * @returns Mutation result.
619
+ */
620
+ export declare function useSell<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useSell.Parameters<config, context>): useSell.ReturnType<config, context>;
621
+ export declare namespace useSell {
622
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
623
+ mutation?: UseMutationParameters<Actions.dex.sell.ReturnValue, Actions.dex.sell.ErrorType, Actions.dex.sell.Parameters<config>, context> | undefined;
624
+ };
625
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.sell.ReturnValue, Actions.dex.sell.ErrorType, Actions.dex.sell.Parameters<config>, context>;
626
+ }
627
+ /**
628
+ * Hook for selling a specific amount of tokens.
629
+ *
630
+ * Note: This is a synchronous hook that waits for the transaction
631
+ * to be included on a block before returning a response.
632
+ *
633
+ * @example
634
+ * ```tsx
635
+ * import { Hooks } from 'wagmi/tempo'
636
+ *
637
+ * function App() {
638
+ * const { mutate, isPending } = Hooks.dex.useSellSync()
639
+ *
640
+ * return (
641
+ * <button
642
+ * onClick={() => mutate({
643
+ * amountIn: parseUnits('100', 6),
644
+ * minAmountOut: parseUnits('95', 6),
645
+ * tokenIn: '0x20c...11',
646
+ * tokenOut: '0x20c...20',
647
+ * })}
648
+ * disabled={isPending}
649
+ * >
650
+ * Sell Tokens
651
+ * </button>
652
+ * )
653
+ * }
654
+ * ```
655
+ *
656
+ * @param parameters - Parameters.
657
+ * @returns Mutation result.
658
+ */
659
+ export declare function useSellSync<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useSellSync.Parameters<config, context>): useSellSync.ReturnType<config, context>;
660
+ export declare namespace useSellSync {
661
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
662
+ mutation?: UseMutationParameters<Actions.dex.sellSync.ReturnValue, Actions.dex.sellSync.ErrorType, Actions.dex.sellSync.Parameters<config>, context> | undefined;
663
+ };
664
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.sellSync.ReturnValue, Actions.dex.sellSync.ErrorType, Actions.dex.sellSync.Parameters<config>, context>;
665
+ }
666
+ /**
667
+ * Hook for withdrawing tokens from the DEX to the caller's wallet.
668
+ *
669
+ * @example
670
+ * ```tsx
671
+ * import { Hooks } from 'wagmi/tempo'
672
+ *
673
+ * function App() {
674
+ * const { mutate, isPending } = Hooks.dex.useWithdraw()
675
+ *
676
+ * return (
677
+ * <button
678
+ * onClick={() => mutate({
679
+ * amount: 100n,
680
+ * token: '0x20c...11',
681
+ * })}
682
+ * disabled={isPending}
683
+ * >
684
+ * Withdraw
685
+ * </button>
686
+ * )
687
+ * }
688
+ * ```
689
+ *
690
+ * @param parameters - Parameters.
691
+ * @returns Mutation result.
692
+ */
693
+ export declare function useWithdraw<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useWithdraw.Parameters<config, context>): useWithdraw.ReturnType<config, context>;
694
+ export declare namespace useWithdraw {
695
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
696
+ mutation?: UseMutationParameters<Actions.dex.withdraw.ReturnValue, Actions.dex.withdraw.ErrorType, Actions.dex.withdraw.Parameters<config>, context> | undefined;
697
+ };
698
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.withdraw.ReturnValue, Actions.dex.withdraw.ErrorType, Actions.dex.withdraw.Parameters<config>, context>;
699
+ }
700
+ /**
701
+ * Hook for withdrawing tokens from the DEX to the caller's wallet.
702
+ *
703
+ * Note: This is a synchronous hook that waits for the transaction
704
+ * to be included on a block before returning a response.
705
+ *
706
+ * @example
707
+ * ```tsx
708
+ * import { Hooks } from 'wagmi/tempo'
709
+ *
710
+ * function App() {
711
+ * const { mutate, isPending } = Hooks.dex.useWithdrawSync()
712
+ *
713
+ * return (
714
+ * <button
715
+ * onClick={() => mutate({
716
+ * amount: 100n,
717
+ * token: '0x20c...11',
718
+ * })}
719
+ * disabled={isPending}
720
+ * >
721
+ * Withdraw
722
+ * </button>
723
+ * )
724
+ * }
725
+ * ```
726
+ *
727
+ * @param parameters - Parameters.
728
+ * @returns Mutation result.
729
+ */
730
+ export declare function useWithdrawSync<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useWithdrawSync.Parameters<config, context>): useWithdrawSync.ReturnType<config, context>;
731
+ export declare namespace useWithdrawSync {
732
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
733
+ mutation?: UseMutationParameters<Actions.dex.withdrawSync.ReturnValue, Actions.dex.withdrawSync.ErrorType, Actions.dex.withdrawSync.Parameters<config>, context> | undefined;
734
+ };
735
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.withdrawSync.ReturnValue, Actions.dex.withdrawSync.ErrorType, Actions.dex.withdrawSync.Parameters<config>, context>;
736
+ }
737
+ /**
738
+ * Hook for watching flip order placement events on the DEX.
739
+ *
740
+ * @example
741
+ * ```tsx
742
+ * import { Hooks } from 'wagmi/tempo'
743
+ *
744
+ * function App() {
745
+ * Hooks.dex.useWatchFlipOrderPlaced({
746
+ * onFlipOrderPlaced(args) {
747
+ * console.log('Flip order placed:', args)
748
+ * },
749
+ * })
750
+ *
751
+ * return <div>Watching for flip order placements...</div>
752
+ * }
753
+ * ```
754
+ *
755
+ * @param parameters - Parameters.
756
+ */
757
+ export declare function useWatchFlipOrderPlaced<config extends Config = ResolvedRegister['config']>(parameters?: useWatchFlipOrderPlaced.Parameters<config>): void;
758
+ export declare namespace useWatchFlipOrderPlaced {
759
+ type Parameters<config extends Config = Config> = UnionCompute<ExactPartial<Actions.dex.watchFlipOrderPlaced.Parameters<config>> & ConfigParameter<config> & {
760
+ enabled?: boolean | undefined;
761
+ }>;
762
+ }
763
+ /**
764
+ * Hook for watching order cancellation events on the DEX.
765
+ *
766
+ * @example
767
+ * ```tsx
768
+ * import { Hooks } from 'wagmi/tempo'
769
+ *
770
+ * function App() {
771
+ * Hooks.dex.useWatchOrderCancelled({
772
+ * onOrderCancelled(args) {
773
+ * console.log('Order cancelled:', args)
774
+ * },
775
+ * })
776
+ *
777
+ * return <div>Watching for order cancellations...</div>
778
+ * }
779
+ * ```
780
+ *
781
+ * @param parameters - Parameters.
782
+ */
783
+ export declare function useWatchOrderCancelled<config extends Config = ResolvedRegister['config']>(parameters?: useWatchOrderCancelled.Parameters<config>): void;
784
+ export declare namespace useWatchOrderCancelled {
785
+ type Parameters<config extends Config = Config> = UnionCompute<ExactPartial<Actions.dex.watchOrderCancelled.Parameters<config>> & ConfigParameter<config> & {
786
+ enabled?: boolean | undefined;
787
+ }>;
788
+ }
789
+ /**
790
+ * Hook for watching order filled events on the DEX.
791
+ *
792
+ * @example
793
+ * ```tsx
794
+ * import { Hooks } from 'wagmi/tempo'
795
+ *
796
+ * function App() {
797
+ * Hooks.dex.useWatchOrderFilled({
798
+ * onOrderFilled(args) {
799
+ * console.log('Order filled:', args)
800
+ * },
801
+ * })
802
+ *
803
+ * return <div>Watching for order fills...</div>
804
+ * }
805
+ * ```
806
+ *
807
+ * @param parameters - Parameters.
808
+ */
809
+ export declare function useWatchOrderFilled<config extends Config = ResolvedRegister['config']>(parameters?: useWatchOrderFilled.Parameters<config>): void;
810
+ export declare namespace useWatchOrderFilled {
811
+ type Parameters<config extends Config = Config> = UnionCompute<ExactPartial<Actions.dex.watchOrderFilled.Parameters<config>> & ConfigParameter<config> & {
812
+ enabled?: boolean | undefined;
813
+ }>;
814
+ }
815
+ /**
816
+ * Hook for watching order placement events on the DEX.
817
+ *
818
+ * @example
819
+ * ```tsx
820
+ * import { Hooks } from 'wagmi/tempo'
821
+ *
822
+ * function App() {
823
+ * Hooks.dex.useWatchOrderPlaced({
824
+ * onOrderPlaced(args) {
825
+ * console.log('Order placed:', args)
826
+ * },
827
+ * })
828
+ *
829
+ * return <div>Watching for order placements...</div>
830
+ * }
831
+ * ```
832
+ *
833
+ * @param parameters - Parameters.
834
+ */
835
+ export declare function useWatchOrderPlaced<config extends Config = ResolvedRegister['config']>(parameters?: useWatchOrderPlaced.Parameters<config>): void;
836
+ export declare namespace useWatchOrderPlaced {
837
+ type Parameters<config extends Config = Config> = UnionCompute<ExactPartial<Actions.dex.watchOrderPlaced.Parameters<config>> & ConfigParameter<config> & {
838
+ enabled?: boolean | undefined;
839
+ }>;
840
+ }
841
+ //# sourceMappingURL=dex.d.ts.map