@rabby-wallet/hyperliquid-sdk 1.0.7 → 1.0.8
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.
|
@@ -20,6 +20,9 @@ export declare class ExchangeClient {
|
|
|
20
20
|
get address(): string;
|
|
21
21
|
updateExchangeAgent(agentPrivateKey: string, agentPublicKey: string, agentName?: string): void;
|
|
22
22
|
private getAgentPrivateKey;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated This method is deprecated. Use the new builder configuration in constructor instead.
|
|
25
|
+
*/
|
|
23
26
|
updateBuilder(address: string, fee: number): Promise<any>;
|
|
24
27
|
updateLeverage(params: UpdateLeverageParams): Promise<any>;
|
|
25
28
|
/**
|
|
@@ -103,7 +103,9 @@ class ExchangeClient {
|
|
|
103
103
|
}
|
|
104
104
|
return this.agentPrivateKey;
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
/**
|
|
107
|
+
* @deprecated This method is deprecated. Use the new builder configuration in constructor instead.
|
|
108
|
+
*/
|
|
107
109
|
updateBuilder(address, fee) {
|
|
108
110
|
return __awaiter(this, void 0, void 0, function* () {
|
|
109
111
|
if (fee < 0 || fee > 100) {
|
|
@@ -151,10 +153,10 @@ class ExchangeClient {
|
|
|
151
153
|
orders: [orderWire],
|
|
152
154
|
grouping: 'na',
|
|
153
155
|
};
|
|
154
|
-
if (
|
|
156
|
+
if (params.builder) {
|
|
155
157
|
action.builder = {
|
|
156
|
-
b:
|
|
157
|
-
f:
|
|
158
|
+
b: params.builder.address,
|
|
159
|
+
f: params.builder.fee,
|
|
158
160
|
};
|
|
159
161
|
}
|
|
160
162
|
const signature = (0, signer_1.signL1AgentAction)(this.getAgentPrivateKey(), action, this.isTestnet, nonce);
|
|
@@ -226,6 +228,7 @@ class ExchangeClient {
|
|
|
226
228
|
}
|
|
227
229
|
const res = yield this.multiOrder({
|
|
228
230
|
orders,
|
|
231
|
+
builder: params.builder,
|
|
229
232
|
});
|
|
230
233
|
return res;
|
|
231
234
|
}
|
|
@@ -249,6 +252,7 @@ class ExchangeClient {
|
|
|
249
252
|
}];
|
|
250
253
|
const res = yield this.multiOrder({
|
|
251
254
|
orders,
|
|
255
|
+
builder: params.builder,
|
|
252
256
|
});
|
|
253
257
|
return res;
|
|
254
258
|
}
|
|
@@ -284,10 +288,10 @@ class ExchangeClient {
|
|
|
284
288
|
orders: orderWires,
|
|
285
289
|
grouping: params.grouping || 'na',
|
|
286
290
|
};
|
|
287
|
-
if (
|
|
291
|
+
if (params.builder) {
|
|
288
292
|
action.builder = {
|
|
289
|
-
b:
|
|
290
|
-
f:
|
|
293
|
+
b: params.builder.address,
|
|
294
|
+
f: params.builder.fee,
|
|
291
295
|
};
|
|
292
296
|
}
|
|
293
297
|
const signature = (0, signer_1.signL1AgentAction)(this.getAgentPrivateKey(), action, this.isTestnet, nonce);
|
|
@@ -338,7 +342,8 @@ class ExchangeClient {
|
|
|
338
342
|
}
|
|
339
343
|
return this.multiOrder({
|
|
340
344
|
orders,
|
|
341
|
-
grouping: 'positionTpsl'
|
|
345
|
+
grouping: 'positionTpsl',
|
|
346
|
+
builder: params.builder,
|
|
342
347
|
});
|
|
343
348
|
});
|
|
344
349
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -194,6 +194,10 @@ export interface MarketOrderParams {
|
|
|
194
194
|
tpTriggerPx?: string;
|
|
195
195
|
slTriggerPx?: string;
|
|
196
196
|
slippage?: number;
|
|
197
|
+
builder?: {
|
|
198
|
+
address: string;
|
|
199
|
+
fee: number;
|
|
200
|
+
};
|
|
197
201
|
}
|
|
198
202
|
export interface CancelResponse {
|
|
199
203
|
status: 'ok';
|
|
@@ -357,6 +361,10 @@ export interface PlaceOrderParams {
|
|
|
357
361
|
limitPx: string;
|
|
358
362
|
reduceOnly?: boolean;
|
|
359
363
|
orderType?: any;
|
|
364
|
+
builder?: {
|
|
365
|
+
address: string;
|
|
366
|
+
fee: number;
|
|
367
|
+
};
|
|
360
368
|
}
|
|
361
369
|
export interface UpdateLeverageParams {
|
|
362
370
|
coin: string;
|
|
@@ -368,10 +376,18 @@ export interface BindTpslByOrderIdParams {
|
|
|
368
376
|
slTriggerPx?: string;
|
|
369
377
|
coin: string;
|
|
370
378
|
isBuy: boolean;
|
|
379
|
+
builder?: {
|
|
380
|
+
address: string;
|
|
381
|
+
fee: number;
|
|
382
|
+
};
|
|
371
383
|
}
|
|
372
384
|
export interface MultiOrderParams {
|
|
373
385
|
orders: PlaceOrderParams[];
|
|
374
386
|
grouping?: string;
|
|
387
|
+
builder?: {
|
|
388
|
+
address: string;
|
|
389
|
+
fee: number;
|
|
390
|
+
};
|
|
375
391
|
}
|
|
376
392
|
export interface CancelOrderParams {
|
|
377
393
|
coin: string;
|