tempo.ts 0.12.1 → 0.13.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 (123) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +28 -34
  3. package/package.json +2 -28
  4. package/dist/wagmi/Actions/amm.d.ts +0 -418
  5. package/dist/wagmi/Actions/amm.d.ts.map +0 -1
  6. package/dist/wagmi/Actions/amm.js +0 -462
  7. package/dist/wagmi/Actions/amm.js.map +0 -1
  8. package/dist/wagmi/Actions/dex.d.ts +0 -864
  9. package/dist/wagmi/Actions/dex.d.ts.map +0 -1
  10. package/dist/wagmi/Actions/dex.js +0 -968
  11. package/dist/wagmi/Actions/dex.js.map +0 -1
  12. package/dist/wagmi/Actions/faucet.d.ts +0 -66
  13. package/dist/wagmi/Actions/faucet.d.ts.map +0 -1
  14. package/dist/wagmi/Actions/faucet.js +0 -64
  15. package/dist/wagmi/Actions/faucet.js.map +0 -1
  16. package/dist/wagmi/Actions/fee.d.ts +0 -111
  17. package/dist/wagmi/Actions/fee.d.ts.map +0 -1
  18. package/dist/wagmi/Actions/fee.js +0 -126
  19. package/dist/wagmi/Actions/fee.js.map +0 -1
  20. package/dist/wagmi/Actions/index.d.ts +0 -9
  21. package/dist/wagmi/Actions/index.d.ts.map +0 -1
  22. package/dist/wagmi/Actions/index.js +0 -9
  23. package/dist/wagmi/Actions/index.js.map +0 -1
  24. package/dist/wagmi/Actions/nonce.d.ts +0 -77
  25. package/dist/wagmi/Actions/nonce.d.ts.map +0 -1
  26. package/dist/wagmi/Actions/nonce.js +0 -87
  27. package/dist/wagmi/Actions/nonce.js.map +0 -1
  28. package/dist/wagmi/Actions/policy.d.ts +0 -480
  29. package/dist/wagmi/Actions/policy.d.ts.map +0 -1
  30. package/dist/wagmi/Actions/policy.js +0 -530
  31. package/dist/wagmi/Actions/policy.js.map +0 -1
  32. package/dist/wagmi/Actions/reward.d.ts +0 -346
  33. package/dist/wagmi/Actions/reward.d.ts.map +0 -1
  34. package/dist/wagmi/Actions/reward.js +0 -382
  35. package/dist/wagmi/Actions/reward.js.map +0 -1
  36. package/dist/wagmi/Actions/token.d.ts +0 -1546
  37. package/dist/wagmi/Actions/token.d.ts.map +0 -1
  38. package/dist/wagmi/Actions/token.js +0 -1712
  39. package/dist/wagmi/Actions/token.js.map +0 -1
  40. package/dist/wagmi/Connector.d.ts +0 -91
  41. package/dist/wagmi/Connector.d.ts.map +0 -1
  42. package/dist/wagmi/Connector.js +0 -473
  43. package/dist/wagmi/Connector.js.map +0 -1
  44. package/dist/wagmi/Hooks/amm.d.ts +0 -411
  45. package/dist/wagmi/Hooks/amm.d.ts.map +0 -1
  46. package/dist/wagmi/Hooks/amm.js +0 -494
  47. package/dist/wagmi/Hooks/amm.js.map +0 -1
  48. package/dist/wagmi/Hooks/dex.d.ts +0 -773
  49. package/dist/wagmi/Hooks/dex.d.ts.map +0 -1
  50. package/dist/wagmi/Hooks/dex.js +0 -921
  51. package/dist/wagmi/Hooks/dex.js.map +0 -1
  52. package/dist/wagmi/Hooks/faucet.d.ts +0 -71
  53. package/dist/wagmi/Hooks/faucet.d.ts.map +0 -1
  54. package/dist/wagmi/Hooks/faucet.js +0 -76
  55. package/dist/wagmi/Hooks/faucet.js.map +0 -1
  56. package/dist/wagmi/Hooks/fee.d.ts +0 -97
  57. package/dist/wagmi/Hooks/fee.d.ts.map +0 -1
  58. package/dist/wagmi/Hooks/fee.js +0 -109
  59. package/dist/wagmi/Hooks/fee.js.map +0 -1
  60. package/dist/wagmi/Hooks/index.d.ts +0 -9
  61. package/dist/wagmi/Hooks/index.d.ts.map +0 -1
  62. package/dist/wagmi/Hooks/index.js +0 -9
  63. package/dist/wagmi/Hooks/index.js.map +0 -1
  64. package/dist/wagmi/Hooks/nonce.d.ts +0 -59
  65. package/dist/wagmi/Hooks/nonce.d.ts.map +0 -1
  66. package/dist/wagmi/Hooks/nonce.js +0 -75
  67. package/dist/wagmi/Hooks/nonce.js.map +0 -1
  68. package/dist/wagmi/Hooks/policy.d.ts +0 -423
  69. package/dist/wagmi/Hooks/policy.d.ts.map +0 -1
  70. package/dist/wagmi/Hooks/policy.js +0 -510
  71. package/dist/wagmi/Hooks/policy.js.map +0 -1
  72. package/dist/wagmi/Hooks/reward.d.ts +0 -305
  73. package/dist/wagmi/Hooks/reward.d.ts.map +0 -1
  74. package/dist/wagmi/Hooks/reward.js +0 -368
  75. package/dist/wagmi/Hooks/reward.js.map +0 -1
  76. package/dist/wagmi/Hooks/token.d.ts +0 -1388
  77. package/dist/wagmi/Hooks/token.d.ts.map +0 -1
  78. package/dist/wagmi/Hooks/token.js +0 -1657
  79. package/dist/wagmi/Hooks/token.js.map +0 -1
  80. package/dist/wagmi/KeyManager.d.ts +0 -60
  81. package/dist/wagmi/KeyManager.d.ts.map +0 -1
  82. package/dist/wagmi/KeyManager.js +0 -106
  83. package/dist/wagmi/KeyManager.js.map +0 -1
  84. package/dist/wagmi/index.d.ts +0 -5
  85. package/dist/wagmi/index.d.ts.map +0 -1
  86. package/dist/wagmi/index.js +0 -5
  87. package/dist/wagmi/index.js.map +0 -1
  88. package/src/wagmi/Actions/amm.test.ts +0 -208
  89. package/src/wagmi/Actions/amm.ts +0 -690
  90. package/src/wagmi/Actions/dex.test.ts +0 -1482
  91. package/src/wagmi/Actions/dex.ts +0 -1540
  92. package/src/wagmi/Actions/faucet.ts +0 -89
  93. package/src/wagmi/Actions/fee.test.ts +0 -63
  94. package/src/wagmi/Actions/fee.ts +0 -211
  95. package/src/wagmi/Actions/index.ts +0 -8
  96. package/src/wagmi/Actions/nonce.test.ts +0 -82
  97. package/src/wagmi/Actions/nonce.ts +0 -139
  98. package/src/wagmi/Actions/policy.test.ts +0 -461
  99. package/src/wagmi/Actions/policy.ts +0 -817
  100. package/src/wagmi/Actions/reward.test.ts +0 -216
  101. package/src/wagmi/Actions/reward.ts +0 -613
  102. package/src/wagmi/Actions/token.test.ts +0 -1309
  103. package/src/wagmi/Actions/token.ts +0 -2644
  104. package/src/wagmi/Connector.test.ts +0 -56
  105. package/src/wagmi/Connector.ts +0 -670
  106. package/src/wagmi/Hooks/amm.test.ts +0 -564
  107. package/src/wagmi/Hooks/amm.ts +0 -796
  108. package/src/wagmi/Hooks/dex.test.ts +0 -992
  109. package/src/wagmi/Hooks/dex.ts +0 -1598
  110. package/src/wagmi/Hooks/faucet.ts +0 -144
  111. package/src/wagmi/Hooks/fee.test.ts +0 -166
  112. package/src/wagmi/Hooks/fee.ts +0 -206
  113. package/src/wagmi/Hooks/index.ts +0 -8
  114. package/src/wagmi/Hooks/nonce.test.ts +0 -142
  115. package/src/wagmi/Hooks/nonce.ts +0 -117
  116. package/src/wagmi/Hooks/policy.test.ts +0 -665
  117. package/src/wagmi/Hooks/policy.ts +0 -873
  118. package/src/wagmi/Hooks/reward.test.ts +0 -249
  119. package/src/wagmi/Hooks/reward.ts +0 -645
  120. package/src/wagmi/Hooks/token.test.ts +0 -1183
  121. package/src/wagmi/Hooks/token.ts +0 -2906
  122. package/src/wagmi/KeyManager.ts +0 -172
  123. package/src/wagmi/index.ts +0 -7
