@n1xyz/nord-ts 0.3.2 → 0.3.3
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/client/Nord.d.ts +9 -3
- package/dist/gen/openapi.d.ts +247 -4
- package/dist/index.browser.js +11442 -11226
- package/dist/index.common.js +222 -1430
- package/dist/types.d.ts +13 -2
- package/dist/websocket/NordWebSocketClient.d.ts +1 -0
- package/dist/websocket/Subscriber.d.ts +7 -1
- package/dist/websocket/events.d.ts +2 -1
- package/dist/websocket/index.d.ts +1 -1
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Connection } from "@solana/web3.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* Nord subscription type for trades or deltas
|
|
7
7
|
*/
|
|
8
|
-
export type SubscriptionType = "trades" | "deltas" | "account";
|
|
8
|
+
export type SubscriptionType = "trades" | "deltas" | "account" | "candle";
|
|
9
9
|
/**
|
|
10
10
|
* Pattern for a valid Nord subscription
|
|
11
11
|
* Format should be: "<type>@<parameter>"
|
|
@@ -196,6 +196,7 @@ export declare enum WebSocketMessageType {
|
|
|
196
196
|
DeltaUpdate = "delta",
|
|
197
197
|
AccountUpdate = "account"
|
|
198
198
|
}
|
|
199
|
+
export type CandleResolution = "1" | "5" | "15" | "30" | "60" | "1D" | "1W" | "1M";
|
|
199
200
|
/**
|
|
200
201
|
* WebSocket trade update message
|
|
201
202
|
*/
|
|
@@ -242,13 +243,23 @@ export interface WebSocketAccountUpdate {
|
|
|
242
243
|
}>;
|
|
243
244
|
balances: Record<string, number>;
|
|
244
245
|
}
|
|
246
|
+
export interface WebSocketCandleUpdate {
|
|
247
|
+
res: CandleResolution;
|
|
248
|
+
mid: number;
|
|
249
|
+
t: number;
|
|
250
|
+
o: number;
|
|
251
|
+
h: number;
|
|
252
|
+
l: number;
|
|
253
|
+
c: number;
|
|
254
|
+
v: number;
|
|
255
|
+
}
|
|
245
256
|
export type WebSocketMessage = {
|
|
246
257
|
trades: WebSocketTradeUpdate;
|
|
247
258
|
} | {
|
|
248
259
|
delta: WebSocketDeltaUpdate;
|
|
249
260
|
} | {
|
|
250
261
|
account: WebSocketAccountUpdate;
|
|
251
|
-
};
|
|
262
|
+
} | WebSocketCandleUpdate;
|
|
252
263
|
export interface SPLTokenInfo {
|
|
253
264
|
mint: string;
|
|
254
265
|
precision: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from "events";
|
|
2
|
-
import { Account, DeltaEvent, WebSocketDeltaUpdate, SubscriberConfig, Trades, WebSocketTradeUpdate } from "../types";
|
|
2
|
+
import { Account, DeltaEvent, WebSocketDeltaUpdate, SubscriberConfig, Trades, WebSocketTradeUpdate, WebSocketCandleUpdate } from "../types";
|
|
3
3
|
/**
|
|
4
4
|
* Subscriber class for handling WebSocket subscriptions
|
|
5
5
|
*/
|
|
@@ -35,3 +35,9 @@ export interface TradeSubscription extends EventEmitter {
|
|
|
35
35
|
close(): void;
|
|
36
36
|
removeAllListeners(event?: string): this;
|
|
37
37
|
}
|
|
38
|
+
export interface CandleSubscription extends EventEmitter {
|
|
39
|
+
on(event: "message", listener: (data: WebSocketCandleUpdate) => void): this;
|
|
40
|
+
on(event: "error", listener: (error: Error) => void): this;
|
|
41
|
+
close(): void;
|
|
42
|
+
removeAllListeners(event?: string): this;
|
|
43
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WebSocketTradeUpdate, WebSocketDeltaUpdate, WebSocketAccountUpdate } from "../types";
|
|
1
|
+
import { WebSocketTradeUpdate, WebSocketDeltaUpdate, WebSocketAccountUpdate, WebSocketCandleUpdate } from "../types";
|
|
2
2
|
/**
|
|
3
3
|
* Event type definitions for the NordWebSocketClient
|
|
4
4
|
*/
|
|
@@ -9,6 +9,7 @@ export interface NordWebSocketEvents {
|
|
|
9
9
|
trade: (update: WebSocketTradeUpdate) => void;
|
|
10
10
|
delta: (update: WebSocketDeltaUpdate) => void;
|
|
11
11
|
account: (update: WebSocketAccountUpdate) => void;
|
|
12
|
+
candle: (update: WebSocketCandleUpdate) => void;
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* Type declaration for NordWebSocketClient event methods
|
|
@@ -16,4 +16,4 @@ export { NordWebSocketClient, NordWebSocketEvents, NordWebSocketClientEvents, Su
|
|
|
16
16
|
* @returns WebSocket client
|
|
17
17
|
* @throws {NordError} If initialization fails or invalid subscription is provided
|
|
18
18
|
*/
|
|
19
|
-
export declare function initWebSocketClient(webServerUrl: string, subscriptions?: SubscriptionPattern[] | "trades" | "delta" | "account"): NordWebSocketClient;
|
|
19
|
+
export declare function initWebSocketClient(webServerUrl: string, subscriptions?: SubscriptionPattern[] | "trades" | "delta" | "account" | "candle"): NordWebSocketClient;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n1xyz/nord-ts",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Typescript for Nord",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@bufbuild/protobuf": "^2.6.3",
|
|
50
|
-
"@n1xyz/proton": "0.1.
|
|
50
|
+
"@n1xyz/proton": "0.1.0",
|
|
51
51
|
"@noble/curves": "^1.9.6",
|
|
52
52
|
"@noble/ed25519": "^2.3.0",
|
|
53
53
|
"@noble/hashes": "^1.8.0",
|