@typus/typus-perp-sdk 1.1.31-codegen → 1.1.32-codegen

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.
@@ -6,13 +6,14 @@ import { LiquidityPool } from "./generated/typus_perp/lp_pool";
6
6
  import { LpUserShare, StakePool } from "./generated/typus_stake_pool/stake_pool";
7
7
  import { TypusBidReceipt } from "./generated/typus_perp/deps/typus_framework/vault";
8
8
  import { TypusClient } from "../src/client";
9
- export declare function getLpPools(client: TypusClient): Promise<(typeof LiquidityPool.$inferType)[]>;
10
- export declare function getLpPool(client: TypusClient, objectId: string): Promise<typeof LiquidityPool.$inferType>;
11
- export declare function getStakePools(client: TypusClient): Promise<(typeof StakePool.$inferType)[]>;
12
- export declare function getStakePool(client: TypusClient, objectId: string): Promise<typeof StakePool.$inferType>;
9
+ import { InferType } from "./generated/utils";
10
+ export declare function getLpPools(client: TypusClient): Promise<InferType<typeof LiquidityPool>[]>;
11
+ export declare function getLpPool(client: TypusClient, objectId: string): Promise<InferType<typeof LiquidityPool>>;
12
+ export declare function getStakePools(client: TypusClient): Promise<InferType<typeof StakePool>[]>;
13
+ export declare function getStakePool(client: TypusClient, objectId: string): Promise<InferType<typeof StakePool>>;
13
14
  export interface MarketsData {
14
- markets: typeof Markets.$inferType;
15
- symbolMarkets: (typeof SymbolMarket.$inferType)[];
15
+ markets: InferType<typeof Markets>;
16
+ symbolMarkets: InferType<typeof SymbolMarket>[];
16
17
  }
17
18
  export declare function getMarkets(client: TypusClient, input: {
18
19
  indexes: string[];
@@ -98,26 +99,26 @@ export declare function getUserPositions(client: TypusClient, input: {
98
99
  } | null;
99
100
  u64_padding: string[];
100
101
  }[]>;
101
- export declare function parseOptionBidReceipts(positions: (typeof Position.$inferType)[]): (typeof TypusBidReceipt.$inferType | null)[];
102
+ export declare function parseOptionBidReceipts(positions: InferType<typeof Position>[]): (InferType<typeof TypusBidReceipt> | null)[];
102
103
  /**
103
104
  * @returns [lpShare, incentives][]
104
105
  */
105
106
  export declare function getUserStake(client: TypusClient, input: {
106
107
  user: string;
107
108
  indexes: string[];
108
- }): Promise<[typeof LpUserShare.$inferType, string[]][]>;
109
+ }): Promise<[InferType<typeof LpUserShare>, string[]][]>;
109
110
  /**
110
111
  * @returns deactivatingShares[]
111
112
  */
112
113
  export declare function getDeactivatingShares(client: TypusClient, input: {
113
114
  user: string;
114
115
  indexes: string[];
115
- }): Promise<(typeof DeactivatingShares.$inferType)[]>;
116
+ }): Promise<InferType<typeof DeactivatingShares>[]>;
116
117
  /**
117
118
  * @returns [liquidationPrice, pnl(in USD)]
118
119
  */
119
120
  export declare function getLiquidationPriceAndPnl(client: TypusClient, input: {
120
- positions: (typeof Position.$inferType)[];
121
+ positions: InferType<typeof Position>[];
121
122
  }): Promise<PositionInfo[]>;
122
123
  interface PositionInfo {
123
124
  liquidationPrice: number;
@@ -183,5 +184,5 @@ export declare function getAllPositions(client: TypusClient, input: {
183
184
  export declare function getAllPositionsWithTradingSymbol(client: TypusClient, input: {
184
185
  baseToken: TOKEN;
185
186
  marketIndex: string;
186
- }): Promise<(typeof Position.$inferType)[]>;
187
+ }): Promise<InferType<typeof Position>[]>;
187
188
  export {};
package/dist/src/fetch.js CHANGED
@@ -59,7 +59,7 @@ async function getStakePools(client) {
59
59
  // let dynamicFields = await client.getDynamicFields({
60
60
  // parentId: STAKE_POOL,
61
61
  // });
62
- // let stakePools: (typeof StakePool.$inferType)[] = [];
62
+ // let stakePools: (InferType<typeof StakePool>)[] = [];
63
63
  // for (const field of dynamicFields.data) {
64
64
  // let stakePool = await getStakePool(client, field.objectId);
65
65
  // // console.log(stakePool);
@@ -9,3 +9,4 @@ export declare class MoveEnum<T extends Record<string, BcsType<any> | null>, con
9
9
  }
10
10
  export declare class MoveTuple<T extends readonly BcsType<any>[], const Name extends string> extends BcsTuple<T, Name> {
11
11
  }
12
+ export type InferType<T extends BcsType<any, any>> = T["$inferType"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typus/typus-perp-sdk",
3
- "version": "1.1.31-codegen",
3
+ "version": "1.1.32-codegen",
4
4
  "repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
5
5
  "author": "Typus",
6
6
  "description": "typus perp sdk",