@wagmi/core 3.0.2 → 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 (83) hide show
  1. package/dist/esm/exports/internal.js.map +1 -1
  2. package/dist/esm/exports/query.js +1 -1
  3. package/dist/esm/exports/query.js.map +1 -1
  4. package/dist/esm/exports/tempo.js +9 -0
  5. package/dist/esm/exports/tempo.js.map +1 -0
  6. package/dist/esm/tempo/Connectors.js +534 -0
  7. package/dist/esm/tempo/Connectors.js.map +1 -0
  8. package/dist/esm/tempo/KeyManager.js +106 -0
  9. package/dist/esm/tempo/KeyManager.js.map +1 -0
  10. package/dist/esm/tempo/actions/amm.js +437 -0
  11. package/dist/esm/tempo/actions/amm.js.map +1 -0
  12. package/dist/esm/tempo/actions/dex.js +1059 -0
  13. package/dist/esm/tempo/actions/dex.js.map +1 -0
  14. package/dist/esm/tempo/actions/faucet.js +64 -0
  15. package/dist/esm/tempo/actions/faucet.js.map +1 -0
  16. package/dist/esm/tempo/actions/fee.js +160 -0
  17. package/dist/esm/tempo/actions/fee.js.map +1 -0
  18. package/dist/esm/tempo/actions/index.js +11 -0
  19. package/dist/esm/tempo/actions/index.js.map +1 -0
  20. package/dist/esm/tempo/actions/nonce.js +91 -0
  21. package/dist/esm/tempo/actions/nonce.js.map +1 -0
  22. package/dist/esm/tempo/actions/policy.js +532 -0
  23. package/dist/esm/tempo/actions/policy.js.map +1 -0
  24. package/dist/esm/tempo/actions/reward.js +384 -0
  25. package/dist/esm/tempo/actions/reward.js.map +1 -0
  26. package/dist/esm/tempo/actions/token.js +1717 -0
  27. package/dist/esm/tempo/actions/token.js.map +1 -0
  28. package/dist/esm/tempo/actions/utils.js +2 -0
  29. package/dist/esm/tempo/actions/utils.js.map +1 -0
  30. package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
  31. package/dist/esm/version.js +1 -1
  32. package/dist/types/exports/internal.d.ts +1 -1
  33. package/dist/types/exports/internal.d.ts.map +1 -1
  34. package/dist/types/exports/query.d.ts +1 -1
  35. package/dist/types/exports/query.d.ts.map +1 -1
  36. package/dist/types/exports/tempo.d.ts +5 -0
  37. package/dist/types/exports/tempo.d.ts.map +1 -0
  38. package/dist/types/tempo/Connectors.d.ts +99 -0
  39. package/dist/types/tempo/Connectors.d.ts.map +1 -0
  40. package/dist/types/tempo/KeyManager.d.ts +71 -0
  41. package/dist/types/tempo/KeyManager.d.ts.map +1 -0
  42. package/dist/types/tempo/actions/amm.d.ts +387 -0
  43. package/dist/types/tempo/actions/amm.d.ts.map +1 -0
  44. package/dist/types/tempo/actions/dex.d.ts +926 -0
  45. package/dist/types/tempo/actions/dex.d.ts.map +1 -0
  46. package/dist/types/tempo/actions/faucet.d.ts +70 -0
  47. package/dist/types/tempo/actions/faucet.d.ts.map +1 -0
  48. package/dist/types/tempo/actions/fee.d.ts +141 -0
  49. package/dist/types/tempo/actions/fee.d.ts.map +1 -0
  50. package/dist/types/tempo/actions/index.d.ts +10 -0
  51. package/dist/types/tempo/actions/index.d.ts.map +1 -0
  52. package/dist/types/tempo/actions/nonce.d.ts +79 -0
  53. package/dist/types/tempo/actions/nonce.d.ts.map +1 -0
  54. package/dist/types/tempo/actions/policy.d.ts +478 -0
  55. package/dist/types/tempo/actions/policy.d.ts.map +1 -0
  56. package/dist/types/tempo/actions/reward.d.ts +340 -0
  57. package/dist/types/tempo/actions/reward.d.ts.map +1 -0
  58. package/dist/types/tempo/actions/token.d.ts +1531 -0
  59. package/dist/types/tempo/actions/token.d.ts.map +1 -0
  60. package/dist/types/tempo/actions/utils.d.ts +9 -0
  61. package/dist/types/tempo/actions/utils.d.ts.map +1 -0
  62. package/dist/types/types/utils.d.ts +16 -0
  63. package/dist/types/types/utils.d.ts.map +1 -1
  64. package/dist/types/version.d.ts +1 -1
  65. package/package.json +14 -2
  66. package/src/exports/internal.ts +3 -0
  67. package/src/exports/query.ts +4 -1
  68. package/src/exports/tempo.ts +14 -0
  69. package/src/tempo/Connectors.ts +762 -0
  70. package/src/tempo/KeyManager.ts +176 -0
  71. package/src/tempo/actions/amm.ts +678 -0
  72. package/src/tempo/actions/dex.ts +1685 -0
  73. package/src/tempo/actions/faucet.ts +95 -0
  74. package/src/tempo/actions/fee.ts +259 -0
  75. package/src/tempo/actions/index.ts +10 -0
  76. package/src/tempo/actions/nonce.ts +147 -0
  77. package/src/tempo/actions/policy.ts +827 -0
  78. package/src/tempo/actions/reward.ts +624 -0
  79. package/src/tempo/actions/token.ts +2598 -0
  80. package/src/tempo/actions/utils.ts +26 -0
  81. package/src/types/utils.ts +19 -0
  82. package/src/version.ts +1 -1
  83. package/tempo/package.json +5 -0
