@pear-protocol/exchanges-sdk 0.0.15 → 0.0.16
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.
- package/dist/account/account-manager.js +1 -1
- package/dist/account/exchanges/binance/orchestrator.js +2 -2
- package/dist/account/exchanges/bybit/orchestrator.js +2 -2
- package/dist/account/exchanges/hyperliquid/asset-tracker.d.ts +1 -1
- package/dist/account/exchanges/hyperliquid/orchestrator.js +1 -1
- package/dist/credentials.js +1 -1
- package/package.json +2 -2
|
@@ -85,7 +85,7 @@ class AccountManager {
|
|
|
85
85
|
async resolveCredentials(tradeAccountId, exchange) {
|
|
86
86
|
const creds = await this.credentials.getOrFetch(tradeAccountId);
|
|
87
87
|
if (exchange === "hyperliquid") {
|
|
88
|
-
const { accounts } = await this.sdk.
|
|
88
|
+
const { accounts } = await this.sdk.core.accounts.list();
|
|
89
89
|
const account = accounts.find((a) => a.id === tradeAccountId);
|
|
90
90
|
if (!account) {
|
|
91
91
|
throw new Error(`Trade account ${tradeAccountId} not found`);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BaseOrchestrator } from '../base';
|
|
2
|
+
import { BinanceAssetTracker } from './asset-tracker';
|
|
2
3
|
import { DEFAULT_LISTEN_KEY_REFRESH_MS, DEFAULT_ACCOUNT_POLL_MS } from './const';
|
|
3
4
|
import { fetchAccountStatus, fetchAllPositionRisk, fetchMultiAssetsMargin, createListenKey, keepAliveListenKey } from './rest';
|
|
5
|
+
import { BinanceStateHandler } from './state-handler';
|
|
4
6
|
import './types';
|
|
5
7
|
import { BinanceWs } from './ws';
|
|
6
|
-
import { BinanceStateHandler } from './state-handler';
|
|
7
|
-
import { BinanceAssetTracker } from './asset-tracker';
|
|
8
8
|
|
|
9
9
|
class BinanceOrchestrator extends BaseOrchestrator {
|
|
10
10
|
ws = null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseOrchestrator } from '../base';
|
|
2
|
+
import { BybitAssetTracker } from './asset-tracker';
|
|
2
3
|
import { fetchWalletBalance, fetchPositions, fetchAccountInfo } from './rest';
|
|
4
|
+
import { BybitStateHandler } from './state-handler';
|
|
3
5
|
import './types';
|
|
4
6
|
import { BybitWs } from './ws';
|
|
5
|
-
import { BybitStateHandler } from './state-handler';
|
|
6
|
-
import { BybitAssetTracker } from './asset-tracker';
|
|
7
7
|
|
|
8
8
|
class BybitOrchestrator extends BaseOrchestrator {
|
|
9
9
|
ws = null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as StateUpdate } from '../../../types-Caz2X4h0.js';
|
|
2
1
|
import { WebSocket } from 'partysocket';
|
|
2
|
+
import { S as StateUpdate } from '../../../types-Caz2X4h0.js';
|
|
3
3
|
import { ActiveAssetDataEvent } from './types.js';
|
|
4
4
|
import '@pear-protocol/types';
|
|
5
5
|
import '../bybit/types.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createWs, waitForOpen, sendWs } from '../../../utils/ws';
|
|
2
2
|
import { BaseOrchestrator } from '../base';
|
|
3
|
+
import { HyperliquidAssetTracker } from './asset-tracker';
|
|
3
4
|
import { LOCKED_TRACKED_COINS } from './const';
|
|
4
5
|
import { HyperliquidStateHandler } from './state-handler';
|
|
5
|
-
import { HyperliquidAssetTracker } from './asset-tracker';
|
|
6
6
|
|
|
7
7
|
const HL_WS_URL = "wss://api.hyperliquid.xyz/ws";
|
|
8
8
|
const HL_INFO_URL = "https://api.hyperliquid.xyz/info";
|
package/dist/credentials.js
CHANGED
|
@@ -8,7 +8,7 @@ class Credentials {
|
|
|
8
8
|
* Fetch exchange credentials from the backend and cache them in memory.
|
|
9
9
|
*/
|
|
10
10
|
async fetch(tradeAccountId) {
|
|
11
|
-
const response = await this.sdk.
|
|
11
|
+
const response = await this.sdk.core.accounts.credentials(tradeAccountId);
|
|
12
12
|
const credentials = response.credentials;
|
|
13
13
|
this.cache.set(tradeAccountId, { credentials, connector: response.connector });
|
|
14
14
|
return credentials;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pear-protocol/exchanges-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "Pear Protocol Exchanges SDK",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"typecheck": "tsc --noEmit"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@pear-protocol/core-sdk": "0.0.
|
|
28
|
+
"@pear-protocol/core-sdk": "0.0.15",
|
|
29
29
|
"@pear-protocol/types": "0.0.13",
|
|
30
30
|
"@pear-protocol/utils": "0.0.13",
|
|
31
31
|
"partysocket": "^1.0.3"
|