@typus/typus-perp-sdk 1.0.30 → 1.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/src/fetch.d.ts +3 -0
  2. package/dist/src/fetch.js +3 -1
  3. package/dist/src/typus_perp/admin/functions.d.ts +25 -25
  4. package/dist/src/typus_perp/admin/functions.js +66 -53
  5. package/dist/src/typus_perp/admin/structs.d.ts +222 -222
  6. package/dist/src/typus_perp/admin/structs.js +256 -256
  7. package/dist/src/typus_perp/error/functions.d.ts +67 -67
  8. package/dist/src/typus_perp/error/functions.js +201 -134
  9. package/dist/src/typus_perp/escrow/functions.d.ts +3 -3
  10. package/dist/src/typus_perp/escrow/functions.js +9 -6
  11. package/dist/src/typus_perp/lending/functions.d.ts +15 -0
  12. package/dist/src/typus_perp/lending/functions.js +22 -0
  13. package/dist/src/typus_perp/lp-pool/functions.d.ts +102 -63
  14. package/dist/src/typus_perp/lp-pool/functions.js +243 -123
  15. package/dist/src/typus_perp/lp-pool/structs.d.ts +616 -348
  16. package/dist/src/typus_perp/lp-pool/structs.js +1202 -768
  17. package/dist/src/typus_perp/math/functions.d.ts +16 -5
  18. package/dist/src/typus_perp/math/functions.js +33 -12
  19. package/dist/src/typus_perp/position/functions.d.ts +86 -86
  20. package/dist/src/typus_perp/position/functions.js +223 -157
  21. package/dist/src/typus_perp/symbol/functions.d.ts +4 -4
  22. package/dist/src/typus_perp/symbol/functions.js +14 -10
  23. package/dist/src/typus_perp/tlp/functions.d.ts +5 -5
  24. package/dist/src/typus_perp/tlp/functions.js +17 -12
  25. package/dist/src/typus_perp/token-interface/functions.d.ts +2 -2
  26. package/dist/src/typus_perp/token-interface/functions.js +6 -4
  27. package/dist/src/typus_perp/trading/functions.d.ts +75 -75
  28. package/dist/src/typus_perp/trading/functions.js +189 -138
  29. package/dist/src/typus_perp/trading/structs.d.ts +6 -0
  30. package/dist/src/typus_perp/trading/structs.js +6 -0
  31. package/dist/src/typus_perp/treasury-caps/functions.d.ts +4 -4
  32. package/dist/src/typus_perp/treasury-caps/functions.js +14 -10
  33. package/package.json +2 -2
@@ -7,194 +7,6 @@ import { FieldsWithTypes } from "../../_framework/util";
7
7
  import { Vector } from "../../_framework/vector";
8
8
  import { PKG_V1 } from "../index";
9
9
  import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
