@bulletxyz/bullet-sdk 0.17.4-rc.0 → 0.17.4-rc.2
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/browser/index.js +36 -17
- package/dist/browser/index.js.map +2 -2
- package/dist/node/index.js +36 -17
- package/dist/node/index.js.map +2 -2
- package/dist/types/client.d.ts +1 -1
- package/dist/types/exchange.d.ts +2 -2
- package/dist/types/orderbook.d.ts +9 -7
- package/dist/types/websocket.d.ts +3 -2
- package/dist/types/zod-types/rest.d.ts +93 -93
- package/package.json +1 -1
package/dist/types/client.d.ts
CHANGED
|
@@ -78,8 +78,8 @@ export declare class Client {
|
|
|
78
78
|
active_size: Decimal;
|
|
79
79
|
full_size: Decimal;
|
|
80
80
|
order_type: "Limit" | "PostOnly" | "FillOrKill" | "ImmediateOrCancel" | "PostOnlySlide" | "PostOnlyFront";
|
|
81
|
+
parent_order_id: bigint | null;
|
|
81
82
|
linked_tpsl_order_ids: bigint[];
|
|
82
|
-
parent_order_id?: bigint | undefined;
|
|
83
83
|
}[];
|
|
84
84
|
}>;
|
|
85
85
|
}>;
|
package/dist/types/exchange.d.ts
CHANGED
|
@@ -18,6 +18,6 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
18
18
|
getMarginConfig(): Promise<MarginConfig | null>;
|
|
19
19
|
getPerpAssets(): Promise<Map<AssetId, string>>;
|
|
20
20
|
getBorrowLendAssets(): Promise<Map<AssetId, string>>;
|
|
21
|
-
subscribeOrderbook(assetId:
|
|
22
|
-
unsubscribeOrderbook(assetId:
|
|
21
|
+
subscribeOrderbook(assetId: AssetId): AsyncIterable<Orderbook>;
|
|
22
|
+
unsubscribeOrderbook(assetId: AssetId): Promise<void>;
|
|
23
23
|
}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
+
import Decimal from "decimal.js";
|
|
1
2
|
import type { Asset } from "./types";
|
|
2
3
|
import type { OrderbookData } from "./zod-types/rest";
|
|
3
4
|
import type { OrderbookUpdate } from "./zod-types/ws";
|
|
4
|
-
type Price =
|
|
5
|
-
type
|
|
6
|
-
type OrderbookLevel = [Price,
|
|
5
|
+
type Price = Decimal;
|
|
6
|
+
type Size = Decimal;
|
|
7
|
+
export type OrderbookLevel = [Price, Size];
|
|
7
8
|
export declare class Orderbook {
|
|
8
|
-
bids: Map<Price,
|
|
9
|
-
asks: Map<Price,
|
|
9
|
+
bids: Map<Price, Size>;
|
|
10
|
+
asks: Map<Price, Size>;
|
|
10
11
|
asset: Asset;
|
|
11
12
|
lastUpdated: number;
|
|
12
13
|
constructor(assetId: number, snapshot?: OrderbookUpdate);
|
|
13
|
-
protected updateBid(price:
|
|
14
|
-
protected updateAsk(price:
|
|
14
|
+
protected updateBid(price: Price, size: Size): void;
|
|
15
|
+
protected updateAsk(price: Price, size: Size): void;
|
|
15
16
|
applyDelta(delta: OrderbookUpdate): void;
|
|
16
17
|
getBids(levels?: number): OrderbookLevel[];
|
|
17
18
|
getAsks(levels?: number): OrderbookLevel[];
|
|
18
19
|
static fromOrderbookData(orderbook: OrderbookData): Orderbook;
|
|
20
|
+
static toOrderbookData(orderbook: Orderbook): OrderbookData;
|
|
19
21
|
toDisplay(levels?: number): string;
|
|
20
22
|
setLastUpdated(ts: number): void;
|
|
21
23
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Orderbook } from "./orderbook";
|
|
2
|
+
import type { AssetId } from "./types";
|
|
2
3
|
export declare class WebSocketManager {
|
|
3
4
|
private socket;
|
|
4
5
|
private orderbooks;
|
|
@@ -18,6 +19,6 @@ export declare class WebSocketManager {
|
|
|
18
19
|
private stopHeartbeat;
|
|
19
20
|
private sendSubscription;
|
|
20
21
|
sendMessage(message: string): void;
|
|
21
|
-
subscribeOrderbook(assetId:
|
|
22
|
-
unsubscribeOrderbook(assetId:
|
|
22
|
+
subscribeOrderbook(assetId: AssetId): AsyncIterable<Orderbook>;
|
|
23
|
+
unsubscribeOrderbook(assetId: AssetId): Promise<void>;
|
|
23
24
|
}
|