@typus/typus-perp-sdk 1.1.32-codegen-exp4 → 1.1.32-codegen-exp5

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.
@@ -349,54 +349,14 @@ export declare function getUserOrders(client: TypusClient, input: {
349
349
  user: string;
350
350
  indexes: string[];
351
351
  }): Promise<TradingOrderWithMarketIndex[]>;
352
+ export type Position = (typeof Position.$inferType);
353
+ export type PositionWithMarketIndex = Position & {
354
+ marketIndex: number;
355
+ };
352
356
  export declare function getUserPositions(client: TypusClient, input: {
353
357
  user: string;
354
358
  indexes: string[];
355
- }): Promise<{
356
- id: {
357
- id: string;
358
- };
359
- create_ts_ms: string;
360
- position_id: string;
361
- linked_order_ids: string[];
362
- linked_order_prices: string[];
363
- user: string;
364
- is_long: boolean;
365
- size: string;
366
- size_decimal: string;
367
- collateral_token: {
368
- name: string;
369
- };
370
- collateral_token_decimal: string;
371
- symbol: {
372
- base_token: {
373
- name: string;
374
- };
375
- quote_token: {
376
- name: string;
377
- };
378
- };
379
- collateral_amount: string;
380
- reserve_amount: string;
381
- average_price: string;
382
- entry_borrow_index: string;
383
- entry_funding_rate_index_sign: boolean;
384
- entry_funding_rate_index: string;
385
- unrealized_loss: string;
386
- unrealized_funding_sign: boolean;
387
- unrealized_funding_fee: string;
388
- unrealized_trading_fee: string;
389
- unrealized_borrow_fee: string;
390
- unrealized_rebate: string;
391
- option_collateral_info: {
392
- index: string;
393
- bid_token: {
394
- name: string;
395
- };
396
- bid_receipts_bcs: number[][];
397
- } | null;
398
- u64_padding: string[];
399
- }[]>;
359
+ }): Promise<PositionWithMarketIndex[]>;
400
360
  export declare function parseOptionBidReceipts(positions: (typeof Position.$inferType)[]): ({
401
361
  id: {
402
362
  id: string;
package/dist/src/fetch.js CHANGED
@@ -170,9 +170,10 @@ async function getUserPositions(client, input) {
170
170
  let length = reader.readULEB();
171
171
  let bytes = reader.readBytes(length);
172
172
  let position = position_1.Position.parse(bytes);
173
- // @ts-ignore
174
- position.marketIndex = x;
175
- positions.push(position);
173
+ positions.push({
174
+ ...position,
175
+ marketIndex: x,
176
+ });
176
177
  });
177
178
  }
178
179
  // let positions: Position[] = readVecPosition(Uint8Array.from(returnValues));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typus/typus-perp-sdk",
3
- "version": "1.1.32-codegen-exp4",
3
+ "version": "1.1.32-codegen-exp5",
4
4
  "repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
5
5
  "author": "Typus",
6
6
  "description": "typus perp sdk",