10
- export declare function isVersion(type: string): boolean;
11
- export interface VersionFields {
12
- id: ToField<UID>;
13
- value: ToField<"u64">;
14
- feePool: ToField<FeePool>;
15
- liquidatorFeePool: ToField<FeePool>;
16
- authority: ToField<VecSet<"address">>;
17
- u64Padding: ToField<Vector<"u64">>;
18
- }
19
- export type VersionReified = Reified<Version, VersionFields>;
20
- export declare class Version implements StructClass {
21
- __StructClass: true;
22
- static readonly $typeName: string;
23
- static readonly $numTypeParams = 0;
24
- static readonly $isPhantom: readonly [];
25
- readonly $typeName: string;
26
- readonly $fullTypeName: `${typeof PKG_V1}::admin::Version`;
27
- readonly $typeArgs: [];
28
- readonly $isPhantom: readonly [];
29
- readonly id: ToField<UID>;
30
- readonly value: ToField<"u64">;
31
- readonly feePool: ToField<FeePool>;
32
- readonly liquidatorFeePool: ToField<FeePool>;
33
- readonly authority: ToField<VecSet<"address">>;
34
- readonly u64Padding: ToField<Vector<"u64">>;
35
- private constructor();
36
- static reified(): VersionReified;
37
- static get r(): reified.StructClassReified<Version, VersionFields>;
38
- static phantom(): PhantomReified<ToTypeStr<Version>>;
39
- static get p(): reified.PhantomReified<"0x7ea60df3452d1cec0064d3380cb6f2a9309dcf7ac1b51529de71ef427688b1c3::admin::Version" | "0x21a3b745eaeee0ec0cbc3207230185013d1d8939f7a920aa61f5fea7d09db600::admin::Version">;
40
- static get bcs(): import("@mysten/sui/bcs").BcsType<{
41
- id: {
42
- id: {
43
- bytes: string;
44
- };
45
- };
46
- value: string;
47
- fee_pool: {
48
- id: {
49
- id: {
50
- bytes: string;
51
- };
52
- };
53
- fee_infos: {
54
- token: {
55
- name: {
56
- bytes: number[];
57
- };
58
- };
59
- value: string;
60
- }[];
61
- };
62
- liquidator_fee_pool: {
63
- id: {
64
- id: {
65
- bytes: string;
66
- };
67
- };
68
- fee_infos: {
69
- token: {
70
- name: {
71
- bytes: number[];
72
- };
73
- };
74
- value: string;
75
- }[];
76
- };
77
- authority: {
78
- contents: any[];
79
- };
80
- u64_padding: string[];
81
- }, {
82
- id: {
83
- id: {
84
- bytes: string;
85
- };
86
- };
87
- value: string | number | bigint;
88
- fee_pool: {
89
- id: {
90
- id: {
91
- bytes: string;
92
- };
93
- };
94
- fee_infos: Iterable<{
95
- token: {
96
- name: {
97
- bytes: Iterable<number> & {
98
- length: number;
99
- };
100
- };
101
- };
102
- value: string | number | bigint;
103
- }> & {
104
- length: number;
105
- };
106
- };
107
- liquidator_fee_pool: {
108
- id: {
109
- id: {
110
- bytes: string;
111
- };
112
- };
113
- fee_infos: Iterable<{
114
- token: {
115
- name: {
116
- bytes: Iterable<number> & {
117
- length: number;
118
- };
119
- };
120
- };
121
- value: string | number | bigint;
122
- }> & {
123
- length: number;
124
- };
125
- };
126
- authority: {
127
- contents: Iterable<any> & {
128
- length: number;
129
- };
130
- };
131
- u64_padding: Iterable<string | number | bigint> & {
132
- length: number;
133
- };
134
- }>;
135
- static fromFields(fields: Record<string, any>): Version;
136
- static fromFieldsWithTypes(item: FieldsWithTypes): Version;
137
- static fromBcs(data: Uint8Array): Version;
138
- toJSONField(): {
139
- id: string;
140
- value: string;
141
- feePool: {
142
- id: string;
143
- feeInfos: {
144
- token: {
145
- name: string;
146
- };
147
- value: string;
148
- }[];
149
- };
150
- liquidatorFeePool: {
151
- id: string;
152
- feeInfos: {
153
- token: {
154
- name: string;
155
- };
156
- value: string;
157
- }[];
158
- };
159
- authority: {
160
- contents: string[];
161
- };
162
- u64Padding: string[];
163
- };
164
- toJSON(): {
165
- id: string;
166
- value: string;
167
- feePool: {
168
- id: string;
169
- feeInfos: {
170
- token: {
171
- name: string;
172
- };
173
- value: string;
174
- }[];
175
- };
176
- liquidatorFeePool: {
177
- id: string;
178
- feeInfos: {
179
- token: {
180
- name: string;
181
- };
182
- value: string;
183
- }[];
184
- };
185
- authority: {
186
- contents: string[];
187
- };
188
- u64Padding: string[];
189
- $typeName: string;
190
- $typeArgs: [];
191
- };
192
- static fromJSONField(field: any): Version;
193
- static fromJSON(json: Record<string, any>): Version;
194
- static fromSuiParsedData(content: SuiParsedData): Version;
195
- static fromSuiObjectData(data: SuiObjectData): Version;
196
- static fetch(client: SuiClient, id: string): Promise<Version>;
197
- }
198
10
  export declare function isFeeInfo(type: string): boolean;
