tempo.ts 0.11.0 → 0.11.1
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.
- package/CHANGELOG.md +6 -0
- package/dist/chains.d.ts +73 -0
- package/dist/chains.d.ts.map +1 -0
- package/dist/chains.js +51 -0
- package/dist/chains.js.map +1 -0
- package/dist/viem/Actions/account.d.ts +40 -0
- package/dist/viem/Actions/account.d.ts.map +1 -0
- package/dist/viem/Actions/account.js +86 -0
- package/dist/viem/Actions/account.js.map +1 -0
- package/dist/viem/Actions/index.d.ts +10 -0
- package/dist/viem/Actions/index.d.ts.map +1 -0
- package/dist/viem/Actions/index.js +10 -0
- package/dist/viem/Actions/index.js.map +1 -0
- package/dist/viem/Decorator.d.ts +2783 -0
- package/dist/viem/Decorator.d.ts.map +1 -0
- package/dist/viem/Decorator.js +137 -0
- package/dist/viem/Decorator.js.map +1 -0
- package/dist/viem/P256.d.ts +2 -0
- package/dist/viem/P256.d.ts.map +1 -0
- package/dist/viem/P256.js +2 -0
- package/dist/viem/P256.js.map +1 -0
- package/dist/viem/Secp256k1.d.ts +2 -0
- package/dist/viem/Secp256k1.d.ts.map +1 -0
- package/dist/viem/Secp256k1.js +2 -0
- package/dist/viem/Secp256k1.js.map +1 -0
- package/dist/viem/TokenIds.d.ts +2 -0
- package/dist/viem/TokenIds.d.ts.map +1 -0
- package/dist/viem/TokenIds.js +2 -0
- package/dist/viem/TokenIds.js.map +1 -0
- package/dist/viem/index.d.ts +26 -0
- package/dist/viem/index.d.ts.map +1 -0
- package/dist/viem/index.js +17 -0
- package/dist/viem/index.js.map +1 -0
- package/package.json +11 -1
|
@@ -0,0 +1,2783 @@
|
|
|
1
|
+
import type { Account, Chain, Client, Transport } from 'viem';
|
|
2
|
+
import type { VerifyHashParameters, VerifyHashReturnType } from 'viem/actions';
|
|
3
|
+
import type { PartialBy } from '../internal/types.js';
|
|
4
|
+
import * as ammActions from './Actions/amm.js';
|
|
5
|
+
import * as dexActions from './Actions/dex.js';
|
|
6
|
+
import * as faucetActions from './Actions/faucet.js';
|
|
7
|
+
import * as feeActions from './Actions/fee.js';
|
|
8
|
+
import * as policyActions from './Actions/policy.js';
|
|
9
|
+
import * as rewardActions from './Actions/reward.js';
|
|
10
|
+
import * as tokenActions from './Actions/token.js';
|
|
11
|
+
export type Decorator<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = {
|
|
12
|
+
/**
|
|
13
|
+
* Verifies that a signature is valid for a given hash and address.
|
|
14
|
+
* Supports Secp256k1, P256, WebCrypto P256, and WebAuthn signatures.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { createClient, http } from 'viem'
|
|
19
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
20
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
21
|
+
*
|
|
22
|
+
* const client = createClient({
|
|
23
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
24
|
+
* transport: http(),
|
|
25
|
+
* }).extend(tempoActions())
|
|
26
|
+
*
|
|
27
|
+
* const valid = await client.verifyHash({
|
|
28
|
+
* address: '0x...',
|
|
29
|
+
* hash: '0x...',
|
|
30
|
+
* signature: '0x...',
|
|
31
|
+
* })
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @param parameters - Parameters.
|
|
35
|
+
* @returns Whether the signature is valid.
|
|
36
|
+
*/
|
|
37
|
+
verifyHash: (parameters: PartialBy<VerifyHashParameters, 'address'>) => Promise<VerifyHashReturnType>;
|
|
38
|
+
amm: {
|
|
39
|
+
/**
|
|
40
|
+
* Gets the reserves for a liquidity pool.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* import { createClient, http } from 'viem'
|
|
45
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
46
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
47
|
+
*
|
|
48
|
+
* const client = createClient({
|
|
49
|
+
* chain: tempo({ feeToken: '0x20c...001' }),
|
|
50
|
+
* transport: http(),
|
|
51
|
+
* }).extend(tempoActions())
|
|
52
|
+
*
|
|
53
|
+
* const pool = await client.amm.getPool({
|
|
54
|
+
* userToken: '0x...',
|
|
55
|
+
* validatorToken: '0x...',
|
|
56
|
+
* })
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @param parameters - Parameters.
|
|
60
|
+
* @returns The pool reserves.
|
|
61
|
+
*/
|
|
62
|
+
getPool: (parameters: ammActions.getPool.Parameters) => Promise<ammActions.getPool.ReturnValue>;
|
|
63
|
+
/**
|
|
64
|
+
* Gets the LP token balance for an account in a specific pool.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* import { createClient, http } from 'viem'
|
|
69
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
70
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
71
|
+
*
|
|
72
|
+
* const client = createClient({
|
|
73
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
74
|
+
* transport: http(),
|
|
75
|
+
* }).extend(tempoActions())
|
|
76
|
+
*
|
|
77
|
+
* const poolId = await client.amm.getPoolId({
|
|
78
|
+
* userToken: '0x...',
|
|
79
|
+
* validatorToken: '0x...',
|
|
80
|
+
* })
|
|
81
|
+
*
|
|
82
|
+
* const balance = await client.amm.getLiquidityBalance({
|
|
83
|
+
* poolId,
|
|
84
|
+
* address: '0x...',
|
|
85
|
+
* })
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @param parameters - Parameters.
|
|
89
|
+
* @returns The LP token balance.
|
|
90
|
+
*/
|
|
91
|
+
getLiquidityBalance: (parameters: ammActions.getLiquidityBalance.Parameters) => Promise<ammActions.getLiquidityBalance.ReturnValue>;
|
|
92
|
+
/**
|
|
93
|
+
* Removes liquidity from a pool.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* import { createClient, http } from 'viem'
|
|
98
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
99
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
100
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
101
|
+
*
|
|
102
|
+
* const client = createClient({
|
|
103
|
+
* account: privateKeyToAccount('0x...'),
|
|
104
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
105
|
+
* transport: http(),
|
|
106
|
+
* }).extend(tempoActions())
|
|
107
|
+
*
|
|
108
|
+
* const hash = await client.amm.burn({
|
|
109
|
+
* userToken: '0x...',
|
|
110
|
+
* validatorToken: '0x...',
|
|
111
|
+
* liquidity: 50n,
|
|
112
|
+
* to: '0x...',
|
|
113
|
+
* })
|
|
114
|
+
* ```
|
|
115
|
+
*
|
|
116
|
+
* @param parameters - Parameters.
|
|
117
|
+
* @returns The transaction hash.
|
|
118
|
+
*/
|
|
119
|
+
burn: (parameters: ammActions.burn.Parameters<chain, account>) => Promise<ammActions.burn.ReturnValue>;
|
|
120
|
+
/**
|
|
121
|
+
* Removes liquidity from a pool and waits for confirmation.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```ts
|
|
125
|
+
* import { createClient, http } from 'viem'
|
|
126
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
127
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
128
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
129
|
+
*
|
|
130
|
+
* const client = createClient({
|
|
131
|
+
* account: privateKeyToAccount('0x...'),
|
|
132
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
133
|
+
* transport: http(),
|
|
134
|
+
* }).extend(tempoActions())
|
|
135
|
+
*
|
|
136
|
+
* const { receipt, ...result } = await client.amm.burnSync({
|
|
137
|
+
* userToken: '0x...',
|
|
138
|
+
* validatorToken: '0x...',
|
|
139
|
+
* liquidity: 50n,
|
|
140
|
+
* to: '0x...',
|
|
141
|
+
* })
|
|
142
|
+
* ```
|
|
143
|
+
*
|
|
144
|
+
* @param parameters - Parameters.
|
|
145
|
+
* @returns The transaction receipt and event data.
|
|
146
|
+
*/
|
|
147
|
+
burnSync: (parameters: ammActions.burnSync.Parameters<chain, account>) => Promise<ammActions.burnSync.ReturnValue>;
|
|
148
|
+
/**
|
|
149
|
+
* Adds liquidity to a pool.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```ts
|
|
153
|
+
* import { createClient, http } from 'viem'
|
|
154
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
155
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
156
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
157
|
+
*
|
|
158
|
+
* const client = createClient({
|
|
159
|
+
* account: privateKeyToAccount('0x...'),
|
|
160
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
161
|
+
* transport: http(),
|
|
162
|
+
* }).extend(tempoActions())
|
|
163
|
+
*
|
|
164
|
+
* const hash = await client.amm.mint({
|
|
165
|
+
* userTokenAddress: '0x...',
|
|
166
|
+
* validatorTokenAddress: '0x...',
|
|
167
|
+
* validatorTokenAmount: 100n,
|
|
168
|
+
* to: '0x...',
|
|
169
|
+
* })
|
|
170
|
+
* ```
|
|
171
|
+
*
|
|
172
|
+
* @param parameters - Parameters.
|
|
173
|
+
* @returns The transaction hash.
|
|
174
|
+
*/
|
|
175
|
+
mint: (parameters: ammActions.mint.Parameters<chain, account>) => Promise<ammActions.mint.ReturnValue>;
|
|
176
|
+
/**
|
|
177
|
+
* Adds liquidity to a pool.
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```ts
|
|
181
|
+
* import { createClient, http } from 'viem'
|
|
182
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
183
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
184
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
185
|
+
*
|
|
186
|
+
* const client = createClient({
|
|
187
|
+
* account: privateKeyToAccount('0x...'),
|
|
188
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
189
|
+
* transport: http(),
|
|
190
|
+
* }).extend(tempoActions())
|
|
191
|
+
*
|
|
192
|
+
* const result = await client.amm.mintSync({
|
|
193
|
+
* userTokenAddress: '0x...',
|
|
194
|
+
* validatorTokenAddress: '0x...',
|
|
195
|
+
* validatorTokenAmount: 100n,
|
|
196
|
+
* to: '0x...',
|
|
197
|
+
* })
|
|
198
|
+
* ```
|
|
199
|
+
*
|
|
200
|
+
* @param parameters - Parameters.
|
|
201
|
+
* @returns The transaction receipt and event data.
|
|
202
|
+
*/
|
|
203
|
+
mintSync: (parameters: ammActions.mintSync.Parameters<chain, account>) => Promise<ammActions.mintSync.ReturnValue>;
|
|
204
|
+
/**
|
|
205
|
+
* Swaps tokens during a rebalance operation.
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```ts
|
|
209
|
+
* import { createClient, http } from 'viem'
|
|
210
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
211
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
212
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
213
|
+
*
|
|
214
|
+
* const client = createClient({
|
|
215
|
+
* account: privateKeyToAccount('0x...'),
|
|
216
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
217
|
+
* transport: http(),
|
|
218
|
+
* }).extend(tempoActions())
|
|
219
|
+
*
|
|
220
|
+
* const hash = await client.amm.rebalanceSwap({
|
|
221
|
+
* userToken: '0x...',
|
|
222
|
+
* validatorToken: '0x...',
|
|
223
|
+
* amountOut: 100n,
|
|
224
|
+
* to: '0x...',
|
|
225
|
+
* })
|
|
226
|
+
* ```
|
|
227
|
+
*
|
|
228
|
+
* @param parameters - Parameters.
|
|
229
|
+
* @returns The transaction hash.
|
|
230
|
+
*/
|
|
231
|
+
rebalanceSwap: (parameters: ammActions.rebalanceSwap.Parameters<chain, account>) => Promise<ammActions.rebalanceSwap.ReturnValue>;
|
|
232
|
+
/**
|
|
233
|
+
* Swaps tokens during a rebalance operation and waits for confirmation.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```ts
|
|
237
|
+
* import { createClient, http } from 'viem'
|
|
238
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
239
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
240
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
241
|
+
*
|
|
242
|
+
* const client = createClient({
|
|
243
|
+
* account: privateKeyToAccount('0x...'),
|
|
244
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
245
|
+
* transport: http(),
|
|
246
|
+
* }).extend(tempoActions())
|
|
247
|
+
*
|
|
248
|
+
* const { receipt, ...result } = await client.amm.rebalanceSwapSync({
|
|
249
|
+
* userToken: '0x...',
|
|
250
|
+
* validatorToken: '0x...',
|
|
251
|
+
* amountOut: 100n,
|
|
252
|
+
* to: '0x...',
|
|
253
|
+
* })
|
|
254
|
+
* ```
|
|
255
|
+
*
|
|
256
|
+
* @param parameters - Parameters.
|
|
257
|
+
* @returns The transaction receipt and event data.
|
|
258
|
+
*/
|
|
259
|
+
rebalanceSwapSync: (parameters: ammActions.rebalanceSwapSync.Parameters<chain, account>) => Promise<ammActions.rebalanceSwapSync.ReturnValue>;
|
|
260
|
+
/**
|
|
261
|
+
* Watches for burn (liquidity removal) events.
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* ```ts
|
|
265
|
+
* import { createClient, http } from 'viem'
|
|
266
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
267
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
268
|
+
*
|
|
269
|
+
* const client = createClient({
|
|
270
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
271
|
+
* transport: http(),
|
|
272
|
+
* }).extend(tempoActions())
|
|
273
|
+
*
|
|
274
|
+
* const unwatch = client.amm.watchBurn({
|
|
275
|
+
* onBurn: (args, log) => {
|
|
276
|
+
* console.log('Liquidity removed:', args)
|
|
277
|
+
* },
|
|
278
|
+
* })
|
|
279
|
+
* ```
|
|
280
|
+
*
|
|
281
|
+
* @param parameters - Parameters.
|
|
282
|
+
* @returns A function to unsubscribe from the event.
|
|
283
|
+
*/
|
|
284
|
+
watchBurn: (parameters: ammActions.watchBurn.Parameters) => () => void;
|
|
285
|
+
/**
|
|
286
|
+
* Watches for fee swap events.
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* ```ts
|
|
290
|
+
* import { createClient, http } from 'viem'
|
|
291
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
292
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
293
|
+
*
|
|
294
|
+
* const client = createClient({
|
|
295
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
296
|
+
* transport: http(),
|
|
297
|
+
* }).extend(tempoActions())
|
|
298
|
+
*
|
|
299
|
+
* const unwatch = client.amm.watchFeeSwap({
|
|
300
|
+
* onFeeSwap: (args, log) => {
|
|
301
|
+
* console.log('Fee swap:', args)
|
|
302
|
+
* },
|
|
303
|
+
* })
|
|
304
|
+
* ```
|
|
305
|
+
*
|
|
306
|
+
* @param parameters - Parameters.
|
|
307
|
+
* @returns A function to unsubscribe from the event.
|
|
308
|
+
*/
|
|
309
|
+
watchFeeSwap: (parameters: ammActions.watchFeeSwap.Parameters) => () => void;
|
|
310
|
+
/**
|
|
311
|
+
* Watches for liquidity mint events.
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* ```ts
|
|
315
|
+
* import { createClient, http } from 'viem'
|
|
316
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
317
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
318
|
+
*
|
|
319
|
+
* const client = createClient({
|
|
320
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
321
|
+
* transport: http(),
|
|
322
|
+
* }).extend(tempoActions())
|
|
323
|
+
*
|
|
324
|
+
* const unwatch = client.amm.watchMint({
|
|
325
|
+
* onMint: (args, log) => {
|
|
326
|
+
* console.log('Liquidity added:', args)
|
|
327
|
+
* },
|
|
328
|
+
* })
|
|
329
|
+
* ```
|
|
330
|
+
*
|
|
331
|
+
* @param parameters - Parameters.
|
|
332
|
+
* @returns A function to unsubscribe from the event.
|
|
333
|
+
*/
|
|
334
|
+
watchMint: (parameters: ammActions.watchMint.Parameters) => () => void;
|
|
335
|
+
/**
|
|
336
|
+
* Watches for rebalance swap events.
|
|
337
|
+
*
|
|
338
|
+
* @example
|
|
339
|
+
* ```ts
|
|
340
|
+
* import { createClient, http } from 'viem'
|
|
341
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
342
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
343
|
+
*
|
|
344
|
+
* const client = createClient({
|
|
345
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
346
|
+
* transport: http(),
|
|
347
|
+
* }).extend(tempoActions())
|
|
348
|
+
*
|
|
349
|
+
* const unwatch = client.amm.watchRebalanceSwap({
|
|
350
|
+
* onRebalanceSwap: (args, log) => {
|
|
351
|
+
* console.log('Rebalance swap:', args)
|
|
352
|
+
* },
|
|
353
|
+
* })
|
|
354
|
+
* ```
|
|
355
|
+
*
|
|
356
|
+
* @param parameters - Parameters.
|
|
357
|
+
* @returns A function to unsubscribe from the event.
|
|
358
|
+
*/
|
|
359
|
+
watchRebalanceSwap: (parameters: ammActions.watchRebalanceSwap.Parameters) => () => void;
|
|
360
|
+
};
|
|
361
|
+
dex: {
|
|
362
|
+
/**
|
|
363
|
+
* Buys a specific amount of tokens.
|
|
364
|
+
*
|
|
365
|
+
* @example
|
|
366
|
+
* ```ts
|
|
367
|
+
* import { createClient, http } from 'viem'
|
|
368
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
369
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
370
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
371
|
+
*
|
|
372
|
+
* const client = createClient({
|
|
373
|
+
* account: privateKeyToAccount('0x...'),
|
|
374
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
375
|
+
* transport: http(),
|
|
376
|
+
* }).extend(tempoActions())
|
|
377
|
+
*
|
|
378
|
+
* const hash = await client.dex.buy({
|
|
379
|
+
* tokenIn: '0x20c...11',
|
|
380
|
+
* tokenOut: '0x20c...20',
|
|
381
|
+
* amountOut: 100n,
|
|
382
|
+
* maxAmountIn: 105n,
|
|
383
|
+
* })
|
|
384
|
+
* ```
|
|
385
|
+
*
|
|
386
|
+
* @param parameters - Parameters.
|
|
387
|
+
* @returns The transaction hash.
|
|
388
|
+
*/
|
|
389
|
+
buy: (parameters: dexActions.buy.Parameters<chain, account>) => Promise<dexActions.buy.ReturnValue>;
|
|
390
|
+
/**
|
|
391
|
+
* Buys a specific amount of tokens.
|
|
392
|
+
*
|
|
393
|
+
* @example
|
|
394
|
+
* ```ts
|
|
395
|
+
* import { createClient, http } from 'viem'
|
|
396
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
397
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
398
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
399
|
+
*
|
|
400
|
+
* const client = createClient({
|
|
401
|
+
* account: privateKeyToAccount('0x...'),
|
|
402
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
403
|
+
* transport: http(),
|
|
404
|
+
* }).extend(tempoActions())
|
|
405
|
+
*
|
|
406
|
+
* const result = await client.dex.buySync({
|
|
407
|
+
* tokenIn: '0x20c...11',
|
|
408
|
+
* tokenOut: '0x20c...20',
|
|
409
|
+
* amountOut: 100n,
|
|
410
|
+
* maxAmountIn: 105n,
|
|
411
|
+
* })
|
|
412
|
+
* ```
|
|
413
|
+
*
|
|
414
|
+
* @param parameters - Parameters.
|
|
415
|
+
* @returns The transaction receipt.
|
|
416
|
+
*/
|
|
417
|
+
buySync: (parameters: dexActions.buySync.Parameters<chain, account>) => Promise<dexActions.buySync.ReturnValue>;
|
|
418
|
+
/**
|
|
419
|
+
* Cancels an order from the orderbook.
|
|
420
|
+
*
|
|
421
|
+
* @example
|
|
422
|
+
* ```ts
|
|
423
|
+
* import { createClient, http } from 'viem'
|
|
424
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
425
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
426
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
427
|
+
*
|
|
428
|
+
* const client = createClient({
|
|
429
|
+
* account: privateKeyToAccount('0x...'),
|
|
430
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
431
|
+
* transport: http(),
|
|
432
|
+
* }).extend(tempoActions())
|
|
433
|
+
*
|
|
434
|
+
* const hash = await client.dex.cancel({
|
|
435
|
+
* orderId: 123n,
|
|
436
|
+
* })
|
|
437
|
+
* ```
|
|
438
|
+
*
|
|
439
|
+
* @param parameters - Parameters.
|
|
440
|
+
* @returns The transaction hash.
|
|
441
|
+
*/
|
|
442
|
+
cancel: (parameters: dexActions.cancel.Parameters<chain, account>) => Promise<dexActions.cancel.ReturnValue>;
|
|
443
|
+
/**
|
|
444
|
+
* Cancels an order from the orderbook.
|
|
445
|
+
*
|
|
446
|
+
* @example
|
|
447
|
+
* ```ts
|
|
448
|
+
* import { createClient, http } from 'viem'
|
|
449
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
450
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
451
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
452
|
+
*
|
|
453
|
+
* const client = createClient({
|
|
454
|
+
* account: privateKeyToAccount('0x...'),
|
|
455
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
456
|
+
* transport: http(),
|
|
457
|
+
* }).extend(tempoActions())
|
|
458
|
+
*
|
|
459
|
+
* const result = await client.dex.cancelSync({
|
|
460
|
+
* orderId: 123n,
|
|
461
|
+
* })
|
|
462
|
+
* ```
|
|
463
|
+
*
|
|
464
|
+
* @param parameters - Parameters.
|
|
465
|
+
* @returns The transaction receipt and event data.
|
|
466
|
+
*/
|
|
467
|
+
cancelSync: (parameters: dexActions.cancelSync.Parameters<chain, account>) => Promise<dexActions.cancelSync.ReturnValue>;
|
|
468
|
+
/**
|
|
469
|
+
* Creates a new trading pair on the DEX.
|
|
470
|
+
*
|
|
471
|
+
* @example
|
|
472
|
+
* ```ts
|
|
473
|
+
* import { createClient, http } from 'viem'
|
|
474
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
475
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
476
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
477
|
+
*
|
|
478
|
+
* const client = createClient({
|
|
479
|
+
* account: privateKeyToAccount('0x...'),
|
|
480
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
481
|
+
* transport: http(),
|
|
482
|
+
* }).extend(tempoActions())
|
|
483
|
+
*
|
|
484
|
+
* const hash = await client.dex.createPair({
|
|
485
|
+
* base: '0x20c...11',
|
|
486
|
+
* })
|
|
487
|
+
* ```
|
|
488
|
+
*
|
|
489
|
+
* @param parameters - Parameters.
|
|
490
|
+
* @returns The transaction hash.
|
|
491
|
+
*/
|
|
492
|
+
createPair: (parameters: dexActions.createPair.Parameters<chain, account>) => Promise<dexActions.createPair.ReturnValue>;
|
|
493
|
+
/**
|
|
494
|
+
* Creates a new trading pair on the DEX.
|
|
495
|
+
*
|
|
496
|
+
* @example
|
|
497
|
+
* ```ts
|
|
498
|
+
* import { createClient, http } from 'viem'
|
|
499
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
500
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
501
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
502
|
+
*
|
|
503
|
+
* const client = createClient({
|
|
504
|
+
* account: privateKeyToAccount('0x...'),
|
|
505
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
506
|
+
* transport: http(),
|
|
507
|
+
* }).extend(tempoActions())
|
|
508
|
+
*
|
|
509
|
+
* const result = await client.dex.createPairSync({
|
|
510
|
+
* base: '0x20c...11',
|
|
511
|
+
* })
|
|
512
|
+
* ```
|
|
513
|
+
*
|
|
514
|
+
* @param parameters - Parameters.
|
|
515
|
+
* @returns The transaction receipt and event data.
|
|
516
|
+
*/
|
|
517
|
+
createPairSync: (parameters: dexActions.createPairSync.Parameters<chain, account>) => Promise<dexActions.createPairSync.ReturnValue>;
|
|
518
|
+
/**
|
|
519
|
+
* Gets a user's token balance on the DEX.
|
|
520
|
+
*
|
|
521
|
+
* @example
|
|
522
|
+
* ```ts
|
|
523
|
+
* import { createClient, http } from 'viem'
|
|
524
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
525
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
526
|
+
*
|
|
527
|
+
* const client = createClient({
|
|
528
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
529
|
+
* transport: http(),
|
|
530
|
+
* }).extend(tempoActions())
|
|
531
|
+
*
|
|
532
|
+
* const balance = await client.dex.getBalance({
|
|
533
|
+
* account: '0x...',
|
|
534
|
+
* token: '0x20c...11',
|
|
535
|
+
* })
|
|
536
|
+
* ```
|
|
537
|
+
*
|
|
538
|
+
* @param parameters - Parameters.
|
|
539
|
+
* @returns The user's token balance on the DEX.
|
|
540
|
+
*/
|
|
541
|
+
getBalance: (parameters: dexActions.getBalance.Parameters<account>) => Promise<dexActions.getBalance.ReturnValue>;
|
|
542
|
+
/**
|
|
543
|
+
* Gets the quote for buying a specific amount of tokens.
|
|
544
|
+
*
|
|
545
|
+
* @example
|
|
546
|
+
* ```ts
|
|
547
|
+
* import { createClient, http } from 'viem'
|
|
548
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
549
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
550
|
+
*
|
|
551
|
+
* const client = createClient({
|
|
552
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
553
|
+
* transport: http(),
|
|
554
|
+
* }).extend(tempoActions())
|
|
555
|
+
*
|
|
556
|
+
* const amountIn = await client.dex.getBuyQuote({
|
|
557
|
+
* tokenIn: '0x20c...11',
|
|
558
|
+
* tokenOut: '0x20c...20',
|
|
559
|
+
* amountOut: 100n,
|
|
560
|
+
* })
|
|
561
|
+
* ```
|
|
562
|
+
*
|
|
563
|
+
* @param parameters - Parameters.
|
|
564
|
+
* @returns The amount of tokenIn needed to buy the specified amountOut.
|
|
565
|
+
*/
|
|
566
|
+
getBuyQuote: (parameters: dexActions.getBuyQuote.Parameters) => Promise<dexActions.getBuyQuote.ReturnValue>;
|
|
567
|
+
/**
|
|
568
|
+
* Gets an order's details from the orderbook.
|
|
569
|
+
*
|
|
570
|
+
* @example
|
|
571
|
+
* ```ts
|
|
572
|
+
* import { createClient, http } from 'viem'
|
|
573
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
574
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
575
|
+
*
|
|
576
|
+
* const client = createClient({
|
|
577
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
578
|
+
* transport: http(),
|
|
579
|
+
* }).extend(tempoActions())
|
|
580
|
+
*
|
|
581
|
+
* const order = await client.dex.getOrder({
|
|
582
|
+
* orderId: 123n,
|
|
583
|
+
* })
|
|
584
|
+
* ```
|
|
585
|
+
*
|
|
586
|
+
* @param parameters - Parameters.
|
|
587
|
+
* @returns The order details.
|
|
588
|
+
*/
|
|
589
|
+
getOrder: (parameters: dexActions.getOrder.Parameters) => Promise<dexActions.getOrder.ReturnValue>;
|
|
590
|
+
/**
|
|
591
|
+
* Gets the price level information at a specific tick.
|
|
592
|
+
*
|
|
593
|
+
* @example
|
|
594
|
+
* ```ts
|
|
595
|
+
* import { createClient, http } from 'viem'
|
|
596
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
597
|
+
* import { tempoActions, Tick } from 'tempo.ts/viem'
|
|
598
|
+
*
|
|
599
|
+
* const client = createClient({
|
|
600
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
601
|
+
* transport: http(),
|
|
602
|
+
* }).extend(tempoActions())
|
|
603
|
+
*
|
|
604
|
+
* const level = await client.dex.getTickLevel({
|
|
605
|
+
* base: '0x20c...11',
|
|
606
|
+
* tick: Tick.fromPrice('1.001'),
|
|
607
|
+
* isBid: true,
|
|
608
|
+
* })
|
|
609
|
+
* ```
|
|
610
|
+
*
|
|
611
|
+
* @param parameters - Parameters.
|
|
612
|
+
* @returns The price level information.
|
|
613
|
+
*/
|
|
614
|
+
getTickLevel: (parameters: dexActions.getTickLevel.Parameters) => Promise<dexActions.getTickLevel.ReturnValue>;
|
|
615
|
+
/**
|
|
616
|
+
* Gets the quote for selling a specific amount of tokens.
|
|
617
|
+
*
|
|
618
|
+
* @example
|
|
619
|
+
* ```ts
|
|
620
|
+
* import { createClient, http } from 'viem'
|
|
621
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
622
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
623
|
+
*
|
|
624
|
+
* const client = createClient({
|
|
625
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
626
|
+
* transport: http(),
|
|
627
|
+
* }).extend(tempoActions())
|
|
628
|
+
*
|
|
629
|
+
* const amountOut = await client.dex.getSellQuote({
|
|
630
|
+
* tokenIn: '0x20c...11',
|
|
631
|
+
* tokenOut: '0x20c...20',
|
|
632
|
+
* amountIn: 100n,
|
|
633
|
+
* })
|
|
634
|
+
* ```
|
|
635
|
+
*
|
|
636
|
+
* @param parameters - Parameters.
|
|
637
|
+
* @returns The amount of tokenOut received for selling the specified amountIn.
|
|
638
|
+
*/
|
|
639
|
+
getSellQuote: (parameters: dexActions.getSellQuote.Parameters) => Promise<dexActions.getSellQuote.ReturnValue>;
|
|
640
|
+
/**
|
|
641
|
+
* Places a limit order on the orderbook.
|
|
642
|
+
*
|
|
643
|
+
* @example
|
|
644
|
+
* ```ts
|
|
645
|
+
* import { createClient, http } from 'viem'
|
|
646
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
647
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
648
|
+
* import { tempoActions, Tick } from 'tempo.ts/viem'
|
|
649
|
+
*
|
|
650
|
+
* const client = createClient({
|
|
651
|
+
* account: privateKeyToAccount('0x...'),
|
|
652
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
653
|
+
* transport: http(),
|
|
654
|
+
* }).extend(tempoActions())
|
|
655
|
+
*
|
|
656
|
+
* const hash = await client.dex.place({
|
|
657
|
+
* token: '0x20c...11',
|
|
658
|
+
* amount: 100n,
|
|
659
|
+
* type: 'buy',
|
|
660
|
+
* tick: Tick.fromPrice('0.99'),
|
|
661
|
+
* })
|
|
662
|
+
* ```
|
|
663
|
+
*
|
|
664
|
+
* @param parameters - Parameters.
|
|
665
|
+
* @returns The transaction hash.
|
|
666
|
+
*/
|
|
667
|
+
place: (parameters: dexActions.place.Parameters<chain, account>) => Promise<dexActions.place.ReturnValue>;
|
|
668
|
+
/**
|
|
669
|
+
* Places a limit order on the orderbook.
|
|
670
|
+
*
|
|
671
|
+
* @example
|
|
672
|
+
* ```ts
|
|
673
|
+
* import { createClient, http } from 'viem'
|
|
674
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
675
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
676
|
+
* import { tempoActions, Tick } from 'tempo.ts/viem'
|
|
677
|
+
*
|
|
678
|
+
* const client = createClient({
|
|
679
|
+
* account: privateKeyToAccount('0x...'),
|
|
680
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
681
|
+
* transport: http(),
|
|
682
|
+
* }).extend(tempoActions())
|
|
683
|
+
*
|
|
684
|
+
* const result = await client.dex.placeSync({
|
|
685
|
+
* token: '0x20c...11',
|
|
686
|
+
* amount: 100n,
|
|
687
|
+
* type: 'buy',
|
|
688
|
+
* tick: Tick.fromPrice('0.99'),
|
|
689
|
+
* })
|
|
690
|
+
* ```
|
|
691
|
+
*
|
|
692
|
+
* @param parameters - Parameters.
|
|
693
|
+
* @returns The transaction receipt and event data.
|
|
694
|
+
*/
|
|
695
|
+
placeSync: (parameters: dexActions.placeSync.Parameters<chain, account>) => Promise<dexActions.placeSync.ReturnValue>;
|
|
696
|
+
/**
|
|
697
|
+
* Places a flip order that automatically flips when filled.
|
|
698
|
+
*
|
|
699
|
+
* @example
|
|
700
|
+
* ```ts
|
|
701
|
+
* import { createClient, http } from 'viem'
|
|
702
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
703
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
704
|
+
* import { tempoActions, Tick } from 'tempo.ts/viem'
|
|
705
|
+
*
|
|
706
|
+
* const client = createClient({
|
|
707
|
+
* account: privateKeyToAccount('0x...'),
|
|
708
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
709
|
+
* transport: http(),
|
|
710
|
+
* }).extend(tempoActions())
|
|
711
|
+
*
|
|
712
|
+
* const hash = await client.dex.placeFlip({
|
|
713
|
+
* token: '0x20c...11',
|
|
714
|
+
* amount: 100n,
|
|
715
|
+
* type: 'buy',
|
|
716
|
+
* tick: Tick.fromPrice('0.99'),
|
|
717
|
+
* flipTick: Tick.fromPrice('1.01'),
|
|
718
|
+
* })
|
|
719
|
+
* ```
|
|
720
|
+
*
|
|
721
|
+
* @param parameters - Parameters.
|
|
722
|
+
* @returns The transaction hash.
|
|
723
|
+
*/
|
|
724
|
+
placeFlip: (parameters: dexActions.placeFlip.Parameters<chain, account>) => Promise<dexActions.placeFlip.ReturnValue>;
|
|
725
|
+
/**
|
|
726
|
+
* Places a flip order that automatically flips when filled.
|
|
727
|
+
*
|
|
728
|
+
* @example
|
|
729
|
+
* ```ts
|
|
730
|
+
* import { createClient, http } from 'viem'
|
|
731
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
732
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
733
|
+
* import { tempoActions, Tick } from 'tempo.ts/viem'
|
|
734
|
+
*
|
|
735
|
+
* const client = createClient({
|
|
736
|
+
* account: privateKeyToAccount('0x...'),
|
|
737
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
738
|
+
* transport: http(),
|
|
739
|
+
* }).extend(tempoActions())
|
|
740
|
+
*
|
|
741
|
+
* const result = await client.dex.placeFlipSync({
|
|
742
|
+
* token: '0x20c...11',
|
|
743
|
+
* amount: 100n,
|
|
744
|
+
* type: 'buy',
|
|
745
|
+
* tick: Tick.fromPrice('0.99'),
|
|
746
|
+
* flipTick: Tick.fromPrice('1.01'),
|
|
747
|
+
* })
|
|
748
|
+
* ```
|
|
749
|
+
*
|
|
750
|
+
* @param parameters - Parameters.
|
|
751
|
+
* @returns The transaction receipt and event data.
|
|
752
|
+
*/
|
|
753
|
+
placeFlipSync: (parameters: dexActions.placeFlipSync.Parameters<chain, account>) => Promise<dexActions.placeFlipSync.ReturnValue>;
|
|
754
|
+
/**
|
|
755
|
+
* Sells a specific amount of tokens.
|
|
756
|
+
*
|
|
757
|
+
* @example
|
|
758
|
+
* ```ts
|
|
759
|
+
* import { createClient, http } from 'viem'
|
|
760
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
761
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
762
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
763
|
+
*
|
|
764
|
+
* const client = createClient({
|
|
765
|
+
* account: privateKeyToAccount('0x...'),
|
|
766
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
767
|
+
* transport: http(),
|
|
768
|
+
* }).extend(tempoActions())
|
|
769
|
+
*
|
|
770
|
+
* const hash = await client.dex.sell({
|
|
771
|
+
* tokenIn: '0x20c...11',
|
|
772
|
+
* tokenOut: '0x20c...20',
|
|
773
|
+
* amountIn: 100n,
|
|
774
|
+
* minAmountOut: 95n,
|
|
775
|
+
* })
|
|
776
|
+
* ```
|
|
777
|
+
*
|
|
778
|
+
* @param parameters - Parameters.
|
|
779
|
+
* @returns The transaction hash.
|
|
780
|
+
*/
|
|
781
|
+
sell: (parameters: dexActions.sell.Parameters<chain, account>) => Promise<dexActions.sell.ReturnValue>;
|
|
782
|
+
/**
|
|
783
|
+
* Sells a specific amount of tokens.
|
|
784
|
+
*
|
|
785
|
+
* @example
|
|
786
|
+
* ```ts
|
|
787
|
+
* import { createClient, http } from 'viem'
|
|
788
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
789
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
790
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
791
|
+
*
|
|
792
|
+
* const client = createClient({
|
|
793
|
+
* account: privateKeyToAccount('0x...'),
|
|
794
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
795
|
+
* transport: http(),
|
|
796
|
+
* }).extend(tempoActions())
|
|
797
|
+
*
|
|
798
|
+
* const result = await client.dex.sellSync({
|
|
799
|
+
* tokenIn: '0x20c...11',
|
|
800
|
+
* tokenOut: '0x20c...20',
|
|
801
|
+
* amountIn: 100n,
|
|
802
|
+
* minAmountOut: 95n,
|
|
803
|
+
* })
|
|
804
|
+
* ```
|
|
805
|
+
*
|
|
806
|
+
* @param parameters - Parameters.
|
|
807
|
+
* @returns The transaction receipt.
|
|
808
|
+
*/
|
|
809
|
+
sellSync: (parameters: dexActions.sellSync.Parameters<chain, account>) => Promise<dexActions.sellSync.ReturnValue>;
|
|
810
|
+
/**
|
|
811
|
+
* Withdraws tokens from the DEX to the caller's wallet.
|
|
812
|
+
*
|
|
813
|
+
* @example
|
|
814
|
+
* ```ts
|
|
815
|
+
* import { createClient, http } from 'viem'
|
|
816
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
817
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
818
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
819
|
+
*
|
|
820
|
+
* const client = createClient({
|
|
821
|
+
* account: privateKeyToAccount('0x...'),
|
|
822
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
823
|
+
* transport: http(),
|
|
824
|
+
* }).extend(tempoActions())
|
|
825
|
+
*
|
|
826
|
+
* const hash = await client.dex.withdraw({
|
|
827
|
+
* token: '0x20c...11',
|
|
828
|
+
* amount: 100n,
|
|
829
|
+
* })
|
|
830
|
+
* ```
|
|
831
|
+
*
|
|
832
|
+
* @param parameters - Parameters.
|
|
833
|
+
* @returns The transaction hash.
|
|
834
|
+
*/
|
|
835
|
+
withdraw: (parameters: dexActions.withdraw.Parameters<chain, account>) => Promise<dexActions.withdraw.ReturnValue>;
|
|
836
|
+
/**
|
|
837
|
+
* Withdraws tokens from the DEX to the caller's wallet.
|
|
838
|
+
*
|
|
839
|
+
* @example
|
|
840
|
+
* ```ts
|
|
841
|
+
* import { createClient, http } from 'viem'
|
|
842
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
843
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
844
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
845
|
+
*
|
|
846
|
+
* const client = createClient({
|
|
847
|
+
* account: privateKeyToAccount('0x...'),
|
|
848
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
849
|
+
* transport: http(),
|
|
850
|
+
* }).extend(tempoActions())
|
|
851
|
+
*
|
|
852
|
+
* const result = await client.dex.withdrawSync({
|
|
853
|
+
* token: '0x20c...11',
|
|
854
|
+
* amount: 100n,
|
|
855
|
+
* })
|
|
856
|
+
* ```
|
|
857
|
+
*
|
|
858
|
+
* @param parameters - Parameters.
|
|
859
|
+
* @returns The transaction receipt.
|
|
860
|
+
*/
|
|
861
|
+
withdrawSync: (parameters: dexActions.withdrawSync.Parameters<chain, account>) => Promise<dexActions.withdrawSync.ReturnValue>;
|
|
862
|
+
/**
|
|
863
|
+
* Watches for flip order placed events.
|
|
864
|
+
*
|
|
865
|
+
* @example
|
|
866
|
+
* ```ts
|
|
867
|
+
* import { createClient, http } from 'viem'
|
|
868
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
869
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
870
|
+
*
|
|
871
|
+
* const client = createClient({
|
|
872
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
873
|
+
* transport: http(),
|
|
874
|
+
* }).extend(tempoActions())
|
|
875
|
+
*
|
|
876
|
+
* const unwatch = client.dex.watchFlipOrderPlaced({
|
|
877
|
+
* onFlipOrderPlaced: (args, log) => {
|
|
878
|
+
* console.log('Flip order placed:', args)
|
|
879
|
+
* },
|
|
880
|
+
* })
|
|
881
|
+
* ```
|
|
882
|
+
*
|
|
883
|
+
* @param parameters - Parameters.
|
|
884
|
+
* @returns A function to unsubscribe from the event.
|
|
885
|
+
*/
|
|
886
|
+
watchFlipOrderPlaced: (parameters: dexActions.watchFlipOrderPlaced.Parameters) => () => void;
|
|
887
|
+
/**
|
|
888
|
+
* Watches for order cancelled events.
|
|
889
|
+
*
|
|
890
|
+
* @example
|
|
891
|
+
* ```ts
|
|
892
|
+
* import { createClient, http } from 'viem'
|
|
893
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
894
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
895
|
+
*
|
|
896
|
+
* const client = createClient({
|
|
897
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
898
|
+
* transport: http(),
|
|
899
|
+
* }).extend(tempoActions())
|
|
900
|
+
*
|
|
901
|
+
* const unwatch = client.dex.watchOrderCancelled({
|
|
902
|
+
* onOrderCancelled: (args, log) => {
|
|
903
|
+
* console.log('Order cancelled:', args)
|
|
904
|
+
* },
|
|
905
|
+
* })
|
|
906
|
+
* ```
|
|
907
|
+
*
|
|
908
|
+
* @param parameters - Parameters.
|
|
909
|
+
* @returns A function to unsubscribe from the event.
|
|
910
|
+
*/
|
|
911
|
+
watchOrderCancelled: (parameters: dexActions.watchOrderCancelled.Parameters) => () => void;
|
|
912
|
+
/**
|
|
913
|
+
* Watches for order filled events.
|
|
914
|
+
*
|
|
915
|
+
* @example
|
|
916
|
+
* ```ts
|
|
917
|
+
* import { createClient, http } from 'viem'
|
|
918
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
919
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
920
|
+
*
|
|
921
|
+
* const client = createClient({
|
|
922
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
923
|
+
* transport: http(),
|
|
924
|
+
* }).extend(tempoActions())
|
|
925
|
+
*
|
|
926
|
+
* const unwatch = client.dex.watchOrderFilled({
|
|
927
|
+
* onOrderFilled: (args, log) => {
|
|
928
|
+
* console.log('Order filled:', args)
|
|
929
|
+
* },
|
|
930
|
+
* })
|
|
931
|
+
* ```
|
|
932
|
+
*
|
|
933
|
+
* @param parameters - Parameters.
|
|
934
|
+
* @returns A function to unsubscribe from the event.
|
|
935
|
+
*/
|
|
936
|
+
watchOrderFilled: (parameters: dexActions.watchOrderFilled.Parameters) => () => void;
|
|
937
|
+
/**
|
|
938
|
+
* Watches for order placed events.
|
|
939
|
+
*
|
|
940
|
+
* @example
|
|
941
|
+
* ```ts
|
|
942
|
+
* import { createClient, http } from 'viem'
|
|
943
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
944
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
945
|
+
*
|
|
946
|
+
* const client = createClient({
|
|
947
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
948
|
+
* transport: http(),
|
|
949
|
+
* }).extend(tempoActions())
|
|
950
|
+
*
|
|
951
|
+
* const unwatch = client.dex.watchOrderPlaced({
|
|
952
|
+
* onOrderPlaced: (args, log) => {
|
|
953
|
+
* console.log('Order placed:', args)
|
|
954
|
+
* },
|
|
955
|
+
* })
|
|
956
|
+
* ```
|
|
957
|
+
*
|
|
958
|
+
* @param parameters - Parameters.
|
|
959
|
+
* @returns A function to unsubscribe from the event.
|
|
960
|
+
*/
|
|
961
|
+
watchOrderPlaced: (parameters: dexActions.watchOrderPlaced.Parameters) => () => void;
|
|
962
|
+
};
|
|
963
|
+
faucet: {
|
|
964
|
+
/**
|
|
965
|
+
* Funds an account with an initial amount of set token(s)
|
|
966
|
+
* on Tempo's testnet.
|
|
967
|
+
*
|
|
968
|
+
* @example
|
|
969
|
+
* ```ts
|
|
970
|
+
* import { createClient, http } from 'viem'
|
|
971
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
972
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
973
|
+
*
|
|
974
|
+
* const client = createClient({
|
|
975
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
976
|
+
* transport: http(),
|
|
977
|
+
* }).extend(tempoActions())
|
|
978
|
+
*
|
|
979
|
+
* const hashes = await client.faucet.fund({
|
|
980
|
+
* account: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
|
|
981
|
+
* })
|
|
982
|
+
* ```
|
|
983
|
+
*
|
|
984
|
+
* @param parameters - Parameters.
|
|
985
|
+
* @returns The transaction hashes.
|
|
986
|
+
*/
|
|
987
|
+
fund: (parameters: faucetActions.fund.Parameters) => Promise<faucetActions.fund.ReturnValue>;
|
|
988
|
+
};
|
|
989
|
+
fee: {
|
|
990
|
+
/**
|
|
991
|
+
* Gets the user's default fee token.
|
|
992
|
+
*
|
|
993
|
+
* @example
|
|
994
|
+
* ```ts
|
|
995
|
+
* import { createClient, http } from 'viem'
|
|
996
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
997
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
998
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
999
|
+
*
|
|
1000
|
+
* const client = createClient({
|
|
1001
|
+
* account: privateKeyToAccount('0x...'),
|
|
1002
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1003
|
+
* transport: http(),
|
|
1004
|
+
* }).extend(tempoActions())
|
|
1005
|
+
*
|
|
1006
|
+
* const { address, id } = await client.token.getUserToken()
|
|
1007
|
+
* ```
|
|
1008
|
+
*
|
|
1009
|
+
* @param client - Client.
|
|
1010
|
+
* @param parameters - Parameters.
|
|
1011
|
+
* @returns The transaction hash.
|
|
1012
|
+
*/
|
|
1013
|
+
getUserToken: (...parameters: account extends Account ? [feeActions.getUserToken.Parameters<account>] | [] : [feeActions.getUserToken.Parameters<account>]) => Promise<feeActions.getUserToken.ReturnValue>;
|
|
1014
|
+
/**
|
|
1015
|
+
* Sets the user's default fee token.
|
|
1016
|
+
*
|
|
1017
|
+
* @example
|
|
1018
|
+
* ```ts
|
|
1019
|
+
* import { createClient, http } from 'viem'
|
|
1020
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1021
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1022
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1023
|
+
*
|
|
1024
|
+
* const client = createClient({
|
|
1025
|
+
* account: privateKeyToAccount('0x...'),
|
|
1026
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1027
|
+
* transport: http(),
|
|
1028
|
+
* }).extend(tempoActions())
|
|
1029
|
+
*
|
|
1030
|
+
* const hash = await client.token.setUserToken({
|
|
1031
|
+
* token: '0x...',
|
|
1032
|
+
* })
|
|
1033
|
+
* ```
|
|
1034
|
+
*
|
|
1035
|
+
* @param client - Client.
|
|
1036
|
+
* @param parameters - Parameters.
|
|
1037
|
+
* @returns The transaction hash.
|
|
1038
|
+
*/
|
|
1039
|
+
setUserToken: (parameters: feeActions.setUserToken.Parameters<chain, account>) => Promise<feeActions.setUserToken.ReturnValue>;
|
|
1040
|
+
/**
|
|
1041
|
+
* Sets the user's default fee token.
|
|
1042
|
+
*
|
|
1043
|
+
* @example
|
|
1044
|
+
* ```ts
|
|
1045
|
+
* import { createClient, http } from 'viem'
|
|
1046
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1047
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1048
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1049
|
+
*
|
|
1050
|
+
* const client = createClient({
|
|
1051
|
+
* account: privateKeyToAccount('0x...'),
|
|
1052
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1053
|
+
* transport: http(),
|
|
1054
|
+
* }).extend(tempoActions())
|
|
1055
|
+
*
|
|
1056
|
+
* const result = await client.fee.setUserTokenSync({
|
|
1057
|
+
* token: '0x...',
|
|
1058
|
+
* })
|
|
1059
|
+
* ```
|
|
1060
|
+
*
|
|
1061
|
+
* @param parameters - Parameters.
|
|
1062
|
+
* @returns The transaction receipt and event data.
|
|
1063
|
+
*/
|
|
1064
|
+
setUserTokenSync: (parameters: feeActions.setUserTokenSync.Parameters<chain, account>) => Promise<feeActions.setUserTokenSync.ReturnValue>;
|
|
1065
|
+
/**
|
|
1066
|
+
* Watches for user token set events.
|
|
1067
|
+
*
|
|
1068
|
+
* @example
|
|
1069
|
+
* ```ts
|
|
1070
|
+
* import { createClient, http } from 'viem'
|
|
1071
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1072
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1073
|
+
*
|
|
1074
|
+
* const client = createClient({
|
|
1075
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1076
|
+
* transport: http(),
|
|
1077
|
+
* }).extend(tempoActions())
|
|
1078
|
+
*
|
|
1079
|
+
* const unwatch = client.token.watchSetUserToken({
|
|
1080
|
+
* onUserTokenSet: (args, log) => {
|
|
1081
|
+
* console.log('User token set:', args)
|
|
1082
|
+
* },
|
|
1083
|
+
* })
|
|
1084
|
+
* ```
|
|
1085
|
+
*
|
|
1086
|
+
* @param client - Client.
|
|
1087
|
+
* @param parameters - Parameters.
|
|
1088
|
+
* @returns A function to unsubscribe from the event.
|
|
1089
|
+
*/
|
|
1090
|
+
watchSetUserToken: (parameters: feeActions.watchSetUserToken.Parameters) => () => void;
|
|
1091
|
+
};
|
|
1092
|
+
policy: {
|
|
1093
|
+
/**
|
|
1094
|
+
* Creates a new policy.
|
|
1095
|
+
*
|
|
1096
|
+
* @example
|
|
1097
|
+
* ```ts
|
|
1098
|
+
* import { createClient, http } from 'viem'
|
|
1099
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1100
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1101
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1102
|
+
*
|
|
1103
|
+
* const client = createClient({
|
|
1104
|
+
* account: privateKeyToAccount('0x...'),
|
|
1105
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1106
|
+
* transport: http(),
|
|
1107
|
+
* }).extend(tempoActions())
|
|
1108
|
+
*
|
|
1109
|
+
* const hash = await client.policy.create({
|
|
1110
|
+
* admin: '0x...',
|
|
1111
|
+
* type: 'whitelist',
|
|
1112
|
+
* })
|
|
1113
|
+
* ```
|
|
1114
|
+
*
|
|
1115
|
+
* @param parameters - Parameters.
|
|
1116
|
+
* @returns The transaction hash.
|
|
1117
|
+
*/
|
|
1118
|
+
create: (parameters: policyActions.create.Parameters<chain, account>) => Promise<policyActions.create.ReturnValue>;
|
|
1119
|
+
/**
|
|
1120
|
+
* Creates a new policy.
|
|
1121
|
+
*
|
|
1122
|
+
* @example
|
|
1123
|
+
* ```ts
|
|
1124
|
+
* import { createClient, http } from 'viem'
|
|
1125
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1126
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1127
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1128
|
+
*
|
|
1129
|
+
* const client = createClient({
|
|
1130
|
+
* account: privateKeyToAccount('0x...'),
|
|
1131
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1132
|
+
* transport: http(),
|
|
1133
|
+
* }).extend(tempoActions())
|
|
1134
|
+
*
|
|
1135
|
+
* const result = await client.policy.createSync({
|
|
1136
|
+
* admin: '0x...',
|
|
1137
|
+
* type: 'whitelist',
|
|
1138
|
+
* })
|
|
1139
|
+
* ```
|
|
1140
|
+
*
|
|
1141
|
+
* @param parameters - Parameters.
|
|
1142
|
+
* @returns The transaction receipt and event data.
|
|
1143
|
+
*/
|
|
1144
|
+
createSync: (parameters: policyActions.createSync.Parameters<chain, account>) => Promise<policyActions.createSync.ReturnValue>;
|
|
1145
|
+
/**
|
|
1146
|
+
* Sets the admin for a policy.
|
|
1147
|
+
*
|
|
1148
|
+
* @example
|
|
1149
|
+
* ```ts
|
|
1150
|
+
* import { createClient, http } from 'viem'
|
|
1151
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1152
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1153
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1154
|
+
*
|
|
1155
|
+
* const client = createClient({
|
|
1156
|
+
* account: privateKeyToAccount('0x...'),
|
|
1157
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1158
|
+
* transport: http(),
|
|
1159
|
+
* }).extend(tempoActions())
|
|
1160
|
+
*
|
|
1161
|
+
* const hash = await client.policy.setAdmin({
|
|
1162
|
+
* policyId: 2n,
|
|
1163
|
+
* admin: '0x...',
|
|
1164
|
+
* })
|
|
1165
|
+
* ```
|
|
1166
|
+
*
|
|
1167
|
+
* @param parameters - Parameters.
|
|
1168
|
+
* @returns The transaction hash.
|
|
1169
|
+
*/
|
|
1170
|
+
setAdmin: (parameters: policyActions.setAdmin.Parameters<chain, account>) => Promise<policyActions.setAdmin.ReturnValue>;
|
|
1171
|
+
/**
|
|
1172
|
+
* Sets the admin for a policy.
|
|
1173
|
+
*
|
|
1174
|
+
* @example
|
|
1175
|
+
* ```ts
|
|
1176
|
+
* import { createClient, http } from 'viem'
|
|
1177
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1178
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1179
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1180
|
+
*
|
|
1181
|
+
* const client = createClient({
|
|
1182
|
+
* account: privateKeyToAccount('0x...'),
|
|
1183
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1184
|
+
* transport: http(),
|
|
1185
|
+
* }).extend(tempoActions())
|
|
1186
|
+
*
|
|
1187
|
+
* const result = await client.policy.setAdminSync({
|
|
1188
|
+
* policyId: 2n,
|
|
1189
|
+
* admin: '0x...',
|
|
1190
|
+
* })
|
|
1191
|
+
* ```
|
|
1192
|
+
*
|
|
1193
|
+
* @param parameters - Parameters.
|
|
1194
|
+
* @returns The transaction receipt and event data.
|
|
1195
|
+
*/
|
|
1196
|
+
setAdminSync: (parameters: policyActions.setAdminSync.Parameters<chain, account>) => Promise<policyActions.setAdminSync.ReturnValue>;
|
|
1197
|
+
/**
|
|
1198
|
+
* Modifies a policy whitelist.
|
|
1199
|
+
*
|
|
1200
|
+
* @example
|
|
1201
|
+
* ```ts
|
|
1202
|
+
* import { createClient, http } from 'viem'
|
|
1203
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1204
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1205
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1206
|
+
*
|
|
1207
|
+
* const client = createClient({
|
|
1208
|
+
* account: privateKeyToAccount('0x...'),
|
|
1209
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1210
|
+
* transport: http(),
|
|
1211
|
+
* }).extend(tempoActions())
|
|
1212
|
+
*
|
|
1213
|
+
* const hash = await client.policy.modifyWhitelist({
|
|
1214
|
+
* policyId: 2n,
|
|
1215
|
+
* address: '0x...',
|
|
1216
|
+
* allowed: true,
|
|
1217
|
+
* })
|
|
1218
|
+
* ```
|
|
1219
|
+
*
|
|
1220
|
+
* @param parameters - Parameters.
|
|
1221
|
+
* @returns The transaction hash.
|
|
1222
|
+
*/
|
|
1223
|
+
modifyWhitelist: (parameters: policyActions.modifyWhitelist.Parameters<chain, account>) => Promise<policyActions.modifyWhitelist.ReturnValue>;
|
|
1224
|
+
/**
|
|
1225
|
+
* Modifies a policy whitelist.
|
|
1226
|
+
*
|
|
1227
|
+
* @example
|
|
1228
|
+
* ```ts
|
|
1229
|
+
* import { createClient, http } from 'viem'
|
|
1230
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1231
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1232
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1233
|
+
*
|
|
1234
|
+
* const client = createClient({
|
|
1235
|
+
* account: privateKeyToAccount('0x...'),
|
|
1236
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1237
|
+
* transport: http(),
|
|
1238
|
+
* }).extend(tempoActions())
|
|
1239
|
+
*
|
|
1240
|
+
* const result = await client.policy.modifyWhitelistSync({
|
|
1241
|
+
* policyId: 2n,
|
|
1242
|
+
* address: '0x...',
|
|
1243
|
+
* allowed: true,
|
|
1244
|
+
* })
|
|
1245
|
+
* ```
|
|
1246
|
+
*
|
|
1247
|
+
* @param parameters - Parameters.
|
|
1248
|
+
* @returns The transaction receipt and event data.
|
|
1249
|
+
*/
|
|
1250
|
+
modifyWhitelistSync: (parameters: policyActions.modifyWhitelistSync.Parameters<chain, account>) => Promise<policyActions.modifyWhitelistSync.ReturnValue>;
|
|
1251
|
+
/**
|
|
1252
|
+
* Modifies a policy blacklist.
|
|
1253
|
+
*
|
|
1254
|
+
* @example
|
|
1255
|
+
* ```ts
|
|
1256
|
+
* import { createClient, http } from 'viem'
|
|
1257
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1258
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1259
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1260
|
+
*
|
|
1261
|
+
* const client = createClient({
|
|
1262
|
+
* account: privateKeyToAccount('0x...'),
|
|
1263
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1264
|
+
* transport: http(),
|
|
1265
|
+
* }).extend(tempoActions())
|
|
1266
|
+
*
|
|
1267
|
+
* const hash = await client.policy.modifyBlacklist({
|
|
1268
|
+
* policyId: 2n,
|
|
1269
|
+
* address: '0x...',
|
|
1270
|
+
* restricted: true,
|
|
1271
|
+
* })
|
|
1272
|
+
* ```
|
|
1273
|
+
*
|
|
1274
|
+
* @param parameters - Parameters.
|
|
1275
|
+
* @returns The transaction hash.
|
|
1276
|
+
*/
|
|
1277
|
+
modifyBlacklist: (parameters: policyActions.modifyBlacklist.Parameters<chain, account>) => Promise<policyActions.modifyBlacklist.ReturnValue>;
|
|
1278
|
+
/**
|
|
1279
|
+
* Modifies a policy blacklist.
|
|
1280
|
+
*
|
|
1281
|
+
* @example
|
|
1282
|
+
* ```ts
|
|
1283
|
+
* import { createClient, http } from 'viem'
|
|
1284
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1285
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1286
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1287
|
+
*
|
|
1288
|
+
* const client = createClient({
|
|
1289
|
+
* account: privateKeyToAccount('0x...'),
|
|
1290
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1291
|
+
* transport: http(),
|
|
1292
|
+
* }).extend(tempoActions())
|
|
1293
|
+
*
|
|
1294
|
+
* const result = await client.policy.modifyBlacklistSync({
|
|
1295
|
+
* policyId: 2n,
|
|
1296
|
+
* address: '0x...',
|
|
1297
|
+
* restricted: true,
|
|
1298
|
+
* })
|
|
1299
|
+
* ```
|
|
1300
|
+
*
|
|
1301
|
+
* @param parameters - Parameters.
|
|
1302
|
+
* @returns The transaction receipt and event data.
|
|
1303
|
+
*/
|
|
1304
|
+
modifyBlacklistSync: (parameters: policyActions.modifyBlacklistSync.Parameters<chain, account>) => Promise<policyActions.modifyBlacklistSync.ReturnValue>;
|
|
1305
|
+
/**
|
|
1306
|
+
* Gets policy data.
|
|
1307
|
+
*
|
|
1308
|
+
* @example
|
|
1309
|
+
* ```ts
|
|
1310
|
+
* import { createClient, http } from 'viem'
|
|
1311
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1312
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1313
|
+
*
|
|
1314
|
+
* const client = createClient({
|
|
1315
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1316
|
+
* transport: http(),
|
|
1317
|
+
* }).extend(tempoActions())
|
|
1318
|
+
*
|
|
1319
|
+
* const data = await client.policy.getData({
|
|
1320
|
+
* policyId: 2n,
|
|
1321
|
+
* })
|
|
1322
|
+
* ```
|
|
1323
|
+
*
|
|
1324
|
+
* @param parameters - Parameters.
|
|
1325
|
+
* @returns The policy data.
|
|
1326
|
+
*/
|
|
1327
|
+
getData: (parameters: policyActions.getData.Parameters) => Promise<policyActions.getData.ReturnValue>;
|
|
1328
|
+
/**
|
|
1329
|
+
* Checks if a user is authorized by a policy.
|
|
1330
|
+
*
|
|
1331
|
+
* @example
|
|
1332
|
+
* ```ts
|
|
1333
|
+
* import { createClient, http } from 'viem'
|
|
1334
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1335
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1336
|
+
*
|
|
1337
|
+
* const client = createClient({
|
|
1338
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1339
|
+
* transport: http(),
|
|
1340
|
+
* }).extend(tempoActions())
|
|
1341
|
+
*
|
|
1342
|
+
* const authorized = await client.policy.isAuthorized({
|
|
1343
|
+
* policyId: 2n,
|
|
1344
|
+
* user: '0x...',
|
|
1345
|
+
* })
|
|
1346
|
+
* ```
|
|
1347
|
+
*
|
|
1348
|
+
* @param parameters - Parameters.
|
|
1349
|
+
* @returns Whether the user is authorized.
|
|
1350
|
+
*/
|
|
1351
|
+
isAuthorized: (parameters: policyActions.isAuthorized.Parameters) => Promise<policyActions.isAuthorized.ReturnValue>;
|
|
1352
|
+
/**
|
|
1353
|
+
* Watches for policy creation events.
|
|
1354
|
+
*
|
|
1355
|
+
* @example
|
|
1356
|
+
* ```ts
|
|
1357
|
+
* import { createClient, http } from 'viem'
|
|
1358
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1359
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1360
|
+
*
|
|
1361
|
+
* const client = createClient({
|
|
1362
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1363
|
+
* transport: http(),
|
|
1364
|
+
* }).extend(tempoActions())
|
|
1365
|
+
*
|
|
1366
|
+
* const unwatch = client.policy.watchCreate({
|
|
1367
|
+
* onPolicyCreated: (args, log) => {
|
|
1368
|
+
* console.log('Policy created:', args)
|
|
1369
|
+
* },
|
|
1370
|
+
* })
|
|
1371
|
+
* ```
|
|
1372
|
+
*
|
|
1373
|
+
* @param parameters - Parameters.
|
|
1374
|
+
* @returns A function to unsubscribe from the event.
|
|
1375
|
+
*/
|
|
1376
|
+
watchCreate: (parameters: policyActions.watchCreate.Parameters) => () => void;
|
|
1377
|
+
/**
|
|
1378
|
+
* Watches for policy admin update events.
|
|
1379
|
+
*
|
|
1380
|
+
* @example
|
|
1381
|
+
* ```ts
|
|
1382
|
+
* import { createClient, http } from 'viem'
|
|
1383
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1384
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1385
|
+
*
|
|
1386
|
+
* const client = createClient({
|
|
1387
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1388
|
+
* transport: http(),
|
|
1389
|
+
* }).extend(tempoActions())
|
|
1390
|
+
*
|
|
1391
|
+
* const unwatch = client.policy.watchAdminUpdated({
|
|
1392
|
+
* onAdminUpdated: (args, log) => {
|
|
1393
|
+
* console.log('Policy admin updated:', args)
|
|
1394
|
+
* },
|
|
1395
|
+
* })
|
|
1396
|
+
* ```
|
|
1397
|
+
*
|
|
1398
|
+
* @param parameters - Parameters.
|
|
1399
|
+
* @returns A function to unsubscribe from the event.
|
|
1400
|
+
*/
|
|
1401
|
+
watchAdminUpdated: (parameters: policyActions.watchAdminUpdated.Parameters) => () => void;
|
|
1402
|
+
/**
|
|
1403
|
+
* Watches for whitelist update events.
|
|
1404
|
+
*
|
|
1405
|
+
* @example
|
|
1406
|
+
* ```ts
|
|
1407
|
+
* import { createClient, http } from 'viem'
|
|
1408
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1409
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1410
|
+
*
|
|
1411
|
+
* const client = createClient({
|
|
1412
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1413
|
+
* transport: http(),
|
|
1414
|
+
* }).extend(tempoActions())
|
|
1415
|
+
*
|
|
1416
|
+
* const unwatch = client.policy.watchWhitelistUpdated({
|
|
1417
|
+
* onWhitelistUpdated: (args, log) => {
|
|
1418
|
+
* console.log('Whitelist updated:', args)
|
|
1419
|
+
* },
|
|
1420
|
+
* })
|
|
1421
|
+
* ```
|
|
1422
|
+
*
|
|
1423
|
+
* @param parameters - Parameters.
|
|
1424
|
+
* @returns A function to unsubscribe from the event.
|
|
1425
|
+
*/
|
|
1426
|
+
watchWhitelistUpdated: (parameters: policyActions.watchWhitelistUpdated.Parameters) => () => void;
|
|
1427
|
+
/**
|
|
1428
|
+
* Watches for blacklist update events.
|
|
1429
|
+
*
|
|
1430
|
+
* @example
|
|
1431
|
+
* ```ts
|
|
1432
|
+
* import { createClient, http } from 'viem'
|
|
1433
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1434
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1435
|
+
*
|
|
1436
|
+
* const client = createClient({
|
|
1437
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1438
|
+
* transport: http(),
|
|
1439
|
+
* }).extend(tempoActions())
|
|
1440
|
+
*
|
|
1441
|
+
* const unwatch = client.policy.watchBlacklistUpdated({
|
|
1442
|
+
* onBlacklistUpdated: (args, log) => {
|
|
1443
|
+
* console.log('Blacklist updated:', args)
|
|
1444
|
+
* },
|
|
1445
|
+
* })
|
|
1446
|
+
* ```
|
|
1447
|
+
*
|
|
1448
|
+
* @param parameters - Parameters.
|
|
1449
|
+
* @returns A function to unsubscribe from the event.
|
|
1450
|
+
*/
|
|
1451
|
+
watchBlacklistUpdated: (parameters: policyActions.watchBlacklistUpdated.Parameters) => () => void;
|
|
1452
|
+
};
|
|
1453
|
+
reward: {
|
|
1454
|
+
/**
|
|
1455
|
+
* Claims accumulated rewards for a recipient.
|
|
1456
|
+
*
|
|
1457
|
+
* @example
|
|
1458
|
+
* ```ts
|
|
1459
|
+
* import { createClient, http } from 'viem'
|
|
1460
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1461
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1462
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1463
|
+
*
|
|
1464
|
+
* const client = createClient({
|
|
1465
|
+
* account: privateKeyToAccount('0x...'),
|
|
1466
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1467
|
+
* transport: http(),
|
|
1468
|
+
* }).extend(tempoActions())
|
|
1469
|
+
*
|
|
1470
|
+
* const hash = await client.reward.claim({
|
|
1471
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1472
|
+
* })
|
|
1473
|
+
* ```
|
|
1474
|
+
*
|
|
1475
|
+
* @param parameters - Parameters.
|
|
1476
|
+
* @returns The transaction hash.
|
|
1477
|
+
*/
|
|
1478
|
+
claim: (parameters: rewardActions.claim.Parameters<chain, account>) => Promise<rewardActions.claim.ReturnValue>;
|
|
1479
|
+
/**
|
|
1480
|
+
* Claims accumulated rewards for a recipient and waits for confirmation.
|
|
1481
|
+
*
|
|
1482
|
+
* @example
|
|
1483
|
+
* ```ts
|
|
1484
|
+
* import { createClient, http } from 'viem'
|
|
1485
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1486
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1487
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1488
|
+
*
|
|
1489
|
+
* const client = createClient({
|
|
1490
|
+
* account: privateKeyToAccount('0x...'),
|
|
1491
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1492
|
+
* transport: http(),
|
|
1493
|
+
* }).extend(tempoActions())
|
|
1494
|
+
*
|
|
1495
|
+
* const result = await client.reward.claimSync({
|
|
1496
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1497
|
+
* })
|
|
1498
|
+
* ```
|
|
1499
|
+
*
|
|
1500
|
+
* @param parameters - Parameters.
|
|
1501
|
+
* @returns The amount claimed and transaction receipt.
|
|
1502
|
+
*/
|
|
1503
|
+
claimSync: (parameters: rewardActions.claimSync.Parameters<chain, account>) => Promise<rewardActions.claimSync.ReturnValue>;
|
|
1504
|
+
/**
|
|
1505
|
+
* Gets the total reward per second rate for all active streams.
|
|
1506
|
+
*
|
|
1507
|
+
* @example
|
|
1508
|
+
* ```ts
|
|
1509
|
+
* import { createClient, http } from 'viem'
|
|
1510
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1511
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1512
|
+
*
|
|
1513
|
+
* const client = createClient({
|
|
1514
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1515
|
+
* transport: http(),
|
|
1516
|
+
* }).extend(tempoActions())
|
|
1517
|
+
*
|
|
1518
|
+
* const rate = await client.reward.getTotalPerSecond({
|
|
1519
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1520
|
+
* })
|
|
1521
|
+
* ```
|
|
1522
|
+
*
|
|
1523
|
+
* @param parameters - Parameters.
|
|
1524
|
+
* @returns The total reward per second (scaled by 1e18).
|
|
1525
|
+
*/
|
|
1526
|
+
getTotalPerSecond: (parameters: rewardActions.getTotalPerSecond.Parameters) => Promise<rewardActions.getTotalPerSecond.ReturnValue>;
|
|
1527
|
+
/**
|
|
1528
|
+
* Gets the reward information for a specific account.
|
|
1529
|
+
*
|
|
1530
|
+
* @example
|
|
1531
|
+
* ```ts
|
|
1532
|
+
* import { createClient, http } from 'viem'
|
|
1533
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1534
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1535
|
+
*
|
|
1536
|
+
* const client = createClient({
|
|
1537
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1538
|
+
* transport: http(),
|
|
1539
|
+
* }).extend(tempoActions())
|
|
1540
|
+
*
|
|
1541
|
+
* const info = await client.reward.getUserRewardInfo({
|
|
1542
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1543
|
+
* account: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
|
1544
|
+
* })
|
|
1545
|
+
* ```
|
|
1546
|
+
*
|
|
1547
|
+
* @param parameters - Parameters.
|
|
1548
|
+
* @returns The user's reward information (recipient, rewardPerToken, rewardBalance).
|
|
1549
|
+
*/
|
|
1550
|
+
getUserRewardInfo: (parameters: rewardActions.getUserRewardInfo.Parameters) => Promise<rewardActions.getUserRewardInfo.ReturnValue>;
|
|
1551
|
+
/**
|
|
1552
|
+
* Sets or changes the reward recipient for a token holder.
|
|
1553
|
+
*
|
|
1554
|
+
* @example
|
|
1555
|
+
* ```ts
|
|
1556
|
+
* import { createClient, http } from 'viem'
|
|
1557
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1558
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1559
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1560
|
+
*
|
|
1561
|
+
* const client = createClient({
|
|
1562
|
+
* account: privateKeyToAccount('0x...'),
|
|
1563
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1564
|
+
* transport: http(),
|
|
1565
|
+
* }).extend(tempoActions())
|
|
1566
|
+
*
|
|
1567
|
+
* const hash = await client.reward.setRecipient({
|
|
1568
|
+
* recipient: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
|
1569
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1570
|
+
* })
|
|
1571
|
+
* ```
|
|
1572
|
+
*
|
|
1573
|
+
* @param parameters - Parameters.
|
|
1574
|
+
* @returns The transaction hash.
|
|
1575
|
+
*/
|
|
1576
|
+
setRecipient: (parameters: rewardActions.setRecipient.Parameters<chain, account>) => Promise<rewardActions.setRecipient.ReturnValue>;
|
|
1577
|
+
/**
|
|
1578
|
+
* Sets or changes the reward recipient for a token holder and waits for confirmation.
|
|
1579
|
+
*
|
|
1580
|
+
* @example
|
|
1581
|
+
* ```ts
|
|
1582
|
+
* import { createClient, http } from 'viem'
|
|
1583
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1584
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1585
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1586
|
+
*
|
|
1587
|
+
* const client = createClient({
|
|
1588
|
+
* account: privateKeyToAccount('0x...'),
|
|
1589
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1590
|
+
* transport: http(),
|
|
1591
|
+
* }).extend(tempoActions())
|
|
1592
|
+
*
|
|
1593
|
+
* const result = await client.reward.setRecipientSync({
|
|
1594
|
+
* recipient: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
|
1595
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1596
|
+
* })
|
|
1597
|
+
* ```
|
|
1598
|
+
*
|
|
1599
|
+
* @param parameters - Parameters.
|
|
1600
|
+
* @returns The transaction receipt and event data.
|
|
1601
|
+
*/
|
|
1602
|
+
setRecipientSync: (parameters: rewardActions.setRecipientSync.Parameters<chain, account>) => Promise<rewardActions.setRecipientSync.ReturnValue>;
|
|
1603
|
+
/**
|
|
1604
|
+
* Starts a new reward stream that distributes tokens to opted-in holders.
|
|
1605
|
+
*
|
|
1606
|
+
* @example
|
|
1607
|
+
* ```ts
|
|
1608
|
+
* import { createClient, http } from 'viem'
|
|
1609
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1610
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1611
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1612
|
+
*
|
|
1613
|
+
* const client = createClient({
|
|
1614
|
+
* account: privateKeyToAccount('0x...'),
|
|
1615
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1616
|
+
* transport: http(),
|
|
1617
|
+
* }).extend(tempoActions())
|
|
1618
|
+
*
|
|
1619
|
+
* const hash = await client.reward.start({
|
|
1620
|
+
* amount: 100000000000000000000n,
|
|
1621
|
+
* seconds: 86400,
|
|
1622
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1623
|
+
* })
|
|
1624
|
+
* ```
|
|
1625
|
+
*
|
|
1626
|
+
* @param parameters - Parameters.
|
|
1627
|
+
* @returns The transaction hash.
|
|
1628
|
+
*/
|
|
1629
|
+
start: (parameters: rewardActions.start.Parameters<chain, account>) => Promise<rewardActions.start.ReturnValue>;
|
|
1630
|
+
/**
|
|
1631
|
+
* Starts a new reward stream that distributes tokens to opted-in holders and waits for confirmation.
|
|
1632
|
+
*
|
|
1633
|
+
* @example
|
|
1634
|
+
* ```ts
|
|
1635
|
+
* import { createClient, http } from 'viem'
|
|
1636
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1637
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1638
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1639
|
+
*
|
|
1640
|
+
* const client = createClient({
|
|
1641
|
+
* account: privateKeyToAccount('0x...'),
|
|
1642
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1643
|
+
* transport: http(),
|
|
1644
|
+
* }).extend(tempoActions())
|
|
1645
|
+
*
|
|
1646
|
+
* const result = await client.reward.startSync({
|
|
1647
|
+
* amount: 100000000000000000000n,
|
|
1648
|
+
* seconds: 86400,
|
|
1649
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1650
|
+
* })
|
|
1651
|
+
* ```
|
|
1652
|
+
*
|
|
1653
|
+
* @param parameters - Parameters.
|
|
1654
|
+
* @returns The transaction receipt and event data.
|
|
1655
|
+
*/
|
|
1656
|
+
startSync: (parameters: rewardActions.startSync.Parameters<chain, account>) => Promise<rewardActions.startSync.ReturnValue>;
|
|
1657
|
+
/**
|
|
1658
|
+
* Watches for reward recipient set events.
|
|
1659
|
+
*
|
|
1660
|
+
* @example
|
|
1661
|
+
* ```ts
|
|
1662
|
+
* import { createClient, http } from 'viem'
|
|
1663
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1664
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1665
|
+
*
|
|
1666
|
+
* const client = createClient({
|
|
1667
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1668
|
+
* transport: http(),
|
|
1669
|
+
* }).extend(tempoActions())
|
|
1670
|
+
*
|
|
1671
|
+
* const unwatch = client.reward.watchRewardRecipientSet({
|
|
1672
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1673
|
+
* onRewardRecipientSet: (args, log) => {
|
|
1674
|
+
* console.log('Reward recipient set:', args)
|
|
1675
|
+
* },
|
|
1676
|
+
* })
|
|
1677
|
+
* ```
|
|
1678
|
+
*
|
|
1679
|
+
* @param parameters - Parameters.
|
|
1680
|
+
* @returns A function to unsubscribe from the event.
|
|
1681
|
+
*/
|
|
1682
|
+
watchRewardRecipientSet: (parameters: rewardActions.watchRewardRecipientSet.Parameters) => () => void;
|
|
1683
|
+
/**
|
|
1684
|
+
* Watches for reward scheduled events.
|
|
1685
|
+
*
|
|
1686
|
+
* @example
|
|
1687
|
+
* ```ts
|
|
1688
|
+
* import { createClient, http } from 'viem'
|
|
1689
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1690
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1691
|
+
*
|
|
1692
|
+
* const client = createClient({
|
|
1693
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1694
|
+
* transport: http(),
|
|
1695
|
+
* }).extend(tempoActions())
|
|
1696
|
+
*
|
|
1697
|
+
* const unwatch = client.reward.watchRewardScheduled({
|
|
1698
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1699
|
+
* onRewardScheduled: (args, log) => {
|
|
1700
|
+
* console.log('Reward scheduled:', args)
|
|
1701
|
+
* },
|
|
1702
|
+
* })
|
|
1703
|
+
* ```
|
|
1704
|
+
*
|
|
1705
|
+
* @param parameters - Parameters.
|
|
1706
|
+
* @returns A function to unsubscribe from the event.
|
|
1707
|
+
*/
|
|
1708
|
+
watchRewardScheduled: (parameters: rewardActions.watchRewardScheduled.Parameters) => () => void;
|
|
1709
|
+
};
|
|
1710
|
+
token: {
|
|
1711
|
+
/**
|
|
1712
|
+
* Approves a spender to transfer TIP20 tokens on behalf of the caller.
|
|
1713
|
+
*
|
|
1714
|
+
* @example
|
|
1715
|
+
* ```ts
|
|
1716
|
+
* import { createClient, http } from 'viem'
|
|
1717
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1718
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1719
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1720
|
+
*
|
|
1721
|
+
* const client = createClient({
|
|
1722
|
+
* account: privateKeyToAccount('0x...'),
|
|
1723
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1724
|
+
* transport: http(),
|
|
1725
|
+
* }).extend(tempoActions())
|
|
1726
|
+
*
|
|
1727
|
+
* const hash = await client.token.approve({
|
|
1728
|
+
* spender: '0x...',
|
|
1729
|
+
* amount: 100n,
|
|
1730
|
+
* })
|
|
1731
|
+
* ```
|
|
1732
|
+
*
|
|
1733
|
+
* @param client - Client.
|
|
1734
|
+
* @param parameters - Parameters.
|
|
1735
|
+
* @returns The transaction hash.
|
|
1736
|
+
*/
|
|
1737
|
+
approve: (parameters: tokenActions.approve.Parameters<chain, account>) => Promise<tokenActions.approve.ReturnValue>;
|
|
1738
|
+
/**
|
|
1739
|
+
* Approves a spender to transfer TIP20 tokens on behalf of the caller.
|
|
1740
|
+
*
|
|
1741
|
+
* @example
|
|
1742
|
+
* ```ts
|
|
1743
|
+
* import { createClient, http } from 'viem'
|
|
1744
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1745
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1746
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1747
|
+
*
|
|
1748
|
+
* const client = createClient({
|
|
1749
|
+
* account: privateKeyToAccount('0x...'),
|
|
1750
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1751
|
+
* transport: http(),
|
|
1752
|
+
* }).extend(tempoActions())
|
|
1753
|
+
*
|
|
1754
|
+
* const result = await client.token.approveSync({
|
|
1755
|
+
* spender: '0x...',
|
|
1756
|
+
* amount: 100n,
|
|
1757
|
+
* })
|
|
1758
|
+
* ```
|
|
1759
|
+
*
|
|
1760
|
+
* @param client - Client.
|
|
1761
|
+
* @param parameters - Parameters.
|
|
1762
|
+
* @returns The transaction receipt and event data.
|
|
1763
|
+
*/
|
|
1764
|
+
approveSync: (parameters: tokenActions.approveSync.Parameters<chain, account>) => Promise<tokenActions.approveSync.ReturnValue>;
|
|
1765
|
+
/**
|
|
1766
|
+
* Burns TIP20 tokens from a blocked address.
|
|
1767
|
+
*
|
|
1768
|
+
* @example
|
|
1769
|
+
* ```ts
|
|
1770
|
+
* import { createClient, http } from 'viem'
|
|
1771
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1772
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1773
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1774
|
+
*
|
|
1775
|
+
* const client = createClient({
|
|
1776
|
+
* account: privateKeyToAccount('0x...'),
|
|
1777
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1778
|
+
* transport: http(),
|
|
1779
|
+
* }).extend(tempoActions())
|
|
1780
|
+
*
|
|
1781
|
+
* const hash = await client.token.burnBlocked({
|
|
1782
|
+
* from: '0x...',
|
|
1783
|
+
* amount: 100n,
|
|
1784
|
+
* token: '0x...',
|
|
1785
|
+
* })
|
|
1786
|
+
* ```
|
|
1787
|
+
*
|
|
1788
|
+
* @param client - Client.
|
|
1789
|
+
* @param parameters - Parameters.
|
|
1790
|
+
* @returns The transaction hash.
|
|
1791
|
+
*/
|
|
1792
|
+
burnBlocked: (parameters: tokenActions.burnBlocked.Parameters<chain, account>) => Promise<tokenActions.burnBlocked.ReturnValue>;
|
|
1793
|
+
/**
|
|
1794
|
+
* Burns TIP20 tokens from a blocked address.
|
|
1795
|
+
*
|
|
1796
|
+
* @example
|
|
1797
|
+
* ```ts
|
|
1798
|
+
* import { createClient, http } from 'viem'
|
|
1799
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1800
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1801
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1802
|
+
*
|
|
1803
|
+
* const client = createClient({
|
|
1804
|
+
* account: privateKeyToAccount('0x...'),
|
|
1805
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1806
|
+
* transport: http(),
|
|
1807
|
+
* }).extend(tempoActions())
|
|
1808
|
+
*
|
|
1809
|
+
* const result = await client.token.burnBlockedSync({
|
|
1810
|
+
* from: '0x...',
|
|
1811
|
+
* amount: 100n,
|
|
1812
|
+
* token: '0x...',
|
|
1813
|
+
* })
|
|
1814
|
+
* ```
|
|
1815
|
+
*
|
|
1816
|
+
* @param client - Client.
|
|
1817
|
+
* @param parameters - Parameters.
|
|
1818
|
+
* @returns The transaction receipt and event data.
|
|
1819
|
+
*/
|
|
1820
|
+
burnBlockedSync: (parameters: tokenActions.burnBlockedSync.Parameters<chain, account>) => Promise<tokenActions.burnBlockedSync.ReturnValue>;
|
|
1821
|
+
/**
|
|
1822
|
+
* Burns TIP20 tokens from the caller's balance.
|
|
1823
|
+
*
|
|
1824
|
+
* @example
|
|
1825
|
+
* ```ts
|
|
1826
|
+
* import { createClient, http } from 'viem'
|
|
1827
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1828
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1829
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1830
|
+
*
|
|
1831
|
+
* const client = createClient({
|
|
1832
|
+
* account: privateKeyToAccount('0x...'),
|
|
1833
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1834
|
+
* transport: http(),
|
|
1835
|
+
* }).extend(tempoActions())
|
|
1836
|
+
*
|
|
1837
|
+
* const hash = await client.token.burn({
|
|
1838
|
+
* amount: 100n,
|
|
1839
|
+
* token: '0x...',
|
|
1840
|
+
* })
|
|
1841
|
+
* ```
|
|
1842
|
+
*
|
|
1843
|
+
* @param client - Client.
|
|
1844
|
+
* @param parameters - Parameters.
|
|
1845
|
+
* @returns The transaction hash.
|
|
1846
|
+
*/
|
|
1847
|
+
burn: (parameters: tokenActions.burn.Parameters<chain, account>) => Promise<tokenActions.burn.ReturnValue>;
|
|
1848
|
+
/**
|
|
1849
|
+
* Burns TIP20 tokens from the caller's balance.
|
|
1850
|
+
*
|
|
1851
|
+
* @example
|
|
1852
|
+
* ```ts
|
|
1853
|
+
* import { createClient, http } from 'viem'
|
|
1854
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1855
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1856
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1857
|
+
*
|
|
1858
|
+
* const client = createClient({
|
|
1859
|
+
* account: privateKeyToAccount('0x...'),
|
|
1860
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1861
|
+
* transport: http(),
|
|
1862
|
+
* }).extend(tempoActions())
|
|
1863
|
+
*
|
|
1864
|
+
* const result = await client.token.burnSync({
|
|
1865
|
+
* amount: 100n,
|
|
1866
|
+
* token: '0x...',
|
|
1867
|
+
* })
|
|
1868
|
+
* ```
|
|
1869
|
+
*
|
|
1870
|
+
* @param client - Client.
|
|
1871
|
+
* @param parameters - Parameters.
|
|
1872
|
+
* @returns The transaction receipt and event data.
|
|
1873
|
+
*/
|
|
1874
|
+
burnSync: (parameters: tokenActions.burnSync.Parameters<chain, account>) => Promise<tokenActions.burnSync.ReturnValue>;
|
|
1875
|
+
/**
|
|
1876
|
+
* Changes the transfer policy ID for a TIP20 token.
|
|
1877
|
+
*
|
|
1878
|
+
* @example
|
|
1879
|
+
* ```ts
|
|
1880
|
+
* import { createClient, http } from 'viem'
|
|
1881
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1882
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1883
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1884
|
+
*
|
|
1885
|
+
* const client = createClient({
|
|
1886
|
+
* account: privateKeyToAccount('0x...'),
|
|
1887
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1888
|
+
* transport: http(),
|
|
1889
|
+
* }).extend(tempoActions())
|
|
1890
|
+
*
|
|
1891
|
+
* const hash = await client.token.changeTransferPolicy({
|
|
1892
|
+
* token: '0x...',
|
|
1893
|
+
* policyId: 1n,
|
|
1894
|
+
* })
|
|
1895
|
+
* ```
|
|
1896
|
+
*
|
|
1897
|
+
* @param client - Client.
|
|
1898
|
+
* @param parameters - Parameters.
|
|
1899
|
+
* @returns The transaction hash.
|
|
1900
|
+
*/
|
|
1901
|
+
changeTransferPolicy: (parameters: tokenActions.changeTransferPolicy.Parameters<chain, account>) => Promise<tokenActions.changeTransferPolicy.ReturnValue>;
|
|
1902
|
+
/**
|
|
1903
|
+
* Changes the transfer policy ID for a TIP20 token.
|
|
1904
|
+
*
|
|
1905
|
+
* @example
|
|
1906
|
+
* ```ts
|
|
1907
|
+
* import { createClient, http } from 'viem'
|
|
1908
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1909
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1910
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1911
|
+
*
|
|
1912
|
+
* const client = createClient({
|
|
1913
|
+
* account: privateKeyToAccount('0x...'),
|
|
1914
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1915
|
+
* transport: http(),
|
|
1916
|
+
* }).extend(tempoActions())
|
|
1917
|
+
*
|
|
1918
|
+
* const result = await client.token.changeTransferPolicySync({
|
|
1919
|
+
* token: '0x...',
|
|
1920
|
+
* policyId: 1n,
|
|
1921
|
+
* })
|
|
1922
|
+
* ```
|
|
1923
|
+
*
|
|
1924
|
+
* @param client - Client.
|
|
1925
|
+
* @param parameters - Parameters.
|
|
1926
|
+
* @returns The transaction receipt and event data.
|
|
1927
|
+
*/
|
|
1928
|
+
changeTransferPolicySync: (parameters: tokenActions.changeTransferPolicySync.Parameters<chain, account>) => Promise<tokenActions.changeTransferPolicySync.ReturnValue>;
|
|
1929
|
+
/**
|
|
1930
|
+
* Creates a new TIP20 token.
|
|
1931
|
+
*
|
|
1932
|
+
* @example
|
|
1933
|
+
* ```ts
|
|
1934
|
+
* import { createClient, http } from 'viem'
|
|
1935
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1936
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1937
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1938
|
+
*
|
|
1939
|
+
* const client = createClient({
|
|
1940
|
+
* account: privateKeyToAccount('0x...'),
|
|
1941
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1942
|
+
* transport: http(),
|
|
1943
|
+
* }).extend(tempoActions())
|
|
1944
|
+
*
|
|
1945
|
+
* const { hash, id, address } = await client.token.create({
|
|
1946
|
+
* name: 'My Token',
|
|
1947
|
+
* symbol: 'MTK',
|
|
1948
|
+
* currency: 'USD',
|
|
1949
|
+
* })
|
|
1950
|
+
* ```
|
|
1951
|
+
*
|
|
1952
|
+
* @param client - Client.
|
|
1953
|
+
* @param parameters - Parameters.
|
|
1954
|
+
* @returns The transaction hash.
|
|
1955
|
+
*/
|
|
1956
|
+
create: (parameters: tokenActions.create.Parameters<chain, account>) => Promise<tokenActions.create.ReturnValue>;
|
|
1957
|
+
/**
|
|
1958
|
+
* Creates a new TIP20 token.
|
|
1959
|
+
*
|
|
1960
|
+
* @example
|
|
1961
|
+
* ```ts
|
|
1962
|
+
* import { createClient, http } from 'viem'
|
|
1963
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1964
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1965
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1966
|
+
*
|
|
1967
|
+
* const client = createClient({
|
|
1968
|
+
* account: privateKeyToAccount('0x...'),
|
|
1969
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1970
|
+
* transport: http(),
|
|
1971
|
+
* }).extend(tempoActions())
|
|
1972
|
+
*
|
|
1973
|
+
* const result = await client.token.createSync({
|
|
1974
|
+
* name: 'My Token',
|
|
1975
|
+
* symbol: 'MTK',
|
|
1976
|
+
* currency: 'USD',
|
|
1977
|
+
* })
|
|
1978
|
+
* ```
|
|
1979
|
+
*
|
|
1980
|
+
* @param client - Client.
|
|
1981
|
+
* @param parameters - Parameters.
|
|
1982
|
+
* @returns The transaction receipt and event data.
|
|
1983
|
+
*/
|
|
1984
|
+
createSync: (parameters: tokenActions.createSync.Parameters<chain, account>) => Promise<tokenActions.createSync.ReturnValue>;
|
|
1985
|
+
/**
|
|
1986
|
+
* Gets TIP20 token allowance.
|
|
1987
|
+
*
|
|
1988
|
+
* @example
|
|
1989
|
+
* ```ts
|
|
1990
|
+
* import { createClient, http } from 'viem'
|
|
1991
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1992
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1993
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1994
|
+
*
|
|
1995
|
+
* const client = createClient({
|
|
1996
|
+
* account: privateKeyToAccount('0x...'),
|
|
1997
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1998
|
+
* transport: http(),
|
|
1999
|
+
* }).extend(tempoActions())
|
|
2000
|
+
*
|
|
2001
|
+
* const allowance = await client.token.getAllowance({
|
|
2002
|
+
* spender: '0x...',
|
|
2003
|
+
* })
|
|
2004
|
+
* ```
|
|
2005
|
+
*
|
|
2006
|
+
* @param client - Client.
|
|
2007
|
+
* @param parameters - Parameters.
|
|
2008
|
+
* @returns The token allowance.
|
|
2009
|
+
*/
|
|
2010
|
+
getAllowance: (parameters: tokenActions.getAllowance.Parameters) => Promise<tokenActions.getAllowance.ReturnValue>;
|
|
2011
|
+
/**
|
|
2012
|
+
* Gets TIP20 token balance for an address.
|
|
2013
|
+
*
|
|
2014
|
+
* @example
|
|
2015
|
+
* ```ts
|
|
2016
|
+
* import { createClient, http } from 'viem'
|
|
2017
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2018
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2019
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2020
|
+
*
|
|
2021
|
+
* const client = createClient({
|
|
2022
|
+
* account: privateKeyToAccount('0x...'),
|
|
2023
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2024
|
+
* transport: http(),
|
|
2025
|
+
* }).extend(tempoActions())
|
|
2026
|
+
*
|
|
2027
|
+
* const balance = await client.token.getBalance()
|
|
2028
|
+
* ```
|
|
2029
|
+
*
|
|
2030
|
+
* @param client - Client.
|
|
2031
|
+
* @param parameters - Parameters.
|
|
2032
|
+
* @returns The token balance.
|
|
2033
|
+
*/
|
|
2034
|
+
getBalance: (parameters: tokenActions.getBalance.Parameters<account>) => Promise<tokenActions.getBalance.ReturnValue>;
|
|
2035
|
+
/**
|
|
2036
|
+
* Gets TIP20 token metadata including name, symbol, currency, decimals, and total supply.
|
|
2037
|
+
*
|
|
2038
|
+
* @example
|
|
2039
|
+
* ```ts
|
|
2040
|
+
* import { createClient, http } from 'viem'
|
|
2041
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2042
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2043
|
+
*
|
|
2044
|
+
* const client = createClient({
|
|
2045
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2046
|
+
* transport: http(),
|
|
2047
|
+
* }).extend(tempoActions())
|
|
2048
|
+
*
|
|
2049
|
+
* const metadata = await client.token.getMetadata({
|
|
2050
|
+
* token: '0x...',
|
|
2051
|
+
* })
|
|
2052
|
+
* ```
|
|
2053
|
+
*
|
|
2054
|
+
* @param client - Client.
|
|
2055
|
+
* @param parameters - Parameters.
|
|
2056
|
+
* @returns The token metadata.
|
|
2057
|
+
*/
|
|
2058
|
+
getMetadata: (parameters: tokenActions.getMetadata.Parameters) => Promise<tokenActions.getMetadata.ReturnValue>;
|
|
2059
|
+
/**
|
|
2060
|
+
* Gets the admin role for a specific role in a TIP20 token.
|
|
2061
|
+
*
|
|
2062
|
+
* @example
|
|
2063
|
+
* ```ts
|
|
2064
|
+
* import { createClient, http } from 'viem'
|
|
2065
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2066
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2067
|
+
*
|
|
2068
|
+
* const client = createClient({
|
|
2069
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2070
|
+
* transport: http(),
|
|
2071
|
+
* }).extend(tempoActions())
|
|
2072
|
+
*
|
|
2073
|
+
* const adminRole = await client.token.getRoleAdmin({
|
|
2074
|
+
* role: 'issuer',
|
|
2075
|
+
* token: '0x...',
|
|
2076
|
+
* })
|
|
2077
|
+
* ```
|
|
2078
|
+
*
|
|
2079
|
+
* @param client - Client.
|
|
2080
|
+
* @param parameters - Parameters.
|
|
2081
|
+
* @returns The admin role hash.
|
|
2082
|
+
*/
|
|
2083
|
+
getRoleAdmin: (parameters: tokenActions.getRoleAdmin.Parameters) => Promise<tokenActions.getRoleAdmin.ReturnValue>;
|
|
2084
|
+
/**
|
|
2085
|
+
* Checks if an account has a specific role for a TIP20 token.
|
|
2086
|
+
*
|
|
2087
|
+
* @example
|
|
2088
|
+
* ```ts
|
|
2089
|
+
* import { createClient, http } from 'viem'
|
|
2090
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2091
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2092
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2093
|
+
*
|
|
2094
|
+
* const client = createClient({
|
|
2095
|
+
* account: privateKeyToAccount('0x...'),
|
|
2096
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2097
|
+
* transport: http(),
|
|
2098
|
+
* }).extend(tempoActions())
|
|
2099
|
+
*
|
|
2100
|
+
* const hasRole = await client.token.hasRole({
|
|
2101
|
+
* token: '0x...',
|
|
2102
|
+
* role: 'issuer',
|
|
2103
|
+
* })
|
|
2104
|
+
* ```
|
|
2105
|
+
*
|
|
2106
|
+
* @param client - Client.
|
|
2107
|
+
* @param parameters - Parameters.
|
|
2108
|
+
* @returns Whether the account has the role.
|
|
2109
|
+
*/
|
|
2110
|
+
hasRole: (parameters: tokenActions.hasRole.Parameters<account>) => Promise<tokenActions.hasRole.ReturnValue>;
|
|
2111
|
+
/**
|
|
2112
|
+
* Grants a role for a TIP20 token.
|
|
2113
|
+
*
|
|
2114
|
+
* @example
|
|
2115
|
+
* ```ts
|
|
2116
|
+
* import { createClient, http } from 'viem'
|
|
2117
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2118
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2119
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2120
|
+
*
|
|
2121
|
+
* const client = createClient({
|
|
2122
|
+
* account: privateKeyToAccount('0x...'),
|
|
2123
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2124
|
+
* transport: http(),
|
|
2125
|
+
* }).extend(tempoActions())
|
|
2126
|
+
*
|
|
2127
|
+
* const hash = await client.token.grantRoles({
|
|
2128
|
+
* token: '0x...',
|
|
2129
|
+
* to: '0x...',
|
|
2130
|
+
* roles: ['issuer'],
|
|
2131
|
+
* })
|
|
2132
|
+
* ```
|
|
2133
|
+
*
|
|
2134
|
+
* @param client - Client.
|
|
2135
|
+
* @param parameters - Parameters.
|
|
2136
|
+
* @returns The transaction hash.
|
|
2137
|
+
*/
|
|
2138
|
+
grantRoles: (parameters: tokenActions.grantRoles.Parameters<chain, account>) => Promise<tokenActions.grantRoles.ReturnValue>;
|
|
2139
|
+
/**
|
|
2140
|
+
* Grants a role for a TIP20 token.
|
|
2141
|
+
*
|
|
2142
|
+
* @example
|
|
2143
|
+
* ```ts
|
|
2144
|
+
* import { createClient, http } from 'viem'
|
|
2145
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2146
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2147
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2148
|
+
*
|
|
2149
|
+
* const client = createClient({
|
|
2150
|
+
* account: privateKeyToAccount('0x...'),
|
|
2151
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2152
|
+
* transport: http(),
|
|
2153
|
+
* }).extend(tempoActions())
|
|
2154
|
+
*
|
|
2155
|
+
* const result = await client.token.grantRolesSync({
|
|
2156
|
+
* token: '0x...',
|
|
2157
|
+
* to: '0x...',
|
|
2158
|
+
* roles: ['issuer'],
|
|
2159
|
+
* })
|
|
2160
|
+
* ```
|
|
2161
|
+
*
|
|
2162
|
+
* @param parameters - Parameters.
|
|
2163
|
+
* @returns The transaction receipt and event data.
|
|
2164
|
+
*/
|
|
2165
|
+
grantRolesSync: (parameters: tokenActions.grantRolesSync.Parameters<chain, account>) => Promise<tokenActions.grantRolesSync.ReturnValue>;
|
|
2166
|
+
/**
|
|
2167
|
+
* Mints TIP20 tokens to an address.
|
|
2168
|
+
*
|
|
2169
|
+
* @example
|
|
2170
|
+
* ```ts
|
|
2171
|
+
* import { createClient, http } from 'viem'
|
|
2172
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2173
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2174
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2175
|
+
*
|
|
2176
|
+
* const client = createClient({
|
|
2177
|
+
* account: privateKeyToAccount('0x...'),
|
|
2178
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2179
|
+
* transport: http(),
|
|
2180
|
+
* }).extend(tempoActions())
|
|
2181
|
+
*
|
|
2182
|
+
* const hash = await client.token.mint({
|
|
2183
|
+
* to: '0x...',
|
|
2184
|
+
* amount: 100n,
|
|
2185
|
+
* token: '0x...',
|
|
2186
|
+
* })
|
|
2187
|
+
* ```
|
|
2188
|
+
*
|
|
2189
|
+
* @param client - Client.
|
|
2190
|
+
* @param parameters - Parameters.
|
|
2191
|
+
* @returns The transaction hash.
|
|
2192
|
+
*/
|
|
2193
|
+
mint: (parameters: tokenActions.mint.Parameters<chain, account>) => Promise<tokenActions.mint.ReturnValue>;
|
|
2194
|
+
/**
|
|
2195
|
+
* Mints TIP20 tokens to an address.
|
|
2196
|
+
*
|
|
2197
|
+
* @example
|
|
2198
|
+
* ```ts
|
|
2199
|
+
* import { createClient, http } from 'viem'
|
|
2200
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2201
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2202
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2203
|
+
*
|
|
2204
|
+
* const client = createClient({
|
|
2205
|
+
* account: privateKeyToAccount('0x...'),
|
|
2206
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2207
|
+
* transport: http(),
|
|
2208
|
+
* }).extend(tempoActions())
|
|
2209
|
+
*
|
|
2210
|
+
* const result = await client.token.mintSync({
|
|
2211
|
+
* to: '0x...',
|
|
2212
|
+
* amount: 100n,
|
|
2213
|
+
* token: '0x...',
|
|
2214
|
+
* })
|
|
2215
|
+
* ```
|
|
2216
|
+
*
|
|
2217
|
+
* @param client - Client.
|
|
2218
|
+
* @param parameters - Parameters.
|
|
2219
|
+
* @returns The transaction receipt and event data.
|
|
2220
|
+
*/
|
|
2221
|
+
mintSync: (parameters: tokenActions.mintSync.Parameters<chain, account>) => Promise<tokenActions.mintSync.ReturnValue>;
|
|
2222
|
+
/**
|
|
2223
|
+
* Pauses a TIP20 token.
|
|
2224
|
+
*
|
|
2225
|
+
* @example
|
|
2226
|
+
* ```ts
|
|
2227
|
+
* import { createClient, http } from 'viem'
|
|
2228
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2229
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2230
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2231
|
+
*
|
|
2232
|
+
* const client = createClient({
|
|
2233
|
+
* account: privateKeyToAccount('0x...'),
|
|
2234
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2235
|
+
* transport: http(),
|
|
2236
|
+
* }).extend(tempoActions())
|
|
2237
|
+
*
|
|
2238
|
+
* const hash = await client.token.pause({
|
|
2239
|
+
* token: '0x...',
|
|
2240
|
+
* })
|
|
2241
|
+
* ```
|
|
2242
|
+
*
|
|
2243
|
+
* @param client - Client.
|
|
2244
|
+
* @param parameters - Parameters.
|
|
2245
|
+
* @returns The transaction hash.
|
|
2246
|
+
*/
|
|
2247
|
+
pause: (parameters: tokenActions.pause.Parameters<chain, account>) => Promise<tokenActions.pause.ReturnValue>;
|
|
2248
|
+
/**
|
|
2249
|
+
* Pauses a TIP20 token.
|
|
2250
|
+
*
|
|
2251
|
+
* @example
|
|
2252
|
+
* ```ts
|
|
2253
|
+
* import { createClient, http } from 'viem'
|
|
2254
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2255
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2256
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2257
|
+
*
|
|
2258
|
+
* const client = createClient({
|
|
2259
|
+
* account: privateKeyToAccount('0x...'),
|
|
2260
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2261
|
+
* transport: http(),
|
|
2262
|
+
* }).extend(tempoActions())
|
|
2263
|
+
*
|
|
2264
|
+
* const result = await client.token.pauseSync({
|
|
2265
|
+
* token: '0x...',
|
|
2266
|
+
* })
|
|
2267
|
+
* ```
|
|
2268
|
+
*
|
|
2269
|
+
* @param client - Client.
|
|
2270
|
+
* @param parameters - Parameters.
|
|
2271
|
+
* @returns The transaction receipt and event data.
|
|
2272
|
+
*/
|
|
2273
|
+
pauseSync: (parameters: tokenActions.pauseSync.Parameters<chain, account>) => Promise<tokenActions.pauseSync.ReturnValue>;
|
|
2274
|
+
/**
|
|
2275
|
+
* Renounces a role for a TIP20 token.
|
|
2276
|
+
*
|
|
2277
|
+
* @example
|
|
2278
|
+
* ```ts
|
|
2279
|
+
* import { createClient, http } from 'viem'
|
|
2280
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2281
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2282
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2283
|
+
*
|
|
2284
|
+
* const client = createClient({
|
|
2285
|
+
* account: privateKeyToAccount('0x...'),
|
|
2286
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2287
|
+
* transport: http(),
|
|
2288
|
+
* }).extend(tempoActions())
|
|
2289
|
+
*
|
|
2290
|
+
* const hash = await client.token.renounceRoles({
|
|
2291
|
+
* token: '0x...',
|
|
2292
|
+
* roles: ['issuer'],
|
|
2293
|
+
* })
|
|
2294
|
+
* ```
|
|
2295
|
+
*
|
|
2296
|
+
* @param client - Client.
|
|
2297
|
+
* @param parameters - Parameters.
|
|
2298
|
+
* @returns The transaction hash.
|
|
2299
|
+
*/
|
|
2300
|
+
renounceRoles: (parameters: tokenActions.renounceRoles.Parameters<chain, account>) => Promise<tokenActions.renounceRoles.ReturnValue>;
|
|
2301
|
+
/**
|
|
2302
|
+
* Renounces a role for a TIP20 token.
|
|
2303
|
+
*
|
|
2304
|
+
* @example
|
|
2305
|
+
* ```ts
|
|
2306
|
+
* import { createClient, http } from 'viem'
|
|
2307
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2308
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2309
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2310
|
+
*
|
|
2311
|
+
* const client = createClient({
|
|
2312
|
+
* account: privateKeyToAccount('0x...'),
|
|
2313
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2314
|
+
* transport: http(),
|
|
2315
|
+
* }).extend(tempoActions())
|
|
2316
|
+
*
|
|
2317
|
+
* const result = await client.token.renounceRolesSync({
|
|
2318
|
+
* token: '0x...',
|
|
2319
|
+
* roles: ['issuer'],
|
|
2320
|
+
* })
|
|
2321
|
+
* ```
|
|
2322
|
+
*
|
|
2323
|
+
* @param parameters - Parameters.
|
|
2324
|
+
* @returns The transaction receipt and event data.
|
|
2325
|
+
*/
|
|
2326
|
+
renounceRolesSync: (parameters: tokenActions.renounceRolesSync.Parameters<chain, account>) => Promise<tokenActions.renounceRolesSync.ReturnValue>;
|
|
2327
|
+
/**
|
|
2328
|
+
* Revokes a role for a TIP20 token.
|
|
2329
|
+
*
|
|
2330
|
+
* @example
|
|
2331
|
+
* ```ts
|
|
2332
|
+
* import { createClient, http } from 'viem'
|
|
2333
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2334
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2335
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2336
|
+
*
|
|
2337
|
+
* const client = createClient({
|
|
2338
|
+
* account: privateKeyToAccount('0x...'),
|
|
2339
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2340
|
+
* transport: http(),
|
|
2341
|
+
* }).extend(tempoActions())
|
|
2342
|
+
*
|
|
2343
|
+
* const hash = await client.token.revokeRoles({
|
|
2344
|
+
* token: '0x...',
|
|
2345
|
+
* from: '0x...',
|
|
2346
|
+
* roles: ['issuer'],
|
|
2347
|
+
* })
|
|
2348
|
+
* ```
|
|
2349
|
+
*
|
|
2350
|
+
* @param client - Client.
|
|
2351
|
+
* @param parameters - Parameters.
|
|
2352
|
+
* @returns The transaction hash.
|
|
2353
|
+
*/
|
|
2354
|
+
revokeRoles: (parameters: tokenActions.revokeRoles.Parameters<chain, account>) => Promise<tokenActions.revokeRoles.ReturnValue>;
|
|
2355
|
+
/**
|
|
2356
|
+
* Revokes a role for a TIP20 token.
|
|
2357
|
+
*
|
|
2358
|
+
* @example
|
|
2359
|
+
* ```ts
|
|
2360
|
+
* import { createClient, http } from 'viem'
|
|
2361
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2362
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2363
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2364
|
+
*
|
|
2365
|
+
* const client = createClient({
|
|
2366
|
+
* account: privateKeyToAccount('0x...'),
|
|
2367
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2368
|
+
* transport: http(),
|
|
2369
|
+
* }).extend(tempoActions())
|
|
2370
|
+
*
|
|
2371
|
+
* const result = await client.token.revokeRolesSync({
|
|
2372
|
+
* token: '0x...',
|
|
2373
|
+
* from: '0x...',
|
|
2374
|
+
* roles: ['issuer'],
|
|
2375
|
+
* })
|
|
2376
|
+
* ```
|
|
2377
|
+
*
|
|
2378
|
+
* @param parameters - Parameters.
|
|
2379
|
+
* @returns The transaction receipt and event data.
|
|
2380
|
+
*/
|
|
2381
|
+
revokeRolesSync: (parameters: tokenActions.revokeRolesSync.Parameters<chain, account>) => Promise<tokenActions.revokeRolesSync.ReturnValue>;
|
|
2382
|
+
/**
|
|
2383
|
+
* Sets the supply cap for a TIP20 token.
|
|
2384
|
+
*
|
|
2385
|
+
* @example
|
|
2386
|
+
* ```ts
|
|
2387
|
+
* import { createClient, http } from 'viem'
|
|
2388
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2389
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2390
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2391
|
+
*
|
|
2392
|
+
* const client = createClient({
|
|
2393
|
+
* account: privateKeyToAccount('0x...'),
|
|
2394
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2395
|
+
* transport: http(),
|
|
2396
|
+
* }).extend(tempoActions())
|
|
2397
|
+
*
|
|
2398
|
+
* const hash = await client.token.setSupplyCap({
|
|
2399
|
+
* token: '0x...',
|
|
2400
|
+
* supplyCap: 1000000n,
|
|
2401
|
+
* })
|
|
2402
|
+
* ```
|
|
2403
|
+
*
|
|
2404
|
+
* @param client - Client.
|
|
2405
|
+
* @param parameters - Parameters.
|
|
2406
|
+
* @returns The transaction hash.
|
|
2407
|
+
*/
|
|
2408
|
+
setSupplyCap: (parameters: tokenActions.setSupplyCap.Parameters<chain, account>) => Promise<tokenActions.setSupplyCap.ReturnValue>;
|
|
2409
|
+
/**
|
|
2410
|
+
* Sets the supply cap for a TIP20 token.
|
|
2411
|
+
*
|
|
2412
|
+
* @example
|
|
2413
|
+
* ```ts
|
|
2414
|
+
* import { createClient, http } from 'viem'
|
|
2415
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2416
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2417
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2418
|
+
*
|
|
2419
|
+
* const client = createClient({
|
|
2420
|
+
* account: privateKeyToAccount('0x...'),
|
|
2421
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2422
|
+
* transport: http(),
|
|
2423
|
+
* }).extend(tempoActions())
|
|
2424
|
+
*
|
|
2425
|
+
* const result = await client.token.setSupplyCapSync({
|
|
2426
|
+
* token: '0x...',
|
|
2427
|
+
* supplyCap: 1000000n,
|
|
2428
|
+
* })
|
|
2429
|
+
* ```
|
|
2430
|
+
*
|
|
2431
|
+
* @param client - Client.
|
|
2432
|
+
* @param parameters - Parameters.
|
|
2433
|
+
* @returns The transaction receipt and event data.
|
|
2434
|
+
*/
|
|
2435
|
+
setSupplyCapSync: (parameters: tokenActions.setSupplyCapSync.Parameters<chain, account>) => Promise<tokenActions.setSupplyCapSync.ReturnValue>;
|
|
2436
|
+
/**
|
|
2437
|
+
* Sets the admin role for a specific role in a TIP20 token.
|
|
2438
|
+
*
|
|
2439
|
+
* @example
|
|
2440
|
+
* ```ts
|
|
2441
|
+
* import { createClient, http } from 'viem'
|
|
2442
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2443
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2444
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2445
|
+
*
|
|
2446
|
+
* const client = createClient({
|
|
2447
|
+
* account: privateKeyToAccount('0x...'),
|
|
2448
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2449
|
+
* transport: http(),
|
|
2450
|
+
* }).extend(tempoActions())
|
|
2451
|
+
*
|
|
2452
|
+
* const hash = await client.token.setRoleAdmin({
|
|
2453
|
+
* token: '0x...',
|
|
2454
|
+
* role: 'issuer',
|
|
2455
|
+
* adminRole: 'admin',
|
|
2456
|
+
* })
|
|
2457
|
+
* ```
|
|
2458
|
+
*
|
|
2459
|
+
* @param client - Client.
|
|
2460
|
+
* @param parameters - Parameters.
|
|
2461
|
+
* @returns The transaction hash.
|
|
2462
|
+
*/
|
|
2463
|
+
setRoleAdmin: (parameters: tokenActions.setRoleAdmin.Parameters<chain, account>) => Promise<tokenActions.setRoleAdmin.ReturnValue>;
|
|
2464
|
+
/**
|
|
2465
|
+
* Sets the admin role for a specific role in a TIP20 token.
|
|
2466
|
+
*
|
|
2467
|
+
* @example
|
|
2468
|
+
* ```ts
|
|
2469
|
+
* import { createClient, http } from 'viem'
|
|
2470
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2471
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2472
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2473
|
+
*
|
|
2474
|
+
* const client = createClient({
|
|
2475
|
+
* account: privateKeyToAccount('0x...'),
|
|
2476
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2477
|
+
* transport: http(),
|
|
2478
|
+
* }).extend(tempoActions())
|
|
2479
|
+
*
|
|
2480
|
+
* const result = await client.token.setRoleAdminSync({
|
|
2481
|
+
* token: '0x...',
|
|
2482
|
+
* role: 'issuer',
|
|
2483
|
+
* adminRole: 'admin',
|
|
2484
|
+
* })
|
|
2485
|
+
* ```
|
|
2486
|
+
*
|
|
2487
|
+
* @param client - Client.
|
|
2488
|
+
* @param parameters - Parameters.
|
|
2489
|
+
* @returns The transaction receipt and event data.
|
|
2490
|
+
*/
|
|
2491
|
+
setRoleAdminSync: (parameters: tokenActions.setRoleAdminSync.Parameters<chain, account>) => Promise<tokenActions.setRoleAdminSync.ReturnValue>;
|
|
2492
|
+
/**
|
|
2493
|
+
* Transfers TIP20 tokens to another address.
|
|
2494
|
+
*
|
|
2495
|
+
* @example
|
|
2496
|
+
* ```ts
|
|
2497
|
+
* import { createClient, http } from 'viem'
|
|
2498
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2499
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2500
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2501
|
+
*
|
|
2502
|
+
* const client = createClient({
|
|
2503
|
+
* account: privateKeyToAccount('0x...'),
|
|
2504
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2505
|
+
* transport: http(),
|
|
2506
|
+
* }).extend(tempoActions())
|
|
2507
|
+
*
|
|
2508
|
+
* const hash = await client.token.transfer({
|
|
2509
|
+
* to: '0x...',
|
|
2510
|
+
* amount: 100n,
|
|
2511
|
+
* })
|
|
2512
|
+
* ```
|
|
2513
|
+
*
|
|
2514
|
+
* @param client - Client.
|
|
2515
|
+
* @param parameters - Parameters.
|
|
2516
|
+
* @returns The transaction hash.
|
|
2517
|
+
*/
|
|
2518
|
+
transfer: (parameters: tokenActions.transfer.Parameters<chain, account>) => Promise<tokenActions.transfer.ReturnValue>;
|
|
2519
|
+
/**
|
|
2520
|
+
* Transfers TIP20 tokens to another address.
|
|
2521
|
+
*
|
|
2522
|
+
* @example
|
|
2523
|
+
* ```ts
|
|
2524
|
+
* import { createClient, http } from 'viem'
|
|
2525
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2526
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2527
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2528
|
+
*
|
|
2529
|
+
* const client = createClient({
|
|
2530
|
+
* account: privateKeyToAccount('0x...'),
|
|
2531
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2532
|
+
* transport: http(),
|
|
2533
|
+
* }).extend(tempoActions())
|
|
2534
|
+
*
|
|
2535
|
+
* const result = await client.token.transferSync({
|
|
2536
|
+
* to: '0x...',
|
|
2537
|
+
* amount: 100n,
|
|
2538
|
+
* })
|
|
2539
|
+
* ```
|
|
2540
|
+
*
|
|
2541
|
+
* @param client - Client.
|
|
2542
|
+
* @param parameters - Parameters.
|
|
2543
|
+
* @returns The transaction receipt and event data.
|
|
2544
|
+
*/
|
|
2545
|
+
transferSync: (parameters: tokenActions.transferSync.Parameters<chain, account>) => Promise<tokenActions.transferSync.ReturnValue>;
|
|
2546
|
+
/**
|
|
2547
|
+
* Unpauses a TIP20 token.
|
|
2548
|
+
*
|
|
2549
|
+
* @example
|
|
2550
|
+
* ```ts
|
|
2551
|
+
* import { createClient, http } from 'viem'
|
|
2552
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2553
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2554
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2555
|
+
*
|
|
2556
|
+
* const client = createClient({
|
|
2557
|
+
* account: privateKeyToAccount('0x...'),
|
|
2558
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2559
|
+
* transport: http(),
|
|
2560
|
+
* }).extend(tempoActions())
|
|
2561
|
+
*
|
|
2562
|
+
* const hash = await client.token.unpause({
|
|
2563
|
+
* token: '0x...',
|
|
2564
|
+
* })
|
|
2565
|
+
* ```
|
|
2566
|
+
*
|
|
2567
|
+
* @param client - Client.
|
|
2568
|
+
* @param parameters - Parameters.
|
|
2569
|
+
* @returns The transaction hash.
|
|
2570
|
+
*/
|
|
2571
|
+
unpause: (parameters: tokenActions.unpause.Parameters<chain, account>) => Promise<tokenActions.unpause.ReturnValue>;
|
|
2572
|
+
/**
|
|
2573
|
+
* Unpauses a TIP20 token.
|
|
2574
|
+
*
|
|
2575
|
+
* @example
|
|
2576
|
+
* ```ts
|
|
2577
|
+
* import { createClient, http } from 'viem'
|
|
2578
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2579
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2580
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2581
|
+
*
|
|
2582
|
+
* const client = createClient({
|
|
2583
|
+
* account: privateKeyToAccount('0x...'),
|
|
2584
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2585
|
+
* transport: http(),
|
|
2586
|
+
* }).extend(tempoActions())
|
|
2587
|
+
*
|
|
2588
|
+
* const result = await client.token.unpauseSync({
|
|
2589
|
+
* token: '0x...',
|
|
2590
|
+
* })
|
|
2591
|
+
* ```
|
|
2592
|
+
*
|
|
2593
|
+
* @param client - Client.
|
|
2594
|
+
* @param parameters - Parameters.
|
|
2595
|
+
* @returns The transaction receipt and event data.
|
|
2596
|
+
*/
|
|
2597
|
+
unpauseSync: (parameters: tokenActions.unpauseSync.Parameters<chain, account>) => Promise<tokenActions.unpauseSync.ReturnValue>;
|
|
2598
|
+
/**
|
|
2599
|
+
* Watches for TIP20 token approval events.
|
|
2600
|
+
*
|
|
2601
|
+
* @example
|
|
2602
|
+
* ```ts
|
|
2603
|
+
* import { createClient, http } from 'viem'
|
|
2604
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2605
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2606
|
+
*
|
|
2607
|
+
* const client = createClient({
|
|
2608
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2609
|
+
* transport: http(),
|
|
2610
|
+
* }).extend(tempoActions())
|
|
2611
|
+
*
|
|
2612
|
+
* const unwatch = client.token.watchApprove({
|
|
2613
|
+
* onApproval: (args, log) => {
|
|
2614
|
+
* console.log('Approval:', args)
|
|
2615
|
+
* },
|
|
2616
|
+
* })
|
|
2617
|
+
* ```
|
|
2618
|
+
*
|
|
2619
|
+
* @param client - Client.
|
|
2620
|
+
* @param parameters - Parameters.
|
|
2621
|
+
* @returns A function to unsubscribe from the event.
|
|
2622
|
+
*/
|
|
2623
|
+
watchApprove: (parameters: tokenActions.watchApprove.Parameters) => () => void;
|
|
2624
|
+
/**
|
|
2625
|
+
* Watches for TIP20 token burn events.
|
|
2626
|
+
*
|
|
2627
|
+
* @example
|
|
2628
|
+
* ```ts
|
|
2629
|
+
* import { createClient, http } from 'viem'
|
|
2630
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2631
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2632
|
+
*
|
|
2633
|
+
* const client = createClient({
|
|
2634
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2635
|
+
* transport: http(),
|
|
2636
|
+
* }).extend(tempoActions())
|
|
2637
|
+
*
|
|
2638
|
+
* const unwatch = client.token.watchBurn({
|
|
2639
|
+
* onBurn: (args, log) => {
|
|
2640
|
+
* console.log('Burn:', args)
|
|
2641
|
+
* },
|
|
2642
|
+
* })
|
|
2643
|
+
* ```
|
|
2644
|
+
*
|
|
2645
|
+
* @param client - Client.
|
|
2646
|
+
* @param parameters - Parameters.
|
|
2647
|
+
* @returns A function to unsubscribe from the event.
|
|
2648
|
+
*/
|
|
2649
|
+
watchBurn: (parameters: tokenActions.watchBurn.Parameters) => () => void;
|
|
2650
|
+
/**
|
|
2651
|
+
* Watches for new TIP20 tokens created.
|
|
2652
|
+
*
|
|
2653
|
+
* @example
|
|
2654
|
+
* ```ts
|
|
2655
|
+
* import { createClient, http } from 'viem'
|
|
2656
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2657
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2658
|
+
*
|
|
2659
|
+
* const client = createClient({
|
|
2660
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2661
|
+
* transport: http(),
|
|
2662
|
+
* }).extend(tempoActions())
|
|
2663
|
+
*
|
|
2664
|
+
* const unwatch = client.token.watchCreate({
|
|
2665
|
+
* onTokenCreated: (args, log) => {
|
|
2666
|
+
* console.log('Token created:', args)
|
|
2667
|
+
* },
|
|
2668
|
+
* })
|
|
2669
|
+
* ```
|
|
2670
|
+
*
|
|
2671
|
+
* @param client - Client.
|
|
2672
|
+
* @param parameters - Parameters.
|
|
2673
|
+
* @returns A function to unsubscribe from the event.
|
|
2674
|
+
*/
|
|
2675
|
+
watchCreate: (parameters: tokenActions.watchCreate.Parameters) => () => void;
|
|
2676
|
+
/**
|
|
2677
|
+
* Watches for TIP20 token mint events.
|
|
2678
|
+
*
|
|
2679
|
+
* @example
|
|
2680
|
+
* ```ts
|
|
2681
|
+
* import { createClient, http } from 'viem'
|
|
2682
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2683
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2684
|
+
*
|
|
2685
|
+
* const client = createClient({
|
|
2686
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2687
|
+
* transport: http(),
|
|
2688
|
+
* }).extend(tempoActions())
|
|
2689
|
+
*
|
|
2690
|
+
* const unwatch = client.token.watchMint({
|
|
2691
|
+
* onMint: (args, log) => {
|
|
2692
|
+
* console.log('Mint:', args)
|
|
2693
|
+
* },
|
|
2694
|
+
* })
|
|
2695
|
+
* ```
|
|
2696
|
+
*
|
|
2697
|
+
* @param client - Client.
|
|
2698
|
+
* @param parameters - Parameters.
|
|
2699
|
+
* @returns A function to unsubscribe from the event.
|
|
2700
|
+
*/
|
|
2701
|
+
watchMint: (parameters: tokenActions.watchMint.Parameters) => () => void;
|
|
2702
|
+
/**
|
|
2703
|
+
* Watches for TIP20 token role admin updates.
|
|
2704
|
+
*
|
|
2705
|
+
* @example
|
|
2706
|
+
* ```ts
|
|
2707
|
+
* import { createClient, http } from 'viem'
|
|
2708
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2709
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2710
|
+
*
|
|
2711
|
+
* const client = createClient({
|
|
2712
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2713
|
+
* transport: http(),
|
|
2714
|
+
* }).extend(tempoActions())
|
|
2715
|
+
*
|
|
2716
|
+
* const unwatch = client.token.watchAdminRole({
|
|
2717
|
+
* onRoleAdminUpdated: (args, log) => {
|
|
2718
|
+
* console.log('Role admin updated:', args)
|
|
2719
|
+
* },
|
|
2720
|
+
* })
|
|
2721
|
+
* ```
|
|
2722
|
+
*
|
|
2723
|
+
* @param client - Client.
|
|
2724
|
+
* @param parameters - Parameters.
|
|
2725
|
+
* @returns A function to unsubscribe from the event.
|
|
2726
|
+
*/
|
|
2727
|
+
watchAdminRole: (parameters: tokenActions.watchAdminRole.Parameters) => () => void;
|
|
2728
|
+
/**
|
|
2729
|
+
* Watches for TIP20 token role membership updates.
|
|
2730
|
+
*
|
|
2731
|
+
* @example
|
|
2732
|
+
* ```ts
|
|
2733
|
+
* import { createClient, http } from 'viem'
|
|
2734
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2735
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2736
|
+
*
|
|
2737
|
+
* const client = createClient({
|
|
2738
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2739
|
+
* transport: http(),
|
|
2740
|
+
* }).extend(tempoActions())
|
|
2741
|
+
*
|
|
2742
|
+
* const unwatch = client.token.watchRole({
|
|
2743
|
+
* onRoleUpdated: (args, log) => {
|
|
2744
|
+
* console.log('Role updated:', args)
|
|
2745
|
+
* },
|
|
2746
|
+
* })
|
|
2747
|
+
* ```
|
|
2748
|
+
*
|
|
2749
|
+
* @param client - Client.
|
|
2750
|
+
* @param parameters - Parameters.
|
|
2751
|
+
* @returns A function to unsubscribe from the event.
|
|
2752
|
+
*/
|
|
2753
|
+
watchRole: (parameters: tokenActions.watchRole.Parameters) => () => void;
|
|
2754
|
+
/**
|
|
2755
|
+
* Watches for TIP20 token transfer events.
|
|
2756
|
+
*
|
|
2757
|
+
* @example
|
|
2758
|
+
* ```ts
|
|
2759
|
+
* import { createClient, http } from 'viem'
|
|
2760
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2761
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2762
|
+
*
|
|
2763
|
+
* const client = createClient({
|
|
2764
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2765
|
+
* transport: http(),
|
|
2766
|
+
* }).extend(tempoActions())
|
|
2767
|
+
*
|
|
2768
|
+
* const unwatch = client.token.watchTransfer({
|
|
2769
|
+
* onTransfer: (args, log) => {
|
|
2770
|
+
* console.log('Transfer:', args)
|
|
2771
|
+
* },
|
|
2772
|
+
* })
|
|
2773
|
+
* ```
|
|
2774
|
+
*
|
|
2775
|
+
* @param client - Client.
|
|
2776
|
+
* @param parameters - Parameters.
|
|
2777
|
+
* @returns A function to unsubscribe from the event.
|
|
2778
|
+
*/
|
|
2779
|
+
watchTransfer: (parameters: tokenActions.watchTransfer.Parameters) => () => void;
|
|
2780
|
+
};
|
|
2781
|
+
};
|
|
2782
|
+
export declare function decorator(): <transport extends Transport, chain extends Chain | undefined, account extends Account | undefined>(client: Client<transport, chain, account>) => Decorator<chain, account>;
|
|
2783
|
+
//# sourceMappingURL=Decorator.d.ts.map
|