tempo.ts 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +28 -34
  3. package/package.json +2 -28
  4. package/dist/wagmi/Actions/amm.d.ts +0 -418
  5. package/dist/wagmi/Actions/amm.d.ts.map +0 -1
  6. package/dist/wagmi/Actions/amm.js +0 -462
  7. package/dist/wagmi/Actions/amm.js.map +0 -1
  8. package/dist/wagmi/Actions/dex.d.ts +0 -864
  9. package/dist/wagmi/Actions/dex.d.ts.map +0 -1
  10. package/dist/wagmi/Actions/dex.js +0 -968
  11. package/dist/wagmi/Actions/dex.js.map +0 -1
  12. package/dist/wagmi/Actions/faucet.d.ts +0 -66
  13. package/dist/wagmi/Actions/faucet.d.ts.map +0 -1
  14. package/dist/wagmi/Actions/faucet.js +0 -64
  15. package/dist/wagmi/Actions/faucet.js.map +0 -1
  16. package/dist/wagmi/Actions/fee.d.ts +0 -111
  17. package/dist/wagmi/Actions/fee.d.ts.map +0 -1
  18. package/dist/wagmi/Actions/fee.js +0 -126
  19. package/dist/wagmi/Actions/fee.js.map +0 -1
  20. package/dist/wagmi/Actions/index.d.ts +0 -9
  21. package/dist/wagmi/Actions/index.d.ts.map +0 -1
  22. package/dist/wagmi/Actions/index.js +0 -9
  23. package/dist/wagmi/Actions/index.js.map +0 -1
  24. package/dist/wagmi/Actions/nonce.d.ts +0 -77
  25. package/dist/wagmi/Actions/nonce.d.ts.map +0 -1
  26. package/dist/wagmi/Actions/nonce.js +0 -87
  27. package/dist/wagmi/Actions/nonce.js.map +0 -1
  28. package/dist/wagmi/Actions/policy.d.ts +0 -480
  29. package/dist/wagmi/Actions/policy.d.ts.map +0 -1
  30. package/dist/wagmi/Actions/policy.js +0 -530
  31. package/dist/wagmi/Actions/policy.js.map +0 -1
  32. package/dist/wagmi/Actions/reward.d.ts +0 -346
  33. package/dist/wagmi/Actions/reward.d.ts.map +0 -1
  34. package/dist/wagmi/Actions/reward.js +0 -382
  35. package/dist/wagmi/Actions/reward.js.map +0 -1
  36. package/dist/wagmi/Actions/token.d.ts +0 -1546
  37. package/dist/wagmi/Actions/token.d.ts.map +0 -1
  38. package/dist/wagmi/Actions/token.js +0 -1712
  39. package/dist/wagmi/Actions/token.js.map +0 -1
  40. package/dist/wagmi/Connector.d.ts +0 -91
  41. package/dist/wagmi/Connector.d.ts.map +0 -1
  42. package/dist/wagmi/Connector.js +0 -473
  43. package/dist/wagmi/Connector.js.map +0 -1
  44. package/dist/wagmi/Hooks/amm.d.ts +0 -411
  45. package/dist/wagmi/Hooks/amm.d.ts.map +0 -1
  46. package/dist/wagmi/Hooks/amm.js +0 -494
  47. package/dist/wagmi/Hooks/amm.js.map +0 -1
  48. package/dist/wagmi/Hooks/dex.d.ts +0 -773
  49. package/dist/wagmi/Hooks/dex.d.ts.map +0 -1
  50. package/dist/wagmi/Hooks/dex.js +0 -921
  51. package/dist/wagmi/Hooks/dex.js.map +0 -1
  52. package/dist/wagmi/Hooks/faucet.d.ts +0 -71
  53. package/dist/wagmi/Hooks/faucet.d.ts.map +0 -1
  54. package/dist/wagmi/Hooks/faucet.js +0 -76
  55. package/dist/wagmi/Hooks/faucet.js.map +0 -1
  56. package/dist/wagmi/Hooks/fee.d.ts +0 -97
  57. package/dist/wagmi/Hooks/fee.d.ts.map +0 -1
  58. package/dist/wagmi/Hooks/fee.js +0 -109
  59. package/dist/wagmi/Hooks/fee.js.map +0 -1
  60. package/dist/wagmi/Hooks/index.d.ts +0 -9
  61. package/dist/wagmi/Hooks/index.d.ts.map +0 -1
  62. package/dist/wagmi/Hooks/index.js +0 -9
  63. package/dist/wagmi/Hooks/index.js.map +0 -1
  64. package/dist/wagmi/Hooks/nonce.d.ts +0 -59
  65. package/dist/wagmi/Hooks/nonce.d.ts.map +0 -1
  66. package/dist/wagmi/Hooks/nonce.js +0 -75
  67. package/dist/wagmi/Hooks/nonce.js.map +0 -1
  68. package/dist/wagmi/Hooks/policy.d.ts +0 -423
  69. package/dist/wagmi/Hooks/policy.d.ts.map +0 -1
  70. package/dist/wagmi/Hooks/policy.js +0 -510
  71. package/dist/wagmi/Hooks/policy.js.map +0 -1
  72. package/dist/wagmi/Hooks/reward.d.ts +0 -305
  73. package/dist/wagmi/Hooks/reward.d.ts.map +0 -1
  74. package/dist/wagmi/Hooks/reward.js +0 -368
  75. package/dist/wagmi/Hooks/reward.js.map +0 -1
  76. package/dist/wagmi/Hooks/token.d.ts +0 -1388
  77. package/dist/wagmi/Hooks/token.d.ts.map +0 -1
  78. package/dist/wagmi/Hooks/token.js +0 -1657
  79. package/dist/wagmi/Hooks/token.js.map +0 -1
  80. package/dist/wagmi/KeyManager.d.ts +0 -60
  81. package/dist/wagmi/KeyManager.d.ts.map +0 -1
  82. package/dist/wagmi/KeyManager.js +0 -106
  83. package/dist/wagmi/KeyManager.js.map +0 -1
  84. package/dist/wagmi/index.d.ts +0 -5
  85. package/dist/wagmi/index.d.ts.map +0 -1
  86. package/dist/wagmi/index.js +0 -5
  87. package/dist/wagmi/index.js.map +0 -1
  88. package/src/wagmi/Actions/amm.test.ts +0 -208
  89. package/src/wagmi/Actions/amm.ts +0 -690
  90. package/src/wagmi/Actions/dex.test.ts +0 -1482
  91. package/src/wagmi/Actions/dex.ts +0 -1540
  92. package/src/wagmi/Actions/faucet.ts +0 -89
  93. package/src/wagmi/Actions/fee.test.ts +0 -63
  94. package/src/wagmi/Actions/fee.ts +0 -211
  95. package/src/wagmi/Actions/index.ts +0 -8
  96. package/src/wagmi/Actions/nonce.test.ts +0 -82
  97. package/src/wagmi/Actions/nonce.ts +0 -139
  98. package/src/wagmi/Actions/policy.test.ts +0 -461
  99. package/src/wagmi/Actions/policy.ts +0 -817
  100. package/src/wagmi/Actions/reward.test.ts +0 -216
  101. package/src/wagmi/Actions/reward.ts +0 -613
  102. package/src/wagmi/Actions/token.test.ts +0 -1309
  103. package/src/wagmi/Actions/token.ts +0 -2644
  104. package/src/wagmi/Connector.test.ts +0 -56
  105. package/src/wagmi/Connector.ts +0 -670
  106. package/src/wagmi/Hooks/amm.test.ts +0 -564
  107. package/src/wagmi/Hooks/amm.ts +0 -796
  108. package/src/wagmi/Hooks/dex.test.ts +0 -992
  109. package/src/wagmi/Hooks/dex.ts +0 -1598
  110. package/src/wagmi/Hooks/faucet.ts +0 -144
  111. package/src/wagmi/Hooks/fee.test.ts +0 -166
  112. package/src/wagmi/Hooks/fee.ts +0 -206
  113. package/src/wagmi/Hooks/index.ts +0 -8
  114. package/src/wagmi/Hooks/nonce.test.ts +0 -142
  115. package/src/wagmi/Hooks/nonce.ts +0 -117
  116. package/src/wagmi/Hooks/policy.test.ts +0 -665
  117. package/src/wagmi/Hooks/policy.ts +0 -873
  118. package/src/wagmi/Hooks/reward.test.ts +0 -249
  119. package/src/wagmi/Hooks/reward.ts +0 -645
  120. package/src/wagmi/Hooks/token.test.ts +0 -1183
  121. package/src/wagmi/Hooks/token.ts +0 -2906
  122. package/src/wagmi/KeyManager.ts +0 -172
  123. package/src/wagmi/index.ts +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # tempo.ts