199
11
  export interface FeeInfoFields {
200
12
  token: ToField<TypeName>;
@@ -341,28 +153,28 @@ export declare class FeePool implements StructClass {
341
153
  static fromSuiObjectData(data: SuiObjectData): FeePool;
342
154
  static fetch(client: SuiClient, id: string): Promise<FeePool>;
343
155
  }
344
- export declare function isSendFeeEvent(type: string): boolean;
345
- export interface SendFeeEventFields {
156
+ export declare function isProtocolFeeEvent(type: string): boolean;
157
+ export interface ProtocolFeeEventFields {
346
158
  token: ToField<TypeName>;
347
159
  amount: ToField<"u64">;
348
160
  }
349
- export type SendFeeEventReified = Reified<SendFeeEvent, SendFeeEventFields>;
350
- export declare class SendFeeEvent implements StructClass {
161
+ export type ProtocolFeeEventReified = Reified<ProtocolFeeEvent, ProtocolFeeEventFields>;
162
+ export declare class ProtocolFeeEvent implements StructClass {
351
163
  __StructClass: true;
352
164
  static readonly $typeName: string;
353
165
  static readonly $numTypeParams = 0;
354
166
  static readonly $isPhantom: readonly [];
355
167
  readonly $typeName: string;
356
- readonly $fullTypeName: `${typeof PKG_V1}::admin::SendFeeEvent`;
168
+ readonly $fullTypeName: `${typeof PKG_V1}::admin::ProtocolFeeEvent`;
357
169
  readonly $typeArgs: [];
358
170
  readonly $isPhantom: readonly [];
359
171
  readonly token: ToField<TypeName>;
360
172
  readonly amount: ToField<"u64">;
361
173
  private constructor();
362
- static reified(): SendFeeEventReified;
363
- static get r(): reified.StructClassReified<SendFeeEvent, SendFeeEventFields>;
364
- static phantom(): PhantomReified<ToTypeStr<SendFeeEvent>>;
365
- static get p(): reified.PhantomReified<"0x7ea60df3452d1cec0064d3380cb6f2a9309dcf7ac1b51529de71ef427688b1c3::admin::SendFeeEvent" | "0x21a3b745eaeee0ec0cbc3207230185013d1d8939f7a920aa61f5fea7d09db600::admin::SendFeeEvent">;
174
+ static reified(): ProtocolFeeEventReified;
175
+ static get r(): reified.StructClassReified<ProtocolFeeEvent, ProtocolFeeEventFields>;
176
+ static phantom(): PhantomReified<ToTypeStr<ProtocolFeeEvent>>;
177
+ static get p(): reified.PhantomReified<"0x7ea60df3452d1cec0064d3380cb6f2a9309dcf7ac1b51529de71ef427688b1c3::admin::ProtocolFeeEvent" | "0x21a3b745eaeee0ec0cbc3207230185013d1d8939f7a920aa61f5fea7d09db600::admin::ProtocolFeeEvent">;
366
178
  static get bcs(): import("@mysten/sui/bcs").BcsType<{
367
179
  token: {
368
180
  name: {
@@ -380,9 +192,9 @@ export declare class SendFeeEvent implements StructClass {
380
192
  };
381
193
  amount: string | number | bigint;
382
194
  }>;
383
- static fromFields(fields: Record<string, any>): SendFeeEvent;
384
- static fromFieldsWithTypes(item: FieldsWithTypes): SendFeeEvent;
385
- static fromBcs(data: Uint8Array): SendFeeEvent;
195
+ static fromFields(fields: Record<string, any>): ProtocolFeeEvent;
196
+ static fromFieldsWithTypes(item: FieldsWithTypes): ProtocolFeeEvent;
197
+ static fromBcs(data: Uint8Array): ProtocolFeeEvent;
386
198
  toJSONField(): {
387
199
  token: {
388
200
  name: string;
@@ -397,34 +209,34 @@ export declare class SendFeeEvent implements StructClass {
397
209
  $typeName: string;
398
210
  $typeArgs: [];
399
211
  };
400
- static fromJSONField(field: any): SendFeeEvent;
401
- static fromJSON(json: Record<string, any>): SendFeeEvent;
402
- static fromSuiParsedData(content: SuiParsedData): SendFeeEvent;
403
- static fromSuiObjectData(data: SuiObjectData): SendFeeEvent;
404
- static fetch(client: SuiClient, id: string): Promise<SendFeeEvent>;
212
+ static fromJSONField(field: any): ProtocolFeeEvent;
213
+ static fromJSON(json: Record<string, any>): ProtocolFeeEvent;
214
+ static fromSuiParsedData(content: SuiParsedData): ProtocolFeeEvent;
215
+ static fromSuiObjectData(data: SuiObjectData): ProtocolFeeEvent;
216
+ static fetch(client: SuiClient, id: string): Promise<ProtocolFeeEvent>;
405
217
  }
406
- export declare function isProtocolFeeEvent(type: string): boolean;
407
- export interface ProtocolFeeEventFields {
218
+ export declare function isSendFeeEvent(type: string): boolean;
219
+ export interface SendFeeEventFields {
408
220
  token: ToField<TypeName>;
409
221
  amount: ToField<"u64">;
410
222
  }
411
- export type ProtocolFeeEventReified = Reified<ProtocolFeeEvent, ProtocolFeeEventFields>;
412
- export declare class ProtocolFeeEvent implements StructClass {
223
+ export type SendFeeEventReified = Reified<SendFeeEvent, SendFeeEventFields>;
224
+ export declare class SendFeeEvent implements StructClass {
413
225
  __StructClass: true;
414
226
  static readonly $typeName: string;
415
227
  static readonly $numTypeParams = 0;
416
228
  static readonly $isPhantom: readonly [];
417
229
  readonly $typeName: string;
418
- readonly $fullTypeName: `${typeof PKG_V1}::admin::ProtocolFeeEvent`;
230
+ readonly $fullTypeName: `${typeof PKG_V1}::admin::SendFeeEvent`;
419
231
  readonly $typeArgs: [];
420
232
  readonly $isPhantom: readonly [];
421
233
  readonly token: ToField<TypeName>;
422
234
  readonly amount: ToField<"u64">;
423
235
  private constructor();
424
- static reified(): ProtocolFeeEventReified;
425
- static get r(): reified.StructClassReified<ProtocolFeeEvent, ProtocolFeeEventFields>;
426
- static phantom(): PhantomReified<ToTypeStr<ProtocolFeeEvent>>;
427
- static get p(): reified.PhantomReified<"0x7ea60df3452d1cec0064d3380cb6f2a9309dcf7ac1b51529de71ef427688b1c3::admin::ProtocolFeeEvent" | "0x21a3b745eaeee0ec0cbc3207230185013d1d8939f7a920aa61f5fea7d09db600::admin::ProtocolFeeEvent">;
236
+ static reified(): SendFeeEventReified;
237
+ static get r(): reified.StructClassReified<SendFeeEvent, SendFeeEventFields>;
238
+ static phantom(): PhantomReified<ToTypeStr<SendFeeEvent>>;
239
+ static get p(): reified.PhantomReified<"0x7ea60df3452d1cec0064d3380cb6f2a9309dcf7ac1b51529de71ef427688b1c3::admin::SendFeeEvent" | "0x21a3b745eaeee0ec0cbc3207230185013d1d8939f7a920aa61f5fea7d09db600::admin::SendFeeEvent">;
428
240
  static get bcs(): import("@mysten/sui/bcs").BcsType<{
429
241
  token: {
430
242
  name: {
@@ -442,9 +254,9 @@ export declare class ProtocolFeeEvent implements StructClass {
442
254
  };
443
255
  amount: string | number | bigint;
444
256
  }>;
445
- static fromFields(fields: Record<string, any>): ProtocolFeeEvent;
446
- static fromFieldsWithTypes(item: FieldsWithTypes): ProtocolFeeEvent;
447
- static fromBcs(data: Uint8Array): ProtocolFeeEvent;
257
+ static fromFields(fields: Record<string, any>): SendFeeEvent;
258
+ static fromFieldsWithTypes(item: FieldsWithTypes): SendFeeEvent;
259
+ static fromBcs(data: Uint8Array): SendFeeEvent;
448
260
  toJSONField(): {
449
261
  token: {
450
262
  name: string;
@@ -459,9 +271,197 @@ export declare class ProtocolFeeEvent implements StructClass {
459
271
  $typeName: string;
460
272
  $typeArgs: [];
461
273
  };
462
- static fromJSONField(field: any): ProtocolFeeEvent;
463
- static fromJSON(json: Record<string, any>): ProtocolFeeEvent;
464
- static fromSuiParsedData(content: SuiParsedData): ProtocolFeeEvent;
465
- static fromSuiObjectData(data: SuiObjectData): ProtocolFeeEvent;
466
- static fetch(client: SuiClient, id: string): Promise<ProtocolFeeEvent>;
274
+ static fromJSONField(field: any): SendFeeEvent;
275
+ static fromJSON(json: Record<string, any>): SendFeeEvent;
276
+ static fromSuiParsedData(content: SuiParsedData): SendFeeEvent;
277
+ static fromSuiObjectData(data: SuiObjectData): SendFeeEvent;
278
+ static fetch(client: SuiClient, id: string): Promise<SendFeeEvent>;
279
+ }
280
+ export declare function isVersion(type: string): boolean;
281
+ export interface VersionFields {
282
+ id: ToField<UID>;
283
+ value: ToField<"u64">;
284
+ feePool: ToField<FeePool>;
285
+ liquidatorFeePool: ToField<FeePool>;
286
+ authority: ToField<VecSet<"address">>;
287
+ u64Padding: ToField<Vector<"u64">>;
288
+ }
289
+ export type VersionReified = Reified<Version, VersionFields>;
290
+ export declare class Version implements StructClass {
291
+ __StructClass: true;
292
+ static readonly $typeName: string;
293
+ static readonly $numTypeParams = 0;
294
+ static readonly $isPhantom: readonly [];
295
+ readonly $typeName: string;
296
+ readonly $fullTypeName: `${typeof PKG_V1}::admin::Version`;
297
+ readonly $typeArgs: [];
298
+ readonly $isPhantom: readonly [];
299
+ readonly id: ToField<UID>;
300
+ readonly value: ToField<"u64">;
301
+ readonly feePool: ToField<FeePool>;
302
+ readonly liquidatorFeePool: ToField<FeePool>;
303
+ readonly authority: ToField<VecSet<"address">>;
304
+ readonly u64Padding: ToField<Vector<"u64">>;
305
+ private constructor();
306
+ static reified(): VersionReified;
307
+ static get r(): reified.StructClassReified<Version, VersionFields>;
308
+ static phantom(): PhantomReified<ToTypeStr<Version>>;
309
+ static get p(): reified.PhantomReified<"0x7ea60df3452d1cec0064d3380cb6f2a9309dcf7ac1b51529de71ef427688b1c3::admin::Version" | "0x21a3b745eaeee0ec0cbc3207230185013d1d8939f7a920aa61f5fea7d09db600::admin::Version">;
310
+ static get bcs(): import("@mysten/sui/bcs").BcsType<{
311
+ id: {
312
+ id: {
313
+ bytes: string;
314
+ };
315
+ };
316
+ value: string;
317
+ fee_pool: {
318
+ id: {
319
+ id: {
320
+ bytes: string;
321
+ };
322
+ };
323
+ fee_infos: {
324
+ token: {
325
+ name: {
326
+ bytes: number[];
327
+ };
328
+ };
329
+ value: string;
330
+ }[];
331
+ };
332
+ liquidator_fee_pool: {
333
+ id: {
334
+ id: {
335
+ bytes: string;
336
+ };
337
+ };
338
+ fee_infos: {
339
+ token: {
340
+ name: {
341
+ bytes: number[];
342
+ };
343
+ };
344
+ value: string;
345
+ }[];
346
+ };
347
+ authority: {
348
+ contents: any[];
349
+ };
350
+ u64_padding: string[];
351
+ }, {
352
+ id: {
353
+ id: {
354
+ bytes: string;
355
+ };
356
+ };
357
+ value: string | number | bigint;
358
+ fee_pool: {
359
+ id: {
360
+ id: {
361
+ bytes: string;
362
+ };
363
+ };
364
+ fee_infos: Iterable<{
365
+ token: {
366
+ name: {
367
+ bytes: Iterable<number> & {
368
+ length: number;
369
+ };
370
+ };
371
+ };
372
+ value: string | number | bigint;
373
+ }> & {
374
+ length: number;
375
+ };
376
+ };
377
+ liquidator_fee_pool: {
378
+ id: {
379
+ id: {
380
+ bytes: string;
381
+ };
382
+ };
383
+ fee_infos: Iterable<{
384
+ token: {
385
+ name: {
386
+ bytes: Iterable<number> & {
387
+ length: number;
388
+ };
389
+ };
390
+ };
391
+ value: string | number | bigint;
392
+ }> & {
393
+ length: number;
394
+ };
395
+ };
396
+ authority: {
397
+ contents: Iterable<any> & {
398
+ length: number;
399
+ };
400
+ };
401
+ u64_padding: Iterable<string | number | bigint> & {
402
+ length: number;
403
+ };
404
+ }>;
405
+ static fromFields(fields: Record<string, any>): Version;
406
+ static fromFieldsWithTypes(item: FieldsWithTypes): Version;
407
+ static fromBcs(data: Uint8Array): Version;
408
+ toJSONField(): {
409
+ id: string;
410
+ value: string;
411
+ feePool: {
412
+ id: string;
413
+ feeInfos: {
414
+ token: {
415
+ name: string;
416
+ };
417
+ value: string;
418
+ }[];
419
+ };
420
+ liquidatorFeePool: {
421
+ id: string;
422
+ feeInfos: {
423
+ token: {
424
+ name: string;
425
+ };
426
+ value: string;
427
+ }[];
428
+ };
429
+ authority: {
430
+ contents: string[];
431
+ };
432
+ u64Padding: string[];
433
+ };
434
+ toJSON(): {
435
+ id: string;
436
+ value: string;
437
+ feePool: {
438
+ id: string;
439
+ feeInfos: {
440
+ token: {
441
+ name: string;
442
+ };
443
+ value: string;
444
+ }[];
445
+ };
446
+ liquidatorFeePool: {
447
+ id: string;
448
+ feeInfos: {
449
+ token: {
450
+ name: string;
451
+ };
452
+ value: string;
453
+ }[];
454
+ };
455
+ authority: {
456
+ contents: string[];
457
+ };
458
+ u64Padding: string[];
459
+ $typeName: string;
460
+ $typeArgs: [];
461
+ };
462
+ static fromJSONField(field: any): Version;
463
+ static fromJSON(json: Record<string, any>): Version;
464
+ static fromSuiParsedData(content: SuiParsedData): Version;
465
+ static fromSuiObjectData(data: SuiObjectData): Version;
466
+ static fetch(client: SuiClient, id: string): Promise<Version>;
467
467
  }