@typus/typus-perp-sdk 1.1.53 → 1.2.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.
Files changed (76) hide show
  1. package/dist/src/api/sentio.js +2 -2
  2. package/dist/src/client.d.ts +13 -12
  3. package/dist/src/client.js +24 -49
  4. package/dist/src/fetch.d.ts +15 -61
  5. package/dist/src/fetch.js +63 -163
  6. package/dist/src/generated/typus_perp/admin.d.ts +32 -42
  7. package/dist/src/generated/typus_perp/admin.js +41 -67
  8. package/dist/src/generated/typus_perp/competition.d.ts +22 -10
  9. package/dist/src/generated/typus_perp/competition.js +19 -54
  10. package/dist/src/generated/typus_perp/deps/std/type_name.d.ts +2 -2
  11. package/dist/src/generated/typus_perp/deps/std/type_name.js +2 -2
  12. package/dist/src/generated/typus_perp/deps/sui/balance.d.ts +3 -3
  13. package/dist/src/generated/typus_perp/deps/sui/balance.js +3 -3
  14. package/dist/src/generated/typus_perp/deps/sui/object_table.d.ts +4 -6
  15. package/dist/src/generated/typus_perp/deps/sui/object_table.js +4 -38
  16. package/dist/src/generated/typus_perp/deps/sui/table.d.ts +4 -6
  17. package/dist/src/generated/typus_perp/deps/sui/table.js +4 -38
  18. package/dist/src/generated/typus_perp/deps/sui/vec_set.d.ts +2 -2
  19. package/dist/src/generated/typus_perp/deps/sui/vec_set.js +2 -2
  20. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.d.ts +7 -9
  21. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.js +6 -6
  22. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.d.ts +6 -10
  23. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.js +5 -39
  24. package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +14 -8
  25. package/dist/src/generated/typus_perp/deps/typus_framework/vault.js +13 -39
  26. package/dist/src/generated/typus_perp/error.d.ts +97 -87
  27. package/dist/src/generated/typus_perp/error.js +18 -0
  28. package/dist/src/generated/typus_perp/escrow.d.ts +17 -21
  29. package/dist/src/generated/typus_perp/escrow.js +10 -22
  30. package/dist/src/generated/typus_perp/lending.d.ts +47 -0
  31. package/dist/src/generated/typus_perp/lending.js +40 -0
  32. package/dist/src/generated/typus_perp/lp_pool.d.ts +718 -397
  33. package/dist/src/generated/typus_perp/lp_pool.js +485 -365
  34. package/dist/src/generated/typus_perp/math.d.ts +18 -8
  35. package/dist/src/generated/typus_perp/math.js +24 -6
  36. package/dist/src/generated/typus_perp/position.d.ts +207 -185
  37. package/dist/src/generated/typus_perp/position.js +236 -277
  38. package/dist/src/generated/typus_perp/profit_vault.d.ts +64 -72
  39. package/dist/src/generated/typus_perp/profit_vault.js +48 -86
  40. package/dist/src/generated/typus_perp/symbol.d.ts +6 -6
  41. package/dist/src/generated/typus_perp/symbol.js +11 -13
  42. package/dist/src/generated/typus_perp/trading.d.ts +451 -558
  43. package/dist/src/generated/typus_perp/trading.js +429 -681
  44. package/dist/src/generated/typus_perp/treasury_caps.d.ts +5 -7
  45. package/dist/src/generated/typus_perp/treasury_caps.js +8 -45
  46. package/dist/src/generated/typus_stake_pool/admin.d.ts +13 -122
  47. package/dist/src/generated/typus_stake_pool/admin.js +19 -103
  48. package/dist/src/generated/typus_stake_pool/deps/std/type_name.d.ts +2 -2
  49. package/dist/src/generated/typus_stake_pool/deps/std/type_name.js +2 -2
  50. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.d.ts +2 -2
  51. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.js +2 -2
  52. package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +249 -240
  53. package/dist/src/generated/typus_stake_pool/stake_pool.js +159 -246
  54. package/dist/src/generated/utils/index.d.ts +21 -2
  55. package/dist/src/generated/utils/index.js +34 -10
  56. package/dist/src/index.js +4 -4
  57. package/dist/src/user/history.js +39 -23
  58. package/dist/src/user/order.d.ts +1 -1
  59. package/dist/src/user/orderWithBidReceipt.d.ts +1 -1
  60. package/package.json +8 -14
  61. package/dist/src/generated/typus_perp/deps/sui/object.d.ts +0 -8
  62. package/dist/src/generated/typus_perp/deps/sui/object.js +0 -16
  63. package/dist/src/generated/typus_perp/user_account.d.ts +0 -146
  64. package/dist/src/generated/typus_perp/user_account.js +0 -221
  65. package/dist/src/generated/typus_stake_pool/deps/sui/object.d.ts +0 -8
  66. package/dist/src/generated/typus_stake_pool/deps/sui/object.js +0 -16
  67. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.d.ts +0 -30
  68. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.js +0 -37
  69. package/dist/src/grpc/graphql.d.ts +0 -26
  70. package/dist/src/grpc/graphql.js +0 -126
  71. package/dist/src/grpc/grpc.d.ts +0 -1
  72. package/dist/src/grpc/grpc.js +0 -38
  73. package/dist/src/grpc/ledgerService.d.ts +0 -0
  74. package/dist/src/grpc/ledgerService.js +0 -64
  75. package/dist/src/grpc/liveDataService.d.ts +0 -0
  76. package/dist/src/grpc/liveDataService.js +0 -49
