@rabby-wallet/hyperliquid-sdk 1.0.0-beta.12 → 1.0.0-beta.14

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.
@@ -478,8 +478,8 @@ class ExchangeClient {
478
478
  action,
479
479
  payloadTypes: [
480
480
  { name: 'hyperliquidChain', type: 'string' },
481
- { name: 'signatureChainId', type: 'string' },
482
- { name: 'builder', type: 'string' },
481
+ { name: 'maxFeeRate', type: 'string' },
482
+ { name: 'builder', type: 'address' },
483
483
  { name: 'nonce', type: 'uint64' },
484
484
  ],
485
485
  primaryType: 'HyperliquidTransaction:ApproveBuilderFee',
@@ -35,9 +35,9 @@ export declare class InfoClient {
35
35
  */
36
36
  candleSnapshot(coin: string, interval: string, startTime?: number, endTime?: number): Promise<CandleSnapshot>;
37
37
  /**
38
- * Check builder fee approval status
38
+ * Check max builder fee
39
39
  */
40
- checkBuilderFeeApproval(builder: string, address?: string): Promise<any>;
40
+ getMaxBuilderFee(builder: string, address?: string): Promise<number>;
41
41
  /**
42
42
  * Get user role
43
43
  */
@@ -129,12 +129,12 @@ class InfoClient {
129
129
  });
130
130
  }
131
131
  /**
132
- * Check builder fee approval status
132
+ * Check max builder fee
133
133
  */
134
- checkBuilderFeeApproval(builder, address) {
134
+ getMaxBuilderFee(builder, address) {
135
135
  return __awaiter(this, void 0, void 0, function* () {
136
136
  return this.httpClient.info({
137
- type: constants_1.InfoType.CHECK_BUILDER_FEE_APPROVAL,
137
+ type: constants_1.InfoType.MAX_BUILDER_FEE,
138
138
  user: address || this.masterAddress,
139
139
  builder,
140
140
  });
@@ -82,9 +82,10 @@ class WebSocketClient {
82
82
  }
83
83
  };
84
84
  this.ws.onclose = () => {
85
+ var _a;
85
86
  this.isConnecting = false;
86
87
  console.log('WebSocket disconnected');
87
- if (this.config.autoReconnect && this.reconnectAttempts < this.config.maxReconnectAttempts) {
88
+ if (this.config.autoReconnect && this.reconnectAttempts < this.config.maxReconnectAttempts && ((_a = this.ws) === null || _a === void 0 ? void 0 : _a.readyState) === WebSocket.OPEN) {
88
89
  this.reconnectAttempts++;
89
90
  console.log(`Reconnecting... (${this.reconnectAttempts}/${this.config.maxReconnectAttempts})`);
90
91
  setTimeout(() => this.connect(), this.config.reconnectDelay);
@@ -42,7 +42,7 @@ export declare enum InfoType {
42
42
  FRONTEND_OPEN_ORDERS = "frontendOpenOrders",
43
43
  PREDICTED_FUNDINGS = "predictedFundings",
44
44
  ACTIVE_ASSET_DATA = "activeAssetData",
45
- CHECK_BUILDER_FEE_APPROVAL = "checkBuilderFeeApproval",
45
+ MAX_BUILDER_FEE = "maxBuilderFee",
46
46
  USER_FEES = "userFees",
47
47
  USER_ROLE = "userRole",
48
48
  EXTRA_AGENTS = "extraAgents"
@@ -50,7 +50,7 @@ var InfoType;
50
50
  InfoType["FRONTEND_OPEN_ORDERS"] = "frontendOpenOrders";
51
51
  InfoType["PREDICTED_FUNDINGS"] = "predictedFundings";
52
52
  InfoType["ACTIVE_ASSET_DATA"] = "activeAssetData";
53
- InfoType["CHECK_BUILDER_FEE_APPROVAL"] = "checkBuilderFeeApproval";
53
+ InfoType["MAX_BUILDER_FEE"] = "maxBuilderFee";
54
54
  InfoType["USER_FEES"] = "userFees";
55
55
  InfoType["USER_ROLE"] = "userRole";
56
56
  InfoType["EXTRA_AGENTS"] = "extraAgents";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/hyperliquid-sdk",
3
- "version": "1.0.0-beta.12",
3
+ "version": "1.0.0-beta.14",
4
4
  "description": "Simplified Hyperliquid Perpetuals Trading SDK for Frontend Applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",