wagmi 3.1.3 → 3.2.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 +534 -0
  4. package/dist/esm/tempo/Hooks/amm.js.map +1 -0
  5. package/dist/esm/tempo/Hooks/dex.js +944 -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 +165 -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 +410 -0
  26. package/dist/types/tempo/Hooks/amm.d.ts.map +1 -0
  27. package/dist/types/tempo/Hooks/dex.d.ts +773 -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 +115 -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 +835 -0
  47. package/src/tempo/Hooks/dex.ts +1597 -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 +248 -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,773 @@
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 creating a new trading pair on the DEX.
149
+ *
150
+ * @example
151
+ * ```tsx
152
+ * import { Hooks } from 'wagmi/tempo'
153
+ *
154
+ * function App() {
155
+ * const { mutate, isPending } = Hooks.dex.useCreatePair()
156
+ *
157
+ * return (
158
+ * <button
159
+ * onClick={() => mutate({ base: '0x20c...11' })}
160
+ * disabled={isPending}
161
+ * >
162
+ * Create Pair
163
+ * </button>
164
+ * )
165
+ * }
166
+ * ```
167
+ *
168
+ * @param parameters - Parameters.
169
+ * @returns Mutation result.
170
+ */
171
+ export declare function useCreatePair<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useCreatePair.Parameters<config, context>): useCreatePair.ReturnType<config, context>;
172
+ export declare namespace useCreatePair {
173
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
174
+ mutation?: UseMutationParameters<Actions.dex.createPair.ReturnValue, Actions.dex.createPair.ErrorType, Actions.dex.createPair.Parameters<config>, context> | undefined;
175
+ };
176
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.createPair.ReturnValue, Actions.dex.createPair.ErrorType, Actions.dex.createPair.Parameters<config>, context>;
177
+ }
178
+ /**
179
+ * Hook for creating a new trading pair on the DEX.
180
+ *
181
+ * Note: This is a synchronous hook that waits for the transaction
182
+ * to be included on a block before returning a response.
183
+ *
184
+ * @example
185
+ * ```tsx
186
+ * import { Hooks } from 'wagmi/tempo'
187
+ *
188
+ * function App() {
189
+ * const { mutate, isPending } = Hooks.dex.useCreatePairSync()
190
+ *
191
+ * return (
192
+ * <button
193
+ * onClick={() => mutate({ base: '0x20c...11' })}
194
+ * disabled={isPending}
195
+ * >
196
+ * Create Pair
197
+ * </button>
198
+ * )
199
+ * }
200
+ * ```
201
+ *
202
+ * @param parameters - Parameters.
203
+ * @returns Mutation result.
204
+ */
205
+ export declare function useCreatePairSync<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useCreatePairSync.Parameters<config, context>): useCreatePairSync.ReturnType<config, context>;
206
+ export declare namespace useCreatePairSync {
207
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
208
+ mutation?: UseMutationParameters<Actions.dex.createPairSync.ReturnValue, Actions.dex.createPairSync.ErrorType, Actions.dex.createPairSync.Parameters<config>, context> | undefined;
209
+ };
210
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.createPairSync.ReturnValue, Actions.dex.createPairSync.ErrorType, Actions.dex.createPairSync.Parameters<config>, context>;
211
+ }
212
+ /**
213
+ * Hook for getting a user's token balance on the DEX.
214
+ *
215
+ * @example
216
+ * ```tsx
217
+ * import { Hooks } from 'wagmi/tempo'
218
+ *
219
+ * function App() {
220
+ * const { data, isLoading } = Hooks.dex.useBalance({
221
+ * account: '0x...',
222
+ * token: '0x20c...11',
223
+ * })
224
+ *
225
+ * if (isLoading) return <div>Loading...</div>
226
+ * return <div>Balance: {data}</div>
227
+ * }
228
+ * ```
229
+ *
230
+ * @param parameters - Parameters.
231
+ * @returns Query result with the user's token balance on the DEX.
232
+ */
233
+ export declare function useBalance<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getBalance.ReturnValue>(parameters: useBalance.Parameters<config, selectData>): useBalance.ReturnValue<selectData>;
234
+ export declare namespace useBalance {
235
+ 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'>;
236
+ type ReturnValue<selectData = Actions.dex.getBalance.ReturnValue> = UseQueryReturnType<selectData, Error>;
237
+ }
238
+ /**
239
+ * Hook for getting the quote for buying a specific amount of tokens.
240
+ *
241
+ * @example
242
+ * ```tsx
243
+ * import { Hooks } from 'wagmi/tempo'
244
+ *
245
+ * function App() {
246
+ * const { data, isLoading } = Hooks.dex.useBuyQuote({
247
+ * amountOut: parseUnits('100', 6),
248
+ * tokenIn: '0x20c...11',
249
+ * tokenOut: '0x20c...20',
250
+ * })
251
+ *
252
+ * if (isLoading) return <div>Loading...</div>
253
+ * return <div>Required Input: {data}</div>
254
+ * }
255
+ * ```
256
+ *
257
+ * @param parameters - Parameters.
258
+ * @returns Query result with the amount of tokenIn needed.
259
+ */
260
+ export declare function useBuyQuote<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getBuyQuote.ReturnValue>(parameters: useBuyQuote.Parameters<config, selectData>): useBuyQuote.ReturnValue<selectData>;
261
+ export declare namespace useBuyQuote {
262
+ 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'>;
263
+ type ReturnValue<selectData = Actions.dex.getBuyQuote.ReturnValue> = UseQueryReturnType<selectData, Error>;
264
+ }
265
+ /**
266
+ * Hook for getting an order's details from the orderbook.
267
+ *
268
+ * @example
269
+ * ```tsx
270
+ * import { Hooks } from 'wagmi/tempo'
271
+ *
272
+ * function App() {
273
+ * const { data, isLoading } = Hooks.dex.useOrder({
274
+ * orderId: 123n,
275
+ * })
276
+ *
277
+ * if (isLoading) return <div>Loading...</div>
278
+ * return <div>Order: {JSON.stringify(data)}</div>
279
+ * }
280
+ * ```
281
+ *
282
+ * @param parameters - Parameters.
283
+ * @returns Query result with the order details.
284
+ */
285
+ export declare function useOrder<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getOrder.ReturnValue>(parameters: useOrder.Parameters<config, selectData>): useOrder.ReturnValue<selectData>;
286
+ export declare namespace useOrder {
287
+ 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'>;
288
+ type ReturnValue<selectData = Actions.dex.getOrder.ReturnValue> = UseQueryReturnType<selectData, Error>;
289
+ }
290
+ /**
291
+ * Hook for getting orderbook information for a trading pair.
292
+ *
293
+ * @example
294
+ * ```tsx
295
+ * import { Hooks } from 'wagmi/tempo'
296
+ *
297
+ * function App() {
298
+ * const { data, isLoading } = Hooks.dex.useOrderbook({
299
+ * base: '0x20c...11',
300
+ * quote: '0x20c...20',
301
+ * })
302
+ *
303
+ * if (isLoading) return <div>Loading...</div>
304
+ * return <div>Orderbook: {JSON.stringify(data)}</div>
305
+ * }
306
+ * ```
307
+ *
308
+ * @param parameters - Parameters.
309
+ * @returns Query result with the orderbook information.
310
+ */
311
+ export declare function useOrderbook<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getOrderbook.ReturnValue>(parameters: useOrderbook.Parameters<config, selectData>): useOrderbook.ReturnValue<selectData>;
312
+ export declare namespace useOrderbook {
313
+ 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'>;
314
+ type ReturnValue<selectData = Actions.dex.getOrderbook.ReturnValue> = UseQueryReturnType<selectData, Error>;
315
+ }
316
+ /**
317
+ * Hook for getting the tick level information at a specific tick.
318
+ *
319
+ * @example
320
+ * ```tsx
321
+ * import { Hooks } from 'wagmi/tempo'
322
+ * import { Tick } from 'viem/tempo'
323
+ *
324
+ * function App() {
325
+ * const { data, isLoading } = Hooks.dex.useTickLevel({
326
+ * base: '0x20c...11',
327
+ * tick: Tick.fromPrice('1.001'),
328
+ * isBid: true,
329
+ * })
330
+ *
331
+ * if (isLoading) return <div>Loading...</div>
332
+ * return <div>Tick Level: {JSON.stringify(data)}</div>
333
+ * }
334
+ * ```
335
+ *
336
+ * @param parameters - Parameters.
337
+ * @returns Query result with the tick level information.
338
+ */
339
+ export declare function useTickLevel<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getTickLevel.ReturnValue>(parameters: useTickLevel.Parameters<config, selectData>): useTickLevel.ReturnValue<selectData>;
340
+ export declare namespace useTickLevel {
341
+ 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'>;
342
+ type ReturnValue<selectData = Actions.dex.getTickLevel.ReturnValue> = UseQueryReturnType<selectData, Error>;
343
+ }
344
+ /**
345
+ * Hook for getting the quote for selling a specific amount of tokens.
346
+ *
347
+ * @example
348
+ * ```tsx
349
+ * import { Hooks } from 'wagmi/tempo'
350
+ *
351
+ * function App() {
352
+ * const { data, isLoading } = Hooks.dex.useSellQuote({
353
+ * amountIn: parseUnits('100', 6),
354
+ * tokenIn: '0x20c...11',
355
+ * tokenOut: '0x20c...20',
356
+ * })
357
+ *
358
+ * if (isLoading) return <div>Loading...</div>
359
+ * return <div>Expected Output: {data}</div>
360
+ * }
361
+ * ```
362
+ *
363
+ * @param parameters - Parameters.
364
+ * @returns Query result with the amount of tokenOut received.
365
+ */
366
+ export declare function useSellQuote<config extends Config = ResolvedRegister['config'], selectData = Actions.dex.getSellQuote.ReturnValue>(parameters: useSellQuote.Parameters<config, selectData>): useSellQuote.ReturnValue<selectData>;
367
+ export declare namespace useSellQuote {
368
+ 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'>;
369
+ type ReturnValue<selectData = Actions.dex.getSellQuote.ReturnValue> = UseQueryReturnType<selectData, Error>;
370
+ }
371
+ /**
372
+ * Hook for placing a limit order on the orderbook.
373
+ *
374
+ * @example
375
+ * ```tsx
376
+ * import { Hooks } from 'wagmi/tempo'
377
+ *
378
+ * function App() {
379
+ * const { mutate, isPending } = Hooks.dex.usePlace()
380
+ *
381
+ * return (
382
+ * <button
383
+ * onClick={() => mutate({
384
+ * amount: parseUnits('100', 6),
385
+ * tick: Tick.fromPrice('0.99'),
386
+ * token: '0x20c...11',
387
+ * type: 'buy',
388
+ * })}
389
+ * disabled={isPending}
390
+ * >
391
+ * Place Order
392
+ * </button>
393
+ * )
394
+ * }
395
+ * ```
396
+ *
397
+ * @param parameters - Parameters.
398
+ * @returns Mutation result.
399
+ */
400
+ export declare function usePlace<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: usePlace.Parameters<config, context>): usePlace.ReturnType<config, context>;
401
+ export declare namespace usePlace {
402
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
403
+ mutation?: UseMutationParameters<Actions.dex.place.ReturnValue, Actions.dex.place.ErrorType, Actions.dex.place.Parameters<config>, context> | undefined;
404
+ };
405
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.place.ReturnValue, Actions.dex.place.ErrorType, Actions.dex.place.Parameters<config>, context>;
406
+ }
407
+ /**
408
+ * Hook for placing a flip order that automatically flips when filled.
409
+ *
410
+ * @example
411
+ * ```tsx
412
+ * import { Hooks } from 'wagmi/tempo'
413
+ *
414
+ * function App() {
415
+ * const { mutate, isPending } = Hooks.dex.usePlaceFlip()
416
+ *
417
+ * return (
418
+ * <button
419
+ * onClick={() => mutate({
420
+ * amount: parseUnits('100', 6),
421
+ * flipTick: Tick.fromPrice('1.01'),
422
+ * tick: Tick.fromPrice('0.99'),
423
+ * token: '0x20c...11',
424
+ * type: 'buy',
425
+ * })}
426
+ * disabled={isPending}
427
+ * >
428
+ * Place Flip Order
429
+ * </button>
430
+ * )
431
+ * }
432
+ * ```
433
+ *
434
+ * @param parameters - Parameters.
435
+ * @returns Mutation result.
436
+ */
437
+ export declare function usePlaceFlip<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: usePlaceFlip.Parameters<config, context>): usePlaceFlip.ReturnType<config, context>;
438
+ export declare namespace usePlaceFlip {
439
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
440
+ mutation?: UseMutationParameters<Actions.dex.placeFlip.ReturnValue, Actions.dex.placeFlip.ErrorType, Actions.dex.placeFlip.Parameters<config>, context> | undefined;
441
+ };
442
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.placeFlip.ReturnValue, Actions.dex.placeFlip.ErrorType, Actions.dex.placeFlip.Parameters<config>, context>;
443
+ }
444
+ /**
445
+ * Hook for placing a flip order that automatically flips when filled.
446
+ *
447
+ * Note: This is a synchronous hook that waits for the transaction
448
+ * to be included on a block before returning a response.
449
+ *
450
+ * @example
451
+ * ```tsx
452
+ * import { Hooks } from 'wagmi/tempo'
453
+ *
454
+ * function App() {
455
+ * const { mutate, isPending } = Hooks.dex.usePlaceFlipSync()
456
+ *
457
+ * return (
458
+ * <button
459
+ * onClick={() => mutate({
460
+ * amount: parseUnits('100', 6),
461
+ * flipTick: Tick.fromPrice('1.01'),
462
+ * tick: Tick.fromPrice('0.99'),
463
+ * token: '0x20c...11',
464
+ * type: 'buy',
465
+ * })}
466
+ * disabled={isPending}
467
+ * >
468
+ * Place Flip Order
469
+ * </button>
470
+ * )
471
+ * }
472
+ * ```
473
+ *
474
+ * @param parameters - Parameters.
475
+ * @returns Mutation result.
476
+ */
477
+ export declare function usePlaceFlipSync<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: usePlaceFlipSync.Parameters<config, context>): usePlaceFlipSync.ReturnType<config, context>;
478
+ export declare namespace usePlaceFlipSync {
479
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
480
+ mutation?: UseMutationParameters<Actions.dex.placeFlipSync.ReturnValue, Actions.dex.placeFlipSync.ErrorType, Actions.dex.placeFlipSync.Parameters<config>, context> | undefined;
481
+ };
482
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.placeFlipSync.ReturnValue, Actions.dex.placeFlipSync.ErrorType, Actions.dex.placeFlipSync.Parameters<config>, context>;
483
+ }
484
+ /**
485
+ * Hook for placing a limit order on the orderbook.
486
+ *
487
+ * Note: This is a synchronous hook that waits for the transaction
488
+ * to be included on a block before returning a response.
489
+ *
490
+ * @example
491
+ * ```tsx
492
+ * import { Hooks } from 'wagmi/tempo'
493
+ *
494
+ * function App() {
495
+ * const { mutate, isPending } = Hooks.dex.usePlaceSync()
496
+ *
497
+ * return (
498
+ * <button
499
+ * onClick={() => mutate({
500
+ * amount: parseUnits('100', 6),
501
+ * tick: Tick.fromPrice('0.99'),
502
+ * token: '0x20c...11',
503
+ * type: 'buy',
504
+ * })}
505
+ * disabled={isPending}
506
+ * >
507
+ * Place Order
508
+ * </button>
509
+ * )
510
+ * }
511
+ * ```
512
+ *
513
+ * @param parameters - Parameters.
514
+ * @returns Mutation result.
515
+ */
516
+ export declare function usePlaceSync<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: usePlaceSync.Parameters<config, context>): usePlaceSync.ReturnType<config, context>;
517
+ export declare namespace usePlaceSync {
518
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
519
+ mutation?: UseMutationParameters<Actions.dex.placeSync.ReturnValue, Actions.dex.placeSync.ErrorType, Actions.dex.placeSync.Parameters<config>, context> | undefined;
520
+ };
521
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.placeSync.ReturnValue, Actions.dex.placeSync.ErrorType, Actions.dex.placeSync.Parameters<config>, context>;
522
+ }
523
+ /**
524
+ * Hook for selling a specific amount of tokens.
525
+ *
526
+ * @example
527
+ * ```tsx
528
+ * import { Hooks } from 'wagmi/tempo'
529
+ *
530
+ * function App() {
531
+ * const { mutate, isPending } = Hooks.dex.useSell()
532
+ *
533
+ * return (
534
+ * <button
535
+ * onClick={() => mutate({
536
+ * amountIn: parseUnits('100', 6),
537
+ * minAmountOut: parseUnits('95', 6),
538
+ * tokenIn: '0x20c...11',
539
+ * tokenOut: '0x20c...20',
540
+ * })}
541
+ * disabled={isPending}
542
+ * >
543
+ * Sell Tokens
544
+ * </button>
545
+ * )
546
+ * }
547
+ * ```
548
+ *
549
+ * @param parameters - Parameters.
550
+ * @returns Mutation result.
551
+ */
552
+ export declare function useSell<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useSell.Parameters<config, context>): useSell.ReturnType<config, context>;
553
+ export declare namespace useSell {
554
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
555
+ mutation?: UseMutationParameters<Actions.dex.sell.ReturnValue, Actions.dex.sell.ErrorType, Actions.dex.sell.Parameters<config>, context> | undefined;
556
+ };
557
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.sell.ReturnValue, Actions.dex.sell.ErrorType, Actions.dex.sell.Parameters<config>, context>;
558
+ }
559
+ /**
560
+ * Hook for selling a specific amount of tokens.
561
+ *
562
+ * Note: This is a synchronous hook that waits for the transaction
563
+ * to be included on a block before returning a response.
564
+ *
565
+ * @example
566
+ * ```tsx
567
+ * import { Hooks } from 'wagmi/tempo'
568
+ *
569
+ * function App() {
570
+ * const { mutate, isPending } = Hooks.dex.useSellSync()
571
+ *
572
+ * return (
573
+ * <button
574
+ * onClick={() => mutate({
575
+ * amountIn: parseUnits('100', 6),
576
+ * minAmountOut: parseUnits('95', 6),
577
+ * tokenIn: '0x20c...11',
578
+ * tokenOut: '0x20c...20',
579
+ * })}
580
+ * disabled={isPending}
581
+ * >
582
+ * Sell Tokens
583
+ * </button>
584
+ * )
585
+ * }
586
+ * ```
587
+ *
588
+ * @param parameters - Parameters.
589
+ * @returns Mutation result.
590
+ */
591
+ export declare function useSellSync<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useSellSync.Parameters<config, context>): useSellSync.ReturnType<config, context>;
592
+ export declare namespace useSellSync {
593
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
594
+ mutation?: UseMutationParameters<Actions.dex.sellSync.ReturnValue, Actions.dex.sellSync.ErrorType, Actions.dex.sellSync.Parameters<config>, context> | undefined;
595
+ };
596
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.sellSync.ReturnValue, Actions.dex.sellSync.ErrorType, Actions.dex.sellSync.Parameters<config>, context>;
597
+ }
598
+ /**
599
+ * Hook for withdrawing tokens from the DEX to the caller's wallet.
600
+ *
601
+ * @example
602
+ * ```tsx
603
+ * import { Hooks } from 'wagmi/tempo'
604
+ *
605
+ * function App() {
606
+ * const { mutate, isPending } = Hooks.dex.useWithdraw()
607
+ *
608
+ * return (
609
+ * <button
610
+ * onClick={() => mutate({
611
+ * amount: 100n,
612
+ * token: '0x20c...11',
613
+ * })}
614
+ * disabled={isPending}
615
+ * >
616
+ * Withdraw
617
+ * </button>
618
+ * )
619
+ * }
620
+ * ```
621
+ *
622
+ * @param parameters - Parameters.
623
+ * @returns Mutation result.
624
+ */
625
+ export declare function useWithdraw<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useWithdraw.Parameters<config, context>): useWithdraw.ReturnType<config, context>;
626
+ export declare namespace useWithdraw {
627
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
628
+ mutation?: UseMutationParameters<Actions.dex.withdraw.ReturnValue, Actions.dex.withdraw.ErrorType, Actions.dex.withdraw.Parameters<config>, context> | undefined;
629
+ };
630
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.withdraw.ReturnValue, Actions.dex.withdraw.ErrorType, Actions.dex.withdraw.Parameters<config>, context>;
631
+ }
632
+ /**
633
+ * Hook for withdrawing tokens from the DEX to the caller's wallet.
634
+ *
635
+ * Note: This is a synchronous hook that waits for the transaction
636
+ * to be included on a block before returning a response.
637
+ *
638
+ * @example
639
+ * ```tsx
640
+ * import { Hooks } from 'wagmi/tempo'
641
+ *
642
+ * function App() {
643
+ * const { mutate, isPending } = Hooks.dex.useWithdrawSync()
644
+ *
645
+ * return (
646
+ * <button
647
+ * onClick={() => mutate({
648
+ * amount: 100n,
649
+ * token: '0x20c...11',
650
+ * })}
651
+ * disabled={isPending}
652
+ * >
653
+ * Withdraw
654
+ * </button>
655
+ * )
656
+ * }
657
+ * ```
658
+ *
659
+ * @param parameters - Parameters.
660
+ * @returns Mutation result.
661
+ */
662
+ export declare function useWithdrawSync<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useWithdrawSync.Parameters<config, context>): useWithdrawSync.ReturnType<config, context>;
663
+ export declare namespace useWithdrawSync {
664
+ type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
665
+ mutation?: UseMutationParameters<Actions.dex.withdrawSync.ReturnValue, Actions.dex.withdrawSync.ErrorType, Actions.dex.withdrawSync.Parameters<config>, context> | undefined;
666
+ };
667
+ type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<Actions.dex.withdrawSync.ReturnValue, Actions.dex.withdrawSync.ErrorType, Actions.dex.withdrawSync.Parameters<config>, context>;
668
+ }
669
+ /**
670
+ * Hook for watching flip order placement events on the DEX.
671
+ *
672
+ * @example
673
+ * ```tsx
674
+ * import { Hooks } from 'wagmi/tempo'
675
+ *
676
+ * function App() {
677
+ * Hooks.dex.useWatchFlipOrderPlaced({
678
+ * onFlipOrderPlaced(args) {
679
+ * console.log('Flip order placed:', args)
680
+ * },
681
+ * })
682
+ *
683
+ * return <div>Watching for flip order placements...</div>
684
+ * }
685
+ * ```
686
+ *
687
+ * @param parameters - Parameters.
688
+ */
689
+ export declare function useWatchFlipOrderPlaced<config extends Config = ResolvedRegister['config']>(parameters?: useWatchFlipOrderPlaced.Parameters<config>): void;
690
+ export declare namespace useWatchFlipOrderPlaced {
691
+ type Parameters<config extends Config = Config> = UnionCompute<ExactPartial<Actions.dex.watchFlipOrderPlaced.Parameters<config>> & ConfigParameter<config> & {
692
+ enabled?: boolean | undefined;
693
+ }>;
694
+ }
695
+ /**
696
+ * Hook for watching order cancellation events on the DEX.
697
+ *
698
+ * @example
699
+ * ```tsx
700
+ * import { Hooks } from 'wagmi/tempo'
701
+ *
702
+ * function App() {
703
+ * Hooks.dex.useWatchOrderCancelled({
704
+ * onOrderCancelled(args) {
705
+ * console.log('Order cancelled:', args)
706
+ * },
707
+ * })
708
+ *
709
+ * return <div>Watching for order cancellations...</div>
710
+ * }
711
+ * ```
712
+ *
713
+ * @param parameters - Parameters.
714
+ */
715
+ export declare function useWatchOrderCancelled<config extends Config = ResolvedRegister['config']>(parameters?: useWatchOrderCancelled.Parameters<config>): void;
716
+ export declare namespace useWatchOrderCancelled {
717
+ type Parameters<config extends Config = Config> = UnionCompute<ExactPartial<Actions.dex.watchOrderCancelled.Parameters<config>> & ConfigParameter<config> & {
718
+ enabled?: boolean | undefined;
719
+ }>;
720
+ }
721
+ /**
722
+ * Hook for watching order filled events on the DEX.
723
+ *
724
+ * @example
725
+ * ```tsx
726
+ * import { Hooks } from 'wagmi/tempo'
727
+ *
728
+ * function App() {
729
+ * Hooks.dex.useWatchOrderFilled({
730
+ * onOrderFilled(args) {
731
+ * console.log('Order filled:', args)
732
+ * },
733
+ * })
734
+ *
735
+ * return <div>Watching for order fills...</div>
736
+ * }
737
+ * ```
738
+ *
739
+ * @param parameters - Parameters.
740
+ */
741
+ export declare function useWatchOrderFilled<config extends Config = ResolvedRegister['config']>(parameters?: useWatchOrderFilled.Parameters<config>): void;
742
+ export declare namespace useWatchOrderFilled {
743
+ type Parameters<config extends Config = Config> = UnionCompute<ExactPartial<Actions.dex.watchOrderFilled.Parameters<config>> & ConfigParameter<config> & {
744
+ enabled?: boolean | undefined;
745
+ }>;
746
+ }
747
+ /**
748
+ * Hook for watching order placement events on the DEX.
749
+ *
750
+ * @example
751
+ * ```tsx
752
+ * import { Hooks } from 'wagmi/tempo'
753
+ *
754
+ * function App() {
755
+ * Hooks.dex.useWatchOrderPlaced({
756
+ * onOrderPlaced(args) {
757
+ * console.log('Order placed:', args)
758
+ * },
759
+ * })
760
+ *
761
+ * return <div>Watching for order placements...</div>
762
+ * }
763
+ * ```
764
+ *
765
+ * @param parameters - Parameters.
766
+ */
767
+ export declare function useWatchOrderPlaced<config extends Config = ResolvedRegister['config']>(parameters?: useWatchOrderPlaced.Parameters<config>): void;
768
+ export declare namespace useWatchOrderPlaced {
769
+ type Parameters<config extends Config = Config> = UnionCompute<ExactPartial<Actions.dex.watchOrderPlaced.Parameters<config>> & ConfigParameter<config> & {
770
+ enabled?: boolean | undefined;
771
+ }>;
772
+ }
773
+ //# sourceMappingURL=dex.d.ts.map