@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
@@ -5,18 +5,16 @@
5
5
  * The `treasury_caps` module defines the `TreasuryCaps` struct, which is a shared
6
6
  * object that stores the treasury caps for the TLP tokens.
7
7
  */
8
- import { MoveStruct, type RawTransactionArgument } from "../utils/index";
8
+ import { MoveStruct, type RawTransactionArgument } from "../utils/index.js";
9
9
  import { type Transaction } from "@mysten/sui/transactions";
10
10
  export declare const TreasuryCaps: MoveStruct<{
11
- id: MoveStruct<{
12
- id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
13
- }, "0x2::object::UID">;
11
+ id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
14
12
  }, "@typus/perp::treasury_caps::TreasuryCaps">;
15
13
  export interface InitOptions {
16
14
  package?: string;
17
15
  arguments?: [];
18
16
  }
19
- export declare function init(options?: InitOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
17
+ export declare function init(options?: InitOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
20
18
  export interface GetMutTreasuryCapArguments {
21
19
  treasuryCaps: RawTransactionArgument<string>;
22
20
  }
@@ -26,7 +24,7 @@ export interface GetMutTreasuryCapOptions {
26
24
  typeArguments: [string];
27
25
  }
28
26
  /** Gets a mutable reference to a treasury cap. WARNING: no authority check inside */
29
- export declare function getMutTreasuryCap(options: GetMutTreasuryCapOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
27
+ export declare function getMutTreasuryCap(options: GetMutTreasuryCapOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
30
28
  export interface ManagerStoreTreasuryCapArguments {
31
29
  version: RawTransactionArgument<string>;
32
30
  treasuryCaps: RawTransactionArgument<string>;
@@ -41,4 +39,4 @@ export interface ManagerStoreTreasuryCapOptions {
41
39
  ];
42
40
  typeArguments: [string];
43
41
  }
44
- export declare function managerStoreTreasuryCap(options: ManagerStoreTreasuryCapOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
42
+ export declare function managerStoreTreasuryCap(options: ManagerStoreTreasuryCapOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
@@ -2,39 +2,6 @@
2
2
  /**************************************************************
3
3
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
4
4
  **************************************************************/
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
38
5
  Object.defineProperty(exports, "__esModule", { value: true });
39
6
  exports.TreasuryCaps = void 0;
40
7
  exports.init = init;
@@ -44,13 +11,13 @@ exports.managerStoreTreasuryCap = managerStoreTreasuryCap;
44
11
  * The `treasury_caps` module defines the `TreasuryCaps` struct, which is a shared
45
12
  * object that stores the treasury caps for the TLP tokens.
46
13
  */
47
- const index_1 = require("../utils/index");
48
- const object = __importStar(require("./deps/sui/object"));
14
+ const index_js_1 = require("../utils/index.js");
15
+ const bcs_1 = require("@mysten/sui/bcs");
49
16
  const $moduleName = "@typus/perp::treasury_caps";
50
- exports.TreasuryCaps = new index_1.MoveStruct({
17
+ exports.TreasuryCaps = new index_js_1.MoveStruct({
51
18
  name: `${$moduleName}::TreasuryCaps`,
52
19
  fields: {
53
- id: object.UID,
20
+ id: bcs_1.bcs.Address,
54
21
  },
55
22
  });
56
23
  function init(options = {}) {
@@ -64,29 +31,25 @@ function init(options = {}) {
64
31
  /** Gets a mutable reference to a treasury cap. WARNING: no authority check inside */
65
32
  function getMutTreasuryCap(options) {
66
33
  const packageAddress = options.package ?? "@typus/perp";
67
- const argumentsTypes = [`${packageAddress}::treasury_caps::TreasuryCaps`];
34
+ const argumentsTypes = [null];
68
35
  const parameterNames = ["treasuryCaps"];
69
36
  return (tx) => tx.moveCall({
70
37
  package: packageAddress,
71
38
  module: "treasury_caps",
72
39
  function: "get_mut_treasury_cap",
73
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
40
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
74
41
  typeArguments: options.typeArguments,
75
42
  });
76
43
  }
77
44
  function managerStoreTreasuryCap(options) {
78
45
  const packageAddress = options.package ?? "@typus/perp";
79
- const argumentsTypes = [
80
- `${packageAddress}::admin::Version`,
81
- `${packageAddress}::treasury_caps::TreasuryCaps`,
82
- `0x0000000000000000000000000000000000000000000000000000000000000002::coin::TreasuryCap<${options.typeArguments[0]}>`,
83
- ];
46
+ const argumentsTypes = [null, null, null];
84
47
  const parameterNames = ["version", "treasuryCaps", "treasuryCap"];
85
48
  return (tx) => tx.moveCall({
86
49
  package: packageAddress,
87
50
  module: "treasury_caps",
88
51
  function: "manager_store_treasury_cap",
89
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
52
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
90
53
  typeArguments: options.typeArguments,
91
54
  });
92
55
  }
@@ -5,108 +5,23 @@
5
5
  * The `admin` module provides administrative functionalities for the Typus Stake
6
6
  * Pool. It includes version management, authority control, and fee handling.
7
7
  */
8
- import { MoveStruct, type RawTransactionArgument } from "../utils/index";
8
+ import { MoveStruct, type RawTransactionArgument } from "../utils/index.js";
9
9
  import { type Transaction } from "@mysten/sui/transactions";
10
- export declare const FeeInfo: MoveStruct<{
11
- /** The type name of the token. */
12
- token: MoveStruct<{
13
- name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
14
- }, "std::type_name::TypeName">;
15
- /** The amount of fees collected. */
16
- value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
17
- }, "@typus/stake-pool::admin::FeeInfo">;
18
- export declare const FeePool: MoveStruct<{
19
- id: MoveStruct<{
20
- id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
21
- }, "0x2::object::UID">;
22
- /** A vector of `FeeInfo` structs. */
23
- fee_infos: import("@mysten/sui/bcs").BcsType<{
24
- token: {
25
- name: string;
26
- };
27
- value: string;
28
- }[], Iterable<{
29
- token: {
30
- name: string;
31
- };
32
- value: string | number | bigint;
33
- }> & {
34
- length: number;
35
- }, string>;
36
- }, "@typus/stake-pool::admin::FeePool">;
37
10
  export declare const Version: MoveStruct<{
38
- id: MoveStruct<{
39
- id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
40
- }, "0x2::object::UID">;
11
+ id: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
41
12
  /** The version number. */
42
- value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
43
- /** The fee pool for protocol fees. */
44
- fee_pool: MoveStruct<{
45
- id: MoveStruct<{
46
- id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
47
- }, "0x2::object::UID">;
48
- /** A vector of `FeeInfo` structs. */
49
- fee_infos: import("@mysten/sui/bcs").BcsType<{
50
- token: {
51
- name: string;
52
- };
53
- value: string;
54
- }[], Iterable<{
55
- token: {
56
- name: string;
57
- };
58
- value: string | number | bigint;
59
- }> & {
60
- length: number;
61
- }, string>;
62
- }, "@typus/stake-pool::admin::FeePool">;
63
- /** The fee pool for liquidator fees. */
64
- liquidator_fee_pool: MoveStruct<{
65
- id: MoveStruct<{
66
- id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
67
- }, "0x2::object::UID">;
68
- /** A vector of `FeeInfo` structs. */
69
- fee_infos: import("@mysten/sui/bcs").BcsType<{
70
- token: {
71
- name: string;
72
- };
73
- value: string;
74
- }[], Iterable<{
75
- token: {
76
- name: string;
77
- };
78
- value: string | number | bigint;
79
- }> & {
80
- length: number;
81
- }, string>;
82
- }, "@typus/stake-pool::admin::FeePool">;
13
+ value: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string | number | bigint, "u64">;
83
14
  /** The list of authorized addresses. */
84
15
  authority: MoveStruct<{
85
- contents: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | Uint8Array<ArrayBufferLike>> & {
16
+ contents: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string[], Iterable<string | Uint8Array<ArrayBufferLike>> & {
86
17
  length: number;
87
18
  }, string>;
88
19
  }, "0x2::vec_set::VecSet<bytes[32]>">;
89
20
  /** Padding for future use. */
90
- u64_padding: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
21
+ u64_padding: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string[], Iterable<string | number | bigint> & {
91
22
  length: number;
92
23
  }, string>;
93
24
  }, "@typus/stake-pool::admin::Version">;
94
- export declare const SendFeeEvent: MoveStruct<{
95
- /** The type name of the token. */
96
- token: MoveStruct<{
97
- name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
98
- }, "std::type_name::TypeName">;
99
- /** The amount of fees sent. */
100
- amount: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
101
- }, "@typus/stake-pool::admin::SendFeeEvent">;
102
- export declare const ProtocolFeeEvent: MoveStruct<{
103
- /** The type name of the token. */
104
- token: MoveStruct<{
105
- name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
106
- }, "std::type_name::TypeName">;
107
- /** The amount of fees charged. */
108
- amount: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
109
- }, "@typus/stake-pool::admin::ProtocolFeeEvent">;
110
25
  export interface VersionCheckArguments {
111
26
  version: RawTransactionArgument<string>;
112
27
  }
@@ -115,7 +30,7 @@ export interface VersionCheckOptions {
115
30
  arguments: VersionCheckArguments | [version: RawTransactionArgument<string>];
116
31
  }
117
32
  /** Checks if the contract version is valid. */
118
- export declare function versionCheck(options: VersionCheckOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
33
+ export declare function versionCheck(options: VersionCheckOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
119
34
  export interface UpgradeArguments {
120
35
  version: RawTransactionArgument<string>;
121
36
  }
@@ -124,13 +39,13 @@ export interface UpgradeOptions {
124
39
  arguments: UpgradeArguments | [version: RawTransactionArgument<string>];
125
40
  }
126
41
  /** Upgrades the contract version. WARNING: no authority check inside */
127
- export declare function upgrade(options: UpgradeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
42
+ export declare function upgrade(options: UpgradeOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
128
43
  export interface InitOptions {
129
44
  package?: string;
130
45
  arguments?: [];
131
46
  }
132
47
  /** Initializes the contract. */
133
- export declare function init(options?: InitOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
48
+ export declare function init(options?: InitOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
134
49
  export interface VerifyArguments {
135
50
  version: RawTransactionArgument<string>;
136
51
  }
@@ -139,7 +54,7 @@ export interface VerifyOptions {
139
54
  arguments: VerifyArguments | [version: RawTransactionArgument<string>];
140
55
  }
141
56
  /** [Authorized Function] Verifies if the sender is an authorized user. */
142
- export declare function verify(options: VerifyOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
57
+ export declare function verify(options: VerifyOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
143
58
  export interface AddAuthorizedUserArguments {
144
59
  version: RawTransactionArgument<string>;
145
60
  userAddress: RawTransactionArgument<string>;
@@ -149,7 +64,7 @@ export interface AddAuthorizedUserOptions {
149
64
  arguments: AddAuthorizedUserArguments | [version: RawTransactionArgument<string>, userAddress: RawTransactionArgument<string>];
150
65
  }
151
66
  /** [Authorized Function] Adds an authorized user. */
152
- export declare function addAuthorizedUser(options: AddAuthorizedUserOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
67
+ export declare function addAuthorizedUser(options: AddAuthorizedUserOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
153
68
  export interface RemoveAuthorizedUserArguments {
154
69
  version: RawTransactionArgument<string>;
155
70
  userAddress: RawTransactionArgument<string>;
@@ -159,7 +74,7 @@ export interface RemoveAuthorizedUserOptions {
159
74
  arguments: RemoveAuthorizedUserArguments | [version: RawTransactionArgument<string>, userAddress: RawTransactionArgument<string>];
160
75
  }
161
76
  /** [Authorized Function] Removes an authorized user. */
162
- export declare function removeAuthorizedUser(options: RemoveAuthorizedUserOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
77
+ export declare function removeAuthorizedUser(options: RemoveAuthorizedUserOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
163
78
  export interface InstallEcosystemManagerCapEntryArguments {
164
79
  version: RawTransactionArgument<string>;
165
80
  typusEcosystemVersion: RawTransactionArgument<string>;
@@ -172,7 +87,7 @@ export interface InstallEcosystemManagerCapEntryOptions {
172
87
  * [Authorized Function] Installs the ecosystem manager cap. TODO: can be remove
173
88
  * after install
174
89
  */
175
- export declare function installEcosystemManagerCapEntry(options: InstallEcosystemManagerCapEntryOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
90
+ export declare function installEcosystemManagerCapEntry(options: InstallEcosystemManagerCapEntryOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
176
91
  export interface AddTailsExpAmountArguments {
177
92
  version: RawTransactionArgument<string>;
178
93
  typusEcosystemVersion: RawTransactionArgument<string>;
@@ -191,28 +106,4 @@ export interface AddTailsExpAmountOptions {
191
106
  ];
192
107
  }
193
108
  /** Adds tails experience points to a user. */
194
- export declare function addTailsExpAmount(options: AddTailsExpAmountOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
195
- export interface SendFeeArguments {
196
- version: RawTransactionArgument<string>;
197
- }
198
- export interface SendFeeOptions {
199
- package?: string;
200
- arguments: SendFeeArguments | [version: RawTransactionArgument<string>];
201
- typeArguments: [string];
202
- }
203
- /**
204
- * Sends the collected fees to the fee address. Safe with constant address as
205
- * receiver
206
- */
207
- export declare function sendFee(options: SendFeeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
208
- export interface ChargeFeeArguments {
209
- version: RawTransactionArgument<string>;
210
- balance: RawTransactionArgument<string>;
211
- }
212
- export interface ChargeFeeOptions {
213
- package?: string;
214
- arguments: ChargeFeeArguments | [version: RawTransactionArgument<string>, balance: RawTransactionArgument<string>];
215
- typeArguments: [string];
216
- }
217
- /** Charges a protocol fee. */
218
- export declare function chargeFee(options: ChargeFeeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
109
+ export declare function addTailsExpAmount(options: AddTailsExpAmountOptions): (tx: Transaction) => import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.ProtocolFeeEvent = exports.SendFeeEvent = exports.Version = exports.FeePool = exports.FeeInfo = void 0;
39
+ exports.Version = void 0;
40
40
  exports.versionCheck = versionCheck;
41
41
  exports.upgrade = upgrade;
42
42
  exports.init = init;
@@ -45,91 +45,48 @@ exports.addAuthorizedUser = addAuthorizedUser;
45
45
  exports.removeAuthorizedUser = removeAuthorizedUser;
46
46
  exports.installEcosystemManagerCapEntry = installEcosystemManagerCapEntry;
47
47
  exports.addTailsExpAmount = addTailsExpAmount;
48
- exports.sendFee = sendFee;
49
- exports.chargeFee = chargeFee;
50
48
  /**
51
49
  * The `admin` module provides administrative functionalities for the Typus Stake
52
50
  * Pool. It includes version management, authority control, and fee handling.
53
51
  */
54
- const index_1 = require("../utils/index");
52
+ const index_js_1 = require("../utils/index.js");
55
53
  const bcs_1 = require("@mysten/sui/bcs");
56
- const type_name = __importStar(require("./deps/std/type_name"));
57
- const object = __importStar(require("./deps/sui/object"));
58
- const vec_set = __importStar(require("./deps/sui/vec_set"));
54
+ const vec_set = __importStar(require("./deps/sui/vec_set.js"));
59
55
  const $moduleName = "@typus/stake-pool::admin";
60
- exports.FeeInfo = new index_1.MoveStruct({
61
- name: `${$moduleName}::FeeInfo`,
62
- fields: {
63
- /** The type name of the token. */
64
- token: type_name.TypeName,
65
- /** The amount of fees collected. */
66
- value: bcs_1.bcs.u64(),
67
- },
68
- });
69
- exports.FeePool = new index_1.MoveStruct({
70
- name: `${$moduleName}::FeePool`,
71
- fields: {
72
- id: object.UID,
73
- /** A vector of `FeeInfo` structs. */
74
- fee_infos: bcs_1.bcs.vector(exports.FeeInfo),
75
- },
76
- });
77
- exports.Version = new index_1.MoveStruct({
56
+ exports.Version = new index_js_1.MoveStruct({
78
57
  name: `${$moduleName}::Version`,
79
58
  fields: {
80
- id: object.UID,
59
+ id: bcs_1.bcs.Address,
81
60
  /** The version number. */
82
61
  value: bcs_1.bcs.u64(),
83
- /** The fee pool for protocol fees. */
84
- fee_pool: exports.FeePool,
85
- /** The fee pool for liquidator fees. */
86
- liquidator_fee_pool: exports.FeePool,
87
62
  /** The list of authorized addresses. */
88
63
  authority: vec_set.VecSet(bcs_1.bcs.Address),
89
64
  /** Padding for future use. */
90
65
  u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
91
66
  },
92
67
  });
93
- exports.SendFeeEvent = new index_1.MoveStruct({
94
- name: `${$moduleName}::SendFeeEvent`,
95
- fields: {
96
- /** The type name of the token. */
97
- token: type_name.TypeName,
98
- /** The amount of fees sent. */
99
- amount: bcs_1.bcs.u64(),
100
- },
101
- });
102
- exports.ProtocolFeeEvent = new index_1.MoveStruct({
103
- name: `${$moduleName}::ProtocolFeeEvent`,
104
- fields: {
105
- /** The type name of the token. */
106
- token: type_name.TypeName,
107
- /** The amount of fees charged. */
108
- amount: bcs_1.bcs.u64(),
109
- },
110
- });
111
68
  /** Checks if the contract version is valid. */
112
69
  function versionCheck(options) {
113
70
  const packageAddress = options.package ?? "@typus/stake-pool";
114
- const argumentsTypes = [`${packageAddress}::admin::Version`];
71
+ const argumentsTypes = [null];
115
72
  const parameterNames = ["version"];
116
73
  return (tx) => tx.moveCall({
117
74
  package: packageAddress,
118
75
  module: "admin",
119
76
  function: "version_check",
120
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
77
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
121
78
  });
122
79
  }
123
80
  /** Upgrades the contract version. WARNING: no authority check inside */
124
81
  function upgrade(options) {
125
82
  const packageAddress = options.package ?? "@typus/stake-pool";
126
- const argumentsTypes = [`${packageAddress}::admin::Version`];
83
+ const argumentsTypes = [null];
127
84
  const parameterNames = ["version"];
128
85
  return (tx) => tx.moveCall({
129
86
  package: packageAddress,
130
87
  module: "admin",
131
88
  function: "upgrade",
132
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
89
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
133
90
  });
134
91
  }
135
92
  /** Initializes the contract. */
@@ -144,37 +101,37 @@ function init(options = {}) {
144
101
  /** [Authorized Function] Verifies if the sender is an authorized user. */
145
102
  function verify(options) {
146
103
  const packageAddress = options.package ?? "@typus/stake-pool";
147
- const argumentsTypes = [`${packageAddress}::admin::Version`];
104
+ const argumentsTypes = [null];
148
105
  const parameterNames = ["version"];
149
106
  return (tx) => tx.moveCall({
150
107
  package: packageAddress,
151
108
  module: "admin",
152
109
  function: "verify",
153
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
110
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
154
111
  });
155
112
  }
156
113
  /** [Authorized Function] Adds an authorized user. */
157
114
  function addAuthorizedUser(options) {
158
115
  const packageAddress = options.package ?? "@typus/stake-pool";
159
- const argumentsTypes = [`${packageAddress}::admin::Version`, "address"];
116
+ const argumentsTypes = [null, "address"];
160
117
  const parameterNames = ["version", "userAddress"];
161
118
  return (tx) => tx.moveCall({
162
119
  package: packageAddress,
163
120
  module: "admin",
164
121
  function: "add_authorized_user",
165
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
122
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
166
123
  });
167
124
  }
168
125
  /** [Authorized Function] Removes an authorized user. */
169
126
  function removeAuthorizedUser(options) {
170
127
  const packageAddress = options.package ?? "@typus/stake-pool";
171
- const argumentsTypes = [`${packageAddress}::admin::Version`, "address"];
128
+ const argumentsTypes = [null, "address"];
172
129
  const parameterNames = ["version", "userAddress"];
173
130
  return (tx) => tx.moveCall({
174
131
  package: packageAddress,
175
132
  module: "admin",
176
133
  function: "remove_authorized_user",
177
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
134
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
178
135
  });
179
136
  }
180
137
  /**
@@ -183,65 +140,24 @@ function removeAuthorizedUser(options) {
183
140
  */
184
141
  function installEcosystemManagerCapEntry(options) {
185
142
  const packageAddress = options.package ?? "@typus/stake-pool";
186
- const argumentsTypes = [
187
- `${packageAddress}::admin::Version`,
188
- "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::ecosystem::Version",
189
- ];
143
+ const argumentsTypes = [null, null];
190
144
  const parameterNames = ["version", "typusEcosystemVersion"];
191
145
  return (tx) => tx.moveCall({
192
146
  package: packageAddress,
193
147
  module: "admin",
194
148
  function: "install_ecosystem_manager_cap_entry",
195
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
149
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
196
150
  });
197
151
  }
198
152
  /** Adds tails experience points to a user. */
199
153
  function addTailsExpAmount(options) {
200
154
  const packageAddress = options.package ?? "@typus/stake-pool";
201
- const argumentsTypes = [
202
- `${packageAddress}::admin::Version`,
203
- "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::ecosystem::Version",
204
- "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::user::TypusUserRegistry",
205
- "address",
206
- "u64",
207
- ];
155
+ const argumentsTypes = [null, null, null, "address", "u64"];
208
156
  const parameterNames = ["version", "typusEcosystemVersion", "typusUserRegistry", "user", "amount"];
209
157
  return (tx) => tx.moveCall({
210
158
  package: packageAddress,
211
159
  module: "admin",
212
160
  function: "add_tails_exp_amount",
213
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
214
- });
215
- }
216
- /**
217
- * Sends the collected fees to the fee address. Safe with constant address as
218
- * receiver
219
- */
220
- function sendFee(options) {
221
- const packageAddress = options.package ?? "@typus/stake-pool";
222
- const argumentsTypes = [`${packageAddress}::admin::Version`];
223
- const parameterNames = ["version"];
224
- return (tx) => tx.moveCall({
225
- package: packageAddress,
226
- module: "admin",
227
- function: "send_fee",
228
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
229
- typeArguments: options.typeArguments,
230
- });
231
- }
232
- /** Charges a protocol fee. */
233
- function chargeFee(options) {
234
- const packageAddress = options.package ?? "@typus/stake-pool";
235
- const argumentsTypes = [
236
- `${packageAddress}::admin::Version`,
237
- `0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`,
238
- ];
239
- const parameterNames = ["version", "balance"];
240
- return (tx) => tx.moveCall({
241
- package: packageAddress,
242
- module: "admin",
243
- function: "charge_fee",
244
- arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
245
- typeArguments: options.typeArguments,
161
+ arguments: (0, index_js_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
246
162
  });
247
163
  }
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
3
  **************************************************************/
4
4
  /** Functionality for converting Move types into values. Use with care! */
5
- import { MoveStruct } from "../../../utils/index";
5
+ import { MoveStruct } from "../../../utils/index.js";
6
6
  export declare const TypeName: MoveStruct<{
7
7
  /**
8
8
  * String representation of the type. All types are represented using their source
@@ -13,5 +13,5 @@ export declare const TypeName: MoveStruct<{
13
13
  * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
14
14
  * 32 depending on the Move platform)
15
15
  */
16
- name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
16
+ name: import("@mysten/sui/bcs", { with: { "resolution-mode": "import" } }).BcsType<string, string, "string">;
17
17
  }, "std::type_name::TypeName">;
@@ -5,10 +5,10 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.TypeName = void 0;
7
7
  /** Functionality for converting Move types into values. Use with care! */
8
- const index_1 = require("../../../utils/index");
8
+ const index_js_1 = require("../../../utils/index.js");
9
9
  const bcs_1 = require("@mysten/sui/bcs");
10
10
  const $moduleName = "std::type_name";
11
- exports.TypeName = new index_1.MoveStruct({
11
+ exports.TypeName = new index_js_1.MoveStruct({
12
12
  name: `${$moduleName}::TypeName`,
13
13
  fields: {
14
14
  /**
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
3
  **************************************************************/
4
4
  import { type BcsType } from "@mysten/sui/bcs";
5
- import { MoveStruct } from "../../../utils/index";
5
+ import { MoveStruct } from "../../../utils/index.js";
6
6
  /**
7
7
  * A set data structure backed by a vector. The set is guaranteed not to contain
8
8
  * duplicate keys. All operations are O(N) in the size of the set
@@ -12,7 +12,7 @@ import { MoveStruct } from "../../../utils/index";
12
12
  * insertion order iteration should be handwritten.
13
13
  */
14
14
  export declare function VecSet<K extends BcsType<any>>(...typeParameters: [K]): MoveStruct<{
15
- contents: BcsType<import("@mysten/bcs").InferBcsType<K>[], Iterable<import("@mysten/bcs").InferBcsInput<K>> & {
15
+ contents: BcsType<import("@mysten/bcs", { with: { "resolution-mode": "import" } }).InferBcsType<K>[], Iterable<import("@mysten/bcs", { with: { "resolution-mode": "import" } }).InferBcsInput<K>> & {
16
16
  length: number;
17
17
  }, string>;
18
18
  }, `0x2::vec_set::VecSet<${K["name"]}>`>;
@@ -5,7 +5,7 @@ exports.VecSet = VecSet;
5
5
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
6
6
  **************************************************************/
7
7
  const bcs_1 = require("@mysten/sui/bcs");
8
- const index_1 = require("../../../utils/index");
8
+ const index_js_1 = require("../../../utils/index.js");
9
9
  const $moduleName = "0x2::vec_set";
10
10
  /**
11
11
  * A set data structure backed by a vector. The set is guaranteed not to contain
@@ -16,7 +16,7 @@ const $moduleName = "0x2::vec_set";
16
16
  * insertion order iteration should be handwritten.
17
17
  */
18
18
  function VecSet(...typeParameters) {
19
- return new index_1.MoveStruct({
19
+ return new index_js_1.MoveStruct({
20
20
  name: `${$moduleName}::VecSet<${typeParameters[0].name}>`,
21
21
  fields: {
22
22
  contents: bcs_1.bcs.vector(typeParameters[0]),