@rabby-wallet/hyperliquid-sdk 1.1.6-beta.0 → 1.1.6-beta.1

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, CandleSnapshot, AllMids, ExtraAgent, OpenOrder, FeeResponse, UserNonFundingLedgerUpdates, UserHistoricalOrders, ReferralResponse, L2BookSnapshot, UserTwapSliceFill, FundingHistoryItem, UserFunding, WsFill, PerpDexsResponse, UserAbstractionResp, SpotClearinghouseState } from '../types';
1
+ import type { Meta, AssetCtx, ClearinghouseState, CandleSnapshot, AllMids, ExtraAgent, OpenOrder, FeeResponse, UserNonFundingLedgerUpdates, UserHistoricalOrders, ReferralResponse, L2BookSnapshot, UserTwapSliceFill, FundingHistoryItem, UserFunding, WsFill, PerpDexsResponse, UserAbstractionResp, SpotClearinghouseState, PreTransferCheckResp } from '../types';
2
2
  export interface InfoClientConfig {
3
3
  isTestnet?: boolean;
4
4
  timeout?: number;
@@ -20,6 +20,7 @@ export declare class InfoClient {
20
20
  */
21
21
  getAllMids(dex?: string): Promise<AllMids>;
22
22
  getDexAbstraction(address?: string): Promise<boolean>;
23
+ getPreTransferCheck(user: string, source: string): Promise<PreTransferCheckResp>;
23
24
  getUserAbstraction(address?: string): Promise<UserAbstractionResp>;
24
25
  initMasterAddress(masterAddress: string): void;
25
26
  /**
@@ -50,6 +50,18 @@ class InfoClient {
50
50
  });
51
51
  });
52
52
  }
53
+ /*
54
+ * Pre-transfer check to verify if a user need fee
55
+ */
56
+ getPreTransferCheck(user, source) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ return this.httpClient.info({
59
+ type: constants_1.InfoType.PRE_TRANSFER_CHECK,
60
+ source,
61
+ user,
62
+ });
63
+ });
64
+ }
53
65
  getUserAbstraction(address) {
54
66
  return __awaiter(this, void 0, void 0, function* () {
55
67
  const user = address || this.masterAddress;
@@ -60,7 +60,8 @@ export declare enum InfoType {
60
60
  EXTRA_AGENTS = "extraAgents",
61
61
  USER_DEX_ABSTRACTION = "userDexAbstraction",
62
62
  USER_ABSTRACTION = "userAbstraction",
63
- REFERRAL = "referral"
63
+ REFERRAL = "referral",
64
+ PRE_TRANSFER_CHECK = "preTransferCheck"
64
65
  }
65
66
  export declare enum OrderType {
66
67
  LIMIT = "limit",
@@ -69,6 +69,7 @@ var InfoType;
69
69
  InfoType["USER_DEX_ABSTRACTION"] = "userDexAbstraction";
70
70
  InfoType["USER_ABSTRACTION"] = "userAbstraction";
71
71
  InfoType["REFERRAL"] = "referral";
72
+ InfoType["PRE_TRANSFER_CHECK"] = "preTransferCheck";
72
73
  })(InfoType || (exports.InfoType = InfoType = {}));
73
74
  // Order types
74
75
  var OrderType;
@@ -29,6 +29,12 @@ export interface PerpDex {
29
29
  }
30
30
  /** Raw response of perp dexes API: first element may be null */
31
31
  export type PerpDexsResponse = (null | PerpDex)[];
32
+ export interface PreTransferCheckResp {
33
+ fee: string;
34
+ isSanctioned: boolean;
35
+ userExists: boolean;
36
+ userHasSentTx: boolean;
37
+ }
32
38
  export interface UserHistoricalOrders {
33
39
  order: {
34
40
  coin: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/hyperliquid-sdk",
3
- "version": "1.1.6-beta.0",
3
+ "version": "1.1.6-beta.1",
4
4
  "description": "Simplified Hyperliquid Perpetuals Trading SDK for Frontend Applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",