@typus/typus-perp-sdk 1.1.49 → 1.1.51-upgrade

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 (77) hide show
  1. package/dist/src/api/sentio.d.ts +1 -1
  2. package/dist/src/api/sentio.js +3 -3
  3. package/dist/src/client.d.ts +11 -12
  4. package/dist/src/client.js +16 -44
  5. package/dist/src/fetch.d.ts +15 -45
  6. package/dist/src/fetch.js +70 -69
  7. package/dist/src/generated/typus_perp/admin.d.ts +32 -42
  8. package/dist/src/generated/typus_perp/admin.js +41 -67
  9. package/dist/src/generated/typus_perp/competition.d.ts +22 -10
  10. package/dist/src/generated/typus_perp/competition.js +19 -54
  11. package/dist/src/generated/typus_perp/deps/std/type_name.d.ts +2 -2
  12. package/dist/src/generated/typus_perp/deps/std/type_name.js +2 -2
  13. package/dist/src/generated/typus_perp/deps/sui/balance.d.ts +3 -3
  14. package/dist/src/generated/typus_perp/deps/sui/balance.js +3 -3
  15. package/dist/src/generated/typus_perp/deps/sui/object_table.d.ts +4 -6
  16. package/dist/src/generated/typus_perp/deps/sui/object_table.js +4 -38
  17. package/dist/src/generated/typus_perp/deps/sui/table.d.ts +4 -6
  18. package/dist/src/generated/typus_perp/deps/sui/table.js +4 -38
  19. package/dist/src/generated/typus_perp/deps/sui/vec_set.d.ts +2 -2
  20. package/dist/src/generated/typus_perp/deps/sui/vec_set.js +2 -2
  21. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.d.ts +7 -9
  22. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.js +6 -6
  23. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.d.ts +6 -10
  24. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.js +5 -39
  25. package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +14 -8
  26. package/dist/src/generated/typus_perp/deps/typus_framework/vault.js +13 -39
  27. package/dist/src/generated/typus_perp/error.d.ts +97 -87
  28. package/dist/src/generated/typus_perp/error.js +18 -0
  29. package/dist/src/generated/typus_perp/escrow.d.ts +17 -21
  30. package/dist/src/generated/typus_perp/escrow.js +10 -22
  31. package/dist/src/generated/typus_perp/lending.d.ts +47 -0
  32. package/dist/src/generated/typus_perp/lending.js +40 -0
  33. package/dist/src/generated/typus_perp/lp_pool.d.ts +718 -397
  34. package/dist/src/generated/typus_perp/lp_pool.js +485 -365
  35. package/dist/src/generated/typus_perp/math.d.ts +18 -8
  36. package/dist/src/generated/typus_perp/math.js +24 -6
  37. package/dist/src/generated/typus_perp/position.d.ts +207 -185
  38. package/dist/src/generated/typus_perp/position.js +236 -277
  39. package/dist/src/generated/typus_perp/profit_vault.d.ts +64 -72
  40. package/dist/src/generated/typus_perp/profit_vault.js +48 -86
  41. package/dist/src/generated/typus_perp/symbol.d.ts +6 -6
  42. package/dist/src/generated/typus_perp/symbol.js +11 -13
  43. package/dist/src/generated/typus_perp/trading.d.ts +451 -558
  44. package/dist/src/generated/typus_perp/trading.js +429 -681
  45. package/dist/src/generated/typus_perp/treasury_caps.d.ts +5 -7
  46. package/dist/src/generated/typus_perp/treasury_caps.js +8 -45
  47. package/dist/src/generated/typus_stake_pool/admin.d.ts +13 -122
  48. package/dist/src/generated/typus_stake_pool/admin.js +19 -103
  49. package/dist/src/generated/typus_stake_pool/deps/std/type_name.d.ts +2 -2
  50. package/dist/src/generated/typus_stake_pool/deps/std/type_name.js +2 -2
  51. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.d.ts +2 -2
  52. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.js +2 -2
  53. package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +249 -240
  54. package/dist/src/generated/typus_stake_pool/stake_pool.js +159 -246
  55. package/dist/src/generated/utils/index.d.ts +21 -2
  56. package/dist/src/generated/utils/index.js +34 -10
  57. package/dist/src/user/history.d.ts +3 -2
  58. package/dist/src/user/history.js +60 -18
  59. package/dist/src/user/order.d.ts +1 -1
  60. package/dist/src/user/orderWithBidReceipt.d.ts +1 -1
  61. package/package.json +8 -15
  62. package/dist/src/generated/typus_perp/deps/sui/object.d.ts +0 -8
  63. package/dist/src/generated/typus_perp/deps/sui/object.js +0 -16
  64. package/dist/src/generated/typus_perp/user_account.d.ts +0 -146
  65. package/dist/src/generated/typus_perp/user_account.js +0 -221
  66. package/dist/src/generated/typus_stake_pool/deps/sui/object.d.ts +0 -8
  67. package/dist/src/generated/typus_stake_pool/deps/sui/object.js +0 -16
  68. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.d.ts +0 -30
  69. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.js +0 -37
  70. package/dist/src/grpc/graphql.d.ts +0 -26
  71. package/dist/src/grpc/graphql.js +0 -126
  72. package/dist/src/grpc/grpc.d.ts +0 -1
  73. package/dist/src/grpc/grpc.js +0 -38
  74. package/dist/src/grpc/ledgerService.d.ts +0 -0
  75. package/dist/src/grpc/ledgerService.js +0 -64
  76. package/dist/src/grpc/liveDataService.d.ts +0 -0
  77. package/dist/src/grpc/liveDataService.js +0 -49
