@typus/typus-perp-sdk 1.0.2 → 1.0.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.
@@ -28,7 +28,7 @@ export declare class PythPrice implements StructClass {
28
28
  static reified(): PythPriceReified;
29
29
  static get r(): import("../../_framework/reified").StructClassReified<PythPrice, PythPriceFields>;
30
30
  static phantom(): PhantomReified<ToTypeStr<PythPrice>>;
31
- static get p(): PhantomReified<"::oracle::PythPrice" | "0xac3919fd321e4c397a5c17d0cc01ed150a5e0f7d8c0f2b728fde3f5d719a2f0e::oracle::PythPrice">;
31
+ static get p(): PhantomReified<"::oracle::PythPrice" | "0x7c19f81d9d411e78305d7af8dad25317c56bb449fede8a78b6021232478f0509::oracle::PythPrice">;
32
32
  static get bcs(): import("@mysten/sui/bcs").BcsType<{
33
33
  price: string;
34
34
  conf: string;
@@ -82,7 +82,7 @@ export declare class PythPriceInfoObject implements StructClass {
82
82
  static reified(): PythPriceInfoObjectReified;
83
83
  static get r(): import("../../_framework/reified").StructClassReified<PythPriceInfoObject, PythPriceInfoObjectFields>;
84
84
  static phantom(): PhantomReified<ToTypeStr<PythPriceInfoObject>>;
85
- static get p(): PhantomReified<"::oracle::PythPriceInfoObject" | "0xac3919fd321e4c397a5c17d0cc01ed150a5e0f7d8c0f2b728fde3f5d719a2f0e::oracle::PythPriceInfoObject">;
85
+ static get p(): PhantomReified<"::oracle::PythPriceInfoObject" | "0x7c19f81d9d411e78305d7af8dad25317c56bb449fede8a78b6021232478f0509::oracle::PythPriceInfoObject">;
86
86
  static get bcs(): import("@mysten/sui/bcs").BcsType<{
87
87
  id: {
88
88
  bytes: string;
@@ -167,6 +167,7 @@ export interface EmitRealizedFundingEventArgs {
167
167
  positionId: bigint | TransactionArgument;
168
168
  realizedFundingSign: boolean | TransactionArgument;
169
169
  realizedFundingFee: bigint | TransactionArgument;
170
+ realizedFundingFeeUsd: bigint | TransactionArgument;
170
171
  u64Padding: Array<bigint | TransactionArgument> | TransactionArgument;
171
172
  }
172
173
  export declare function emitRealizedFundingEvent(tx: Transaction, args: EmitRealizedFundingEventArgs): import("@mysten/sui/transactions").TransactionResult;
@@ -294,6 +295,8 @@ export declare function orderFilledWithBidReceiptsCollateral(tx: Transaction, ty
294
295
  export interface RealizeFundingArgs {
295
296
  position: TransactionObjectInput;
296
297
  fundingIncome: TransactionObjectInput;
298
+ collateralOraclePrice: bigint | TransactionArgument;
299
+ collateralOraclePriceDecimal: bigint | TransactionArgument;
297
300
  }
298
301
  export declare function realizeFunding(tx: Transaction, typeArg: string, args: RealizeFundingArgs): import("@mysten/sui/transactions").TransactionResult;
299
302
  export interface ReleaseCollateralArgs {
@@ -293,6 +293,7 @@ function emitRealizedFundingEvent(tx, args) {
293
293
  (0, util_1.pure)(tx, args.positionId, "u64"),
294
294
  (0, util_1.pure)(tx, args.realizedFundingSign, "bool"),
295
295
  (0, util_1.pure)(tx, args.realizedFundingFee, "u64"),
296
+ (0, util_1.pure)(tx, args.realizedFundingFeeUsd, "u64"),
296
297
  (0, util_1.pure)(tx, args.u64Padding, "vector<u64>"),
297
298
  ],
298
299
  });
@@ -517,7 +518,12 @@ function realizeFunding(tx, typeArg, args) {
517
518
  return tx.moveCall({
518
519
  target: "".concat(__1.PUBLISHED_AT, "::position::realize_funding"),
519
520
  typeArguments: [typeArg],
520
- arguments: [(0, util_1.obj)(tx, args.position), (0, util_1.obj)(tx, args.fundingIncome)],
521
+ arguments: [
522
+ (0, util_1.obj)(tx, args.position),
523
+ (0, util_1.obj)(tx, args.fundingIncome),
524
+ (0, util_1.pure)(tx, args.collateralOraclePrice, "u64"),
525
+ (0, util_1.pure)(tx, args.collateralOraclePriceDecimal, "u64"),
526
+ ],
521
527
  });
522
528
  }
523
529
  function releaseCollateral(tx, typeArg, args) {
@@ -31,7 +31,7 @@ export declare class OptionCollateralInfo implements StructClass {
31
31
  static reified(): OptionCollateralInfoReified;
32
32
  static get r(): reified.StructClassReified<OptionCollateralInfo, OptionCollateralInfoFields>;
33
33
  static phantom(): PhantomReified<ToTypeStr<OptionCollateralInfo>>;
34
- static get p(): reified.PhantomReified<"::position::OptionCollateralInfo" | "0xac3919fd321e4c397a5c17d0cc01ed150a5e0f7d8c0f2b728fde3f5d719a2f0e::position::OptionCollateralInfo">;
34
+ static get p(): reified.PhantomReified<"::position::OptionCollateralInfo" | "0x7c19f81d9d411e78305d7af8dad25317c56bb449fede8a78b6021232478f0509::position::OptionCollateralInfo">;
35
35
  static get bcs(): import("@mysten/sui/bcs").BcsType<{
36
36
  index: string;
37
37
  bid_token: {
@@ -96,6 +96,8 @@ export interface OrderFilledEventFields {
96
96
  realizedTradingFee: ToField<"u64">;
97
97
  realizedBorrowFee: ToField<"u64">;
98
98
  realizedFeeInUsd: ToField<"u64">;
99
+ realizedAmount: ToField<"u64">;
100
+ realizedAmountSign: ToField<"bool">;
99
101
  u64Padding: ToField<Vector<"u64">>;
100
102
  }
101
103
  export type OrderFilledEventReified = Reified<OrderFilledEvent, OrderFilledEventFields>;
@@ -122,12 +124,14 @@ export declare class OrderFilledEvent implements StructClass {
122
124
  readonly realizedTradingFee: ToField<"u64">;
123
125
  readonly realizedBorrowFee: ToField<"u64">;
124
126
  readonly realizedFeeInUsd: ToField<"u64">;
127
+ readonly realizedAmount: ToField<"u64">;
128
+ readonly realizedAmountSign: ToField<"bool">;
125
129
  readonly u64Padding: ToField<Vector<"u64">>;
126
130
  private constructor();
127
131
  static reified(): OrderFilledEventReified;
128
132
  static get r(): reified.StructClassReified<OrderFilledEvent, OrderFilledEventFields>;
129
133
  static phantom(): PhantomReified<ToTypeStr<OrderFilledEvent>>;
130
- static get p(): reified.PhantomReified<"::position::OrderFilledEvent" | "0xac3919fd321e4c397a5c17d0cc01ed150a5e0f7d8c0f2b728fde3f5d719a2f0e::position::OrderFilledEvent">;
134
+ static get p(): reified.PhantomReified<"::position::OrderFilledEvent" | "0x7c19f81d9d411e78305d7af8dad25317c56bb449fede8a78b6021232478f0509::position::OrderFilledEvent">;
131
135
  static get bcs(): import("@mysten/sui/bcs").BcsType<{
132
136
  user: string;
133
137
  collateral_token: {
@@ -162,6 +166,8 @@ export declare class OrderFilledEvent implements StructClass {
162
166
  realized_trading_fee: string;
163
167
  realized_borrow_fee: string;
164
168
  realized_fee_in_usd: string;
169
+ realized_amount: string;
170
+ realized_amount_sign: boolean;
165
171
  u64_padding: string[];
166
172
  }, {
167
173
  user: string;
@@ -207,6 +213,8 @@ export declare class OrderFilledEvent implements StructClass {
207
213
  realized_trading_fee: string | number | bigint;
208
214
  realized_borrow_fee: string | number | bigint;
209
215
  realized_fee_in_usd: string | number | bigint;
216
+ realized_amount: string | number | bigint;
217
+ realized_amount_sign: boolean;
210
218
  u64_padding: Iterable<string | number | bigint> & {
211
219
  length: number;
212
220
  };
@@ -238,6 +246,8 @@ export declare class OrderFilledEvent implements StructClass {
238
246
  realizedTradingFee: string;
239
247
  realizedBorrowFee: string;
240
248
  realizedFeeInUsd: string;
249
+ realizedAmount: string;
250
+ realizedAmountSign: boolean;
241
251
  u64Padding: string[];
242
252
  };
243
253
  toJSON(): {
@@ -264,6 +274,8 @@ export declare class OrderFilledEvent implements StructClass {
264
274
  realizedTradingFee: string;
265
275
  realizedBorrowFee: string;
266
276
  realizedFeeInUsd: string;
277
+ realizedAmount: string;
278
+ realizedAmountSign: boolean;
267
279
  u64Padding: string[];
268
280
  $typeName: string;
269
281
  $typeArgs: [];
@@ -343,7 +355,7 @@ export declare class Position implements StructClass {
343
355
  static reified(): PositionReified;
344
356
  static get r(): reified.StructClassReified<Position, PositionFields>;
345
357
  static phantom(): PhantomReified<ToTypeStr<Position>>;
346
- static get p(): reified.PhantomReified<"::position::Position" | "0xac3919fd321e4c397a5c17d0cc01ed150a5e0f7d8c0f2b728fde3f5d719a2f0e::position::Position">;
358
+ static get p(): reified.PhantomReified<"::position::Position" | "0x7c19f81d9d411e78305d7af8dad25317c56bb449fede8a78b6021232478f0509::position::Position">;
347
359
  static get bcs(): import("@mysten/sui/bcs").BcsType<{
348
360
  id: {
349
361
  id: {
@@ -560,6 +572,7 @@ export interface RealizeFundingEventFields {
560
572
  positionId: ToField<"u64">;
561
573
  realizedFundingSign: ToField<"bool">;
562
574
  realizedFundingFee: ToField<"u64">;
575
+ realizedFundingFeeUsd: ToField<"u64">;
563
576
  u64Padding: ToField<Vector<"u64">>;
564
577
  }
565
578
  export type RealizeFundingEventReified = Reified<RealizeFundingEvent, RealizeFundingEventFields>;
@@ -578,12 +591,13 @@ export declare class RealizeFundingEvent implements StructClass {
578
591
  readonly positionId: ToField<"u64">;
579
592
  readonly realizedFundingSign: ToField<"bool">;
580
593
  readonly realizedFundingFee: ToField<"u64">;
594
+ readonly realizedFundingFeeUsd: ToField<"u64">;
581
595
  readonly u64Padding: ToField<Vector<"u64">>;
582
596
  private constructor();
583
597
  static reified(): RealizeFundingEventReified;
584
598
  static get r(): reified.StructClassReified<RealizeFundingEvent, RealizeFundingEventFields>;
585
599
  static phantom(): PhantomReified<ToTypeStr<RealizeFundingEvent>>;
586
- static get p(): reified.PhantomReified<"::position::RealizeFundingEvent" | "0xac3919fd321e4c397a5c17d0cc01ed150a5e0f7d8c0f2b728fde3f5d719a2f0e::position::RealizeFundingEvent">;
600
+ static get p(): reified.PhantomReified<"::position::RealizeFundingEvent" | "0x7c19f81d9d411e78305d7af8dad25317c56bb449fede8a78b6021232478f0509::position::RealizeFundingEvent">;
587
601
  static get bcs(): import("@mysten/sui/bcs").BcsType<{
588
602
  user: string;
589
603
  collateral_token: {
@@ -606,6 +620,7 @@ export declare class RealizeFundingEvent implements StructClass {
606
620
  position_id: string;
607
621
  realized_funding_sign: boolean;
608
622
  realized_funding_fee: string;
623
+ realized_funding_fee_usd: string;
609
624
  u64_padding: string[];
610
625
  }, {
611
626
  user: string;
@@ -635,6 +650,7 @@ export declare class RealizeFundingEvent implements StructClass {
635
650
  position_id: string | number | bigint;
636
651
  realized_funding_sign: boolean;
637
652
  realized_funding_fee: string | number | bigint;
653
+ realized_funding_fee_usd: string | number | bigint;
638
654
  u64_padding: Iterable<string | number | bigint> & {
639
655
  length: number;
640
656
  };
@@ -658,6 +674,7 @@ export declare class RealizeFundingEvent implements StructClass {
658
674
  positionId: string;
659
675
  realizedFundingSign: boolean;
660
676
  realizedFundingFee: string;
677
+ realizedFundingFeeUsd: string;
661
678
  u64Padding: string[];
662
679
  };
663
680
  toJSON(): {
@@ -676,6 +693,7 @@ export declare class RealizeFundingEvent implements StructClass {
676
693
  positionId: string;
677
694
  realizedFundingSign: boolean;
678
695
  realizedFundingFee: string;
696
+ realizedFundingFeeUsd: string;
679
697
  u64Padding: string[];
680
698
  $typeName: string;
681
699
  $typeArgs: [];
@@ -686,164 +704,6 @@ export declare class RealizeFundingEvent implements StructClass {
686
704
  static fromSuiObjectData(data: SuiObjectData): RealizeFundingEvent;
687
705
  static fetch(client: SuiClient, id: string): Promise<RealizeFundingEvent>;
688
706
  }
689
- export declare function isRealizedPnlEvent(type: string): boolean;
690
- export interface RealizedPnlEventFields {
691
- user: ToField<"address">;
692
- collateralToken: ToField<TypeName>;
693
- symbol: ToField<Symbol>;
694
- positionId: ToField<"u64">;
695
- positionAverageEntryPrice: ToField<"u64">;
696
- filledPrice: ToField<"u64">;
697
- realizedPnlSign: ToField<"bool">;
698
- realizedPnl: ToField<"u64">;
699
- realizedTradingFee: ToField<"u64">;
700
- realizedBorrowFee: ToField<"u64">;
701
- u64Padding: ToField<Vector<"u64">>;
702
- }
703
- export type RealizedPnlEventReified = Reified<RealizedPnlEvent, RealizedPnlEventFields>;
704
- export declare class RealizedPnlEvent implements StructClass {
705
- __StructClass: true;
706
- static readonly $typeName: string;
707
- static readonly $numTypeParams = 0;
708
- static readonly $isPhantom: readonly [];
709
- readonly $typeName: string;
710
- readonly $fullTypeName: `${typeof PKG_V1}::position::RealizedPnlEvent`;
711
- readonly $typeArgs: [];
712
- readonly $isPhantom: readonly [];
713
- readonly user: ToField<"address">;
714
- readonly collateralToken: ToField<TypeName>;
715
- readonly symbol: ToField<Symbol>;
716
- readonly positionId: ToField<"u64">;
717
- readonly positionAverageEntryPrice: ToField<"u64">;
718
- readonly filledPrice: ToField<"u64">;
719
- readonly realizedPnlSign: ToField<"bool">;
720
- readonly realizedPnl: ToField<"u64">;
721
- readonly realizedTradingFee: ToField<"u64">;
722
- readonly realizedBorrowFee: ToField<"u64">;
723
- readonly u64Padding: ToField<Vector<"u64">>;
724
- private constructor();
725
- static reified(): RealizedPnlEventReified;
726
- static get r(): reified.StructClassReified<RealizedPnlEvent, RealizedPnlEventFields>;
727
- static phantom(): PhantomReified<ToTypeStr<RealizedPnlEvent>>;
728
- static get p(): reified.PhantomReified<"::position::RealizedPnlEvent" | "0xac3919fd321e4c397a5c17d0cc01ed150a5e0f7d8c0f2b728fde3f5d719a2f0e::position::RealizedPnlEvent">;
729
- static get bcs(): import("@mysten/sui/bcs").BcsType<{
730
- user: string;
731
- collateral_token: {
732
- name: {
733
- bytes: number[];
734
- };
735
- };
736
- symbol: {
737
- base_token: {
738
- name: {
739
- bytes: number[];
740
- };
741
- };
742
- quote_token: {
743
- name: {
744
- bytes: number[];
745
- };
746
- };
747
- };
748
- position_id: string;
749
- position_average_entry_price: string;
750
- filled_price: string;
751
- realized_pnl_sign: boolean;
752
- realized_pnl: string;
753
- realized_trading_fee: string;
754
- realized_borrow_fee: string;
755
- u64_padding: string[];
756
- }, {
757
- user: string;
758
- collateral_token: {
759
- name: {
760
- bytes: Iterable<number> & {
761
- length: number;
762
- };
763
- };
764
- };
765
- symbol: {
766
- base_token: {
767
- name: {
768
- bytes: Iterable<number> & {
769
- length: number;
770
- };
771
- };
772
- };
773
- quote_token: {
774
- name: {
775
- bytes: Iterable<number> & {
776
- length: number;
777
- };
778
- };
779
- };
780
- };
781
- position_id: string | number | bigint;
782
- position_average_entry_price: string | number | bigint;
783
- filled_price: string | number | bigint;
784
- realized_pnl_sign: boolean;
785
- realized_pnl: string | number | bigint;
786
- realized_trading_fee: string | number | bigint;
787
- realized_borrow_fee: string | number | bigint;
788
- u64_padding: Iterable<string | number | bigint> & {
789
- length: number;
790
- };
791
- }>;
792
- static fromFields(fields: Record<string, any>): RealizedPnlEvent;
793
- static fromFieldsWithTypes(item: FieldsWithTypes): RealizedPnlEvent;
794
- static fromBcs(data: Uint8Array): RealizedPnlEvent;
795
- toJSONField(): {
796
- user: string;
797
- collateralToken: {
798
- name: string;
799
- };
800
- symbol: {
801
- baseToken: {
802
- name: string;
803
- };
804
- quoteToken: {
805
- name: string;
806
- };
807
- };
808
- positionId: string;
809
- positionAverageEntryPrice: string;
810
- filledPrice: string;
811
- realizedPnlSign: boolean;
812
- realizedPnl: string;
813
- realizedTradingFee: string;
814
- realizedBorrowFee: string;
815
- u64Padding: string[];
816
- };
817
- toJSON(): {
818
- user: string;
819
- collateralToken: {
820
- name: string;
821
- };
822
- symbol: {
823
- baseToken: {
824
- name: string;
825
- };
826
- quoteToken: {
827
- name: string;
828
- };
829
- };
830
- positionId: string;
831
- positionAverageEntryPrice: string;
832
- filledPrice: string;
833
- realizedPnlSign: boolean;
834
- realizedPnl: string;
835
- realizedTradingFee: string;
836
- realizedBorrowFee: string;
837
- u64Padding: string[];
838
- $typeName: string;
839
- $typeArgs: [];
840
- };
841
- static fromJSONField(field: any): RealizedPnlEvent;
842
- static fromJSON(json: Record<string, any>): RealizedPnlEvent;
843
- static fromSuiParsedData(content: SuiParsedData): RealizedPnlEvent;
844
- static fromSuiObjectData(data: SuiObjectData): RealizedPnlEvent;
845
- static fetch(client: SuiClient, id: string): Promise<RealizedPnlEvent>;
846
- }
847
707
  export declare function isRemovePositionEvent(type: string): boolean;
848
708
  export interface RemovePositionEventFields {
849
709
  user: ToField<"address">;
@@ -879,7 +739,7 @@ export declare class RemovePositionEvent implements StructClass {
879
739
  static reified(): RemovePositionEventReified;
880
740
  static get r(): reified.StructClassReified<RemovePositionEvent, RemovePositionEventFields>;
881
741
  static phantom(): PhantomReified<ToTypeStr<RemovePositionEvent>>;
882
- static get p(): reified.PhantomReified<"::position::RemovePositionEvent" | "0xac3919fd321e4c397a5c17d0cc01ed150a5e0f7d8c0f2b728fde3f5d719a2f0e::position::RemovePositionEvent">;
742
+ static get p(): reified.PhantomReified<"::position::RemovePositionEvent" | "0x7c19f81d9d411e78305d7af8dad25317c56bb449fede8a78b6021232478f0509::position::RemovePositionEvent">;
883
743
  static get bcs(): import("@mysten/sui/bcs").BcsType<{
884
744
  user: string;
885
745
  collateral_token: {
@@ -1045,7 +905,7 @@ export declare class TradingOrder implements StructClass {
1045
905
  static reified(): TradingOrderReified;
1046
906
  static get r(): reified.StructClassReified<TradingOrder, TradingOrderFields>;
1047
907
  static phantom(): PhantomReified<ToTypeStr<TradingOrder>>;
1048
- static get p(): reified.PhantomReified<"::position::TradingOrder" | "0xac3919fd321e4c397a5c17d0cc01ed150a5e0f7d8c0f2b728fde3f5d719a2f0e::position::TradingOrder">;
908
+ static get p(): reified.PhantomReified<"::position::TradingOrder" | "0x7c19f81d9d411e78305d7af8dad25317c56bb449fede8a78b6021232478f0509::position::TradingOrder">;
1049
909
  static get bcs(): import("@mysten/sui/bcs").BcsType<{
1050
910
  id: {
1051
911
  id: {