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