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

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.
@@ -1,19 +1,27 @@
1
1
  import { TOKEN } from "@typus/typus-sdk/dist/src/constants";
2
2
  import { Markets, SymbolMarket } from "./generated/typus_perp/trading";
3
3
  import { DeactivatingShares } from "./generated/typus_perp/lp_pool";
4
- import { Position } from "./generated/typus_perp/position";
4
+ import { TradingOrder, Position } from "./generated/typus_perp/position";
5
5
  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
- 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>>;
9
+ export type LiquidityPoolType = typeof LiquidityPool.$inferType;
10
+ export type StakePoolType = typeof StakePool.$inferType;
11
+ export type MarketsType = typeof Markets.$inferType;
12
+ export type SymbolMarketType = typeof SymbolMarket.$inferType;
13
+ export type TradingOrderType = typeof TradingOrder.$inferType;
14
+ export type PositionType = typeof Position.$inferType;
15
+ export type TypusBidReceiptType = typeof TypusBidReceipt.$inferType;
16
+ export type LpUserShareType = typeof LpUserShare.$inferType;
17
+ export type DeactivatingSharesType = typeof DeactivatingShares.$inferType;
18
+ export declare function getLpPools(client: TypusClient): Promise<LiquidityPoolType[]>;
19
+ export declare function getLpPool(client: TypusClient, objectId: string): Promise<LiquidityPoolType>;
20
+ export declare function getStakePools(client: TypusClient): Promise<StakePoolType[]>;
21
+ export declare function getStakePool(client: TypusClient, objectId: string): Promise<StakePoolType>;
14
22
  export interface MarketsData {
15
- markets: InferType<typeof Markets>;
16
- symbolMarkets: InferType<typeof SymbolMarket>[];
23
+ markets: MarketsType;
24
+ symbolMarkets: SymbolMarketType[];
17
25
  }
18
26
  export declare function getMarkets(client: TypusClient, input: {
19
27
  indexes: string[];
@@ -99,26 +107,26 @@ export declare function getUserPositions(client: TypusClient, input: {
99
107
  } | null;
100
108
  u64_padding: string[];
101
109
  }[]>;
102
- export declare function parseOptionBidReceipts(positions: InferType<typeof Position>[]): (InferType<typeof TypusBidReceipt> | null)[];
110
+ export declare function parseOptionBidReceipts(positions: PositionType[]): (TypusBidReceiptType | null)[];
103
111
  /**
104
112
  * @returns [lpShare, incentives][]
105
113
  */
106
114
  export declare function getUserStake(client: TypusClient, input: {
107
115
  user: string;
108
116
  indexes: string[];
109
- }): Promise<[InferType<typeof LpUserShare>, string[]][]>;
117
+ }): Promise<[LpUserShareType, string[]][]>;
110
118
  /**
111
119
  * @returns deactivatingShares[]
112
120
  */
113
121
  export declare function getDeactivatingShares(client: TypusClient, input: {
114
122
  user: string;
115
123
  indexes: string[];
116
- }): Promise<InferType<typeof DeactivatingShares>[]>;
124
+ }): Promise<DeactivatingSharesType[]>;
117
125
  /**
118
126
  * @returns [liquidationPrice, pnl(in USD)]
119
127
  */
120
128
  export declare function getLiquidationPriceAndPnl(client: TypusClient, input: {
121
- positions: InferType<typeof Position>[];
129
+ positions: PositionType[];
122
130
  }): Promise<PositionInfo[]>;
123
131
  interface PositionInfo {
124
132
  liquidationPrice: number;
@@ -184,5 +192,5 @@ export declare function getAllPositions(client: TypusClient, input: {
184
192
  export declare function getAllPositionsWithTradingSymbol(client: TypusClient, input: {
185
193
  baseToken: TOKEN;
186
194
  marketIndex: string;
187
- }): Promise<InferType<typeof Position>[]>;
195
+ }): Promise<PositionType[]>;
188
196
  export {};
package/dist/src/fetch.js CHANGED
@@ -29,7 +29,7 @@ async function getLpPools(client) {
29
29
  // let dynamicFields = await client.getDynamicFields({
30
30
  // parentId: LIQUIDITY_POOL,
31
31
  // });
32
- // let lpPools: (typeof LiquidityPool.$inferType)[] = [];
32
+ // let lpPools: (LiquidityPoolType)[] = [];
33
33
  // for (const field of dynamicFields.data) {
34
34
  // let lpPool = await getLpPool(client, field.objectId);
35
35
  // // console.log(lpPool);
@@ -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: (InferType<typeof StakePool>)[] = [];
62
+ // let stakePools: (StakePoolType)[] = [];
63
63
  // for (const field of dynamicFields.data) {
64
64
  // let stakePool = await getStakePool(client, field.objectId);
65
65
  // // console.log(stakePool);
@@ -9,4 +9,3 @@ 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.32-codegen",
3
+ "version": "1.1.32-codegen-exp1",
4
4
  "repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
5
5
  "author": "Typus",
6
6
  "description": "typus perp sdk",
@@ -36,7 +36,8 @@
36
36
  "dist"
37
37
  ],
38
38
  "scripts": {
39
- "build": "rm -rf dist && tsc -p tsconfig.build.json && tsc-alias"
39
+ "build": "rm -rf dist && tsc -p tsconfig.build.json && tsc-alias",
40
+ "publish": "yarn npm publish --access public"
40
41
  },
41
42
  "bugs": {
42
43
  "url": "https://github.com/Typus-Lab/typus-perp-sdk/issues"