@@ -0,0 +1,926 @@
1
+ import type { Account, BaseErrorType } from 'viem';
2
+ import { Actions } from 'viem/tempo';
3
+ import type { Config } from '../../createConfig.js';
4
+ import type { ChainIdParameter, ConnectorParameter } from '../../types/properties.js';
5
+ import type { PartialBy, UnionLooseOmit } from '../../types/utils.js';
6
+ import type { QueryOptions, QueryParameter } from './utils.js';
7
+ /**
8
+ * Buys a specific amount of tokens.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { createConfig, http } from '@wagmi/core'
13
+ * import { tempo } from '@wagmi/core/chains'
14
+ * import { Actions } from '@wagmi/core/tempo'
15
+ *
16
+ * const config = createConfig({
17
+ * chains: [tempoModerato],
18
+ * transports: {
19
+ * [tempo.id]: http(),
20
+ * },
21
+ * })
22
+ *
23
+ * const hash = await Actions.dex.buy(config, {
24
+ * tokenIn: '0x20c...11',
25
+ * tokenOut: '0x20c...20',
26
+ * amountOut: parseUnits('100', 6),
27
+ * maxAmountIn: parseUnits('105', 6),
28
+ * })
29
+ * ```
30
+ *
31
+ * @param config - Config.
32
+ * @param parameters - Parameters.
33
+ * @returns The transaction hash.
34
+ */
35
+ export declare function buy<config extends Config>(config: config, parameters: buy.Parameters<config>): Promise<Actions.dex.buy.ReturnValue>;
36
+ export declare namespace buy {
37
+ type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionLooseOmit<Actions.dex.buy.Parameters<config['chains'][number], Account>, 'chain'>;
38
+ type ReturnValue = Actions.dex.buy.ReturnValue;
39
+ type ErrorType = BaseErrorType;
40
+ }
41
+ /**
42
+ * Buys a specific amount of tokens.
43
+ *
44
+ * Note: This is a synchronous action that waits for the transaction to
45
+ * be included on a block before returning a response.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * import { createConfig, http } from '@wagmi/core'
50
+ * import { tempo } from '@wagmi/core/chains'
51
+ * import { Actions } from '@wagmi/core/tempo'
52
+ *
53
+ * const config = createConfig({
54
+ * chains: [tempoModerato],
55
+ * transports: {
56
+ * [tempo.id]: http(),
57
+ * },
58
+ * })
59
+ *
60
+ * const result = await Actions.dex.buySync(config, {
61
+ * tokenIn: '0x20c...11',
62
+ * tokenOut: '0x20c...20',
63
+ * amountOut: parseUnits('100', 6),
64
+ * maxAmountIn: parseUnits('105', 6),
65
+ * })
66
+ * ```
67
+ *
68
+ * @param config - Config.
69
+ * @param parameters - Parameters.
70
+ * @returns The transaction receipt.
71
+ */
72
+ export declare function buySync<config extends Config>(config: config, parameters: buySync.Parameters<config>): Promise<Actions.dex.buySync.ReturnValue>;
73
+ export declare namespace buySync {
74
+ type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionLooseOmit<Actions.dex.buySync.Parameters<config['chains'][number], Account>, 'chain'>;
75
+ type ReturnValue = Actions.dex.buySync.ReturnValue;
76
+ type ErrorType = BaseErrorType;
77
+ }
78
+ /**
79
+ * Cancels an order from the orderbook.
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * import { createConfig, http } from '@wagmi/core'
84
+ * import { tempo } from '@wagmi/core/chains'
85
+ * import { Actions } from '@wagmi/core/tempo'
86
+ *
87
+ * const config = createConfig({
88
+ * chains: [tempoModerato],
89
+ * transports: {
90
+ * [tempo.id]: http(),
91
+ * },
92
+ * })
93
+ *
94
+ * const hash = await Actions.dex.cancel(config, {
95
+ * orderId: 123n,
96
+ * })
97
+ * ```
98
+ *
99
+ * @param config - Config.
100
+ * @param parameters - Parameters.
101
+ * @returns The transaction hash.
102
+ */
103
+ export declare function cancel<config extends Config>(config: config, parameters: cancel.Parameters<config>): Promise<Actions.dex.cancel.ReturnValue>;
104
+ export declare namespace cancel {
105
+ type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionLooseOmit<Actions.dex.cancel.Parameters<config['chains'][number], Account>, 'chain'>;
106
+ type ReturnValue = Actions.dex.cancel.ReturnValue;
107
+ type ErrorType = BaseErrorType;
108
+ }
109
+ /**
110
+ * Cancels an order from the orderbook.
111
+ *
112
+ * Note: This is a synchronous action that waits for the transaction to
113
+ * be included on a block before returning a response.
114
+ *
115
+ * @example
116
+ * ```ts
117
+ * import { createConfig, http } from '@wagmi/core'
118
+ * import { tempo } from '@wagmi/core/chains'
119
+ * import { Actions } from '@wagmi/core/tempo'
120
+ *
121
+ * const config = createConfig({
122
+ * chains: [tempoModerato],
123
+ * transports: {
124
+ * [tempo.id]: http(),
125
+ * },
126
+ * })
127
+ *
128
+ * const result = await Actions.dex.cancelSync(config, {
129
+ * orderId: 123n,
130
+ * })
131
+ * ```
132
+ *
133
+ * @param config - Config.
134
+ * @param parameters - Parameters.
135
+ * @returns The transaction receipt and event data.
136
+ */
137
+ export declare function cancelSync<config extends Config>(config: config, parameters: cancelSync.Parameters<config>): Promise<Actions.dex.cancelSync.ReturnValue>;
138
+ export declare namespace cancelSync {
139
+ type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionLooseOmit<Actions.dex.cancelSync.Parameters<config['chains'][number], Account>, 'chain'>;
140
+ type ReturnValue = Actions.dex.cancelSync.ReturnValue;
141
+ type ErrorType = BaseErrorType;
142
+ }
143
+ /**
144
+ * Cancels a stale order from the orderbook.
145
+ *
146
+ * A stale order is one where the owner's balance or allowance has dropped
147
+ * below the order amount.
148
+ *
149
+ * @example
150
+ * ```ts
151
+ * import { createConfig, http } from '@wagmi/core'
152
+ * import { tempo } from '@wagmi/core/chains'
153
+ * import { Actions } from '@wagmi/core/tempo'
154
+ *
155
+ * const config = createConfig({
156
+ * chains: [tempoModerato],
157
+ * transports: {
158
+ * [tempo.id]: http(),
159
+ * },
160
+ * })
161
+ *
162
+ * const hash = await Actions.dex.cancelStale(config, {
163
+ * orderId: 123n,
164
+ * })
165
+ * ```
166
+ *
167
+ * @param config - Config.
168
+ * @param parameters - Parameters.
169
+ * @returns The transaction hash.
170
+ */
171
+ export declare function cancelStale<config extends Config>(config: config, parameters: cancelStale.Parameters<config>): Promise<Actions.dex.cancelStale.ReturnValue>;
172
+ export declare namespace cancelStale {
173
+ type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionLooseOmit<Actions.dex.cancelStale.Parameters<config['chains'][number], Account>, 'chain'>;
174
+ type ReturnValue = Actions.dex.cancelStale.ReturnValue;
175
+ type ErrorType = BaseErrorType;
176
+ }
177
+ /**
178
+ * Cancels a stale order from the orderbook and waits for confirmation.
179
+ *
180
+ * A stale order is one where the owner's balance or allowance has dropped
181
+ * below the order amount.
182
+ *
183
+ * @example
184
+ * ```ts
185
+ * import { createConfig, http } from '@wagmi/core'
186
+ * import { tempo } from '@wagmi/core/chains'
187
+ * import { Actions } from '@wagmi/core/tempo'
188
+ *
189
+ * const config = createConfig({
190
+ * chains: [tempoModerato],
191
+ * transports: {
192
+ * [tempo.id]: http(),
193
+ * },
194
+ * })
195
+ *
196
+ * const result = await Actions.dex.cancelStaleSync(config, {
197
+ * orderId: 123n,
198
+ * })
199
+ * ```
200
+ *
201
+ * @param config - Config.
202
+ * @param parameters - Parameters.
203
+ * @returns The transaction receipt and event data.
204
+ */
205
+ export declare function cancelStaleSync<config extends Config>(config: config, parameters: cancelStaleSync.Parameters<config>): Promise<Actions.dex.cancelStaleSync.ReturnValue>;
206
+ export declare namespace cancelStaleSync {
207
+ type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionLooseOmit<Actions.dex.cancelStaleSync.Parameters<config['chains'][number], Account>, 'chain'>;
208
+ type ReturnValue = Actions.dex.cancelStaleSync.ReturnValue;
209
+ type ErrorType = BaseErrorType;
210
+ }
211
+ /**
212
+ * Creates a new trading pair on the DEX.
213
+ *
214
+ * @example
215
+ * ```ts
216
+ * import { createConfig, http } from '@wagmi/core'
217
+ * import { tempo } from '@wagmi/core/chains'
218
+ * import { Actions } from '@wagmi/core/tempo'
219
+ *
220
+ * const config = createConfig({
221
+ * chains: [tempoModerato],
222
+ * transports: {
223
+ * [tempo.id]: http(),
224
+ * },
225
+ * })
226
+ *
227
+ * const hash = await Actions.dex.createPair(config, {
228
+ * base: '0x20c...11',
229
+ * })
230
+ * ```
231
+ *
232
+ * @param config - Config.
233
+ * @param parameters - Parameters.
234
+ * @returns The transaction hash.
235
+ */
236
+ export declare function createPair<config extends Config>(config: config, parameters: createPair.Parameters<config>): Promise<Actions.dex.createPair.ReturnValue>;
237
+ export declare namespace createPair {
238
+ type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionLooseOmit<Actions.dex.createPair.Parameters<config['chains'][number], Account>, 'chain'>;
239
+ type ReturnValue = Actions.dex.createPair.ReturnValue;
240
+ type ErrorType = BaseErrorType;
241
+ }
242
+ /**
243
+ * Creates a new trading pair on the DEX.
244
+ *
245
+ * Note: This is a synchronous action that waits for the transaction to
246
+ * be included on a block before returning a response.
247
+ *
248
+ * @example
249
+ * ```ts
250
+ * import { createConfig, http } from '@wagmi/core'
251
+ * import { tempo } from '@wagmi/core/chains'
252
+ * import { Actions } from '@wagmi/core/tempo'
253
+ *
254
+ * const config = createConfig({
255
+ * chains: [tempoModerato],
256
+ * transports: {
257
+ * [tempo.id]: http(),
258
+ * },
259
+ * })
260
+ *
261
+ * const result = await Actions.dex.createPairSync(config, {
262
+ * base: '0x20c...11',
263
+ * })
264
+ * ```
265
+ *
266
+ * @param config - Config.
267
+ * @param parameters - Parameters.
268
+ * @returns The transaction receipt and event data.
269
+ */
270
+ export declare function createPairSync<config extends Config>(config: config, parameters: createPairSync.Parameters<config>): Promise<Actions.dex.createPairSync.ReturnValue>;
271
+ export declare namespace createPairSync {
272
+ type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionLooseOmit<Actions.dex.createPairSync.Parameters<config['chains'][number], Account>, 'chain'>;
273
+ type ReturnValue = Actions.dex.createPairSync.ReturnValue;
274
+ type ErrorType = BaseErrorType;
275
+ }
276
+ /**
277
+ * Gets a user's token balance on the DEX.
278
+ *
279
+ * @example
280
+ * ```ts
281
+ * import { createConfig, http } from '@wagmi/core'
282
+ * import { tempo } from '@wagmi/core/chains'
283
+ * import { Actions } from '@wagmi/core/tempo'
284
+ *
285
+ * const config = createConfig({
286
+ * chains: [tempoModerato],
287
+ * transports: {
288
+ * [tempo.id]: http(),
289
+ * },
290
+ * })
291
+ *
292
+ * const balance = await Actions.dex.getBalance(config, {
293
+ * account: '0x...',
294
+ * token: '0x20c...11',
295
+ * })
296
+ * ```
297
+ *
298
+ * @param config - Config.
299
+ * @param parameters - Parameters.
300
+ * @returns The user's token balance on the DEX.
301
+ */
302
+ export declare function getBalance<config extends Config>(config: config, parameters: getBalance.Parameters<config>): Promise<getBalance.ReturnValue>;
303
+ export declare namespace getBalance {
304
+ type Parameters<config extends Config> = ChainIdParameter<config> & Actions.dex.getBalance.Parameters;
305
+ type ReturnValue = Actions.dex.getBalance.ReturnValue;
306
+ type ErrorType = BaseErrorType;
307
+ function queryKey<config extends Config>(parameters: PartialBy<Parameters<config>, 'account'>): readonly ["getBalance", PartialBy<Parameters<config>, "account">];
308
+ type QueryKey<config extends Config> = ReturnType<typeof queryKey<config>>;
309
+ function queryOptions<config extends Config, selectData = ReturnValue>(config: Config, parameters: queryOptions.Parameters<config, selectData>): queryOptions.ReturnValue<config, selectData>;
310
+ namespace queryOptions {
311
+ type Parameters<config extends Config, selectData = getBalance.ReturnValue> = PartialBy<getBalance.Parameters<config>, 'account'> & QueryParameter<getBalance.ReturnValue, getBalance.ErrorType, selectData, getBalance.QueryKey<config>>;
312
+ type ReturnValue<config extends Config, selectData = getBalance.ReturnValue> = QueryOptions<getBalance.ReturnValue, getBalance.ErrorType, selectData, getBalance.QueryKey<config>>;
313
+ }
314
+ }
315
+ /**
316
+ * Gets the quote for buying a specific amount of tokens.
317
+ *
318
+ * @example
319
+ * ```ts
320
+ * import { createConfig, http } from '@wagmi/core'
321
+ * import { tempo } from '@wagmi/core/chains'
322
+ * import { Actions } from '@wagmi/core/tempo'
323
+ *
324
+ * const config = createConfig({
325
+ * chains: [tempoModerato],
326
+ * transports: {
327
+ * [tempo.id]: http(),
328
+ * },
329
+ * })
330
+ *
331
+ * const amountIn = await Actions.dex.getBuyQuote(config, {
332
+ * amountOut: parseUnits('100', 6),
333
+ * tokenIn: '0x20c...11',
334
+ * tokenOut: '0x20c...20',
335
+ * })
336
+ * ```
337
+ *
338
+ * @param config - Config.
339
+ * @param parameters - Parameters.
340
+ * @returns The amount of tokenIn needed to buy the specified amountOut.
341
+ */
342
+ export declare function getBuyQuote<config extends Config>(config: config, parameters: getBuyQuote.Parameters<config>): Promise<getBuyQuote.ReturnValue>;
343
+ export declare namespace getBuyQuote {
344
+ type Parameters<config extends Config> = ChainIdParameter<config> & Actions.dex.getBuyQuote.Parameters;
345
+ type ReturnValue = Actions.dex.getBuyQuote.ReturnValue;
346
+ type ErrorType = BaseErrorType;
347
+ function queryKey<config extends Config>(parameters: Parameters<config>): readonly ["getBuyQuote", Parameters<config>];
348
+ type QueryKey<config extends Config> = ReturnType<typeof queryKey<config>>;
349
+ function queryOptions<config extends Config, selectData = ReturnValue>(config: Config, parameters: queryOptions.Parameters<config, selectData>): queryOptions.ReturnValue<config, selectData>;
350
+ namespace queryOptions {
351
+ type Parameters<config extends Config, selectData = getBuyQuote.ReturnValue> = getBuyQuote.Parameters<config> & QueryParameter<getBuyQuote.ReturnValue, getBuyQuote.ErrorType, selectData, getBuyQuote.QueryKey<config>>;
352
+ type ReturnValue<config extends Config, selectData = getBuyQuote.ReturnValue> = QueryOptions<getBuyQuote.ReturnValue, getBuyQuote.ErrorType, selectData, getBuyQuote.QueryKey<config>>;
353
+ }
354
+ }
355
+ /**
356
+ * Gets an order's details from the orderbook.
357
+ *
358
+ * @example
359
+ * ```ts
360
+ * import { createConfig, http } from '@wagmi/core'
361
+ * import { tempo } from '@wagmi/core/chains'
362
+ * import { Actions } from '@wagmi/core/tempo'
363
+ *
364
+ * const config = createConfig({
365
+ * chains: [tempoModerato],
366
+ * transports: {
367
+ * [tempo.id]: http(),
368
+ * },
369
+ * })
370
+ *
371
+ * const order = await Actions.dex.getOrder(config, {
372
+ * orderId: 123n,
373
+ * })
374
+ * ```
375
+ *
376
+ * @param config - Config.
377
+ * @param parameters - Parameters.
378
+ * @returns The order details.
379
+ */
380
+ export declare function getOrder<config extends Config>(config: config, parameters: getOrder.Parameters<config>): Promise<getOrder.ReturnValue>;
381
+ export declare namespace getOrder {
382
+ type Parameters<config extends Config> = ChainIdParameter<config> & Actions.dex.getOrder.Parameters;
383
+ type ReturnValue = Actions.dex.getOrder.ReturnValue;
384
+ type ErrorType = BaseErrorType;
385
+ function queryKey<config extends Config>(parameters: Parameters<config>): readonly ["getOrder", Parameters<config>];
386
+ type QueryKey<config extends Config> = ReturnType<typeof queryKey<config>>;
387
+ function queryOptions<config extends Config, selectData = ReturnValue>(config: Config, parameters: queryOptions.Parameters<config, selectData>): queryOptions.ReturnValue<config, selectData>;
388
+ namespace queryOptions {
389
+ type Parameters<config extends Config, selectData = getOrder.ReturnValue> = getOrder.Parameters<config> & QueryParameter<getOrder.ReturnValue, getOrder.ErrorType, selectData, getOrder.QueryKey<config>>;
390
+ type ReturnValue<config extends Config, selectData = getOrder.ReturnValue> = QueryOptions<getOrder.ReturnValue, getOrder.ErrorType, selectData, getOrder.QueryKey<config>>;
391
+ }
392
+ }
393
+ /**
394
+ * Gets orderbook information for a trading pair.
395
+ *
396
+ * @example
397
+ * ```ts
398
+ * import { createConfig, http } from '@wagmi/core'
399
+ * import { tempo } from '@wagmi/core/chains'
400
+ * import { Actions } from '@wagmi/core/tempo'
401
+ *
402
+ * const config = createConfig({
403
+ * chains: [tempoModerato],
404
+ * transports: {
405
+ * [tempo.id]: http(),
406
+ * },
407
+ * })
408
+ *
409
+ * const book = await Actions.dex.getOrderbook(config, {
410
+ * base: '0x20c...11',
411
+ * quote: '0x20c...20',
412
+ * })
413
+ * ```
414
+ *
415
+ * @param config - Config.
416
+ * @param parameters - Parameters.
417
+ * @returns The orderbook information.
418
+ */
419
+ export declare function getOrderbook<config extends Config>(config: config, parameters: getOrderbook.Parameters<config>): Promise<getOrderbook.ReturnValue>;
420
+ export declare namespace getOrderbook {
421
+ type Parameters<config extends Config> = ChainIdParameter<config> & Actions.dex.getOrderbook.Parameters;
422
+ type ReturnValue = Actions.dex.getOrderbook.ReturnValue;
423
+ type ErrorType = BaseErrorType;
424
+ function queryKey<config extends Config>(parameters: Parameters<config>): readonly ["getOrderbook", Parameters<config>];
425
+ type QueryKey<config extends Config> = ReturnType<typeof queryKey<config>>;
426
+ function queryOptions<config extends Config, selectData = ReturnValue>(config: Config, parameters: queryOptions.Parameters<config, selectData>): queryOptions.ReturnValue<config, selectData>;
427
+ namespace queryOptions {
428
+ type Parameters<config extends Config, selectData = getOrderbook.ReturnValue> = getOrderbook.Parameters<config> & QueryParameter<getOrderbook.ReturnValue, getOrderbook.ErrorType, selectData, getOrderbook.QueryKey<config>>;
429
+ type ReturnValue<config extends Config, selectData = getOrderbook.ReturnValue> = QueryOptions<getOrderbook.ReturnValue, getOrderbook.ErrorType, selectData, getOrderbook.QueryKey<config>>;
430
+ }
431
+ }
432
+ /**
433
+ * Gets the price level information at a specific tick.
434
+ *
435
+ * @example
436
+ * ```ts
437
+ * import { createConfig, http } from '@wagmi/core'
438
+ * import { tempo } from '@wagmi/core/chains'
439
+ * import { Actions, Tick } from '@wagmi/core/tempo'
440
+ *
441
+ * const config = createConfig({
442
+ * chains: [tempoModerato],
443
+ * transports: {
444
+ * [tempo.id]: http(),
445
+ * },
446
+ * })
447
+ *
448
+ * const level = await Actions.dex.getTickLevel(config, {
449
+ * base: '0x20c...11',
450
+ * tick: Tick.fromPrice('1.001'),
451
+ * isBid: true,
452
+ * })
453
+ * ```
454
+ *
455
+ * @param config - Config.
456
+ * @param parameters - Parameters.
457
+ * @returns The price level information.
458
+ */
459
+ export declare function getTickLevel<config extends Config>(config: config, parameters: getTickLevel.Parameters<config>): Promise<getTickLevel.ReturnValue>;
460
+ export declare namespace getTickLevel {
461
+ type Parameters<config extends Config> = ChainIdParameter<config> & Actions.dex.getTickLevel.Parameters;
462
+ type ReturnValue = Actions.dex.getTickLevel.ReturnValue;
463
+ type ErrorType = BaseErrorType;
464
+ function queryKey<config extends Config>(parameters: Parameters<config>): readonly ["getTickLevel", Parameters<config>];
465
+ type QueryKey<config extends Config> = ReturnType<typeof queryKey<config>>;
466
+ function queryOptions<config extends Config, selectData = ReturnValue>(config: Config, parameters: queryOptions.Parameters<config, selectData>): queryOptions.ReturnValue<config, selectData>;
467
+ namespace queryOptions {
468
+ type Parameters<config extends Config, selectData = getTickLevel.ReturnValue> = getTickLevel.Parameters<config> & QueryParameter<getTickLevel.ReturnValue, getTickLevel.ErrorType, selectData, getTickLevel.QueryKey<config>>;
469
+ type ReturnValue<config extends Config, selectData = getTickLevel.ReturnValue> = QueryOptions<getTickLevel.ReturnValue, getTickLevel.ErrorType, selectData, getTickLevel.QueryKey<config>>;
470
+ }
471
+ }
472
+ /**
473
+ * Gets the quote for selling a specific amount of tokens.
474
+ *
475
+ * @example
476
+ * ```ts
477
+ * import { createConfig, http } from '@wagmi/core'
478
+ * import { tempo } from '@wagmi/core/chains'
479
+ * import { Actions } from '@wagmi/core/tempo'
480
+ *
481
+ * const config = createConfig({
482
+ * chains: [tempoModerato],
483
+ * transports: {
484
+ * [tempo.id]: http(),
485
+ * },
486
+ * })
487
+ *
488
+ * const amountOut = await Actions.dex.getSellQuote(config, {
489
+ * amountIn: parseUnits('100', 6),
490
+ * tokenIn: '0x20c...11',
491
+ * tokenOut: '0x20c...20',
492
+ * })
493
+ * ```
494
+ *
495
+ * @param config - Config.
496
+ * @param parameters - Parameters.
497
+ * @returns The amount of tokenOut received for selling the specified amountIn.
498
+ */
499
+ export declare function getSellQuote<config extends Config>(config: config, parameters: getSellQuote.Parameters<config>): Promise<getSellQuote.ReturnValue>;
500
+ export declare namespace getSellQuote {
501
+ type Parameters<config extends Config> = ChainIdParameter<config> & Actions.dex.getSellQuote.Parameters;
502
+ type ReturnValue = Actions.dex.getSellQuote.ReturnValue;
503
+ type ErrorType = BaseErrorType;
504
+ function queryKey<config extends Config>(parameters: Parameters<config>): readonly ["getSellQuote", Parameters<config>];
505
+ type QueryKey<config extends Config> = ReturnType<typeof queryKey<config>>;
506
+ function queryOptions<config extends Config, selectData = ReturnValue>(config: Config, parameters: queryOptions.Parameters<config, selectData>): queryOptions.ReturnValue<config, selectData>;
507
+ namespace queryOptions {
508
+ type Parameters<config extends Config, selectData = getSellQuote.ReturnValue> = getSellQuote.Parameters<config> & QueryParameter<getSellQuote.ReturnValue, getSellQuote.ErrorType, selectData, getSellQuote.QueryKey<config>>;
509
+ type ReturnValue<config extends Config, selectData = getSellQuote.ReturnValue> = QueryOptions<getSellQuote.ReturnValue, getSellQuote.ErrorType, selectData, getSellQuote.QueryKey<config>>;
510
+ }
511
+ }
512
+ /**
513
+ * Places a limit order on the orderbook.
514
+ *
515
+ * @example
516
+ * ```ts
517
+ * import { createConfig, http } from '@wagmi/core'
518
+ * import { tempo } from '@wagmi/core/chains'
519
+ * import { Actions } from '@wagmi/core/tempo'
520
+ *
521
+ * const config = createConfig({
522
+ * chains: [tempoModerato],
523
+ * transports: {
524
+ * [tempo.id]: http(),
525
+ * },
526
+ * })
527
+ *
528
+ * const hash = await Actions.dex.place(config, {
529
+ * amount: parseUnits('100', 6),
530
+ * tick: Tick.fromPrice('0.99'),
531
+ * token: '0x20c...11',
532
+ * type: 'buy',
533
+ * })
534
+ * ```
535
+ *
536
+ * @param config - Config.
537
+ * @param parameters - Parameters.
538
+ * @returns The transaction hash.
539
+ */
540
+ export declare function place<config extends Config>(config: config, parameters: place.Parameters<config>): Promise<Actions.dex.place.ReturnValue>;
541
+ export declare namespace place {
542
+ type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionLooseOmit<Actions.dex.place.Parameters<config['chains'][number], Account>, 'chain'>;
543
+ type ReturnValue = Actions.dex.place.ReturnValue;
544
+ type ErrorType = BaseErrorType;
545
+ }
546
+ /**
547
+ * Places a flip order that automatically flips when filled.
548
+ *
549
+ * @example
550
+ * ```ts
551
+ * import { createConfig, http } from '@wagmi/core'
552
+ * import { tempo } from '@wagmi/core/chains'
553
+ * import { Actions } from '@wagmi/core/tempo'
554
+ *
555
+ * const config = createConfig({
556
+ * chains: [tempoModerato],
557
+ * transports: {
558
+ * [tempo.id]: http(),
559
+ * },
560
+ * })
561
+ *
562
+ * const hash = await Actions.dex.placeFlip(config, {
563
+ * amount: parseUnits('100', 6),
564
+ * flipTick: Tick.fromPrice('1.01'),
565
+ * tick: Tick.fromPrice('0.99'),
566
+ * token: '0x20c...11',
567
+ * type: 'buy',
568
+ * })
569
+ * ```
570
+ *
571
+ * @param config - Config.
572
+ * @param parameters - Parameters.
573
+ * @returns The transaction hash.
574
+ */
575
+ export declare function placeFlip<config extends Config>(config: config, parameters: placeFlip.Parameters<config>): Promise<Actions.dex.placeFlip.ReturnValue>;
576
+ export declare namespace placeFlip {
577
+ type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionLooseOmit<Actions.dex.placeFlip.Parameters<config['chains'][number], Account>, 'chain'>;
578
+ type ReturnValue = Actions.dex.placeFlip.ReturnValue;
579
+ type ErrorType = BaseErrorType;
580
+ }
581
+ /**
582
+ * Places a flip order that automatically flips when filled.
583
+ *
584
+ * Note: This is a synchronous action that waits for the transaction to
585
+ * be included on a block before returning a response.
586
+ *
587
+ * @example
588
+ * ```ts
589
+ * import { createConfig, http } from '@wagmi/core'
590
+ * import { tempo } from '@wagmi/core/chains'
591
+ * import { Actions } from '@wagmi/core/tempo'
592
+ *
593
+ * const config = createConfig({
594
+ * chains: [tempoModerato],
595
+ * transports: {
596
+ * [tempo.id]: http(),
597
+ * },
598
+ * })
599
+ *
600
+ * const result = await Actions.dex.placeFlipSync(config, {
601
+ * amount: parseUnits('100', 6),
602
+ * flipTick: Tick.fromPrice('1.01'),
603
+ * tick: Tick.fromPrice('0.99'),
604
+ * token: '0x20c...11',
605
+ * type: 'buy',
606
+ * })
607
+ * ```
608
+ *
609
+ * @param config - Config.
610
+ * @param parameters - Parameters.
611
+ * @returns The transaction receipt and event data.
612
+ */
613
+ export declare function placeFlipSync<config extends Config>(config: config, parameters: placeFlipSync.Parameters<config>): Promise<Actions.dex.placeFlipSync.ReturnValue>;
614
+ export declare namespace placeFlipSync {
615
+ type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionLooseOmit<Actions.dex.placeFlipSync.Parameters<config['chains'][number], Account>, 'chain'>;
616
+ type ReturnValue = Actions.dex.placeFlipSync.ReturnValue;
617
+ type ErrorType = BaseErrorType;
618
+ }
619
+ /**
620
+ * Places a limit order on the orderbook.
621
+ *
622
+ * Note: This is a synchronous action that waits for the transaction to
623
+ * be included on a block before returning a response.
624
+ *
625
+ * @example
626
+ * ```ts
627
+ * import { createConfig, http } from '@wagmi/core'
628
+ * import { tempo } from '@wagmi/core/chains'
629
+ * import { Actions } from '@wagmi/core/tempo'
630
+ *
631
+ * const config = createConfig({
632
+ * chains: [tempoModerato],
633
+ * transports: {
634
+ * [tempo.id]: http(),
635
+ * },
636
+ * })
637
+ *
638
+ * const result = await Actions.dex.placeSync(config, {
639
+ * amount: parseUnits('100', 6),
640
+ * tick: Tick.fromPrice('0.99'),
641
+ * token: '0x20c...11',
642
+ * type: 'buy',
643
+ * })
644
+ * ```
645
+ *
646
+ * @param config - Config.
647
+ * @param parameters - Parameters.
648
+ * @returns The transaction receipt and event data.
649
+ */
650
+ export declare function placeSync<config extends Config>(config: config, parameters: placeSync.Parameters<config>): Promise<Actions.dex.placeSync.ReturnValue>;
651
+ export declare namespace placeSync {
652
+ type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionLooseOmit<Actions.dex.placeSync.Parameters<config['chains'][number], Account>, 'chain'>;
653
+ type ReturnValue = Actions.dex.placeSync.ReturnValue;
654
+ type ErrorType = BaseErrorType;
655
+ }
656
+ /**
657
+ * Sells a specific amount of tokens.
658
+ *
659
+ * @example
660
+ * ```ts
661
+ * import { createConfig, http } from '@wagmi/core'
662
+ * import { tempo } from '@wagmi/core/chains'
663
+ * import { Actions } from '@wagmi/core/tempo'
664
+ *
665
+ * const config = createConfig({
666
+ * chains: [tempoModerato],
667
+ * transports: {
668
+ * [tempo.id]: http(),
669
+ * },
670
+ * })
671
+ *
672
+ * const hash = await Actions.dex.sell(config, {
673
+ * amountIn: parseUnits('100', 6),
674
+ * minAmountOut: parseUnits('95', 6),
675
+ * tokenIn: '0x20c...11',
676
+ * tokenOut: '0x20c...20',
677
+ * })
678
+ * ```
679
+ *
680
+ * @param config - Config.
681
+ * @param parameters - Parameters.
682
+ * @returns The transaction hash.
683
+ */
684
+ export declare function sell<config extends Config>(config: config, parameters: sell.Parameters<config>): Promise<Actions.dex.sell.ReturnValue>;
685
+ export declare namespace sell {
686
+ type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionLooseOmit<Actions.dex.sell.Parameters<config['chains'][number], Account>, 'chain'>;
687
+ type ReturnValue = Actions.dex.sell.ReturnValue;
688
+ type ErrorType = BaseErrorType;
689
+ }
690
+ /**
691
+ * Sells a specific amount of tokens.
692
+ *
693
+ * Note: This is a synchronous action that waits for the transaction to
694
+ * be included on a block before returning a response.
695
+ *
696
+ * @example
697
+ * ```ts
698
+ * import { createConfig, http } from '@wagmi/core'
699
+ * import { tempo } from '@wagmi/core/chains'
700
+ * import { Actions } from '@wagmi/core/tempo'
701
+ *
702
+ * const config = createConfig({
703
+ * chains: [tempoModerato],
704
+ * transports: {
705
+ * [tempo.id]: http(),
706
+ * },
707
+ * })
708
+ *
709
+ * const result = await Actions.dex.sellSync(config, {
710
+ * amountIn: parseUnits('100', 6),
711
+ * minAmountOut: parseUnits('95', 6),
712
+ * tokenIn: '0x20c...11',
713
+ * tokenOut: '0x20c...20',
714
+ * })
715
+ * ```
716
+ *
717
+ * @param config - Config.
718
+ * @param parameters - Parameters.
719
+ * @returns The transaction receipt.
720
+ */
721
+ export declare function sellSync<config extends Config>(config: config, parameters: sellSync.Parameters<config>): Promise<Actions.dex.sellSync.ReturnValue>;
722
+ export declare namespace sellSync {
723
+ type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionLooseOmit<Actions.dex.sellSync.Parameters<config['chains'][number], Account>, 'chain'>;
724
+ type ReturnValue = Actions.dex.sellSync.ReturnValue;
725
+ type ErrorType = BaseErrorType;
726
+ }
727
+ /**
728
+ * Watches for flip order placement events on the DEX.
729
+ *
730
+ * @example
731
+ * ```ts
732
+ * import { createConfig, http } from '@wagmi/core'
733
+ * import { tempo } from '@wagmi/core/chains'
734
+ * import { Actions } from '@wagmi/core/tempo'
735
+ *
736
+ * const config = createConfig({
737
+ * chains: [tempoModerato],
738
+ * transports: {
739
+ * [tempo.id]: http(),
740
+ * },
741
+ * })
742
+ *
743
+ * const unwatch = Actions.dex.watchFlipOrderPlaced(config, {
744
+ * onFlipOrderPlaced: (args, log) => {
745
+ * console.log('Flip order placed:', args)
746
+ * },
747
+ * })
748
+ * ```
749
+ *
750
+ * @param config - Config.
751
+ * @param parameters - Parameters.
752
+ * @returns A function to unsubscribe from the event.
753
+ */
754
+ export declare function watchFlipOrderPlaced<config extends Config>(config: config, parameters: watchFlipOrderPlaced.Parameters<config>): import("viem").WatchContractEventReturnType;
755
+ export declare namespace watchFlipOrderPlaced {
756
+ type Parameters<config extends Config> = ChainIdParameter<config> & Actions.dex.watchFlipOrderPlaced.Parameters;
757
+ type Args = Actions.dex.watchFlipOrderPlaced.Args;
758
+ type Log = Actions.dex.watchFlipOrderPlaced.Log;
759
+ }
760
+ /**
761
+ * Watches for order cancellation events on the DEX.
762
+ *
763
+ * @example
764
+ * ```ts
765
+ * import { createConfig, http } from '@wagmi/core'
766
+ * import { tempo } from '@wagmi/core/chains'
767
+ * import { Actions } from '@wagmi/core/tempo'
768
+ *
769
+ * const config = createConfig({
770
+ * chains: [tempoModerato],
771
+ * transports: {
772
+ * [tempo.id]: http(),
773
+ * },
774
+ * })
775
+ *
776
+ * const unwatch = Actions.dex.watchOrderCancelled(config, {
777
+ * onOrderCancelled: (args, log) => {
778
+ * console.log('Order cancelled:', args)
779
+ * },
780
+ * })
781
+ * ```
782
+ *
783
+ * @param config - Config.
784
+ * @param parameters - Parameters.
785
+ * @returns A function to unsubscribe from the event.
786
+ */
787
+ export declare function watchOrderCancelled<config extends Config>(config: config, parameters: watchOrderCancelled.Parameters<config>): import("viem").WatchContractEventReturnType;
788
+ export declare namespace watchOrderCancelled {
789
+ type Parameters<config extends Config> = ChainIdParameter<config> & Actions.dex.watchOrderCancelled.Parameters;
790
+ type Args = Actions.dex.watchOrderCancelled.Args;
791
+ type Log = Actions.dex.watchOrderCancelled.Log;
792
+ }
793
+ /**
794
+ * Watches for order filled events on the DEX.
795
+ *
796
+ * @example
797
+ * ```ts
798
+ * import { createConfig, http } from '@wagmi/core'
799
+ * import { tempo } from '@wagmi/core/chains'
800
+ * import { Actions } from '@wagmi/core/tempo'
801
+ *
802
+ * const config = createConfig({
803
+ * chains: [tempoModerato],
804
+ * transports: {
805
+ * [tempo.id]: http(),
806
+ * },
807
+ * })
808
+ *
809
+ * const unwatch = Actions.dex.watchOrderFilled(config, {
810
+ * onOrderFilled: (args, log) => {
811
+ * console.log('Order filled:', args)
812
+ * },
813
+ * })
814
+ * ```
815
+ *
816
+ * @param config - Config.
817
+ * @param parameters - Parameters.
818
+ * @returns A function to unsubscribe from the event.
819
+ */
820
+ export declare function watchOrderFilled<config extends Config>(config: config, parameters: watchOrderFilled.Parameters<config>): import("viem").WatchContractEventReturnType;
821
+ export declare namespace watchOrderFilled {
822
+ type Parameters<config extends Config> = ChainIdParameter<config> & Actions.dex.watchOrderFilled.Parameters;
823
+ type Args = Actions.dex.watchOrderFilled.Args;
824
+ type Log = Actions.dex.watchOrderFilled.Log;
825
+ }
826
+ /**
827
+ * Watches for order placement events on the DEX.
828
+ *
829
+ * @example
830
+ * ```ts
831
+ * import { createConfig, http } from '@wagmi/core'
832
+ * import { tempo } from '@wagmi/core/chains'
833
+ * import { Actions } from '@wagmi/core/tempo'
834
+ *
835
+ * const config = createConfig({
836
+ * chains: [tempoModerato],
837
+ * transports: {
838
+ * [tempo.id]: http(),
839
+ * },
840
+ * })
841
+ *
842
+ * const unwatch = Actions.dex.watchOrderPlaced(config, {
843
+ * onOrderPlaced: (args, log) => {
844
+ * console.log('Order placed:', args)
845
+ * },
846
+ * })
847
+ * ```
848
+ *
849
+ * @param config - Config.
850
+ * @param parameters - Parameters.
851
+ * @returns A function to unsubscribe from the event.
852
+ */
853
+ export declare function watchOrderPlaced<config extends Config>(config: config, parameters: watchOrderPlaced.Parameters<config>): import("viem").WatchContractEventReturnType;
854
+ export declare namespace watchOrderPlaced {
855
+ type Parameters<config extends Config> = ChainIdParameter<config> & Actions.dex.watchOrderPlaced.Parameters;
856
+ type Args = Actions.dex.watchOrderPlaced.Args;
857
+ type Log = Actions.dex.watchOrderPlaced.Log;
858
+ }
859
+ /**
860
+ * Withdraws tokens from the DEX to the caller's wallet.
861
+ *
862
+ * @example
863
+ * ```ts
864
+ * import { createConfig, http } from '@wagmi/core'
865
+ * import { tempo } from '@wagmi/core/chains'
866
+ * import { Actions } from '@wagmi/core/tempo'
867
+ *
868
+ * const config = createConfig({
869
+ * chains: [tempoModerato],
870
+ * transports: {
871
+ * [tempo.id]: http(),
872
+ * },
873
+ * })
874
+ *
875
+ * const hash = await Actions.dex.withdraw(config, {
876
+ * amount: 100n,
877
+ * token: '0x20c...11',
878
+ * })
879
+ * ```
880
+ *
881
+ * @param config - Config.
882
+ * @param parameters - Parameters.
883
+ * @returns The transaction hash.
884
+ */
885
+ export declare function withdraw<config extends Config>(config: config, parameters: withdraw.Parameters<config>): Promise<Actions.dex.withdraw.ReturnValue>;
886
+ export declare namespace withdraw {
887
+ type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionLooseOmit<Actions.dex.withdraw.Parameters<config['chains'][number], Account>, 'chain'>;
888
+ type ReturnValue = Actions.dex.withdraw.ReturnValue;
889
+ type ErrorType = BaseErrorType;
890
+ }
891
+ /**
892
+ * Withdraws tokens from the DEX to the caller's wallet.
893
+ *
894
+ * Note: This is a synchronous action that waits for the transaction to
895
+ * be included on a block before returning a response.
896
+ *
897
+ * @example
898
+ * ```ts
899
+ * import { createConfig, http } from '@wagmi/core'
900
+ * import { tempo } from '@wagmi/core/chains'
901
+ * import { Actions } from '@wagmi/core/tempo'
902
+ *
903
+ * const config = createConfig({
904
+ * chains: [tempoModerato],
905
+ * transports: {
906
+ * [tempo.id]: http(),
907
+ * },
908
+ * })
909
+ *
910
+ * const result = await Actions.dex.withdrawSync(config, {
911
+ * amount: 100n,
912
+ * token: '0x20c...11',
913
+ * })
914
+ * ```
915
+ *
916
+ * @param config - Config.
917
+ * @param parameters - Parameters.
918
+ * @returns The transaction receipt and event data.
919
+ */
920
+ export declare function withdrawSync<config extends Config>(config: config, parameters: withdrawSync.Parameters<config>): Promise<Actions.dex.withdrawSync.ReturnValue>;
921
+ export declare namespace withdrawSync {
922
+ type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionLooseOmit<Actions.dex.withdrawSync.Parameters<config['chains'][number], Account>, 'chain'>;
923
+ type ReturnValue = Actions.dex.withdrawSync.ReturnValue;
924
+ type ErrorType = BaseErrorType;
925
+ }
926
+ //# sourceMappingURL=dex.d.ts.map