@@ -6,22 +6,18 @@
6
6
  * creating and destructing it. This is used to handle unsettled bids from
7
7
  * liquidations.
8
8
  */
9
- import { MoveStruct, type RawTransactionArgument } from "../utils/index";
9
+ import { MoveStruct, type RawTransactionArgument } from "../utils/index.js";
10
10
  import { type Transaction } from "@mysten/sui/transactions";
11
11
  export declare const UnsettledBidReceipt: MoveStruct<{
12
12
  /** A vector of `TypusBidReceipt` structs. */
13
- receipt: import("@mysten/sui/bcs").BcsType<{
14
- id: {
15
- id: string;
16
- };
13
+ receipt: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<{
14
+ id: string;
17
15
  vid: string;
18
16
  index: string;
19
17
  metadata: string;
20
18
  u64_padding: string[];
21
19
  }[], Iterable<{
22
- id: {
23
- id: string | Uint8Array<ArrayBufferLike>;
24
- };
20
+ id: string | Uint8Array<ArrayBufferLike>;
25
21
  vid: string | Uint8Array<ArrayBufferLike>;
26
22
  index: string | number | bigint;
27
23
  metadata: string;
@@ -32,11 +28,11 @@ export declare const UnsettledBidReceipt: MoveStruct<{
32
28
  length: number;
33
29
  }, string>;
34
30
  /** The ID of the position. */
35
- position_id: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
31
+ position_id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
36
32
  /** The address of the user. */
37
- user: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
33
+ user: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
38
34
  /** A vector of the token types. */
39
- token_types: import("@mysten/sui/bcs").BcsType<{
35
+ token_types: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<{
40
36
  name: string;
41
37
  }[], Iterable<{
42
38
  name: string;
@@ -44,19 +40,19 @@ export declare const UnsettledBidReceipt: MoveStruct<{
44
40
  length: number;
45
41
  }, string>;
46
42
  /** The sign of the unrealized PNL. */
47
- unrealized_pnl_sign: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
43
+ unrealized_pnl_sign: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<boolean, boolean, "bool">;
48
44
  /** The unrealized PNL. */
49
- unrealized_pnl: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
45
+ unrealized_pnl: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
50
46
  /** The unrealized trading fee. */
51
- unrealized_trading_fee: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
47
+ unrealized_trading_fee: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
52
48
  /** The unrealized borrow fee. */
53
- unrealized_borrow_fee: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
49
+ unrealized_borrow_fee: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
54
50
  /** The sign of the unrealized funding fee. */
55
- unrealized_funding_fee_sign: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
51
+ unrealized_funding_fee_sign: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<boolean, boolean, "bool">;
56
52
  /** The unrealized funding fee. */
57
- unrealized_funding_fee: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
53
+ unrealized_funding_fee: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
58
54
  /** The unrealized liquidator fee. */
59
- unrealized_liquidator_fee: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
55
+ unrealized_liquidator_fee: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
60
56
  }, "@typus/perp::escrow::UnsettledBidReceipt">;
61
57
  export interface CreateUnsettledBidReceiptArguments {
62
58
  receipt: RawTransactionArgument<string[]>;
@@ -88,7 +84,7 @@ export interface CreateUnsettledBidReceiptOptions {
88
84
  ];
89
85
  }
90
86
  /** Creates a new `UnsettledBidReceipt`. */
91
- export declare function createUnsettledBidReceipt(options: CreateUnsettledBidReceiptOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
87
+ export declare function createUnsettledBidReceipt(options: CreateUnsettledBidReceiptOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
92
88
  export interface DestructUnsettledBidReceiptArguments {
93
89
  unsettledBidReceipt: RawTransactionArgument<string>;
94
90
  }
@@ -97,7 +93,7 @@ export interface DestructUnsettledBidReceiptOptions {
97
93
  arguments: DestructUnsettledBidReceiptArguments | [unsettledBidReceipt: RawTransactionArgument<string>];
98
94
  }
99
95
  /** Destructs an `UnsettledBidReceipt` and returns its fields. */
100
- export declare function destructUnsettledBidReceipt(options: DestructUnsettledBidReceiptOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
96
+ export declare function destructUnsettledBidReceipt(options: DestructUnsettledBidReceiptOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
101
97
  export interface GetBidReceiptsArguments {
102
98
  unsettledBidReceipt: RawTransactionArgument<string>;
103
99
  }
@@ -106,4 +102,4 @@ export interface GetBidReceiptsOptions {
106
102
  arguments: GetBidReceiptsArguments | [unsettledBidReceipt: RawTransactionArgument<string>];
107
103
  }
108
104
  /** Gets a reference to the bid receipts in an `UnsettledBidReceipt`. */
109
- export declare function getBidReceipts(options: GetBidReceiptsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
105
+ export declare function getBidReceipts(options: GetBidReceiptsOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
@@ -45,12 +45,12 @@ exports.getBidReceipts = getBidReceipts;
45
45
  * creating and destructing it. This is used to handle unsettled bids from
46
46
  * liquidations.
47
47
  */
48
- const index_1 = require("../utils/index");
48
+ const index_js_1 = require("../utils/index.js");
49
49
  const bcs_1 = require("@mysten/sui/bcs");
50
- const vault = __importStar(require("./deps/typus_framework/vault"));
51
- const type_name = __importStar(require("./deps/std/type_name"));
50
+ const vault = __importStar(require("./deps/typus_framework/vault.js"));
51
+ const type_name = __importStar(require("./deps/std/type_name.js"));
52
52
  const $moduleName = "@typus/perp::escrow";
53
- exports.UnsettledBidReceipt = new index_1.MoveStruct({
53
+ exports.UnsettledBidReceipt = new index_js_1.MoveStruct({
54
54
  name: `${$moduleName}::UnsettledBidReceipt`,
55
55
  fields: {
56
56
  /** A vector of `TypusBidReceipt` structs. */
@@ -80,19 +80,7 @@ exports.UnsettledBidReceipt = new index_1.MoveStruct({
80
80
  /** Creates a new `UnsettledBidReceipt`. */
81
81
  function createUnsettledBidReceipt(options) {
82
82
  const packageAddress = options.package ?? "@typus/perp";
83
- const argumentsTypes = [
84
- "vector<0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::vault::TypusBidReceipt>",
85
- "u64",
86
- "address",
87
- "vector<0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName>",
88
- "bool",
89
- "u64",
90
- "u64",
91
- "u64",
92
- "bool",
93
- "u64",
94
- "u64",
95
- ];
83
+ const argumentsTypes = ["vector<null>", "u64", "address", "vector<null>", "bool", "u64", "u64", "u64", "bool", "u64", "u64"];
96
84
  const parameterNames = [
97
85
  "receipt",
98
86
  "positionId",
@@ -110,30 +98,30 @@ function createUnsettledBidReceipt(options) {
110
98
  package: packageAddress,
111
99
  module: "escrow",
112
100
  function: "create_unsettled_bid_receipt",
113
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
101
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
114
102
  });
115
103
  }
116
104
  /** Destructs an `UnsettledBidReceipt` and returns its fields. */
117
105
  function destructUnsettledBidReceipt(options) {
118
106
  const packageAddress = options.package ?? "@typus/perp";
119
- const argumentsTypes = [`${packageAddress}::escrow::UnsettledBidReceipt`];
107
+ const argumentsTypes = [null];
120
108
  const parameterNames = ["unsettledBidReceipt"];
121
109
  return (tx) => tx.moveCall({
122
110
  package: packageAddress,
123
111
  module: "escrow",
124
112
  function: "destruct_unsettled_bid_receipt",
125
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
113
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
126
114
  });
127
115
  }
128
116
  /** Gets a reference to the bid receipts in an `UnsettledBidReceipt`. */
129
117
  function getBidReceipts(options) {
130
118
  const packageAddress = options.package ?? "@typus/perp";
131
- const argumentsTypes = [`${packageAddress}::escrow::UnsettledBidReceipt`];
119
+ const argumentsTypes = [null];
132
120
  const parameterNames = ["unsettledBidReceipt"];
133
121
  return (tx) => tx.moveCall({
134
122
  package: packageAddress,
135
123
  module: "escrow",
136
124
  function: "get_bid_receipts",
137
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
125
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
138
126
  });
139
127
  }
@@ -0,0 +1,47 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /**
5
+ * The `lending` module provides functions for interacting with the Scallop lending
6
+ * protocol.
7
+ */
8
+ import { type Transaction } from "@mysten/sui/transactions";
9
+ import { type RawTransactionArgument } from "../utils/index.js";
10
+ export interface DepositScallopBasicArguments {
11
+ balance: RawTransactionArgument<string>;
12
+ scallopVersion: RawTransactionArgument<string>;
13
+ scallopMarket: RawTransactionArgument<string>;
14
+ }
15
+ export interface DepositScallopBasicOptions {
16
+ package?: string;
17
+ arguments: DepositScallopBasicArguments | [
18
+ balance: RawTransactionArgument<string>,
19
+ scallopVersion: RawTransactionArgument<string>,
20
+ scallopMarket: RawTransactionArgument<string>
21
+ ];
22
+ typeArguments: [string];
23
+ }
24
+ /**
25
+ * Deposits a token into the Scallop lending protocol. WARNING: no authority check
26
+ * inside
27
+ */
28
+ export declare function depositScallopBasic(options: DepositScallopBasicOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
29
+ export interface WithdrawScallopBasicArguments {
30
+ marketCoin: RawTransactionArgument<string>;
31
+ scallopVersion: RawTransactionArgument<string>;
32
+ scallopMarket: RawTransactionArgument<string>;
33
+ }
34
+ export interface WithdrawScallopBasicOptions {
35
+ package?: string;
36
+ arguments: WithdrawScallopBasicArguments | [
37
+ marketCoin: RawTransactionArgument<string>,
38
+ scallopVersion: RawTransactionArgument<string>,
39
+ scallopMarket: RawTransactionArgument<string>
40
+ ];
41
+ typeArguments: [string];
42
+ }
43
+ /**
44
+ * Withdraws a token from the Scallop lending protocol. WARNING: no authority check
45
+ * inside
46
+ */
47
+ export declare function withdrawScallopBasic(options: WithdrawScallopBasicOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ /**************************************************************
3
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
4
+ **************************************************************/
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.depositScallopBasic = depositScallopBasic;
7
+ exports.withdrawScallopBasic = withdrawScallopBasic;
8
+ const index_js_1 = require("../utils/index.js");
9
+ /**
10
+ * Deposits a token into the Scallop lending protocol. WARNING: no authority check
11
+ * inside
12
+ */
13
+ function depositScallopBasic(options) {
14
+ const packageAddress = options.package ?? "@typus/perp";
15
+ const argumentsTypes = [null, null, null, "0x2::clock::Clock"];
16
+ const parameterNames = ["balance", "scallopVersion", "scallopMarket"];
17
+ return (tx) => tx.moveCall({
18
+ package: packageAddress,
19
+ module: "lending",
20
+ function: "deposit_scallop_basic",
21
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
22
+ typeArguments: options.typeArguments,
23
+ });
24
+ }
25
+ /**
26
+ * Withdraws a token from the Scallop lending protocol. WARNING: no authority check
27
+ * inside
28
+ */
29
+ function withdrawScallopBasic(options) {
30
+ const packageAddress = options.package ?? "@typus/perp";
31
+ const argumentsTypes = [null, null, null, "0x2::clock::Clock"];
32
+ const parameterNames = ["marketCoin", "scallopVersion", "scallopMarket"];
33
+ return (tx) => tx.moveCall({
34
+ package: packageAddress,
35
+ module: "lending",
36
+ function: "withdraw_scallop_basic",
37
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
38
+ typeArguments: options.typeArguments,
39
+ });
40
+ }