@xccy/ts-sdk 0.1.1 → 0.1.3

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.
@@ -0,0 +1,610 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ import type {
5
+ BaseContract,
6
+ BigNumberish,
7
+ BytesLike,
8
+ FunctionFragment,
9
+ Result,
10
+ Interface,
11
+ EventFragment,
12
+ AddressLike,
13
+ ContractRunner,
14
+ ContractMethod,
15
+ Listener,
16
+ } from "ethers";
17
+ import type {
18
+ TypedContractEvent,
19
+ TypedDeferredTopicFilter,
20
+ TypedEventLog,
21
+ TypedLogDescription,
22
+ TypedListener,
23
+ TypedContractMethod,
24
+ } from "./common";
25
+
26
+ export declare namespace PoolKey {
27
+ export type KeyStruct = {
28
+ underlyingAsset: AddressLike;
29
+ compoundToken: AddressLike;
30
+ termStartTimestampWad: BigNumberish;
31
+ termEndTimestampWad: BigNumberish;
32
+ feeWad: BigNumberish;
33
+ tickSpacing: BigNumberish;
34
+ };
35
+
36
+ export type KeyStructOutput = [
37
+ underlyingAsset: string,
38
+ compoundToken: string,
39
+ termStartTimestampWad: bigint,
40
+ termEndTimestampWad: bigint,
41
+ feeWad: bigint,
42
+ tickSpacing: bigint
43
+ ] & {
44
+ underlyingAsset: string;
45
+ compoundToken: string;
46
+ termStartTimestampWad: bigint;
47
+ termEndTimestampWad: bigint;
48
+ feeWad: bigint;
49
+ tickSpacing: bigint;
50
+ };
51
+ }
52
+
53
+ export declare namespace Account {
54
+ export type AccountIdStruct = {
55
+ owner: AddressLike;
56
+ id: BigNumberish;
57
+ isolatedMarginToken: AddressLike;
58
+ };
59
+
60
+ export type AccountIdStructOutput = [
61
+ owner: string,
62
+ id: bigint,
63
+ isolatedMarginToken: string
64
+ ] & { owner: string; id: bigint; isolatedMarginToken: string };
65
+ }
66
+
67
+ export declare namespace VAMMTypes {
68
+ export type SwapParamsStruct = {
69
+ account: Account.AccountIdStruct;
70
+ amountSpecified: BigNumberish;
71
+ sqrtPriceLimitX96: BigNumberish;
72
+ tickLower: BigNumberish;
73
+ tickUpper: BigNumberish;
74
+ };
75
+
76
+ export type SwapParamsStructOutput = [
77
+ account: Account.AccountIdStructOutput,
78
+ amountSpecified: bigint,
79
+ sqrtPriceLimitX96: bigint,
80
+ tickLower: bigint,
81
+ tickUpper: bigint
82
+ ] & {
83
+ account: Account.AccountIdStructOutput;
84
+ amountSpecified: bigint;
85
+ sqrtPriceLimitX96: bigint;
86
+ tickLower: bigint;
87
+ tickUpper: bigint;
88
+ };
89
+ }
90
+
91
+ export interface IVAMMManagerInterface extends Interface {
92
+ getFunction(
93
+ nameOrSignature:
94
+ | "burn"
95
+ | "computeGrowthInside"
96
+ | "createPool"
97
+ | "getVAMMState"
98
+ | "mint"
99
+ | "poolExists"
100
+ | "swap"
101
+ ): FunctionFragment;
102
+
103
+ getEvent(
104
+ nameOrSignatureOrTopic: "Burn" | "Mint" | "PoolInitialized" | "Swap"
105
+ ): EventFragment;
106
+
107
+ encodeFunctionData(
108
+ functionFragment: "burn",
109
+ values: [
110
+ PoolKey.KeyStruct,
111
+ Account.AccountIdStruct,
112
+ BigNumberish,
113
+ BigNumberish,
114
+ BigNumberish
115
+ ]
116
+ ): string;
117
+ encodeFunctionData(
118
+ functionFragment: "computeGrowthInside",
119
+ values: [BytesLike, BigNumberish, BigNumberish]
120
+ ): string;
121
+ encodeFunctionData(
122
+ functionFragment: "createPool",
123
+ values: [PoolKey.KeyStruct, AddressLike, BigNumberish]
124
+ ): string;
125
+ encodeFunctionData(
126
+ functionFragment: "getVAMMState",
127
+ values: [BytesLike]
128
+ ): string;
129
+ encodeFunctionData(
130
+ functionFragment: "mint",
131
+ values: [
132
+ PoolKey.KeyStruct,
133
+ Account.AccountIdStruct,
134
+ BigNumberish,
135
+ BigNumberish,
136
+ BigNumberish
137
+ ]
138
+ ): string;
139
+ encodeFunctionData(
140
+ functionFragment: "poolExists",
141
+ values: [PoolKey.KeyStruct]
142
+ ): string;
143
+ encodeFunctionData(
144
+ functionFragment: "swap",
145
+ values: [PoolKey.KeyStruct, VAMMTypes.SwapParamsStruct]
146
+ ): string;
147
+
148
+ decodeFunctionResult(functionFragment: "burn", data: BytesLike): Result;
149
+ decodeFunctionResult(
150
+ functionFragment: "computeGrowthInside",
151
+ data: BytesLike
152
+ ): Result;
153
+ decodeFunctionResult(functionFragment: "createPool", data: BytesLike): Result;
154
+ decodeFunctionResult(
155
+ functionFragment: "getVAMMState",
156
+ data: BytesLike
157
+ ): Result;
158
+ decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result;
159
+ decodeFunctionResult(functionFragment: "poolExists", data: BytesLike): Result;
160
+ decodeFunctionResult(functionFragment: "swap", data: BytesLike): Result;
161
+ }
162
+
163
+ export namespace BurnEvent {
164
+ export type InputTuple = [
165
+ poolId: BytesLike,
166
+ owner: AddressLike,
167
+ accountId: BigNumberish,
168
+ isolatedMarginToken: AddressLike,
169
+ tickLower: BigNumberish,
170
+ tickUpper: BigNumberish,
171
+ amount: BigNumberish,
172
+ feeIncurred: BigNumberish
173
+ ];
174
+ export type OutputTuple = [
175
+ poolId: string,
176
+ owner: string,
177
+ accountId: bigint,
178
+ isolatedMarginToken: string,
179
+ tickLower: bigint,
180
+ tickUpper: bigint,
181
+ amount: bigint,
182
+ feeIncurred: bigint
183
+ ];
184
+ export interface OutputObject {
185
+ poolId: string;
186
+ owner: string;
187
+ accountId: bigint;
188
+ isolatedMarginToken: string;
189
+ tickLower: bigint;
190
+ tickUpper: bigint;
191
+ amount: bigint;
192
+ feeIncurred: bigint;
193
+ }
194
+ export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
195
+ export type Filter = TypedDeferredTopicFilter<Event>;
196
+ export type Log = TypedEventLog<Event>;
197
+ export type LogDescription = TypedLogDescription<Event>;
198
+ }
199
+
200
+ export namespace MintEvent {
201
+ export type InputTuple = [
202
+ poolId: BytesLike,
203
+ owner: AddressLike,
204
+ accountId: BigNumberish,
205
+ isolatedMarginToken: AddressLike,
206
+ tickLower: BigNumberish,
207
+ tickUpper: BigNumberish,
208
+ amount: BigNumberish,
209
+ feeIncurred: BigNumberish
210
+ ];
211
+ export type OutputTuple = [
212
+ poolId: string,
213
+ owner: string,
214
+ accountId: bigint,
215
+ isolatedMarginToken: string,
216
+ tickLower: bigint,
217
+ tickUpper: bigint,
218
+ amount: bigint,
219
+ feeIncurred: bigint
220
+ ];
221
+ export interface OutputObject {
222
+ poolId: string;
223
+ owner: string;
224
+ accountId: bigint;
225
+ isolatedMarginToken: string;
226
+ tickLower: bigint;
227
+ tickUpper: bigint;
228
+ amount: bigint;
229
+ feeIncurred: bigint;
230
+ }
231
+ export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
232
+ export type Filter = TypedDeferredTopicFilter<Event>;
233
+ export type Log = TypedEventLog<Event>;
234
+ export type LogDescription = TypedLogDescription<Event>;
235
+ }
236
+
237
+ export namespace PoolInitializedEvent {
238
+ export type InputTuple = [
239
+ poolId: BytesLike,
240
+ underlyingAsset: AddressLike,
241
+ compoundToken: AddressLike,
242
+ termStartTimestampWad: BigNumberish,
243
+ termEndTimestampWad: BigNumberish,
244
+ feeWad: BigNumberish,
245
+ tickSpacing: BigNumberish,
246
+ currentTick: BigNumberish,
247
+ sqrtPriceX96: BigNumberish
248
+ ];
249
+ export type OutputTuple = [
250
+ poolId: string,
251
+ underlyingAsset: string,
252
+ compoundToken: string,
253
+ termStartTimestampWad: bigint,
254
+ termEndTimestampWad: bigint,
255
+ feeWad: bigint,
256
+ tickSpacing: bigint,
257
+ currentTick: bigint,
258
+ sqrtPriceX96: bigint
259
+ ];
260
+ export interface OutputObject {
261
+ poolId: string;
262
+ underlyingAsset: string;
263
+ compoundToken: string;
264
+ termStartTimestampWad: bigint;
265
+ termEndTimestampWad: bigint;
266
+ feeWad: bigint;
267
+ tickSpacing: bigint;
268
+ currentTick: bigint;
269
+ sqrtPriceX96: bigint;
270
+ }
271
+ export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
272
+ export type Filter = TypedDeferredTopicFilter<Event>;
273
+ export type Log = TypedEventLog<Event>;
274
+ export type LogDescription = TypedLogDescription<Event>;
275
+ }
276
+
277
+ export namespace SwapEvent {
278
+ export type InputTuple = [
279
+ poolId: BytesLike,
280
+ owner: AddressLike,
281
+ accountId: BigNumberish,
282
+ isolatedMarginToken: AddressLike,
283
+ tickLower: BigNumberish,
284
+ tickUpper: BigNumberish,
285
+ feeIncurred: BigNumberish,
286
+ fixedTokenDelta: BigNumberish,
287
+ variableTokenDelta: BigNumberish,
288
+ currentTick: BigNumberish,
289
+ sqrtPriceX96: BigNumberish
290
+ ];
291
+ export type OutputTuple = [
292
+ poolId: string,
293
+ owner: string,
294
+ accountId: bigint,
295
+ isolatedMarginToken: string,
296
+ tickLower: bigint,
297
+ tickUpper: bigint,
298
+ feeIncurred: bigint,
299
+ fixedTokenDelta: bigint,
300
+ variableTokenDelta: bigint,
301
+ currentTick: bigint,
302
+ sqrtPriceX96: bigint
303
+ ];
304
+ export interface OutputObject {
305
+ poolId: string;
306
+ owner: string;
307
+ accountId: bigint;
308
+ isolatedMarginToken: string;
309
+ tickLower: bigint;
310
+ tickUpper: bigint;
311
+ feeIncurred: bigint;
312
+ fixedTokenDelta: bigint;
313
+ variableTokenDelta: bigint;
314
+ currentTick: bigint;
315
+ sqrtPriceX96: bigint;
316
+ }
317
+ export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
318
+ export type Filter = TypedDeferredTopicFilter<Event>;
319
+ export type Log = TypedEventLog<Event>;
320
+ export type LogDescription = TypedLogDescription<Event>;
321
+ }
322
+
323
+ export interface IVAMMManager extends BaseContract {
324
+ connect(runner?: ContractRunner | null): IVAMMManager;
325
+ waitForDeployment(): Promise<this>;
326
+
327
+ interface: IVAMMManagerInterface;
328
+
329
+ queryFilter<TCEvent extends TypedContractEvent>(
330
+ event: TCEvent,
331
+ fromBlockOrBlockhash?: string | number | undefined,
332
+ toBlock?: string | number | undefined
333
+ ): Promise<Array<TypedEventLog<TCEvent>>>;
334
+ queryFilter<TCEvent extends TypedContractEvent>(
335
+ filter: TypedDeferredTopicFilter<TCEvent>,
336
+ fromBlockOrBlockhash?: string | number | undefined,
337
+ toBlock?: string | number | undefined
338
+ ): Promise<Array<TypedEventLog<TCEvent>>>;
339
+
340
+ on<TCEvent extends TypedContractEvent>(
341
+ event: TCEvent,
342
+ listener: TypedListener<TCEvent>
343
+ ): Promise<this>;
344
+ on<TCEvent extends TypedContractEvent>(
345
+ filter: TypedDeferredTopicFilter<TCEvent>,
346
+ listener: TypedListener<TCEvent>
347
+ ): Promise<this>;
348
+
349
+ once<TCEvent extends TypedContractEvent>(
350
+ event: TCEvent,
351
+ listener: TypedListener<TCEvent>
352
+ ): Promise<this>;
353
+ once<TCEvent extends TypedContractEvent>(
354
+ filter: TypedDeferredTopicFilter<TCEvent>,
355
+ listener: TypedListener<TCEvent>
356
+ ): Promise<this>;
357
+
358
+ listeners<TCEvent extends TypedContractEvent>(
359
+ event: TCEvent
360
+ ): Promise<Array<TypedListener<TCEvent>>>;
361
+ listeners(eventName?: string): Promise<Array<Listener>>;
362
+ removeAllListeners<TCEvent extends TypedContractEvent>(
363
+ event?: TCEvent
364
+ ): Promise<this>;
365
+
366
+ burn: TypedContractMethod<
367
+ [
368
+ key: PoolKey.KeyStruct,
369
+ account: Account.AccountIdStruct,
370
+ tickLower: BigNumberish,
371
+ tickUpper: BigNumberish,
372
+ amount: BigNumberish
373
+ ],
374
+ [bigint],
375
+ "nonpayable"
376
+ >;
377
+
378
+ computeGrowthInside: TypedContractMethod<
379
+ [poolId: BytesLike, tickLower: BigNumberish, tickUpper: BigNumberish],
380
+ [
381
+ [bigint, bigint] & {
382
+ fixedTokenGrowthInsideX128: bigint;
383
+ variableTokenGrowthInsideX128: bigint;
384
+ }
385
+ ],
386
+ "view"
387
+ >;
388
+
389
+ createPool: TypedContractMethod<
390
+ [
391
+ key: PoolKey.KeyStruct,
392
+ aprOracle: AddressLike,
393
+ sqrtPriceX96: BigNumberish
394
+ ],
395
+ [[bigint, string] & { tick: bigint; poolId: string }],
396
+ "nonpayable"
397
+ >;
398
+
399
+ getVAMMState: TypedContractMethod<
400
+ [poolId: BytesLike],
401
+ [
402
+ [bigint, bigint, string] & {
403
+ tick: bigint;
404
+ sqrtPriceX96: bigint;
405
+ compoundToken: string;
406
+ }
407
+ ],
408
+ "view"
409
+ >;
410
+
411
+ mint: TypedContractMethod<
412
+ [
413
+ key: PoolKey.KeyStruct,
414
+ account: Account.AccountIdStruct,
415
+ tickLower: BigNumberish,
416
+ tickUpper: BigNumberish,
417
+ amount: BigNumberish
418
+ ],
419
+ [
420
+ [bigint, bigint] & {
421
+ positionMarginRequirement: bigint;
422
+ feeIncurred: bigint;
423
+ }
424
+ ],
425
+ "nonpayable"
426
+ >;
427
+
428
+ poolExists: TypedContractMethod<[key: PoolKey.KeyStruct], [boolean], "view">;
429
+
430
+ swap: TypedContractMethod<
431
+ [key: PoolKey.KeyStruct, params: VAMMTypes.SwapParamsStruct],
432
+ [
433
+ [bigint, bigint, bigint, bigint, bigint, bigint] & {
434
+ fixedTokenDelta: bigint;
435
+ variableTokenDelta: bigint;
436
+ feeIncurred: bigint;
437
+ fixedTokenDeltaUnbalanced: bigint;
438
+ positionMarginRequirement: bigint;
439
+ priceAfterSwap: bigint;
440
+ }
441
+ ],
442
+ "nonpayable"
443
+ >;
444
+
445
+ getFunction<T extends ContractMethod = ContractMethod>(
446
+ key: string | FunctionFragment
447
+ ): T;
448
+
449
+ getFunction(
450
+ nameOrSignature: "burn"
451
+ ): TypedContractMethod<
452
+ [
453
+ key: PoolKey.KeyStruct,
454
+ account: Account.AccountIdStruct,
455
+ tickLower: BigNumberish,
456
+ tickUpper: BigNumberish,
457
+ amount: BigNumberish
458
+ ],
459
+ [bigint],
460
+ "nonpayable"
461
+ >;
462
+ getFunction(
463
+ nameOrSignature: "computeGrowthInside"
464
+ ): TypedContractMethod<
465
+ [poolId: BytesLike, tickLower: BigNumberish, tickUpper: BigNumberish],
466
+ [
467
+ [bigint, bigint] & {
468
+ fixedTokenGrowthInsideX128: bigint;
469
+ variableTokenGrowthInsideX128: bigint;
470
+ }
471
+ ],
472
+ "view"
473
+ >;
474
+ getFunction(
475
+ nameOrSignature: "createPool"
476
+ ): TypedContractMethod<
477
+ [
478
+ key: PoolKey.KeyStruct,
479
+ aprOracle: AddressLike,
480
+ sqrtPriceX96: BigNumberish
481
+ ],
482
+ [[bigint, string] & { tick: bigint; poolId: string }],
483
+ "nonpayable"
484
+ >;
485
+ getFunction(
486
+ nameOrSignature: "getVAMMState"
487
+ ): TypedContractMethod<
488
+ [poolId: BytesLike],
489
+ [
490
+ [bigint, bigint, string] & {
491
+ tick: bigint;
492
+ sqrtPriceX96: bigint;
493
+ compoundToken: string;
494
+ }
495
+ ],
496
+ "view"
497
+ >;
498
+ getFunction(
499
+ nameOrSignature: "mint"
500
+ ): TypedContractMethod<
501
+ [
502
+ key: PoolKey.KeyStruct,
503
+ account: Account.AccountIdStruct,
504
+ tickLower: BigNumberish,
505
+ tickUpper: BigNumberish,
506
+ amount: BigNumberish
507
+ ],
508
+ [
509
+ [bigint, bigint] & {
510
+ positionMarginRequirement: bigint;
511
+ feeIncurred: bigint;
512
+ }
513
+ ],
514
+ "nonpayable"
515
+ >;
516
+ getFunction(
517
+ nameOrSignature: "poolExists"
518
+ ): TypedContractMethod<[key: PoolKey.KeyStruct], [boolean], "view">;
519
+ getFunction(
520
+ nameOrSignature: "swap"
521
+ ): TypedContractMethod<
522
+ [key: PoolKey.KeyStruct, params: VAMMTypes.SwapParamsStruct],
523
+ [
524
+ [bigint, bigint, bigint, bigint, bigint, bigint] & {
525
+ fixedTokenDelta: bigint;
526
+ variableTokenDelta: bigint;
527
+ feeIncurred: bigint;
528
+ fixedTokenDeltaUnbalanced: bigint;
529
+ positionMarginRequirement: bigint;
530
+ priceAfterSwap: bigint;
531
+ }
532
+ ],
533
+ "nonpayable"
534
+ >;
535
+
536
+ getEvent(
537
+ key: "Burn"
538
+ ): TypedContractEvent<
539
+ BurnEvent.InputTuple,
540
+ BurnEvent.OutputTuple,
541
+ BurnEvent.OutputObject
542
+ >;
543
+ getEvent(
544
+ key: "Mint"
545
+ ): TypedContractEvent<
546
+ MintEvent.InputTuple,
547
+ MintEvent.OutputTuple,
548
+ MintEvent.OutputObject
549
+ >;
550
+ getEvent(
551
+ key: "PoolInitialized"
552
+ ): TypedContractEvent<
553
+ PoolInitializedEvent.InputTuple,
554
+ PoolInitializedEvent.OutputTuple,
555
+ PoolInitializedEvent.OutputObject
556
+ >;
557
+ getEvent(
558
+ key: "Swap"
559
+ ): TypedContractEvent<
560
+ SwapEvent.InputTuple,
561
+ SwapEvent.OutputTuple,
562
+ SwapEvent.OutputObject
563
+ >;
564
+
565
+ filters: {
566
+ "Burn(bytes32,address,uint96,address,int24,int24,uint128,int256)": TypedContractEvent<
567
+ BurnEvent.InputTuple,
568
+ BurnEvent.OutputTuple,
569
+ BurnEvent.OutputObject
570
+ >;
571
+ Burn: TypedContractEvent<
572
+ BurnEvent.InputTuple,
573
+ BurnEvent.OutputTuple,
574
+ BurnEvent.OutputObject
575
+ >;
576
+
577
+ "Mint(bytes32,address,uint96,address,int24,int24,uint128,int256)": TypedContractEvent<
578
+ MintEvent.InputTuple,
579
+ MintEvent.OutputTuple,
580
+ MintEvent.OutputObject
581
+ >;
582
+ Mint: TypedContractEvent<
583
+ MintEvent.InputTuple,
584
+ MintEvent.OutputTuple,
585
+ MintEvent.OutputObject
586
+ >;
587
+
588
+ "PoolInitialized(bytes32,address,address,uint256,uint256,uint256,int24,int24,uint160)": TypedContractEvent<
589
+ PoolInitializedEvent.InputTuple,
590
+ PoolInitializedEvent.OutputTuple,
591
+ PoolInitializedEvent.OutputObject
592
+ >;
593
+ PoolInitialized: TypedContractEvent<
594
+ PoolInitializedEvent.InputTuple,
595
+ PoolInitializedEvent.OutputTuple,
596
+ PoolInitializedEvent.OutputObject
597
+ >;
598
+
599
+ "Swap(bytes32,address,uint96,address,int24,int24,int256,int256,int256,int24,uint160)": TypedContractEvent<
600
+ SwapEvent.InputTuple,
601
+ SwapEvent.OutputTuple,
602
+ SwapEvent.OutputObject
603
+ >;
604
+ Swap: TypedContractEvent<
605
+ SwapEvent.InputTuple,
606
+ SwapEvent.OutputTuple,
607
+ SwapEvent.OutputObject
608
+ >;
609
+ };
610
+ }