@@ -6,7 +6,7 @@
6
6
  * Perpetual Protocol.
7
7
  */
8
8
  import { type Transaction } from "@mysten/sui/transactions";
9
- import { type RawTransactionArgument } from "../utils/index";
9
+ import { type RawTransactionArgument } from "../utils/index.js";
10
10
  export interface SetU64VectorValueArguments {
11
11
  u64Vector: RawTransactionArgument<number | bigint[]>;
12
12
  i: RawTransactionArgument<number | bigint>;
@@ -24,7 +24,7 @@ export interface SetU64VectorValueOptions {
24
24
  * Sets a value in a `vector<u64>` at a specific index. It will extend the vector
25
25
  * with zeros if the index is out of bounds.
26
26
  */
27
- export declare function setU64VectorValue(options: SetU64VectorValueOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
27
+ export declare function setU64VectorValue(options: SetU64VectorValueOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
28
28
  export interface GetU64VectorValueArguments {
29
29
  u64Vector: RawTransactionArgument<number | bigint[]>;
30
30
  i: RawTransactionArgument<number | bigint>;
@@ -37,7 +37,7 @@ export interface GetU64VectorValueOptions {
37
37
  * Gets a value from a `vector<u64>` at a specific index. It will return 0 if the
38
38
  * index is out of bounds.
39
39
  */
40
- export declare function getU64VectorValue(options: GetU64VectorValueOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
40
+ export declare function getU64VectorValue(options: GetU64VectorValueOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
41
41
  export interface MultiplierArguments {
42
42
  decimal: RawTransactionArgument<number | bigint>;
43
43
  }
@@ -46,7 +46,7 @@ export interface MultiplierOptions {
46
46
  arguments: MultiplierArguments | [decimal: RawTransactionArgument<number | bigint>];
47
47
  }
48
48
  /** Calculates a multiplier for a given number of decimals. */
49
- export declare function multiplier(options: MultiplierOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
49
+ export declare function multiplier(options: MultiplierOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
50
50
  export interface AmountToUsdArguments {
51
51
  amount: RawTransactionArgument<number | bigint>;
52
52
  amountDecimal: RawTransactionArgument<number | bigint>;
@@ -63,7 +63,7 @@ export interface AmountToUsdOptions {
63
63
  ];
64
64
  }
65
65
  /** Converts an amount of a token to USD. */
66
- export declare function amountToUsd(options: AmountToUsdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
66
+ export declare function amountToUsd(options: AmountToUsdOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
67
67
  export interface UsdToAmountArguments {
68
68
  usd: RawTransactionArgument<number | bigint>;
69
69
  amountDecimal: RawTransactionArgument<number | bigint>;
@@ -80,16 +80,26 @@ export interface UsdToAmountOptions {
80
80
  ];
81
81
  }
82
82
  /** Converts an amount of USD to a token. */
83
- export declare function usdToAmount(options: UsdToAmountOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
83
+ export declare function usdToAmount(options: UsdToAmountOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
84
84
  export interface GetUsdDecimalOptions {
85
85
  package?: string;
86
86
  arguments?: [];
87
87
  }
88
88
  /** Returns the number of decimals for USD. */
89
- export declare function getUsdDecimal(options?: GetUsdDecimalOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
89
+ export declare function getUsdDecimal(options?: GetUsdDecimalOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
90
90
  export interface GetFundingRateDecimalOptions {
91
91
  package?: string;
92
92
  arguments?: [];
93
93
  }
94
94
  /** Returns the number of decimals for the funding rate. */
95
- export declare function getFundingRateDecimal(options?: GetFundingRateDecimalOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
95
+ export declare function getFundingRateDecimal(options?: GetFundingRateDecimalOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
96
+ export interface GetMbpScaleOptions {
97
+ package?: string;
98
+ arguments?: [];
99
+ }
100
+ export declare function getMbpScale(options?: GetMbpScaleOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
101
+ export interface GetBpScaleOptions {
102
+ package?: string;
103
+ arguments?: [];
104
+ }
105
+ export declare function getBpScale(options?: GetBpScaleOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
@@ -10,7 +10,9 @@ exports.amountToUsd = amountToUsd;
10
10
  exports.usdToAmount = usdToAmount;
11
11
  exports.getUsdDecimal = getUsdDecimal;
12
12
  exports.getFundingRateDecimal = getFundingRateDecimal;
13
- const index_1 = require("../utils/index");
13
+ exports.getMbpScale = getMbpScale;
14
+ exports.getBpScale = getBpScale;
15
+ const index_js_1 = require("../utils/index.js");
14
16
  /**
15
17
  * Sets a value in a `vector<u64>` at a specific index. It will extend the vector
16
18
  * with zeros if the index is out of bounds.
@@ -23,7 +25,7 @@ function setU64VectorValue(options) {
23
25
  package: packageAddress,
24
26
  module: "math",
25
27
  function: "set_u64_vector_value",
26
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
28
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
27
29
  });
28
30
  }
29
31
  /**
@@ -38,7 +40,7 @@ function getU64VectorValue(options) {
38
40
  package: packageAddress,
39
41
  module: "math",
40
42
  function: "get_u64_vector_value",
41
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
43
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
42
44
  });
43
45
  }
44
46
  /** Calculates a multiplier for a given number of decimals. */
@@ -50,7 +52,7 @@ function multiplier(options) {
50
52
  package: packageAddress,
51
53
  module: "math",
52
54
  function: "multiplier",
53
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
55
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
54
56
  });
55
57
  }
56
58
  /** Converts an amount of a token to USD. */
@@ -62,7 +64,7 @@ function amountToUsd(options) {
62
64
  package: packageAddress,
63
65
  module: "math",
64
66
  function: "amount_to_usd",
65
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
67
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
66
68
  });
67
69
  }
68
70
  /** Converts an amount of USD to a token. */
@@ -74,7 +76,7 @@ function usdToAmount(options) {
74
76
  package: packageAddress,
75
77
  module: "math",
76
78
  function: "usd_to_amount",
77
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
79
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
78
80
  });
79
81
  }
80
82
  /** Returns the number of decimals for USD. */
@@ -95,3 +97,19 @@ function getFundingRateDecimal(options = {}) {
95
97
  function: "get_funding_rate_decimal",
96
98
  });
97
99
  }
100
+ function getMbpScale(options = {}) {
101
+ const packageAddress = options.package ?? "@typus/perp";
102
+ return (tx) => tx.moveCall({
103
+ package: packageAddress,
104
+ module: "math",
105
+ function: "get_mbp_scale",
106
+ });
107
+ }
108
+ function getBpScale(options = {}) {
109
+ const packageAddress = options.package ?? "@typus/perp";
110
+ return (tx) => tx.moveCall({
111
+ package: packageAddress,
112
+ module: "math",
113
+ function: "get_bp_scale",
114
+ });
115
+ }