@@ -1,773 +0,0 @@
1
- import type { DefaultError } from '@tanstack/query-core';
2
- import type { UseMutationResult } from '@tanstack/react-query';
3
- import type { Config, ResolvedRegister } from '@wagmi/core';
4
- import type { ConfigParameter, QueryParameter } from 'wagmi/internal';
5
- import { type UseMutationParameters, type UseQueryReturnType } from 'wagmi/query';
6
- import type { ExactPartial, UnionCompute } from '../../internal/types.js';
7
- import { buy, buySync, cancel, cancelSync, createPair, createPairSync, getBalance, getBuyQuote, getOrder, getOrderbook, getSellQuote, getTickLevel, place, placeFlip, placeFlipSync, placeSync, sell, sellSync, watchFlipOrderPlaced, watchOrderCancelled, watchOrderFilled, watchOrderPlaced, withdraw, withdrawSync } from '../Actions/dex.js';
8
- /**
9
- * Hook for buying a specific amount of tokens.
10
- *
11
- * @example
12
- * ```tsx
13
- * import { Hooks } from 'tempo.ts/wagmi'
14
- *
15
- * function App() {
16
- * const { mutate, isPending } = Hooks.dex.useBuy()
17
- *
18
- * return (
19
- * <button
20
- * onClick={() => mutate({
21
- * tokenIn: '0x20c...11',
22
- * tokenOut: '0x20c...20',
23
- * amountOut: parseUnits('100', 6),
24
- * maxAmountIn: parseUnits('105', 6),
25
- * })}
26
- * disabled={isPending}
27
- * >
28
- * Buy Tokens
29
- * </button>
30
- * )
31
- * }
32
- * ```
33
- *
34
- * @param parameters - Parameters.
35
- * @returns Mutation result.
36
- */
37
- export declare function useBuy<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useBuy.Parameters<config, context>): useBuy.ReturnType<config, context>;
38
- export declare namespace useBuy {
39
- type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
40
- mutation?: UseMutationParameters<buy.ReturnValue, buy.ErrorType, buy.Parameters<config>, context> | undefined;
41
- };
42
- type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<buy.ReturnValue, buy.ErrorType, buy.Parameters<config>, context>;
43
- }
44
- /**
45
- * Hook for buying a specific amount of tokens.
46
- *
47
- * Note: This is a synchronous hook that waits for the transaction
48
- * to be included on a block before returning a response.
49
- *
50
- * @example
51
- * ```tsx
52
- * import { Hooks } from 'tempo.ts/wagmi'
53
- *
54
- * function App() {
55
- * const { mutate, isPending } = Hooks.dex.useBuySync()
56
- *
57
- * return (
58
- * <button
59
- * onClick={() => mutate({
60
- * tokenIn: '0x20c...11',
61
- * tokenOut: '0x20c...20',
62
- * amountOut: parseUnits('100', 6),
63
- * maxAmountIn: parseUnits('105', 6),
64
- * })}
65
- * disabled={isPending}
66
- * >
67
- * Buy Tokens
68
- * </button>
69
- * )
70
- * }
71
- * ```
72
- *
73
- * @param parameters - Parameters.
74
- * @returns Mutation result.
75
- */
76
- export declare function useBuySync<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useBuySync.Parameters<config, context>): useBuySync.ReturnType<config, context>;
77
- export declare namespace useBuySync {
78
- type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
79
- mutation?: UseMutationParameters<buySync.ReturnValue, buySync.ErrorType, buySync.Parameters<config>, context> | undefined;
80
- };
81
- type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<buySync.ReturnValue, buySync.ErrorType, buySync.Parameters<config>, context>;
82
- }
83
- /**
84
- * Hook for canceling an order from the orderbook.
85
- *
86
- * @example
87
- * ```tsx
88
- * import { Hooks } from 'tempo.ts/wagmi'
89
- *
90
- * function App() {
91
- * const { mutate, isPending } = Hooks.dex.useCancel()
92
- *
93
- * return (
94
- * <button
95
- * onClick={() => mutate({ orderId: 123n })}
96
- * disabled={isPending}
97
- * >
98
- * Cancel Order
99
- * </button>
100
- * )
101
- * }
102
- * ```
103
- *
104
- * @param parameters - Parameters.
105
- * @returns Mutation result.
106
- */
107
- export declare function useCancel<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useCancel.Parameters<config, context>): useCancel.ReturnType<config, context>;
108
- export declare namespace useCancel {
109
- type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
110
- mutation?: UseMutationParameters<cancel.ReturnValue, cancel.ErrorType, cancel.Parameters<config>, context> | undefined;
111
- };
112
- type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<cancel.ReturnValue, cancel.ErrorType, cancel.Parameters<config>, context>;
113
- }
114
- /**
115
- * Hook for canceling an order from the orderbook.
116
- *
117
- * Note: This is a synchronous hook that waits for the transaction
118
- * to be included on a block before returning a response.
119
- *
120
- * @example
121
- * ```tsx
122
- * import { Hooks } from 'tempo.ts/wagmi'
123
- *
124
- * function App() {
125
- * const { mutate, isPending } = Hooks.dex.useCancelSync()
126
- *
127
- * return (
128
- * <button
129
- * onClick={() => mutate({ orderId: 123n })}
130
- * disabled={isPending}
131
- * >
132
- * Cancel Order
133
- * </button>
134
- * )
135
- * }
136
- * ```
137
- *
138
- * @param parameters - Parameters.
139
- * @returns Mutation result.
140
- */
141
- export declare function useCancelSync<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useCancelSync.Parameters<config, context>): useCancelSync.ReturnType<config, context>;
142
- export declare namespace useCancelSync {
143
- type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
144
- mutation?: UseMutationParameters<cancelSync.ReturnValue, cancelSync.ErrorType, cancelSync.Parameters<config>, context> | undefined;
145
- };
146
- type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<cancelSync.ReturnValue, cancelSync.ErrorType, cancelSync.Parameters<config>, context>;
147
- }
148
- /**
149
- * Hook for creating a new trading pair on the DEX.
150
- *
151
- * @example
152
- * ```tsx
153
- * import { Hooks } from 'tempo.ts/wagmi'
154
- *
155
- * function App() {
156
- * const { mutate, isPending } = Hooks.dex.useCreatePair()
157
- *
158
- * return (
159
- * <button
160
- * onClick={() => mutate({ base: '0x20c...11' })}
161
- * disabled={isPending}
162
- * >
163
- * Create Pair
164
- * </button>
165
- * )
166
- * }
167
- * ```
168
- *
169
- * @param parameters - Parameters.
170
- * @returns Mutation result.
171
- */
172
- export declare function useCreatePair<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useCreatePair.Parameters<config, context>): useCreatePair.ReturnType<config, context>;
173
- export declare namespace useCreatePair {
174
- type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
175
- mutation?: UseMutationParameters<createPair.ReturnValue, createPair.ErrorType, createPair.Parameters<config>, context> | undefined;
176
- };
177
- type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<createPair.ReturnValue, createPair.ErrorType, createPair.Parameters<config>, context>;
178
- }
179
- /**
180
- * Hook for creating a new trading pair on the DEX.
181
- *
182
- * Note: This is a synchronous hook that waits for the transaction
183
- * to be included on a block before returning a response.
184
- *
185
- * @example
186
- * ```tsx
187
- * import { Hooks } from 'tempo.ts/wagmi'
188
- *
189
- * function App() {
190
- * const { mutate, isPending } = Hooks.dex.useCreatePairSync()
191
- *
192
- * return (
193
- * <button
194
- * onClick={() => mutate({ base: '0x20c...11' })}
195
- * disabled={isPending}
196
- * >
197
- * Create Pair
198
- * </button>
199
- * )
200
- * }
201
- * ```
202
- *
203
- * @param parameters - Parameters.
204
- * @returns Mutation result.
205
- */
206
- export declare function useCreatePairSync<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: useCreatePairSync.Parameters<config, context>): useCreatePairSync.ReturnType<config, context>;
207
- export declare namespace useCreatePairSync {
208
- type Parameters<config extends Config = Config, context = unknown> = ConfigParameter<config> & {
209
- mutation?: UseMutationParameters<createPairSync.ReturnValue, createPairSync.ErrorType, createPairSync.Parameters<config>, context> | undefined;
210
- };
211
- type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<createPairSync.ReturnValue, createPairSync.ErrorType, createPairSync.Parameters<config>, context>;
212
- }
213
- /**
214
- * Hook for getting a user's token balance on the DEX.
215
- *
216
- * @example
217
- * ```tsx
218
- * import { Hooks } from 'tempo.ts/wagmi'
219
- *
220
- * function App() {
221
- * const { data, isLoading } = Hooks.dex.useBalance({
222
- * account: '0x...',
223
- * token: '0x20c...11',
224
- * })
225
- *
226
- * if (isLoading) return <div>Loading...</div>
227
- * return <div>Balance: {data}</div>
228
- * }
229
- * ```
230
- *
231
- * @param parameters - Parameters.
232
- * @returns Query result with the user's token balance on the DEX.
233
- */
234
- export declare function useBalance<config extends Config = ResolvedRegister['config'], selectData = getBalance.ReturnValue>(parameters: useBalance.Parameters<config, selectData>): UseQueryReturnType<selectData, Error>;
235
- export declare namespace useBalance {
236
- type Parameters<config extends Config = ResolvedRegister['config'], selectData = getBalance.ReturnValue> = ConfigParameter<config> & QueryParameter<getBalance.ReturnValue, DefaultError, selectData, getBalance.QueryKey<config>> & Omit<getBalance.queryOptions.Parameters<config, selectData>, 'query'>;
237
- type ReturnValue<selectData = getBalance.ReturnValue> = UseQueryReturnType<selectData, Error>;
238
- }
239
- /**
240
- * Hook for getting the quote for buying a specific amount of tokens.
241
- *
242
- * @example
243
- * ```tsx
244
- * import { Hooks } from 'tempo.ts/wagmi'
245
- *
246
- * function App() {
247
- * const { data, isLoading } = Hooks.dex.useBuyQuote({
248
- * amountOut: parseUnits('100', 6),
249
- * tokenIn: '0x20c...11',
250
- * tokenOut: '0x20c...20',
251
- * })
252
- *
253
- * if (isLoading) return <div>Loading...</div>
254
- * return <div>Required Input: {data}</div>
255
- * }
256
- * ```
257
- *
258
- * @param parameters - Parameters.
259
- * @returns Query result with the amount of tokenIn needed.
260
- */
261
- export declare function useBuyQuote<config extends Config = ResolvedRegister['config'], selectData = getBuyQuote.ReturnValue>(parameters: useBuyQuote.Parameters<config, selectData>): UseQueryReturnType<selectData, Error>;
262
- export declare namespace useBuyQuote {
263
- type Parameters<config extends Config = ResolvedRegister['config'], selectData = getBuyQuote.ReturnValue> = ConfigParameter<config> & QueryParameter<getBuyQuote.ReturnValue, DefaultError, selectData, getBuyQuote.QueryKey<config>> & Omit<getBuyQuote.queryOptions.Parameters<config, selectData>, 'query'>;
264
- type ReturnValue<selectData = getBuyQuote.ReturnValue> = UseQueryReturnType<selectData, Error>;
265
- }
266
- /**
267
- * Hook for getting an order's details from the orderbook.
268
- *
269
- * @example
270
- * ```tsx
271
- * import { Hooks } from 'tempo.ts/wagmi'
272
- *
273
- * function App() {
274
- * const { data, isLoading } = Hooks.dex.useOrder({
275
- * orderId: 123n,
276
- * })
277
- *
278
- * if (isLoading) return <div>Loading...</div>
279
- * return <div>Order: {JSON.stringify(data)}</div>
280
- * }
281
- * ```
282
- *
283
- * @param parameters - Parameters.
284
- * @returns Query result with the order details.
285
- */
286
- export declare function useOrder<config extends Config = ResolvedRegister['config'], selectData = getOrder.ReturnValue>(parameters: useOrder.Parameters<config, selectData>): UseQueryReturnType<selectData, Error>;
287
- export declare namespace useOrder {
288
- type Parameters<config extends Config = ResolvedRegister['config'], selectData = getOrder.ReturnValue> = ConfigParameter<config> & QueryParameter<getOrder.ReturnValue, DefaultError, selectData, getOrder.QueryKey<config>> & Omit<getOrder.queryOptions.Parameters<config, selectData>, 'query'>;
289
- type ReturnValue<selectData = getOrder.ReturnValue> = UseQueryReturnType<selectData, Error>;
290
- }
291
- /**
292
- * Hook for getting orderbook information for a trading pair.
293
- *
294
- * @example
295
- * ```tsx
296
- * import { Hooks } from 'tempo.ts/wagmi'
297
- *
298
- * function App() {
299
- * const { data, isLoading } = Hooks.dex.useOrderbook({
300
- * base: '0x20c...11',
301
- * quote: '0x20c...20',
302
- * })
303
- *
304
- * if (isLoading) return <div>Loading...</div>
305
- * return <div>Orderbook: {JSON.stringify(data)}</div>
306
- * }
307
- * ```
308
- *
309
- * @param parameters - Parameters.
310
- * @returns Query result with the orderbook information.
311
- */
312
- export declare function useOrderbook<config extends Config = ResolvedRegister['config'], selectData = getOrderbook.ReturnValue>(parameters: useOrderbook.Parameters<config, selectData>): UseQueryReturnType<selectData, Error>;
313
- export declare namespace useOrderbook {
314
- type Parameters<config extends Config = ResolvedRegister['config'], selectData = getOrderbook.ReturnValue> = ConfigParameter<config> & QueryParameter<getOrderbook.ReturnValue, DefaultError, selectData, getOrderbook.QueryKey<config>> & Omit<getOrderbook.queryOptions.Parameters<config, selectData>, 'query'>;
315
- type ReturnValue<selectData = getOrderbook.ReturnValue> = UseQueryReturnType<selectData, Error>;
316
- }
317
- /**
318
- * Hook for getting the price level information at a specific tick.
319
- *
320
- * @example
321
- * ```tsx
322
- * import { Hooks } from 'tempo.ts/wagmi'
323
- *
324
- * function App() {
325
- * const { data, isLoading } = Hooks.dex.usePriceLevel({
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>Price Level: {JSON.stringify(data)}</div>
333
- * }
334
- * ```
335
- *
336
- * @param parameters - Parameters.
337
- * @returns Query result with the price level information.
338
- */
339
- export declare function usePriceLevel<config extends Config = ResolvedRegister['config'], selectData = getTickLevel.ReturnValue>(parameters: usePriceLevel.Parameters<config, selectData>): UseQueryReturnType<selectData, Error>;
340
- export declare namespace usePriceLevel {
341
- type Parameters<config extends Config = ResolvedRegister['config'], selectData = getTickLevel.ReturnValue> = ConfigParameter<config> & QueryParameter<getTickLevel.ReturnValue, DefaultError, selectData, getTickLevel.QueryKey<config>> & Omit<getTickLevel.queryOptions.Parameters<config, selectData>, 'query'>;
342
- type ReturnValue<selectData = 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 'tempo.ts/wagmi'
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 = getSellQuote.ReturnValue>(parameters: useSellQuote.Parameters<config, selectData>): UseQueryReturnType<selectData, Error>;
367
- export declare namespace useSellQuote {
368
- type Parameters<config extends Config = ResolvedRegister['config'], selectData = getSellQuote.ReturnValue> = ConfigParameter<config> & QueryParameter<getSellQuote.ReturnValue, DefaultError, selectData, getSellQuote.QueryKey<config>> & Omit<getSellQuote.queryOptions.Parameters<config, selectData>, 'query'>;
369
- type ReturnValue<selectData = 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 'tempo.ts/wagmi'
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<place.ReturnValue, place.ErrorType, place.Parameters<config>, context> | undefined;
404
- };
405
- type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<place.ReturnValue, place.ErrorType, 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 'tempo.ts/wagmi'
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<placeFlip.ReturnValue, placeFlip.ErrorType, placeFlip.Parameters<config>, context> | undefined;
441
- };
442
- type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<placeFlip.ReturnValue, placeFlip.ErrorType, 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 'tempo.ts/wagmi'
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<placeFlipSync.ReturnValue, placeFlipSync.ErrorType, placeFlipSync.Parameters<config>, context> | undefined;
481
- };
482
- type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<placeFlipSync.ReturnValue, placeFlipSync.ErrorType, 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 'tempo.ts/wagmi'
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<placeSync.ReturnValue, placeSync.ErrorType, placeSync.Parameters<config>, context> | undefined;
520
- };
521
- type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<placeSync.ReturnValue, placeSync.ErrorType, placeSync.Parameters<config>, context>;
522
- }
523
- /**
524
- * Hook for selling a specific amount of tokens.
525
- *
526
- * @example
527
- * ```tsx
528
- * import { Hooks } from 'tempo.ts/wagmi'
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<sell.ReturnValue, sell.ErrorType, sell.Parameters<config>, context> | undefined;
556
- };
557
- type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<sell.ReturnValue, sell.ErrorType, 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 'tempo.ts/wagmi'
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<sellSync.ReturnValue, sellSync.ErrorType, sellSync.Parameters<config>, context> | undefined;
595
- };
596
- type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<sellSync.ReturnValue, sellSync.ErrorType, 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 'tempo.ts/wagmi'
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<withdraw.ReturnValue, withdraw.ErrorType, withdraw.Parameters<config>, context> | undefined;
629
- };
630
- type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<withdraw.ReturnValue, withdraw.ErrorType, 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 'tempo.ts/wagmi'
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<withdrawSync.ReturnValue, withdrawSync.ErrorType, withdrawSync.Parameters<config>, context> | undefined;
666
- };
667
- type ReturnType<config extends Config = Config, context = unknown> = UseMutationResult<withdrawSync.ReturnValue, withdrawSync.ErrorType, 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 'tempo.ts/wagmi'
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<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 'tempo.ts/wagmi'
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<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 'tempo.ts/wagmi'
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<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 'tempo.ts/wagmi'
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<watchOrderPlaced.Parameters<config>> & ConfigParameter<config> & {
770
- enabled?: boolean | undefined;
771
- }>;
772
- }
773
- //# sourceMappingURL=dex.d.ts.map