tempo.ts 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +134 -0
- package/README.md +6 -2
- package/dist/ox/Transaction.js +1 -1
- package/dist/ox/Transaction.js.map +1 -1
- package/dist/server/Handler.d.ts +346 -0
- package/dist/server/Handler.d.ts.map +1 -0
- package/dist/server/Handler.js +441 -0
- package/dist/server/Handler.js.map +1 -0
- package/dist/server/Kv.d.ts +16 -0
- package/dist/server/Kv.d.ts.map +1 -0
- package/dist/server/Kv.js +25 -0
- package/dist/server/Kv.js.map +1 -0
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +3 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/internal/requestListener.d.ts +124 -0
- package/dist/server/internal/requestListener.d.ts.map +1 -0
- package/dist/server/internal/requestListener.js +174 -0
- package/dist/server/internal/requestListener.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 +87 -0
- package/dist/viem/Actions/account.js.map +1 -0
- package/dist/viem/Actions/amm.d.ts +51 -1245
- package/dist/viem/Actions/amm.d.ts.map +1 -1
- package/dist/viem/Actions/amm.js +15 -478
- package/dist/viem/Actions/amm.js.map +1 -1
- package/dist/viem/Actions/index.d.ts +1 -0
- package/dist/viem/Actions/index.d.ts.map +1 -1
- package/dist/viem/Actions/index.js +1 -0
- package/dist/viem/Actions/index.js.map +1 -1
- package/dist/viem/Actions/reward.d.ts +0 -1067
- package/dist/viem/Actions/reward.d.ts.map +1 -1
- package/dist/viem/Actions/reward.js +4 -212
- package/dist/viem/Actions/reward.js.map +1 -1
- package/dist/viem/Decorator.d.ts +28 -263
- package/dist/viem/Decorator.d.ts.map +1 -1
- package/dist/viem/Decorator.js +2 -10
- package/dist/viem/Decorator.js.map +1 -1
- package/dist/viem/Storage.d.ts +23 -0
- package/dist/viem/Storage.d.ts.map +1 -0
- package/dist/viem/Storage.js +47 -0
- package/dist/viem/Storage.js.map +1 -0
- package/dist/viem/Transport.d.ts +10 -1
- package/dist/viem/Transport.d.ts.map +1 -1
- package/dist/viem/Transport.js +22 -3
- package/dist/viem/Transport.js.map +1 -1
- package/dist/viem/internal/utils.d.ts +6 -0
- package/dist/viem/internal/utils.d.ts.map +1 -1
- package/dist/viem/internal/utils.js +24 -0
- package/dist/viem/internal/utils.js.map +1 -1
- package/dist/wagmi/Actions/amm.d.ts +0 -225
- package/dist/wagmi/Actions/amm.d.ts.map +1 -1
- package/dist/wagmi/Actions/amm.js +0 -248
- package/dist/wagmi/Actions/amm.js.map +1 -1
- package/dist/wagmi/Actions/reward.d.ts +0 -110
- package/dist/wagmi/Actions/reward.d.ts.map +1 -1
- package/dist/wagmi/Actions/reward.js +0 -121
- package/dist/wagmi/Actions/reward.js.map +1 -1
- package/dist/wagmi/Connector.d.ts +6 -17
- package/dist/wagmi/Connector.d.ts.map +1 -1
- package/dist/wagmi/Connector.js +17 -43
- package/dist/wagmi/Connector.js.map +1 -1
- package/dist/wagmi/Hooks/amm.d.ts +0 -236
- package/dist/wagmi/Hooks/amm.d.ts.map +1 -1
- package/dist/wagmi/Hooks/amm.js +0 -285
- package/dist/wagmi/Hooks/amm.js.map +1 -1
- package/dist/wagmi/Hooks/reward.d.ts +0 -88
- package/dist/wagmi/Hooks/reward.d.ts.map +1 -1
- package/dist/wagmi/Hooks/reward.js +0 -103
- package/dist/wagmi/Hooks/reward.js.map +1 -1
- package/dist/wagmi/KeyManager.d.ts +57 -0
- package/dist/wagmi/KeyManager.d.ts.map +1 -0
- package/dist/wagmi/KeyManager.js +101 -0
- package/dist/wagmi/KeyManager.js.map +1 -0
- package/dist/wagmi/index.d.ts +1 -0
- package/dist/wagmi/index.d.ts.map +1 -1
- package/dist/wagmi/index.js +1 -0
- package/dist/wagmi/index.js.map +1 -1
- package/package.json +8 -2
- package/src/ox/Transaction.ts +1 -1
- package/src/ox/e2e.test.ts +7 -0
- package/src/server/Handler.test.ts +566 -0
- package/src/server/Handler.ts +577 -0
- package/src/server/Kv.ts +40 -0
- package/src/server/index.ts +2 -0
- package/src/server/internal/requestListener.ts +285 -0
- package/src/viem/Actions/account.test.ts +414 -0
- package/src/viem/Actions/account.ts +108 -0
- package/src/viem/Actions/amm.test.ts +10 -284
- package/src/viem/Actions/amm.ts +88 -768
- package/src/viem/Actions/index.ts +1 -0
- package/src/viem/Actions/reward.test.ts +4 -212
- package/src/viem/Actions/reward.ts +4 -291
- package/src/viem/Decorator.test.ts +1 -0
- package/src/viem/Decorator.ts +32 -294
- package/src/viem/Storage.ts +88 -0
- package/src/viem/Transport.ts +40 -2
- package/src/viem/e2e.test.ts +106 -3
- package/src/viem/internal/utils.ts +21 -0
- package/src/wagmi/Actions/amm.test.ts +7 -85
- package/src/wagmi/Actions/amm.ts +0 -346
- package/src/wagmi/Actions/reward.test.ts +0 -99
- package/src/wagmi/Actions/reward.ts +0 -203
- package/src/wagmi/Connector.test.ts +4 -1
- package/src/wagmi/Connector.ts +24 -58
- package/src/wagmi/Hooks/amm.test.ts +8 -200
- package/src/wagmi/Hooks/amm.ts +0 -443
- package/src/wagmi/Hooks/reward.test.ts +1 -142
- package/src/wagmi/Hooks/reward.ts +0 -196
- package/src/wagmi/KeyManager.ts +159 -0
- package/src/wagmi/index.ts +1 -0
|
@@ -185,1049 +185,6 @@ export declare namespace getLiquidityBalance {
|
|
|
185
185
|
to: Address;
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
/**
|
|
189
|
-
* Performs a rebalance swap from validator token to user token.
|
|
190
|
-
*
|
|
191
|
-
* @example
|
|
192
|
-
* ```ts
|
|
193
|
-
* import { createClient, http } from 'viem'
|
|
194
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
195
|
-
* import { Actions } from 'tempo.ts/viem'
|
|
196
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
|
197
|
-
*
|
|
198
|
-
* const client = createClient({
|
|
199
|
-
* account: privateKeyToAccount('0x...'),
|
|
200
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
201
|
-
* transport: http(),
|
|
202
|
-
* })
|
|
203
|
-
*
|
|
204
|
-
* const hash = await Actions.amm.rebalanceSwap(client, {
|
|
205
|
-
* userToken: '0x...',
|
|
206
|
-
* validatorToken: '0x...',
|
|
207
|
-
* amountOut: 100n,
|
|
208
|
-
* to: '0x...',
|
|
209
|
-
* })
|
|
210
|
-
* ```
|
|
211
|
-
*
|
|
212
|
-
* @param client - Client.
|
|
213
|
-
* @param parameters - Parameters.
|
|
214
|
-
* @returns The transaction hash.
|
|
215
|
-
*/
|
|
216
|
-
export declare function rebalanceSwap<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: rebalanceSwap.Parameters<chain, account>): Promise<rebalanceSwap.ReturnValue>;
|
|
217
|
-
export declare namespace rebalanceSwap {
|
|
218
|
-
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = WriteParameters<chain, account> & Args;
|
|
219
|
-
type Args = {
|
|
220
|
-
/** Amount of user token to receive. */
|
|
221
|
-
amountOut: bigint;
|
|
222
|
-
/** Address to send the user token to. */
|
|
223
|
-
to: Address;
|
|
224
|
-
/** Address or ID of the user token. */
|
|
225
|
-
userToken: TokenId.TokenIdOrAddress;
|
|
226
|
-
/** Address or ID of the validator token. */
|
|
227
|
-
validatorToken: TokenId.TokenIdOrAddress;
|
|
228
|
-
};
|
|
229
|
-
type ReturnValue = WriteContractReturnType;
|
|
230
|
-
/** @internal */
|
|
231
|
-
function inner<action extends typeof writeContract | typeof writeContractSync, chain extends Chain | undefined, account extends Account | undefined>(action: action, client: Client<Transport, chain, account>, parameters: rebalanceSwap.Parameters<chain, account>): Promise<ReturnType<action>>;
|
|
232
|
-
/**
|
|
233
|
-
* Defines a call to the `rebalanceSwap` function.
|
|
234
|
-
*
|
|
235
|
-
* Can be passed as a parameter to:
|
|
236
|
-
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
237
|
-
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
238
|
-
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
239
|
-
*
|
|
240
|
-
* @example
|
|
241
|
-
* ```ts
|
|
242
|
-
* import { createClient, http, walletActions } from 'viem'
|
|
243
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
244
|
-
* import { Actions } from 'tempo.ts/viem'
|
|
245
|
-
*
|
|
246
|
-
* const client = createClient({
|
|
247
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
248
|
-
* transport: http(),
|
|
249
|
-
* }).extend(walletActions)
|
|
250
|
-
*
|
|
251
|
-
* const { result } = await client.sendCalls({
|
|
252
|
-
* calls: [
|
|
253
|
-
* actions.amm.rebalanceSwap.call({
|
|
254
|
-
* userToken: '0x20c0...beef',
|
|
255
|
-
* validatorToken: '0x20c0...babe',
|
|
256
|
-
* amountOut: 100n,
|
|
257
|
-
* to: '0xfeed...fede',
|
|
258
|
-
* }),
|
|
259
|
-
* actions.amm.rebalanceSwap.call({
|
|
260
|
-
* userToken: '0x20c0...babe',
|
|
261
|
-
* validatorToken: '0x20c0...babe',
|
|
262
|
-
* amountOut: 100n,
|
|
263
|
-
* to: '0xfeed...fede',
|
|
264
|
-
* }),
|
|
265
|
-
* ]
|
|
266
|
-
* })
|
|
267
|
-
* ```
|
|
268
|
-
*
|
|
269
|
-
* @param args - Arguments.
|
|
270
|
-
* @returns The call.
|
|
271
|
-
*/
|
|
272
|
-
function call(args: Args): {
|
|
273
|
-
abi: [{
|
|
274
|
-
readonly name: "rebalanceSwap";
|
|
275
|
-
readonly type: "function";
|
|
276
|
-
readonly stateMutability: "nonpayable";
|
|
277
|
-
readonly inputs: readonly [{
|
|
278
|
-
readonly type: "address";
|
|
279
|
-
readonly name: "userToken";
|
|
280
|
-
}, {
|
|
281
|
-
readonly type: "address";
|
|
282
|
-
readonly name: "validatorToken";
|
|
283
|
-
}, {
|
|
284
|
-
readonly type: "uint256";
|
|
285
|
-
readonly name: "amountOut";
|
|
286
|
-
}, {
|
|
287
|
-
readonly type: "address";
|
|
288
|
-
readonly name: "to";
|
|
289
|
-
}];
|
|
290
|
-
readonly outputs: readonly [{
|
|
291
|
-
readonly type: "uint256";
|
|
292
|
-
readonly name: "amountIn";
|
|
293
|
-
}];
|
|
294
|
-
}];
|
|
295
|
-
functionName: "rebalanceSwap";
|
|
296
|
-
args?: readonly [`0x${string}`, `0x${string}`, bigint, `0x${string}`] | undefined;
|
|
297
|
-
} & {
|
|
298
|
-
args: readonly [`0x${string}`, `0x${string}`, bigint, `0x${string}`];
|
|
299
|
-
} & {
|
|
300
|
-
address: Address;
|
|
301
|
-
} & {
|
|
302
|
-
data: Hex;
|
|
303
|
-
to: Address;
|
|
304
|
-
};
|
|
305
|
-
/**
|
|
306
|
-
* Extracts the `RebalanceSwap` event from logs.
|
|
307
|
-
*
|
|
308
|
-
* @param logs - The logs.
|
|
309
|
-
* @returns The `RebalanceSwap` event.
|
|
310
|
-
*/
|
|
311
|
-
function extractEvent(logs: Log[]): Log<bigint, number, false, undefined, true, readonly [{
|
|
312
|
-
readonly name: "MIN_LIQUIDITY";
|
|
313
|
-
readonly type: "function";
|
|
314
|
-
readonly stateMutability: "view";
|
|
315
|
-
readonly inputs: readonly [];
|
|
316
|
-
readonly outputs: readonly [{
|
|
317
|
-
readonly type: "uint256";
|
|
318
|
-
}];
|
|
319
|
-
}, {
|
|
320
|
-
readonly name: "getPoolId";
|
|
321
|
-
readonly type: "function";
|
|
322
|
-
readonly stateMutability: "pure";
|
|
323
|
-
readonly inputs: readonly [{
|
|
324
|
-
readonly type: "address";
|
|
325
|
-
readonly name: "userToken";
|
|
326
|
-
}, {
|
|
327
|
-
readonly type: "address";
|
|
328
|
-
readonly name: "validatorToken";
|
|
329
|
-
}];
|
|
330
|
-
readonly outputs: readonly [{
|
|
331
|
-
readonly type: "bytes32";
|
|
332
|
-
}];
|
|
333
|
-
}, {
|
|
334
|
-
readonly name: "getPool";
|
|
335
|
-
readonly type: "function";
|
|
336
|
-
readonly stateMutability: "view";
|
|
337
|
-
readonly inputs: readonly [{
|
|
338
|
-
readonly type: "address";
|
|
339
|
-
readonly name: "userToken";
|
|
340
|
-
}, {
|
|
341
|
-
readonly type: "address";
|
|
342
|
-
readonly name: "validatorToken";
|
|
343
|
-
}];
|
|
344
|
-
readonly outputs: readonly [{
|
|
345
|
-
readonly type: "tuple";
|
|
346
|
-
readonly components: readonly [{
|
|
347
|
-
readonly type: "uint128";
|
|
348
|
-
readonly name: "reserveUserToken";
|
|
349
|
-
}, {
|
|
350
|
-
readonly type: "uint128";
|
|
351
|
-
readonly name: "reserveValidatorToken";
|
|
352
|
-
}];
|
|
353
|
-
}];
|
|
354
|
-
}, {
|
|
355
|
-
readonly name: "pools";
|
|
356
|
-
readonly type: "function";
|
|
357
|
-
readonly stateMutability: "view";
|
|
358
|
-
readonly inputs: readonly [{
|
|
359
|
-
readonly type: "bytes32";
|
|
360
|
-
readonly name: "poolId";
|
|
361
|
-
}];
|
|
362
|
-
readonly outputs: readonly [{
|
|
363
|
-
readonly type: "tuple";
|
|
364
|
-
readonly components: readonly [{
|
|
365
|
-
readonly type: "uint128";
|
|
366
|
-
readonly name: "reserveUserToken";
|
|
367
|
-
}, {
|
|
368
|
-
readonly type: "uint128";
|
|
369
|
-
readonly name: "reserveValidatorToken";
|
|
370
|
-
}];
|
|
371
|
-
}];
|
|
372
|
-
}, {
|
|
373
|
-
readonly name: "mint";
|
|
374
|
-
readonly type: "function";
|
|
375
|
-
readonly stateMutability: "nonpayable";
|
|
376
|
-
readonly inputs: readonly [{
|
|
377
|
-
readonly type: "address";
|
|
378
|
-
readonly name: "userToken";
|
|
379
|
-
}, {
|
|
380
|
-
readonly type: "address";
|
|
381
|
-
readonly name: "validatorToken";
|
|
382
|
-
}, {
|
|
383
|
-
readonly type: "uint256";
|
|
384
|
-
readonly name: "amountUserToken";
|
|
385
|
-
}, {
|
|
386
|
-
readonly type: "uint256";
|
|
387
|
-
readonly name: "amountValidatorToken";
|
|
388
|
-
}, {
|
|
389
|
-
readonly type: "address";
|
|
390
|
-
readonly name: "to";
|
|
391
|
-
}];
|
|
392
|
-
readonly outputs: readonly [{
|
|
393
|
-
readonly type: "uint256";
|
|
394
|
-
readonly name: "liquidity";
|
|
395
|
-
}];
|
|
396
|
-
}, {
|
|
397
|
-
readonly name: "mintWithValidatorToken";
|
|
398
|
-
readonly type: "function";
|
|
399
|
-
readonly stateMutability: "nonpayable";
|
|
400
|
-
readonly inputs: readonly [{
|
|
401
|
-
readonly type: "address";
|
|
402
|
-
readonly name: "userToken";
|
|
403
|
-
}, {
|
|
404
|
-
readonly type: "address";
|
|
405
|
-
readonly name: "validatorToken";
|
|
406
|
-
}, {
|
|
407
|
-
readonly type: "uint256";
|
|
408
|
-
readonly name: "amountValidatorToken";
|
|
409
|
-
}, {
|
|
410
|
-
readonly type: "address";
|
|
411
|
-
readonly name: "to";
|
|
412
|
-
}];
|
|
413
|
-
readonly outputs: readonly [{
|
|
414
|
-
readonly type: "uint256";
|
|
415
|
-
readonly name: "liquidity";
|
|
416
|
-
}];
|
|
417
|
-
}, {
|
|
418
|
-
readonly name: "burn";
|
|
419
|
-
readonly type: "function";
|
|
420
|
-
readonly stateMutability: "nonpayable";
|
|
421
|
-
readonly inputs: readonly [{
|
|
422
|
-
readonly type: "address";
|
|
423
|
-
readonly name: "userToken";
|
|
424
|
-
}, {
|
|
425
|
-
readonly type: "address";
|
|
426
|
-
readonly name: "validatorToken";
|
|
427
|
-
}, {
|
|
428
|
-
readonly type: "uint256";
|
|
429
|
-
readonly name: "liquidity";
|
|
430
|
-
}, {
|
|
431
|
-
readonly type: "address";
|
|
432
|
-
readonly name: "to";
|
|
433
|
-
}];
|
|
434
|
-
readonly outputs: readonly [{
|
|
435
|
-
readonly type: "uint256";
|
|
436
|
-
readonly name: "amountUserToken";
|
|
437
|
-
}, {
|
|
438
|
-
readonly type: "uint256";
|
|
439
|
-
readonly name: "amountValidatorToken";
|
|
440
|
-
}];
|
|
441
|
-
}, {
|
|
442
|
-
readonly name: "totalSupply";
|
|
443
|
-
readonly type: "function";
|
|
444
|
-
readonly stateMutability: "view";
|
|
445
|
-
readonly inputs: readonly [{
|
|
446
|
-
readonly type: "bytes32";
|
|
447
|
-
readonly name: "poolId";
|
|
448
|
-
}];
|
|
449
|
-
readonly outputs: readonly [{
|
|
450
|
-
readonly type: "uint256";
|
|
451
|
-
}];
|
|
452
|
-
}, {
|
|
453
|
-
readonly name: "liquidityBalances";
|
|
454
|
-
readonly type: "function";
|
|
455
|
-
readonly stateMutability: "view";
|
|
456
|
-
readonly inputs: readonly [{
|
|
457
|
-
readonly type: "bytes32";
|
|
458
|
-
readonly name: "poolId";
|
|
459
|
-
}, {
|
|
460
|
-
readonly type: "address";
|
|
461
|
-
readonly name: "user";
|
|
462
|
-
}];
|
|
463
|
-
readonly outputs: readonly [{
|
|
464
|
-
readonly type: "uint256";
|
|
465
|
-
}];
|
|
466
|
-
}, {
|
|
467
|
-
readonly name: "rebalanceSwap";
|
|
468
|
-
readonly type: "function";
|
|
469
|
-
readonly stateMutability: "nonpayable";
|
|
470
|
-
readonly inputs: readonly [{
|
|
471
|
-
readonly type: "address";
|
|
472
|
-
readonly name: "userToken";
|
|
473
|
-
}, {
|
|
474
|
-
readonly type: "address";
|
|
475
|
-
readonly name: "validatorToken";
|
|
476
|
-
}, {
|
|
477
|
-
readonly type: "uint256";
|
|
478
|
-
readonly name: "amountOut";
|
|
479
|
-
}, {
|
|
480
|
-
readonly type: "address";
|
|
481
|
-
readonly name: "to";
|
|
482
|
-
}];
|
|
483
|
-
readonly outputs: readonly [{
|
|
484
|
-
readonly type: "uint256";
|
|
485
|
-
readonly name: "amountIn";
|
|
486
|
-
}];
|
|
487
|
-
}, {
|
|
488
|
-
readonly name: "Mint";
|
|
489
|
-
readonly type: "event";
|
|
490
|
-
readonly inputs: readonly [{
|
|
491
|
-
readonly type: "address";
|
|
492
|
-
readonly name: "sender";
|
|
493
|
-
readonly indexed: true;
|
|
494
|
-
}, {
|
|
495
|
-
readonly type: "address";
|
|
496
|
-
readonly name: "userToken";
|
|
497
|
-
readonly indexed: true;
|
|
498
|
-
}, {
|
|
499
|
-
readonly type: "address";
|
|
500
|
-
readonly name: "validatorToken";
|
|
501
|
-
readonly indexed: true;
|
|
502
|
-
}, {
|
|
503
|
-
readonly type: "uint256";
|
|
504
|
-
readonly name: "amountUserToken";
|
|
505
|
-
}, {
|
|
506
|
-
readonly type: "uint256";
|
|
507
|
-
readonly name: "amountValidatorToken";
|
|
508
|
-
}, {
|
|
509
|
-
readonly type: "uint256";
|
|
510
|
-
readonly name: "liquidity";
|
|
511
|
-
}];
|
|
512
|
-
}, {
|
|
513
|
-
readonly name: "Burn";
|
|
514
|
-
readonly type: "event";
|
|
515
|
-
readonly inputs: readonly [{
|
|
516
|
-
readonly type: "address";
|
|
517
|
-
readonly name: "sender";
|
|
518
|
-
readonly indexed: true;
|
|
519
|
-
}, {
|
|
520
|
-
readonly type: "address";
|
|
521
|
-
readonly name: "userToken";
|
|
522
|
-
readonly indexed: true;
|
|
523
|
-
}, {
|
|
524
|
-
readonly type: "address";
|
|
525
|
-
readonly name: "validatorToken";
|
|
526
|
-
readonly indexed: true;
|
|
527
|
-
}, {
|
|
528
|
-
readonly type: "uint256";
|
|
529
|
-
readonly name: "amountUserToken";
|
|
530
|
-
}, {
|
|
531
|
-
readonly type: "uint256";
|
|
532
|
-
readonly name: "amountValidatorToken";
|
|
533
|
-
}, {
|
|
534
|
-
readonly type: "uint256";
|
|
535
|
-
readonly name: "liquidity";
|
|
536
|
-
}, {
|
|
537
|
-
readonly type: "address";
|
|
538
|
-
readonly name: "to";
|
|
539
|
-
}];
|
|
540
|
-
}, {
|
|
541
|
-
readonly name: "RebalanceSwap";
|
|
542
|
-
readonly type: "event";
|
|
543
|
-
readonly inputs: readonly [{
|
|
544
|
-
readonly type: "address";
|
|
545
|
-
readonly name: "userToken";
|
|
546
|
-
readonly indexed: true;
|
|
547
|
-
}, {
|
|
548
|
-
readonly type: "address";
|
|
549
|
-
readonly name: "validatorToken";
|
|
550
|
-
readonly indexed: true;
|
|
551
|
-
}, {
|
|
552
|
-
readonly type: "address";
|
|
553
|
-
readonly name: "swapper";
|
|
554
|
-
readonly indexed: true;
|
|
555
|
-
}, {
|
|
556
|
-
readonly type: "uint256";
|
|
557
|
-
readonly name: "amountIn";
|
|
558
|
-
}, {
|
|
559
|
-
readonly type: "uint256";
|
|
560
|
-
readonly name: "amountOut";
|
|
561
|
-
}];
|
|
562
|
-
}, {
|
|
563
|
-
readonly name: "FeeSwap";
|
|
564
|
-
readonly type: "event";
|
|
565
|
-
readonly inputs: readonly [{
|
|
566
|
-
readonly type: "address";
|
|
567
|
-
readonly name: "userToken";
|
|
568
|
-
readonly indexed: true;
|
|
569
|
-
}, {
|
|
570
|
-
readonly type: "address";
|
|
571
|
-
readonly name: "validatorToken";
|
|
572
|
-
readonly indexed: true;
|
|
573
|
-
}, {
|
|
574
|
-
readonly type: "uint256";
|
|
575
|
-
readonly name: "amountIn";
|
|
576
|
-
}, {
|
|
577
|
-
readonly type: "uint256";
|
|
578
|
-
readonly name: "amountOut";
|
|
579
|
-
}];
|
|
580
|
-
}, {
|
|
581
|
-
readonly name: "IdenticalAddresses";
|
|
582
|
-
readonly type: "error";
|
|
583
|
-
readonly inputs: readonly [];
|
|
584
|
-
}, {
|
|
585
|
-
readonly name: "ZeroAddress";
|
|
586
|
-
readonly type: "error";
|
|
587
|
-
readonly inputs: readonly [];
|
|
588
|
-
}, {
|
|
589
|
-
readonly name: "PoolExists";
|
|
590
|
-
readonly type: "error";
|
|
591
|
-
readonly inputs: readonly [];
|
|
592
|
-
}, {
|
|
593
|
-
readonly name: "PoolDoesNotExist";
|
|
594
|
-
readonly type: "error";
|
|
595
|
-
readonly inputs: readonly [];
|
|
596
|
-
}, {
|
|
597
|
-
readonly name: "InvalidToken";
|
|
598
|
-
readonly type: "error";
|
|
599
|
-
readonly inputs: readonly [];
|
|
600
|
-
}, {
|
|
601
|
-
readonly name: "InsufficientLiquidity";
|
|
602
|
-
readonly type: "error";
|
|
603
|
-
readonly inputs: readonly [];
|
|
604
|
-
}, {
|
|
605
|
-
readonly name: "OnlyProtocol";
|
|
606
|
-
readonly type: "error";
|
|
607
|
-
readonly inputs: readonly [];
|
|
608
|
-
}, {
|
|
609
|
-
readonly name: "InsufficientPoolBalance";
|
|
610
|
-
readonly type: "error";
|
|
611
|
-
readonly inputs: readonly [];
|
|
612
|
-
}, {
|
|
613
|
-
readonly name: "InsufficientReserves";
|
|
614
|
-
readonly type: "error";
|
|
615
|
-
readonly inputs: readonly [];
|
|
616
|
-
}, {
|
|
617
|
-
readonly name: "InsufficientLiquidityBalance";
|
|
618
|
-
readonly type: "error";
|
|
619
|
-
readonly inputs: readonly [];
|
|
620
|
-
}, {
|
|
621
|
-
readonly name: "MustDepositLowerBalanceToken";
|
|
622
|
-
readonly type: "error";
|
|
623
|
-
readonly inputs: readonly [];
|
|
624
|
-
}, {
|
|
625
|
-
readonly name: "InvalidAmount";
|
|
626
|
-
readonly type: "error";
|
|
627
|
-
readonly inputs: readonly [];
|
|
628
|
-
}, {
|
|
629
|
-
readonly name: "InvalidRebalanceState";
|
|
630
|
-
readonly type: "error";
|
|
631
|
-
readonly inputs: readonly [];
|
|
632
|
-
}, {
|
|
633
|
-
readonly name: "InvalidRebalanceDirection";
|
|
634
|
-
readonly type: "error";
|
|
635
|
-
readonly inputs: readonly [];
|
|
636
|
-
}, {
|
|
637
|
-
readonly name: "InvalidNewReserves";
|
|
638
|
-
readonly type: "error";
|
|
639
|
-
readonly inputs: readonly [];
|
|
640
|
-
}, {
|
|
641
|
-
readonly name: "CannotSupportPendingSwaps";
|
|
642
|
-
readonly type: "error";
|
|
643
|
-
readonly inputs: readonly [];
|
|
644
|
-
}, {
|
|
645
|
-
readonly name: "DivisionByZero";
|
|
646
|
-
readonly type: "error";
|
|
647
|
-
readonly inputs: readonly [];
|
|
648
|
-
}, {
|
|
649
|
-
readonly name: "InvalidSwapCalculation";
|
|
650
|
-
readonly type: "error";
|
|
651
|
-
readonly inputs: readonly [];
|
|
652
|
-
}, {
|
|
653
|
-
readonly name: "InsufficientLiquidityForPending";
|
|
654
|
-
readonly type: "error";
|
|
655
|
-
readonly inputs: readonly [];
|
|
656
|
-
}, {
|
|
657
|
-
readonly name: "TokenTransferFailed";
|
|
658
|
-
readonly type: "error";
|
|
659
|
-
readonly inputs: readonly [];
|
|
660
|
-
}, {
|
|
661
|
-
readonly name: "InternalError";
|
|
662
|
-
readonly type: "error";
|
|
663
|
-
readonly inputs: readonly [];
|
|
664
|
-
}], "RebalanceSwap">;
|
|
665
|
-
}
|
|
666
|
-
/**
|
|
667
|
-
* Performs a rebalance swap from validator token to user token.
|
|
668
|
-
*
|
|
669
|
-
* @example
|
|
670
|
-
* ```ts
|
|
671
|
-
* import { createClient, http } from 'viem'
|
|
672
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
673
|
-
* import { Actions } from 'tempo.ts/viem'
|
|
674
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
|
675
|
-
*
|
|
676
|
-
* const client = createClient({
|
|
677
|
-
* account: privateKeyToAccount('0x...'),
|
|
678
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
679
|
-
* transport: http(),
|
|
680
|
-
* })
|
|
681
|
-
*
|
|
682
|
-
* const result = await Actions.amm.rebalanceSwapSync(client, {
|
|
683
|
-
* userToken: '0x...',
|
|
684
|
-
* validatorToken: '0x...',
|
|
685
|
-
* amountOut: 100n,
|
|
686
|
-
* to: '0x...',
|
|
687
|
-
* })
|
|
688
|
-
* ```
|
|
689
|
-
*
|
|
690
|
-
* @param client - Client.
|
|
691
|
-
* @param parameters - Parameters.
|
|
692
|
-
* @returns The transaction receipt and event data.
|
|
693
|
-
*/
|
|
694
|
-
export declare function rebalanceSwapSync<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: rebalanceSwapSync.Parameters<chain, account>): Promise<rebalanceSwapSync.ReturnValue>;
|
|
695
|
-
export declare namespace rebalanceSwapSync {
|
|
696
|
-
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = rebalanceSwap.Parameters<chain, account>;
|
|
697
|
-
type Args = rebalanceSwap.Args;
|
|
698
|
-
type ReturnValue = Compute<GetEventArgs<typeof Abis.feeAmm, 'RebalanceSwap', {
|
|
699
|
-
IndexedOnly: false;
|
|
700
|
-
Required: true;
|
|
701
|
-
}> & {
|
|
702
|
-
/** Transaction receipt. */
|
|
703
|
-
receipt: TransactionReceipt;
|
|
704
|
-
}>;
|
|
705
|
-
}
|
|
706
|
-
/**
|
|
707
|
-
* Adds liquidity to a pool.
|
|
708
|
-
*
|
|
709
|
-
* @example
|
|
710
|
-
* ```ts
|
|
711
|
-
* import { createClient, http } from 'viem'
|
|
712
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
713
|
-
* import { Actions } from 'tempo.ts/viem'
|
|
714
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
|
715
|
-
*
|
|
716
|
-
* const client = createClient({
|
|
717
|
-
* account: privateKeyToAccount('0x...'),
|
|
718
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
719
|
-
* transport: http(),
|
|
720
|
-
* })
|
|
721
|
-
*
|
|
722
|
-
* const hash = await Actions.amm.mint(client, {
|
|
723
|
-
* userToken: {
|
|
724
|
-
* address: '0x20c0...beef',
|
|
725
|
-
* amount: 100n,
|
|
726
|
-
* },
|
|
727
|
-
* validatorToken: {
|
|
728
|
-
* address: '0x20c0...babe',
|
|
729
|
-
* amount: 100n,
|
|
730
|
-
* },
|
|
731
|
-
* to: '0xfeed...fede',
|
|
732
|
-
* })
|
|
733
|
-
* ```
|
|
734
|
-
*
|
|
735
|
-
* @param client - Client.
|
|
736
|
-
* @param parameters - Parameters.
|
|
737
|
-
* @returns The transaction hash.
|
|
738
|
-
*/
|
|
739
|
-
export declare function mint<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: mint.Parameters<chain, account>): Promise<mint.ReturnValue>;
|
|
740
|
-
export declare namespace mint {
|
|
741
|
-
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = WriteParameters<chain, account> & Args;
|
|
742
|
-
type Args = {
|
|
743
|
-
/** Address to mint LP tokens to. */
|
|
744
|
-
to: Address;
|
|
745
|
-
/** User token address and amount. */
|
|
746
|
-
userToken: {
|
|
747
|
-
/** Address or ID of the user token. */
|
|
748
|
-
address: TokenId.TokenIdOrAddress;
|
|
749
|
-
/** Amount of user token to add. */
|
|
750
|
-
amount?: bigint | undefined;
|
|
751
|
-
};
|
|
752
|
-
/** Validator token address and amount. */
|
|
753
|
-
validatorToken: {
|
|
754
|
-
/** Address or ID of the validator token. */
|
|
755
|
-
address: TokenId.TokenIdOrAddress;
|
|
756
|
-
/** Amount of validator token to add. */
|
|
757
|
-
amount: bigint;
|
|
758
|
-
};
|
|
759
|
-
};
|
|
760
|
-
type ReturnValue = WriteContractReturnType;
|
|
761
|
-
/** @internal */
|
|
762
|
-
function inner<action extends typeof writeContract | typeof writeContractSync, chain extends Chain | undefined, account extends Account | undefined>(action: action, client: Client<Transport, chain, account>, parameters: mint.Parameters<chain, account>): Promise<ReturnType<action>>;
|
|
763
|
-
/**
|
|
764
|
-
* Defines a call to the `mint` function.
|
|
765
|
-
*
|
|
766
|
-
* Can be passed as a parameter to:
|
|
767
|
-
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
768
|
-
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
769
|
-
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
770
|
-
*
|
|
771
|
-
* @example
|
|
772
|
-
* ```ts
|
|
773
|
-
* import { createClient, http, walletActions } from 'viem'
|
|
774
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
775
|
-
* import { Actions } from 'tempo.ts/viem'
|
|
776
|
-
*
|
|
777
|
-
* const client = createClient({
|
|
778
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
779
|
-
* transport: http(),
|
|
780
|
-
* }).extend(walletActions)
|
|
781
|
-
*
|
|
782
|
-
* const { result } = await client.sendCalls({
|
|
783
|
-
* calls: [
|
|
784
|
-
* actions.amm.mint.call({
|
|
785
|
-
* userToken: {
|
|
786
|
-
* address: '0x20c0...beef',
|
|
787
|
-
* amount: 100n,
|
|
788
|
-
* },
|
|
789
|
-
* validatorToken: {
|
|
790
|
-
* address: '0x20c0...babe',
|
|
791
|
-
* amount: 100n,
|
|
792
|
-
* },
|
|
793
|
-
* to: '0xfeed...fede',
|
|
794
|
-
* }),
|
|
795
|
-
* actions.amm.mint.call({
|
|
796
|
-
* userToken: {
|
|
797
|
-
* address: '0x20c0...babe',
|
|
798
|
-
* amount: 100n,
|
|
799
|
-
* },
|
|
800
|
-
* validatorToken: {
|
|
801
|
-
* address: '0x20c0...babe',
|
|
802
|
-
* amount: 100n,
|
|
803
|
-
* },
|
|
804
|
-
* to: '0xfeed...fede',
|
|
805
|
-
* }),
|
|
806
|
-
* ]
|
|
807
|
-
* })
|
|
808
|
-
* ```
|
|
809
|
-
*
|
|
810
|
-
* @param args - Arguments.
|
|
811
|
-
* @returns The call.
|
|
812
|
-
*/
|
|
813
|
-
function call(args: Args): {
|
|
814
|
-
abi: [{
|
|
815
|
-
readonly name: "mint";
|
|
816
|
-
readonly type: "function";
|
|
817
|
-
readonly stateMutability: "nonpayable";
|
|
818
|
-
readonly inputs: readonly [{
|
|
819
|
-
readonly type: "address";
|
|
820
|
-
readonly name: "userToken";
|
|
821
|
-
}, {
|
|
822
|
-
readonly type: "address";
|
|
823
|
-
readonly name: "validatorToken";
|
|
824
|
-
}, {
|
|
825
|
-
readonly type: "uint256";
|
|
826
|
-
readonly name: "amountUserToken";
|
|
827
|
-
}, {
|
|
828
|
-
readonly type: "uint256";
|
|
829
|
-
readonly name: "amountValidatorToken";
|
|
830
|
-
}, {
|
|
831
|
-
readonly type: "address";
|
|
832
|
-
readonly name: "to";
|
|
833
|
-
}];
|
|
834
|
-
readonly outputs: readonly [{
|
|
835
|
-
readonly type: "uint256";
|
|
836
|
-
readonly name: "liquidity";
|
|
837
|
-
}];
|
|
838
|
-
} | {
|
|
839
|
-
readonly name: "mintWithValidatorToken";
|
|
840
|
-
readonly type: "function";
|
|
841
|
-
readonly stateMutability: "nonpayable";
|
|
842
|
-
readonly inputs: readonly [{
|
|
843
|
-
readonly type: "address";
|
|
844
|
-
readonly name: "userToken";
|
|
845
|
-
}, {
|
|
846
|
-
readonly type: "address";
|
|
847
|
-
readonly name: "validatorToken";
|
|
848
|
-
}, {
|
|
849
|
-
readonly type: "uint256";
|
|
850
|
-
readonly name: "amountValidatorToken";
|
|
851
|
-
}, {
|
|
852
|
-
readonly type: "address";
|
|
853
|
-
readonly name: "to";
|
|
854
|
-
}];
|
|
855
|
-
readonly outputs: readonly [{
|
|
856
|
-
readonly type: "uint256";
|
|
857
|
-
readonly name: "liquidity";
|
|
858
|
-
}];
|
|
859
|
-
}];
|
|
860
|
-
functionName: "mint" | "mintWithValidatorToken";
|
|
861
|
-
args?: readonly [`0x${string}`, `0x${string}`, bigint, `0x${string}`] | readonly [`0x${string}`, `0x${string}`, bigint, bigint, `0x${string}`] | undefined;
|
|
862
|
-
} & {
|
|
863
|
-
args: import("viem").Widen<readonly [`0x${string}`, `0x${string}`, bigint, `0x${string}`] | readonly [`0x${string}`, `0x${string}`, bigint, bigint, `0x${string}`]>;
|
|
864
|
-
} & {
|
|
865
|
-
address: Address;
|
|
866
|
-
} & {
|
|
867
|
-
data: Hex;
|
|
868
|
-
to: Address;
|
|
869
|
-
};
|
|
870
|
-
/**
|
|
871
|
-
* Extracts the `Mint` event from logs.
|
|
872
|
-
*
|
|
873
|
-
* @param logs - The logs.
|
|
874
|
-
* @returns The `Mint` event.
|
|
875
|
-
*/
|
|
876
|
-
function extractEvent(logs: Log[]): Log<bigint, number, false, undefined, true, readonly [{
|
|
877
|
-
readonly name: "MIN_LIQUIDITY";
|
|
878
|
-
readonly type: "function";
|
|
879
|
-
readonly stateMutability: "view";
|
|
880
|
-
readonly inputs: readonly [];
|
|
881
|
-
readonly outputs: readonly [{
|
|
882
|
-
readonly type: "uint256";
|
|
883
|
-
}];
|
|
884
|
-
}, {
|
|
885
|
-
readonly name: "getPoolId";
|
|
886
|
-
readonly type: "function";
|
|
887
|
-
readonly stateMutability: "pure";
|
|
888
|
-
readonly inputs: readonly [{
|
|
889
|
-
readonly type: "address";
|
|
890
|
-
readonly name: "userToken";
|
|
891
|
-
}, {
|
|
892
|
-
readonly type: "address";
|
|
893
|
-
readonly name: "validatorToken";
|
|
894
|
-
}];
|
|
895
|
-
readonly outputs: readonly [{
|
|
896
|
-
readonly type: "bytes32";
|
|
897
|
-
}];
|
|
898
|
-
}, {
|
|
899
|
-
readonly name: "getPool";
|
|
900
|
-
readonly type: "function";
|
|
901
|
-
readonly stateMutability: "view";
|
|
902
|
-
readonly inputs: readonly [{
|
|
903
|
-
readonly type: "address";
|
|
904
|
-
readonly name: "userToken";
|
|
905
|
-
}, {
|
|
906
|
-
readonly type: "address";
|
|
907
|
-
readonly name: "validatorToken";
|
|
908
|
-
}];
|
|
909
|
-
readonly outputs: readonly [{
|
|
910
|
-
readonly type: "tuple";
|
|
911
|
-
readonly components: readonly [{
|
|
912
|
-
readonly type: "uint128";
|
|
913
|
-
readonly name: "reserveUserToken";
|
|
914
|
-
}, {
|
|
915
|
-
readonly type: "uint128";
|
|
916
|
-
readonly name: "reserveValidatorToken";
|
|
917
|
-
}];
|
|
918
|
-
}];
|
|
919
|
-
}, {
|
|
920
|
-
readonly name: "pools";
|
|
921
|
-
readonly type: "function";
|
|
922
|
-
readonly stateMutability: "view";
|
|
923
|
-
readonly inputs: readonly [{
|
|
924
|
-
readonly type: "bytes32";
|
|
925
|
-
readonly name: "poolId";
|
|
926
|
-
}];
|
|
927
|
-
readonly outputs: readonly [{
|
|
928
|
-
readonly type: "tuple";
|
|
929
|
-
readonly components: readonly [{
|
|
930
|
-
readonly type: "uint128";
|
|
931
|
-
readonly name: "reserveUserToken";
|
|
932
|
-
}, {
|
|
933
|
-
readonly type: "uint128";
|
|
934
|
-
readonly name: "reserveValidatorToken";
|
|
935
|
-
}];
|
|
936
|
-
}];
|
|
937
|
-
}, {
|
|
938
|
-
readonly name: "mint";
|
|
939
|
-
readonly type: "function";
|
|
940
|
-
readonly stateMutability: "nonpayable";
|
|
941
|
-
readonly inputs: readonly [{
|
|
942
|
-
readonly type: "address";
|
|
943
|
-
readonly name: "userToken";
|
|
944
|
-
}, {
|
|
945
|
-
readonly type: "address";
|
|
946
|
-
readonly name: "validatorToken";
|
|
947
|
-
}, {
|
|
948
|
-
readonly type: "uint256";
|
|
949
|
-
readonly name: "amountUserToken";
|
|
950
|
-
}, {
|
|
951
|
-
readonly type: "uint256";
|
|
952
|
-
readonly name: "amountValidatorToken";
|
|
953
|
-
}, {
|
|
954
|
-
readonly type: "address";
|
|
955
|
-
readonly name: "to";
|
|
956
|
-
}];
|
|
957
|
-
readonly outputs: readonly [{
|
|
958
|
-
readonly type: "uint256";
|
|
959
|
-
readonly name: "liquidity";
|
|
960
|
-
}];
|
|
961
|
-
}, {
|
|
962
|
-
readonly name: "mintWithValidatorToken";
|
|
963
|
-
readonly type: "function";
|
|
964
|
-
readonly stateMutability: "nonpayable";
|
|
965
|
-
readonly inputs: readonly [{
|
|
966
|
-
readonly type: "address";
|
|
967
|
-
readonly name: "userToken";
|
|
968
|
-
}, {
|
|
969
|
-
readonly type: "address";
|
|
970
|
-
readonly name: "validatorToken";
|
|
971
|
-
}, {
|
|
972
|
-
readonly type: "uint256";
|
|
973
|
-
readonly name: "amountValidatorToken";
|
|
974
|
-
}, {
|
|
975
|
-
readonly type: "address";
|
|
976
|
-
readonly name: "to";
|
|
977
|
-
}];
|
|
978
|
-
readonly outputs: readonly [{
|
|
979
|
-
readonly type: "uint256";
|
|
980
|
-
readonly name: "liquidity";
|
|
981
|
-
}];
|
|
982
|
-
}, {
|
|
983
|
-
readonly name: "burn";
|
|
984
|
-
readonly type: "function";
|
|
985
|
-
readonly stateMutability: "nonpayable";
|
|
986
|
-
readonly inputs: readonly [{
|
|
987
|
-
readonly type: "address";
|
|
988
|
-
readonly name: "userToken";
|
|
989
|
-
}, {
|
|
990
|
-
readonly type: "address";
|
|
991
|
-
readonly name: "validatorToken";
|
|
992
|
-
}, {
|
|
993
|
-
readonly type: "uint256";
|
|
994
|
-
readonly name: "liquidity";
|
|
995
|
-
}, {
|
|
996
|
-
readonly type: "address";
|
|
997
|
-
readonly name: "to";
|
|
998
|
-
}];
|
|
999
|
-
readonly outputs: readonly [{
|
|
1000
|
-
readonly type: "uint256";
|
|
1001
|
-
readonly name: "amountUserToken";
|
|
1002
|
-
}, {
|
|
1003
|
-
readonly type: "uint256";
|
|
1004
|
-
readonly name: "amountValidatorToken";
|
|
1005
|
-
}];
|
|
1006
|
-
}, {
|
|
1007
|
-
readonly name: "totalSupply";
|
|
1008
|
-
readonly type: "function";
|
|
1009
|
-
readonly stateMutability: "view";
|
|
1010
|
-
readonly inputs: readonly [{
|
|
1011
|
-
readonly type: "bytes32";
|
|
1012
|
-
readonly name: "poolId";
|
|
1013
|
-
}];
|
|
1014
|
-
readonly outputs: readonly [{
|
|
1015
|
-
readonly type: "uint256";
|
|
1016
|
-
}];
|
|
1017
|
-
}, {
|
|
1018
|
-
readonly name: "liquidityBalances";
|
|
1019
|
-
readonly type: "function";
|
|
1020
|
-
readonly stateMutability: "view";
|
|
1021
|
-
readonly inputs: readonly [{
|
|
1022
|
-
readonly type: "bytes32";
|
|
1023
|
-
readonly name: "poolId";
|
|
1024
|
-
}, {
|
|
1025
|
-
readonly type: "address";
|
|
1026
|
-
readonly name: "user";
|
|
1027
|
-
}];
|
|
1028
|
-
readonly outputs: readonly [{
|
|
1029
|
-
readonly type: "uint256";
|
|
1030
|
-
}];
|
|
1031
|
-
}, {
|
|
1032
|
-
readonly name: "rebalanceSwap";
|
|
1033
|
-
readonly type: "function";
|
|
1034
|
-
readonly stateMutability: "nonpayable";
|
|
1035
|
-
readonly inputs: readonly [{
|
|
1036
|
-
readonly type: "address";
|
|
1037
|
-
readonly name: "userToken";
|
|
1038
|
-
}, {
|
|
1039
|
-
readonly type: "address";
|
|
1040
|
-
readonly name: "validatorToken";
|
|
1041
|
-
}, {
|
|
1042
|
-
readonly type: "uint256";
|
|
1043
|
-
readonly name: "amountOut";
|
|
1044
|
-
}, {
|
|
1045
|
-
readonly type: "address";
|
|
1046
|
-
readonly name: "to";
|
|
1047
|
-
}];
|
|
1048
|
-
readonly outputs: readonly [{
|
|
1049
|
-
readonly type: "uint256";
|
|
1050
|
-
readonly name: "amountIn";
|
|
1051
|
-
}];
|
|
1052
|
-
}, {
|
|
1053
|
-
readonly name: "Mint";
|
|
1054
|
-
readonly type: "event";
|
|
1055
|
-
readonly inputs: readonly [{
|
|
1056
|
-
readonly type: "address";
|
|
1057
|
-
readonly name: "sender";
|
|
1058
|
-
readonly indexed: true;
|
|
1059
|
-
}, {
|
|
1060
|
-
readonly type: "address";
|
|
1061
|
-
readonly name: "userToken";
|
|
1062
|
-
readonly indexed: true;
|
|
1063
|
-
}, {
|
|
1064
|
-
readonly type: "address";
|
|
1065
|
-
readonly name: "validatorToken";
|
|
1066
|
-
readonly indexed: true;
|
|
1067
|
-
}, {
|
|
1068
|
-
readonly type: "uint256";
|
|
1069
|
-
readonly name: "amountUserToken";
|
|
1070
|
-
}, {
|
|
1071
|
-
readonly type: "uint256";
|
|
1072
|
-
readonly name: "amountValidatorToken";
|
|
1073
|
-
}, {
|
|
1074
|
-
readonly type: "uint256";
|
|
1075
|
-
readonly name: "liquidity";
|
|
1076
|
-
}];
|
|
1077
|
-
}, {
|
|
1078
|
-
readonly name: "Burn";
|
|
1079
|
-
readonly type: "event";
|
|
1080
|
-
readonly inputs: readonly [{
|
|
1081
|
-
readonly type: "address";
|
|
1082
|
-
readonly name: "sender";
|
|
1083
|
-
readonly indexed: true;
|
|
1084
|
-
}, {
|
|
1085
|
-
readonly type: "address";
|
|
1086
|
-
readonly name: "userToken";
|
|
1087
|
-
readonly indexed: true;
|
|
1088
|
-
}, {
|
|
1089
|
-
readonly type: "address";
|
|
1090
|
-
readonly name: "validatorToken";
|
|
1091
|
-
readonly indexed: true;
|
|
1092
|
-
}, {
|
|
1093
|
-
readonly type: "uint256";
|
|
1094
|
-
readonly name: "amountUserToken";
|
|
1095
|
-
}, {
|
|
1096
|
-
readonly type: "uint256";
|
|
1097
|
-
readonly name: "amountValidatorToken";
|
|
1098
|
-
}, {
|
|
1099
|
-
readonly type: "uint256";
|
|
1100
|
-
readonly name: "liquidity";
|
|
1101
|
-
}, {
|
|
1102
|
-
readonly type: "address";
|
|
1103
|
-
readonly name: "to";
|
|
1104
|
-
}];
|
|
1105
|
-
}, {
|
|
1106
|
-
readonly name: "RebalanceSwap";
|
|
1107
|
-
readonly type: "event";
|
|
1108
|
-
readonly inputs: readonly [{
|
|
1109
|
-
readonly type: "address";
|
|
1110
|
-
readonly name: "userToken";
|
|
1111
|
-
readonly indexed: true;
|
|
1112
|
-
}, {
|
|
1113
|
-
readonly type: "address";
|
|
1114
|
-
readonly name: "validatorToken";
|
|
1115
|
-
readonly indexed: true;
|
|
1116
|
-
}, {
|
|
1117
|
-
readonly type: "address";
|
|
1118
|
-
readonly name: "swapper";
|
|
1119
|
-
readonly indexed: true;
|
|
1120
|
-
}, {
|
|
1121
|
-
readonly type: "uint256";
|
|
1122
|
-
readonly name: "amountIn";
|
|
1123
|
-
}, {
|
|
1124
|
-
readonly type: "uint256";
|
|
1125
|
-
readonly name: "amountOut";
|
|
1126
|
-
}];
|
|
1127
|
-
}, {
|
|
1128
|
-
readonly name: "FeeSwap";
|
|
1129
|
-
readonly type: "event";
|
|
1130
|
-
readonly inputs: readonly [{
|
|
1131
|
-
readonly type: "address";
|
|
1132
|
-
readonly name: "userToken";
|
|
1133
|
-
readonly indexed: true;
|
|
1134
|
-
}, {
|
|
1135
|
-
readonly type: "address";
|
|
1136
|
-
readonly name: "validatorToken";
|
|
1137
|
-
readonly indexed: true;
|
|
1138
|
-
}, {
|
|
1139
|
-
readonly type: "uint256";
|
|
1140
|
-
readonly name: "amountIn";
|
|
1141
|
-
}, {
|
|
1142
|
-
readonly type: "uint256";
|
|
1143
|
-
readonly name: "amountOut";
|
|
1144
|
-
}];
|
|
1145
|
-
}, {
|
|
1146
|
-
readonly name: "IdenticalAddresses";
|
|
1147
|
-
readonly type: "error";
|
|
1148
|
-
readonly inputs: readonly [];
|
|
1149
|
-
}, {
|
|
1150
|
-
readonly name: "ZeroAddress";
|
|
1151
|
-
readonly type: "error";
|
|
1152
|
-
readonly inputs: readonly [];
|
|
1153
|
-
}, {
|
|
1154
|
-
readonly name: "PoolExists";
|
|
1155
|
-
readonly type: "error";
|
|
1156
|
-
readonly inputs: readonly [];
|
|
1157
|
-
}, {
|
|
1158
|
-
readonly name: "PoolDoesNotExist";
|
|
1159
|
-
readonly type: "error";
|
|
1160
|
-
readonly inputs: readonly [];
|
|
1161
|
-
}, {
|
|
1162
|
-
readonly name: "InvalidToken";
|
|
1163
|
-
readonly type: "error";
|
|
1164
|
-
readonly inputs: readonly [];
|
|
1165
|
-
}, {
|
|
1166
|
-
readonly name: "InsufficientLiquidity";
|
|
1167
|
-
readonly type: "error";
|
|
1168
|
-
readonly inputs: readonly [];
|
|
1169
|
-
}, {
|
|
1170
|
-
readonly name: "OnlyProtocol";
|
|
1171
|
-
readonly type: "error";
|
|
1172
|
-
readonly inputs: readonly [];
|
|
1173
|
-
}, {
|
|
1174
|
-
readonly name: "InsufficientPoolBalance";
|
|
1175
|
-
readonly type: "error";
|
|
1176
|
-
readonly inputs: readonly [];
|
|
1177
|
-
}, {
|
|
1178
|
-
readonly name: "InsufficientReserves";
|
|
1179
|
-
readonly type: "error";
|
|
1180
|
-
readonly inputs: readonly [];
|
|
1181
|
-
}, {
|
|
1182
|
-
readonly name: "InsufficientLiquidityBalance";
|
|
1183
|
-
readonly type: "error";
|
|
1184
|
-
readonly inputs: readonly [];
|
|
1185
|
-
}, {
|
|
1186
|
-
readonly name: "MustDepositLowerBalanceToken";
|
|
1187
|
-
readonly type: "error";
|
|
1188
|
-
readonly inputs: readonly [];
|
|
1189
|
-
}, {
|
|
1190
|
-
readonly name: "InvalidAmount";
|
|
1191
|
-
readonly type: "error";
|
|
1192
|
-
readonly inputs: readonly [];
|
|
1193
|
-
}, {
|
|
1194
|
-
readonly name: "InvalidRebalanceState";
|
|
1195
|
-
readonly type: "error";
|
|
1196
|
-
readonly inputs: readonly [];
|
|
1197
|
-
}, {
|
|
1198
|
-
readonly name: "InvalidRebalanceDirection";
|
|
1199
|
-
readonly type: "error";
|
|
1200
|
-
readonly inputs: readonly [];
|
|
1201
|
-
}, {
|
|
1202
|
-
readonly name: "InvalidNewReserves";
|
|
1203
|
-
readonly type: "error";
|
|
1204
|
-
readonly inputs: readonly [];
|
|
1205
|
-
}, {
|
|
1206
|
-
readonly name: "CannotSupportPendingSwaps";
|
|
1207
|
-
readonly type: "error";
|
|
1208
|
-
readonly inputs: readonly [];
|
|
1209
|
-
}, {
|
|
1210
|
-
readonly name: "DivisionByZero";
|
|
1211
|
-
readonly type: "error";
|
|
1212
|
-
readonly inputs: readonly [];
|
|
1213
|
-
}, {
|
|
1214
|
-
readonly name: "InvalidSwapCalculation";
|
|
1215
|
-
readonly type: "error";
|
|
1216
|
-
readonly inputs: readonly [];
|
|
1217
|
-
}, {
|
|
1218
|
-
readonly name: "InsufficientLiquidityForPending";
|
|
1219
|
-
readonly type: "error";
|
|
1220
|
-
readonly inputs: readonly [];
|
|
1221
|
-
}, {
|
|
1222
|
-
readonly name: "TokenTransferFailed";
|
|
1223
|
-
readonly type: "error";
|
|
1224
|
-
readonly inputs: readonly [];
|
|
1225
|
-
}, {
|
|
1226
|
-
readonly name: "InternalError";
|
|
1227
|
-
readonly type: "error";
|
|
1228
|
-
readonly inputs: readonly [];
|
|
1229
|
-
}], "Mint">;
|
|
1230
|
-
}
|
|
1231
188
|
/**
|
|
1232
189
|
* Adds liquidity to a pool.
|
|
1233
190
|
*
|
|
@@ -1259,66 +216,26 @@ export declare namespace mint {
|
|
|
1259
216
|
*
|
|
1260
217
|
* @param client - Client.
|
|
1261
218
|
* @param parameters - Parameters.
|
|
1262
|
-
* @returns The transaction receipt and event data.
|
|
1263
|
-
*/
|
|
1264
|
-
export declare function mintSync<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: mintSync.Parameters<chain, account>): Promise<mintSync.ReturnValue>;
|
|
1265
|
-
export declare namespace mintSync {
|
|
1266
|
-
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = mint.Parameters<chain, account>;
|
|
1267
|
-
type Args = mint.Args;
|
|
1268
|
-
type ReturnValue = Compute<GetEventArgs<typeof Abis.feeAmm, 'Mint', {
|
|
1269
|
-
IndexedOnly: false;
|
|
1270
|
-
Required: true;
|
|
1271
|
-
}> & {
|
|
1272
|
-
/** Transaction receipt. */
|
|
1273
|
-
receipt: TransactionReceipt;
|
|
1274
|
-
}>;
|
|
1275
|
-
}
|
|
1276
|
-
/**
|
|
1277
|
-
* Removes liquidity from a pool.
|
|
1278
|
-
*
|
|
1279
|
-
* @example
|
|
1280
|
-
* ```ts
|
|
1281
|
-
* import { createClient, http } from 'viem'
|
|
1282
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
1283
|
-
* import { Actions } from 'tempo.ts/viem'
|
|
1284
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1285
|
-
*
|
|
1286
|
-
* const client = createClient({
|
|
1287
|
-
* account: privateKeyToAccount('0x...'),
|
|
1288
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1289
|
-
* transport: http(),
|
|
1290
|
-
* })
|
|
1291
|
-
*
|
|
1292
|
-
* const hash = await Actions.amm.burn(client, {
|
|
1293
|
-
* userToken: '0x20c0...beef',
|
|
1294
|
-
* validatorToken: '0x20c0...babe',
|
|
1295
|
-
* liquidity: 50n,
|
|
1296
|
-
* to: '0xfeed...fede',
|
|
1297
|
-
* })
|
|
1298
|
-
* ```
|
|
1299
|
-
*
|
|
1300
|
-
* @param client - Client.
|
|
1301
|
-
* @param parameters - Parameters.
|
|
1302
219
|
* @returns The transaction hash.
|
|
1303
220
|
*/
|
|
1304
|
-
export declare function
|
|
1305
|
-
export declare namespace
|
|
221
|
+
export declare function mint<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: mint.Parameters<chain, account>): Promise<mint.ReturnValue>;
|
|
222
|
+
export declare namespace mint {
|
|
1306
223
|
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = WriteParameters<chain, account> & Args;
|
|
1307
224
|
type Args = {
|
|
1308
|
-
/**
|
|
1309
|
-
liquidity: bigint;
|
|
1310
|
-
/** Address to send tokens to. */
|
|
225
|
+
/** Address to mint LP tokens to. */
|
|
1311
226
|
to: Address;
|
|
1312
|
-
/**
|
|
1313
|
-
|
|
1314
|
-
/**
|
|
1315
|
-
|
|
227
|
+
/** User token address. */
|
|
228
|
+
userTokenAddress: TokenId.TokenIdOrAddress;
|
|
229
|
+
/** Validator token address. */
|
|
230
|
+
validatorTokenAddress: TokenId.TokenIdOrAddress;
|
|
231
|
+
/** Amount of validator token to add. */
|
|
232
|
+
validatorTokenAmount: bigint;
|
|
1316
233
|
};
|
|
1317
234
|
type ReturnValue = WriteContractReturnType;
|
|
1318
235
|
/** @internal */
|
|
1319
|
-
function inner<action extends typeof writeContract | typeof writeContractSync, chain extends Chain | undefined, account extends Account | undefined>(action: action, client: Client<Transport, chain, account>, parameters:
|
|
236
|
+
function inner<action extends typeof writeContract | typeof writeContractSync, chain extends Chain | undefined, account extends Account | undefined>(action: action, client: Client<Transport, chain, account>, parameters: mint.Parameters<chain, account>): Promise<ReturnType<action>>;
|
|
1320
237
|
/**
|
|
1321
|
-
* Defines a call to the `
|
|
238
|
+
* Defines a call to the `mint` function.
|
|
1322
239
|
*
|
|
1323
240
|
* Can be passed as a parameter to:
|
|
1324
241
|
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
@@ -1338,17 +255,27 @@ export declare namespace burn {
|
|
|
1338
255
|
*
|
|
1339
256
|
* const { result } = await client.sendCalls({
|
|
1340
257
|
* calls: [
|
|
1341
|
-
* actions.amm.
|
|
1342
|
-
*
|
|
258
|
+
* actions.amm.mint.call({
|
|
259
|
+
* userToken: {
|
|
260
|
+
* address: '0x20c0...beef',
|
|
261
|
+
* amount: 100n,
|
|
262
|
+
* },
|
|
263
|
+
* validatorToken: {
|
|
264
|
+
* address: '0x20c0...babe',
|
|
265
|
+
* amount: 100n,
|
|
266
|
+
* },
|
|
1343
267
|
* to: '0xfeed...fede',
|
|
1344
|
-
* userToken: '0x20c0...beef',
|
|
1345
|
-
* validatorToken: '0x20c0...babe',
|
|
1346
268
|
* }),
|
|
1347
|
-
* actions.amm.
|
|
1348
|
-
*
|
|
269
|
+
* actions.amm.mint.call({
|
|
270
|
+
* userToken: {
|
|
271
|
+
* address: '0x20c0...babe',
|
|
272
|
+
* amount: 100n,
|
|
273
|
+
* },
|
|
274
|
+
* validatorToken: {
|
|
275
|
+
* address: '0x20c0...babe',
|
|
276
|
+
* amount: 100n,
|
|
277
|
+
* },
|
|
1349
278
|
* to: '0xfeed...fede',
|
|
1350
|
-
* userToken: '0x20c0...babe',
|
|
1351
|
-
* validatorToken: '0x20c0...babe',
|
|
1352
279
|
* }),
|
|
1353
280
|
* ]
|
|
1354
281
|
* })
|
|
@@ -1359,7 +286,7 @@ export declare namespace burn {
|
|
|
1359
286
|
*/
|
|
1360
287
|
function call(args: Args): {
|
|
1361
288
|
abi: [{
|
|
1362
|
-
readonly name: "
|
|
289
|
+
readonly name: "mintWithValidatorToken";
|
|
1363
290
|
readonly type: "function";
|
|
1364
291
|
readonly stateMutability: "nonpayable";
|
|
1365
292
|
readonly inputs: readonly [{
|
|
@@ -1370,20 +297,17 @@ export declare namespace burn {
|
|
|
1370
297
|
readonly name: "validatorToken";
|
|
1371
298
|
}, {
|
|
1372
299
|
readonly type: "uint256";
|
|
1373
|
-
readonly name: "
|
|
300
|
+
readonly name: "amountValidatorToken";
|
|
1374
301
|
}, {
|
|
1375
302
|
readonly type: "address";
|
|
1376
303
|
readonly name: "to";
|
|
1377
304
|
}];
|
|
1378
305
|
readonly outputs: readonly [{
|
|
1379
306
|
readonly type: "uint256";
|
|
1380
|
-
readonly name: "
|
|
1381
|
-
}, {
|
|
1382
|
-
readonly type: "uint256";
|
|
1383
|
-
readonly name: "amountValidatorToken";
|
|
307
|
+
readonly name: "liquidity";
|
|
1384
308
|
}];
|
|
1385
309
|
}];
|
|
1386
|
-
functionName: "
|
|
310
|
+
functionName: "mintWithValidatorToken";
|
|
1387
311
|
args?: readonly [`0x${string}`, `0x${string}`, bigint, `0x${string}`] | undefined;
|
|
1388
312
|
} & {
|
|
1389
313
|
args: readonly [`0x${string}`, `0x${string}`, bigint, `0x${string}`];
|
|
@@ -1394,10 +318,10 @@ export declare namespace burn {
|
|
|
1394
318
|
to: Address;
|
|
1395
319
|
};
|
|
1396
320
|
/**
|
|
1397
|
-
* Extracts the `
|
|
321
|
+
* Extracts the `Mint` event from logs.
|
|
1398
322
|
*
|
|
1399
323
|
* @param logs - The logs.
|
|
1400
|
-
* @returns The `
|
|
324
|
+
* @returns The `Mint` event.
|
|
1401
325
|
*/
|
|
1402
326
|
function extractEvent(logs: Log[]): Log<bigint, number, false, undefined, true, readonly [{
|
|
1403
327
|
readonly name: "MIN_LIQUIDITY";
|
|
@@ -1752,10 +676,10 @@ export declare namespace burn {
|
|
|
1752
676
|
readonly name: "InternalError";
|
|
1753
677
|
readonly type: "error";
|
|
1754
678
|
readonly inputs: readonly [];
|
|
1755
|
-
}], "
|
|
679
|
+
}], "Mint">;
|
|
1756
680
|
}
|
|
1757
681
|
/**
|
|
1758
|
-
*
|
|
682
|
+
* Adds liquidity to a pool.
|
|
1759
683
|
*
|
|
1760
684
|
* @example
|
|
1761
685
|
* ```ts
|
|
@@ -1770,10 +694,15 @@ export declare namespace burn {
|
|
|
1770
694
|
* transport: http(),
|
|
1771
695
|
* })
|
|
1772
696
|
*
|
|
1773
|
-
* const
|
|
1774
|
-
* userToken:
|
|
1775
|
-
*
|
|
1776
|
-
*
|
|
697
|
+
* const hash = await Actions.amm.mint(client, {
|
|
698
|
+
* userToken: {
|
|
699
|
+
* address: '0x20c0...beef',
|
|
700
|
+
* amount: 100n,
|
|
701
|
+
* },
|
|
702
|
+
* validatorToken: {
|
|
703
|
+
* address: '0x20c0...babe',
|
|
704
|
+
* amount: 100n,
|
|
705
|
+
* },
|
|
1777
706
|
* to: '0xfeed...fede',
|
|
1778
707
|
* })
|
|
1779
708
|
* ```
|
|
@@ -1782,11 +711,11 @@ export declare namespace burn {
|
|
|
1782
711
|
* @param parameters - Parameters.
|
|
1783
712
|
* @returns The transaction receipt and event data.
|
|
1784
713
|
*/
|
|
1785
|
-
export declare function
|
|
1786
|
-
export declare namespace
|
|
1787
|
-
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> =
|
|
1788
|
-
type Args =
|
|
1789
|
-
type ReturnValue = Compute<GetEventArgs<typeof Abis.feeAmm, '
|
|
714
|
+
export declare function mintSync<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: mintSync.Parameters<chain, account>): Promise<mintSync.ReturnValue>;
|
|
715
|
+
export declare namespace mintSync {
|
|
716
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = mint.Parameters<chain, account>;
|
|
717
|
+
type Args = mint.Args;
|
|
718
|
+
type ReturnValue = Compute<GetEventArgs<typeof Abis.feeAmm, 'Mint', {
|
|
1790
719
|
IndexedOnly: false;
|
|
1791
720
|
Required: true;
|
|
1792
721
|
}> & {
|
|
@@ -1794,88 +723,6 @@ export declare namespace burnSync {
|
|
|
1794
723
|
receipt: TransactionReceipt;
|
|
1795
724
|
}>;
|
|
1796
725
|
}
|
|
1797
|
-
/**
|
|
1798
|
-
* Watches for rebalance swap events.
|
|
1799
|
-
*
|
|
1800
|
-
* @example
|
|
1801
|
-
* ```ts
|
|
1802
|
-
* import { createClient, http } from 'viem'
|
|
1803
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
1804
|
-
* import { Actions } from 'tempo.ts/viem'
|
|
1805
|
-
*
|
|
1806
|
-
* const client = createClient({
|
|
1807
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1808
|
-
* transport: http(),
|
|
1809
|
-
* })
|
|
1810
|
-
*
|
|
1811
|
-
* const unwatch = actions.amm.watchRebalanceSwap(client, {
|
|
1812
|
-
* onRebalanceSwap: (args, log) => {
|
|
1813
|
-
* console.log('Rebalance swap:', args)
|
|
1814
|
-
* },
|
|
1815
|
-
* })
|
|
1816
|
-
* ```
|
|
1817
|
-
*
|
|
1818
|
-
* @param client - Client.
|
|
1819
|
-
* @param parameters - Parameters.
|
|
1820
|
-
* @returns A function to unsubscribe from the event.
|
|
1821
|
-
*/
|
|
1822
|
-
export declare function watchRebalanceSwap<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: watchRebalanceSwap.Parameters): import("viem").WatchContractEventReturnType;
|
|
1823
|
-
export declare namespace watchRebalanceSwap {
|
|
1824
|
-
type Args = GetEventArgs<typeof Abis.feeAmm, 'RebalanceSwap', {
|
|
1825
|
-
IndexedOnly: false;
|
|
1826
|
-
Required: true;
|
|
1827
|
-
}>;
|
|
1828
|
-
type Log = viem_Log<bigint, number, false, ExtractAbiItem<typeof Abis.feeAmm, 'RebalanceSwap'>, true>;
|
|
1829
|
-
type Parameters = UnionOmit<WatchContractEventParameters<typeof Abis.feeAmm, 'RebalanceSwap', true>, 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'> & {
|
|
1830
|
-
/** Callback to invoke when a rebalance swap occurs. */
|
|
1831
|
-
onRebalanceSwap: (args: Args, log: Log) => void;
|
|
1832
|
-
/** Address or ID of the user token to filter events. */
|
|
1833
|
-
userToken?: TokenId.TokenIdOrAddress | undefined;
|
|
1834
|
-
/** Address or ID of the validator token to filter events. */
|
|
1835
|
-
validatorToken?: TokenId.TokenIdOrAddress | undefined;
|
|
1836
|
-
};
|
|
1837
|
-
}
|
|
1838
|
-
/**
|
|
1839
|
-
* Watches for fee swap events.
|
|
1840
|
-
*
|
|
1841
|
-
* @example
|
|
1842
|
-
* ```ts
|
|
1843
|
-
* import { createClient, http } from 'viem'
|
|
1844
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
1845
|
-
* import { Actions } from 'tempo.ts/viem'
|
|
1846
|
-
*
|
|
1847
|
-
* const client = createClient({
|
|
1848
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1849
|
-
* transport: http(),
|
|
1850
|
-
* })
|
|
1851
|
-
*
|
|
1852
|
-
* const unwatch = actions.amm.watchFeeSwap(client, {
|
|
1853
|
-
* onFeeSwap: (args, log) => {
|
|
1854
|
-
* console.log('Fee swap:', args)
|
|
1855
|
-
* },
|
|
1856
|
-
* })
|
|
1857
|
-
* ```
|
|
1858
|
-
*
|
|
1859
|
-
* @param client - Client.
|
|
1860
|
-
* @param parameters - Parameters.
|
|
1861
|
-
* @returns A function to unsubscribe from the event.
|
|
1862
|
-
*/
|
|
1863
|
-
export declare function watchFeeSwap<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: watchFeeSwap.Parameters): import("viem").WatchContractEventReturnType;
|
|
1864
|
-
export declare namespace watchFeeSwap {
|
|
1865
|
-
type Args = GetEventArgs<typeof Abis.feeAmm, 'FeeSwap', {
|
|
1866
|
-
IndexedOnly: false;
|
|
1867
|
-
Required: true;
|
|
1868
|
-
}>;
|
|
1869
|
-
type Log = viem_Log<bigint, number, false, ExtractAbiItem<typeof Abis.feeAmm, 'FeeSwap'>, true>;
|
|
1870
|
-
type Parameters = UnionOmit<WatchContractEventParameters<typeof Abis.feeAmm, 'FeeSwap', true>, 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'> & {
|
|
1871
|
-
/** Callback to invoke when a fee swap occurs. */
|
|
1872
|
-
onFeeSwap: (args: Args, log: Log) => void;
|
|
1873
|
-
/** Address or ID of the user token to filter events. */
|
|
1874
|
-
userToken?: TokenId.TokenIdOrAddress | undefined;
|
|
1875
|
-
/** Address or ID of the validator token to filter events. */
|
|
1876
|
-
validatorToken?: TokenId.TokenIdOrAddress | undefined;
|
|
1877
|
-
};
|
|
1878
|
-
}
|
|
1879
726
|
/**
|
|
1880
727
|
* Watches for liquidity mint events.
|
|
1881
728
|
*
|
|
@@ -1927,45 +774,4 @@ export declare namespace watchMint {
|
|
|
1927
774
|
validatorToken?: TokenId.TokenIdOrAddress | undefined;
|
|
1928
775
|
};
|
|
1929
776
|
}
|
|
1930
|
-
/**
|
|
1931
|
-
* Watches for liquidity burn events.
|
|
1932
|
-
*
|
|
1933
|
-
* @example
|
|
1934
|
-
* ```ts
|
|
1935
|
-
* import { createClient, http } from 'viem'
|
|
1936
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
1937
|
-
* import { Actions } from 'tempo.ts/viem'
|
|
1938
|
-
*
|
|
1939
|
-
* const client = createClient({
|
|
1940
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1941
|
-
* transport: http(),
|
|
1942
|
-
* })
|
|
1943
|
-
*
|
|
1944
|
-
* const unwatch = actions.amm.watchBurn(client, {
|
|
1945
|
-
* onBurn: (args, log) => {
|
|
1946
|
-
* console.log('Liquidity removed:', args)
|
|
1947
|
-
* },
|
|
1948
|
-
* })
|
|
1949
|
-
* ```
|
|
1950
|
-
*
|
|
1951
|
-
* @param client - Client.
|
|
1952
|
-
* @param parameters - Parameters.
|
|
1953
|
-
* @returns A function to unsubscribe from the event.
|
|
1954
|
-
*/
|
|
1955
|
-
export declare function watchBurn<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: watchBurn.Parameters): import("viem").WatchContractEventReturnType;
|
|
1956
|
-
export declare namespace watchBurn {
|
|
1957
|
-
type Args = GetEventArgs<typeof Abis.feeAmm, 'Burn', {
|
|
1958
|
-
IndexedOnly: false;
|
|
1959
|
-
Required: true;
|
|
1960
|
-
}>;
|
|
1961
|
-
type Log = viem_Log<bigint, number, false, ExtractAbiItem<typeof Abis.feeAmm, 'Burn'>, true>;
|
|
1962
|
-
type Parameters = UnionOmit<WatchContractEventParameters<typeof Abis.feeAmm, 'Burn', true>, 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'> & {
|
|
1963
|
-
/** Callback to invoke when liquidity is removed. */
|
|
1964
|
-
onBurn: (args: Args, log: Log) => void;
|
|
1965
|
-
/** Address or ID of the user token to filter events. */
|
|
1966
|
-
userToken?: TokenId.TokenIdOrAddress | undefined;
|
|
1967
|
-
/** Address or ID of the validator token to filter events. */
|
|
1968
|
-
validatorToken?: TokenId.TokenIdOrAddress | undefined;
|
|
1969
|
-
};
|
|
1970
|
-
}
|
|
1971
777
|
//# sourceMappingURL=amm.d.ts.map
|