@rabby-wallet/hyperliquid-sdk 1.0.0-beta.2 → 1.0.0-beta.3

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,4 +1,4 @@
1
- import type { Meta, AssetCtx, ClearinghouseState, UserFills, CandleSnapshot, AllMids, ExtraAgent, OpenOrder, FeeResponse } from '../types';
1
+ import type { Meta, AssetCtx, ClearinghouseState, UserFills, CandleSnapshot, AllMids, ExtraAgent, OpenOrder, FeeResponse, UserNonFundingLedgerUpdates } from '../types';
2
2
  export interface InfoClientConfig {
3
3
  isTestnet?: boolean;
4
4
  timeout?: number;
@@ -22,6 +22,7 @@ export declare class InfoClient {
22
22
  metaAndAssetCtxs(): Promise<[Meta, AssetCtx[]]>;
23
23
  getClearingHouseState(address?: string): Promise<ClearinghouseState>;
24
24
  getFrontendOpenOrders(address?: string): Promise<OpenOrder[]>;
25
+ getUserNonFundingLedgerUpdates(address?: string, startTime?: number, endTime?: number): Promise<UserNonFundingLedgerUpdates[]>;
25
26
  /**
26
27
  * Get user's fill history
27
28
  */
@@ -68,6 +68,16 @@ class InfoClient {
68
68
  // user: this.masterAddress,
69
69
  // });
70
70
  // }
71
+ getUserNonFundingLedgerUpdates(address, startTime, endTime) {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ return this.httpClient.info({
74
+ type: constants_1.InfoType.USER_NON_FUNDING_LEDGER_UPDATES,
75
+ user: address || this.masterAddress,
76
+ startTime: startTime || 0,
77
+ endTime,
78
+ });
79
+ });
80
+ }
71
81
  /**
72
82
  * Get user's fill history
73
83
  */
@@ -27,6 +27,7 @@ export declare enum ExchangeType {
27
27
  }
28
28
  export declare enum InfoType {
29
29
  ALL_MIDS = "allMids",
30
+ USER_NON_FUNDING_LEDGER_UPDATES = "userNonFundingLedgerUpdates",
30
31
  USER_OPEN_ORDERS = "openOrders",
31
32
  USER_FILLS = "userFills",
32
33
  USER_FILLS_BY_TIME = "userFillsByTime",
@@ -35,7 +36,6 @@ export declare enum InfoType {
35
36
  CANDLES_SNAPSHOT = "candleSnapshot",
36
37
  META_AND_ASSET_CTXS = "metaAndAssetCtxs",
37
38
  USER_FUNDING = "userFunding",
38
- USER_NON_FUNDING_LEDGER_UPDATES = "userNonFundingLedgerUpdates",
39
39
  FUNDING_HISTORY = "fundingHistory",
40
40
  CLEARINGHOUSE_STATE = "clearinghouseState",
41
41
  META = "meta",
@@ -35,6 +35,7 @@ var ExchangeType;
35
35
  var InfoType;
36
36
  (function (InfoType) {
37
37
  InfoType["ALL_MIDS"] = "allMids";
38
+ InfoType["USER_NON_FUNDING_LEDGER_UPDATES"] = "userNonFundingLedgerUpdates";
38
39
  InfoType["USER_OPEN_ORDERS"] = "openOrders";
39
40
  InfoType["USER_FILLS"] = "userFills";
40
41
  InfoType["USER_FILLS_BY_TIME"] = "userFillsByTime";
@@ -43,7 +44,6 @@ var InfoType;
43
44
  InfoType["CANDLES_SNAPSHOT"] = "candleSnapshot";
44
45
  InfoType["META_AND_ASSET_CTXS"] = "metaAndAssetCtxs";
45
46
  InfoType["USER_FUNDING"] = "userFunding";
46
- InfoType["USER_NON_FUNDING_LEDGER_UPDATES"] = "userNonFundingLedgerUpdates";
47
47
  InfoType["FUNDING_HISTORY"] = "fundingHistory";
48
48
  InfoType["CLEARINGHOUSE_STATE"] = "clearinghouseState";
49
49
  InfoType["META"] = "meta";
@@ -121,6 +121,24 @@ export interface UserFill {
121
121
  export type UserFills = {
122
122
  [asset: string]: UserFill[];
123
123
  };
124
+ export type UserNonFundingLedgerUpdates = {
125
+ time: number;
126
+ hash: string;
127
+ delta: {
128
+ type: string;
129
+ usdc?: string;
130
+ vault?: string;
131
+ user?: string;
132
+ token?: string;
133
+ amount?: string;
134
+ requestedUsd?: string;
135
+ commission?: string;
136
+ closingCost?: string;
137
+ basis?: string;
138
+ netWithdrawnUsd?: string;
139
+ toPerp?: boolean;
140
+ };
141
+ };
124
142
  export interface OrderResponse {
125
143
  status: 'ok';
126
144
  response: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/hyperliquid-sdk",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.3",
4
4
  "description": "Simplified Hyperliquid Perpetuals Trading SDK for Frontend Applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",