@rabby-wallet/hyperliquid-sdk 1.1.2-beta.3 → 1.1.2-beta.5

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.
@@ -269,6 +269,7 @@ class ExchangeClient {
269
269
  }
270
270
  const res = yield this.multiOrder({
271
271
  orders,
272
+ grouping: 'positionTpsl',
272
273
  builder: params.builder,
273
274
  });
274
275
  return res;
@@ -729,12 +730,14 @@ class ExchangeClient {
729
730
  const nonce = Date.now();
730
731
  const action = {
731
732
  type: constants_1.ExchangeType.TWAP_ORDER,
732
- a: yield this.symbolConversion.getAssetIndex(params.coin),
733
- b: params.isBuy,
734
- s: (0, number_1.removeTrailingZeros)(params.sz),
735
- r: params.reduceOnly || false,
736
- m: params.durationMillis,
737
- t: params.randomizeDelay || false,
733
+ twap: {
734
+ a: yield this.symbolConversion.getAssetIndex(params.coin),
735
+ b: params.isBuy,
736
+ s: (0, number_1.removeTrailingZeros)(params.sz),
737
+ r: params.reduceOnly || false,
738
+ m: params.durationMins,
739
+ t: params.randomizeDelay || false,
740
+ },
738
741
  };
739
742
  if (params.builder) {
740
743
  action.builder = {
@@ -758,8 +761,10 @@ class ExchangeClient {
758
761
  const nonce = Date.now();
759
762
  const action = {
760
763
  type: constants_1.ExchangeType.TWAP_CANCEL,
761
- a: yield this.symbolConversion.getAssetIndex(params.coin),
762
- t: params.twapId,
764
+ twap: {
765
+ a: yield this.symbolConversion.getAssetIndex(params.coin),
766
+ t: params.twapId,
767
+ },
763
768
  };
764
769
  const signature = (0, signer_1.signL1AgentAction)(this.getAgentPrivateKey(), action, this.isTestnet, nonce);
765
770
  return this.httpClient.exchange({
@@ -46,6 +46,7 @@ export interface OpenOrder {
46
46
  orderType: 'Take Profit Market' | 'Stop Market';
47
47
  origSz: '0.0';
48
48
  tif: null;
49
+ children?: OpenOrder[];
49
50
  }
50
51
  export interface OrderRequest {
51
52
  asset: AssetId;
@@ -440,7 +441,7 @@ export interface BindTpslByOrderIdParams {
440
441
  }
441
442
  export interface MultiOrderParams {
442
443
  orders: PlaceOrderParams[];
443
- grouping?: string;
444
+ grouping?: "na" | "normalTpsl" | "positionTpsl";
444
445
  builder?: {
445
446
  address: string;
446
447
  fee: number;
@@ -524,7 +525,7 @@ export interface TwapOrderParams {
524
525
  isBuy: boolean;
525
526
  sz: string;
526
527
  reduceOnly?: boolean;
527
- durationMillis: number;
528
+ durationMins: number;
528
529
  randomizeDelay?: boolean;
529
530
  builder?: {
530
531
  address: string;
@@ -610,12 +611,17 @@ export interface FundingHistoryItem {
610
611
  premium: string;
611
612
  time: number;
612
613
  }
613
- export interface UserFunding {
614
- time: number;
614
+ export interface UserFundingDelta {
615
615
  coin: string;
616
- usdc: string;
617
- szi: string;
618
616
  fundingRate: string;
617
+ szi: string;
618
+ type: 'funding';
619
+ usdc: string;
620
+ }
621
+ export interface UserFunding {
622
+ delta: UserFundingDelta;
623
+ hash: string;
624
+ time: number;
619
625
  }
620
626
  export interface Notification {
621
627
  notification: string;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/hyperliquid-sdk",
3
- "version": "1.1.2-beta.3",
3
+ "version": "1.1.2-beta.5",
4
4
  "description": "Simplified Hyperliquid Perpetuals Trading SDK for Frontend Applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,7 +8,6 @@
8
8
  "dist"
9
9
  ],
10
10
  "publishConfig": {
11
-
12
11
  "access": "public"
13
12
  },
14
13
  "scripts": {