2
2
 
3
+ ## 0.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#136](https://github.com/tempoxyz/tempo-ts/pull/136) [`ef17d58`](https://github.com/tempoxyz/tempo-ts/commit/ef17d58d213a675dd1e3e43dd844be5699a2ff47) Thanks [@tmm](https://github.com/tmm)! - **Breaking:** As of `wagmi@3.2.0` and `@wagmi/core@3.1.0`, `tempo.ts/wagmi` has been upstreamed into `wagmi` and `@wagmi/core`, and is no longer maintained in this repository.
8
+
9
+ ```bash
10
+ pnpm i wagmi@3.2.0
11
+ pnpm i @wagmi/core@3.1.0
12
+ ```
13
+
14
+ Import from the `/tempo` entrypoint.
15
+
16
+ ```diff
17
+ - import { Actions, Hooks } from 'tempo.ts/wagmi'
18
+ + import { Actions, Hooks } from 'wagmi/tempo'
19
+ - import { Actions } from 'tempo.ts/wagmi'
20
+ + import { Actions } from '@wagmi/core/tempo'
21
+ ```
22
+
23
+ ## 0.12.1
24
+
25
+ ### Patch Changes
26
+
27
+ - [`10eb044`](https://github.com/tempoxyz/tempo-ts/commit/10eb044b5c9b218e81a94b8642c0d40309c87792) Thanks [@jxom](https://github.com/jxom)! - Bumped `viem` peer dep range.
28
+
3
29
  ## 0.12.0
4
30
 
5
31
  ### Minor Changes
package/README.md CHANGED
@@ -27,45 +27,39 @@ pnpm i tempo.ts
27
27
 
28
28
  ## Entrypoints
29
29
 
30
- | Entrypoint | Description |
31
- | ---------------- | ---------------------------------------- |
32
- | `tempo.ts/wagmi` | Tempo actions/hooks for Wagmi. |
30
+ | Entrypoint | Description |
31
+ | ----------------- | ---------------------------------------- |
32
+ | `tempo.ts/server` | Framework-agnostic server handlers. |
33
33
 
34
34
  ## Usage
35
35
 
36
- ### `tempo.ts/wagmi`
36
+ ### `tempo.ts/server`
37
37
 
38
38
  ```ts
39
- import { createConfig, http } from 'wagmi';
40
- import { tempoTestnet } from 'viem/chains';
41
- import { Actions, Hooks, KeyManager, webauthn } from 'tempo.ts/wagmi';
42
-
43
- export const config = createConfig({
44
- chains: [tempoTestnet.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })],
45
- connectors: [
46
- webAuthn({
47
- keyManager: KeyManager.localStorage(),
48
- })
49
- ],
50
- transports: {
51
- [tempoTestnet.id]: http(),
52
- },
53
- });
54
-
55
- const { receipt } = await Actions.dex.buySync(config, {
56
- tokenIn: '0x...',
57
- tokenOut: '0x...',
58
- amountOut: parseEther('100'),
59
- maxAmountIn: parseEther('150'),
60
- });
61
-
62
- const { data, mutate } = Hooks.dex.useBuySync();
63
- mutate({
64
- tokenIn: '0x...',
65
- tokenOut: '0x...',
66
- amountOut: parseEther('100'),
67
- maxAmountIn: parseEther('150'),
68
- });
39
+ import { Handler } from 'tempo.ts/server'
40
+ import { account, client } from './config'
41
+
42
+ const handler = Handler.feePayer({
43
+ account,
44
+ client,
45
+ feeToken: '0x20c0…0001'
46
+ path: '/fee-payer',
47
+ })
48
+
49
+ createServer(handler.listener) // Node.js
50
+
51
+ Bun.serve(handler) // Bun
52
+
53
+ Deno.serve(handler) // Deno
54
+
55
+ app.all('*', c => handler.fetch(c.request)) // Elysia
56
+
57
+ app.use(handler.listener) // Express
58
+
59
+ app.use(c => handler.fetch(c.req.raw)) // Hono
60
+
61
+ export const GET = handler.fetch // Next.js
62
+ export const POST = handler.fetch // Next.js
69
63
  ```
70
64
 
71
65
  ## Contributing
package/package.json CHANGED
@@ -1,38 +1,17 @@
1
1
  {
2
2
  "name": "tempo.ts",
3
3
  "type": "module",
4
- "version": "0.12.0",
4
+ "version": "0.13.0",
5
5
  "dependencies": {
6
6
  "@remix-run/fetch-router": "~0.12.0",
7
- "idb-keyval": "^6.2.2",
8
7
  "ox": "~0.11.1"
9
8
  },
10
9
  "peerDependencies": {
11
- "@tanstack/query-core": ">=5.0.0",
12
- "@tanstack/react-query": ">=5.0.0",
13
- "@wagmi/core": ">=2.18",
14
- "prool": "^0",
15
- "viem": ">=2.41.2",
16
- "wagmi": ">=2.19"
10
+ "viem": ">=2.43.3"
17
11
  },
18
12
  "peerDependenciesMeta": {
19
- "@tanstack/react-query": {
20
- "optional": true
21
- },
22
- "@tanstack/query-core": {
23
- "optional": true
24
- },
25
- "@wagmi/core": {
26
- "optional": true
27
- },
28
- "prool": {
29
- "optional": true
30
- },
31
13
  "viem": {
32
14
  "optional": true
33
- },
34
- "wagmi": {
35
- "optional": true
36
15
  }
37
16
  },
38
17
  "repository": {
@@ -58,11 +37,6 @@
58
37
  "src": "./src/server/index.ts",
59
38
  "types": "./dist/server/index.d.ts",
60
39
  "default": "./dist/server/index.js"
61
- },
62
- "./wagmi": {
63
- "src": "./src/wagmi/index.ts",
64
- "types": "./dist/wagmi/index.d.ts",
65
- "default": "./dist/wagmi/index.js"
66
40
  }
67
41
  }
68
42
  }
