@imbingox/acex 0.3.0-beta.0 → 0.3.0-beta.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.
@@ -1,6 +1,12 @@
1
- export const SUPPORTED_EXCHANGES = ["binance", "okx", "bybit", "gate"] as const;
1
+ export const SUPPORTED_VENUES = [
2
+ "binance",
3
+ "okx",
4
+ "bybit",
5
+ "gate",
6
+ "juplend",
7
+ ] as const;
2
8
 
3
- export type Exchange = (typeof SUPPORTED_EXCHANGES)[number];
9
+ export type Venue = (typeof SUPPORTED_VENUES)[number];
4
10
 
5
11
  export type ClientStatus =
6
12
  | "idle"
@@ -30,6 +36,9 @@ export interface AccountRuntimeOptions {
30
36
  streamReconnectDelayMs?: number;
31
37
  streamReconnectMaxDelayMs?: number;
32
38
  listenKeyKeepAliveMs?: number;
39
+ juplend?: {
40
+ pollIntervalMs?: number;
41
+ };
33
42
  }
34
43
 
35
44
  export interface CreateClientOptions {
@@ -47,16 +56,41 @@ export interface AccountCredentials {
47
56
  extra?: Record<string, string>;
48
57
  }
49
58
 
50
- export interface RegisterAccountInput {
59
+ export interface BinanceAccountOptions {
60
+ timestamp?: number;
61
+ recvWindow?: number;
62
+ }
63
+
64
+ export interface JuplendAccountCredentials {
65
+ apiKey: string;
66
+ }
67
+
68
+ export interface JuplendAccountOptions {
69
+ walletAddress: string;
70
+ positionId?: string;
71
+ }
72
+
73
+ export interface RegisterCexAccountInput {
51
74
  accountId: string;
52
- exchange: Exchange;
75
+ venue: Exclude<Venue, "juplend">;
53
76
  credentials?: AccountCredentials;
54
- options?: Record<string, unknown>;
77
+ options?: BinanceAccountOptions;
55
78
  }
56
79
 
80
+ export interface RegisterJuplendAccountInput {
81
+ accountId: string;
82
+ venue: "juplend";
83
+ credentials: JuplendAccountCredentials;
84
+ options: JuplendAccountOptions;
85
+ }
86
+
87
+ export type RegisterAccountInput =
88
+ | RegisterCexAccountInput
89
+ | RegisterJuplendAccountInput;
90
+
57
91
  export interface RegisterAccountResult {
58
92
  accountId: string;
59
- exchange: Exchange;
93
+ venue: Venue;
60
94
  }
61
95
 
62
96
  export interface StopOptions {
@@ -66,7 +100,7 @@ export interface StopOptions {
66
100
 
67
101
  export interface AcexInternalError {
68
102
  source: "client" | "market" | "account" | "order" | "adapter" | "runtime";
69
- exchange?: Exchange;
103
+ venue?: Venue;
70
104
  accountId?: string;
71
105
  symbol?: string;
72
106
  error: Error;
@@ -88,6 +122,8 @@ export type PrivateRuntimeStatus =
88
122
  export type PrivateRuntimeReason =
89
123
  | "credentials_missing"
90
124
  | "auth_failed"
125
+ | "http_failed"
126
+ | "rate_limited"
91
127
  | "ws_disconnected"
92
128
  | "heartbeat_timeout"
93
129
  | "reconciling";