@nemesis-oss/binance-sdk 1.0.0 → 2.0.0
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/README.md +136 -8
- package/dist/index-BO27qOb5.d.cts +3887 -0
- package/dist/index-BO27qOb5.d.ts +3887 -0
- package/dist/index.cjs +2640 -629
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +62 -8
- package/dist/index.d.ts +62 -8
- package/dist/index.js +2536 -632
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.cjs +2429 -632
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.js +2430 -633
- package/dist/mcp/index.js.map +1 -1
- package/dist/tools/index.d.cts +2 -1
- package/dist/tools/index.d.ts +2 -1
- package/package.json +8 -3
- package/dist/index-D2T_Rhwj.d.cts +0 -2055
- package/dist/index-D2T_Rhwj.d.ts +0 -2055
|
@@ -0,0 +1,3887 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { EventEmitter } from 'node:events';
|
|
4
|
+
|
|
5
|
+
interface RateLimitUsage {
|
|
6
|
+
/** Highest `x-mbx-used-weight-*` value seen across all interval headers on the last response. */
|
|
7
|
+
usedWeight: number;
|
|
8
|
+
/** Per-header-suffix used-weight snapshot, e.g. `{ '1m': 120 }`. */
|
|
9
|
+
usedWeightByInterval: Record<string, number>;
|
|
10
|
+
/** Per-header-suffix order-count snapshot, e.g. `{ '10s': 3, '1d': 45 }`. */
|
|
11
|
+
orderCountByInterval: Record<string, number>;
|
|
12
|
+
lastUpdated: number;
|
|
13
|
+
}
|
|
14
|
+
interface RateLimitTrackerOptions {
|
|
15
|
+
/** Assumed weight-per-minute ceiling used to compute throttling delay. Binance's default IP limit is 6000 for most REST hosts. */
|
|
16
|
+
weightLimitPerMinute?: number;
|
|
17
|
+
/** Fraction of the weight limit at which the tracker starts delaying requests (0-1). Set >=1 to disable throttling. */
|
|
18
|
+
safetyMargin?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Tracks Binance's `X-MBX-USED-WEIGHT-*` / `X-MBX-ORDER-COUNT-*` response headers so callers can
|
|
22
|
+
* back off before hitting `-1003` (IP ban) instead of reacting to it after the fact.
|
|
23
|
+
*/
|
|
24
|
+
declare class RateLimitTracker {
|
|
25
|
+
private readonly weightLimitPerMinute;
|
|
26
|
+
private readonly safetyMargin;
|
|
27
|
+
private usage;
|
|
28
|
+
constructor(options?: RateLimitTrackerOptions);
|
|
29
|
+
update(headers: Record<string, string> | undefined): void;
|
|
30
|
+
getUsage(): Readonly<RateLimitUsage>;
|
|
31
|
+
/**
|
|
32
|
+
* Milliseconds a caller should wait before its next request, based on the most recently
|
|
33
|
+
* observed 1-minute weight usage. Returns 0 when usage is stale or under the safety margin.
|
|
34
|
+
*/
|
|
35
|
+
getThrottleDelayMs(): number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type SignatureAlgorithm = 'HMAC' | 'ED25519' | 'RSA';
|
|
39
|
+
interface SignerOptions {
|
|
40
|
+
algorithm?: SignatureAlgorithm;
|
|
41
|
+
/** HMAC secret string. Required when algorithm is 'HMAC' (the default). */
|
|
42
|
+
apiSecret?: string;
|
|
43
|
+
/** PEM-encoded private key (or raw Buffer). Required for 'ED25519' and 'RSA'. */
|
|
44
|
+
privateKey?: string | Buffer;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Signs Binance request payloads. HMAC-SHA256 (the classic API-secret flow) is the default;
|
|
48
|
+
* Ed25519 and RSA keys — which Binance now recommends over HMAC — are signed via `privateKey`.
|
|
49
|
+
*/
|
|
50
|
+
declare class Signer {
|
|
51
|
+
readonly algorithm: SignatureAlgorithm;
|
|
52
|
+
private readonly apiSecret?;
|
|
53
|
+
private readonly privateKey?;
|
|
54
|
+
constructor(options: SignerOptions);
|
|
55
|
+
canSign(): boolean;
|
|
56
|
+
sign(payload: string): string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface TradingPolicyOptions {
|
|
60
|
+
/**
|
|
61
|
+
* Intercept every mutating request (POST/PUT/DELETE) and throw {@link DryRunError} instead of
|
|
62
|
+
* sending it. Read-only GETs still hit the network, so an agent can research freely but
|
|
63
|
+
* cannot act.
|
|
64
|
+
*/
|
|
65
|
+
dryRun?: boolean;
|
|
66
|
+
/** Reject every mutating request outright. Unlike dryRun this is not a rehearsal mode. */
|
|
67
|
+
readOnly?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Allowlist of tradeable symbols. Any order-bearing request naming a symbol outside this
|
|
70
|
+
* list is rejected. Case-insensitive.
|
|
71
|
+
*/
|
|
72
|
+
allowedSymbols?: string[];
|
|
73
|
+
/**
|
|
74
|
+
* Hard cap on a single order's notional value, in quote currency. When set, an order whose
|
|
75
|
+
* notional cannot be determined from its parameters (e.g. a MARKET order with no price) is
|
|
76
|
+
* also rejected — an unverifiable order is not a safe order.
|
|
77
|
+
*/
|
|
78
|
+
maxNotionalPerOrder?: number;
|
|
79
|
+
/** Permit withdrawal requests. Defaults to false: opting into a policy at all denies withdrawals. */
|
|
80
|
+
allowWithdrawals?: boolean;
|
|
81
|
+
/** Permit account-to-account transfers. Defaults to true; set false to pin funds in place. */
|
|
82
|
+
allowTransfers?: boolean;
|
|
83
|
+
/** Extra path fragments to refuse, matched case-insensitively as substrings. */
|
|
84
|
+
blockedPaths?: string[];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Client-side guardrails evaluated before a request leaves the process.
|
|
88
|
+
*
|
|
89
|
+
* This exists for autonomous/LLM-driven callers: a misread prompt should not be able to spend
|
|
90
|
+
* the account. It is a defence-in-depth layer, not a substitute for exchange-side API-key
|
|
91
|
+
* restrictions (IP allowlists, disabled withdrawals) — anything that bypasses this HttpClient
|
|
92
|
+
* bypasses the policy too.
|
|
93
|
+
*/
|
|
94
|
+
declare class TradingPolicy {
|
|
95
|
+
private readonly options;
|
|
96
|
+
private readonly allowedSymbols?;
|
|
97
|
+
constructor(options?: TradingPolicyOptions);
|
|
98
|
+
/** Throws {@link PolicyViolationError} or {@link DryRunError} if the request is not permitted. */
|
|
99
|
+
check(method: HttpMethod, path: string, params?: Record<string, unknown>): void;
|
|
100
|
+
private checkSymbol;
|
|
101
|
+
private checkNotional;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
type AuthMode = 'public' | 'apiKey' | 'signed';
|
|
105
|
+
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
106
|
+
|
|
107
|
+
interface HttpClientOptions {
|
|
108
|
+
baseURL: string;
|
|
109
|
+
apiKey?: string;
|
|
110
|
+
apiSecret?: string;
|
|
111
|
+
/** PEM-encoded Ed25519 or RSA private key. When set, requests are signed with it instead of HMAC. */
|
|
112
|
+
privateKey?: string | Buffer;
|
|
113
|
+
/** Defaults to 'ED25519' when privateKey is set, otherwise 'HMAC'. */
|
|
114
|
+
signatureAlgorithm?: SignatureAlgorithm;
|
|
115
|
+
recvWindow?: number;
|
|
116
|
+
timeoutMs?: number;
|
|
117
|
+
maxRetries?: number;
|
|
118
|
+
minTimeMs?: number;
|
|
119
|
+
/** @deprecated unused; superseded by header-based tracking (rateLimitWeightPerMinute/rateLimitSafetyMargin). */
|
|
120
|
+
rateLimitTokensPerSecond?: number;
|
|
121
|
+
/** @deprecated unused; superseded by header-based tracking (rateLimitWeightPerMinute/rateLimitSafetyMargin). */
|
|
122
|
+
rateLimitMaxTokens?: number;
|
|
123
|
+
/** Assumed per-minute IP weight ceiling used to preempt -1003 bans. Binance's default is 6000 for most REST hosts. */
|
|
124
|
+
rateLimitWeightPerMinute?: number;
|
|
125
|
+
/** Fraction of rateLimitWeightPerMinute at which requests are delayed until the next minute window. Set >=1 to disable. */
|
|
126
|
+
rateLimitSafetyMargin?: number;
|
|
127
|
+
retryBaseDelayMs?: number;
|
|
128
|
+
retryMaxDelayMs?: number;
|
|
129
|
+
retryFactor?: number;
|
|
130
|
+
/** Custom keep-alive/https agent, e.g. for corporate proxies or connection pooling. */
|
|
131
|
+
httpsAgent?: AxiosRequestConfig['httpsAgent'];
|
|
132
|
+
/** Axios proxy configuration. */
|
|
133
|
+
proxy?: AxiosRequestConfig['proxy'];
|
|
134
|
+
/** Client-side guardrails evaluated before any mutating request is sent. */
|
|
135
|
+
policy?: TradingPolicy;
|
|
136
|
+
}
|
|
137
|
+
declare class HttpClient {
|
|
138
|
+
private readonly axios;
|
|
139
|
+
private readonly limiter;
|
|
140
|
+
private readonly signer;
|
|
141
|
+
private readonly rateLimitTracker;
|
|
142
|
+
private readonly policy?;
|
|
143
|
+
private readonly apiKey?;
|
|
144
|
+
private readonly recvWindow;
|
|
145
|
+
private readonly timeoutMs;
|
|
146
|
+
private maxRetries;
|
|
147
|
+
private minTimeMs;
|
|
148
|
+
private retryBaseDelayMs;
|
|
149
|
+
private retryMaxDelayMs;
|
|
150
|
+
private retryFactor;
|
|
151
|
+
private pendingRequests;
|
|
152
|
+
private timeOffsetMs;
|
|
153
|
+
constructor(options: HttpClientOptions);
|
|
154
|
+
get<T>(path: string, params?: Record<string, unknown>, mode?: AuthMode): Promise<T>;
|
|
155
|
+
post<T>(path: string, params?: Record<string, unknown>, mode?: AuthMode): Promise<T>;
|
|
156
|
+
put<T>(path: string, params?: Record<string, unknown>, mode?: AuthMode): Promise<T>;
|
|
157
|
+
delete<T>(path: string, params?: Record<string, unknown>, mode?: AuthMode): Promise<T>;
|
|
158
|
+
getRateLimiterStatus(): {
|
|
159
|
+
minTimeMs: number;
|
|
160
|
+
queueLength: number;
|
|
161
|
+
};
|
|
162
|
+
/** Snapshot of the most recently observed `X-MBX-USED-WEIGHT-*` / `X-MBX-ORDER-COUNT-*` response headers. */
|
|
163
|
+
getRateLimitUsage(): Readonly<RateLimitUsage>;
|
|
164
|
+
configureRateLimiter(options: {
|
|
165
|
+
minTimeMs?: number;
|
|
166
|
+
}): void;
|
|
167
|
+
getRetryConfig(): {
|
|
168
|
+
maxRetries: number;
|
|
169
|
+
baseDelayMs: number;
|
|
170
|
+
maxDelayMs: number;
|
|
171
|
+
factor: number;
|
|
172
|
+
};
|
|
173
|
+
configureRetry(options: {
|
|
174
|
+
maxRetries?: number;
|
|
175
|
+
baseDelayMs?: number;
|
|
176
|
+
maxDelayMs?: number;
|
|
177
|
+
factor?: number;
|
|
178
|
+
}): void;
|
|
179
|
+
/**
|
|
180
|
+
* Fetches server time from `timePath` (e.g. '/time', '/fapi/v1/time', '/dapi/v1/time') and
|
|
181
|
+
* stores the offset from local time, applied to every signed request's `timestamp` param.
|
|
182
|
+
* Mitigates `-1021` (timestamp outside recvWindow) errors caused by local clock drift.
|
|
183
|
+
*/
|
|
184
|
+
syncTime(timePath?: string): Promise<number>;
|
|
185
|
+
getTimeOffsetMs(): number;
|
|
186
|
+
private request;
|
|
187
|
+
private buildHeaders;
|
|
188
|
+
private buildUrl;
|
|
189
|
+
private appendQuery;
|
|
190
|
+
private buildQueryString;
|
|
191
|
+
private sign;
|
|
192
|
+
private requireApiKey;
|
|
193
|
+
private requestWithRetry;
|
|
194
|
+
private parseRetryAfterMs;
|
|
195
|
+
private shouldRetry;
|
|
196
|
+
private calculateDelay;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
declare const FundingRateSchema: z.ZodObject<{
|
|
200
|
+
symbol: z.ZodString;
|
|
201
|
+
fundingTime: z.ZodNumber;
|
|
202
|
+
fundingRate: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
203
|
+
markPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
type FundingRate = z.infer<typeof FundingRateSchema>;
|
|
206
|
+
declare const FundingRateHistorySchema: z.ZodArray<z.ZodObject<{
|
|
207
|
+
symbol: z.ZodString;
|
|
208
|
+
fundingTime: z.ZodNumber;
|
|
209
|
+
fundingRate: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
210
|
+
markPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
211
|
+
}, z.core.$strip>>;
|
|
212
|
+
declare const PremiumIndexSchema: z.ZodObject<{
|
|
213
|
+
symbol: z.ZodString;
|
|
214
|
+
markPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
215
|
+
indexPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
216
|
+
estimatedSettlePrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
217
|
+
lastFundingRate: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
218
|
+
nextFundingTime: z.ZodNumber;
|
|
219
|
+
interestRate: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
220
|
+
time: z.ZodNumber;
|
|
221
|
+
}, z.core.$strip>;
|
|
222
|
+
type PremiumIndex = z.infer<typeof PremiumIndexSchema>;
|
|
223
|
+
declare const OpenInterestSchema: z.ZodObject<{
|
|
224
|
+
symbol: z.ZodString;
|
|
225
|
+
openInterest: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
226
|
+
time: z.ZodNumber;
|
|
227
|
+
}, z.core.$strip>;
|
|
228
|
+
type OpenInterest = z.infer<typeof OpenInterestSchema>;
|
|
229
|
+
declare const OpenInterestHistEntrySchema: z.ZodObject<{
|
|
230
|
+
symbol: z.ZodString;
|
|
231
|
+
sumOpenInterest: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
232
|
+
sumOpenInterestValue: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
233
|
+
timestamp: z.ZodNumber;
|
|
234
|
+
}, z.core.$strip>;
|
|
235
|
+
type OpenInterestHistEntry = z.infer<typeof OpenInterestHistEntrySchema>;
|
|
236
|
+
declare const OpenInterestHistSchema: z.ZodArray<z.ZodObject<{
|
|
237
|
+
symbol: z.ZodString;
|
|
238
|
+
sumOpenInterest: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
239
|
+
sumOpenInterestValue: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
240
|
+
timestamp: z.ZodNumber;
|
|
241
|
+
}, z.core.$strip>>;
|
|
242
|
+
declare const LongShortRatioEntrySchema: z.ZodObject<{
|
|
243
|
+
symbol: z.ZodString;
|
|
244
|
+
longShortRatio: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
245
|
+
longAccount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
246
|
+
shortAccount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
247
|
+
timestamp: z.ZodNumber;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
type LongShortRatioEntry = z.infer<typeof LongShortRatioEntrySchema>;
|
|
250
|
+
declare const LongShortRatioSchema: z.ZodArray<z.ZodObject<{
|
|
251
|
+
symbol: z.ZodString;
|
|
252
|
+
longShortRatio: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
253
|
+
longAccount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
254
|
+
shortAccount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
255
|
+
timestamp: z.ZodNumber;
|
|
256
|
+
}, z.core.$strip>>;
|
|
257
|
+
declare const TakerLongShortRatioEntrySchema: z.ZodObject<{
|
|
258
|
+
buySellRatio: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
259
|
+
buyVol: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
260
|
+
sellVol: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
261
|
+
timestamp: z.ZodNumber;
|
|
262
|
+
}, z.core.$strip>;
|
|
263
|
+
type TakerLongShortRatioEntry = z.infer<typeof TakerLongShortRatioEntrySchema>;
|
|
264
|
+
declare const TakerLongShortRatioSchema: z.ZodArray<z.ZodObject<{
|
|
265
|
+
buySellRatio: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
266
|
+
buyVol: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
267
|
+
sellVol: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
268
|
+
timestamp: z.ZodNumber;
|
|
269
|
+
}, z.core.$strip>>;
|
|
270
|
+
|
|
271
|
+
declare const KlineIntervalSchema: z.ZodEnum<{
|
|
272
|
+
"1m": "1m";
|
|
273
|
+
"3m": "3m";
|
|
274
|
+
"5m": "5m";
|
|
275
|
+
"15m": "15m";
|
|
276
|
+
"30m": "30m";
|
|
277
|
+
"1h": "1h";
|
|
278
|
+
"2h": "2h";
|
|
279
|
+
"4h": "4h";
|
|
280
|
+
"6h": "6h";
|
|
281
|
+
"8h": "8h";
|
|
282
|
+
"12h": "12h";
|
|
283
|
+
"1d": "1d";
|
|
284
|
+
"3d": "3d";
|
|
285
|
+
"1w": "1w";
|
|
286
|
+
"1M": "1M";
|
|
287
|
+
}>;
|
|
288
|
+
type KlineInterval = z.infer<typeof KlineIntervalSchema>;
|
|
289
|
+
declare const KlineSchema: z.ZodPipe<z.ZodTuple<[z.ZodNumber, z.ZodString, z.ZodString, z.ZodString, z.ZodString, z.ZodString, z.ZodNumber, z.ZodString, z.ZodNumber, z.ZodString, z.ZodString, z.ZodString], null>, z.ZodTransform<{
|
|
290
|
+
openTime: number;
|
|
291
|
+
open: number;
|
|
292
|
+
high: number;
|
|
293
|
+
low: number;
|
|
294
|
+
close: number;
|
|
295
|
+
volume: number;
|
|
296
|
+
closeTime: number;
|
|
297
|
+
quoteAssetVolume: number;
|
|
298
|
+
trades: number;
|
|
299
|
+
takerBuyBaseVolume: number;
|
|
300
|
+
takerBuyQuoteVolume: number;
|
|
301
|
+
}, [number, string, string, string, string, string, number, string, number, string, string, string]>>;
|
|
302
|
+
type Kline = z.infer<typeof KlineSchema>;
|
|
303
|
+
declare const KlinesResponseSchema: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodNumber, z.ZodString, z.ZodString, z.ZodString, z.ZodString, z.ZodString, z.ZodNumber, z.ZodString, z.ZodNumber, z.ZodString, z.ZodString, z.ZodString], null>, z.ZodTransform<{
|
|
304
|
+
openTime: number;
|
|
305
|
+
open: number;
|
|
306
|
+
high: number;
|
|
307
|
+
low: number;
|
|
308
|
+
close: number;
|
|
309
|
+
volume: number;
|
|
310
|
+
closeTime: number;
|
|
311
|
+
quoteAssetVolume: number;
|
|
312
|
+
trades: number;
|
|
313
|
+
takerBuyBaseVolume: number;
|
|
314
|
+
takerBuyQuoteVolume: number;
|
|
315
|
+
}, [number, string, string, string, string, string, number, string, number, string, string, string]>>>;
|
|
316
|
+
declare const TickerPriceSchema: z.ZodObject<{
|
|
317
|
+
symbol: z.ZodString;
|
|
318
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
319
|
+
time: z.ZodOptional<z.ZodNumber>;
|
|
320
|
+
}, z.core.$strip>;
|
|
321
|
+
type TickerPrice = z.infer<typeof TickerPriceSchema>;
|
|
322
|
+
declare const Ticker24hrSchema: z.ZodObject<{
|
|
323
|
+
symbol: z.ZodString;
|
|
324
|
+
priceChange: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
325
|
+
priceChangePercent: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
326
|
+
weightedAvgPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
327
|
+
lastPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
328
|
+
lastQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
329
|
+
openPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
330
|
+
highPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
331
|
+
lowPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
332
|
+
volume: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
333
|
+
quoteVolume: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
334
|
+
openTime: z.ZodNumber;
|
|
335
|
+
closeTime: z.ZodNumber;
|
|
336
|
+
firstId: z.ZodNumber;
|
|
337
|
+
lastId: z.ZodNumber;
|
|
338
|
+
count: z.ZodNumber;
|
|
339
|
+
}, z.core.$strip>;
|
|
340
|
+
type Ticker24hr = z.infer<typeof Ticker24hrSchema>;
|
|
341
|
+
declare const BookTickerSchema: z.ZodObject<{
|
|
342
|
+
symbol: z.ZodString;
|
|
343
|
+
bidPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
344
|
+
bidQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
345
|
+
askPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
346
|
+
askQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
347
|
+
time: z.ZodOptional<z.ZodNumber>;
|
|
348
|
+
}, z.core.$strip>;
|
|
349
|
+
type BookTicker = z.infer<typeof BookTickerSchema>;
|
|
350
|
+
declare const DepthSnapshotSchema: z.ZodObject<{
|
|
351
|
+
lastUpdateId: z.ZodNumber;
|
|
352
|
+
bids: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodString, z.ZodString], null>, z.ZodTransform<{
|
|
353
|
+
price: number;
|
|
354
|
+
qty: number;
|
|
355
|
+
}, [string, string]>>>;
|
|
356
|
+
asks: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodString, z.ZodString], null>, z.ZodTransform<{
|
|
357
|
+
price: number;
|
|
358
|
+
qty: number;
|
|
359
|
+
}, [string, string]>>>;
|
|
360
|
+
}, z.core.$strip>;
|
|
361
|
+
type DepthSnapshot = z.infer<typeof DepthSnapshotSchema>;
|
|
362
|
+
declare const TradeSchema: z.ZodObject<{
|
|
363
|
+
id: z.ZodNumber;
|
|
364
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
365
|
+
qty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
366
|
+
quoteQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
367
|
+
time: z.ZodNumber;
|
|
368
|
+
isBuyerMaker: z.ZodBoolean;
|
|
369
|
+
}, z.core.$strip>;
|
|
370
|
+
type Trade = z.infer<typeof TradeSchema>;
|
|
371
|
+
declare const TradesResponseSchema: z.ZodArray<z.ZodObject<{
|
|
372
|
+
id: z.ZodNumber;
|
|
373
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
374
|
+
qty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
375
|
+
quoteQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
376
|
+
time: z.ZodNumber;
|
|
377
|
+
isBuyerMaker: z.ZodBoolean;
|
|
378
|
+
}, z.core.$strip>>;
|
|
379
|
+
declare const AggTradeSchema: z.ZodObject<{
|
|
380
|
+
a: z.ZodNumber;
|
|
381
|
+
p: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
382
|
+
q: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
383
|
+
f: z.ZodNumber;
|
|
384
|
+
l: z.ZodNumber;
|
|
385
|
+
T: z.ZodNumber;
|
|
386
|
+
m: z.ZodBoolean;
|
|
387
|
+
}, z.core.$strip>;
|
|
388
|
+
type AggTrade = z.infer<typeof AggTradeSchema>;
|
|
389
|
+
declare const AggTradesResponseSchema: z.ZodArray<z.ZodObject<{
|
|
390
|
+
a: z.ZodNumber;
|
|
391
|
+
p: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
392
|
+
q: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
393
|
+
f: z.ZodNumber;
|
|
394
|
+
l: z.ZodNumber;
|
|
395
|
+
T: z.ZodNumber;
|
|
396
|
+
m: z.ZodBoolean;
|
|
397
|
+
}, z.core.$strip>>;
|
|
398
|
+
declare const AvgPriceSchema: z.ZodObject<{
|
|
399
|
+
mins: z.ZodNumber;
|
|
400
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
401
|
+
}, z.core.$strip>;
|
|
402
|
+
type AvgPrice = z.infer<typeof AvgPriceSchema>;
|
|
403
|
+
declare const ExchangeSymbolSchema: z.ZodObject<{
|
|
404
|
+
symbol: z.ZodString;
|
|
405
|
+
status: z.ZodString;
|
|
406
|
+
baseAsset: z.ZodString;
|
|
407
|
+
quoteAsset: z.ZodString;
|
|
408
|
+
}, z.core.$loose>;
|
|
409
|
+
type ExchangeSymbol = z.infer<typeof ExchangeSymbolSchema>;
|
|
410
|
+
declare const ExchangeInfoSchema: z.ZodObject<{
|
|
411
|
+
timezone: z.ZodString;
|
|
412
|
+
serverTime: z.ZodNumber;
|
|
413
|
+
symbols: z.ZodArray<z.ZodObject<{
|
|
414
|
+
symbol: z.ZodString;
|
|
415
|
+
status: z.ZodString;
|
|
416
|
+
baseAsset: z.ZodString;
|
|
417
|
+
quoteAsset: z.ZodString;
|
|
418
|
+
}, z.core.$loose>>;
|
|
419
|
+
}, z.core.$loose>;
|
|
420
|
+
type ExchangeInfo = z.infer<typeof ExchangeInfoSchema>;
|
|
421
|
+
|
|
422
|
+
interface FuturesDataEndpoints {
|
|
423
|
+
restFapi?: string;
|
|
424
|
+
restFuturesData?: string;
|
|
425
|
+
apiKey?: string;
|
|
426
|
+
apiSecret?: string;
|
|
427
|
+
recvWindow?: number;
|
|
428
|
+
timeoutMs?: number;
|
|
429
|
+
maxRetries?: number;
|
|
430
|
+
retryBaseDelayMs?: number;
|
|
431
|
+
retryMaxDelayMs?: number;
|
|
432
|
+
}
|
|
433
|
+
declare class FuturesData {
|
|
434
|
+
private readonly http;
|
|
435
|
+
private readonly dataHttp;
|
|
436
|
+
constructor(endpoints?: FuturesDataEndpoints);
|
|
437
|
+
fundingRateHistory(symbol: string, options?: {
|
|
438
|
+
startTime?: number;
|
|
439
|
+
endTime?: number;
|
|
440
|
+
limit?: number;
|
|
441
|
+
}): Promise<FundingRate[]>;
|
|
442
|
+
premiumIndex(symbol: string): Promise<PremiumIndex>;
|
|
443
|
+
openInterest(symbol: string): Promise<OpenInterest>;
|
|
444
|
+
openInterestHist(symbol: string, period: string, limit?: number): Promise<OpenInterestHistEntry[]>;
|
|
445
|
+
topLongShortAccountRatio(symbol: string, period: string, limit?: number): Promise<LongShortRatioEntry[]>;
|
|
446
|
+
topLongShortPositionRatio(symbol: string, period: string, limit?: number): Promise<LongShortRatioEntry[]>;
|
|
447
|
+
globalLongShortAccountRatio(symbol: string, period: string, limit?: number): Promise<LongShortRatioEntry[]>;
|
|
448
|
+
takerLongShortRatio(symbol: string, period: string, limit?: number): Promise<TakerLongShortRatioEntry[]>;
|
|
449
|
+
basis(symbol: string, period: string, options?: {
|
|
450
|
+
startTime?: number;
|
|
451
|
+
endTime?: number;
|
|
452
|
+
limit?: number;
|
|
453
|
+
}): Promise<unknown[]>;
|
|
454
|
+
fundingInfo(): Promise<unknown[]>;
|
|
455
|
+
assetIndex(symbol?: string): Promise<unknown[] | unknown>;
|
|
456
|
+
compositeIndexInfo(symbol?: string): Promise<unknown>;
|
|
457
|
+
adlQuantile(symbol?: string): Promise<unknown[]>;
|
|
458
|
+
blvtInfo(tokenName: string, interval: KlineInterval, options?: {
|
|
459
|
+
startTime?: number;
|
|
460
|
+
endTime?: number;
|
|
461
|
+
limit?: number;
|
|
462
|
+
}): Promise<unknown[]>;
|
|
463
|
+
indexPriceConstituents(symbol: string): Promise<unknown>;
|
|
464
|
+
symbolConfig(symbol?: string): Promise<unknown[]>;
|
|
465
|
+
forceOrders(options?: {
|
|
466
|
+
symbol?: string;
|
|
467
|
+
autoCloseType?: 'LIQUIDATION' | 'ADL';
|
|
468
|
+
startTime?: number;
|
|
469
|
+
endTime?: number;
|
|
470
|
+
limit?: number;
|
|
471
|
+
}): Promise<unknown[]>;
|
|
472
|
+
insuranceFundBalance(options?: {
|
|
473
|
+
symbol?: string;
|
|
474
|
+
startTime?: number;
|
|
475
|
+
endTime?: number;
|
|
476
|
+
limit?: number;
|
|
477
|
+
}): Promise<unknown[]>;
|
|
478
|
+
pmExchangeInfo(): Promise<unknown>;
|
|
479
|
+
delistSchedule(symbol?: string): Promise<unknown[]>;
|
|
480
|
+
symbolAdlRisk(symbol?: string): Promise<unknown[]>;
|
|
481
|
+
deliveryPrice(pair: string): Promise<{
|
|
482
|
+
deliveryTime: number;
|
|
483
|
+
deliveryPrice: number;
|
|
484
|
+
}[]>;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
declare class MarketDataBase {
|
|
488
|
+
protected readonly http: HttpClient;
|
|
489
|
+
constructor(http: HttpClient);
|
|
490
|
+
exchangeInfo(): Promise<ExchangeInfo>;
|
|
491
|
+
ping(): Promise<Record<string, unknown>>;
|
|
492
|
+
serverTime(): Promise<{
|
|
493
|
+
serverTime: number;
|
|
494
|
+
}>;
|
|
495
|
+
historicalTrades(symbol: string, options?: {
|
|
496
|
+
fromId?: number;
|
|
497
|
+
limit?: number;
|
|
498
|
+
}): Promise<Trade[]>;
|
|
499
|
+
klines(symbol: string, interval: KlineInterval, options?: {
|
|
500
|
+
startTime?: number;
|
|
501
|
+
endTime?: number;
|
|
502
|
+
limit?: number;
|
|
503
|
+
}): Promise<Kline[]>;
|
|
504
|
+
tickerPrice(symbol: string): Promise<TickerPrice>;
|
|
505
|
+
ticker24hr(symbol: string): Promise<Ticker24hr>;
|
|
506
|
+
bookTicker(symbol: string): Promise<BookTicker>;
|
|
507
|
+
depth(symbol: string, limit?: number): Promise<DepthSnapshot>;
|
|
508
|
+
trades(symbol: string, limit?: number): Promise<Trade[]>;
|
|
509
|
+
aggTrades(symbol: string, options?: {
|
|
510
|
+
startTime?: number;
|
|
511
|
+
endTime?: number;
|
|
512
|
+
limit?: number;
|
|
513
|
+
}): Promise<AggTrade[]>;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
declare class FuturesMarket extends MarketDataBase {
|
|
517
|
+
private readonly rootHttp;
|
|
518
|
+
constructor(http?: HttpClient, restRoot?: string);
|
|
519
|
+
continuousKlines(pair: string, contractType: 'perpetual' | 'current_quarter' | 'next_quarter', interval: KlineInterval, options?: {
|
|
520
|
+
startTime?: number;
|
|
521
|
+
endTime?: number;
|
|
522
|
+
limit?: number;
|
|
523
|
+
}): Promise<Kline[]>;
|
|
524
|
+
indexPriceKlines(pair: string, interval: KlineInterval, options?: {
|
|
525
|
+
startTime?: number;
|
|
526
|
+
endTime?: number;
|
|
527
|
+
limit?: number;
|
|
528
|
+
}): Promise<Kline[]>;
|
|
529
|
+
markPriceKlines(symbol: string, interval: KlineInterval, options?: {
|
|
530
|
+
startTime?: number;
|
|
531
|
+
endTime?: number;
|
|
532
|
+
limit?: number;
|
|
533
|
+
}): Promise<Kline[]>;
|
|
534
|
+
premiumIndexKlines(symbol: string, interval: KlineInterval, options?: {
|
|
535
|
+
startTime?: number;
|
|
536
|
+
endTime?: number;
|
|
537
|
+
limit?: number;
|
|
538
|
+
}): Promise<Kline[]>;
|
|
539
|
+
rpiDepth(symbol: string, limit?: number): Promise<DepthSnapshot>;
|
|
540
|
+
tradingDayTicker(symbol?: string): Promise<unknown[]>;
|
|
541
|
+
tickerPriceV2(symbol?: string): Promise<TickerPrice[] | TickerPrice>;
|
|
542
|
+
bookTickerV2(symbol?: string): Promise<BookTicker[] | BookTicker>;
|
|
543
|
+
instrumentDetails(symbol: string): Promise<ExchangeInfo['symbols'][number]>;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
declare class SpotMarket extends MarketDataBase {
|
|
547
|
+
constructor(http?: HttpClient);
|
|
548
|
+
avgPrice(symbol: string): Promise<AvgPrice>;
|
|
549
|
+
/** Optimized klines endpoint (`/uiKlines`) with the same response shape as `/klines`. */
|
|
550
|
+
uiKlines(symbol: string, interval: KlineInterval, options?: {
|
|
551
|
+
startTime?: number;
|
|
552
|
+
endTime?: number;
|
|
553
|
+
limit?: number;
|
|
554
|
+
}): Promise<Kline[]>;
|
|
555
|
+
/** Rolling window ticker (`/ticker`). Omit `symbol` for all symbols. */
|
|
556
|
+
rollingWindowTicker(symbol?: string, windowSize?: '1d' | '7d' | '30d'): Promise<unknown[] | unknown>;
|
|
557
|
+
/** Trading-day ticker (`/ticker/tradingDay`). Omit `symbol` for all symbols. */
|
|
558
|
+
tradingDayTicker(symbol?: string, options?: {
|
|
559
|
+
timeZone?: string;
|
|
560
|
+
type?: 'FULL' | 'MINI';
|
|
561
|
+
}): Promise<unknown[] | unknown>;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
declare const SpotOrderSchema: z.ZodObject<{
|
|
565
|
+
symbol: z.ZodString;
|
|
566
|
+
orderId: z.ZodNumber;
|
|
567
|
+
clientOrderId: z.ZodString;
|
|
568
|
+
status: z.ZodString;
|
|
569
|
+
side: z.ZodString;
|
|
570
|
+
type: z.ZodString;
|
|
571
|
+
timeInForce: z.ZodOptional<z.ZodString>;
|
|
572
|
+
price: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
573
|
+
origQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
574
|
+
executedQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
575
|
+
cummulativeQuoteQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
576
|
+
stopPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
577
|
+
icebergQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
578
|
+
originalQuoteOrderQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
579
|
+
transactTime: z.ZodOptional<z.ZodNumber>;
|
|
580
|
+
workingTime: z.ZodOptional<z.ZodNumber>;
|
|
581
|
+
orderListId: z.ZodOptional<z.ZodNumber>;
|
|
582
|
+
selfTradePreventionMode: z.ZodOptional<z.ZodString>;
|
|
583
|
+
fills: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
584
|
+
}, z.core.$loose>;
|
|
585
|
+
type SpotOrder = z.infer<typeof SpotOrderSchema>;
|
|
586
|
+
declare const SpotOrderResponseSchema: z.ZodObject<{
|
|
587
|
+
symbol: z.ZodString;
|
|
588
|
+
orderId: z.ZodNumber;
|
|
589
|
+
clientOrderId: z.ZodString;
|
|
590
|
+
status: z.ZodString;
|
|
591
|
+
side: z.ZodString;
|
|
592
|
+
type: z.ZodString;
|
|
593
|
+
timeInForce: z.ZodOptional<z.ZodString>;
|
|
594
|
+
price: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
595
|
+
origQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
596
|
+
executedQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
597
|
+
cummulativeQuoteQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
598
|
+
stopPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
599
|
+
icebergQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
600
|
+
originalQuoteOrderQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
601
|
+
transactTime: z.ZodOptional<z.ZodNumber>;
|
|
602
|
+
workingTime: z.ZodOptional<z.ZodNumber>;
|
|
603
|
+
orderListId: z.ZodOptional<z.ZodNumber>;
|
|
604
|
+
selfTradePreventionMode: z.ZodOptional<z.ZodString>;
|
|
605
|
+
fills: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
606
|
+
}, z.core.$loose>;
|
|
607
|
+
declare const SpotOrdersResponseSchema: z.ZodArray<z.ZodObject<{
|
|
608
|
+
symbol: z.ZodString;
|
|
609
|
+
orderId: z.ZodNumber;
|
|
610
|
+
clientOrderId: z.ZodString;
|
|
611
|
+
status: z.ZodString;
|
|
612
|
+
side: z.ZodString;
|
|
613
|
+
type: z.ZodString;
|
|
614
|
+
timeInForce: z.ZodOptional<z.ZodString>;
|
|
615
|
+
price: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
616
|
+
origQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
617
|
+
executedQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
618
|
+
cummulativeQuoteQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
619
|
+
stopPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
620
|
+
icebergQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
621
|
+
originalQuoteOrderQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
622
|
+
transactTime: z.ZodOptional<z.ZodNumber>;
|
|
623
|
+
workingTime: z.ZodOptional<z.ZodNumber>;
|
|
624
|
+
orderListId: z.ZodOptional<z.ZodNumber>;
|
|
625
|
+
selfTradePreventionMode: z.ZodOptional<z.ZodString>;
|
|
626
|
+
fills: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
627
|
+
}, z.core.$loose>>;
|
|
628
|
+
declare const SpotOCOOrderAckSchema: z.ZodObject<{
|
|
629
|
+
orderListId: z.ZodNumber;
|
|
630
|
+
contingencyType: z.ZodString;
|
|
631
|
+
listStatusType: z.ZodString;
|
|
632
|
+
listOrderStatus: z.ZodString;
|
|
633
|
+
listClientOrderId: z.ZodString;
|
|
634
|
+
transactionTime: z.ZodNumber;
|
|
635
|
+
symbol: z.ZodString;
|
|
636
|
+
orders: z.ZodArray<z.ZodObject<{
|
|
637
|
+
symbol: z.ZodString;
|
|
638
|
+
orderId: z.ZodNumber;
|
|
639
|
+
clientOrderId: z.ZodString;
|
|
640
|
+
status: z.ZodString;
|
|
641
|
+
side: z.ZodString;
|
|
642
|
+
type: z.ZodString;
|
|
643
|
+
timeInForce: z.ZodOptional<z.ZodString>;
|
|
644
|
+
price: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
645
|
+
origQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
646
|
+
executedQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
647
|
+
cummulativeQuoteQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
648
|
+
stopPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
649
|
+
icebergQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
650
|
+
originalQuoteOrderQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
651
|
+
transactTime: z.ZodOptional<z.ZodNumber>;
|
|
652
|
+
workingTime: z.ZodOptional<z.ZodNumber>;
|
|
653
|
+
orderListId: z.ZodOptional<z.ZodNumber>;
|
|
654
|
+
selfTradePreventionMode: z.ZodOptional<z.ZodString>;
|
|
655
|
+
fills: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
656
|
+
}, z.core.$loose>>;
|
|
657
|
+
orderReports: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
658
|
+
}, z.core.$loose>;
|
|
659
|
+
type SpotOCOOrderAck = z.infer<typeof SpotOCOOrderAckSchema>;
|
|
660
|
+
declare const SpotOCOOrderAckResponseSchema: z.ZodObject<{
|
|
661
|
+
orderListId: z.ZodNumber;
|
|
662
|
+
contingencyType: z.ZodString;
|
|
663
|
+
listStatusType: z.ZodString;
|
|
664
|
+
listOrderStatus: z.ZodString;
|
|
665
|
+
listClientOrderId: z.ZodString;
|
|
666
|
+
transactionTime: z.ZodNumber;
|
|
667
|
+
symbol: z.ZodString;
|
|
668
|
+
orders: z.ZodArray<z.ZodObject<{
|
|
669
|
+
symbol: z.ZodString;
|
|
670
|
+
orderId: z.ZodNumber;
|
|
671
|
+
clientOrderId: z.ZodString;
|
|
672
|
+
status: z.ZodString;
|
|
673
|
+
side: z.ZodString;
|
|
674
|
+
type: z.ZodString;
|
|
675
|
+
timeInForce: z.ZodOptional<z.ZodString>;
|
|
676
|
+
price: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
677
|
+
origQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
678
|
+
executedQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
679
|
+
cummulativeQuoteQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
680
|
+
stopPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
681
|
+
icebergQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
682
|
+
originalQuoteOrderQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
683
|
+
transactTime: z.ZodOptional<z.ZodNumber>;
|
|
684
|
+
workingTime: z.ZodOptional<z.ZodNumber>;
|
|
685
|
+
orderListId: z.ZodOptional<z.ZodNumber>;
|
|
686
|
+
selfTradePreventionMode: z.ZodOptional<z.ZodString>;
|
|
687
|
+
fills: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
688
|
+
}, z.core.$loose>>;
|
|
689
|
+
orderReports: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
690
|
+
}, z.core.$loose>;
|
|
691
|
+
declare const SpotOCOOrdersResponseSchema: z.ZodArray<z.ZodObject<{
|
|
692
|
+
orderListId: z.ZodNumber;
|
|
693
|
+
contingencyType: z.ZodString;
|
|
694
|
+
listStatusType: z.ZodString;
|
|
695
|
+
listOrderStatus: z.ZodString;
|
|
696
|
+
listClientOrderId: z.ZodString;
|
|
697
|
+
transactionTime: z.ZodNumber;
|
|
698
|
+
symbol: z.ZodString;
|
|
699
|
+
orders: z.ZodArray<z.ZodObject<{
|
|
700
|
+
symbol: z.ZodString;
|
|
701
|
+
orderId: z.ZodNumber;
|
|
702
|
+
clientOrderId: z.ZodString;
|
|
703
|
+
status: z.ZodString;
|
|
704
|
+
side: z.ZodString;
|
|
705
|
+
type: z.ZodString;
|
|
706
|
+
timeInForce: z.ZodOptional<z.ZodString>;
|
|
707
|
+
price: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
708
|
+
origQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
709
|
+
executedQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
710
|
+
cummulativeQuoteQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
711
|
+
stopPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
712
|
+
icebergQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
713
|
+
originalQuoteOrderQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
714
|
+
transactTime: z.ZodOptional<z.ZodNumber>;
|
|
715
|
+
workingTime: z.ZodOptional<z.ZodNumber>;
|
|
716
|
+
orderListId: z.ZodOptional<z.ZodNumber>;
|
|
717
|
+
selfTradePreventionMode: z.ZodOptional<z.ZodString>;
|
|
718
|
+
fills: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
719
|
+
}, z.core.$loose>>;
|
|
720
|
+
orderReports: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
721
|
+
}, z.core.$loose>>;
|
|
722
|
+
declare const SpotTradeSchema: z.ZodObject<{
|
|
723
|
+
symbol: z.ZodString;
|
|
724
|
+
id: z.ZodNumber;
|
|
725
|
+
orderId: z.ZodNumber;
|
|
726
|
+
orderListId: z.ZodOptional<z.ZodNumber>;
|
|
727
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
728
|
+
qty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
729
|
+
quoteQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
730
|
+
commission: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
731
|
+
commissionAsset: z.ZodString;
|
|
732
|
+
time: z.ZodNumber;
|
|
733
|
+
isBuyer: z.ZodBoolean;
|
|
734
|
+
isMaker: z.ZodBoolean;
|
|
735
|
+
isBestMatch: z.ZodBoolean;
|
|
736
|
+
}, z.core.$loose>;
|
|
737
|
+
type SpotTrade = z.infer<typeof SpotTradeSchema>;
|
|
738
|
+
declare const SpotTradesResponseSchema: z.ZodArray<z.ZodObject<{
|
|
739
|
+
symbol: z.ZodString;
|
|
740
|
+
id: z.ZodNumber;
|
|
741
|
+
orderId: z.ZodNumber;
|
|
742
|
+
orderListId: z.ZodOptional<z.ZodNumber>;
|
|
743
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
744
|
+
qty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
745
|
+
quoteQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
746
|
+
commission: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
747
|
+
commissionAsset: z.ZodString;
|
|
748
|
+
time: z.ZodNumber;
|
|
749
|
+
isBuyer: z.ZodBoolean;
|
|
750
|
+
isMaker: z.ZodBoolean;
|
|
751
|
+
isBestMatch: z.ZodBoolean;
|
|
752
|
+
}, z.core.$loose>>;
|
|
753
|
+
declare const SpotBalanceSchema: z.ZodObject<{
|
|
754
|
+
asset: z.ZodString;
|
|
755
|
+
free: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
756
|
+
locked: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
757
|
+
}, z.core.$strip>;
|
|
758
|
+
type SpotBalance = z.infer<typeof SpotBalanceSchema>;
|
|
759
|
+
declare const SpotAccountSchema: z.ZodObject<{
|
|
760
|
+
makerCommission: z.ZodNumber;
|
|
761
|
+
takerCommission: z.ZodNumber;
|
|
762
|
+
buyerCommission: z.ZodNumber;
|
|
763
|
+
sellerCommission: z.ZodNumber;
|
|
764
|
+
canTrade: z.ZodBoolean;
|
|
765
|
+
canWithdraw: z.ZodBoolean;
|
|
766
|
+
canDeposit: z.ZodBoolean;
|
|
767
|
+
updateTime: z.ZodOptional<z.ZodNumber>;
|
|
768
|
+
accountType: z.ZodOptional<z.ZodString>;
|
|
769
|
+
balances: z.ZodArray<z.ZodObject<{
|
|
770
|
+
asset: z.ZodString;
|
|
771
|
+
free: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
772
|
+
locked: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
773
|
+
}, z.core.$strip>>;
|
|
774
|
+
permissions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
775
|
+
}, z.core.$loose>;
|
|
776
|
+
type SpotAccountInfo = z.infer<typeof SpotAccountSchema>;
|
|
777
|
+
declare const SpotExecutionReportSchema: z.ZodObject<{
|
|
778
|
+
e: z.ZodLiteral<"executionReport">;
|
|
779
|
+
}, z.core.$loose>;
|
|
780
|
+
type SpotExecutionReport = z.infer<typeof SpotExecutionReportSchema>;
|
|
781
|
+
declare const SpotOutboundAccountPositionSchema: z.ZodObject<{
|
|
782
|
+
e: z.ZodLiteral<"outboundAccountPosition">;
|
|
783
|
+
}, z.core.$loose>;
|
|
784
|
+
type SpotOutboundAccountPosition = z.infer<typeof SpotOutboundAccountPositionSchema>;
|
|
785
|
+
declare const SpotBalanceUpdateSchema: z.ZodObject<{
|
|
786
|
+
e: z.ZodLiteral<"balanceUpdate">;
|
|
787
|
+
}, z.core.$loose>;
|
|
788
|
+
type SpotBalanceUpdate = z.infer<typeof SpotBalanceUpdateSchema>;
|
|
789
|
+
declare const SpotListStatusSchema: z.ZodObject<{
|
|
790
|
+
e: z.ZodLiteral<"listStatus">;
|
|
791
|
+
}, z.core.$loose>;
|
|
792
|
+
type SpotListStatus = z.infer<typeof SpotListStatusSchema>;
|
|
793
|
+
type SpotUserDataEvent = SpotExecutionReport | SpotOutboundAccountPosition | SpotBalanceUpdate | SpotListStatus;
|
|
794
|
+
declare function parseSpotUserDataEvent(raw: unknown): SpotUserDataEvent;
|
|
795
|
+
|
|
796
|
+
declare class SpotTrading {
|
|
797
|
+
private readonly http;
|
|
798
|
+
constructor(http: HttpClient);
|
|
799
|
+
createOrder(params: Record<string, unknown>): Promise<SpotOrder>;
|
|
800
|
+
testOrder(params: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
801
|
+
getOrder(symbol: string, options?: {
|
|
802
|
+
orderId?: number;
|
|
803
|
+
origClientOrderId?: string;
|
|
804
|
+
}): Promise<SpotOrder>;
|
|
805
|
+
cancelOrder(symbol: string, options?: {
|
|
806
|
+
orderId?: number;
|
|
807
|
+
origClientOrderId?: string;
|
|
808
|
+
newClientOrderId?: string;
|
|
809
|
+
}): Promise<SpotOrder>;
|
|
810
|
+
cancelOpenOrders(symbol: string): Promise<SpotOrder[]>;
|
|
811
|
+
getOpenOrders(symbol?: string): Promise<SpotOrder[]>;
|
|
812
|
+
getAllOrders(symbol: string, options?: {
|
|
813
|
+
orderId?: number;
|
|
814
|
+
startTime?: number;
|
|
815
|
+
endTime?: number;
|
|
816
|
+
limit?: number;
|
|
817
|
+
}): Promise<SpotOrder[]>;
|
|
818
|
+
cancelReplaceOrder(params: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
819
|
+
createOCOOrder(params: Record<string, unknown>): Promise<SpotOCOOrderAck>;
|
|
820
|
+
cancelOCOOrder(symbol: string, options?: {
|
|
821
|
+
orderListId?: number;
|
|
822
|
+
listClientOrderId?: string;
|
|
823
|
+
newClientOrderId?: string;
|
|
824
|
+
}): Promise<SpotOCOOrderAck>;
|
|
825
|
+
getOCOOrder(symbol: string, options?: {
|
|
826
|
+
orderListId?: number;
|
|
827
|
+
origClientOrderId?: string;
|
|
828
|
+
}): Promise<SpotOCOOrderAck>;
|
|
829
|
+
getOpenOCOOrders(): Promise<SpotOCOOrderAck[]>;
|
|
830
|
+
getAllOCOOrders(symbol: string, options?: {
|
|
831
|
+
fromId?: number;
|
|
832
|
+
startTime?: number;
|
|
833
|
+
endTime?: number;
|
|
834
|
+
limit?: number;
|
|
835
|
+
}): Promise<SpotOCOOrderAck[]>;
|
|
836
|
+
cancelOpenOCOOrders(symbol: string): Promise<SpotOCOOrderAck[]>;
|
|
837
|
+
}
|
|
838
|
+
declare class SpotAccount {
|
|
839
|
+
private readonly http;
|
|
840
|
+
constructor(http: HttpClient);
|
|
841
|
+
account(): Promise<SpotAccountInfo>;
|
|
842
|
+
myTrades(symbol: string, options?: {
|
|
843
|
+
orderId?: number;
|
|
844
|
+
startTime?: number;
|
|
845
|
+
endTime?: number;
|
|
846
|
+
fromId?: number;
|
|
847
|
+
limit?: number;
|
|
848
|
+
}): Promise<SpotTrade[]>;
|
|
849
|
+
myPreventedMatches(symbol: string, options?: {
|
|
850
|
+
preventedMatchId?: number;
|
|
851
|
+
orderId?: number;
|
|
852
|
+
fromPreventedMatchId?: number;
|
|
853
|
+
limit?: number;
|
|
854
|
+
}): Promise<unknown[]>;
|
|
855
|
+
accountCommission(symbol: string): Promise<Record<string, unknown>>;
|
|
856
|
+
rateLimitOrder(): Promise<unknown[]>;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
declare const ListenKeySchema: z.ZodObject<{
|
|
860
|
+
listenKey: z.ZodString;
|
|
861
|
+
}, z.core.$strip>;
|
|
862
|
+
type ListenKey = z.infer<typeof ListenKeySchema>;
|
|
863
|
+
declare const UserDataAccountUpdateSchema: z.ZodObject<{
|
|
864
|
+
e: z.ZodLiteral<"ACCOUNT_UPDATE">;
|
|
865
|
+
E: z.ZodNumber;
|
|
866
|
+
T: z.ZodNumber;
|
|
867
|
+
a: z.ZodObject<{
|
|
868
|
+
m: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
869
|
+
B: z.ZodArray<z.ZodObject<{
|
|
870
|
+
a: z.ZodString;
|
|
871
|
+
wb: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
872
|
+
cw: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
873
|
+
bc: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
874
|
+
}, z.core.$strip>>;
|
|
875
|
+
P: z.ZodArray<z.ZodObject<{
|
|
876
|
+
s: z.ZodString;
|
|
877
|
+
pa: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
878
|
+
ep: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
879
|
+
cr: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
880
|
+
up: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
881
|
+
mt: z.ZodString;
|
|
882
|
+
iw: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
883
|
+
ps: z.ZodString;
|
|
884
|
+
}, z.core.$strip>>;
|
|
885
|
+
}, z.core.$strip>;
|
|
886
|
+
}, z.core.$strip>;
|
|
887
|
+
type UserDataAccountUpdate = z.infer<typeof UserDataAccountUpdateSchema>;
|
|
888
|
+
declare const UserDataOrderTradeUpdateSchema: z.ZodObject<{
|
|
889
|
+
e: z.ZodLiteral<"ORDER_TRADE_UPDATE">;
|
|
890
|
+
E: z.ZodNumber;
|
|
891
|
+
T: z.ZodNumber;
|
|
892
|
+
o: z.ZodObject<{
|
|
893
|
+
s: z.ZodString;
|
|
894
|
+
c: z.ZodString;
|
|
895
|
+
i: z.ZodNumber;
|
|
896
|
+
S: z.ZodString;
|
|
897
|
+
o: z.ZodString;
|
|
898
|
+
f: z.ZodString;
|
|
899
|
+
q: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
900
|
+
p: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
901
|
+
ap: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
902
|
+
sp: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
903
|
+
x: z.ZodString;
|
|
904
|
+
X: z.ZodString;
|
|
905
|
+
l: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
906
|
+
z: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
907
|
+
L: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
908
|
+
n: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
909
|
+
N: z.ZodString;
|
|
910
|
+
T: z.ZodNumber;
|
|
911
|
+
t: z.ZodNumber;
|
|
912
|
+
b: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
913
|
+
a: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
914
|
+
m: z.ZodBoolean;
|
|
915
|
+
R: z.ZodBoolean;
|
|
916
|
+
wt: z.ZodString;
|
|
917
|
+
ot: z.ZodString;
|
|
918
|
+
ps: z.ZodString;
|
|
919
|
+
cp: z.ZodOptional<z.ZodBoolean>;
|
|
920
|
+
AP: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
921
|
+
cr: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
922
|
+
rp: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
923
|
+
}, z.core.$strip>;
|
|
924
|
+
}, z.core.$strip>;
|
|
925
|
+
type UserDataOrderTradeUpdate = z.infer<typeof UserDataOrderTradeUpdateSchema>;
|
|
926
|
+
declare const UserDataMarginCallSchema: z.ZodObject<{
|
|
927
|
+
e: z.ZodLiteral<"MARGIN_CALL">;
|
|
928
|
+
E: z.ZodNumber;
|
|
929
|
+
cw: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
930
|
+
p: z.ZodArray<z.ZodObject<{
|
|
931
|
+
s: z.ZodString;
|
|
932
|
+
ps: z.ZodString;
|
|
933
|
+
pa: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
934
|
+
mt: z.ZodString;
|
|
935
|
+
iw: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
936
|
+
mp: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
937
|
+
up: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
938
|
+
mm: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
939
|
+
}, z.core.$strip>>;
|
|
940
|
+
}, z.core.$strip>;
|
|
941
|
+
type UserDataMarginCall = z.infer<typeof UserDataMarginCallSchema>;
|
|
942
|
+
type UserDataEvent = UserDataAccountUpdate | UserDataOrderTradeUpdate | UserDataMarginCall;
|
|
943
|
+
declare function parseUserDataEvent(raw: unknown): UserDataEvent;
|
|
944
|
+
declare const WsApiResponseSchema: z.ZodObject<{
|
|
945
|
+
id: z.ZodString;
|
|
946
|
+
status: z.ZodNumber;
|
|
947
|
+
result: z.ZodUnknown;
|
|
948
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
949
|
+
code: z.ZodNumber;
|
|
950
|
+
msg: z.ZodString;
|
|
951
|
+
}, z.core.$strip>>;
|
|
952
|
+
}, z.core.$strip>;
|
|
953
|
+
type WsApiResponse = z.infer<typeof WsApiResponseSchema>;
|
|
954
|
+
|
|
955
|
+
declare class SpotUserDataStream {
|
|
956
|
+
private readonly http;
|
|
957
|
+
constructor(http: HttpClient);
|
|
958
|
+
createListenKey(): Promise<ListenKey>;
|
|
959
|
+
keepAliveListenKey(): Promise<Record<string, unknown>>;
|
|
960
|
+
closeListenKey(): Promise<Record<string, unknown>>;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
declare const BalanceSchema: z.ZodObject<{
|
|
964
|
+
accountAlias: z.ZodString;
|
|
965
|
+
asset: z.ZodString;
|
|
966
|
+
balance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
967
|
+
crossWalletBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
968
|
+
crossUnPnl: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
969
|
+
availableBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
970
|
+
maxWithdrawAmount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
971
|
+
marginAvailable: z.ZodBoolean;
|
|
972
|
+
updateTime: z.ZodNumber;
|
|
973
|
+
}, z.core.$strip>;
|
|
974
|
+
type Balance = z.infer<typeof BalanceSchema>;
|
|
975
|
+
declare const BalancesResponseSchema: z.ZodArray<z.ZodObject<{
|
|
976
|
+
accountAlias: z.ZodString;
|
|
977
|
+
asset: z.ZodString;
|
|
978
|
+
balance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
979
|
+
crossWalletBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
980
|
+
crossUnPnl: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
981
|
+
availableBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
982
|
+
maxWithdrawAmount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
983
|
+
marginAvailable: z.ZodBoolean;
|
|
984
|
+
updateTime: z.ZodNumber;
|
|
985
|
+
}, z.core.$strip>>;
|
|
986
|
+
declare const PositionRiskSchema: z.ZodObject<{
|
|
987
|
+
symbol: z.ZodString;
|
|
988
|
+
positionAmt: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
989
|
+
entryPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
990
|
+
markPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
991
|
+
unRealizedProfit: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
992
|
+
liquidationPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
993
|
+
leverage: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
994
|
+
marginType: z.ZodEnum<{
|
|
995
|
+
isolated: "isolated";
|
|
996
|
+
cross: "cross";
|
|
997
|
+
}>;
|
|
998
|
+
positionSide: z.ZodString;
|
|
999
|
+
isolatedWallet: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1000
|
+
isolatedMargin: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1001
|
+
notional: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1002
|
+
updateTime: z.ZodOptional<z.ZodNumber>;
|
|
1003
|
+
}, z.core.$strip>;
|
|
1004
|
+
type PositionRisk = z.infer<typeof PositionRiskSchema>;
|
|
1005
|
+
declare const PositionRiskResponseSchema: z.ZodArray<z.ZodObject<{
|
|
1006
|
+
symbol: z.ZodString;
|
|
1007
|
+
positionAmt: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1008
|
+
entryPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1009
|
+
markPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1010
|
+
unRealizedProfit: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1011
|
+
liquidationPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1012
|
+
leverage: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1013
|
+
marginType: z.ZodEnum<{
|
|
1014
|
+
isolated: "isolated";
|
|
1015
|
+
cross: "cross";
|
|
1016
|
+
}>;
|
|
1017
|
+
positionSide: z.ZodString;
|
|
1018
|
+
isolatedWallet: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1019
|
+
isolatedMargin: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1020
|
+
notional: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1021
|
+
updateTime: z.ZodOptional<z.ZodNumber>;
|
|
1022
|
+
}, z.core.$strip>>;
|
|
1023
|
+
declare const AccountAssetSchema: z.ZodObject<{
|
|
1024
|
+
asset: z.ZodString;
|
|
1025
|
+
walletBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1026
|
+
unrealizedProfit: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1027
|
+
marginBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1028
|
+
maintMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1029
|
+
initialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1030
|
+
positionInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1031
|
+
openOrderInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1032
|
+
crossWalletBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1033
|
+
crossUnPnl: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1034
|
+
availableBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1035
|
+
maxWithdrawAmount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1036
|
+
marginAvailable: z.ZodOptional<z.ZodBoolean>;
|
|
1037
|
+
updateTime: z.ZodNumber;
|
|
1038
|
+
}, z.core.$strip>;
|
|
1039
|
+
type AccountAsset = z.infer<typeof AccountAssetSchema>;
|
|
1040
|
+
declare const AccountPositionSchema: z.ZodObject<{
|
|
1041
|
+
symbol: z.ZodString;
|
|
1042
|
+
positionAmt: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1043
|
+
initialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1044
|
+
maintMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1045
|
+
unrealizedProfit: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1046
|
+
positionInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1047
|
+
openOrderInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1048
|
+
leverage: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1049
|
+
isolated: z.ZodBoolean;
|
|
1050
|
+
entryPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1051
|
+
positionSide: z.ZodString;
|
|
1052
|
+
positionNotional: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1053
|
+
isolatedWallet: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1054
|
+
isolatedMargin: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1055
|
+
notional: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1056
|
+
}, z.core.$strip>;
|
|
1057
|
+
type AccountPosition = z.infer<typeof AccountPositionSchema>;
|
|
1058
|
+
declare const AccountSchema: z.ZodObject<{
|
|
1059
|
+
feeTier: z.ZodNumber;
|
|
1060
|
+
canTrade: z.ZodBoolean;
|
|
1061
|
+
canDeposit: z.ZodBoolean;
|
|
1062
|
+
canWithdraw: z.ZodBoolean;
|
|
1063
|
+
updateTime: z.ZodNumber;
|
|
1064
|
+
totalInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1065
|
+
totalMaintMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1066
|
+
totalWalletBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1067
|
+
totalUnrealizedProfit: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1068
|
+
totalMarginBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1069
|
+
totalPositionInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1070
|
+
totalOpenOrderInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1071
|
+
totalCrossWalletBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1072
|
+
totalCrossUnPnl: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1073
|
+
availableBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1074
|
+
maxWithdrawAmount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1075
|
+
assets: z.ZodArray<z.ZodObject<{
|
|
1076
|
+
asset: z.ZodString;
|
|
1077
|
+
walletBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1078
|
+
unrealizedProfit: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1079
|
+
marginBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1080
|
+
maintMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1081
|
+
initialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1082
|
+
positionInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1083
|
+
openOrderInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1084
|
+
crossWalletBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1085
|
+
crossUnPnl: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1086
|
+
availableBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1087
|
+
maxWithdrawAmount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1088
|
+
marginAvailable: z.ZodOptional<z.ZodBoolean>;
|
|
1089
|
+
updateTime: z.ZodNumber;
|
|
1090
|
+
}, z.core.$strip>>;
|
|
1091
|
+
positions: z.ZodArray<z.ZodObject<{
|
|
1092
|
+
symbol: z.ZodString;
|
|
1093
|
+
positionAmt: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1094
|
+
initialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1095
|
+
maintMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1096
|
+
unrealizedProfit: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1097
|
+
positionInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1098
|
+
openOrderInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1099
|
+
leverage: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1100
|
+
isolated: z.ZodBoolean;
|
|
1101
|
+
entryPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1102
|
+
positionSide: z.ZodString;
|
|
1103
|
+
positionNotional: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1104
|
+
isolatedWallet: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1105
|
+
isolatedMargin: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1106
|
+
notional: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1107
|
+
}, z.core.$strip>>;
|
|
1108
|
+
}, z.core.$strip>;
|
|
1109
|
+
type Account = z.infer<typeof AccountSchema>;
|
|
1110
|
+
declare const IncomeSchema: z.ZodObject<{
|
|
1111
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
1112
|
+
incomeType: z.ZodString;
|
|
1113
|
+
income: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1114
|
+
asset: z.ZodString;
|
|
1115
|
+
time: z.ZodNumber;
|
|
1116
|
+
info: z.ZodOptional<z.ZodString>;
|
|
1117
|
+
tranId: z.ZodNumber;
|
|
1118
|
+
tradeId: z.ZodOptional<z.ZodString>;
|
|
1119
|
+
}, z.core.$strip>;
|
|
1120
|
+
type Income = z.infer<typeof IncomeSchema>;
|
|
1121
|
+
declare const IncomeHistoryResponseSchema: z.ZodArray<z.ZodObject<{
|
|
1122
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
1123
|
+
incomeType: z.ZodString;
|
|
1124
|
+
income: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1125
|
+
asset: z.ZodString;
|
|
1126
|
+
time: z.ZodNumber;
|
|
1127
|
+
info: z.ZodOptional<z.ZodString>;
|
|
1128
|
+
tranId: z.ZodNumber;
|
|
1129
|
+
tradeId: z.ZodOptional<z.ZodString>;
|
|
1130
|
+
}, z.core.$strip>>;
|
|
1131
|
+
declare const UserTradeSchema: z.ZodObject<{
|
|
1132
|
+
buyer: z.ZodBoolean;
|
|
1133
|
+
commission: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1134
|
+
commissionAsset: z.ZodString;
|
|
1135
|
+
id: z.ZodNumber;
|
|
1136
|
+
maker: z.ZodBoolean;
|
|
1137
|
+
orderId: z.ZodNumber;
|
|
1138
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1139
|
+
qty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1140
|
+
quoteQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1141
|
+
realizedPnl: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1142
|
+
side: z.ZodString;
|
|
1143
|
+
positionSide: z.ZodString;
|
|
1144
|
+
symbol: z.ZodString;
|
|
1145
|
+
time: z.ZodNumber;
|
|
1146
|
+
}, z.core.$strip>;
|
|
1147
|
+
type UserTrade = z.infer<typeof UserTradeSchema>;
|
|
1148
|
+
declare const UserTradesResponseSchema: z.ZodArray<z.ZodObject<{
|
|
1149
|
+
buyer: z.ZodBoolean;
|
|
1150
|
+
commission: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1151
|
+
commissionAsset: z.ZodString;
|
|
1152
|
+
id: z.ZodNumber;
|
|
1153
|
+
maker: z.ZodBoolean;
|
|
1154
|
+
orderId: z.ZodNumber;
|
|
1155
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1156
|
+
qty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1157
|
+
quoteQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1158
|
+
realizedPnl: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1159
|
+
side: z.ZodString;
|
|
1160
|
+
positionSide: z.ZodString;
|
|
1161
|
+
symbol: z.ZodString;
|
|
1162
|
+
time: z.ZodNumber;
|
|
1163
|
+
}, z.core.$strip>>;
|
|
1164
|
+
declare const CommissionRateSchema: z.ZodObject<{
|
|
1165
|
+
symbol: z.ZodString;
|
|
1166
|
+
makerCommissionRate: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1167
|
+
takerCommissionRate: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1168
|
+
}, z.core.$strip>;
|
|
1169
|
+
type CommissionRate = z.infer<typeof CommissionRateSchema>;
|
|
1170
|
+
declare const LeverageBracketSchema: z.ZodObject<{
|
|
1171
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
1172
|
+
bracketNotional: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1173
|
+
bracket: z.ZodOptional<z.ZodNumber>;
|
|
1174
|
+
maxLeverage: z.ZodOptional<z.ZodNumber>;
|
|
1175
|
+
maintMarginRatio: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1176
|
+
cum: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1177
|
+
}, z.core.$strip>;
|
|
1178
|
+
type LeverageBracket = z.infer<typeof LeverageBracketSchema>;
|
|
1179
|
+
declare const LeverageBracketResponseSchema: z.ZodArray<z.ZodObject<{
|
|
1180
|
+
symbol: z.ZodString;
|
|
1181
|
+
brackets: z.ZodArray<z.ZodObject<{
|
|
1182
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
1183
|
+
bracketNotional: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1184
|
+
bracket: z.ZodOptional<z.ZodNumber>;
|
|
1185
|
+
maxLeverage: z.ZodOptional<z.ZodNumber>;
|
|
1186
|
+
maintMarginRatio: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1187
|
+
cum: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1188
|
+
}, z.core.$strip>>;
|
|
1189
|
+
}, z.core.$strip>>;
|
|
1190
|
+
declare const PositionModeSchema: z.ZodObject<{
|
|
1191
|
+
dualSidePosition: z.ZodBoolean;
|
|
1192
|
+
}, z.core.$strip>;
|
|
1193
|
+
type PositionMode = z.infer<typeof PositionModeSchema>;
|
|
1194
|
+
declare const MultiAssetsMarginSchema: z.ZodObject<{
|
|
1195
|
+
multiAssetsMargin: z.ZodBoolean;
|
|
1196
|
+
}, z.core.$strip>;
|
|
1197
|
+
type MultiAssetsMargin = z.infer<typeof MultiAssetsMarginSchema>;
|
|
1198
|
+
declare const FeeBurnStatusSchema: z.ZodObject<{
|
|
1199
|
+
feeBurn: z.ZodBoolean;
|
|
1200
|
+
}, z.core.$strip>;
|
|
1201
|
+
type FeeBurnStatus = z.infer<typeof FeeBurnStatusSchema>;
|
|
1202
|
+
declare const PositionMarginHistoryEntrySchema: z.ZodObject<{
|
|
1203
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1204
|
+
asset: z.ZodString;
|
|
1205
|
+
symbol: z.ZodString;
|
|
1206
|
+
time: z.ZodNumber;
|
|
1207
|
+
type: z.ZodNumber;
|
|
1208
|
+
positionSide: z.ZodString;
|
|
1209
|
+
}, z.core.$strip>;
|
|
1210
|
+
type PositionMarginHistoryEntry = z.infer<typeof PositionMarginHistoryEntrySchema>;
|
|
1211
|
+
declare const PositionMarginHistorySchema: z.ZodArray<z.ZodObject<{
|
|
1212
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1213
|
+
asset: z.ZodString;
|
|
1214
|
+
symbol: z.ZodString;
|
|
1215
|
+
time: z.ZodNumber;
|
|
1216
|
+
type: z.ZodNumber;
|
|
1217
|
+
positionSide: z.ZodString;
|
|
1218
|
+
}, z.core.$strip>>;
|
|
1219
|
+
declare const ApiTradingStatusSchema: z.ZodObject<{
|
|
1220
|
+
isLocked: z.ZodBoolean;
|
|
1221
|
+
plannedRecoverTime: z.ZodNumber;
|
|
1222
|
+
updateTime: z.ZodNumber;
|
|
1223
|
+
triggerCondition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1224
|
+
indicators: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1225
|
+
}, z.core.$strip>;
|
|
1226
|
+
type ApiTradingStatus = z.infer<typeof ApiTradingStatusSchema>;
|
|
1227
|
+
declare const RateLimitOrderSchema: z.ZodObject<{
|
|
1228
|
+
rateLimitType: z.ZodString;
|
|
1229
|
+
interval: z.ZodString;
|
|
1230
|
+
intervalNum: z.ZodNumber;
|
|
1231
|
+
limit: z.ZodNumber;
|
|
1232
|
+
count: z.ZodNumber;
|
|
1233
|
+
}, z.core.$strip>;
|
|
1234
|
+
type RateLimitOrder = z.infer<typeof RateLimitOrderSchema>;
|
|
1235
|
+
declare const RateLimitOrderResponseSchema: z.ZodArray<z.ZodObject<{
|
|
1236
|
+
rateLimitType: z.ZodString;
|
|
1237
|
+
interval: z.ZodString;
|
|
1238
|
+
intervalNum: z.ZodNumber;
|
|
1239
|
+
limit: z.ZodNumber;
|
|
1240
|
+
count: z.ZodNumber;
|
|
1241
|
+
}, z.core.$strip>>;
|
|
1242
|
+
|
|
1243
|
+
declare class FuturesAccount {
|
|
1244
|
+
private readonly http;
|
|
1245
|
+
constructor(http: HttpClient);
|
|
1246
|
+
balance(): Promise<Balance[]>;
|
|
1247
|
+
account(): Promise<Account>;
|
|
1248
|
+
positionRisk(symbol?: string): Promise<PositionRisk[]>;
|
|
1249
|
+
balanceV3(): Promise<Balance[]>;
|
|
1250
|
+
accountV3(): Promise<Account>;
|
|
1251
|
+
positionRiskV3(symbol?: string): Promise<PositionRisk[]>;
|
|
1252
|
+
incomeHistory(options?: {
|
|
1253
|
+
symbol?: string;
|
|
1254
|
+
incomeType?: string;
|
|
1255
|
+
startTime?: number;
|
|
1256
|
+
endTime?: number;
|
|
1257
|
+
limit?: number;
|
|
1258
|
+
}): Promise<Income[]>;
|
|
1259
|
+
userTrades(options?: {
|
|
1260
|
+
symbol?: string;
|
|
1261
|
+
startTime?: number;
|
|
1262
|
+
endTime?: number;
|
|
1263
|
+
limit?: number;
|
|
1264
|
+
fromId?: number;
|
|
1265
|
+
}): Promise<UserTrade[]>;
|
|
1266
|
+
leverageBrackets(symbol?: string): Promise<{
|
|
1267
|
+
symbol: string;
|
|
1268
|
+
brackets: LeverageBracket[];
|
|
1269
|
+
}[]>;
|
|
1270
|
+
commissionRate(symbol: string): Promise<CommissionRate>;
|
|
1271
|
+
multiAssetsMargin(): Promise<MultiAssetsMargin>;
|
|
1272
|
+
setMultiAssetsMargin(multiAssetsMargin: boolean): Promise<Record<string, unknown>>;
|
|
1273
|
+
feeBurnStatus(): Promise<FeeBurnStatus>;
|
|
1274
|
+
setFeeBurnStatus(feeBurn: boolean): Promise<Record<string, unknown>>;
|
|
1275
|
+
positionMode(): Promise<PositionMode>;
|
|
1276
|
+
setPositionMode(dualSidePosition: boolean): Promise<Record<string, unknown>>;
|
|
1277
|
+
apiTradingStatus(): Promise<ApiTradingStatus>;
|
|
1278
|
+
positionMarginHistory(options?: {
|
|
1279
|
+
symbol: string;
|
|
1280
|
+
type?: number;
|
|
1281
|
+
startTime?: number;
|
|
1282
|
+
endTime?: number;
|
|
1283
|
+
limit?: number;
|
|
1284
|
+
}): Promise<PositionMarginHistoryEntry[]>;
|
|
1285
|
+
rateLimitOrder(): Promise<RateLimitOrder[]>;
|
|
1286
|
+
accountConfig(): Promise<Record<string, unknown>>;
|
|
1287
|
+
pmAccountInfo(asset: string): Promise<Record<string, unknown>>;
|
|
1288
|
+
requestIncomeDownload(options: {
|
|
1289
|
+
startTime: number;
|
|
1290
|
+
endTime: number;
|
|
1291
|
+
}): Promise<Record<string, unknown>>;
|
|
1292
|
+
getIncomeDownloadStatus(downloadId: string): Promise<Record<string, unknown>>;
|
|
1293
|
+
requestOrderDownload(options?: {
|
|
1294
|
+
symbol?: string;
|
|
1295
|
+
startTime?: number;
|
|
1296
|
+
endTime?: number;
|
|
1297
|
+
}): Promise<Record<string, unknown>>;
|
|
1298
|
+
getOrderDownloadStatus(downloadId: string): Promise<Record<string, unknown>>;
|
|
1299
|
+
requestTradeDownload(options?: {
|
|
1300
|
+
symbol?: string;
|
|
1301
|
+
startTime?: number;
|
|
1302
|
+
endTime?: number;
|
|
1303
|
+
}): Promise<Record<string, unknown>>;
|
|
1304
|
+
getTradeDownloadStatus(downloadId: string): Promise<Record<string, unknown>>;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
declare const OrderSchema: z.ZodObject<{
|
|
1308
|
+
orderId: z.ZodNumber;
|
|
1309
|
+
symbol: z.ZodString;
|
|
1310
|
+
status: z.ZodString;
|
|
1311
|
+
clientOrderId: z.ZodString;
|
|
1312
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1313
|
+
avgPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1314
|
+
origQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1315
|
+
executedQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1316
|
+
cumQuote: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1317
|
+
type: z.ZodString;
|
|
1318
|
+
reduceOnly: z.ZodBoolean;
|
|
1319
|
+
side: z.ZodString;
|
|
1320
|
+
positionSide: z.ZodString;
|
|
1321
|
+
stopPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1322
|
+
closePosition: z.ZodOptional<z.ZodBoolean>;
|
|
1323
|
+
timeInForce: z.ZodOptional<z.ZodString>;
|
|
1324
|
+
origType: z.ZodOptional<z.ZodString>;
|
|
1325
|
+
time: z.ZodNumber;
|
|
1326
|
+
updateTime: z.ZodNumber;
|
|
1327
|
+
workingType: z.ZodOptional<z.ZodString>;
|
|
1328
|
+
priceProtect: z.ZodOptional<z.ZodBoolean>;
|
|
1329
|
+
}, z.core.$strip>;
|
|
1330
|
+
type Order = z.infer<typeof OrderSchema>;
|
|
1331
|
+
declare const OrderResponseSchema: z.ZodObject<{
|
|
1332
|
+
orderId: z.ZodNumber;
|
|
1333
|
+
symbol: z.ZodString;
|
|
1334
|
+
status: z.ZodString;
|
|
1335
|
+
clientOrderId: z.ZodString;
|
|
1336
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1337
|
+
avgPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1338
|
+
origQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1339
|
+
executedQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1340
|
+
cumQuote: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1341
|
+
type: z.ZodString;
|
|
1342
|
+
reduceOnly: z.ZodBoolean;
|
|
1343
|
+
side: z.ZodString;
|
|
1344
|
+
positionSide: z.ZodString;
|
|
1345
|
+
stopPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1346
|
+
closePosition: z.ZodOptional<z.ZodBoolean>;
|
|
1347
|
+
timeInForce: z.ZodOptional<z.ZodString>;
|
|
1348
|
+
origType: z.ZodOptional<z.ZodString>;
|
|
1349
|
+
time: z.ZodNumber;
|
|
1350
|
+
updateTime: z.ZodNumber;
|
|
1351
|
+
workingType: z.ZodOptional<z.ZodString>;
|
|
1352
|
+
priceProtect: z.ZodOptional<z.ZodBoolean>;
|
|
1353
|
+
}, z.core.$strip>;
|
|
1354
|
+
declare const OrdersResponseSchema: z.ZodArray<z.ZodObject<{
|
|
1355
|
+
orderId: z.ZodNumber;
|
|
1356
|
+
symbol: z.ZodString;
|
|
1357
|
+
status: z.ZodString;
|
|
1358
|
+
clientOrderId: z.ZodString;
|
|
1359
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1360
|
+
avgPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1361
|
+
origQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1362
|
+
executedQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1363
|
+
cumQuote: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1364
|
+
type: z.ZodString;
|
|
1365
|
+
reduceOnly: z.ZodBoolean;
|
|
1366
|
+
side: z.ZodString;
|
|
1367
|
+
positionSide: z.ZodString;
|
|
1368
|
+
stopPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1369
|
+
closePosition: z.ZodOptional<z.ZodBoolean>;
|
|
1370
|
+
timeInForce: z.ZodOptional<z.ZodString>;
|
|
1371
|
+
origType: z.ZodOptional<z.ZodString>;
|
|
1372
|
+
time: z.ZodNumber;
|
|
1373
|
+
updateTime: z.ZodNumber;
|
|
1374
|
+
workingType: z.ZodOptional<z.ZodString>;
|
|
1375
|
+
priceProtect: z.ZodOptional<z.ZodBoolean>;
|
|
1376
|
+
}, z.core.$strip>>;
|
|
1377
|
+
declare const CreateOrderParamsSchema: z.ZodObject<{
|
|
1378
|
+
symbol: z.ZodString;
|
|
1379
|
+
side: z.ZodEnum<{
|
|
1380
|
+
BUY: "BUY";
|
|
1381
|
+
SELL: "SELL";
|
|
1382
|
+
}>;
|
|
1383
|
+
type: z.ZodString;
|
|
1384
|
+
quantity: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
1385
|
+
price: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
1386
|
+
timeInForce: z.ZodOptional<z.ZodEnum<{
|
|
1387
|
+
GTC: "GTC";
|
|
1388
|
+
IOC: "IOC";
|
|
1389
|
+
FOK: "FOK";
|
|
1390
|
+
GTX: "GTX";
|
|
1391
|
+
GTD: "GTD";
|
|
1392
|
+
}>>;
|
|
1393
|
+
stopPrice: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
1394
|
+
reduceOnly: z.ZodOptional<z.ZodBoolean>;
|
|
1395
|
+
positionSide: z.ZodOptional<z.ZodEnum<{
|
|
1396
|
+
BOTH: "BOTH";
|
|
1397
|
+
LONG: "LONG";
|
|
1398
|
+
SHORT: "SHORT";
|
|
1399
|
+
}>>;
|
|
1400
|
+
newClientOrderId: z.ZodOptional<z.ZodString>;
|
|
1401
|
+
closePosition: z.ZodOptional<z.ZodBoolean>;
|
|
1402
|
+
newOrderRespType: z.ZodOptional<z.ZodEnum<{
|
|
1403
|
+
ACK: "ACK";
|
|
1404
|
+
RESULT: "RESULT";
|
|
1405
|
+
}>>;
|
|
1406
|
+
priceProtect: z.ZodOptional<z.ZodBoolean>;
|
|
1407
|
+
workingType: z.ZodOptional<z.ZodEnum<{
|
|
1408
|
+
MARK_PRICE: "MARK_PRICE";
|
|
1409
|
+
CONTRACT_PRICE: "CONTRACT_PRICE";
|
|
1410
|
+
}>>;
|
|
1411
|
+
callbackRate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
1412
|
+
activationPrice: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
1413
|
+
selfTradePreventionMode: z.ZodOptional<z.ZodEnum<{
|
|
1414
|
+
NONE: "NONE";
|
|
1415
|
+
EXPIRE_TAKER: "EXPIRE_TAKER";
|
|
1416
|
+
EXPIRE_MAKER: "EXPIRE_MAKER";
|
|
1417
|
+
EXPIRE_BOTH: "EXPIRE_BOTH";
|
|
1418
|
+
}>>;
|
|
1419
|
+
goodTillDate: z.ZodOptional<z.ZodNumber>;
|
|
1420
|
+
}, z.core.$strip>;
|
|
1421
|
+
type CreateOrderParams = z.infer<typeof CreateOrderParamsSchema>;
|
|
1422
|
+
declare const ModifyOrderParamsSchema: z.ZodObject<{
|
|
1423
|
+
symbol: z.ZodString;
|
|
1424
|
+
side: z.ZodEnum<{
|
|
1425
|
+
BUY: "BUY";
|
|
1426
|
+
SELL: "SELL";
|
|
1427
|
+
}>;
|
|
1428
|
+
type: z.ZodString;
|
|
1429
|
+
quantity: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
1430
|
+
price: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
1431
|
+
timeInForce: z.ZodOptional<z.ZodEnum<{
|
|
1432
|
+
GTC: "GTC";
|
|
1433
|
+
IOC: "IOC";
|
|
1434
|
+
FOK: "FOK";
|
|
1435
|
+
GTX: "GTX";
|
|
1436
|
+
GTD: "GTD";
|
|
1437
|
+
}>>;
|
|
1438
|
+
stopPrice: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
1439
|
+
reduceOnly: z.ZodOptional<z.ZodBoolean>;
|
|
1440
|
+
positionSide: z.ZodOptional<z.ZodEnum<{
|
|
1441
|
+
BOTH: "BOTH";
|
|
1442
|
+
LONG: "LONG";
|
|
1443
|
+
SHORT: "SHORT";
|
|
1444
|
+
}>>;
|
|
1445
|
+
newClientOrderId: z.ZodOptional<z.ZodString>;
|
|
1446
|
+
closePosition: z.ZodOptional<z.ZodBoolean>;
|
|
1447
|
+
newOrderRespType: z.ZodOptional<z.ZodEnum<{
|
|
1448
|
+
ACK: "ACK";
|
|
1449
|
+
RESULT: "RESULT";
|
|
1450
|
+
}>>;
|
|
1451
|
+
priceProtect: z.ZodOptional<z.ZodBoolean>;
|
|
1452
|
+
workingType: z.ZodOptional<z.ZodEnum<{
|
|
1453
|
+
MARK_PRICE: "MARK_PRICE";
|
|
1454
|
+
CONTRACT_PRICE: "CONTRACT_PRICE";
|
|
1455
|
+
}>>;
|
|
1456
|
+
callbackRate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
1457
|
+
activationPrice: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
1458
|
+
selfTradePreventionMode: z.ZodOptional<z.ZodEnum<{
|
|
1459
|
+
NONE: "NONE";
|
|
1460
|
+
EXPIRE_TAKER: "EXPIRE_TAKER";
|
|
1461
|
+
EXPIRE_MAKER: "EXPIRE_MAKER";
|
|
1462
|
+
EXPIRE_BOTH: "EXPIRE_BOTH";
|
|
1463
|
+
}>>;
|
|
1464
|
+
goodTillDate: z.ZodOptional<z.ZodNumber>;
|
|
1465
|
+
orderId: z.ZodOptional<z.ZodNumber>;
|
|
1466
|
+
origClientOrderId: z.ZodOptional<z.ZodString>;
|
|
1467
|
+
origType: z.ZodOptional<z.ZodString>;
|
|
1468
|
+
}, z.core.$strip>;
|
|
1469
|
+
type ModifyOrderParams = z.infer<typeof ModifyOrderParamsSchema>;
|
|
1470
|
+
declare const AlgoOrderSchema: z.ZodObject<{
|
|
1471
|
+
algoId: z.ZodNumber;
|
|
1472
|
+
symbol: z.ZodString;
|
|
1473
|
+
side: z.ZodString;
|
|
1474
|
+
positionSide: z.ZodString;
|
|
1475
|
+
totalQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1476
|
+
executedQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1477
|
+
executedAmt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1478
|
+
avgPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1479
|
+
clientAlgoId: z.ZodOptional<z.ZodString>;
|
|
1480
|
+
bookTime: z.ZodOptional<z.ZodNumber>;
|
|
1481
|
+
endTime: z.ZodOptional<z.ZodNumber>;
|
|
1482
|
+
algoStatus: z.ZodOptional<z.ZodString>;
|
|
1483
|
+
algoType: z.ZodOptional<z.ZodString>;
|
|
1484
|
+
urgency: z.ZodOptional<z.ZodString>;
|
|
1485
|
+
}, z.core.$strip>;
|
|
1486
|
+
type AlgoOrder = z.infer<typeof AlgoOrderSchema>;
|
|
1487
|
+
declare const AlgoOrderResponseSchema: z.ZodObject<{
|
|
1488
|
+
algoId: z.ZodNumber;
|
|
1489
|
+
symbol: z.ZodString;
|
|
1490
|
+
side: z.ZodString;
|
|
1491
|
+
positionSide: z.ZodString;
|
|
1492
|
+
totalQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1493
|
+
executedQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1494
|
+
executedAmt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1495
|
+
avgPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1496
|
+
clientAlgoId: z.ZodOptional<z.ZodString>;
|
|
1497
|
+
bookTime: z.ZodOptional<z.ZodNumber>;
|
|
1498
|
+
endTime: z.ZodOptional<z.ZodNumber>;
|
|
1499
|
+
algoStatus: z.ZodOptional<z.ZodString>;
|
|
1500
|
+
algoType: z.ZodOptional<z.ZodString>;
|
|
1501
|
+
urgency: z.ZodOptional<z.ZodString>;
|
|
1502
|
+
}, z.core.$strip>;
|
|
1503
|
+
declare const AlgoOrdersResponseSchema: z.ZodArray<z.ZodObject<{
|
|
1504
|
+
algoId: z.ZodNumber;
|
|
1505
|
+
symbol: z.ZodString;
|
|
1506
|
+
side: z.ZodString;
|
|
1507
|
+
positionSide: z.ZodString;
|
|
1508
|
+
totalQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1509
|
+
executedQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1510
|
+
executedAmt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1511
|
+
avgPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1512
|
+
clientAlgoId: z.ZodOptional<z.ZodString>;
|
|
1513
|
+
bookTime: z.ZodOptional<z.ZodNumber>;
|
|
1514
|
+
endTime: z.ZodOptional<z.ZodNumber>;
|
|
1515
|
+
algoStatus: z.ZodOptional<z.ZodString>;
|
|
1516
|
+
algoType: z.ZodOptional<z.ZodString>;
|
|
1517
|
+
urgency: z.ZodOptional<z.ZodString>;
|
|
1518
|
+
}, z.core.$strip>>;
|
|
1519
|
+
declare const BatchOrdersItemSchema: z.ZodObject<{
|
|
1520
|
+
orderId: z.ZodNumber;
|
|
1521
|
+
symbol: z.ZodString;
|
|
1522
|
+
status: z.ZodString;
|
|
1523
|
+
clientOrderId: z.ZodString;
|
|
1524
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1525
|
+
avgPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1526
|
+
origQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1527
|
+
executedQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1528
|
+
cumQuote: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1529
|
+
type: z.ZodString;
|
|
1530
|
+
reduceOnly: z.ZodBoolean;
|
|
1531
|
+
side: z.ZodString;
|
|
1532
|
+
positionSide: z.ZodString;
|
|
1533
|
+
time: z.ZodNumber;
|
|
1534
|
+
updateTime: z.ZodNumber;
|
|
1535
|
+
}, z.core.$strip>;
|
|
1536
|
+
type BatchOrdersItem = z.infer<typeof BatchOrdersItemSchema>;
|
|
1537
|
+
declare const BatchOrdersResponseSchema: z.ZodArray<z.ZodObject<{
|
|
1538
|
+
orderId: z.ZodNumber;
|
|
1539
|
+
symbol: z.ZodString;
|
|
1540
|
+
status: z.ZodString;
|
|
1541
|
+
clientOrderId: z.ZodString;
|
|
1542
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1543
|
+
avgPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1544
|
+
origQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1545
|
+
executedQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1546
|
+
cumQuote: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1547
|
+
type: z.ZodString;
|
|
1548
|
+
reduceOnly: z.ZodBoolean;
|
|
1549
|
+
side: z.ZodString;
|
|
1550
|
+
positionSide: z.ZodString;
|
|
1551
|
+
time: z.ZodNumber;
|
|
1552
|
+
updateTime: z.ZodNumber;
|
|
1553
|
+
}, z.core.$strip>>;
|
|
1554
|
+
declare const OrderModifyHistoryEntrySchema: z.ZodObject<{
|
|
1555
|
+
orderId: z.ZodNumber;
|
|
1556
|
+
symbol: z.ZodString;
|
|
1557
|
+
status: z.ZodString;
|
|
1558
|
+
clientOrderId: z.ZodString;
|
|
1559
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1560
|
+
avgPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1561
|
+
origQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1562
|
+
executedQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1563
|
+
cumQuote: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1564
|
+
type: z.ZodString;
|
|
1565
|
+
reduceOnly: z.ZodBoolean;
|
|
1566
|
+
side: z.ZodString;
|
|
1567
|
+
positionSide: z.ZodString;
|
|
1568
|
+
origType: z.ZodOptional<z.ZodString>;
|
|
1569
|
+
stopPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1570
|
+
updateTime: z.ZodNumber;
|
|
1571
|
+
}, z.core.$strip>;
|
|
1572
|
+
type OrderModifyHistoryEntry = z.infer<typeof OrderModifyHistoryEntrySchema>;
|
|
1573
|
+
declare const OrderModifyHistorySchema: z.ZodArray<z.ZodObject<{
|
|
1574
|
+
orderId: z.ZodNumber;
|
|
1575
|
+
symbol: z.ZodString;
|
|
1576
|
+
status: z.ZodString;
|
|
1577
|
+
clientOrderId: z.ZodString;
|
|
1578
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1579
|
+
avgPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1580
|
+
origQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1581
|
+
executedQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1582
|
+
cumQuote: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1583
|
+
type: z.ZodString;
|
|
1584
|
+
reduceOnly: z.ZodBoolean;
|
|
1585
|
+
side: z.ZodString;
|
|
1586
|
+
positionSide: z.ZodString;
|
|
1587
|
+
origType: z.ZodOptional<z.ZodString>;
|
|
1588
|
+
stopPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1589
|
+
updateTime: z.ZodNumber;
|
|
1590
|
+
}, z.core.$strip>>;
|
|
1591
|
+
declare const LeverageChangeSchema: z.ZodObject<{
|
|
1592
|
+
leverage: z.ZodNumber;
|
|
1593
|
+
maxNotionalValue: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
1594
|
+
symbol: z.ZodString;
|
|
1595
|
+
}, z.core.$strip>;
|
|
1596
|
+
type LeverageChange = z.infer<typeof LeverageChangeSchema>;
|
|
1597
|
+
declare const MarginTypeChangeSchema: z.ZodObject<{
|
|
1598
|
+
code: z.ZodNumber;
|
|
1599
|
+
msg: z.ZodString;
|
|
1600
|
+
}, z.core.$strip>;
|
|
1601
|
+
type MarginTypeChange = z.infer<typeof MarginTypeChangeSchema>;
|
|
1602
|
+
declare const PositionMarginChangeSchema: z.ZodObject<{
|
|
1603
|
+
amount: z.ZodNumber;
|
|
1604
|
+
code: z.ZodNumber;
|
|
1605
|
+
msg: z.ZodString;
|
|
1606
|
+
type: z.ZodNumber;
|
|
1607
|
+
}, z.core.$strip>;
|
|
1608
|
+
type PositionMarginChange = z.infer<typeof PositionMarginChangeSchema>;
|
|
1609
|
+
declare const CountdownCancelAllSchema: z.ZodObject<{
|
|
1610
|
+
symbol: z.ZodString;
|
|
1611
|
+
countdownTime: z.ZodNumber;
|
|
1612
|
+
}, z.core.$strip>;
|
|
1613
|
+
type CountdownCancelAll = z.infer<typeof CountdownCancelAllSchema>;
|
|
1614
|
+
declare const NewOrderAckSchema: z.ZodObject<{
|
|
1615
|
+
orderId: z.ZodNumber;
|
|
1616
|
+
symbol: z.ZodString;
|
|
1617
|
+
status: z.ZodString;
|
|
1618
|
+
clientOrderId: z.ZodString;
|
|
1619
|
+
price: z.ZodString;
|
|
1620
|
+
avgPrice: z.ZodString;
|
|
1621
|
+
origQty: z.ZodString;
|
|
1622
|
+
executedQty: z.ZodString;
|
|
1623
|
+
cumQuote: z.ZodString;
|
|
1624
|
+
type: z.ZodString;
|
|
1625
|
+
reduceOnly: z.ZodBoolean;
|
|
1626
|
+
side: z.ZodString;
|
|
1627
|
+
positionSide: z.ZodString;
|
|
1628
|
+
timeInForce: z.ZodOptional<z.ZodString>;
|
|
1629
|
+
time: z.ZodNumber;
|
|
1630
|
+
updateTime: z.ZodNumber;
|
|
1631
|
+
workingType: z.ZodOptional<z.ZodString>;
|
|
1632
|
+
origType: z.ZodOptional<z.ZodString>;
|
|
1633
|
+
closePosition: z.ZodOptional<z.ZodBoolean>;
|
|
1634
|
+
}, z.core.$strip>;
|
|
1635
|
+
type NewOrderAck = z.infer<typeof NewOrderAckSchema>;
|
|
1636
|
+
|
|
1637
|
+
declare class FuturesTrading {
|
|
1638
|
+
private readonly http;
|
|
1639
|
+
constructor(http: HttpClient);
|
|
1640
|
+
setLeverage(symbol: string, leverage: number): Promise<LeverageChange>;
|
|
1641
|
+
createOrder(params: CreateOrderParams): Promise<NewOrderAck | Order>;
|
|
1642
|
+
createTestOrder(params: CreateOrderParams): Promise<Record<string, unknown>>;
|
|
1643
|
+
getOrder(symbol: string, options?: {
|
|
1644
|
+
orderId?: number;
|
|
1645
|
+
origClientOrderId?: string;
|
|
1646
|
+
}): Promise<Order>;
|
|
1647
|
+
cancelOrder(symbol: string, options?: {
|
|
1648
|
+
orderId?: number;
|
|
1649
|
+
origClientOrderId?: string;
|
|
1650
|
+
}): Promise<Order>;
|
|
1651
|
+
getCurrentOrder(symbol: string, options?: {
|
|
1652
|
+
orderId?: number;
|
|
1653
|
+
origClientOrderId?: string;
|
|
1654
|
+
}): Promise<Order>;
|
|
1655
|
+
getOpenOrders(symbol?: string): Promise<Order[]>;
|
|
1656
|
+
getAllOrders(symbol: string, options?: {
|
|
1657
|
+
orderId?: number;
|
|
1658
|
+
startTime?: number;
|
|
1659
|
+
endTime?: number;
|
|
1660
|
+
limit?: number;
|
|
1661
|
+
}): Promise<Order[]>;
|
|
1662
|
+
cancelAllOpenOrders(symbol: string): Promise<Record<string, unknown>>;
|
|
1663
|
+
modifyOrder(params: ModifyOrderParams): Promise<Order>;
|
|
1664
|
+
createAlgoOrder(params: Record<string, unknown>): Promise<AlgoOrder>;
|
|
1665
|
+
cancelAlgoOrder(symbol: string, options?: {
|
|
1666
|
+
algoId?: number;
|
|
1667
|
+
clientAlgoId?: string;
|
|
1668
|
+
}): Promise<Record<string, unknown>>;
|
|
1669
|
+
cancelAllOpenAlgoOrders(symbol: string): Promise<Record<string, unknown>>;
|
|
1670
|
+
getAlgoOrder(symbol: string, options?: {
|
|
1671
|
+
algoId?: number;
|
|
1672
|
+
clientAlgoId?: string;
|
|
1673
|
+
}): Promise<AlgoOrder>;
|
|
1674
|
+
getOpenAlgoOrders(symbol?: string): Promise<AlgoOrder[]>;
|
|
1675
|
+
getAllAlgoOrders(symbol: string, options?: {
|
|
1676
|
+
startTime?: number;
|
|
1677
|
+
endTime?: number;
|
|
1678
|
+
limit?: number;
|
|
1679
|
+
}): Promise<AlgoOrder[]>;
|
|
1680
|
+
createBatchOrders(batchOrders: CreateOrderParams[]): Promise<BatchOrdersItem[]>;
|
|
1681
|
+
modifyBatchOrders(batchOrders: ModifyOrderParams[]): Promise<BatchOrdersItem[]>;
|
|
1682
|
+
cancelBatchOrders(symbol: string, options?: {
|
|
1683
|
+
orderIdList?: number[];
|
|
1684
|
+
origClientOrderIdList?: string[];
|
|
1685
|
+
}): Promise<BatchOrdersItem[]>;
|
|
1686
|
+
getOrderModifyHistory(symbol: string, options?: {
|
|
1687
|
+
startTime?: number;
|
|
1688
|
+
endTime?: number;
|
|
1689
|
+
limit?: number;
|
|
1690
|
+
}): Promise<OrderModifyHistoryEntry[]>;
|
|
1691
|
+
setMarginType(symbol: string, marginType: 'isolated' | 'cross'): Promise<MarginTypeChange>;
|
|
1692
|
+
modifyPositionMargin(symbol: string, amount: number, type: number): Promise<PositionMarginChange>;
|
|
1693
|
+
setCountdownCancelAll(symbol: string, countdownTime: number): Promise<CountdownCancelAll>;
|
|
1694
|
+
convertExchangeInfo(options?: {
|
|
1695
|
+
fromAsset?: string;
|
|
1696
|
+
toAsset?: string;
|
|
1697
|
+
}): Promise<unknown[]>;
|
|
1698
|
+
convertGetQuote(params: {
|
|
1699
|
+
fromAsset: string;
|
|
1700
|
+
toAsset: string;
|
|
1701
|
+
fromAmount?: number;
|
|
1702
|
+
toAmount?: number;
|
|
1703
|
+
validTime?: '10s' | '30s' | '1m' | '2m';
|
|
1704
|
+
}): Promise<Record<string, unknown>>;
|
|
1705
|
+
convertAcceptQuote(quoteId: string): Promise<Record<string, unknown>>;
|
|
1706
|
+
convertOrderStatus(options: {
|
|
1707
|
+
orderId?: string;
|
|
1708
|
+
quoteId?: string;
|
|
1709
|
+
}): Promise<Record<string, unknown>>;
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
/**
|
|
1713
|
+
* Symbol trading rules, flattened out of the loose `filters` array that
|
|
1714
|
+
* `/fapi/v1/exchangeInfo` returns. Callers need these to round prices and
|
|
1715
|
+
* quantities before sending an order — Binance rejects anything that does not
|
|
1716
|
+
* sit exactly on a tick/step boundary (-1111) or that falls under the minimum
|
|
1717
|
+
* notional (-4164).
|
|
1718
|
+
*/
|
|
1719
|
+
interface SymbolRules {
|
|
1720
|
+
symbol: string;
|
|
1721
|
+
status: string;
|
|
1722
|
+
baseAsset: string;
|
|
1723
|
+
quoteAsset: string;
|
|
1724
|
+
/** Tick the price must sit on, e.g. 0.10 for BTCUSDT. */
|
|
1725
|
+
tickSize: number;
|
|
1726
|
+
tickDecimals: number;
|
|
1727
|
+
/** Step the quantity must sit on for limit orders, e.g. 0.001 for BTCUSDT. */
|
|
1728
|
+
stepSize: number;
|
|
1729
|
+
stepDecimals: number;
|
|
1730
|
+
minQty: number;
|
|
1731
|
+
maxQty: number;
|
|
1732
|
+
/** MARKET orders carry their own LOT_SIZE, usually with a lower max. */
|
|
1733
|
+
marketStepSize: number;
|
|
1734
|
+
marketStepDecimals: number;
|
|
1735
|
+
marketMinQty: number;
|
|
1736
|
+
marketMaxQty: number;
|
|
1737
|
+
/** MIN_NOTIONAL — on USD-M futures the field is `notional`, not `minNotional`. */
|
|
1738
|
+
minNotional: number;
|
|
1739
|
+
}
|
|
1740
|
+
/**
|
|
1741
|
+
* Decimal places implied by a step string, e.g. "0.00100000" -> 3, "1" -> 0.
|
|
1742
|
+
* Derived from the string rather than the number so that a step like 0.0000001
|
|
1743
|
+
* never picks up an exponent representation.
|
|
1744
|
+
*/
|
|
1745
|
+
declare function stepDecimals(step: string | number): number;
|
|
1746
|
+
/** Format a value at a fixed precision, which is what should be sent to Binance. */
|
|
1747
|
+
declare function formatToDecimals(value: number, decimals: number): string;
|
|
1748
|
+
/**
|
|
1749
|
+
* Round down onto a step boundary. Used for quantities, where rounding up would
|
|
1750
|
+
* silently take on more risk than the caller asked for. The epsilon absorbs
|
|
1751
|
+
* binary-float error so that e.g. 0.3 / 0.1 = 2.9999999999999996 still floors to 3.
|
|
1752
|
+
*/
|
|
1753
|
+
declare function floorToStep(value: number, step: number, decimals?: number): number;
|
|
1754
|
+
/** Round to the nearest step boundary. Used for prices, where direction is not a risk. */
|
|
1755
|
+
declare function roundToStep(value: number, step: number, decimals?: number): number;
|
|
1756
|
+
/** Flatten one `exchangeInfo.symbols[]` entry into typed trading rules. */
|
|
1757
|
+
declare function symbolRulesFrom(symbol: ExchangeSymbol): SymbolRules;
|
|
1758
|
+
|
|
1759
|
+
interface SizePositionParams {
|
|
1760
|
+
symbol: string;
|
|
1761
|
+
side: 'BUY' | 'SELL';
|
|
1762
|
+
stopPrice: number;
|
|
1763
|
+
entryPrice?: number;
|
|
1764
|
+
riskAmount?: number;
|
|
1765
|
+
riskPct?: number;
|
|
1766
|
+
leverage?: number;
|
|
1767
|
+
marketOrder?: boolean;
|
|
1768
|
+
}
|
|
1769
|
+
interface PositionSizing {
|
|
1770
|
+
ok: boolean;
|
|
1771
|
+
reasons: string[];
|
|
1772
|
+
symbol: string;
|
|
1773
|
+
side: 'BUY' | 'SELL';
|
|
1774
|
+
entryPrice: number;
|
|
1775
|
+
stopPrice: number;
|
|
1776
|
+
riskPerUnit: number;
|
|
1777
|
+
riskAmount: number;
|
|
1778
|
+
rawQuantity: number;
|
|
1779
|
+
quantity: number;
|
|
1780
|
+
/** Pass this to createOrder — a string avoids float round-tripping. */
|
|
1781
|
+
quantityStr: string;
|
|
1782
|
+
notional: number;
|
|
1783
|
+
minNotional: number;
|
|
1784
|
+
leverage: number;
|
|
1785
|
+
requiredMargin: number;
|
|
1786
|
+
availableBalance?: number;
|
|
1787
|
+
rules: SymbolRules;
|
|
1788
|
+
}
|
|
1789
|
+
interface ClosePositionParams {
|
|
1790
|
+
symbol: string;
|
|
1791
|
+
positionSide?: 'BOTH' | 'LONG' | 'SHORT';
|
|
1792
|
+
/** Fraction of the position to close, 0 < portion <= 1. Defaults to the whole position. */
|
|
1793
|
+
portion?: number;
|
|
1794
|
+
dryRun?: boolean;
|
|
1795
|
+
}
|
|
1796
|
+
interface BracketOrderParams {
|
|
1797
|
+
symbol: string;
|
|
1798
|
+
side: 'BUY' | 'SELL';
|
|
1799
|
+
quantity: number | string;
|
|
1800
|
+
entryPrice?: number;
|
|
1801
|
+
stopLossPrice: number;
|
|
1802
|
+
takeProfitPrice?: number;
|
|
1803
|
+
positionSide?: 'BOTH' | 'LONG' | 'SHORT';
|
|
1804
|
+
workingType?: 'MARK_PRICE' | 'CONTRACT_PRICE';
|
|
1805
|
+
}
|
|
1806
|
+
/**
|
|
1807
|
+
* Composite operations layered over the single-endpoint resources.
|
|
1808
|
+
*
|
|
1809
|
+
* Everything here fans out over `FuturesMarket` / `FuturesData` / `FuturesAccount` /
|
|
1810
|
+
* `FuturesTrading` directly. It deliberately does not call the LLM tool handlers,
|
|
1811
|
+
* which return formatted JSON strings — composing at this layer keeps typed values
|
|
1812
|
+
* typed and avoids a parse/stringify round-trip per step.
|
|
1813
|
+
*/
|
|
1814
|
+
declare class FuturesOps {
|
|
1815
|
+
private readonly market;
|
|
1816
|
+
private readonly data;
|
|
1817
|
+
private readonly account;
|
|
1818
|
+
private readonly trading;
|
|
1819
|
+
private rulesCache;
|
|
1820
|
+
constructor(market: FuturesMarket, data: FuturesData, account: FuturesAccount, trading: FuturesTrading);
|
|
1821
|
+
/** Typed tick/step/notional rules for a symbol, cached briefly (exchangeInfo is a large payload). */
|
|
1822
|
+
symbolRules(symbol: string, options?: {
|
|
1823
|
+
refresh?: boolean;
|
|
1824
|
+
}): Promise<SymbolRules>;
|
|
1825
|
+
/** Round a price to the symbol's tick and a quantity to its step, ready to send. */
|
|
1826
|
+
quantize(symbol: string, values: {
|
|
1827
|
+
price?: number;
|
|
1828
|
+
quantity?: number;
|
|
1829
|
+
marketOrder?: boolean;
|
|
1830
|
+
}): Promise<{
|
|
1831
|
+
price?: string;
|
|
1832
|
+
quantity?: string;
|
|
1833
|
+
rules: SymbolRules;
|
|
1834
|
+
}>;
|
|
1835
|
+
/**
|
|
1836
|
+
* Risk-based position sizing. Converts "risk N quote units between entry and stop"
|
|
1837
|
+
* into a quantity that satisfies the symbol's step size, lot bounds and min notional,
|
|
1838
|
+
* and reports every constraint it could not satisfy instead of silently adjusting risk.
|
|
1839
|
+
*/
|
|
1840
|
+
sizePosition(params: SizePositionParams): Promise<PositionSizing>;
|
|
1841
|
+
/**
|
|
1842
|
+
* Flatten an open position with a reduce-only market order.
|
|
1843
|
+
*
|
|
1844
|
+
* Picks the closing side from the sign of `positionAmt` and, critically, chooses
|
|
1845
|
+
* between `reduceOnly` and `positionSide`: Binance rejects `reduceOnly` in hedge
|
|
1846
|
+
* mode, and rejects a LONG/SHORT `positionSide` in one-way mode.
|
|
1847
|
+
*/
|
|
1848
|
+
closePosition(params: ClosePositionParams): Promise<{
|
|
1849
|
+
closed: boolean;
|
|
1850
|
+
reason?: string;
|
|
1851
|
+
position?: PositionRisk;
|
|
1852
|
+
order?: unknown;
|
|
1853
|
+
request?: Record<string, unknown>;
|
|
1854
|
+
}>;
|
|
1855
|
+
/**
|
|
1856
|
+
* One-call market picture: 24h stats, mark/index and funding, open interest and
|
|
1857
|
+
* positioning. Uses allSettled so a single unavailable feed degrades one field
|
|
1858
|
+
* instead of failing the whole snapshot.
|
|
1859
|
+
*/
|
|
1860
|
+
marketSnapshot(symbol: string, options?: {
|
|
1861
|
+
period?: string;
|
|
1862
|
+
}): Promise<Record<string, unknown>>;
|
|
1863
|
+
/** Balances, open positions and working orders in one call, with the noise filtered out. */
|
|
1864
|
+
accountOverview(): Promise<Record<string, unknown>>;
|
|
1865
|
+
/**
|
|
1866
|
+
* Entry order plus its protective stop-loss and optional take-profit, with every
|
|
1867
|
+
* price quantized to the symbol tick.
|
|
1868
|
+
*
|
|
1869
|
+
* The protective legs are placed after the entry is accepted. If a protective leg
|
|
1870
|
+
* fails, the failure is reported per-leg rather than unwound: the entry may already
|
|
1871
|
+
* have filled, so cancelling it is not a safe automatic recovery.
|
|
1872
|
+
*/
|
|
1873
|
+
placeBracketOrder(params: BracketOrderParams): Promise<Record<string, unknown>>;
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
declare class UserDataStream {
|
|
1877
|
+
private readonly http;
|
|
1878
|
+
constructor(http: HttpClient);
|
|
1879
|
+
createListenKey(): Promise<ListenKey>;
|
|
1880
|
+
keepAliveListenKey(): Promise<Record<string, unknown>>;
|
|
1881
|
+
closeListenKey(): Promise<Record<string, unknown>>;
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
declare const CoinMBalanceSchema: z.ZodObject<{
|
|
1885
|
+
accountAlias: z.ZodString;
|
|
1886
|
+
asset: z.ZodString;
|
|
1887
|
+
balance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1888
|
+
withdrawAvailable: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1889
|
+
crossWalletBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1890
|
+
crossUnPnl: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1891
|
+
availableBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1892
|
+
updateTime: z.ZodNumber;
|
|
1893
|
+
}, z.core.$strip>;
|
|
1894
|
+
type CoinMBalance = z.infer<typeof CoinMBalanceSchema>;
|
|
1895
|
+
declare const CoinMBalanceResponseSchema: z.ZodArray<z.ZodObject<{
|
|
1896
|
+
accountAlias: z.ZodString;
|
|
1897
|
+
asset: z.ZodString;
|
|
1898
|
+
balance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1899
|
+
withdrawAvailable: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1900
|
+
crossWalletBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1901
|
+
crossUnPnl: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1902
|
+
availableBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1903
|
+
updateTime: z.ZodNumber;
|
|
1904
|
+
}, z.core.$strip>>;
|
|
1905
|
+
declare const CoinMPositionRiskSchema: z.ZodObject<{
|
|
1906
|
+
symbol: z.ZodString;
|
|
1907
|
+
pair: z.ZodOptional<z.ZodString>;
|
|
1908
|
+
positionAmt: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1909
|
+
entryPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1910
|
+
markPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1911
|
+
unRealizedProfit: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1912
|
+
liquidationPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1913
|
+
leverage: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1914
|
+
maxQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1915
|
+
marginType: z.ZodEnum<{
|
|
1916
|
+
isolated: "isolated";
|
|
1917
|
+
cross: "cross";
|
|
1918
|
+
}>;
|
|
1919
|
+
isolatedMargin: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1920
|
+
isAutoAddMargin: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
1921
|
+
positionSide: z.ZodString;
|
|
1922
|
+
notionalValue: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1923
|
+
breakEvenPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1924
|
+
updateTime: z.ZodOptional<z.ZodNumber>;
|
|
1925
|
+
}, z.core.$loose>;
|
|
1926
|
+
type CoinMPositionRisk = z.infer<typeof CoinMPositionRiskSchema>;
|
|
1927
|
+
declare const CoinMPositionRiskResponseSchema: z.ZodArray<z.ZodObject<{
|
|
1928
|
+
symbol: z.ZodString;
|
|
1929
|
+
pair: z.ZodOptional<z.ZodString>;
|
|
1930
|
+
positionAmt: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1931
|
+
entryPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1932
|
+
markPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1933
|
+
unRealizedProfit: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1934
|
+
liquidationPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1935
|
+
leverage: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1936
|
+
maxQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1937
|
+
marginType: z.ZodEnum<{
|
|
1938
|
+
isolated: "isolated";
|
|
1939
|
+
cross: "cross";
|
|
1940
|
+
}>;
|
|
1941
|
+
isolatedMargin: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1942
|
+
isAutoAddMargin: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
1943
|
+
positionSide: z.ZodString;
|
|
1944
|
+
notionalValue: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1945
|
+
breakEvenPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1946
|
+
updateTime: z.ZodOptional<z.ZodNumber>;
|
|
1947
|
+
}, z.core.$loose>>;
|
|
1948
|
+
declare const CoinMAccountAssetSchema: z.ZodObject<{
|
|
1949
|
+
asset: z.ZodString;
|
|
1950
|
+
walletBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1951
|
+
unrealizedProfit: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1952
|
+
marginBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1953
|
+
maintMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1954
|
+
initialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1955
|
+
positionInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1956
|
+
openOrderInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1957
|
+
maxWithdrawAmount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1958
|
+
crossWalletBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1959
|
+
crossUnPnl: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1960
|
+
availableBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1961
|
+
updateTime: z.ZodNumber;
|
|
1962
|
+
}, z.core.$loose>;
|
|
1963
|
+
type CoinMAccountAsset = z.infer<typeof CoinMAccountAssetSchema>;
|
|
1964
|
+
declare const CoinMAccountPositionSchema: z.ZodObject<{
|
|
1965
|
+
symbol: z.ZodString;
|
|
1966
|
+
positionAmt: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1967
|
+
initialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1968
|
+
maintMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1969
|
+
unrealizedProfit: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1970
|
+
positionInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1971
|
+
openOrderInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1972
|
+
leverage: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1973
|
+
isolated: z.ZodBoolean;
|
|
1974
|
+
positionSide: z.ZodString;
|
|
1975
|
+
entryPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1976
|
+
maxQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
1977
|
+
updateTime: z.ZodOptional<z.ZodNumber>;
|
|
1978
|
+
}, z.core.$loose>;
|
|
1979
|
+
type CoinMAccountPosition = z.infer<typeof CoinMAccountPositionSchema>;
|
|
1980
|
+
declare const CoinMAccountSchema: z.ZodObject<{
|
|
1981
|
+
canDeposit: z.ZodBoolean;
|
|
1982
|
+
canTrade: z.ZodBoolean;
|
|
1983
|
+
canWithdraw: z.ZodBoolean;
|
|
1984
|
+
feeTier: z.ZodNumber;
|
|
1985
|
+
updateTime: z.ZodNumber;
|
|
1986
|
+
assets: z.ZodArray<z.ZodObject<{
|
|
1987
|
+
asset: z.ZodString;
|
|
1988
|
+
walletBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1989
|
+
unrealizedProfit: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1990
|
+
marginBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1991
|
+
maintMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1992
|
+
initialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1993
|
+
positionInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1994
|
+
openOrderInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1995
|
+
maxWithdrawAmount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1996
|
+
crossWalletBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1997
|
+
crossUnPnl: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1998
|
+
availableBalance: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
1999
|
+
updateTime: z.ZodNumber;
|
|
2000
|
+
}, z.core.$loose>>;
|
|
2001
|
+
positions: z.ZodArray<z.ZodObject<{
|
|
2002
|
+
symbol: z.ZodString;
|
|
2003
|
+
positionAmt: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2004
|
+
initialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2005
|
+
maintMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2006
|
+
unrealizedProfit: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2007
|
+
positionInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2008
|
+
openOrderInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2009
|
+
leverage: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2010
|
+
isolated: z.ZodBoolean;
|
|
2011
|
+
positionSide: z.ZodString;
|
|
2012
|
+
entryPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2013
|
+
maxQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2014
|
+
updateTime: z.ZodOptional<z.ZodNumber>;
|
|
2015
|
+
}, z.core.$loose>>;
|
|
2016
|
+
}, z.core.$loose>;
|
|
2017
|
+
type CoinMAccountInfo = z.infer<typeof CoinMAccountSchema>;
|
|
2018
|
+
declare const CoinMOrderSchema: z.ZodObject<{
|
|
2019
|
+
orderId: z.ZodNumber;
|
|
2020
|
+
symbol: z.ZodString;
|
|
2021
|
+
pair: z.ZodOptional<z.ZodString>;
|
|
2022
|
+
status: z.ZodString;
|
|
2023
|
+
clientOrderId: z.ZodString;
|
|
2024
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2025
|
+
avgPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2026
|
+
origQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2027
|
+
executedQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2028
|
+
cumBase: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2029
|
+
type: z.ZodString;
|
|
2030
|
+
reduceOnly: z.ZodBoolean;
|
|
2031
|
+
closePosition: z.ZodOptional<z.ZodBoolean>;
|
|
2032
|
+
side: z.ZodString;
|
|
2033
|
+
positionSide: z.ZodString;
|
|
2034
|
+
stopPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2035
|
+
workingType: z.ZodOptional<z.ZodString>;
|
|
2036
|
+
priceProtect: z.ZodOptional<z.ZodBoolean>;
|
|
2037
|
+
origType: z.ZodOptional<z.ZodString>;
|
|
2038
|
+
timeInForce: z.ZodOptional<z.ZodString>;
|
|
2039
|
+
activatePrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2040
|
+
priceRate: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2041
|
+
time: z.ZodNumber;
|
|
2042
|
+
updateTime: z.ZodNumber;
|
|
2043
|
+
}, z.core.$loose>;
|
|
2044
|
+
type CoinMOrder = z.infer<typeof CoinMOrderSchema>;
|
|
2045
|
+
declare const CoinMOrderResponseSchema: z.ZodObject<{
|
|
2046
|
+
orderId: z.ZodNumber;
|
|
2047
|
+
symbol: z.ZodString;
|
|
2048
|
+
pair: z.ZodOptional<z.ZodString>;
|
|
2049
|
+
status: z.ZodString;
|
|
2050
|
+
clientOrderId: z.ZodString;
|
|
2051
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2052
|
+
avgPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2053
|
+
origQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2054
|
+
executedQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2055
|
+
cumBase: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2056
|
+
type: z.ZodString;
|
|
2057
|
+
reduceOnly: z.ZodBoolean;
|
|
2058
|
+
closePosition: z.ZodOptional<z.ZodBoolean>;
|
|
2059
|
+
side: z.ZodString;
|
|
2060
|
+
positionSide: z.ZodString;
|
|
2061
|
+
stopPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2062
|
+
workingType: z.ZodOptional<z.ZodString>;
|
|
2063
|
+
priceProtect: z.ZodOptional<z.ZodBoolean>;
|
|
2064
|
+
origType: z.ZodOptional<z.ZodString>;
|
|
2065
|
+
timeInForce: z.ZodOptional<z.ZodString>;
|
|
2066
|
+
activatePrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2067
|
+
priceRate: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2068
|
+
time: z.ZodNumber;
|
|
2069
|
+
updateTime: z.ZodNumber;
|
|
2070
|
+
}, z.core.$loose>;
|
|
2071
|
+
declare const CoinMOrdersResponseSchema: z.ZodArray<z.ZodObject<{
|
|
2072
|
+
orderId: z.ZodNumber;
|
|
2073
|
+
symbol: z.ZodString;
|
|
2074
|
+
pair: z.ZodOptional<z.ZodString>;
|
|
2075
|
+
status: z.ZodString;
|
|
2076
|
+
clientOrderId: z.ZodString;
|
|
2077
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2078
|
+
avgPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2079
|
+
origQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2080
|
+
executedQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2081
|
+
cumBase: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2082
|
+
type: z.ZodString;
|
|
2083
|
+
reduceOnly: z.ZodBoolean;
|
|
2084
|
+
closePosition: z.ZodOptional<z.ZodBoolean>;
|
|
2085
|
+
side: z.ZodString;
|
|
2086
|
+
positionSide: z.ZodString;
|
|
2087
|
+
stopPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2088
|
+
workingType: z.ZodOptional<z.ZodString>;
|
|
2089
|
+
priceProtect: z.ZodOptional<z.ZodBoolean>;
|
|
2090
|
+
origType: z.ZodOptional<z.ZodString>;
|
|
2091
|
+
timeInForce: z.ZodOptional<z.ZodString>;
|
|
2092
|
+
activatePrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2093
|
+
priceRate: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2094
|
+
time: z.ZodNumber;
|
|
2095
|
+
updateTime: z.ZodNumber;
|
|
2096
|
+
}, z.core.$loose>>;
|
|
2097
|
+
declare const CoinMCreateOrderParamsSchema: z.ZodObject<{
|
|
2098
|
+
symbol: z.ZodString;
|
|
2099
|
+
side: z.ZodEnum<{
|
|
2100
|
+
BUY: "BUY";
|
|
2101
|
+
SELL: "SELL";
|
|
2102
|
+
}>;
|
|
2103
|
+
positionSide: z.ZodOptional<z.ZodEnum<{
|
|
2104
|
+
BOTH: "BOTH";
|
|
2105
|
+
LONG: "LONG";
|
|
2106
|
+
SHORT: "SHORT";
|
|
2107
|
+
}>>;
|
|
2108
|
+
type: z.ZodString;
|
|
2109
|
+
timeInForce: z.ZodOptional<z.ZodEnum<{
|
|
2110
|
+
GTC: "GTC";
|
|
2111
|
+
IOC: "IOC";
|
|
2112
|
+
FOK: "FOK";
|
|
2113
|
+
GTX: "GTX";
|
|
2114
|
+
}>>;
|
|
2115
|
+
quantity: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
2116
|
+
reduceOnly: z.ZodOptional<z.ZodBoolean>;
|
|
2117
|
+
price: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
2118
|
+
newClientOrderId: z.ZodOptional<z.ZodString>;
|
|
2119
|
+
stopPrice: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
2120
|
+
closePosition: z.ZodOptional<z.ZodBoolean>;
|
|
2121
|
+
activationPrice: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
2122
|
+
callbackRate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
2123
|
+
workingType: z.ZodOptional<z.ZodEnum<{
|
|
2124
|
+
MARK_PRICE: "MARK_PRICE";
|
|
2125
|
+
CONTRACT_PRICE: "CONTRACT_PRICE";
|
|
2126
|
+
}>>;
|
|
2127
|
+
priceProtect: z.ZodOptional<z.ZodBoolean>;
|
|
2128
|
+
newOrderRespType: z.ZodOptional<z.ZodEnum<{
|
|
2129
|
+
ACK: "ACK";
|
|
2130
|
+
RESULT: "RESULT";
|
|
2131
|
+
}>>;
|
|
2132
|
+
}, z.core.$strip>;
|
|
2133
|
+
type CoinMCreateOrderParams = z.infer<typeof CoinMCreateOrderParamsSchema>;
|
|
2134
|
+
declare const CoinMLeverageChangeSchema: z.ZodObject<{
|
|
2135
|
+
leverage: z.ZodNumber;
|
|
2136
|
+
maxQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2137
|
+
symbol: z.ZodString;
|
|
2138
|
+
}, z.core.$strip>;
|
|
2139
|
+
type CoinMLeverageChange = z.infer<typeof CoinMLeverageChangeSchema>;
|
|
2140
|
+
declare const CoinMMarginTypeChangeSchema: z.ZodObject<{
|
|
2141
|
+
code: z.ZodNumber;
|
|
2142
|
+
msg: z.ZodString;
|
|
2143
|
+
}, z.core.$strip>;
|
|
2144
|
+
type CoinMMarginTypeChange = z.infer<typeof CoinMMarginTypeChangeSchema>;
|
|
2145
|
+
declare const CoinMPositionMarginChangeSchema: z.ZodObject<{
|
|
2146
|
+
amount: z.ZodNumber;
|
|
2147
|
+
code: z.ZodNumber;
|
|
2148
|
+
msg: z.ZodString;
|
|
2149
|
+
type: z.ZodNumber;
|
|
2150
|
+
}, z.core.$strip>;
|
|
2151
|
+
type CoinMPositionMarginChange = z.infer<typeof CoinMPositionMarginChangeSchema>;
|
|
2152
|
+
declare const CoinMIncomeSchema: z.ZodObject<{
|
|
2153
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
2154
|
+
incomeType: z.ZodString;
|
|
2155
|
+
income: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2156
|
+
asset: z.ZodString;
|
|
2157
|
+
info: z.ZodOptional<z.ZodString>;
|
|
2158
|
+
time: z.ZodNumber;
|
|
2159
|
+
tranId: z.ZodNumber;
|
|
2160
|
+
tradeId: z.ZodOptional<z.ZodString>;
|
|
2161
|
+
}, z.core.$loose>;
|
|
2162
|
+
type CoinMIncome = z.infer<typeof CoinMIncomeSchema>;
|
|
2163
|
+
declare const CoinMIncomeHistoryResponseSchema: z.ZodArray<z.ZodObject<{
|
|
2164
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
2165
|
+
incomeType: z.ZodString;
|
|
2166
|
+
income: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2167
|
+
asset: z.ZodString;
|
|
2168
|
+
info: z.ZodOptional<z.ZodString>;
|
|
2169
|
+
time: z.ZodNumber;
|
|
2170
|
+
tranId: z.ZodNumber;
|
|
2171
|
+
tradeId: z.ZodOptional<z.ZodString>;
|
|
2172
|
+
}, z.core.$loose>>;
|
|
2173
|
+
declare const CoinMUserTradeSchema: z.ZodObject<{
|
|
2174
|
+
symbol: z.ZodString;
|
|
2175
|
+
id: z.ZodNumber;
|
|
2176
|
+
orderId: z.ZodNumber;
|
|
2177
|
+
pair: z.ZodOptional<z.ZodString>;
|
|
2178
|
+
side: z.ZodString;
|
|
2179
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2180
|
+
qty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2181
|
+
realizedPnl: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2182
|
+
marginAsset: z.ZodOptional<z.ZodString>;
|
|
2183
|
+
baseQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2184
|
+
commission: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2185
|
+
commissionAsset: z.ZodString;
|
|
2186
|
+
time: z.ZodNumber;
|
|
2187
|
+
positionSide: z.ZodString;
|
|
2188
|
+
buyer: z.ZodBoolean;
|
|
2189
|
+
maker: z.ZodBoolean;
|
|
2190
|
+
}, z.core.$loose>;
|
|
2191
|
+
type CoinMUserTrade = z.infer<typeof CoinMUserTradeSchema>;
|
|
2192
|
+
declare const CoinMUserTradesResponseSchema: z.ZodArray<z.ZodObject<{
|
|
2193
|
+
symbol: z.ZodString;
|
|
2194
|
+
id: z.ZodNumber;
|
|
2195
|
+
orderId: z.ZodNumber;
|
|
2196
|
+
pair: z.ZodOptional<z.ZodString>;
|
|
2197
|
+
side: z.ZodString;
|
|
2198
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2199
|
+
qty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2200
|
+
realizedPnl: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2201
|
+
marginAsset: z.ZodOptional<z.ZodString>;
|
|
2202
|
+
baseQty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2203
|
+
commission: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2204
|
+
commissionAsset: z.ZodString;
|
|
2205
|
+
time: z.ZodNumber;
|
|
2206
|
+
positionSide: z.ZodString;
|
|
2207
|
+
buyer: z.ZodBoolean;
|
|
2208
|
+
maker: z.ZodBoolean;
|
|
2209
|
+
}, z.core.$loose>>;
|
|
2210
|
+
declare const CoinMOpenInterestHistEntrySchema: z.ZodObject<{
|
|
2211
|
+
pair: z.ZodString;
|
|
2212
|
+
contractType: z.ZodString;
|
|
2213
|
+
sumOpenInterest: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2214
|
+
sumOpenInterestValue: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2215
|
+
timestamp: z.ZodNumber;
|
|
2216
|
+
}, z.core.$strip>;
|
|
2217
|
+
type CoinMOpenInterestHistEntry = z.infer<typeof CoinMOpenInterestHistEntrySchema>;
|
|
2218
|
+
declare const CoinMOpenInterestHistSchema: z.ZodArray<z.ZodObject<{
|
|
2219
|
+
pair: z.ZodString;
|
|
2220
|
+
contractType: z.ZodString;
|
|
2221
|
+
sumOpenInterest: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2222
|
+
sumOpenInterestValue: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2223
|
+
timestamp: z.ZodNumber;
|
|
2224
|
+
}, z.core.$strip>>;
|
|
2225
|
+
declare const CoinMPositionModeSchema: z.ZodObject<{
|
|
2226
|
+
dualSidePosition: z.ZodBoolean;
|
|
2227
|
+
}, z.core.$strip>;
|
|
2228
|
+
type CoinMPositionMode = z.infer<typeof CoinMPositionModeSchema>;
|
|
2229
|
+
declare const CoinMLeverageBracketSchema: z.ZodObject<{
|
|
2230
|
+
bracket: z.ZodNumber;
|
|
2231
|
+
initialLeverage: z.ZodNumber;
|
|
2232
|
+
qtyCap: z.ZodNumber;
|
|
2233
|
+
qtyFloor: z.ZodNumber;
|
|
2234
|
+
maintMarginRatio: z.ZodNumber;
|
|
2235
|
+
cum: z.ZodOptional<z.ZodNumber>;
|
|
2236
|
+
}, z.core.$strip>;
|
|
2237
|
+
type CoinMLeverageBracket = z.infer<typeof CoinMLeverageBracketSchema>;
|
|
2238
|
+
declare const CoinMLeverageBracketResponseSchema: z.ZodArray<z.ZodObject<{
|
|
2239
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
2240
|
+
pair: z.ZodOptional<z.ZodString>;
|
|
2241
|
+
brackets: z.ZodArray<z.ZodObject<{
|
|
2242
|
+
bracket: z.ZodNumber;
|
|
2243
|
+
initialLeverage: z.ZodNumber;
|
|
2244
|
+
qtyCap: z.ZodNumber;
|
|
2245
|
+
qtyFloor: z.ZodNumber;
|
|
2246
|
+
maintMarginRatio: z.ZodNumber;
|
|
2247
|
+
cum: z.ZodOptional<z.ZodNumber>;
|
|
2248
|
+
}, z.core.$strip>>;
|
|
2249
|
+
}, z.core.$strip>>;
|
|
2250
|
+
declare const CoinMCommissionRateSchema: z.ZodObject<{
|
|
2251
|
+
symbol: z.ZodString;
|
|
2252
|
+
makerCommissionRate: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2253
|
+
takerCommissionRate: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2254
|
+
}, z.core.$strip>;
|
|
2255
|
+
type CoinMCommissionRate = z.infer<typeof CoinMCommissionRateSchema>;
|
|
2256
|
+
|
|
2257
|
+
declare class CoinMMarket extends MarketDataBase {
|
|
2258
|
+
constructor(http?: HttpClient);
|
|
2259
|
+
continuousKlines(pair: string, contractType: 'perpetual' | 'current_quarter' | 'next_quarter', interval: KlineInterval, options?: {
|
|
2260
|
+
startTime?: number;
|
|
2261
|
+
endTime?: number;
|
|
2262
|
+
limit?: number;
|
|
2263
|
+
}): Promise<Kline[]>;
|
|
2264
|
+
indexPriceKlines(pair: string, interval: KlineInterval, options?: {
|
|
2265
|
+
startTime?: number;
|
|
2266
|
+
endTime?: number;
|
|
2267
|
+
limit?: number;
|
|
2268
|
+
}): Promise<Kline[]>;
|
|
2269
|
+
markPriceKlines(symbol: string, interval: KlineInterval, options?: {
|
|
2270
|
+
startTime?: number;
|
|
2271
|
+
endTime?: number;
|
|
2272
|
+
limit?: number;
|
|
2273
|
+
}): Promise<Kline[]>;
|
|
2274
|
+
premiumIndex(options?: {
|
|
2275
|
+
symbol?: string;
|
|
2276
|
+
pair?: string;
|
|
2277
|
+
}): Promise<PremiumIndex[] | PremiumIndex>;
|
|
2278
|
+
fundingRateHistory(symbol: string, options?: {
|
|
2279
|
+
startTime?: number;
|
|
2280
|
+
endTime?: number;
|
|
2281
|
+
limit?: number;
|
|
2282
|
+
}): Promise<FundingRate[]>;
|
|
2283
|
+
openInterest(symbol: string): Promise<OpenInterest>;
|
|
2284
|
+
openInterestHist(pair: string, contractType: 'ALL' | 'CURRENT_QUARTER' | 'NEXT_QUARTER' | 'PERPETUAL', period: '5m' | '15m' | '30m' | '1h' | '2h' | '4h' | '6h' | '12h' | '1d', options?: {
|
|
2285
|
+
startTime?: number;
|
|
2286
|
+
endTime?: number;
|
|
2287
|
+
limit?: number;
|
|
2288
|
+
}): Promise<CoinMOpenInterestHistEntry[]>;
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
declare class CoinMAccount {
|
|
2292
|
+
private readonly http;
|
|
2293
|
+
constructor(http: HttpClient);
|
|
2294
|
+
balance(): Promise<CoinMBalance[]>;
|
|
2295
|
+
account(): Promise<CoinMAccountInfo>;
|
|
2296
|
+
positionRisk(options?: {
|
|
2297
|
+
symbol?: string;
|
|
2298
|
+
pair?: string;
|
|
2299
|
+
}): Promise<CoinMPositionRisk[]>;
|
|
2300
|
+
incomeHistory(options?: {
|
|
2301
|
+
symbol?: string;
|
|
2302
|
+
incomeType?: string;
|
|
2303
|
+
startTime?: number;
|
|
2304
|
+
endTime?: number;
|
|
2305
|
+
limit?: number;
|
|
2306
|
+
}): Promise<CoinMIncome[]>;
|
|
2307
|
+
userTrades(options?: {
|
|
2308
|
+
symbol?: string;
|
|
2309
|
+
pair?: string;
|
|
2310
|
+
startTime?: number;
|
|
2311
|
+
endTime?: number;
|
|
2312
|
+
limit?: number;
|
|
2313
|
+
fromId?: number;
|
|
2314
|
+
}): Promise<CoinMUserTrade[]>;
|
|
2315
|
+
leverageBrackets(symbol?: string): Promise<{
|
|
2316
|
+
symbol?: string;
|
|
2317
|
+
pair?: string;
|
|
2318
|
+
brackets: CoinMLeverageBracket[];
|
|
2319
|
+
}[]>;
|
|
2320
|
+
commissionRate(symbol: string): Promise<CoinMCommissionRate>;
|
|
2321
|
+
positionMode(): Promise<CoinMPositionMode>;
|
|
2322
|
+
setPositionMode(dualSidePosition: boolean): Promise<Record<string, unknown>>;
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2325
|
+
declare class CoinMTrading {
|
|
2326
|
+
private readonly http;
|
|
2327
|
+
constructor(http: HttpClient);
|
|
2328
|
+
setLeverage(symbol: string, leverage: number): Promise<CoinMLeverageChange>;
|
|
2329
|
+
setMarginType(symbol: string, marginType: 'ISOLATED' | 'CROSSED'): Promise<CoinMMarginTypeChange>;
|
|
2330
|
+
createOrder(params: CoinMCreateOrderParams): Promise<CoinMOrder>;
|
|
2331
|
+
createTestOrder(params: CoinMCreateOrderParams): Promise<Record<string, unknown>>;
|
|
2332
|
+
getOrder(symbol: string, options?: {
|
|
2333
|
+
orderId?: number;
|
|
2334
|
+
origClientOrderId?: string;
|
|
2335
|
+
}): Promise<CoinMOrder>;
|
|
2336
|
+
cancelOrder(symbol: string, options?: {
|
|
2337
|
+
orderId?: number;
|
|
2338
|
+
origClientOrderId?: string;
|
|
2339
|
+
}): Promise<CoinMOrder>;
|
|
2340
|
+
cancelAllOpenOrders(symbol: string): Promise<Record<string, unknown>>;
|
|
2341
|
+
getOpenOrders(symbol?: string): Promise<CoinMOrder[]>;
|
|
2342
|
+
getAllOrders(symbol: string, options?: {
|
|
2343
|
+
orderId?: number;
|
|
2344
|
+
startTime?: number;
|
|
2345
|
+
endTime?: number;
|
|
2346
|
+
limit?: number;
|
|
2347
|
+
}): Promise<CoinMOrder[]>;
|
|
2348
|
+
modifyPositionMargin(symbol: string, amount: number, type: number): Promise<CoinMPositionMarginChange>;
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
declare class CoinMUserDataStream {
|
|
2352
|
+
private readonly http;
|
|
2353
|
+
constructor(http: HttpClient);
|
|
2354
|
+
createListenKey(): Promise<ListenKey>;
|
|
2355
|
+
keepAliveListenKey(): Promise<Record<string, unknown>>;
|
|
2356
|
+
closeListenKey(): Promise<Record<string, unknown>>;
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
declare const MarginAssetBalanceSchema: z.ZodObject<{
|
|
2360
|
+
asset: z.ZodString;
|
|
2361
|
+
borrowed: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2362
|
+
free: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2363
|
+
interest: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2364
|
+
locked: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2365
|
+
netAsset: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2366
|
+
}, z.core.$strip>;
|
|
2367
|
+
type MarginAssetBalance = z.infer<typeof MarginAssetBalanceSchema>;
|
|
2368
|
+
declare const CrossMarginAccountSchema: z.ZodObject<{
|
|
2369
|
+
borrowEnabled: z.ZodBoolean;
|
|
2370
|
+
marginLevel: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2371
|
+
totalAssetOfBtc: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2372
|
+
totalLiabilityOfBtc: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2373
|
+
totalNetAssetOfBtc: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2374
|
+
tradeEnabled: z.ZodBoolean;
|
|
2375
|
+
transferEnabled: z.ZodBoolean;
|
|
2376
|
+
accountType: z.ZodOptional<z.ZodString>;
|
|
2377
|
+
userAssets: z.ZodArray<z.ZodObject<{
|
|
2378
|
+
asset: z.ZodString;
|
|
2379
|
+
borrowed: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2380
|
+
free: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2381
|
+
interest: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2382
|
+
locked: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2383
|
+
netAsset: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2384
|
+
}, z.core.$strip>>;
|
|
2385
|
+
}, z.core.$loose>;
|
|
2386
|
+
type CrossMarginAccount = z.infer<typeof CrossMarginAccountSchema>;
|
|
2387
|
+
declare const IsolatedMarginAssetSchema: z.ZodObject<{
|
|
2388
|
+
asset: z.ZodString;
|
|
2389
|
+
borrowEnabled: z.ZodBoolean;
|
|
2390
|
+
borrowed: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2391
|
+
free: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2392
|
+
interest: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2393
|
+
locked: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2394
|
+
netAsset: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2395
|
+
netAssetOfBtc: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2396
|
+
repayEnabled: z.ZodBoolean;
|
|
2397
|
+
totalAsset: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2398
|
+
}, z.core.$loose>;
|
|
2399
|
+
type IsolatedMarginAsset = z.infer<typeof IsolatedMarginAssetSchema>;
|
|
2400
|
+
declare const IsolatedMarginSymbolSchema: z.ZodObject<{
|
|
2401
|
+
baseAsset: z.ZodObject<{
|
|
2402
|
+
asset: z.ZodString;
|
|
2403
|
+
borrowEnabled: z.ZodBoolean;
|
|
2404
|
+
borrowed: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2405
|
+
free: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2406
|
+
interest: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2407
|
+
locked: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2408
|
+
netAsset: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2409
|
+
netAssetOfBtc: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2410
|
+
repayEnabled: z.ZodBoolean;
|
|
2411
|
+
totalAsset: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2412
|
+
}, z.core.$loose>;
|
|
2413
|
+
quoteAsset: z.ZodObject<{
|
|
2414
|
+
asset: z.ZodString;
|
|
2415
|
+
borrowEnabled: z.ZodBoolean;
|
|
2416
|
+
borrowed: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2417
|
+
free: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2418
|
+
interest: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2419
|
+
locked: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2420
|
+
netAsset: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2421
|
+
netAssetOfBtc: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2422
|
+
repayEnabled: z.ZodBoolean;
|
|
2423
|
+
totalAsset: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2424
|
+
}, z.core.$loose>;
|
|
2425
|
+
symbol: z.ZodString;
|
|
2426
|
+
isolatedCreated: z.ZodOptional<z.ZodBoolean>;
|
|
2427
|
+
enabled: z.ZodBoolean;
|
|
2428
|
+
marginLevel: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2429
|
+
marginLevelStatus: z.ZodOptional<z.ZodString>;
|
|
2430
|
+
marginRatio: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2431
|
+
indexPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2432
|
+
liquidatePrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2433
|
+
liquidateRate: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2434
|
+
tradeEnabled: z.ZodBoolean;
|
|
2435
|
+
}, z.core.$loose>;
|
|
2436
|
+
type IsolatedMarginSymbol = z.infer<typeof IsolatedMarginSymbolSchema>;
|
|
2437
|
+
declare const IsolatedMarginAccountSchema: z.ZodObject<{
|
|
2438
|
+
assets: z.ZodArray<z.ZodObject<{
|
|
2439
|
+
baseAsset: z.ZodObject<{
|
|
2440
|
+
asset: z.ZodString;
|
|
2441
|
+
borrowEnabled: z.ZodBoolean;
|
|
2442
|
+
borrowed: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2443
|
+
free: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2444
|
+
interest: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2445
|
+
locked: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2446
|
+
netAsset: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2447
|
+
netAssetOfBtc: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2448
|
+
repayEnabled: z.ZodBoolean;
|
|
2449
|
+
totalAsset: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2450
|
+
}, z.core.$loose>;
|
|
2451
|
+
quoteAsset: z.ZodObject<{
|
|
2452
|
+
asset: z.ZodString;
|
|
2453
|
+
borrowEnabled: z.ZodBoolean;
|
|
2454
|
+
borrowed: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2455
|
+
free: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2456
|
+
interest: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2457
|
+
locked: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2458
|
+
netAsset: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2459
|
+
netAssetOfBtc: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2460
|
+
repayEnabled: z.ZodBoolean;
|
|
2461
|
+
totalAsset: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2462
|
+
}, z.core.$loose>;
|
|
2463
|
+
symbol: z.ZodString;
|
|
2464
|
+
isolatedCreated: z.ZodOptional<z.ZodBoolean>;
|
|
2465
|
+
enabled: z.ZodBoolean;
|
|
2466
|
+
marginLevel: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2467
|
+
marginLevelStatus: z.ZodOptional<z.ZodString>;
|
|
2468
|
+
marginRatio: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2469
|
+
indexPrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2470
|
+
liquidatePrice: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2471
|
+
liquidateRate: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2472
|
+
tradeEnabled: z.ZodBoolean;
|
|
2473
|
+
}, z.core.$loose>>;
|
|
2474
|
+
totalAssetOfBtc: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2475
|
+
totalLiabilityOfBtc: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2476
|
+
totalNetAssetOfBtc: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2477
|
+
}, z.core.$strip>;
|
|
2478
|
+
type IsolatedMarginAccount = z.infer<typeof IsolatedMarginAccountSchema>;
|
|
2479
|
+
declare const MaxBorrowableSchema: z.ZodObject<{
|
|
2480
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2481
|
+
borrowLimit: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2482
|
+
}, z.core.$strip>;
|
|
2483
|
+
type MaxBorrowable = z.infer<typeof MaxBorrowableSchema>;
|
|
2484
|
+
declare const MaxTransferableSchema: z.ZodObject<{
|
|
2485
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2486
|
+
fullAmount: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
2487
|
+
}, z.core.$strip>;
|
|
2488
|
+
type MaxTransferable = z.infer<typeof MaxTransferableSchema>;
|
|
2489
|
+
declare const BorrowRepayParamsSchema: z.ZodObject<{
|
|
2490
|
+
asset: z.ZodString;
|
|
2491
|
+
isIsolated: z.ZodOptional<z.ZodEnum<{
|
|
2492
|
+
TRUE: "TRUE";
|
|
2493
|
+
FALSE: "FALSE";
|
|
2494
|
+
}>>;
|
|
2495
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
2496
|
+
amount: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
2497
|
+
type: z.ZodEnum<{
|
|
2498
|
+
BORROW: "BORROW";
|
|
2499
|
+
REPAY: "REPAY";
|
|
2500
|
+
}>;
|
|
2501
|
+
}, z.core.$strip>;
|
|
2502
|
+
type BorrowRepayParams = z.infer<typeof BorrowRepayParamsSchema>;
|
|
2503
|
+
declare const BorrowRepayResultSchema: z.ZodObject<{
|
|
2504
|
+
tranId: z.ZodNumber;
|
|
2505
|
+
}, z.core.$strip>;
|
|
2506
|
+
type BorrowRepayResult = z.infer<typeof BorrowRepayResultSchema>;
|
|
2507
|
+
declare const BorrowRepayRecordEntrySchema: z.ZodObject<{
|
|
2508
|
+
isolatedSymbol: z.ZodOptional<z.ZodString>;
|
|
2509
|
+
txId: z.ZodNumber;
|
|
2510
|
+
asset: z.ZodString;
|
|
2511
|
+
principal: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2512
|
+
timestamp: z.ZodNumber;
|
|
2513
|
+
status: z.ZodString;
|
|
2514
|
+
}, z.core.$loose>;
|
|
2515
|
+
type BorrowRepayRecordEntry = z.infer<typeof BorrowRepayRecordEntrySchema>;
|
|
2516
|
+
declare const BorrowRepayRecordResponseSchema: z.ZodObject<{
|
|
2517
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
2518
|
+
isolatedSymbol: z.ZodOptional<z.ZodString>;
|
|
2519
|
+
txId: z.ZodNumber;
|
|
2520
|
+
asset: z.ZodString;
|
|
2521
|
+
principal: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2522
|
+
timestamp: z.ZodNumber;
|
|
2523
|
+
status: z.ZodString;
|
|
2524
|
+
}, z.core.$loose>>;
|
|
2525
|
+
total: z.ZodNumber;
|
|
2526
|
+
}, z.core.$strip>;
|
|
2527
|
+
type BorrowRepayRecordResponse = z.infer<typeof BorrowRepayRecordResponseSchema>;
|
|
2528
|
+
declare const MarginTransferResultSchema: z.ZodObject<{
|
|
2529
|
+
tranId: z.ZodNumber;
|
|
2530
|
+
}, z.core.$strip>;
|
|
2531
|
+
type MarginTransferResult = z.infer<typeof MarginTransferResultSchema>;
|
|
2532
|
+
declare const IsolatedTransferParamsSchema: z.ZodObject<{
|
|
2533
|
+
asset: z.ZodString;
|
|
2534
|
+
symbol: z.ZodString;
|
|
2535
|
+
transFrom: z.ZodEnum<{
|
|
2536
|
+
SPOT: "SPOT";
|
|
2537
|
+
ISOLATED_MARGIN: "ISOLATED_MARGIN";
|
|
2538
|
+
}>;
|
|
2539
|
+
transTo: z.ZodEnum<{
|
|
2540
|
+
SPOT: "SPOT";
|
|
2541
|
+
ISOLATED_MARGIN: "ISOLATED_MARGIN";
|
|
2542
|
+
}>;
|
|
2543
|
+
amount: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
2544
|
+
}, z.core.$strip>;
|
|
2545
|
+
type IsolatedTransferParams = z.infer<typeof IsolatedTransferParamsSchema>;
|
|
2546
|
+
declare const MarginInterestHistoryEntrySchema: z.ZodObject<{
|
|
2547
|
+
txId: z.ZodNumber;
|
|
2548
|
+
interestAccuredTime: z.ZodNumber;
|
|
2549
|
+
asset: z.ZodString;
|
|
2550
|
+
rawAsset: z.ZodOptional<z.ZodString>;
|
|
2551
|
+
principal: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2552
|
+
interest: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2553
|
+
interestRate: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2554
|
+
type: z.ZodString;
|
|
2555
|
+
isolatedSymbol: z.ZodOptional<z.ZodString>;
|
|
2556
|
+
}, z.core.$loose>;
|
|
2557
|
+
type MarginInterestHistoryEntry = z.infer<typeof MarginInterestHistoryEntrySchema>;
|
|
2558
|
+
declare const MarginInterestHistoryResponseSchema: z.ZodObject<{
|
|
2559
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
2560
|
+
txId: z.ZodNumber;
|
|
2561
|
+
interestAccuredTime: z.ZodNumber;
|
|
2562
|
+
asset: z.ZodString;
|
|
2563
|
+
rawAsset: z.ZodOptional<z.ZodString>;
|
|
2564
|
+
principal: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2565
|
+
interest: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2566
|
+
interestRate: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2567
|
+
type: z.ZodString;
|
|
2568
|
+
isolatedSymbol: z.ZodOptional<z.ZodString>;
|
|
2569
|
+
}, z.core.$loose>>;
|
|
2570
|
+
total: z.ZodNumber;
|
|
2571
|
+
}, z.core.$strip>;
|
|
2572
|
+
type MarginInterestHistoryResponse = z.infer<typeof MarginInterestHistoryResponseSchema>;
|
|
2573
|
+
declare const MarginForceLiquidationEntrySchema: z.ZodObject<{
|
|
2574
|
+
avgPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2575
|
+
executedQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2576
|
+
orderId: z.ZodNumber;
|
|
2577
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2578
|
+
qty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2579
|
+
side: z.ZodString;
|
|
2580
|
+
symbol: z.ZodString;
|
|
2581
|
+
timeInForce: z.ZodString;
|
|
2582
|
+
isIsolated: z.ZodOptional<z.ZodBoolean>;
|
|
2583
|
+
updatedTime: z.ZodNumber;
|
|
2584
|
+
}, z.core.$loose>;
|
|
2585
|
+
type MarginForceLiquidationEntry = z.infer<typeof MarginForceLiquidationEntrySchema>;
|
|
2586
|
+
declare const MarginForceLiquidationResponseSchema: z.ZodObject<{
|
|
2587
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
2588
|
+
avgPrice: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2589
|
+
executedQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2590
|
+
orderId: z.ZodNumber;
|
|
2591
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2592
|
+
qty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2593
|
+
side: z.ZodString;
|
|
2594
|
+
symbol: z.ZodString;
|
|
2595
|
+
timeInForce: z.ZodString;
|
|
2596
|
+
isIsolated: z.ZodOptional<z.ZodBoolean>;
|
|
2597
|
+
updatedTime: z.ZodNumber;
|
|
2598
|
+
}, z.core.$loose>>;
|
|
2599
|
+
total: z.ZodNumber;
|
|
2600
|
+
}, z.core.$strip>;
|
|
2601
|
+
type MarginForceLiquidationResponse = z.infer<typeof MarginForceLiquidationResponseSchema>;
|
|
2602
|
+
declare const MarginPriceIndexSchema: z.ZodObject<{
|
|
2603
|
+
calcTime: z.ZodNumber;
|
|
2604
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2605
|
+
symbol: z.ZodString;
|
|
2606
|
+
}, z.core.$strip>;
|
|
2607
|
+
type MarginPriceIndex = z.infer<typeof MarginPriceIndexSchema>;
|
|
2608
|
+
declare const MarginOrderSchema: z.ZodObject<{
|
|
2609
|
+
symbol: z.ZodString;
|
|
2610
|
+
orderId: z.ZodNumber;
|
|
2611
|
+
clientOrderId: z.ZodString;
|
|
2612
|
+
isIsolated: z.ZodOptional<z.ZodBoolean>;
|
|
2613
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2614
|
+
origQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2615
|
+
executedQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2616
|
+
cummulativeQuoteQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2617
|
+
status: z.ZodString;
|
|
2618
|
+
timeInForce: z.ZodOptional<z.ZodString>;
|
|
2619
|
+
type: z.ZodString;
|
|
2620
|
+
side: z.ZodString;
|
|
2621
|
+
transactTime: z.ZodOptional<z.ZodNumber>;
|
|
2622
|
+
time: z.ZodOptional<z.ZodNumber>;
|
|
2623
|
+
updateTime: z.ZodOptional<z.ZodNumber>;
|
|
2624
|
+
fills: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
2625
|
+
}, z.core.$loose>;
|
|
2626
|
+
type MarginOrder = z.infer<typeof MarginOrderSchema>;
|
|
2627
|
+
declare const MarginOrderResponseSchema: z.ZodObject<{
|
|
2628
|
+
symbol: z.ZodString;
|
|
2629
|
+
orderId: z.ZodNumber;
|
|
2630
|
+
clientOrderId: z.ZodString;
|
|
2631
|
+
isIsolated: z.ZodOptional<z.ZodBoolean>;
|
|
2632
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2633
|
+
origQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2634
|
+
executedQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2635
|
+
cummulativeQuoteQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2636
|
+
status: z.ZodString;
|
|
2637
|
+
timeInForce: z.ZodOptional<z.ZodString>;
|
|
2638
|
+
type: z.ZodString;
|
|
2639
|
+
side: z.ZodString;
|
|
2640
|
+
transactTime: z.ZodOptional<z.ZodNumber>;
|
|
2641
|
+
time: z.ZodOptional<z.ZodNumber>;
|
|
2642
|
+
updateTime: z.ZodOptional<z.ZodNumber>;
|
|
2643
|
+
fills: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
2644
|
+
}, z.core.$loose>;
|
|
2645
|
+
declare const MarginOrdersResponseSchema: z.ZodArray<z.ZodObject<{
|
|
2646
|
+
symbol: z.ZodString;
|
|
2647
|
+
orderId: z.ZodNumber;
|
|
2648
|
+
clientOrderId: z.ZodString;
|
|
2649
|
+
isIsolated: z.ZodOptional<z.ZodBoolean>;
|
|
2650
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2651
|
+
origQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2652
|
+
executedQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2653
|
+
cummulativeQuoteQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2654
|
+
status: z.ZodString;
|
|
2655
|
+
timeInForce: z.ZodOptional<z.ZodString>;
|
|
2656
|
+
type: z.ZodString;
|
|
2657
|
+
side: z.ZodString;
|
|
2658
|
+
transactTime: z.ZodOptional<z.ZodNumber>;
|
|
2659
|
+
time: z.ZodOptional<z.ZodNumber>;
|
|
2660
|
+
updateTime: z.ZodOptional<z.ZodNumber>;
|
|
2661
|
+
fills: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
2662
|
+
}, z.core.$loose>>;
|
|
2663
|
+
declare const MarginCreateOrderParamsSchema: z.ZodObject<{
|
|
2664
|
+
symbol: z.ZodString;
|
|
2665
|
+
isIsolated: z.ZodOptional<z.ZodEnum<{
|
|
2666
|
+
TRUE: "TRUE";
|
|
2667
|
+
FALSE: "FALSE";
|
|
2668
|
+
}>>;
|
|
2669
|
+
side: z.ZodEnum<{
|
|
2670
|
+
BUY: "BUY";
|
|
2671
|
+
SELL: "SELL";
|
|
2672
|
+
}>;
|
|
2673
|
+
type: z.ZodString;
|
|
2674
|
+
quantity: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
2675
|
+
quoteOrderQty: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
2676
|
+
price: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
2677
|
+
stopPrice: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
2678
|
+
newClientOrderId: z.ZodOptional<z.ZodString>;
|
|
2679
|
+
icebergQty: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
2680
|
+
timeInForce: z.ZodOptional<z.ZodEnum<{
|
|
2681
|
+
GTC: "GTC";
|
|
2682
|
+
IOC: "IOC";
|
|
2683
|
+
FOK: "FOK";
|
|
2684
|
+
}>>;
|
|
2685
|
+
sideEffectType: z.ZodOptional<z.ZodEnum<{
|
|
2686
|
+
NO_SIDE_EFFECT: "NO_SIDE_EFFECT";
|
|
2687
|
+
MARGIN_BUY: "MARGIN_BUY";
|
|
2688
|
+
AUTO_REPAY: "AUTO_REPAY";
|
|
2689
|
+
AUTO_BORROW_REPAY: "AUTO_BORROW_REPAY";
|
|
2690
|
+
}>>;
|
|
2691
|
+
newOrderRespType: z.ZodOptional<z.ZodEnum<{
|
|
2692
|
+
FULL: "FULL";
|
|
2693
|
+
ACK: "ACK";
|
|
2694
|
+
RESULT: "RESULT";
|
|
2695
|
+
}>>;
|
|
2696
|
+
autoRepayAtCancel: z.ZodOptional<z.ZodBoolean>;
|
|
2697
|
+
}, z.core.$strip>;
|
|
2698
|
+
type MarginCreateOrderParams = z.infer<typeof MarginCreateOrderParamsSchema>;
|
|
2699
|
+
declare const MarginTradeSchema: z.ZodObject<{
|
|
2700
|
+
symbol: z.ZodString;
|
|
2701
|
+
id: z.ZodNumber;
|
|
2702
|
+
orderId: z.ZodNumber;
|
|
2703
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2704
|
+
qty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2705
|
+
quoteQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2706
|
+
commission: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2707
|
+
commissionAsset: z.ZodString;
|
|
2708
|
+
time: z.ZodNumber;
|
|
2709
|
+
isBuyer: z.ZodBoolean;
|
|
2710
|
+
isMaker: z.ZodBoolean;
|
|
2711
|
+
isBestMatch: z.ZodOptional<z.ZodBoolean>;
|
|
2712
|
+
isIsolated: z.ZodOptional<z.ZodBoolean>;
|
|
2713
|
+
}, z.core.$loose>;
|
|
2714
|
+
type MarginTrade = z.infer<typeof MarginTradeSchema>;
|
|
2715
|
+
declare const MarginTradesResponseSchema: z.ZodArray<z.ZodObject<{
|
|
2716
|
+
symbol: z.ZodString;
|
|
2717
|
+
id: z.ZodNumber;
|
|
2718
|
+
orderId: z.ZodNumber;
|
|
2719
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2720
|
+
qty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2721
|
+
quoteQty: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2722
|
+
commission: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2723
|
+
commissionAsset: z.ZodString;
|
|
2724
|
+
time: z.ZodNumber;
|
|
2725
|
+
isBuyer: z.ZodBoolean;
|
|
2726
|
+
isMaker: z.ZodBoolean;
|
|
2727
|
+
isBestMatch: z.ZodOptional<z.ZodBoolean>;
|
|
2728
|
+
isIsolated: z.ZodOptional<z.ZodBoolean>;
|
|
2729
|
+
}, z.core.$loose>>;
|
|
2730
|
+
|
|
2731
|
+
declare class MarginAccount {
|
|
2732
|
+
private readonly http;
|
|
2733
|
+
constructor(http: HttpClient);
|
|
2734
|
+
crossAccount(): Promise<CrossMarginAccount>;
|
|
2735
|
+
isolatedAccount(symbols?: string[]): Promise<IsolatedMarginAccount>;
|
|
2736
|
+
maxBorrowable(asset: string, isolatedSymbol?: string): Promise<MaxBorrowable>;
|
|
2737
|
+
maxTransferable(asset: string, isolatedSymbol?: string): Promise<MaxTransferable>;
|
|
2738
|
+
borrowRepay(params: BorrowRepayParams): Promise<BorrowRepayResult>;
|
|
2739
|
+
borrow(asset: string, amount: number, options?: {
|
|
2740
|
+
isIsolated?: boolean;
|
|
2741
|
+
symbol?: string;
|
|
2742
|
+
}): Promise<BorrowRepayResult>;
|
|
2743
|
+
repay(asset: string, amount: number, options?: {
|
|
2744
|
+
isIsolated?: boolean;
|
|
2745
|
+
symbol?: string;
|
|
2746
|
+
}): Promise<BorrowRepayResult>;
|
|
2747
|
+
borrowRepayRecord(type: 'BORROW' | 'REPAY', options?: {
|
|
2748
|
+
asset?: string;
|
|
2749
|
+
isolatedSymbol?: string;
|
|
2750
|
+
startTime?: number;
|
|
2751
|
+
endTime?: number;
|
|
2752
|
+
current?: number;
|
|
2753
|
+
size?: number;
|
|
2754
|
+
}): Promise<BorrowRepayRecordResponse>;
|
|
2755
|
+
transfer(asset: string, amount: number, type: 1 | 2): Promise<MarginTransferResult>;
|
|
2756
|
+
isolatedTransfer(params: IsolatedTransferParams): Promise<MarginTransferResult>;
|
|
2757
|
+
interestHistory(options?: {
|
|
2758
|
+
asset?: string;
|
|
2759
|
+
isolatedSymbol?: string;
|
|
2760
|
+
startTime?: number;
|
|
2761
|
+
endTime?: number;
|
|
2762
|
+
current?: number;
|
|
2763
|
+
size?: number;
|
|
2764
|
+
}): Promise<MarginInterestHistoryResponse>;
|
|
2765
|
+
forceLiquidationRecord(options?: {
|
|
2766
|
+
startTime?: number;
|
|
2767
|
+
endTime?: number;
|
|
2768
|
+
isolatedSymbol?: string;
|
|
2769
|
+
current?: number;
|
|
2770
|
+
size?: number;
|
|
2771
|
+
}): Promise<MarginForceLiquidationResponse>;
|
|
2772
|
+
priceIndex(symbol: string): Promise<MarginPriceIndex>;
|
|
2773
|
+
}
|
|
2774
|
+
declare class MarginTrading {
|
|
2775
|
+
private readonly http;
|
|
2776
|
+
constructor(http: HttpClient);
|
|
2777
|
+
createOrder(params: MarginCreateOrderParams): Promise<MarginOrder>;
|
|
2778
|
+
cancelOrder(symbol: string, options?: {
|
|
2779
|
+
isIsolated?: 'TRUE' | 'FALSE';
|
|
2780
|
+
orderId?: number;
|
|
2781
|
+
origClientOrderId?: string;
|
|
2782
|
+
newClientOrderId?: string;
|
|
2783
|
+
}): Promise<MarginOrder>;
|
|
2784
|
+
cancelAllOpenOrders(symbol: string, isIsolated?: 'TRUE' | 'FALSE'): Promise<MarginOrder[]>;
|
|
2785
|
+
getOrder(symbol: string, options?: {
|
|
2786
|
+
isIsolated?: 'TRUE' | 'FALSE';
|
|
2787
|
+
orderId?: number;
|
|
2788
|
+
origClientOrderId?: string;
|
|
2789
|
+
}): Promise<MarginOrder>;
|
|
2790
|
+
getOpenOrders(options?: {
|
|
2791
|
+
symbol?: string;
|
|
2792
|
+
isIsolated?: 'TRUE' | 'FALSE';
|
|
2793
|
+
}): Promise<MarginOrder[]>;
|
|
2794
|
+
getAllOrders(symbol: string, options?: {
|
|
2795
|
+
isIsolated?: 'TRUE' | 'FALSE';
|
|
2796
|
+
orderId?: number;
|
|
2797
|
+
startTime?: number;
|
|
2798
|
+
endTime?: number;
|
|
2799
|
+
limit?: number;
|
|
2800
|
+
}): Promise<MarginOrder[]>;
|
|
2801
|
+
myTrades(symbol: string, options?: {
|
|
2802
|
+
isIsolated?: 'TRUE' | 'FALSE';
|
|
2803
|
+
orderId?: number;
|
|
2804
|
+
startTime?: number;
|
|
2805
|
+
endTime?: number;
|
|
2806
|
+
fromId?: number;
|
|
2807
|
+
limit?: number;
|
|
2808
|
+
}): Promise<MarginTrade[]>;
|
|
2809
|
+
}
|
|
2810
|
+
|
|
2811
|
+
declare const TransferTypeSchema: z.ZodEnum<{
|
|
2812
|
+
MAIN_UMFUTURE: "MAIN_UMFUTURE";
|
|
2813
|
+
MAIN_CMFUTURE: "MAIN_CMFUTURE";
|
|
2814
|
+
MAIN_MARGIN: "MAIN_MARGIN";
|
|
2815
|
+
MAIN_MINING: "MAIN_MINING";
|
|
2816
|
+
MAIN_FUNDING: "MAIN_FUNDING";
|
|
2817
|
+
MAIN_OPTION: "MAIN_OPTION";
|
|
2818
|
+
UMFUTURE_MAIN: "UMFUTURE_MAIN";
|
|
2819
|
+
UMFUTURE_MARGIN: "UMFUTURE_MARGIN";
|
|
2820
|
+
UMFUTURE_FUNDING: "UMFUTURE_FUNDING";
|
|
2821
|
+
CMFUTURE_MAIN: "CMFUTURE_MAIN";
|
|
2822
|
+
CMFUTURE_MARGIN: "CMFUTURE_MARGIN";
|
|
2823
|
+
MARGIN_MAIN: "MARGIN_MAIN";
|
|
2824
|
+
MARGIN_UMFUTURE: "MARGIN_UMFUTURE";
|
|
2825
|
+
MARGIN_CMFUTURE: "MARGIN_CMFUTURE";
|
|
2826
|
+
MARGIN_MINING: "MARGIN_MINING";
|
|
2827
|
+
MARGIN_FUNDING: "MARGIN_FUNDING";
|
|
2828
|
+
MINING_MAIN: "MINING_MAIN";
|
|
2829
|
+
MINING_UMFUTURE: "MINING_UMFUTURE";
|
|
2830
|
+
MINING_MARGIN: "MINING_MARGIN";
|
|
2831
|
+
FUNDING_MAIN: "FUNDING_MAIN";
|
|
2832
|
+
FUNDING_UMFUTURE: "FUNDING_UMFUTURE";
|
|
2833
|
+
FUNDING_MARGIN: "FUNDING_MARGIN";
|
|
2834
|
+
FUNDING_CMFUTURE: "FUNDING_CMFUTURE";
|
|
2835
|
+
OPTION_MAIN: "OPTION_MAIN";
|
|
2836
|
+
MAIN_OPTION_MARGIN: "MAIN_OPTION_MARGIN";
|
|
2837
|
+
MAIN_PORTFOLIO_MARGIN: "MAIN_PORTFOLIO_MARGIN";
|
|
2838
|
+
PORTFOLIO_MARGIN_MAIN: "PORTFOLIO_MARGIN_MAIN";
|
|
2839
|
+
ISOLATEDMARGIN_MARGIN: "ISOLATEDMARGIN_MARGIN";
|
|
2840
|
+
MARGIN_ISOLATEDMARGIN: "MARGIN_ISOLATEDMARGIN";
|
|
2841
|
+
ISOLATEDMARGIN_ISOLATEDMARGIN: "ISOLATEDMARGIN_ISOLATEDMARGIN";
|
|
2842
|
+
}>;
|
|
2843
|
+
type TransferType = z.infer<typeof TransferTypeSchema>;
|
|
2844
|
+
declare const UniversalTransferParamsSchema: z.ZodObject<{
|
|
2845
|
+
type: z.ZodEnum<{
|
|
2846
|
+
MAIN_UMFUTURE: "MAIN_UMFUTURE";
|
|
2847
|
+
MAIN_CMFUTURE: "MAIN_CMFUTURE";
|
|
2848
|
+
MAIN_MARGIN: "MAIN_MARGIN";
|
|
2849
|
+
MAIN_MINING: "MAIN_MINING";
|
|
2850
|
+
MAIN_FUNDING: "MAIN_FUNDING";
|
|
2851
|
+
MAIN_OPTION: "MAIN_OPTION";
|
|
2852
|
+
UMFUTURE_MAIN: "UMFUTURE_MAIN";
|
|
2853
|
+
UMFUTURE_MARGIN: "UMFUTURE_MARGIN";
|
|
2854
|
+
UMFUTURE_FUNDING: "UMFUTURE_FUNDING";
|
|
2855
|
+
CMFUTURE_MAIN: "CMFUTURE_MAIN";
|
|
2856
|
+
CMFUTURE_MARGIN: "CMFUTURE_MARGIN";
|
|
2857
|
+
MARGIN_MAIN: "MARGIN_MAIN";
|
|
2858
|
+
MARGIN_UMFUTURE: "MARGIN_UMFUTURE";
|
|
2859
|
+
MARGIN_CMFUTURE: "MARGIN_CMFUTURE";
|
|
2860
|
+
MARGIN_MINING: "MARGIN_MINING";
|
|
2861
|
+
MARGIN_FUNDING: "MARGIN_FUNDING";
|
|
2862
|
+
MINING_MAIN: "MINING_MAIN";
|
|
2863
|
+
MINING_UMFUTURE: "MINING_UMFUTURE";
|
|
2864
|
+
MINING_MARGIN: "MINING_MARGIN";
|
|
2865
|
+
FUNDING_MAIN: "FUNDING_MAIN";
|
|
2866
|
+
FUNDING_UMFUTURE: "FUNDING_UMFUTURE";
|
|
2867
|
+
FUNDING_MARGIN: "FUNDING_MARGIN";
|
|
2868
|
+
FUNDING_CMFUTURE: "FUNDING_CMFUTURE";
|
|
2869
|
+
OPTION_MAIN: "OPTION_MAIN";
|
|
2870
|
+
MAIN_OPTION_MARGIN: "MAIN_OPTION_MARGIN";
|
|
2871
|
+
MAIN_PORTFOLIO_MARGIN: "MAIN_PORTFOLIO_MARGIN";
|
|
2872
|
+
PORTFOLIO_MARGIN_MAIN: "PORTFOLIO_MARGIN_MAIN";
|
|
2873
|
+
ISOLATEDMARGIN_MARGIN: "ISOLATEDMARGIN_MARGIN";
|
|
2874
|
+
MARGIN_ISOLATEDMARGIN: "MARGIN_ISOLATEDMARGIN";
|
|
2875
|
+
ISOLATEDMARGIN_ISOLATEDMARGIN: "ISOLATEDMARGIN_ISOLATEDMARGIN";
|
|
2876
|
+
}>;
|
|
2877
|
+
asset: z.ZodString;
|
|
2878
|
+
amount: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
2879
|
+
fromSymbol: z.ZodOptional<z.ZodString>;
|
|
2880
|
+
toSymbol: z.ZodOptional<z.ZodString>;
|
|
2881
|
+
}, z.core.$strip>;
|
|
2882
|
+
type UniversalTransferParams = z.infer<typeof UniversalTransferParamsSchema>;
|
|
2883
|
+
declare const UniversalTransferResultSchema: z.ZodObject<{
|
|
2884
|
+
tranId: z.ZodNumber;
|
|
2885
|
+
}, z.core.$strip>;
|
|
2886
|
+
type UniversalTransferResult = z.infer<typeof UniversalTransferResultSchema>;
|
|
2887
|
+
declare const UniversalTransferHistoryEntrySchema: z.ZodObject<{
|
|
2888
|
+
asset: z.ZodString;
|
|
2889
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2890
|
+
type: z.ZodString;
|
|
2891
|
+
status: z.ZodString;
|
|
2892
|
+
tranId: z.ZodNumber;
|
|
2893
|
+
timestamp: z.ZodNumber;
|
|
2894
|
+
fromSymbol: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2895
|
+
toSymbol: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2896
|
+
}, z.core.$loose>;
|
|
2897
|
+
type UniversalTransferHistoryEntry = z.infer<typeof UniversalTransferHistoryEntrySchema>;
|
|
2898
|
+
declare const UniversalTransferHistoryResponseSchema: z.ZodObject<{
|
|
2899
|
+
total: z.ZodNumber;
|
|
2900
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
2901
|
+
asset: z.ZodString;
|
|
2902
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2903
|
+
type: z.ZodString;
|
|
2904
|
+
status: z.ZodString;
|
|
2905
|
+
tranId: z.ZodNumber;
|
|
2906
|
+
timestamp: z.ZodNumber;
|
|
2907
|
+
fromSymbol: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2908
|
+
toSymbol: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2909
|
+
}, z.core.$loose>>;
|
|
2910
|
+
}, z.core.$strip>;
|
|
2911
|
+
type UniversalTransferHistoryResponse = z.infer<typeof UniversalTransferHistoryResponseSchema>;
|
|
2912
|
+
declare const FundingAssetSchema: z.ZodObject<{
|
|
2913
|
+
asset: z.ZodString;
|
|
2914
|
+
free: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2915
|
+
locked: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2916
|
+
freeze: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2917
|
+
withdrawing: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2918
|
+
btcValuation: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2919
|
+
}, z.core.$strip>;
|
|
2920
|
+
type FundingAsset = z.infer<typeof FundingAssetSchema>;
|
|
2921
|
+
declare const FundingAssetsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
2922
|
+
asset: z.ZodString;
|
|
2923
|
+
free: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2924
|
+
locked: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2925
|
+
freeze: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2926
|
+
withdrawing: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2927
|
+
btcValuation: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2928
|
+
}, z.core.$strip>>;
|
|
2929
|
+
declare const UserAssetSchema: z.ZodObject<{
|
|
2930
|
+
asset: z.ZodString;
|
|
2931
|
+
free: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2932
|
+
locked: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2933
|
+
freeze: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2934
|
+
withdrawing: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2935
|
+
ipoable: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2936
|
+
btcValuation: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2937
|
+
}, z.core.$strip>;
|
|
2938
|
+
type UserAsset = z.infer<typeof UserAssetSchema>;
|
|
2939
|
+
declare const UserAssetsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
2940
|
+
asset: z.ZodString;
|
|
2941
|
+
free: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2942
|
+
locked: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2943
|
+
freeze: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2944
|
+
withdrawing: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2945
|
+
ipoable: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2946
|
+
btcValuation: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2947
|
+
}, z.core.$strip>>;
|
|
2948
|
+
declare const DepositHistoryEntrySchema: z.ZodObject<{
|
|
2949
|
+
id: z.ZodString;
|
|
2950
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2951
|
+
coin: z.ZodString;
|
|
2952
|
+
network: z.ZodString;
|
|
2953
|
+
status: z.ZodNumber;
|
|
2954
|
+
address: z.ZodString;
|
|
2955
|
+
addressTag: z.ZodOptional<z.ZodString>;
|
|
2956
|
+
txId: z.ZodString;
|
|
2957
|
+
insertTime: z.ZodNumber;
|
|
2958
|
+
transferType: z.ZodNumber;
|
|
2959
|
+
confirmTimes: z.ZodOptional<z.ZodString>;
|
|
2960
|
+
unlockConfirm: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
2961
|
+
walletType: z.ZodOptional<z.ZodNumber>;
|
|
2962
|
+
}, z.core.$loose>;
|
|
2963
|
+
type DepositHistoryEntry = z.infer<typeof DepositHistoryEntrySchema>;
|
|
2964
|
+
declare const DepositHistoryResponseSchema: z.ZodArray<z.ZodObject<{
|
|
2965
|
+
id: z.ZodString;
|
|
2966
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2967
|
+
coin: z.ZodString;
|
|
2968
|
+
network: z.ZodString;
|
|
2969
|
+
status: z.ZodNumber;
|
|
2970
|
+
address: z.ZodString;
|
|
2971
|
+
addressTag: z.ZodOptional<z.ZodString>;
|
|
2972
|
+
txId: z.ZodString;
|
|
2973
|
+
insertTime: z.ZodNumber;
|
|
2974
|
+
transferType: z.ZodNumber;
|
|
2975
|
+
confirmTimes: z.ZodOptional<z.ZodString>;
|
|
2976
|
+
unlockConfirm: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
2977
|
+
walletType: z.ZodOptional<z.ZodNumber>;
|
|
2978
|
+
}, z.core.$loose>>;
|
|
2979
|
+
declare const WithdrawHistoryEntrySchema: z.ZodObject<{
|
|
2980
|
+
id: z.ZodString;
|
|
2981
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2982
|
+
transactionFee: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2983
|
+
coin: z.ZodString;
|
|
2984
|
+
status: z.ZodNumber;
|
|
2985
|
+
address: z.ZodString;
|
|
2986
|
+
txId: z.ZodOptional<z.ZodString>;
|
|
2987
|
+
applyTime: z.ZodString;
|
|
2988
|
+
network: z.ZodString;
|
|
2989
|
+
transferType: z.ZodNumber;
|
|
2990
|
+
withdrawOrderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2991
|
+
info: z.ZodOptional<z.ZodString>;
|
|
2992
|
+
confirmNo: z.ZodOptional<z.ZodNumber>;
|
|
2993
|
+
walletType: z.ZodOptional<z.ZodNumber>;
|
|
2994
|
+
}, z.core.$loose>;
|
|
2995
|
+
type WithdrawHistoryEntry = z.infer<typeof WithdrawHistoryEntrySchema>;
|
|
2996
|
+
declare const WithdrawHistoryResponseSchema: z.ZodArray<z.ZodObject<{
|
|
2997
|
+
id: z.ZodString;
|
|
2998
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
2999
|
+
transactionFee: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3000
|
+
coin: z.ZodString;
|
|
3001
|
+
status: z.ZodNumber;
|
|
3002
|
+
address: z.ZodString;
|
|
3003
|
+
txId: z.ZodOptional<z.ZodString>;
|
|
3004
|
+
applyTime: z.ZodString;
|
|
3005
|
+
network: z.ZodString;
|
|
3006
|
+
transferType: z.ZodNumber;
|
|
3007
|
+
withdrawOrderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3008
|
+
info: z.ZodOptional<z.ZodString>;
|
|
3009
|
+
confirmNo: z.ZodOptional<z.ZodNumber>;
|
|
3010
|
+
walletType: z.ZodOptional<z.ZodNumber>;
|
|
3011
|
+
}, z.core.$loose>>;
|
|
3012
|
+
declare const WithdrawParamsSchema: z.ZodObject<{
|
|
3013
|
+
coin: z.ZodString;
|
|
3014
|
+
address: z.ZodString;
|
|
3015
|
+
amount: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
3016
|
+
withdrawOrderId: z.ZodOptional<z.ZodString>;
|
|
3017
|
+
network: z.ZodOptional<z.ZodString>;
|
|
3018
|
+
addressTag: z.ZodOptional<z.ZodString>;
|
|
3019
|
+
transactionFeeFlag: z.ZodOptional<z.ZodBoolean>;
|
|
3020
|
+
name: z.ZodOptional<z.ZodString>;
|
|
3021
|
+
walletType: z.ZodOptional<z.ZodNumber>;
|
|
3022
|
+
}, z.core.$strip>;
|
|
3023
|
+
type WithdrawParams = z.infer<typeof WithdrawParamsSchema>;
|
|
3024
|
+
declare const WithdrawResultSchema: z.ZodObject<{
|
|
3025
|
+
id: z.ZodString;
|
|
3026
|
+
}, z.core.$strip>;
|
|
3027
|
+
type WithdrawResult = z.infer<typeof WithdrawResultSchema>;
|
|
3028
|
+
declare const DepositAddressSchema: z.ZodObject<{
|
|
3029
|
+
address: z.ZodString;
|
|
3030
|
+
coin: z.ZodString;
|
|
3031
|
+
tag: z.ZodString;
|
|
3032
|
+
url: z.ZodOptional<z.ZodString>;
|
|
3033
|
+
}, z.core.$strip>;
|
|
3034
|
+
type DepositAddress = z.infer<typeof DepositAddressSchema>;
|
|
3035
|
+
declare const ApiKeyPermissionsSchema: z.ZodObject<{
|
|
3036
|
+
ipRestrict: z.ZodBoolean;
|
|
3037
|
+
createTime: z.ZodNumber;
|
|
3038
|
+
enableWithdrawals: z.ZodBoolean;
|
|
3039
|
+
enableInternalTransfer: z.ZodBoolean;
|
|
3040
|
+
enableFutures: z.ZodBoolean;
|
|
3041
|
+
enableMargin: z.ZodBoolean;
|
|
3042
|
+
enableSpotAndMarginTrading: z.ZodBoolean;
|
|
3043
|
+
permitsUniversalTransfer: z.ZodOptional<z.ZodBoolean>;
|
|
3044
|
+
enableReading: z.ZodOptional<z.ZodBoolean>;
|
|
3045
|
+
tradingAuthorityExpirationTime: z.ZodOptional<z.ZodNumber>;
|
|
3046
|
+
}, z.core.$loose>;
|
|
3047
|
+
type ApiKeyPermissions = z.infer<typeof ApiKeyPermissionsSchema>;
|
|
3048
|
+
declare const AssetDetailSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3049
|
+
minWithdrawAmount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3050
|
+
depositStatus: z.ZodBoolean;
|
|
3051
|
+
withdrawFee: z.ZodNumber;
|
|
3052
|
+
withdrawStatus: z.ZodBoolean;
|
|
3053
|
+
depositTip: z.ZodOptional<z.ZodString>;
|
|
3054
|
+
}, z.core.$loose>>;
|
|
3055
|
+
type AssetDetail = z.infer<typeof AssetDetailSchema>;
|
|
3056
|
+
declare const DustLogEntrySchema: z.ZodObject<{
|
|
3057
|
+
transId: z.ZodNumber;
|
|
3058
|
+
serviceChargeAmount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3059
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3060
|
+
operateTime: z.ZodString;
|
|
3061
|
+
transferedAmount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3062
|
+
fromAsset: z.ZodString;
|
|
3063
|
+
}, z.core.$loose>;
|
|
3064
|
+
type DustLogEntry = z.infer<typeof DustLogEntrySchema>;
|
|
3065
|
+
declare const DustLogResponseSchema: z.ZodObject<{
|
|
3066
|
+
total: z.ZodNumber;
|
|
3067
|
+
userAssetDribblets: z.ZodArray<z.ZodObject<{
|
|
3068
|
+
operateTime: z.ZodNumber;
|
|
3069
|
+
totalTransferedAmount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3070
|
+
totalServiceChargeAmount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3071
|
+
transId: z.ZodNumber;
|
|
3072
|
+
userAssetDribbletDetails: z.ZodArray<z.ZodObject<{
|
|
3073
|
+
transId: z.ZodNumber;
|
|
3074
|
+
serviceChargeAmount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3075
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3076
|
+
operateTime: z.ZodString;
|
|
3077
|
+
transferedAmount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3078
|
+
fromAsset: z.ZodString;
|
|
3079
|
+
}, z.core.$loose>>;
|
|
3080
|
+
}, z.core.$strip>>;
|
|
3081
|
+
}, z.core.$strip>;
|
|
3082
|
+
type DustLogResponse = z.infer<typeof DustLogResponseSchema>;
|
|
3083
|
+
declare const DustConversionResultSchema: z.ZodObject<{
|
|
3084
|
+
totalServiceCharge: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3085
|
+
totalTransfered: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3086
|
+
transferResult: z.ZodArray<z.ZodObject<{
|
|
3087
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3088
|
+
fromAsset: z.ZodString;
|
|
3089
|
+
operateTime: z.ZodNumber;
|
|
3090
|
+
serviceChargeAmount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3091
|
+
tranId: z.ZodNumber;
|
|
3092
|
+
transferedAmount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3093
|
+
}, z.core.$loose>>;
|
|
3094
|
+
}, z.core.$loose>;
|
|
3095
|
+
type DustConversionResult = z.infer<typeof DustConversionResultSchema>;
|
|
3096
|
+
declare const TradeFeeEntrySchema: z.ZodObject<{
|
|
3097
|
+
symbol: z.ZodString;
|
|
3098
|
+
makerCommission: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3099
|
+
takerCommission: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3100
|
+
}, z.core.$strip>;
|
|
3101
|
+
type TradeFeeEntry = z.infer<typeof TradeFeeEntrySchema>;
|
|
3102
|
+
declare const TradeFeeResponseSchema: z.ZodArray<z.ZodObject<{
|
|
3103
|
+
symbol: z.ZodString;
|
|
3104
|
+
makerCommission: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3105
|
+
takerCommission: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3106
|
+
}, z.core.$strip>>;
|
|
3107
|
+
declare const AccountSnapshotSchema: z.ZodObject<{
|
|
3108
|
+
code: z.ZodNumber;
|
|
3109
|
+
msg: z.ZodString;
|
|
3110
|
+
snapshotVos: z.ZodArray<z.ZodObject<{
|
|
3111
|
+
type: z.ZodString;
|
|
3112
|
+
updateTime: z.ZodNumber;
|
|
3113
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
3114
|
+
}, z.core.$loose>>;
|
|
3115
|
+
}, z.core.$loose>;
|
|
3116
|
+
type AccountSnapshot = z.infer<typeof AccountSnapshotSchema>;
|
|
3117
|
+
|
|
3118
|
+
declare class Wallet {
|
|
3119
|
+
private readonly http;
|
|
3120
|
+
constructor(http: HttpClient);
|
|
3121
|
+
universalTransfer(params: UniversalTransferParams): Promise<UniversalTransferResult>;
|
|
3122
|
+
universalTransferHistory(options: {
|
|
3123
|
+
type: string;
|
|
3124
|
+
startTime?: number;
|
|
3125
|
+
endTime?: number;
|
|
3126
|
+
current?: number;
|
|
3127
|
+
size?: number;
|
|
3128
|
+
fromSymbol?: string;
|
|
3129
|
+
toSymbol?: string;
|
|
3130
|
+
}): Promise<UniversalTransferHistoryResponse>;
|
|
3131
|
+
fundingWallet(options?: {
|
|
3132
|
+
asset?: string;
|
|
3133
|
+
needBtcValuation?: boolean;
|
|
3134
|
+
}): Promise<FundingAsset[]>;
|
|
3135
|
+
userAsset(options?: {
|
|
3136
|
+
asset?: string;
|
|
3137
|
+
needBtcValuation?: boolean;
|
|
3138
|
+
}): Promise<UserAsset[]>;
|
|
3139
|
+
depositHistory(options?: {
|
|
3140
|
+
coin?: string;
|
|
3141
|
+
status?: number;
|
|
3142
|
+
startTime?: number;
|
|
3143
|
+
endTime?: number;
|
|
3144
|
+
offset?: number;
|
|
3145
|
+
limit?: number;
|
|
3146
|
+
}): Promise<DepositHistoryEntry[]>;
|
|
3147
|
+
withdrawHistory(options?: {
|
|
3148
|
+
coin?: string;
|
|
3149
|
+
withdrawOrderId?: string;
|
|
3150
|
+
status?: number;
|
|
3151
|
+
startTime?: number;
|
|
3152
|
+
endTime?: number;
|
|
3153
|
+
offset?: number;
|
|
3154
|
+
limit?: number;
|
|
3155
|
+
}): Promise<WithdrawHistoryEntry[]>;
|
|
3156
|
+
withdraw(params: WithdrawParams): Promise<WithdrawResult>;
|
|
3157
|
+
depositAddress(coin: string, network?: string): Promise<DepositAddress>;
|
|
3158
|
+
accountSnapshot(type: 'SPOT' | 'MARGIN' | 'FUTURES', options?: {
|
|
3159
|
+
startTime?: number;
|
|
3160
|
+
endTime?: number;
|
|
3161
|
+
limit?: number;
|
|
3162
|
+
}): Promise<AccountSnapshot>;
|
|
3163
|
+
apiKeyPermissions(): Promise<ApiKeyPermissions>;
|
|
3164
|
+
assetDetail(asset?: string): Promise<AssetDetail>;
|
|
3165
|
+
dustLog(options?: {
|
|
3166
|
+
accountType?: 'SPOT' | 'MARGIN';
|
|
3167
|
+
startTime?: number;
|
|
3168
|
+
endTime?: number;
|
|
3169
|
+
}): Promise<DustLogResponse>;
|
|
3170
|
+
convertDustToBnb(assets: string[], accountType?: 'SPOT' | 'MARGIN'): Promise<DustConversionResult>;
|
|
3171
|
+
tradeFee(symbol?: string): Promise<TradeFeeEntry[]>;
|
|
3172
|
+
}
|
|
3173
|
+
|
|
3174
|
+
declare const SubAccountEntrySchema: z.ZodObject<{
|
|
3175
|
+
email: z.ZodString;
|
|
3176
|
+
isFreeze: z.ZodBoolean;
|
|
3177
|
+
createTime: z.ZodNumber;
|
|
3178
|
+
isManagedSubAccount: z.ZodOptional<z.ZodBoolean>;
|
|
3179
|
+
isAssetManagementSubAccount: z.ZodOptional<z.ZodBoolean>;
|
|
3180
|
+
type: z.ZodOptional<z.ZodString>;
|
|
3181
|
+
}, z.core.$loose>;
|
|
3182
|
+
type SubAccountEntry = z.infer<typeof SubAccountEntrySchema>;
|
|
3183
|
+
declare const SubAccountListResponseSchema: z.ZodObject<{
|
|
3184
|
+
subAccounts: z.ZodArray<z.ZodObject<{
|
|
3185
|
+
email: z.ZodString;
|
|
3186
|
+
isFreeze: z.ZodBoolean;
|
|
3187
|
+
createTime: z.ZodNumber;
|
|
3188
|
+
isManagedSubAccount: z.ZodOptional<z.ZodBoolean>;
|
|
3189
|
+
isAssetManagementSubAccount: z.ZodOptional<z.ZodBoolean>;
|
|
3190
|
+
type: z.ZodOptional<z.ZodString>;
|
|
3191
|
+
}, z.core.$loose>>;
|
|
3192
|
+
}, z.core.$strip>;
|
|
3193
|
+
type SubAccountListResponse = z.infer<typeof SubAccountListResponseSchema>;
|
|
3194
|
+
declare const SubAccountStatusSchema: z.ZodObject<{
|
|
3195
|
+
email: z.ZodString;
|
|
3196
|
+
isSubUserEnabled: z.ZodBoolean;
|
|
3197
|
+
isUserActive: z.ZodBoolean;
|
|
3198
|
+
insertTime: z.ZodNumber;
|
|
3199
|
+
isMarginEnabled: z.ZodBoolean;
|
|
3200
|
+
isFutureEnabled: z.ZodBoolean;
|
|
3201
|
+
mobile: z.ZodOptional<z.ZodNumber>;
|
|
3202
|
+
}, z.core.$loose>;
|
|
3203
|
+
type SubAccountStatus = z.infer<typeof SubAccountStatusSchema>;
|
|
3204
|
+
declare const SubAccountStatusResponseSchema: z.ZodArray<z.ZodObject<{
|
|
3205
|
+
email: z.ZodString;
|
|
3206
|
+
isSubUserEnabled: z.ZodBoolean;
|
|
3207
|
+
isUserActive: z.ZodBoolean;
|
|
3208
|
+
insertTime: z.ZodNumber;
|
|
3209
|
+
isMarginEnabled: z.ZodBoolean;
|
|
3210
|
+
isFutureEnabled: z.ZodBoolean;
|
|
3211
|
+
mobile: z.ZodOptional<z.ZodNumber>;
|
|
3212
|
+
}, z.core.$loose>>;
|
|
3213
|
+
declare const SubAccountSpotAssetSchema: z.ZodObject<{
|
|
3214
|
+
asset: z.ZodString;
|
|
3215
|
+
free: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3216
|
+
locked: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3217
|
+
}, z.core.$strip>;
|
|
3218
|
+
type SubAccountSpotAsset = z.infer<typeof SubAccountSpotAssetSchema>;
|
|
3219
|
+
declare const SubAccountSpotAssetsResponseSchema: z.ZodObject<{
|
|
3220
|
+
balances: z.ZodArray<z.ZodObject<{
|
|
3221
|
+
asset: z.ZodString;
|
|
3222
|
+
free: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3223
|
+
locked: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3224
|
+
}, z.core.$strip>>;
|
|
3225
|
+
}, z.core.$strip>;
|
|
3226
|
+
type SubAccountSpotAssetsResponse = z.infer<typeof SubAccountSpotAssetsResponseSchema>;
|
|
3227
|
+
declare const SubAccountSpotSummaryEntrySchema: z.ZodObject<{
|
|
3228
|
+
email: z.ZodString;
|
|
3229
|
+
totalAsset: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3230
|
+
}, z.core.$loose>;
|
|
3231
|
+
type SubAccountSpotSummaryEntry = z.infer<typeof SubAccountSpotSummaryEntrySchema>;
|
|
3232
|
+
declare const SubAccountSpotSummarySchema: z.ZodObject<{
|
|
3233
|
+
totalCount: z.ZodNumber;
|
|
3234
|
+
masterAccountTotalAsset: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3235
|
+
spotSubUserAssetBtcVoList: z.ZodArray<z.ZodObject<{
|
|
3236
|
+
email: z.ZodString;
|
|
3237
|
+
totalAsset: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3238
|
+
}, z.core.$loose>>;
|
|
3239
|
+
}, z.core.$strip>;
|
|
3240
|
+
type SubAccountSpotSummary = z.infer<typeof SubAccountSpotSummarySchema>;
|
|
3241
|
+
declare const SubAccountFuturesSummarySchema: z.ZodObject<{
|
|
3242
|
+
totalCount: z.ZodOptional<z.ZodNumber>;
|
|
3243
|
+
totalMarginBalanceOfBTC: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
3244
|
+
totalUnrealizedProfitOfBTC: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
3245
|
+
totalWalletBalanceOfBTC: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
3246
|
+
subAccountList: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
3247
|
+
}, z.core.$loose>;
|
|
3248
|
+
type SubAccountFuturesSummary = z.infer<typeof SubAccountFuturesSummarySchema>;
|
|
3249
|
+
declare const SubAccountMarginAccountSchema: z.ZodObject<{
|
|
3250
|
+
email: z.ZodString;
|
|
3251
|
+
marginLevel: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3252
|
+
totalAssetOfBtc: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3253
|
+
totalLiabilityOfBtc: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3254
|
+
totalNetAssetOfBtc: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3255
|
+
marginTradeCoeffVo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3256
|
+
marginUserAssetVoList: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
3257
|
+
}, z.core.$loose>;
|
|
3258
|
+
type SubAccountMarginAccount = z.infer<typeof SubAccountMarginAccountSchema>;
|
|
3259
|
+
declare const SubAccountUniversalTransferParamsSchema: z.ZodObject<{
|
|
3260
|
+
fromEmail: z.ZodOptional<z.ZodString>;
|
|
3261
|
+
toEmail: z.ZodOptional<z.ZodString>;
|
|
3262
|
+
fromAccountType: z.ZodEnum<{
|
|
3263
|
+
SPOT: "SPOT";
|
|
3264
|
+
ISOLATED_MARGIN: "ISOLATED_MARGIN";
|
|
3265
|
+
MARGIN: "MARGIN";
|
|
3266
|
+
USDT_FUTURE: "USDT_FUTURE";
|
|
3267
|
+
COIN_FUTURE: "COIN_FUTURE";
|
|
3268
|
+
}>;
|
|
3269
|
+
toAccountType: z.ZodEnum<{
|
|
3270
|
+
SPOT: "SPOT";
|
|
3271
|
+
ISOLATED_MARGIN: "ISOLATED_MARGIN";
|
|
3272
|
+
MARGIN: "MARGIN";
|
|
3273
|
+
USDT_FUTURE: "USDT_FUTURE";
|
|
3274
|
+
COIN_FUTURE: "COIN_FUTURE";
|
|
3275
|
+
}>;
|
|
3276
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
3277
|
+
asset: z.ZodString;
|
|
3278
|
+
amount: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
3279
|
+
clientTranId: z.ZodOptional<z.ZodString>;
|
|
3280
|
+
}, z.core.$strip>;
|
|
3281
|
+
type SubAccountUniversalTransferParams = z.infer<typeof SubAccountUniversalTransferParamsSchema>;
|
|
3282
|
+
declare const SubAccountUniversalTransferResultSchema: z.ZodObject<{
|
|
3283
|
+
tranId: z.ZodNumber;
|
|
3284
|
+
clientTranId: z.ZodOptional<z.ZodString>;
|
|
3285
|
+
}, z.core.$strip>;
|
|
3286
|
+
type SubAccountUniversalTransferResult = z.infer<typeof SubAccountUniversalTransferResultSchema>;
|
|
3287
|
+
declare const SubAccountUniversalTransferEntrySchema: z.ZodObject<{
|
|
3288
|
+
tranId: z.ZodNumber;
|
|
3289
|
+
fromEmail: z.ZodString;
|
|
3290
|
+
toEmail: z.ZodString;
|
|
3291
|
+
asset: z.ZodString;
|
|
3292
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3293
|
+
fromAccountType: z.ZodString;
|
|
3294
|
+
toAccountType: z.ZodString;
|
|
3295
|
+
status: z.ZodString;
|
|
3296
|
+
createTimeStamp: z.ZodNumber;
|
|
3297
|
+
clientTranId: z.ZodOptional<z.ZodString>;
|
|
3298
|
+
}, z.core.$loose>;
|
|
3299
|
+
type SubAccountUniversalTransferEntry = z.infer<typeof SubAccountUniversalTransferEntrySchema>;
|
|
3300
|
+
declare const SubAccountUniversalTransferHistoryResponseSchema: z.ZodObject<{
|
|
3301
|
+
result: z.ZodArray<z.ZodObject<{
|
|
3302
|
+
tranId: z.ZodNumber;
|
|
3303
|
+
fromEmail: z.ZodString;
|
|
3304
|
+
toEmail: z.ZodString;
|
|
3305
|
+
asset: z.ZodString;
|
|
3306
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3307
|
+
fromAccountType: z.ZodString;
|
|
3308
|
+
toAccountType: z.ZodString;
|
|
3309
|
+
status: z.ZodString;
|
|
3310
|
+
createTimeStamp: z.ZodNumber;
|
|
3311
|
+
clientTranId: z.ZodOptional<z.ZodString>;
|
|
3312
|
+
}, z.core.$loose>>;
|
|
3313
|
+
totalCount: z.ZodNumber;
|
|
3314
|
+
}, z.core.$strip>;
|
|
3315
|
+
type SubAccountUniversalTransferHistoryResponse = z.infer<typeof SubAccountUniversalTransferHistoryResponseSchema>;
|
|
3316
|
+
declare const VirtualSubAccountResultSchema: z.ZodObject<{
|
|
3317
|
+
email: z.ZodString;
|
|
3318
|
+
}, z.core.$strip>;
|
|
3319
|
+
type VirtualSubAccountResult = z.infer<typeof VirtualSubAccountResultSchema>;
|
|
3320
|
+
declare const SubAccountDepositAddressSchema: z.ZodObject<{
|
|
3321
|
+
address: z.ZodString;
|
|
3322
|
+
coin: z.ZodString;
|
|
3323
|
+
tag: z.ZodString;
|
|
3324
|
+
url: z.ZodOptional<z.ZodString>;
|
|
3325
|
+
}, z.core.$strip>;
|
|
3326
|
+
type SubAccountDepositAddress = z.infer<typeof SubAccountDepositAddressSchema>;
|
|
3327
|
+
declare const SubAccountDepositHistoryEntrySchema: z.ZodObject<{
|
|
3328
|
+
id: z.ZodString;
|
|
3329
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3330
|
+
coin: z.ZodString;
|
|
3331
|
+
network: z.ZodString;
|
|
3332
|
+
status: z.ZodNumber;
|
|
3333
|
+
address: z.ZodString;
|
|
3334
|
+
txId: z.ZodString;
|
|
3335
|
+
insertTime: z.ZodNumber;
|
|
3336
|
+
transferType: z.ZodNumber;
|
|
3337
|
+
}, z.core.$loose>;
|
|
3338
|
+
type SubAccountDepositHistoryEntry = z.infer<typeof SubAccountDepositHistoryEntrySchema>;
|
|
3339
|
+
declare const SubAccountDepositHistoryResponseSchema: z.ZodArray<z.ZodObject<{
|
|
3340
|
+
id: z.ZodString;
|
|
3341
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
3342
|
+
coin: z.ZodString;
|
|
3343
|
+
network: z.ZodString;
|
|
3344
|
+
status: z.ZodNumber;
|
|
3345
|
+
address: z.ZodString;
|
|
3346
|
+
txId: z.ZodString;
|
|
3347
|
+
insertTime: z.ZodNumber;
|
|
3348
|
+
transferType: z.ZodNumber;
|
|
3349
|
+
}, z.core.$loose>>;
|
|
3350
|
+
declare const SubAccountEnableResultSchema: z.ZodObject<{
|
|
3351
|
+
email: z.ZodString;
|
|
3352
|
+
isFuturesEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
3353
|
+
isMarginEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
3354
|
+
}, z.core.$loose>;
|
|
3355
|
+
type SubAccountEnableResult = z.infer<typeof SubAccountEnableResultSchema>;
|
|
3356
|
+
|
|
3357
|
+
declare class SubAccount {
|
|
3358
|
+
private readonly http;
|
|
3359
|
+
constructor(http: HttpClient);
|
|
3360
|
+
list(options?: {
|
|
3361
|
+
email?: string;
|
|
3362
|
+
isFreeze?: boolean;
|
|
3363
|
+
page?: number;
|
|
3364
|
+
limit?: number;
|
|
3365
|
+
}): Promise<SubAccountEntry[]>;
|
|
3366
|
+
status(email?: string): Promise<SubAccountStatus[]>;
|
|
3367
|
+
spotAssets(email: string): Promise<SubAccountSpotAssetsResponse>;
|
|
3368
|
+
spotSummary(options?: {
|
|
3369
|
+
email?: string;
|
|
3370
|
+
page?: number;
|
|
3371
|
+
size?: number;
|
|
3372
|
+
}): Promise<SubAccountSpotSummary>;
|
|
3373
|
+
futuresAccountSummary(futuresType: 1 | 2): Promise<SubAccountFuturesSummary>;
|
|
3374
|
+
marginAccount(email: string): Promise<SubAccountMarginAccount>;
|
|
3375
|
+
universalTransfer(params: SubAccountUniversalTransferParams): Promise<SubAccountUniversalTransferResult>;
|
|
3376
|
+
universalTransferHistory(options?: {
|
|
3377
|
+
fromEmail?: string;
|
|
3378
|
+
toEmail?: string;
|
|
3379
|
+
clientTranId?: string;
|
|
3380
|
+
startTime?: number;
|
|
3381
|
+
endTime?: number;
|
|
3382
|
+
page?: number;
|
|
3383
|
+
limit?: number;
|
|
3384
|
+
}): Promise<SubAccountUniversalTransferHistoryResponse>;
|
|
3385
|
+
createVirtualSubAccount(subAccountString: string): Promise<VirtualSubAccountResult>;
|
|
3386
|
+
enableFutures(email: string): Promise<SubAccountEnableResult>;
|
|
3387
|
+
enableMargin(email: string): Promise<SubAccountEnableResult>;
|
|
3388
|
+
depositAddress(email: string, coin: string, network?: string): Promise<SubAccountDepositAddress>;
|
|
3389
|
+
depositHistory(options: {
|
|
3390
|
+
email: string;
|
|
3391
|
+
coin?: string;
|
|
3392
|
+
status?: number;
|
|
3393
|
+
startTime?: number;
|
|
3394
|
+
endTime?: number;
|
|
3395
|
+
limit?: number;
|
|
3396
|
+
offset?: number;
|
|
3397
|
+
}): Promise<SubAccountDepositHistoryEntry[]>;
|
|
3398
|
+
}
|
|
3399
|
+
|
|
3400
|
+
interface BaseWSOptions {
|
|
3401
|
+
baseStreamUrl: string;
|
|
3402
|
+
reconnectDelayMs?: number;
|
|
3403
|
+
maxReconnectDelayMs?: number;
|
|
3404
|
+
}
|
|
3405
|
+
declare class BaseWS extends EventEmitter {
|
|
3406
|
+
private readonly options;
|
|
3407
|
+
private ws;
|
|
3408
|
+
private readonly streams;
|
|
3409
|
+
private reconnectAttempt;
|
|
3410
|
+
private closedByUser;
|
|
3411
|
+
constructor(options: BaseWSOptions);
|
|
3412
|
+
subscribe(streams: string[]): void;
|
|
3413
|
+
unsubscribe(streams: string[]): void;
|
|
3414
|
+
close(): void;
|
|
3415
|
+
reconnect(): void;
|
|
3416
|
+
resetReconnectAttempts(): void;
|
|
3417
|
+
private isOpen;
|
|
3418
|
+
private send;
|
|
3419
|
+
private connect;
|
|
3420
|
+
private handleMessage;
|
|
3421
|
+
private scheduleReconnect;
|
|
3422
|
+
}
|
|
3423
|
+
|
|
3424
|
+
type ContractType = 'perpetual' | 'current_quarter' | 'next_quarter';
|
|
3425
|
+
type MarkPriceSpeed = '1s' | '3s';
|
|
3426
|
+
declare class FuturesMarketWS extends BaseWS {
|
|
3427
|
+
constructor(baseStreamUrl?: string);
|
|
3428
|
+
kline(symbol: string, interval: KlineInterval): string;
|
|
3429
|
+
continuousKline(symbol: string, contractType: ContractType, interval: KlineInterval): string;
|
|
3430
|
+
indexPriceKline(symbol: string, interval: KlineInterval): string;
|
|
3431
|
+
markPriceKline(symbol: string, interval: KlineInterval): string;
|
|
3432
|
+
aggTrade(symbol: string): string;
|
|
3433
|
+
trade(symbol: string): string;
|
|
3434
|
+
depth(symbol: string, level?: 5 | 10 | 20): string;
|
|
3435
|
+
depthDiff(symbol: string): string;
|
|
3436
|
+
depthDiffSpeed(symbol: string, updateSpeed: '100ms' | '500ms'): string;
|
|
3437
|
+
ticker(symbol: string): string;
|
|
3438
|
+
rollingWindowTicker(symbol: string, window?: '1h' | '4h' | '1d'): string;
|
|
3439
|
+
allRollingWindowTickers(window?: '1h' | '4h' | '1d'): string;
|
|
3440
|
+
allMarketTickers(): string;
|
|
3441
|
+
allBookTickers(): string;
|
|
3442
|
+
miniTicker(symbol: string): string;
|
|
3443
|
+
allMiniTickers(): string;
|
|
3444
|
+
markPrice(symbol: string, updateSpeed?: MarkPriceSpeed): string;
|
|
3445
|
+
allMarkPrices(): string;
|
|
3446
|
+
bookTicker(symbol: string): string;
|
|
3447
|
+
liquidationOrder(symbol: string): string;
|
|
3448
|
+
allLiquidationOrders(): string;
|
|
3449
|
+
compositeIndex(symbol: string): string;
|
|
3450
|
+
assetIndex(symbol: string): string;
|
|
3451
|
+
allAssetIndices(): string;
|
|
3452
|
+
}
|
|
3453
|
+
|
|
3454
|
+
declare class SpotMarketWS extends BaseWS {
|
|
3455
|
+
constructor(baseStreamUrl?: string);
|
|
3456
|
+
kline(symbol: string, interval: KlineInterval): string;
|
|
3457
|
+
aggTrade(symbol: string): string;
|
|
3458
|
+
trade(symbol: string): string;
|
|
3459
|
+
depth(symbol: string, level?: 5 | 10 | 20): string;
|
|
3460
|
+
depthDiff(symbol: string): string;
|
|
3461
|
+
depthDiffSpeed(symbol: string, updateSpeed: '100ms'): string;
|
|
3462
|
+
avgPrice(symbol: string): string;
|
|
3463
|
+
ticker(symbol: string): string;
|
|
3464
|
+
rollingWindowTicker(symbol: string, window?: '1h' | '4h' | '1d' | '7d' | '30d'): string;
|
|
3465
|
+
allRollingWindowTickers(window?: '1h' | '4h' | '1d' | '7d' | '30d'): string;
|
|
3466
|
+
miniTicker(symbol: string): string;
|
|
3467
|
+
allMarketTickers(): string;
|
|
3468
|
+
allMiniTickers(): string;
|
|
3469
|
+
bookTicker(symbol: string): string;
|
|
3470
|
+
allBookTickers(): string;
|
|
3471
|
+
}
|
|
3472
|
+
|
|
3473
|
+
interface SpotUserWSOptions {
|
|
3474
|
+
baseUserUrl: string;
|
|
3475
|
+
getListenKey: () => string | null;
|
|
3476
|
+
reconnectDelayMs?: number;
|
|
3477
|
+
maxReconnectDelayMs?: number;
|
|
3478
|
+
}
|
|
3479
|
+
declare class SpotUserWS extends EventEmitter {
|
|
3480
|
+
private readonly options;
|
|
3481
|
+
private ws;
|
|
3482
|
+
private reconnectAttempt;
|
|
3483
|
+
private closedByUser;
|
|
3484
|
+
constructor(options: SpotUserWSOptions);
|
|
3485
|
+
connect(): void;
|
|
3486
|
+
close(): void;
|
|
3487
|
+
reconnect(): void;
|
|
3488
|
+
resetReconnectAttempts(): void;
|
|
3489
|
+
private handleMessage;
|
|
3490
|
+
private scheduleReconnect;
|
|
3491
|
+
}
|
|
3492
|
+
|
|
3493
|
+
interface FuturesUserWSOptions {
|
|
3494
|
+
baseUserUrl: string;
|
|
3495
|
+
getListenKey: () => string | null;
|
|
3496
|
+
reconnectDelayMs?: number;
|
|
3497
|
+
maxReconnectDelayMs?: number;
|
|
3498
|
+
}
|
|
3499
|
+
declare class FuturesUserWS extends EventEmitter {
|
|
3500
|
+
private readonly options;
|
|
3501
|
+
private ws;
|
|
3502
|
+
private reconnectAttempt;
|
|
3503
|
+
private closedByUser;
|
|
3504
|
+
constructor(options: FuturesUserWSOptions);
|
|
3505
|
+
connect(): void;
|
|
3506
|
+
close(): void;
|
|
3507
|
+
reconnect(): void;
|
|
3508
|
+
resetReconnectAttempts(): void;
|
|
3509
|
+
private handleMessage;
|
|
3510
|
+
private scheduleReconnect;
|
|
3511
|
+
}
|
|
3512
|
+
|
|
3513
|
+
type CoinMContractType = 'perpetual' | 'current_quarter' | 'next_quarter';
|
|
3514
|
+
type CoinMMarkPriceSpeed = '1s' | '3s';
|
|
3515
|
+
/**
|
|
3516
|
+
* COIN-M stream names mirror USD-M's naming scheme exactly, just against `dstream.binance.com`
|
|
3517
|
+
* and inverse-contract symbols/pairs (e.g. `btcusd_perp`, `btcusd`).
|
|
3518
|
+
*/
|
|
3519
|
+
declare class CoinMMarketWS extends BaseWS {
|
|
3520
|
+
constructor(baseStreamUrl?: string);
|
|
3521
|
+
kline(symbol: string, interval: KlineInterval): string;
|
|
3522
|
+
continuousKline(pair: string, contractType: CoinMContractType, interval: KlineInterval): string;
|
|
3523
|
+
indexPriceKline(pair: string, interval: KlineInterval): string;
|
|
3524
|
+
markPriceKline(symbol: string, interval: KlineInterval): string;
|
|
3525
|
+
aggTrade(symbol: string): string;
|
|
3526
|
+
trade(symbol: string): string;
|
|
3527
|
+
depth(symbol: string, level?: 5 | 10 | 20): string;
|
|
3528
|
+
depthDiff(symbol: string): string;
|
|
3529
|
+
depthDiffSpeed(symbol: string, updateSpeed: '100ms' | '250ms' | '500ms'): string;
|
|
3530
|
+
ticker(symbol: string): string;
|
|
3531
|
+
allMarketTickers(): string;
|
|
3532
|
+
miniTicker(symbol: string): string;
|
|
3533
|
+
allMiniTickers(): string;
|
|
3534
|
+
bookTicker(symbol: string): string;
|
|
3535
|
+
allBookTickers(): string;
|
|
3536
|
+
markPrice(symbol: string, updateSpeed?: CoinMMarkPriceSpeed): string;
|
|
3537
|
+
markPriceForPair(pair: string, updateSpeed?: CoinMMarkPriceSpeed): string;
|
|
3538
|
+
liquidationOrder(symbol: string): string;
|
|
3539
|
+
allLiquidationOrders(): string;
|
|
3540
|
+
}
|
|
3541
|
+
|
|
3542
|
+
interface CoinMUserWSOptions {
|
|
3543
|
+
baseUserUrl: string;
|
|
3544
|
+
getListenKey: () => string | null;
|
|
3545
|
+
reconnectDelayMs?: number;
|
|
3546
|
+
maxReconnectDelayMs?: number;
|
|
3547
|
+
}
|
|
3548
|
+
/**
|
|
3549
|
+
* COIN-M user data events (ACCOUNT_UPDATE, ORDER_TRADE_UPDATE, MARGIN_CALL) share the same
|
|
3550
|
+
* event shape as USD-M's, so the USD-M parser/types are reused as-is.
|
|
3551
|
+
*/
|
|
3552
|
+
declare class CoinMUserWS extends EventEmitter {
|
|
3553
|
+
private readonly options;
|
|
3554
|
+
private ws;
|
|
3555
|
+
private reconnectAttempt;
|
|
3556
|
+
private closedByUser;
|
|
3557
|
+
constructor(options: CoinMUserWSOptions);
|
|
3558
|
+
connect(): void;
|
|
3559
|
+
close(): void;
|
|
3560
|
+
reconnect(): void;
|
|
3561
|
+
resetReconnectAttempts(): void;
|
|
3562
|
+
private handleMessage;
|
|
3563
|
+
private scheduleReconnect;
|
|
3564
|
+
}
|
|
3565
|
+
|
|
3566
|
+
interface WsApiOptions {
|
|
3567
|
+
baseUrl: string;
|
|
3568
|
+
apiKey?: string;
|
|
3569
|
+
apiSecret?: string;
|
|
3570
|
+
/** PEM-encoded Ed25519 or RSA private key. When set, requests are signed with it instead of HMAC. */
|
|
3571
|
+
privateKey?: string | Buffer;
|
|
3572
|
+
/** Defaults to 'ED25519' when privateKey is set, otherwise 'HMAC'. */
|
|
3573
|
+
signatureAlgorithm?: SignatureAlgorithm;
|
|
3574
|
+
recvWindow?: number;
|
|
3575
|
+
timeoutMs?: number;
|
|
3576
|
+
}
|
|
3577
|
+
interface WsApiRequestParams$1 {
|
|
3578
|
+
id?: string;
|
|
3579
|
+
[key: string]: unknown;
|
|
3580
|
+
}
|
|
3581
|
+
declare class WsApi {
|
|
3582
|
+
private readonly options;
|
|
3583
|
+
private readonly signer;
|
|
3584
|
+
constructor(options: WsApiOptions);
|
|
3585
|
+
request(method: string, params?: WsApiRequestParams$1, options?: {
|
|
3586
|
+
signed?: boolean;
|
|
3587
|
+
}): Promise<WsApiResponse>;
|
|
3588
|
+
placeOrder(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3589
|
+
cancelOrder(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3590
|
+
modifyOrder(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3591
|
+
placeAlgoOrder(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3592
|
+
cancelAlgoOrder(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3593
|
+
orderStatus(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3594
|
+
placeOrderList(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3595
|
+
cancelOrderList(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3596
|
+
orderListStatus(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3597
|
+
accountStatus(): Promise<WsApiResponse>;
|
|
3598
|
+
accountPosition(params?: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3599
|
+
userDataStreamStart(): Promise<WsApiResponse>;
|
|
3600
|
+
userDataStreamPing(listenKey: string): Promise<WsApiResponse>;
|
|
3601
|
+
userDataStreamStop(listenKey: string): Promise<WsApiResponse>;
|
|
3602
|
+
time(): Promise<WsApiResponse>;
|
|
3603
|
+
exchangeInfo(params?: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3604
|
+
klines(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3605
|
+
aggTrades(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3606
|
+
trades(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3607
|
+
depth(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3608
|
+
avgPrice(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3609
|
+
tickerPrice(params?: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3610
|
+
tickerBookTicker(params?: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3611
|
+
ticker24hr(params?: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3612
|
+
}
|
|
3613
|
+
|
|
3614
|
+
interface SpotWsApiOptions {
|
|
3615
|
+
baseUrl: string;
|
|
3616
|
+
apiKey?: string;
|
|
3617
|
+
apiSecret?: string;
|
|
3618
|
+
/** PEM-encoded Ed25519 or RSA private key. When set, requests are signed with it instead of HMAC. */
|
|
3619
|
+
privateKey?: string | Buffer;
|
|
3620
|
+
/** Defaults to 'ED25519' when privateKey is set, otherwise 'HMAC'. */
|
|
3621
|
+
signatureAlgorithm?: SignatureAlgorithm;
|
|
3622
|
+
recvWindow?: number;
|
|
3623
|
+
timeoutMs?: number;
|
|
3624
|
+
}
|
|
3625
|
+
interface WsApiRequestParams {
|
|
3626
|
+
id?: string;
|
|
3627
|
+
[key: string]: unknown;
|
|
3628
|
+
}
|
|
3629
|
+
/**
|
|
3630
|
+
* Spot WebSocket API (`wss://ws-api.binance.com:443/ws-api/v3`). Same request/response envelope
|
|
3631
|
+
* as the futures {@link WsApi}, but Spot uses its own method identifiers (`trades.recent` rather
|
|
3632
|
+
* than `trades`, `ticker.book` rather than `ticker.bookTicker`, etc.) — hence a separate class
|
|
3633
|
+
* rather than pointing WsApi at a different host.
|
|
3634
|
+
*/
|
|
3635
|
+
declare class SpotWsApi {
|
|
3636
|
+
private readonly options;
|
|
3637
|
+
private readonly signer;
|
|
3638
|
+
constructor(options: SpotWsApiOptions);
|
|
3639
|
+
request(method: string, params?: WsApiRequestParams, options?: {
|
|
3640
|
+
signed?: boolean;
|
|
3641
|
+
}): Promise<WsApiResponse>;
|
|
3642
|
+
placeOrder(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3643
|
+
testOrder(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3644
|
+
cancelOrder(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3645
|
+
cancelReplaceOrder(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3646
|
+
orderStatus(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3647
|
+
openOrdersStatus(params?: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3648
|
+
cancelOpenOrders(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3649
|
+
placeOrderList(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3650
|
+
cancelOrderList(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3651
|
+
orderListStatus(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3652
|
+
openOrderListsStatus(): Promise<WsApiResponse>;
|
|
3653
|
+
accountStatus(): Promise<WsApiResponse>;
|
|
3654
|
+
accountCommission(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3655
|
+
accountRateLimitsOrders(): Promise<WsApiResponse>;
|
|
3656
|
+
allOrders(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3657
|
+
allOrderLists(params?: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3658
|
+
myTrades(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3659
|
+
userDataStreamStart(): Promise<WsApiResponse>;
|
|
3660
|
+
userDataStreamPing(listenKey: string): Promise<WsApiResponse>;
|
|
3661
|
+
userDataStreamStop(listenKey: string): Promise<WsApiResponse>;
|
|
3662
|
+
ping(): Promise<WsApiResponse>;
|
|
3663
|
+
time(): Promise<WsApiResponse>;
|
|
3664
|
+
exchangeInfo(params?: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3665
|
+
depth(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3666
|
+
recentTrades(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3667
|
+
historicalTrades(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3668
|
+
aggTrades(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3669
|
+
klines(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3670
|
+
uiKlines(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3671
|
+
avgPrice(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3672
|
+
ticker24hr(params?: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3673
|
+
tickerTradingDay(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3674
|
+
tickerPrice(params?: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3675
|
+
tickerBook(params?: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3676
|
+
ticker(params: Record<string, unknown>): Promise<WsApiResponse>;
|
|
3677
|
+
}
|
|
3678
|
+
|
|
3679
|
+
interface BinanceClientOptions {
|
|
3680
|
+
apiKey?: string;
|
|
3681
|
+
apiSecret?: string;
|
|
3682
|
+
/** PEM-encoded Ed25519 or RSA private key. When set, requests are signed with it instead of HMAC. */
|
|
3683
|
+
privateKey?: string | Buffer;
|
|
3684
|
+
/** Defaults to 'ED25519' when privateKey is set, otherwise 'HMAC'. */
|
|
3685
|
+
signatureAlgorithm?: SignatureAlgorithm;
|
|
3686
|
+
testnet?: boolean;
|
|
3687
|
+
demo?: boolean;
|
|
3688
|
+
recvWindow?: number;
|
|
3689
|
+
apiBase?: string;
|
|
3690
|
+
wsBase?: string;
|
|
3691
|
+
wsUserBase?: string;
|
|
3692
|
+
wsApiBase?: string;
|
|
3693
|
+
dapiBase?: string;
|
|
3694
|
+
wsSpotApiBase?: string;
|
|
3695
|
+
wsDapiBase?: string;
|
|
3696
|
+
timeoutMs?: number;
|
|
3697
|
+
maxRetries?: number;
|
|
3698
|
+
/** @deprecated unused; superseded by header-based tracking (rateLimitWeightPerMinute/rateLimitSafetyMargin). */
|
|
3699
|
+
rateLimitTokensPerSecond?: number;
|
|
3700
|
+
/** @deprecated unused; superseded by header-based tracking (rateLimitWeightPerMinute/rateLimitSafetyMargin). */
|
|
3701
|
+
rateLimitMaxTokens?: number;
|
|
3702
|
+
/** Assumed per-minute IP weight ceiling used to preempt -1003 bans. Binance's default is 6000 for most REST hosts. */
|
|
3703
|
+
rateLimitWeightPerMinute?: number;
|
|
3704
|
+
/** Fraction of rateLimitWeightPerMinute at which requests are delayed until the next minute window. Set >=1 to disable. */
|
|
3705
|
+
rateLimitSafetyMargin?: number;
|
|
3706
|
+
retryBaseDelayMs?: number;
|
|
3707
|
+
retryMaxDelayMs?: number;
|
|
3708
|
+
/** Custom keep-alive/https agent, e.g. for corporate proxies or connection pooling. */
|
|
3709
|
+
httpsAgent?: AxiosRequestConfig['httpsAgent'];
|
|
3710
|
+
/** Axios proxy configuration. */
|
|
3711
|
+
proxy?: AxiosRequestConfig['proxy'];
|
|
3712
|
+
/**
|
|
3713
|
+
* Client-side guardrails for autonomous/LLM-driven callers: dry run, read-only, symbol
|
|
3714
|
+
* allowlist, per-order notional cap, withdrawal and transfer switches. Omit for no policy
|
|
3715
|
+
* (all requests permitted). Opting in denies withdrawals unless explicitly allowed.
|
|
3716
|
+
*/
|
|
3717
|
+
safety?: TradingPolicyOptions;
|
|
3718
|
+
}
|
|
3719
|
+
declare class BinanceClient {
|
|
3720
|
+
readonly spot: {
|
|
3721
|
+
market: SpotMarket;
|
|
3722
|
+
account: SpotAccount;
|
|
3723
|
+
trading: SpotTrading;
|
|
3724
|
+
userStream: SpotUserDataStream;
|
|
3725
|
+
ws: SpotMarketWS;
|
|
3726
|
+
wsUser: SpotUserWS;
|
|
3727
|
+
wsApi: SpotWsApi;
|
|
3728
|
+
};
|
|
3729
|
+
readonly futures: {
|
|
3730
|
+
market: FuturesMarket;
|
|
3731
|
+
data: FuturesData;
|
|
3732
|
+
account: FuturesAccount;
|
|
3733
|
+
trading: FuturesTrading;
|
|
3734
|
+
ops: FuturesOps;
|
|
3735
|
+
userStream: UserDataStream;
|
|
3736
|
+
ws: FuturesMarketWS;
|
|
3737
|
+
wsUser: FuturesUserWS;
|
|
3738
|
+
wsApi: WsApi;
|
|
3739
|
+
};
|
|
3740
|
+
readonly coinm: {
|
|
3741
|
+
market: CoinMMarket;
|
|
3742
|
+
account: CoinMAccount;
|
|
3743
|
+
trading: CoinMTrading;
|
|
3744
|
+
userStream: CoinMUserDataStream;
|
|
3745
|
+
ws: CoinMMarketWS;
|
|
3746
|
+
wsUser: CoinMUserWS;
|
|
3747
|
+
};
|
|
3748
|
+
readonly margin: {
|
|
3749
|
+
account: MarginAccount;
|
|
3750
|
+
trading: MarginTrading;
|
|
3751
|
+
};
|
|
3752
|
+
readonly wallet: Wallet;
|
|
3753
|
+
readonly subaccount: SubAccount;
|
|
3754
|
+
/** The active guardrail policy, or undefined when no `safety` config was supplied. */
|
|
3755
|
+
readonly policy?: TradingPolicy;
|
|
3756
|
+
private readonly authHttp;
|
|
3757
|
+
private readonly spotHttp;
|
|
3758
|
+
private readonly dapiHttp;
|
|
3759
|
+
private readonly sapiHttp;
|
|
3760
|
+
private listenKeyValue;
|
|
3761
|
+
private keepAliveInterval;
|
|
3762
|
+
private spotListenKeyValue;
|
|
3763
|
+
private spotKeepAliveInterval;
|
|
3764
|
+
private coinmListenKeyValue;
|
|
3765
|
+
private coinmKeepAliveInterval;
|
|
3766
|
+
static nowSeconds(): number;
|
|
3767
|
+
static buildPair(base: string, target: string): string;
|
|
3768
|
+
static parsePair(pair: string): {
|
|
3769
|
+
base: string;
|
|
3770
|
+
target: string;
|
|
3771
|
+
} | null;
|
|
3772
|
+
static calculateLiquidationPrice(entryPrice: number, leverage: number, side: 'buy' | 'sell', mm?: number): number;
|
|
3773
|
+
constructor(options?: BinanceClientOptions);
|
|
3774
|
+
/**
|
|
3775
|
+
* Syncs local time against each REST host's server clock and stores the offset, applied to
|
|
3776
|
+
* every subsequent signed request's `timestamp` param. Call this once after construction to
|
|
3777
|
+
* mitigate `-1021` errors caused by local clock drift.
|
|
3778
|
+
*/
|
|
3779
|
+
syncTime(): Promise<void>;
|
|
3780
|
+
/**
|
|
3781
|
+
* Snapshot of the most recently observed `X-MBX-USED-WEIGHT-*` / `X-MBX-ORDER-COUNT-*`
|
|
3782
|
+
* response headers, per REST host. Each host tracks its own weight budget independently.
|
|
3783
|
+
*/
|
|
3784
|
+
getRateLimitUsage(): {
|
|
3785
|
+
spot: RateLimitUsage;
|
|
3786
|
+
futures: RateLimitUsage;
|
|
3787
|
+
coinm: RateLimitUsage;
|
|
3788
|
+
sapi: RateLimitUsage;
|
|
3789
|
+
};
|
|
3790
|
+
startUserStream(): Promise<string>;
|
|
3791
|
+
closeUserStream(): void;
|
|
3792
|
+
startSpotUserStream(): Promise<string>;
|
|
3793
|
+
closeSpotUserStream(): void;
|
|
3794
|
+
startCoinMUserStream(): Promise<string>;
|
|
3795
|
+
closeCoinMUserStream(): void;
|
|
3796
|
+
closeAllWebSockets(): void;
|
|
3797
|
+
reconnectWebSocket(target: 'ws' | 'wsUser' | 'spot' | 'spotUser' | 'coinm' | 'coinmUser'): void;
|
|
3798
|
+
resetReconnectAttempts(): void;
|
|
3799
|
+
}
|
|
3800
|
+
|
|
3801
|
+
interface ToolContext {
|
|
3802
|
+
env: 'live' | 'testnet' | 'demo';
|
|
3803
|
+
isSigned: boolean;
|
|
3804
|
+
}
|
|
3805
|
+
interface ToolDefinition<TInput extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
3806
|
+
name: string;
|
|
3807
|
+
description: string;
|
|
3808
|
+
inputSchema: TInput;
|
|
3809
|
+
handler: (args: any, ctx: ToolContext) => Promise<unknown>;
|
|
3810
|
+
}
|
|
3811
|
+
declare function toJsonSchema(inputSchema: z.ZodTypeAny): Record<string, unknown>;
|
|
3812
|
+
declare function toOpenAITool(tool: ToolDefinition): Record<string, unknown>;
|
|
3813
|
+
declare function toAnthropicTool(tool: ToolDefinition): Record<string, unknown>;
|
|
3814
|
+
declare function toMCPTool(tool: ToolDefinition): {
|
|
3815
|
+
name: string;
|
|
3816
|
+
description: string;
|
|
3817
|
+
inputSchema: Record<string, unknown>;
|
|
3818
|
+
};
|
|
3819
|
+
declare function toToolList<TInput extends z.ZodTypeAny>(tools: ToolDefinition<TInput>[], format: 'openai' | 'anthropic' | 'mcp'): Record<string, unknown>[];
|
|
3820
|
+
declare function textResult(data: unknown): string;
|
|
3821
|
+
|
|
3822
|
+
interface PaperState {
|
|
3823
|
+
balance: number;
|
|
3824
|
+
positions: PaperPosition[];
|
|
3825
|
+
history: PaperEvent[];
|
|
3826
|
+
}
|
|
3827
|
+
interface PaperPosition {
|
|
3828
|
+
id: string;
|
|
3829
|
+
symbol: string;
|
|
3830
|
+
side: 'LONG' | 'SHORT';
|
|
3831
|
+
quantity: number;
|
|
3832
|
+
entryPrice: number;
|
|
3833
|
+
openedAt: string;
|
|
3834
|
+
}
|
|
3835
|
+
interface PaperEvent extends PaperPosition {
|
|
3836
|
+
type: 'open' | 'close';
|
|
3837
|
+
exitPrice?: number;
|
|
3838
|
+
realizedPnl?: number;
|
|
3839
|
+
closedAt?: string;
|
|
3840
|
+
}
|
|
3841
|
+
interface PaperContext {
|
|
3842
|
+
state: PaperState;
|
|
3843
|
+
client: BinanceClient;
|
|
3844
|
+
}
|
|
3845
|
+
declare function createPaperContext(client: BinanceClient, initialState?: Partial<PaperState>): PaperContext;
|
|
3846
|
+
declare function paperTools(ctx: PaperContext): ToolDefinition[];
|
|
3847
|
+
|
|
3848
|
+
declare function marketDataTools(client: BinanceClient): ToolDefinition[];
|
|
3849
|
+
|
|
3850
|
+
declare function accountTools(client: BinanceClient): ToolDefinition[];
|
|
3851
|
+
|
|
3852
|
+
declare function tradingTools(client: BinanceClient): ToolDefinition[];
|
|
3853
|
+
|
|
3854
|
+
declare function spotTools(client: BinanceClient): ToolDefinition[];
|
|
3855
|
+
|
|
3856
|
+
/**
|
|
3857
|
+
* Derived tools: each one fans out over several REST endpoints and returns a
|
|
3858
|
+
* single answer. They exist so the model does not have to chain primitives and
|
|
3859
|
+
* do float arithmetic on tick/step sizes itself.
|
|
3860
|
+
*/
|
|
3861
|
+
declare function derivedTools(client: BinanceClient): ToolDefinition[];
|
|
3862
|
+
|
|
3863
|
+
declare function getBufferedWsEvents(client: BinanceClient, limit?: number): unknown[];
|
|
3864
|
+
declare function clearBufferedWsEvents(client: BinanceClient): void;
|
|
3865
|
+
declare function wsTools(client: BinanceClient): ToolDefinition[];
|
|
3866
|
+
|
|
3867
|
+
interface FuturesToolkit {
|
|
3868
|
+
client: BinanceClient;
|
|
3869
|
+
tools: ToolDefinition[];
|
|
3870
|
+
market: ToolDefinition[];
|
|
3871
|
+
account: ToolDefinition[];
|
|
3872
|
+
trading: ToolDefinition[];
|
|
3873
|
+
spot: ToolDefinition[];
|
|
3874
|
+
ws: ToolDefinition[];
|
|
3875
|
+
/** Composite tools that fan out over several endpoints. */
|
|
3876
|
+
derived: ToolDefinition[];
|
|
3877
|
+
paper: ToolDefinition[];
|
|
3878
|
+
paperContext: PaperContext;
|
|
3879
|
+
}
|
|
3880
|
+
declare function createFuturesToolkit(client: BinanceClient): FuturesToolkit;
|
|
3881
|
+
declare function toolkitToFormats(toolkit: FuturesToolkit): {
|
|
3882
|
+
openai: Record<string, unknown>[];
|
|
3883
|
+
anthropic: Record<string, unknown>[];
|
|
3884
|
+
mcp: Record<string, unknown>[];
|
|
3885
|
+
};
|
|
3886
|
+
|
|
3887
|
+
export { CoinMAccountSchema as $, type Account as A, BinanceClient as B, BaseWS as C, type BaseWSOptions as D, type BatchOrdersItem as E, FuturesMarket as F, BatchOrdersItemSchema as G, BatchOrdersResponseSchema as H, type BinanceClientOptions as I, type BookTicker as J, BookTickerSchema as K, type BorrowRepayParams as L, BorrowRepayParamsSchema as M, type BorrowRepayRecordEntry as N, BorrowRepayRecordEntrySchema as O, type BorrowRepayRecordResponse as P, BorrowRepayRecordResponseSchema as Q, type BorrowRepayResult as R, BorrowRepayResultSchema as S, type BracketOrderParams as T, type ClosePositionParams as U, CoinMAccount as V, type CoinMAccountAsset as W, CoinMAccountAssetSchema as X, type CoinMAccountInfo as Y, type CoinMAccountPosition as Z, CoinMAccountPositionSchema as _, type AccountAsset as a, DustLogResponseSchema as a$, type CoinMBalance as a0, CoinMBalanceResponseSchema as a1, CoinMBalanceSchema as a2, type CoinMCommissionRate as a3, CoinMCommissionRateSchema as a4, type CoinMContractType as a5, type CoinMCreateOrderParams as a6, CoinMCreateOrderParamsSchema as a7, type CoinMIncome as a8, CoinMIncomeHistoryResponseSchema as a9, CoinMUserDataStream as aA, type CoinMUserTrade as aB, CoinMUserTradeSchema as aC, CoinMUserTradesResponseSchema as aD, CoinMUserWS as aE, type CoinMUserWSOptions as aF, type CommissionRate as aG, CommissionRateSchema as aH, type ContractType as aI, type CountdownCancelAll as aJ, CountdownCancelAllSchema as aK, type CreateOrderParams as aL, CreateOrderParamsSchema as aM, type CrossMarginAccount as aN, CrossMarginAccountSchema as aO, type DepositAddress as aP, DepositAddressSchema as aQ, type DepositHistoryEntry as aR, DepositHistoryEntrySchema as aS, DepositHistoryResponseSchema as aT, type DepthSnapshot as aU, DepthSnapshotSchema as aV, type DustConversionResult as aW, DustConversionResultSchema as aX, type DustLogEntry as aY, DustLogEntrySchema as aZ, type DustLogResponse as a_, CoinMIncomeSchema as aa, type CoinMLeverageBracket as ab, CoinMLeverageBracketResponseSchema as ac, CoinMLeverageBracketSchema as ad, type CoinMLeverageChange as ae, CoinMLeverageChangeSchema as af, type CoinMMarginTypeChange as ag, CoinMMarginTypeChangeSchema as ah, type CoinMMarkPriceSpeed as ai, CoinMMarket as aj, CoinMMarketWS as ak, type CoinMOpenInterestHistEntry as al, CoinMOpenInterestHistEntrySchema as am, CoinMOpenInterestHistSchema as an, type CoinMOrder as ao, CoinMOrderResponseSchema as ap, CoinMOrderSchema as aq, CoinMOrdersResponseSchema as ar, type CoinMPositionMarginChange as as, CoinMPositionMarginChangeSchema as at, type CoinMPositionMode as au, CoinMPositionModeSchema as av, type CoinMPositionRisk as aw, CoinMPositionRiskResponseSchema as ax, CoinMPositionRiskSchema as ay, CoinMTrading as az, AccountAssetSchema as b, type MarginOrder as b$, type ExchangeInfo as b0, ExchangeInfoSchema as b1, type ExchangeSymbol as b2, ExchangeSymbolSchema as b3, type FeeBurnStatus as b4, FeeBurnStatusSchema as b5, type FundingAsset as b6, FundingAssetSchema as b7, FundingAssetsResponseSchema as b8, type FundingRate as b9, type KlineInterval as bA, KlineIntervalSchema as bB, KlineSchema as bC, KlinesResponseSchema as bD, type LeverageBracket as bE, LeverageBracketResponseSchema as bF, LeverageBracketSchema as bG, type LeverageChange as bH, LeverageChangeSchema as bI, type ListenKey as bJ, ListenKeySchema as bK, type LongShortRatioEntry as bL, LongShortRatioEntrySchema as bM, LongShortRatioSchema as bN, MarginAccount as bO, type MarginAssetBalance as bP, MarginAssetBalanceSchema as bQ, type MarginCreateOrderParams as bR, MarginCreateOrderParamsSchema as bS, type MarginForceLiquidationEntry as bT, MarginForceLiquidationEntrySchema as bU, type MarginForceLiquidationResponse as bV, MarginForceLiquidationResponseSchema as bW, type MarginInterestHistoryEntry as bX, MarginInterestHistoryEntrySchema as bY, type MarginInterestHistoryResponse as bZ, MarginInterestHistoryResponseSchema as b_, FundingRateHistorySchema as ba, FundingRateSchema as bb, FuturesAccount as bc, FuturesData as bd, type FuturesDataEndpoints as be, FuturesMarketWS as bf, FuturesOps as bg, type FuturesToolkit as bh, FuturesTrading as bi, FuturesUserWS as bj, type FuturesUserWSOptions as bk, HttpClient as bl, type HttpClientOptions as bm, type HttpMethod as bn, type Income as bo, IncomeHistoryResponseSchema as bp, IncomeSchema as bq, type IsolatedMarginAccount as br, IsolatedMarginAccountSchema as bs, type IsolatedMarginAsset as bt, IsolatedMarginAssetSchema as bu, type IsolatedMarginSymbol as bv, IsolatedMarginSymbolSchema as bw, type IsolatedTransferParams as bx, IsolatedTransferParamsSchema as by, type Kline as bz, type AccountPosition as c, type SpotBalance as c$, MarginOrderResponseSchema as c0, MarginOrderSchema as c1, MarginOrdersResponseSchema as c2, type MarginPriceIndex as c3, MarginPriceIndexSchema as c4, type MarginTrade as c5, MarginTradeSchema as c6, MarginTradesResponseSchema as c7, MarginTrading as c8, type MarginTransferResult as c9, OrdersResponseSchema as cA, type PositionMarginChange as cB, PositionMarginChangeSchema as cC, type PositionMarginHistoryEntry as cD, PositionMarginHistoryEntrySchema as cE, PositionMarginHistorySchema as cF, type PositionMode as cG, PositionModeSchema as cH, type PositionRisk as cI, PositionRiskResponseSchema as cJ, PositionRiskSchema as cK, type PositionSizing as cL, type PremiumIndex as cM, PremiumIndexSchema as cN, type RateLimitOrder as cO, RateLimitOrderResponseSchema as cP, RateLimitOrderSchema as cQ, RateLimitTracker as cR, type RateLimitTrackerOptions as cS, type RateLimitUsage as cT, type SignatureAlgorithm as cU, Signer as cV, type SignerOptions as cW, type SizePositionParams as cX, SpotAccount as cY, type SpotAccountInfo as cZ, SpotAccountSchema as c_, MarginTransferResultSchema as ca, type MarginTypeChange as cb, MarginTypeChangeSchema as cc, type MarkPriceSpeed as cd, MarketDataBase as ce, type MaxBorrowable as cf, MaxBorrowableSchema as cg, type MaxTransferable as ch, MaxTransferableSchema as ci, type ModifyOrderParams as cj, ModifyOrderParamsSchema as ck, type MultiAssetsMargin as cl, MultiAssetsMarginSchema as cm, type NewOrderAck as cn, NewOrderAckSchema as co, type OpenInterest as cp, type OpenInterestHistEntry as cq, OpenInterestHistEntrySchema as cr, OpenInterestHistSchema as cs, OpenInterestSchema as ct, type Order as cu, type OrderModifyHistoryEntry as cv, OrderModifyHistoryEntrySchema as cw, OrderModifyHistorySchema as cx, OrderResponseSchema as cy, OrderSchema as cz, AccountPositionSchema as d, type SubAccountUniversalTransferResult as d$, SpotBalanceSchema as d0, type SpotBalanceUpdate as d1, SpotBalanceUpdateSchema as d2, type SpotExecutionReport as d3, SpotExecutionReportSchema as d4, type SpotListStatus as d5, SpotListStatusSchema as d6, SpotMarket as d7, SpotMarketWS as d8, type SpotOCOOrderAck as d9, type SubAccountEnableResult as dA, SubAccountEnableResultSchema as dB, type SubAccountEntry as dC, SubAccountEntrySchema as dD, type SubAccountFuturesSummary as dE, SubAccountFuturesSummarySchema as dF, type SubAccountListResponse as dG, SubAccountListResponseSchema as dH, type SubAccountMarginAccount as dI, SubAccountMarginAccountSchema as dJ, type SubAccountSpotAsset as dK, SubAccountSpotAssetSchema as dL, type SubAccountSpotAssetsResponse as dM, SubAccountSpotAssetsResponseSchema as dN, type SubAccountSpotSummary as dO, type SubAccountSpotSummaryEntry as dP, SubAccountSpotSummaryEntrySchema as dQ, SubAccountSpotSummarySchema as dR, type SubAccountStatus as dS, SubAccountStatusResponseSchema as dT, SubAccountStatusSchema as dU, type SubAccountUniversalTransferEntry as dV, SubAccountUniversalTransferEntrySchema as dW, type SubAccountUniversalTransferHistoryResponse as dX, SubAccountUniversalTransferHistoryResponseSchema as dY, type SubAccountUniversalTransferParams as dZ, SubAccountUniversalTransferParamsSchema as d_, SpotOCOOrderAckResponseSchema as da, SpotOCOOrderAckSchema as db, SpotOCOOrdersResponseSchema as dc, type SpotOrder as dd, SpotOrderResponseSchema as de, SpotOrderSchema as df, SpotOrdersResponseSchema as dg, type SpotOutboundAccountPosition as dh, SpotOutboundAccountPositionSchema as di, type SpotTrade as dj, SpotTradeSchema as dk, SpotTradesResponseSchema as dl, SpotTrading as dm, type SpotUserDataEvent as dn, SpotUserDataStream as dp, SpotUserWS as dq, type SpotUserWSOptions as dr, SpotWsApi as ds, type SpotWsApiOptions as dt, SubAccount as du, type SubAccountDepositAddress as dv, SubAccountDepositAddressSchema as dw, type SubAccountDepositHistoryEntry as dx, SubAccountDepositHistoryEntrySchema as dy, SubAccountDepositHistoryResponseSchema as dz, AccountSchema as e, getBufferedWsEvents as e$, SubAccountUniversalTransferResultSchema as e0, type SymbolRules as e1, type TakerLongShortRatioEntry as e2, TakerLongShortRatioEntrySchema as e3, TakerLongShortRatioSchema as e4, type Ticker24hr as e5, Ticker24hrSchema as e6, type TickerPrice as e7, TickerPriceSchema as e8, type ToolContext as e9, UserDataMarginCallSchema as eA, type UserDataOrderTradeUpdate as eB, UserDataOrderTradeUpdateSchema as eC, UserDataStream as eD, type UserTrade as eE, UserTradeSchema as eF, UserTradesResponseSchema as eG, type VirtualSubAccountResult as eH, VirtualSubAccountResultSchema as eI, Wallet as eJ, type WithdrawHistoryEntry as eK, WithdrawHistoryEntrySchema as eL, WithdrawHistoryResponseSchema as eM, type WithdrawParams as eN, WithdrawParamsSchema as eO, type WithdrawResult as eP, WithdrawResultSchema as eQ, WsApi as eR, type WsApiOptions as eS, type WsApiResponse as eT, WsApiResponseSchema as eU, accountTools as eV, createFuturesToolkit as eW, createPaperContext as eX, derivedTools as eY, floorToStep as eZ, formatToDecimals as e_, type ToolDefinition as ea, type Trade as eb, type TradeFeeEntry as ec, TradeFeeEntrySchema as ed, TradeFeeResponseSchema as ee, TradeSchema as ef, TradesResponseSchema as eg, TradingPolicy as eh, type TradingPolicyOptions as ei, type TransferType as ej, TransferTypeSchema as ek, type UniversalTransferHistoryEntry as el, UniversalTransferHistoryEntrySchema as em, type UniversalTransferHistoryResponse as en, UniversalTransferHistoryResponseSchema as eo, type UniversalTransferParams as ep, UniversalTransferParamsSchema as eq, type UniversalTransferResult as er, UniversalTransferResultSchema as es, type UserAsset as et, UserAssetSchema as eu, UserAssetsResponseSchema as ev, type UserDataAccountUpdate as ew, UserDataAccountUpdateSchema as ex, type UserDataEvent as ey, type UserDataMarginCall as ez, type AccountSnapshot as f, marketDataTools as f0, paperTools as f1, parseSpotUserDataEvent as f2, parseUserDataEvent as f3, roundToStep as f4, spotTools as f5, stepDecimals as f6, symbolRulesFrom as f7, textResult as f8, toAnthropicTool as f9, toJsonSchema as fa, toMCPTool as fb, toOpenAITool as fc, toToolList as fd, toolkitToFormats as fe, tradingTools as ff, wsTools as fg, type PaperContext as fh, type PaperEvent as fi, type PaperPosition as fj, type PaperState as fk, clearBufferedWsEvents as fl, AccountSnapshotSchema as g, type AggTrade as h, AggTradeSchema as i, AggTradesResponseSchema as j, type AlgoOrder as k, AlgoOrderResponseSchema as l, AlgoOrderSchema as m, AlgoOrdersResponseSchema as n, type ApiKeyPermissions as o, ApiKeyPermissionsSchema as p, type ApiTradingStatus as q, ApiTradingStatusSchema as r, type AssetDetail as s, AssetDetailSchema as t, type AuthMode as u, type AvgPrice as v, AvgPriceSchema as w, type Balance as x, BalanceSchema as y, BalancesResponseSchema as z };
|