@@ -1,418 +0,0 @@
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 { Account } from 'viem';
5
- import { Actions } from 'viem/tempo';
6
- import type { RequiredBy, UnionOmit } from '../../internal/types.js';
7
- /**
8
- * Gets the reserves for a liquidity pool.
9
- *
10
- * @example
11
- * ```ts
12
- * import { createConfig, http } from '@wagmi/core'
13
- * import { tempo } from 'viem/chains'
14
- * import { Actions } from 'tempo.ts/wagmi'
15
- *
16
- * const config = createConfig({
17
- * chains: [tempoTestnet],
18
- * transports: {
19
- * [tempo.id]: http(),
20
- * },
21
- * })
22
- *
23
- * const pool = await Actions.amm.getPool(config, {
24
- * userToken: '0x...',
25
- * validatorToken: '0x...',
26
- * })
27
- * ```
28
- *
29
- * @param config - Config.
30
- * @param parameters - Parameters.
31
- * @returns The pool reserves.
32
- */
33
- export declare function getPool<config extends Config>(config: config, parameters: getPool.Parameters<config>): Promise<{
34
- reserveUserToken: bigint;
35
- reserveValidatorToken: bigint;
36
- totalSupply: bigint;
37
- }>;
38
- export declare namespace getPool {
39
- type Parameters<config extends Config> = ChainIdParameter<config> & Actions.amm.getPool.Parameters;
40
- type ReturnValue = Actions.amm.getPool.ReturnValue;
41
- function queryKey<config extends Config>(parameters: Parameters<config>): readonly ["getPool", Parameters<config>];
42
- type QueryKey<config extends Config> = ReturnType<typeof queryKey<config>>;
43
- function queryOptions<config extends Config, selectData = ReturnValue>(config: Config, parameters: queryOptions.Parameters<config, selectData>): queryOptions.ReturnValue<config, selectData>;
44
- namespace queryOptions {
45
- type Parameters<config extends Config, selectData = getPool.ReturnValue> = getPool.Parameters<config> & {
46
- query?: Omit<ReturnValue<config, selectData>, 'queryKey' | 'queryFn'> | undefined;
47
- };
48
- type ReturnValue<config extends Config, selectData = getPool.ReturnValue> = RequiredBy<Query.QueryOptions<getPool.ReturnValue, Query.DefaultError, selectData, getPool.QueryKey<config>>, 'queryKey' | 'queryFn'>;
49
- }
50
- }
51
- /**
52
- * Gets the LP token balance for an account in a specific pool.
53
- *
54
- * @example
55
- * ```ts
56
- * import { createConfig, http } from '@wagmi/core'
57
- * import { tempo } from 'viem/chains'
58
- * import { Actions } from 'tempo.ts/wagmi'
59
- *
60
- * const config = createConfig({
61
- * chains: [tempoTestnet],
62
- * transports: {
63
- * [tempo.id]: http(),
64
- * },
65
- * })
66
- *
67
- * const poolId = await Actions.amm.getPoolId(config, {
68
- * userToken: '0x...',
69
- * validatorToken: '0x...',
70
- * })
71
- *
72
- * const balance = await Actions.amm.getLiquidityBalance(config, {
73
- * poolId,
74
- * address: '0x...',
75
- * })
76
- * ```
77
- *
78
- * @param config - Config.
79
- * @param parameters - Parameters.
80
- * @returns The LP token balance.
81
- */
82
- export declare function getLiquidityBalance<config extends Config>(config: config, parameters: getLiquidityBalance.Parameters<config>): Promise<bigint>;
83
- export declare namespace getLiquidityBalance {
84
- type Parameters<config extends Config> = ChainIdParameter<config> & Actions.amm.getLiquidityBalance.Parameters;
85
- type ReturnValue = Actions.amm.getLiquidityBalance.ReturnValue;
86
- function queryKey<config extends Config>(parameters: Parameters<config>): readonly ["getLiquidityBalance", Parameters<config>];
87
- type QueryKey<config extends Config> = ReturnType<typeof queryKey<config>>;
88
- function queryOptions<config extends Config, selectData = ReturnValue>(config: Config, parameters: queryOptions.Parameters<config, selectData>): queryOptions.ReturnValue<config, selectData>;
89
- namespace queryOptions {
90
- type Parameters<config extends Config, selectData = getLiquidityBalance.ReturnValue> = getLiquidityBalance.Parameters<config> & {
91
- query?: Omit<ReturnValue<config, selectData>, 'queryKey' | 'queryFn'> | undefined;
92
- };
93
- type ReturnValue<config extends Config, selectData = getLiquidityBalance.ReturnValue> = RequiredBy<Query.QueryOptions<getLiquidityBalance.ReturnValue, Query.DefaultError, selectData, getLiquidityBalance.QueryKey<config>>, 'queryKey' | 'queryFn'>;
94
- }
95
- }
96
- /**
97
- * Performs a rebalance swap from validator token to user token.
98
- *
99
- * @example
100
- * ```ts
101
- * import { createConfig, http } from '@wagmi/core'
102
- * import { tempo } from 'viem/chains'
103
- * import { Actions } from 'tempo.ts/wagmi'
104
- *
105
- * const config = createConfig({
106
- * chains: [tempoTestnet],
107
- * transports: {
108
- * [tempo.id]: http(),
109
- * },
110
- * })
111
- *
112
- * const hash = await Actions.amm.rebalanceSwap(config, {
113
- * userToken: '0x...',
114
- * validatorToken: '0x...',
115
- * amountOut: 100n,
116
- * to: '0x...',
117
- * })
118
- * ```
119
- *
120
- * @param config - Config.
121
- * @param parameters - Parameters.
122
- * @returns The transaction hash.
123
- */
124
- export declare function rebalanceSwap<config extends Config>(config: config, parameters: rebalanceSwap.Parameters<config>): Promise<Actions.amm.rebalanceSwap.ReturnValue>;
125
- export declare namespace rebalanceSwap {
126
- type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionOmit<Actions.amm.rebalanceSwap.Parameters<config['chains'][number], Account>, 'chain'>;
127
- type ReturnValue = Actions.amm.rebalanceSwap.ReturnValue;
128
- }
129
- /**
130
- * Performs a rebalance swap from validator token to user token.
131
- *
132
- * @example
133
- * ```ts
134
- * import { createConfig, http } from '@wagmi/core'
135
- * import { tempo } from 'viem/chains'
136
- * import { Actions } from 'tempo.ts/wagmi'
137
- *
138
- * const config = createConfig({
139
- * chains: [tempoTestnet],
140
- * transports: {
141
- * [tempo.id]: http(),
142
- * },
143
- * })
144
- *
145
- * const result = await Actions.amm.rebalanceSwapSync(config, {
146
- * userToken: '0x...',
147
- * validatorToken: '0x...',
148
- * amountOut: 100n,
149
- * to: '0x...',
150
- * })
151
- * ```
152
- *
153
- * @param config - Config.
154
- * @param parameters - Parameters.
155
- * @returns The transaction receipt and event data.
156
- */
157
- export declare function rebalanceSwapSync<config extends Config>(config: config, parameters: rebalanceSwapSync.Parameters<config>): Promise<Actions.amm.rebalanceSwapSync.ReturnValue>;
158
- export declare namespace rebalanceSwapSync {
159
- type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionOmit<Actions.amm.rebalanceSwapSync.Parameters<config['chains'][number], Account>, 'chain'>;
160
- type ReturnValue = Actions.amm.rebalanceSwapSync.ReturnValue;
161
- }
162
- /**
163
- * Adds liquidity to a pool.
164
- *
165
- * @example
166
- * ```ts
167
- * import { createConfig, http } from '@wagmi/core'
168
- * import { tempo } from 'viem/chains'
169
- * import { Actions } from 'tempo.ts/wagmi'
170
- *
171
- * const config = createConfig({
172
- * chains: [tempoTestnet],
173
- * transports: {
174
- * [tempo.id]: http(),
175
- * },
176
- * })
177
- *
178
- * const hash = await Actions.amm.mint(config, {
179
- * userTokenAddress: '0x20c0...beef',
180
- * validatorTokenAddress: '0x20c0...babe',
181
- * validatorTokenAmount: 100n,
182
- * to: '0xfeed...fede',
183
- * })
184
- * ```
185
- *
186
- * @param config - Config.
187
- * @param parameters - Parameters.
188
- * @returns The transaction hash.
189
- */
190
- export declare function mint<config extends Config>(config: config, parameters: mint.Parameters<config>): Promise<Actions.amm.mint.ReturnValue>;
191
- export declare namespace mint {
192
- type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionOmit<Actions.amm.mint.Parameters<config['chains'][number], Account>, 'chain'>;
193
- type ReturnValue = Actions.amm.mint.ReturnValue;
194
- }
195
- /**
196
- * Adds liquidity to a pool.
197
- *
198
- * @example
199
- * ```ts
200
- * import { createConfig, http } from '@wagmi/core'
201
- * import { tempo } from 'viem/chains'
202
- * import { Actions } from 'tempo.ts/wagmi'
203
- *
204
- * const config = createConfig({
205
- * chains: [tempoTestnet],
206
- * transports: {
207
- * [tempo.id]: http(),
208
- * },
209
- * })
210
- *
211
- * const result = await Actions.amm.mintSync(config, {
212
- * userTokenAddress: '0x20c0...beef',
213
- * validatorTokenAddress: '0x20c0...babe',
214
- * validatorTokenAmount: 100n,
215
- * to: '0xfeed...fede',
216
- * })
217
- * ```
218
- *
219
- * @param config - Config.
220
- * @param parameters - Parameters.
221
- * @returns The transaction receipt and event data.
222
- */
223
- export declare function mintSync<config extends Config>(config: config, parameters: mintSync.Parameters<config>): Promise<Actions.amm.mintSync.ReturnValue>;
224
- export declare namespace mintSync {
225
- type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionOmit<Actions.amm.mintSync.Parameters<config['chains'][number], Account>, 'chain'>;
226
- type ReturnValue = Actions.amm.mintSync.ReturnValue;
227
- }
228
- /**
229
- * Removes liquidity from a pool.
230
- *
231
- * @example
232
- * ```ts
233
- * import { createConfig, http } from '@wagmi/core'
234
- * import { tempo } from 'viem/chains'
235
- * import { Actions } from 'tempo.ts/wagmi'
236
- *
237
- * const config = createConfig({
238
- * chains: [tempoTestnet],
239
- * transports: {
240
- * [tempo.id]: http(),
241
- * },
242
- * })
243
- *
244
- * const hash = await Actions.amm.burn(config, {
245
- * userToken: '0x20c0...beef',
246
- * validatorToken: '0x20c0...babe',
247
- * liquidity: 50n,
248
- * to: '0xfeed...fede',
249
- * })
250
- * ```
251
- *
252
- * @param config - Config.
253
- * @param parameters - Parameters.
254
- * @returns The transaction hash.
255
- */
256
- export declare function burn<config extends Config>(config: config, parameters: burn.Parameters<config>): Promise<Actions.amm.burn.ReturnValue>;
257
- export declare namespace burn {
258
- type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionOmit<Actions.amm.burn.Parameters<config['chains'][number], Account>, 'chain'>;
259
- type ReturnValue = Actions.amm.burn.ReturnValue;
260
- }
261
- /**
262
- * Removes liquidity from a pool.
263
- *
264
- * @example
265
- * ```ts
266
- * import { createConfig, http } from '@wagmi/core'
267
- * import { tempo } from 'viem/chains'
268
- * import { Actions } from 'tempo.ts/wagmi'
269
- *
270
- * const config = createConfig({
271
- * chains: [tempoTestnet],
272
- * transports: {
273
- * [tempo.id]: http(),
274
- * },
275
- * })
276
- *
277
- * const result = await Actions.amm.burnSync(config, {
278
- * userToken: '0x20c0...beef',
279
- * validatorToken: '0x20c0...babe',
280
- * liquidity: 50n,
281
- * to: '0xfeed...fede',
282
- * })
283
- * ```
284
- *
285
- * @param config - Config.
286
- * @param parameters - Parameters.
287
- * @returns The transaction receipt and event data.
288
- */
289
- export declare function burnSync<config extends Config>(config: config, parameters: burnSync.Parameters<config>): Promise<Actions.amm.burnSync.ReturnValue>;
290
- export declare namespace burnSync {
291
- type Parameters<config extends Config> = ChainIdParameter<config> & ConnectorParameter & UnionOmit<Actions.amm.burnSync.Parameters<config['chains'][number], Account>, 'chain'>;
292
- type ReturnValue = Actions.amm.burnSync.ReturnValue;
293
- }
294
- /**
295
- * Watches for rebalance swap events.
296
- *
297
- * @example
298
- * ```ts
299
- * import { createConfig, http } from '@wagmi/core'
300
- * import { tempo } from 'viem/chains'
301
- * import { Actions } from 'tempo.ts/wagmi'
302
- *
303
- * const config = createConfig({
304
- * chains: [tempoTestnet],
305
- * transports: {
306
- * [tempo.id]: http(),
307
- * },
308
- * })
309
- *
310
- * const unwatch = Actions.amm.watchRebalanceSwap(config, {
311
- * onRebalanceSwap: (args, log) => {
312
- * console.log('Rebalance swap:', args)
313
- * },
314
- * })
315
- * ```
316
- *
317
- * @param config - Config.
318
- * @param parameters - Parameters.
319
- * @returns A function to unsubscribe from the event.
320
- */
321
- export declare function watchRebalanceSwap<config extends Config>(config: config, parameters: watchRebalanceSwap.Parameters<config>): import("viem").WatchContractEventReturnType;
322
- export declare namespace watchRebalanceSwap {
323
- type Parameters<config extends Config> = ChainIdParameter<config> & Actions.amm.watchRebalanceSwap.Parameters;
324
- }
325
- /**
326
- * Watches for fee swap events.
327
- *
328
- * @example
329
- * ```ts
330
- * import { createConfig, http } from '@wagmi/core'
331
- * import { tempo } from 'viem/chains'
332
- * import { Actions } from 'tempo.ts/wagmi'
333
- *
334
- * const config = createConfig({
335
- * chains: [tempoTestnet],
336
- * transports: {
337
- * [tempo.id]: http(),
338
- * },
339
- * })
340
- *
341
- * const unwatch = Actions.amm.watchFeeSwap(config, {
342
- * onFeeSwap: (args, log) => {
343
- * console.log('Fee swap:', args)
344
- * },
345
- * })
346
- * ```
347
- *
348
- * @param config - Config.
349
- * @param parameters - Parameters.
350
- * @returns A function to unsubscribe from the event.
351
- */
352
- export declare function watchFeeSwap<config extends Config>(config: config, parameters: watchFeeSwap.Parameters<config>): import("viem").WatchContractEventReturnType;
353
- export declare namespace watchFeeSwap {
354
- type Parameters<config extends Config> = ChainIdParameter<config> & Actions.amm.watchFeeSwap.Parameters;
355
- }
356
- /**
357
- * Watches for liquidity mint events.
358
- *
359
- * @example
360
- * ```ts
361
- * import { createConfig, http } from '@wagmi/core'
362
- * import { tempo } from 'viem/chains'
363
- * import { Actions } from 'tempo.ts/wagmi'
364
- *
365
- * const config = createConfig({
366
- * chains: [tempoTestnet],
367
- * transports: {
368
- * [tempo.id]: http(),
369
- * },
370
- * })
371
- *
372
- * const unwatch = Actions.amm.watchMint(config, {
373
- * onMint: (args, log) => {
374
- * console.log('Liquidity added:', args)
375
- * },
376
- * })
377
- * ```
378
- *
379
- * @param config - Config.
380
- * @param parameters - Parameters.
381
- * @returns A function to unsubscribe from the event.
382
- */
383
- export declare function watchMint<config extends Config>(config: config, parameters: watchMint.Parameters<config>): import("viem").WatchContractEventReturnType;
384
- export declare namespace watchMint {
385
- type Parameters<config extends Config> = ChainIdParameter<config> & Actions.amm.watchMint.Parameters;
386
- }
387
- /**
388
- * Watches for liquidity burn events.
389
- *
390
- * @example
391
- * ```ts
392
- * import { createConfig, http } from '@wagmi/core'
393
- * import { tempo } from 'viem/chains'
394
- * import { Actions } from 'tempo.ts/wagmi'
395
- *
396
- * const config = createConfig({
397
- * chains: [tempoTestnet],
398
- * transports: {
399
- * [tempo.id]: http(),
400
- * },
401
- * })
402
- *
403
- * const unwatch = Actions.amm.watchBurn(config, {
404
- * onBurn: (args, log) => {
405
- * console.log('Liquidity removed:', args)
406
- * },
407
- * })
408
- * ```
409
- *
410
- * @param config - Config.
411
- * @param parameters - Parameters.
412
- * @returns A function to unsubscribe from the event.
413
- */
414
- export declare function watchBurn<config extends Config>(config: config, parameters: watchBurn.Parameters<config>): import("viem").WatchContractEventReturnType;
415
- export declare namespace watchBurn {
416
- type Parameters<config extends Config> = ChainIdParameter<config> & Actions.amm.watchBurn.Parameters;
417
- }
418
- //# sourceMappingURL=amm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"amm.d.ts","sourceRoot":"","sources":["../../../src/wagmi/Actions/amm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,KAAK,MAAM,EAAsB,MAAM,aAAa,CAAA;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAChF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,OAAO,CAAC,MAAM,SAAS,MAAM,EAC3C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;;;;GAKvC;AAED,yBAAiB,OAAO,CAAC;IACvB,KAAY,UAAU,CAAC,MAAM,SAAS,MAAM,IAAI,gBAAgB,CAAC,MAAM,CAAC,GACtE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAA;IAEhC,KAAY,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAA;IAEzD,SAAgB,QAAQ,CAAC,MAAM,SAAS,MAAM,EAC5C,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,4CAG/B;IAED,KAAY,QAAQ,CAAC,MAAM,SAAS,MAAM,IAAI,UAAU,CACtD,OAAO,QAAQ,CAAC,MAAM,CAAC,CACxB,CAAA;IAED,SAAgB,YAAY,CAAC,MAAM,SAAS,MAAM,EAAE,UAAU,GAAG,WA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