@pear-protocol/core-sdk 0.0.22 → 0.0.23

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.
@@ -63,11 +63,43 @@ declare class Core {
63
63
  delete: (id: string, headers?: ClientHeaders) => Promise<void>;
64
64
  credentials: (id: string, headers?: ClientHeaders) => Promise<{
65
65
  connector: "hyperliquid";
66
+ account: {
67
+ id: string;
68
+ alias: string;
69
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
70
+ exchangeIdentifier: string;
71
+ createdAt: string;
72
+ updatedAt: string;
73
+ metadata?: {
74
+ agentWalletAddress: string;
75
+ isSubaccount: boolean;
76
+ mainAccountAddress: string;
77
+ } | {
78
+ l1_address: string;
79
+ } | undefined;
80
+ deletedAt?: string | undefined;
81
+ };
66
82
  credentials: {
67
83
  signer_key: string;
68
84
  };
69
85
  } | {
70
86
  connector: "binance";
87
+ account: {
88
+ id: string;
89
+ alias: string;
90
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
91
+ exchangeIdentifier: string;
92
+ createdAt: string;
93
+ updatedAt: string;
94
+ metadata?: {
95
+ agentWalletAddress: string;
96
+ isSubaccount: boolean;
97
+ mainAccountAddress: string;
98
+ } | {
99
+ l1_address: string;
100
+ } | undefined;
101
+ deletedAt?: string | undefined;
102
+ };
71
103
  credentials: {
72
104
  read: {
73
105
  api_key: string;
@@ -80,12 +112,44 @@ declare class Core {
80
112
  };
81
113
  } | {
82
114
  connector: "bybit";
115
+ account: {
116
+ id: string;
117
+ alias: string;
118
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
119
+ exchangeIdentifier: string;
120
+ createdAt: string;
121
+ updatedAt: string;
122
+ metadata?: {
123
+ agentWalletAddress: string;
124
+ isSubaccount: boolean;
125
+ mainAccountAddress: string;
126
+ } | {
127
+ l1_address: string;
128
+ } | undefined;
129
+ deletedAt?: string | undefined;
130
+ };
83
131
  credentials: {
84
132
  api_key: string;
85
133
  api_secret: string;
86
134
  };
87
135
  } | {
88
136
  connector: "okx";
137
+ account: {
138
+ id: string;
139
+ alias: string;
140
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
141
+ exchangeIdentifier: string;
142
+ createdAt: string;
143
+ updatedAt: string;
144
+ metadata?: {
145
+ agentWalletAddress: string;
146
+ isSubaccount: boolean;
147
+ mainAccountAddress: string;
148
+ } | {
149
+ l1_address: string;
150
+ } | undefined;
151
+ deletedAt?: string | undefined;
152
+ };
89
153
  credentials: {
90
154
  api_key: string;
91
155
  api_secret: string;
@@ -93,6 +157,22 @@ declare class Core {
93
157
  };
94
158
  } | {
95
159
  connector: "lighter";
160
+ account: {
161
+ id: string;
162
+ alias: string;
163
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
164
+ exchangeIdentifier: string;
165
+ createdAt: string;
166
+ updatedAt: string;
167
+ metadata?: {
168
+ agentWalletAddress: string;
169
+ isSubaccount: boolean;
170
+ mainAccountAddress: string;
171
+ } | {
172
+ l1_address: string;
173
+ } | undefined;
174
+ deletedAt?: string | undefined;
175
+ };
96
176
  credentials: {
97
177
  api_private_key: string;
98
178
  api_key_index: number;
@@ -352,6 +432,16 @@ declare class Core {
352
432
  mark: Record<string, string>;
353
433
  }>;
354
434
  };
435
+ rebalance: {
436
+ manually: (positionId: string, body: HttpTypes.RebalanceManually, headers?: ClientHeaders) => Promise<{
437
+ plan: {
438
+ outcome: "full_rebalance";
439
+ } | {
440
+ outcome: "partial_rebalance" | "no_rebalance";
441
+ messages: [string, ...string[]];
442
+ };
443
+ }>;
444
+ };
355
445
  schedules: {
356
446
  list: (query: HttpTypes.ScheduleListParamsInput, headers?: ClientHeaders) => Promise<{
357
447
  limit: number;
@@ -123,6 +123,15 @@ class Core {
123
123
  });
124
124
  }
125
125
  };
126
+ rebalance = {
127
+ manually: async (positionId, body, headers) => {
128
+ return await this.client.fetch(`/rebalance/manually/${positionId}`, {
129
+ method: "POST",
130
+ headers,
131
+ body
132
+ });
133
+ }
134
+ };
126
135
  schedules = {
127
136
  list: async (query, headers) => {
128
137
  return await this.client.fetch(`/schedules`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/core-sdk",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "description": "Pear Protocol Core SDK",
5
5
  "private": false,
6
6
  "type": "module",
@@ -25,8 +25,8 @@
25
25
  "typecheck": "tsc --noEmit"
26
26
  },
27
27
  "dependencies": {
28
- "@pear-protocol/types": "^0.0.19",
29
- "@pear-protocol/utils": "^0.0.19",
28
+ "@pear-protocol/types": "^0.0.20",
29
+ "@pear-protocol/utils": "^0.0.20",
30
30
  "qs": "^6.14.0"
31
31
  },
32
32
  "devDependencies": {