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