@kodiak-finance/orderly-types 2.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1898 -0
- package/dist/index.d.ts +1898 -0
- package/dist/index.js +1268 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1137 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +35 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1898 @@
|
|
|
1
|
+
import * as superstruct from 'superstruct';
|
|
2
|
+
export { superstruct };
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
interface Window {
|
|
6
|
+
__ORDERLY_VERSION__?: {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
declare const _default: "2.7.4";
|
|
12
|
+
|
|
13
|
+
declare enum AccountStatusEnum {
|
|
14
|
+
EnableTradingWithoutConnected = -1,
|
|
15
|
+
NotConnected = 0,
|
|
16
|
+
Connected = 1,
|
|
17
|
+
NotSignedIn = 2,
|
|
18
|
+
SignedIn = 3,
|
|
19
|
+
DisabledTrading = 4,
|
|
20
|
+
EnableTrading = 5
|
|
21
|
+
}
|
|
22
|
+
declare enum SystemStateEnum {
|
|
23
|
+
Loading = 0,
|
|
24
|
+
Error = 1,
|
|
25
|
+
Ready = 10
|
|
26
|
+
}
|
|
27
|
+
declare enum ExchangeStatusEnum {
|
|
28
|
+
Normal = 0,
|
|
29
|
+
Maintain = 1
|
|
30
|
+
}
|
|
31
|
+
type NetworkId = "testnet" | "mainnet";
|
|
32
|
+
declare enum NetworkStatusEnum {
|
|
33
|
+
unknown = 0,
|
|
34
|
+
unsupported = 1,
|
|
35
|
+
supported = 2
|
|
36
|
+
}
|
|
37
|
+
declare const ARBITRUM_TESTNET_CHAINID = 421614;
|
|
38
|
+
declare const SOLANA_TESTNET_CHAINID = 901901901;
|
|
39
|
+
declare const SOLANA_MAINNET_CHAINID = 900900900;
|
|
40
|
+
declare const STORY_TESTNET_CHAINID = 1516;
|
|
41
|
+
declare const MONAD_TESTNET_CHAINID = 10143;
|
|
42
|
+
declare const ABSTRACT_TESTNET_CHAINID = 11124;
|
|
43
|
+
declare const ABSTRACT_MAINNET_CHAINID = 2741;
|
|
44
|
+
declare const BSC_TESTNET_CHAINID = 97;
|
|
45
|
+
declare const ABSTRACT_CHAIN_ID_MAP: Set<number>;
|
|
46
|
+
declare const ARBITRUM_TESTNET_CHAINID_HEX = "0x66EEE";
|
|
47
|
+
declare const MANTLE_TESTNET_CHAINID = 5003;
|
|
48
|
+
declare const MANTLE_TESTNET_CHAINID_HEX = "0x138b";
|
|
49
|
+
declare const ARBITRUM_MAINNET_CHAINID = 42161;
|
|
50
|
+
declare const ETHEREUM_MAINNET_CHAINID = 1;
|
|
51
|
+
declare const ARBITRUM_MAINNET_CHAINID_HEX = "0xa4b1";
|
|
52
|
+
declare const MEDIA_TABLET = "(max-width: 768px)";
|
|
53
|
+
declare const DEPOSIT_FEE_RATE = 1.05;
|
|
54
|
+
/**
|
|
55
|
+
* A constant for the maximum value for a ``uint256``.
|
|
56
|
+
*/
|
|
57
|
+
declare const MaxUint256: bigint;
|
|
58
|
+
declare const nativeTokenAddress = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
59
|
+
declare const nativeETHAddress = "0x0000000000000000000000000000000000000000";
|
|
60
|
+
declare const isNativeTokenChecker: (address: string) => address is "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" | "0x0000000000000000000000000000000000000000";
|
|
61
|
+
declare const ArbitrumSepoliaChainInfo: {
|
|
62
|
+
name: string;
|
|
63
|
+
public_rpc_url: string;
|
|
64
|
+
chain_id: string;
|
|
65
|
+
currency_symbol: string;
|
|
66
|
+
currency_decimal: number;
|
|
67
|
+
explorer_base_url: string;
|
|
68
|
+
vault_address: string;
|
|
69
|
+
};
|
|
70
|
+
declare const AbstractTestnetChainInfo: {
|
|
71
|
+
name: string;
|
|
72
|
+
public_rpc_url: string;
|
|
73
|
+
chain_id: string;
|
|
74
|
+
currency_symbol: string;
|
|
75
|
+
currency_decimal: number;
|
|
76
|
+
explorer_base_url: string;
|
|
77
|
+
vault_address: string;
|
|
78
|
+
};
|
|
79
|
+
declare const AbstractTestnetTokenInfo: {
|
|
80
|
+
chain_id: string;
|
|
81
|
+
contract_address: string;
|
|
82
|
+
decimals: number;
|
|
83
|
+
withdrawal_fee: number;
|
|
84
|
+
cross_chain_withdrawal_fee: number;
|
|
85
|
+
display_name: string;
|
|
86
|
+
};
|
|
87
|
+
declare const SolanaDevnetChainInfo: {
|
|
88
|
+
chain_id: string;
|
|
89
|
+
currency_decimal: number;
|
|
90
|
+
currency_symbol: string;
|
|
91
|
+
explorer_base_url: string;
|
|
92
|
+
name: string;
|
|
93
|
+
public_rpc_url: string;
|
|
94
|
+
vault_address: string;
|
|
95
|
+
};
|
|
96
|
+
declare const SolanaDevnetTokenInfo: {
|
|
97
|
+
chain_id: string;
|
|
98
|
+
contract_address: string;
|
|
99
|
+
decimals: number;
|
|
100
|
+
withdrawal_fee: number;
|
|
101
|
+
cross_chain_withdrawal_fee: number;
|
|
102
|
+
display_name: string;
|
|
103
|
+
};
|
|
104
|
+
declare const ArbitrumSepoliaTokenInfo: {
|
|
105
|
+
chain_id: string;
|
|
106
|
+
contract_address: string;
|
|
107
|
+
decimals: number;
|
|
108
|
+
withdrawal_fee: number;
|
|
109
|
+
cross_chain_withdrawal_fee: number;
|
|
110
|
+
display_name: string;
|
|
111
|
+
};
|
|
112
|
+
declare const TesntTokenFallback: (testnetTokens: any) => {
|
|
113
|
+
token: string;
|
|
114
|
+
token_hash: string;
|
|
115
|
+
decimals: number;
|
|
116
|
+
minimum_withdraw_amount: number;
|
|
117
|
+
chain_details: any;
|
|
118
|
+
}[];
|
|
119
|
+
declare const EMPTY_LIST: ReadonlyArray<any>;
|
|
120
|
+
declare const EMPTY_OBJECT: Readonly<Record<PropertyKey, any>>;
|
|
121
|
+
declare const EMPTY_OPERATION: () => void;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Supported types for placing an order
|
|
125
|
+
*/
|
|
126
|
+
declare enum OrderType {
|
|
127
|
+
LIMIT = "LIMIT",
|
|
128
|
+
MARKET = "MARKET",
|
|
129
|
+
IOC = "IOC",
|
|
130
|
+
FOK = "FOK",
|
|
131
|
+
POST_ONLY = "POST_ONLY",
|
|
132
|
+
ASK = "ASK",
|
|
133
|
+
BID = "BID",
|
|
134
|
+
STOP_LIMIT = "STOP_LIMIT",
|
|
135
|
+
STOP_MARKET = "STOP_MARKET",
|
|
136
|
+
/**
|
|
137
|
+
* Only for POSITIONAL_TP_SL type algo order
|
|
138
|
+
*/
|
|
139
|
+
CLOSE_POSITION = "CLOSE_POSITION",
|
|
140
|
+
/**
|
|
141
|
+
* Scaled order
|
|
142
|
+
*/
|
|
143
|
+
SCALED = "SCALED",
|
|
144
|
+
/**
|
|
145
|
+
* trailing stop
|
|
146
|
+
*/
|
|
147
|
+
TRAILING_STOP = "TRAILING_STOP"
|
|
148
|
+
}
|
|
149
|
+
declare enum BBOOrderType {
|
|
150
|
+
COUNTERPARTY1 = "counterparty1",
|
|
151
|
+
COUNTERPARTY5 = "counterparty5",
|
|
152
|
+
QUEUE1 = "queue1",
|
|
153
|
+
QUEUE5 = "queue5"
|
|
154
|
+
}
|
|
155
|
+
declare enum OrderLevel {
|
|
156
|
+
ONE = 0,
|
|
157
|
+
TWO = 1,
|
|
158
|
+
THREE = 2,
|
|
159
|
+
FOUR = 3,
|
|
160
|
+
FIVE = 4
|
|
161
|
+
}
|
|
162
|
+
declare enum AlgoOrderRootType {
|
|
163
|
+
TP_SL = "TP_SL",
|
|
164
|
+
POSITIONAL_TP_SL = "POSITIONAL_TP_SL",
|
|
165
|
+
STOP = "STOP",
|
|
166
|
+
BRACKET = "BRACKET",
|
|
167
|
+
TRAILING_STOP = "TRAILING_STOP"
|
|
168
|
+
}
|
|
169
|
+
declare enum TriggerPriceType {
|
|
170
|
+
MARK_PRICE = "MARK_PRICE"
|
|
171
|
+
}
|
|
172
|
+
declare enum PositionType {
|
|
173
|
+
FULL = "FULL",
|
|
174
|
+
PARTIAL = "PARTIAL"
|
|
175
|
+
}
|
|
176
|
+
declare enum AlgoOrderType {
|
|
177
|
+
TAKE_PROFIT = "TAKE_PROFIT",
|
|
178
|
+
STOP_LOSS = "STOP_LOSS"
|
|
179
|
+
}
|
|
180
|
+
declare enum OrderSide {
|
|
181
|
+
BUY = "BUY",
|
|
182
|
+
SELL = "SELL"
|
|
183
|
+
}
|
|
184
|
+
declare enum PositionSide {
|
|
185
|
+
LONG = "LONG",
|
|
186
|
+
SHORT = "SHORT"
|
|
187
|
+
}
|
|
188
|
+
declare enum OrderStatus {
|
|
189
|
+
/** @deprecated */
|
|
190
|
+
OPEN = "OPEN",
|
|
191
|
+
NEW = "NEW",
|
|
192
|
+
FILLED = "FILLED",
|
|
193
|
+
PARTIAL_FILLED = "PARTIAL_FILLED",
|
|
194
|
+
CANCELLED = "CANCELLED",
|
|
195
|
+
REPLACED = "REPLACED",
|
|
196
|
+
COMPLETED = "COMPLETED",
|
|
197
|
+
INCOMPLETE = "INCOMPLETE",
|
|
198
|
+
REJECTED = "REJECTED"
|
|
199
|
+
}
|
|
200
|
+
interface OrderExt {
|
|
201
|
+
total: string;
|
|
202
|
+
}
|
|
203
|
+
interface BaseOrder {
|
|
204
|
+
symbol: string;
|
|
205
|
+
order_type: OrderType;
|
|
206
|
+
order_type_ext?: OrderType;
|
|
207
|
+
order_price: string;
|
|
208
|
+
order_quantity: string;
|
|
209
|
+
order_amount?: number;
|
|
210
|
+
visible_quantity: number;
|
|
211
|
+
side: OrderSide;
|
|
212
|
+
reduce_only: boolean;
|
|
213
|
+
slippage: number;
|
|
214
|
+
order_tag: string;
|
|
215
|
+
level: OrderLevel;
|
|
216
|
+
post_only_adjust: boolean;
|
|
217
|
+
/** custom order id, it is used to identify the order from ws */
|
|
218
|
+
client_order_id: string;
|
|
219
|
+
}
|
|
220
|
+
/** Scaled order fields */
|
|
221
|
+
interface ScaledOrder {
|
|
222
|
+
/** user-defined price at the first order (index 0) */
|
|
223
|
+
start_price?: string;
|
|
224
|
+
/** user-defined price at the last order (index total_orders - 1) */
|
|
225
|
+
end_price?: string;
|
|
226
|
+
/** total number of orders */
|
|
227
|
+
total_orders?: string;
|
|
228
|
+
/** quantity distribution type */
|
|
229
|
+
distribution_type?: DistributionType;
|
|
230
|
+
/** the ratio of qty[end] / qty[start] */
|
|
231
|
+
skew?: string;
|
|
232
|
+
}
|
|
233
|
+
declare enum TrailingCallbackType {
|
|
234
|
+
VALUE = "value",
|
|
235
|
+
RATE = "rate"
|
|
236
|
+
}
|
|
237
|
+
interface RegularOrder extends BaseOrder, OrderExt, ScaledOrder, TrailingStopOrder {
|
|
238
|
+
}
|
|
239
|
+
interface AlgoOrder extends BaseOrder, OrderExt {
|
|
240
|
+
quantity: string;
|
|
241
|
+
type: OrderType;
|
|
242
|
+
price: string;
|
|
243
|
+
algo_type: AlgoOrderRootType;
|
|
244
|
+
trigger_price_type: string;
|
|
245
|
+
trigger_price: string;
|
|
246
|
+
child_orders: AlgoOrderChildOrders[];
|
|
247
|
+
}
|
|
248
|
+
interface BracketOrder extends AlgoOrder, OrderExt {
|
|
249
|
+
/**
|
|
250
|
+
* Computed take profit
|
|
251
|
+
*/
|
|
252
|
+
position_type?: PositionType;
|
|
253
|
+
tp_enable?: boolean;
|
|
254
|
+
sl_enable?: boolean;
|
|
255
|
+
tp_pnl?: string;
|
|
256
|
+
tp_offset?: string;
|
|
257
|
+
tp_offset_percentage?: string;
|
|
258
|
+
tp_ROI?: string;
|
|
259
|
+
tp_trigger_price?: string;
|
|
260
|
+
tp_order_price?: string;
|
|
261
|
+
tp_order_type?: OrderType;
|
|
262
|
+
/**
|
|
263
|
+
* Computed stop loss
|
|
264
|
+
*/
|
|
265
|
+
sl_pnl?: string;
|
|
266
|
+
sl_offset?: string;
|
|
267
|
+
sl_offset_percentage?: string;
|
|
268
|
+
sl_ROI?: string;
|
|
269
|
+
sl_trigger_price?: string;
|
|
270
|
+
sl_order_price?: string;
|
|
271
|
+
sl_order_type?: OrderType;
|
|
272
|
+
}
|
|
273
|
+
type OrderlyOrder = RegularOrder & AlgoOrder & BracketOrder;
|
|
274
|
+
interface AlgoOrderChildOrders {
|
|
275
|
+
symbol: string;
|
|
276
|
+
algo_type: string;
|
|
277
|
+
child_orders: ChildOrder[];
|
|
278
|
+
}
|
|
279
|
+
interface ChildOrder {
|
|
280
|
+
symbol: string;
|
|
281
|
+
algo_type: AlgoOrderType;
|
|
282
|
+
side: string;
|
|
283
|
+
type: OrderType;
|
|
284
|
+
trigger_price: string;
|
|
285
|
+
price?: string;
|
|
286
|
+
reduce_only: boolean;
|
|
287
|
+
trigger_price_type?: string;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Trailing Stop that allows users to set an activation price and a trailing amount (value / rate).
|
|
291
|
+
* The order is only activated when the market reaches the activation price,
|
|
292
|
+
* after which the trailing stop logic tracks the extreme price and triggers when the price retraces by the specified trailing amount.
|
|
293
|
+
*/
|
|
294
|
+
interface TrailingStopOrder {
|
|
295
|
+
/**
|
|
296
|
+
* activated price
|
|
297
|
+
*/
|
|
298
|
+
activated_price?: string;
|
|
299
|
+
/**
|
|
300
|
+
* i.e. the value = 100
|
|
301
|
+
*/
|
|
302
|
+
callback_value?: string;
|
|
303
|
+
/**
|
|
304
|
+
* i.e. the value = 0.1 represent to 10%
|
|
305
|
+
*/
|
|
306
|
+
callback_rate?: string;
|
|
307
|
+
}
|
|
308
|
+
interface TrailingStopOrder {
|
|
309
|
+
activated_price?: string;
|
|
310
|
+
callback_value?: string;
|
|
311
|
+
callback_rate?: string;
|
|
312
|
+
}
|
|
313
|
+
interface OrderEntity extends ScaledOrder, TrailingStopOrder {
|
|
314
|
+
symbol: string;
|
|
315
|
+
order_type: OrderType;
|
|
316
|
+
algo_type?: AlgoOrderRootType;
|
|
317
|
+
order_type_ext?: OrderType;
|
|
318
|
+
order_price?: string;
|
|
319
|
+
order_quantity?: string;
|
|
320
|
+
order_amount?: number;
|
|
321
|
+
visible_quantity?: number;
|
|
322
|
+
reduce_only?: boolean;
|
|
323
|
+
side: OrderSide;
|
|
324
|
+
broker_id?: string;
|
|
325
|
+
slippage?: number;
|
|
326
|
+
total?: string;
|
|
327
|
+
isStopOrder?: boolean;
|
|
328
|
+
trigger_price?: string;
|
|
329
|
+
order_tag?: string;
|
|
330
|
+
client_order_id?: string;
|
|
331
|
+
level?: OrderLevel;
|
|
332
|
+
}
|
|
333
|
+
declare enum DistributionType {
|
|
334
|
+
FLAT = "flat",
|
|
335
|
+
ASCENDING = "ascending",
|
|
336
|
+
DESCENDING = "descending",
|
|
337
|
+
CUSTOM = "custom"
|
|
338
|
+
}
|
|
339
|
+
type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
340
|
+
type RequireKeys<T extends object, K extends keyof T> = Required<Pick<T, K>> & Partial<Omit<T, K>>;
|
|
341
|
+
interface BaseAlgoOrderEntity<T extends AlgoOrderRootType> extends OrderEntity {
|
|
342
|
+
algo_type: AlgoOrderRootType;
|
|
343
|
+
child_orders: (Partial<Omit<AlgoOrderEntity<T>, "algo_type" | "type">> & {
|
|
344
|
+
algo_type: AlgoOrderType;
|
|
345
|
+
type: OrderType;
|
|
346
|
+
child_orders?: BaseAlgoOrderEntity<T>["child_orders"];
|
|
347
|
+
})[];
|
|
348
|
+
algo_order_id?: number;
|
|
349
|
+
client_order_id?: string;
|
|
350
|
+
order_tag?: string;
|
|
351
|
+
price?: number | string;
|
|
352
|
+
quantity: number | string;
|
|
353
|
+
reduce_only?: boolean;
|
|
354
|
+
side: OrderSide;
|
|
355
|
+
symbol: string;
|
|
356
|
+
trigger_price: string;
|
|
357
|
+
trigger_price_type: TriggerPriceType;
|
|
358
|
+
type: OrderType;
|
|
359
|
+
visible_quantity?: number;
|
|
360
|
+
is_activated?: boolean;
|
|
361
|
+
tp_trigger_price?: string | number;
|
|
362
|
+
sl_trigger_price?: string | number;
|
|
363
|
+
tp_order_price?: string | number;
|
|
364
|
+
tp_order_type?: OrderType;
|
|
365
|
+
sl_order_price?: string | number;
|
|
366
|
+
sl_order_type?: OrderType;
|
|
367
|
+
tp_enable?: boolean;
|
|
368
|
+
sl_enable?: boolean;
|
|
369
|
+
position_type?: PositionType;
|
|
370
|
+
}
|
|
371
|
+
type AlgoOrderEntity<T extends AlgoOrderRootType = AlgoOrderRootType.STOP> = T extends AlgoOrderRootType.TP_SL ? Optional<BaseAlgoOrderEntity<T>, "side" | "type" | "trigger_price" | "order_type"> : T extends AlgoOrderRootType.POSITIONAL_TP_SL ? Optional<BaseAlgoOrderEntity<T>, "side" | "type" | "trigger_price" | "order_type" | "quantity" | "tp_enable" | "sl_enable" | "tp_order_price" | "tp_order_type" | "sl_order_price" | "sl_order_type" | "position_type"> : Omit<BaseAlgoOrderEntity<T>, "child_orders" | "order_type">;
|
|
372
|
+
type TPSLOrderEntry = Optional<AlgoOrderEntity<AlgoOrderRootType.TP_SL>, "side" | "type" | "trigger_price">;
|
|
373
|
+
type BracketOrderEntry = Optional<AlgoOrderEntity<AlgoOrderRootType.BRACKET>, "side">;
|
|
374
|
+
|
|
375
|
+
declare enum AnnouncementType {
|
|
376
|
+
Listing = "LISTING",
|
|
377
|
+
Maintenance = "MAINTENANCE",
|
|
378
|
+
Delisting = "DELISTING"
|
|
379
|
+
}
|
|
380
|
+
declare namespace API {
|
|
381
|
+
interface ConvertThreshold {
|
|
382
|
+
ltv_threshold: number;
|
|
383
|
+
negative_usdc_threshold: number;
|
|
384
|
+
}
|
|
385
|
+
interface Token {
|
|
386
|
+
token: string;
|
|
387
|
+
token_hash: string;
|
|
388
|
+
decimals: number;
|
|
389
|
+
minimum_withdraw_amount: number;
|
|
390
|
+
chain_details: ChainDetail[];
|
|
391
|
+
}
|
|
392
|
+
interface ChainDetail {
|
|
393
|
+
chain_id: string;
|
|
394
|
+
contract_address: string;
|
|
395
|
+
decimals: number;
|
|
396
|
+
}
|
|
397
|
+
interface MarketInfo {
|
|
398
|
+
symbol: string;
|
|
399
|
+
index_price: number;
|
|
400
|
+
mark_price: number;
|
|
401
|
+
sum_unitary_funding: number;
|
|
402
|
+
est_funding_rate: number;
|
|
403
|
+
last_funding_rate: number;
|
|
404
|
+
next_funding_time: number;
|
|
405
|
+
open_interest: string;
|
|
406
|
+
"24h_open": number;
|
|
407
|
+
"24h_close": number;
|
|
408
|
+
"24h_high": number;
|
|
409
|
+
"24h_low": number;
|
|
410
|
+
/**
|
|
411
|
+
* @deprecated
|
|
412
|
+
* spelling mistake, use 24h_volume to instead, will be remove next version
|
|
413
|
+
*/
|
|
414
|
+
"24h_volumn": number;
|
|
415
|
+
"24h_volume": number;
|
|
416
|
+
"24h_amount": number;
|
|
417
|
+
}
|
|
418
|
+
interface MarketInfoExt extends MarketInfo {
|
|
419
|
+
change: number;
|
|
420
|
+
"24h_volume": number;
|
|
421
|
+
}
|
|
422
|
+
interface AnnouncementRow {
|
|
423
|
+
announcement_id: number | string;
|
|
424
|
+
message: string;
|
|
425
|
+
i18n?: Record<PropertyKey, string | null>;
|
|
426
|
+
url?: string | null;
|
|
427
|
+
type?: AnnouncementType | null;
|
|
428
|
+
updated_time?: number | null;
|
|
429
|
+
}
|
|
430
|
+
interface Announcement {
|
|
431
|
+
last_updated_time?: number | null;
|
|
432
|
+
rows?: AnnouncementRow[];
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* v1/public/info
|
|
436
|
+
*/
|
|
437
|
+
interface Symbol {
|
|
438
|
+
symbol: string;
|
|
439
|
+
quote_min: number;
|
|
440
|
+
quote_max: number;
|
|
441
|
+
quote_tick: number;
|
|
442
|
+
base_min: number;
|
|
443
|
+
base_max: number;
|
|
444
|
+
base_tick: number;
|
|
445
|
+
min_notional: number;
|
|
446
|
+
price_range: number;
|
|
447
|
+
price_scope: number;
|
|
448
|
+
std_liquidation_fee: number;
|
|
449
|
+
liquidator_fee: number;
|
|
450
|
+
claim_insurance_fund_discount: number;
|
|
451
|
+
funding_period: number;
|
|
452
|
+
cap_funding: number;
|
|
453
|
+
floor_funding: number;
|
|
454
|
+
interest_rate: number;
|
|
455
|
+
created_time: number;
|
|
456
|
+
updated_time: number;
|
|
457
|
+
imr_factor: number;
|
|
458
|
+
base_mmr: number;
|
|
459
|
+
base_imr: number;
|
|
460
|
+
}
|
|
461
|
+
interface TokenItem {
|
|
462
|
+
token: string;
|
|
463
|
+
token_hash: string;
|
|
464
|
+
decimals: number;
|
|
465
|
+
minimum_withdraw_amount: number;
|
|
466
|
+
chain_details: ChainDetail[];
|
|
467
|
+
}
|
|
468
|
+
interface ChainDetail {
|
|
469
|
+
chain_id: string;
|
|
470
|
+
contract_address: string;
|
|
471
|
+
decimals: number;
|
|
472
|
+
withdrawal_fee: number;
|
|
473
|
+
}
|
|
474
|
+
interface SymbolExt extends Symbol {
|
|
475
|
+
base: string;
|
|
476
|
+
base_dp: number;
|
|
477
|
+
quote: string;
|
|
478
|
+
quote_dp: number;
|
|
479
|
+
type: string;
|
|
480
|
+
name: string;
|
|
481
|
+
}
|
|
482
|
+
interface Order {
|
|
483
|
+
symbol: string;
|
|
484
|
+
status: string;
|
|
485
|
+
side: string;
|
|
486
|
+
order_id: number;
|
|
487
|
+
algo_order_id?: number;
|
|
488
|
+
user_id: number;
|
|
489
|
+
price: number | null;
|
|
490
|
+
type: string;
|
|
491
|
+
quantity: number;
|
|
492
|
+
amount: null;
|
|
493
|
+
visible: number;
|
|
494
|
+
executed: number;
|
|
495
|
+
total_fee: number;
|
|
496
|
+
fee_asset: string;
|
|
497
|
+
client_order_id?: string;
|
|
498
|
+
average_executed_price: number;
|
|
499
|
+
total_executed_quantity: number;
|
|
500
|
+
visible_quantity: number;
|
|
501
|
+
created_time: number;
|
|
502
|
+
updated_time: number;
|
|
503
|
+
reduce_only: boolean;
|
|
504
|
+
trigger_price?: number;
|
|
505
|
+
order_tag?: string;
|
|
506
|
+
}
|
|
507
|
+
interface OrderExt extends Order {
|
|
508
|
+
mark_price: string;
|
|
509
|
+
}
|
|
510
|
+
interface AlgoOrder {
|
|
511
|
+
algo_order_id: number;
|
|
512
|
+
root_algo_order_id: number;
|
|
513
|
+
parent_algo_order_id: number;
|
|
514
|
+
parent_algo_type: AlgoOrderRootType;
|
|
515
|
+
symbol: string;
|
|
516
|
+
algo_type: string;
|
|
517
|
+
child_orders: AlgoOrder[];
|
|
518
|
+
side: string;
|
|
519
|
+
quantity: number;
|
|
520
|
+
is_triggered: boolean;
|
|
521
|
+
is_activated: boolean;
|
|
522
|
+
trigger_price: number;
|
|
523
|
+
trigger_price_type: string;
|
|
524
|
+
type: OrderType;
|
|
525
|
+
root_algo_status: string;
|
|
526
|
+
algo_status: string;
|
|
527
|
+
price?: number;
|
|
528
|
+
total_executed_quantity: number;
|
|
529
|
+
visible_quantity: number;
|
|
530
|
+
total_fee: number;
|
|
531
|
+
fee_asset: string;
|
|
532
|
+
reduce_only: boolean;
|
|
533
|
+
created_time: number;
|
|
534
|
+
updated_time: number;
|
|
535
|
+
order_tag?: string;
|
|
536
|
+
client_order_id?: string;
|
|
537
|
+
activated_price?: number;
|
|
538
|
+
callback_value?: number;
|
|
539
|
+
callback_rate?: number;
|
|
540
|
+
extreme_price?: number;
|
|
541
|
+
}
|
|
542
|
+
interface AlgoOrderExt extends AlgoOrder {
|
|
543
|
+
mark_price: string;
|
|
544
|
+
position?: Partial<Position>;
|
|
545
|
+
tp_trigger_price?: number;
|
|
546
|
+
sl_trigger_price?: number;
|
|
547
|
+
}
|
|
548
|
+
interface OrderResponse {
|
|
549
|
+
rows: (Order | AlgoOrder)[];
|
|
550
|
+
meta: {
|
|
551
|
+
total: number;
|
|
552
|
+
current_page: number;
|
|
553
|
+
records_per_page: number;
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
interface FundingRate {
|
|
557
|
+
symbol: string;
|
|
558
|
+
est_funding_rate: number;
|
|
559
|
+
est_funding_rate_timestamp: number;
|
|
560
|
+
last_funding_rate: number;
|
|
561
|
+
last_funding_rate_timestamp: number;
|
|
562
|
+
next_funding_time: number;
|
|
563
|
+
sum_unitary_funding: number;
|
|
564
|
+
}
|
|
565
|
+
interface FundingPeriodData {
|
|
566
|
+
rate: number;
|
|
567
|
+
positive: number;
|
|
568
|
+
negative: number;
|
|
569
|
+
}
|
|
570
|
+
interface FundingDetails {
|
|
571
|
+
symbol: string;
|
|
572
|
+
quote_min: number;
|
|
573
|
+
quote_max: number;
|
|
574
|
+
quote_tick: number;
|
|
575
|
+
base_min: number;
|
|
576
|
+
base_max: number;
|
|
577
|
+
base_tick: number;
|
|
578
|
+
min_notional: number;
|
|
579
|
+
price_range: number;
|
|
580
|
+
price_scope: number;
|
|
581
|
+
std_liquidation_fee: number;
|
|
582
|
+
liquidator_fee: number;
|
|
583
|
+
claim_insurance_fund_discount: number;
|
|
584
|
+
funding_period: number;
|
|
585
|
+
cap_funding: number;
|
|
586
|
+
floor_funding: number;
|
|
587
|
+
interest_rate: number;
|
|
588
|
+
created_time: number;
|
|
589
|
+
updated_time: number;
|
|
590
|
+
liquidation_tier: number;
|
|
591
|
+
cap_ir: number;
|
|
592
|
+
floor_ir: number;
|
|
593
|
+
mark_index_price_deviation_floor: number;
|
|
594
|
+
mark_index_price_deviation_cap: number;
|
|
595
|
+
global_max_oi_cap: number;
|
|
596
|
+
base_mmr: number;
|
|
597
|
+
base_imr: number;
|
|
598
|
+
imr_factor: number;
|
|
599
|
+
deviation_factor: number;
|
|
600
|
+
}
|
|
601
|
+
interface FundingHistory {
|
|
602
|
+
symbol: string;
|
|
603
|
+
data_start_time: string;
|
|
604
|
+
funding: {
|
|
605
|
+
last: FundingPeriodData;
|
|
606
|
+
"1d": FundingPeriodData;
|
|
607
|
+
"3d": FundingPeriodData;
|
|
608
|
+
"7d": FundingPeriodData;
|
|
609
|
+
"14d": FundingPeriodData;
|
|
610
|
+
"30d": FundingPeriodData;
|
|
611
|
+
"90d": FundingPeriodData;
|
|
612
|
+
};
|
|
613
|
+
}
|
|
614
|
+
interface PositionInfo extends PositionAggregated {
|
|
615
|
+
rows: Position[];
|
|
616
|
+
}
|
|
617
|
+
interface PositionAggregated {
|
|
618
|
+
margin_ratio: number;
|
|
619
|
+
initial_margin_ratio: number;
|
|
620
|
+
maintenance_margin_ratio: number;
|
|
621
|
+
open_margin_ratio: number;
|
|
622
|
+
current_margin_ratio_with_orders: number;
|
|
623
|
+
initial_margin_ratio_with_orders: number;
|
|
624
|
+
maintenance_margin_ratio_with_orders: number;
|
|
625
|
+
total_collateral_value: number;
|
|
626
|
+
free_collateral: number;
|
|
627
|
+
total_pnl_24_h: number;
|
|
628
|
+
/**
|
|
629
|
+
* @deprecated use total_unreal_pnl instead
|
|
630
|
+
*/
|
|
631
|
+
unrealPnL: number;
|
|
632
|
+
total_unreal_pnl: number;
|
|
633
|
+
total_unreal_pnl_index?: number;
|
|
634
|
+
/**
|
|
635
|
+
* @deprecated use total_unsettled_pnl instead
|
|
636
|
+
*/
|
|
637
|
+
unsettledPnL: number;
|
|
638
|
+
total_unsettled_pnl: number;
|
|
639
|
+
notional: number;
|
|
640
|
+
unrealPnlROI: number;
|
|
641
|
+
unrealPnlROI_index?: number;
|
|
642
|
+
}
|
|
643
|
+
interface Position {
|
|
644
|
+
account_id?: string;
|
|
645
|
+
symbol: string;
|
|
646
|
+
position_qty: number;
|
|
647
|
+
cost_position: number;
|
|
648
|
+
last_sum_unitary_funding: number;
|
|
649
|
+
pending_long_qty: number;
|
|
650
|
+
pending_short_qty: number;
|
|
651
|
+
settle_price: number;
|
|
652
|
+
average_open_price: number;
|
|
653
|
+
unrealized_pnl: number;
|
|
654
|
+
unrealized_pnl_index?: number;
|
|
655
|
+
unrealized_pnl_ROI: number;
|
|
656
|
+
unsettled_pnl: number;
|
|
657
|
+
unsettled_pnl_ROI: number;
|
|
658
|
+
unrealized_pnl_ROI_index?: number;
|
|
659
|
+
mark_price: number;
|
|
660
|
+
index_price?: number;
|
|
661
|
+
est_liq_price: number | null;
|
|
662
|
+
timestamp: number;
|
|
663
|
+
/**
|
|
664
|
+
* Maintenance margin ratio
|
|
665
|
+
*/
|
|
666
|
+
mmr: number;
|
|
667
|
+
imr: number;
|
|
668
|
+
IMR_withdraw_orders: number;
|
|
669
|
+
MMR_with_orders: number;
|
|
670
|
+
pnl_24_h: number;
|
|
671
|
+
fee_24_h: number;
|
|
672
|
+
fundingFee?: number;
|
|
673
|
+
leverage: number;
|
|
674
|
+
}
|
|
675
|
+
interface PositionExt extends Position {
|
|
676
|
+
notional: number;
|
|
677
|
+
mm: number;
|
|
678
|
+
}
|
|
679
|
+
interface PositionTPSLExt extends PositionExt {
|
|
680
|
+
full_tp_sl?: {
|
|
681
|
+
tp_trigger_price?: number;
|
|
682
|
+
sl_trigger_price?: number;
|
|
683
|
+
algo_order?: AlgoOrder;
|
|
684
|
+
};
|
|
685
|
+
partial_tp_sl?: {
|
|
686
|
+
tp_trigger_price?: number;
|
|
687
|
+
sl_trigger_price?: number;
|
|
688
|
+
order_num?: number;
|
|
689
|
+
algo_order?: AlgoOrder;
|
|
690
|
+
};
|
|
691
|
+
/**
|
|
692
|
+
* related position tp/sl order
|
|
693
|
+
*/
|
|
694
|
+
algo_order?: AlgoOrder;
|
|
695
|
+
}
|
|
696
|
+
interface PositionsTPSLExt extends PositionAggregated {
|
|
697
|
+
rows: PositionTPSLExt[];
|
|
698
|
+
}
|
|
699
|
+
interface Trade {
|
|
700
|
+
symbol: Symbol;
|
|
701
|
+
side: OrderSide;
|
|
702
|
+
ts: number;
|
|
703
|
+
executed_price: number;
|
|
704
|
+
executed_quantity: number;
|
|
705
|
+
executed_timestamp: number;
|
|
706
|
+
}
|
|
707
|
+
interface Holding {
|
|
708
|
+
token: string;
|
|
709
|
+
holding: number;
|
|
710
|
+
frozen: number;
|
|
711
|
+
pending_short: number;
|
|
712
|
+
updated_time: number;
|
|
713
|
+
}
|
|
714
|
+
interface AccountInfo {
|
|
715
|
+
account_id: string;
|
|
716
|
+
email: string;
|
|
717
|
+
account_mode: string;
|
|
718
|
+
tier: string;
|
|
719
|
+
futures_tier: string;
|
|
720
|
+
maintenance_cancel_orders: boolean;
|
|
721
|
+
taker_fee_rate: number;
|
|
722
|
+
maker_fee_rate: number;
|
|
723
|
+
max_leverage: number;
|
|
724
|
+
futures_taker_fee_rate: number;
|
|
725
|
+
futures_maker_fee_rate: number;
|
|
726
|
+
imr_factor: {
|
|
727
|
+
[key: string]: number;
|
|
728
|
+
};
|
|
729
|
+
max_notional: {
|
|
730
|
+
[key: string]: number;
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
interface Chain {
|
|
734
|
+
dexs: string[];
|
|
735
|
+
network_infos: NetworkInfos;
|
|
736
|
+
token_infos: TokenInfo[];
|
|
737
|
+
nativeToken?: TokenInfo;
|
|
738
|
+
address?: string;
|
|
739
|
+
symbol?: string;
|
|
740
|
+
on_chain_swap?: boolean;
|
|
741
|
+
}
|
|
742
|
+
interface NetworkInfos {
|
|
743
|
+
name: string;
|
|
744
|
+
shortName: string;
|
|
745
|
+
public_rpc_url: string;
|
|
746
|
+
chain_id: number;
|
|
747
|
+
currency_symbol: string;
|
|
748
|
+
bridge_enable: boolean;
|
|
749
|
+
mainnet: boolean;
|
|
750
|
+
est_txn_mins: number | null;
|
|
751
|
+
explorer_base_url: string;
|
|
752
|
+
bridgeless?: boolean;
|
|
753
|
+
withdrawal_fee?: number;
|
|
754
|
+
minimum_withdraw_amount?: number;
|
|
755
|
+
vault_address: string;
|
|
756
|
+
currency_decimal?: number;
|
|
757
|
+
cross_chain_router: string;
|
|
758
|
+
depositor: string;
|
|
759
|
+
}
|
|
760
|
+
interface TokenInfo {
|
|
761
|
+
address?: string;
|
|
762
|
+
base_weight: number;
|
|
763
|
+
decimals?: number;
|
|
764
|
+
/** token decimals */
|
|
765
|
+
token_decimal?: number;
|
|
766
|
+
discount_factor?: number | null;
|
|
767
|
+
display_name?: string;
|
|
768
|
+
haircut: number;
|
|
769
|
+
is_collateral: boolean;
|
|
770
|
+
symbol?: string;
|
|
771
|
+
user_max_qty: number;
|
|
772
|
+
precision?: number;
|
|
773
|
+
minimum_withdraw_amount: number;
|
|
774
|
+
swap_enable?: boolean;
|
|
775
|
+
}
|
|
776
|
+
interface Chain {
|
|
777
|
+
token: string;
|
|
778
|
+
token_hash: string;
|
|
779
|
+
decimals: number;
|
|
780
|
+
minimum_withdraw_amount: number;
|
|
781
|
+
base_weight: number;
|
|
782
|
+
discount_factor?: number | null;
|
|
783
|
+
haircut: number;
|
|
784
|
+
user_max_qty: number;
|
|
785
|
+
is_collateral: boolean;
|
|
786
|
+
chain_details: ChainDetail[];
|
|
787
|
+
}
|
|
788
|
+
interface ChainDetail {
|
|
789
|
+
chain_id: string;
|
|
790
|
+
chain_name?: string;
|
|
791
|
+
contract_address: string;
|
|
792
|
+
decimals: number;
|
|
793
|
+
withdrawal_fee: number;
|
|
794
|
+
cross_chain_withdrawal_fee: number;
|
|
795
|
+
display_name: string;
|
|
796
|
+
}
|
|
797
|
+
interface AssetHistory {
|
|
798
|
+
meta: RecordsMeta;
|
|
799
|
+
rows: AssetHistoryRow[];
|
|
800
|
+
}
|
|
801
|
+
interface RecordsMeta {
|
|
802
|
+
total: number;
|
|
803
|
+
records_per_page: number;
|
|
804
|
+
current_page: number;
|
|
805
|
+
}
|
|
806
|
+
interface AssetHistoryRow {
|
|
807
|
+
id: string;
|
|
808
|
+
tx_id: string;
|
|
809
|
+
side: string;
|
|
810
|
+
token: string;
|
|
811
|
+
amount: number;
|
|
812
|
+
fee: number;
|
|
813
|
+
trans_status: string;
|
|
814
|
+
created_time: number;
|
|
815
|
+
updated_time: number;
|
|
816
|
+
chain_id: string;
|
|
817
|
+
}
|
|
818
|
+
interface FundingFeeHistory {
|
|
819
|
+
meta: RecordsMeta;
|
|
820
|
+
rows: FundingFeeRow[];
|
|
821
|
+
}
|
|
822
|
+
interface FundingFeeRow {
|
|
823
|
+
symbol: string;
|
|
824
|
+
funding_rate: number;
|
|
825
|
+
mark_price: number;
|
|
826
|
+
funding_fee: number;
|
|
827
|
+
payment_type: string;
|
|
828
|
+
status: string;
|
|
829
|
+
created_time: number;
|
|
830
|
+
updated_time: number;
|
|
831
|
+
}
|
|
832
|
+
interface StrategyVaultHistoryRow {
|
|
833
|
+
vault_id: string;
|
|
834
|
+
created_time: number;
|
|
835
|
+
type: "withdrawal" | "deposit";
|
|
836
|
+
status: string;
|
|
837
|
+
amount_change: number;
|
|
838
|
+
token?: string;
|
|
839
|
+
vaultName?: string;
|
|
840
|
+
}
|
|
841
|
+
interface StrategyVaultHistory {
|
|
842
|
+
rows: StrategyVaultHistoryRow[];
|
|
843
|
+
meta: RecordsMeta;
|
|
844
|
+
}
|
|
845
|
+
interface TransferHistoryRow {
|
|
846
|
+
amount: number;
|
|
847
|
+
created_time: number;
|
|
848
|
+
from_account_id: string;
|
|
849
|
+
id: string;
|
|
850
|
+
status: "CREATED" | "PENDING" | "COMPLETED" | "FAILED";
|
|
851
|
+
to_account_id: string;
|
|
852
|
+
token: string;
|
|
853
|
+
updated_time: number;
|
|
854
|
+
chain_id: string;
|
|
855
|
+
block_time: number;
|
|
856
|
+
}
|
|
857
|
+
interface TransferHistory {
|
|
858
|
+
meta: RecordsMeta;
|
|
859
|
+
rows: TransferHistoryRow[];
|
|
860
|
+
}
|
|
861
|
+
interface TransferHistoryRow {
|
|
862
|
+
amount: number;
|
|
863
|
+
created_time: number;
|
|
864
|
+
from_account_id: string;
|
|
865
|
+
id: string;
|
|
866
|
+
status: "CREATED" | "PENDING" | "COMPLETED" | "FAILED";
|
|
867
|
+
to_account_id: string;
|
|
868
|
+
token: string;
|
|
869
|
+
updated_time: number;
|
|
870
|
+
}
|
|
871
|
+
interface DailyRow {
|
|
872
|
+
account_value: number;
|
|
873
|
+
broker_id: string;
|
|
874
|
+
date: string;
|
|
875
|
+
perp_volume: number;
|
|
876
|
+
pnl: number;
|
|
877
|
+
snapshot_time?: number;
|
|
878
|
+
}
|
|
879
|
+
interface PositionHistory {
|
|
880
|
+
position_id: number;
|
|
881
|
+
liquidation_id?: number;
|
|
882
|
+
position_status: string;
|
|
883
|
+
type: string;
|
|
884
|
+
symbol: string;
|
|
885
|
+
avg_open_price: number;
|
|
886
|
+
avg_close_price: number;
|
|
887
|
+
max_position_qty: number;
|
|
888
|
+
closed_position_qty: number;
|
|
889
|
+
side: "LONG" | "SHORT";
|
|
890
|
+
trading_fee: number;
|
|
891
|
+
accumulated_funding_fee: number;
|
|
892
|
+
insurance_fund_fee: number;
|
|
893
|
+
liquidator_fee: number;
|
|
894
|
+
realized_pnl: number;
|
|
895
|
+
open_timestamp: number;
|
|
896
|
+
close_timestamp: number;
|
|
897
|
+
last_update_time: number;
|
|
898
|
+
leverage: number;
|
|
899
|
+
}
|
|
900
|
+
interface LiquidationPositionByPerp {
|
|
901
|
+
abs_liquidation_fee: number;
|
|
902
|
+
cost_position_transfer: number;
|
|
903
|
+
liquidator_fee: number;
|
|
904
|
+
position_qty: number;
|
|
905
|
+
symbol: string;
|
|
906
|
+
transfer_price: number;
|
|
907
|
+
mark_price: number;
|
|
908
|
+
}
|
|
909
|
+
interface Liquidation {
|
|
910
|
+
liquidation_id: number;
|
|
911
|
+
timestamp: number;
|
|
912
|
+
transfer_amount_to_insurance_fund: number;
|
|
913
|
+
margin_ratio: number;
|
|
914
|
+
account_mmr: number;
|
|
915
|
+
collateral_value: number;
|
|
916
|
+
position_notional: number;
|
|
917
|
+
positions_by_perp: LiquidationPositionByPerp[];
|
|
918
|
+
}
|
|
919
|
+
interface VaultBalance {
|
|
920
|
+
chain_id: string;
|
|
921
|
+
token: string;
|
|
922
|
+
balance: number;
|
|
923
|
+
pending_rebalance: number;
|
|
924
|
+
}
|
|
925
|
+
interface RestrictedAreas {
|
|
926
|
+
invalid_web_country: string;
|
|
927
|
+
invalid_web_city: string;
|
|
928
|
+
}
|
|
929
|
+
interface IpInfo {
|
|
930
|
+
ip: string;
|
|
931
|
+
city: string;
|
|
932
|
+
region: string;
|
|
933
|
+
checked: boolean;
|
|
934
|
+
}
|
|
935
|
+
interface LeverageInfo {
|
|
936
|
+
symbol: string;
|
|
937
|
+
leverage: number;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
declare namespace WSMessage {
|
|
941
|
+
interface Ticker {
|
|
942
|
+
symbol: string;
|
|
943
|
+
open: number;
|
|
944
|
+
close: number;
|
|
945
|
+
high: number;
|
|
946
|
+
low: number;
|
|
947
|
+
volume: number;
|
|
948
|
+
amount: number;
|
|
949
|
+
count: number;
|
|
950
|
+
change: number;
|
|
951
|
+
open_interest?: number;
|
|
952
|
+
index_price?: number;
|
|
953
|
+
}
|
|
954
|
+
interface MarkPrice {
|
|
955
|
+
symbol: string;
|
|
956
|
+
price: number;
|
|
957
|
+
}
|
|
958
|
+
interface Position {
|
|
959
|
+
symbol: string;
|
|
960
|
+
positionQty: number;
|
|
961
|
+
costPosition: number;
|
|
962
|
+
lastSumUnitaryFunding: number;
|
|
963
|
+
sumUnitaryFundingVersion: number;
|
|
964
|
+
pendingLongQty: number;
|
|
965
|
+
pendingShortQty: number;
|
|
966
|
+
settlePrice: number;
|
|
967
|
+
averageOpenPrice: number;
|
|
968
|
+
unsettledPnl: number;
|
|
969
|
+
pnl24H: number;
|
|
970
|
+
fee24H: number;
|
|
971
|
+
markPrice: number;
|
|
972
|
+
estLiqPrice: number;
|
|
973
|
+
version: number;
|
|
974
|
+
imr: number;
|
|
975
|
+
imrwithOrders: number;
|
|
976
|
+
mmrwithOrders: number;
|
|
977
|
+
mmr: number;
|
|
978
|
+
}
|
|
979
|
+
interface VaultBalance {
|
|
980
|
+
chain_id: string;
|
|
981
|
+
token: string;
|
|
982
|
+
balance: number;
|
|
983
|
+
pending_rebalance: number;
|
|
984
|
+
}
|
|
985
|
+
interface Order {
|
|
986
|
+
symbol: string;
|
|
987
|
+
clientOrderId: string;
|
|
988
|
+
orderId: number;
|
|
989
|
+
type: string;
|
|
990
|
+
side: string;
|
|
991
|
+
quantity: number;
|
|
992
|
+
price: number;
|
|
993
|
+
tradeId: number;
|
|
994
|
+
executedPrice: number;
|
|
995
|
+
executedQuantity: number;
|
|
996
|
+
fee: number;
|
|
997
|
+
feeAsset: string;
|
|
998
|
+
totalExecutedQuantity: number;
|
|
999
|
+
avgPrice: number;
|
|
1000
|
+
status: string;
|
|
1001
|
+
reason: string;
|
|
1002
|
+
totalFee: number;
|
|
1003
|
+
visible: number;
|
|
1004
|
+
/**
|
|
1005
|
+
* update time
|
|
1006
|
+
*/
|
|
1007
|
+
timestamp: number;
|
|
1008
|
+
reduceOnly: boolean;
|
|
1009
|
+
maker: boolean;
|
|
1010
|
+
}
|
|
1011
|
+
interface Holding {
|
|
1012
|
+
holding: number;
|
|
1013
|
+
frozen: number;
|
|
1014
|
+
interest: number;
|
|
1015
|
+
pendingShortQty: number;
|
|
1016
|
+
pendingExposure: number;
|
|
1017
|
+
pendingLongQty: number;
|
|
1018
|
+
pendingLongExposure: number;
|
|
1019
|
+
version: number;
|
|
1020
|
+
staked: number;
|
|
1021
|
+
unbonding: number;
|
|
1022
|
+
vault: number;
|
|
1023
|
+
fee24H: number;
|
|
1024
|
+
markPrice: number;
|
|
1025
|
+
}
|
|
1026
|
+
interface AlgoOrder {
|
|
1027
|
+
symbol: string;
|
|
1028
|
+
rootAlgoOrderId: number;
|
|
1029
|
+
parentAlgoOrderId: number;
|
|
1030
|
+
algoOrderId: number;
|
|
1031
|
+
status: string;
|
|
1032
|
+
algoType: string;
|
|
1033
|
+
side: string;
|
|
1034
|
+
quantity: number;
|
|
1035
|
+
triggerStatus: string;
|
|
1036
|
+
price: number;
|
|
1037
|
+
type: string;
|
|
1038
|
+
triggerTradePrice: number;
|
|
1039
|
+
triggerTime: number;
|
|
1040
|
+
tradeId: number;
|
|
1041
|
+
executedPrice: number;
|
|
1042
|
+
executedQuantity: number;
|
|
1043
|
+
fee: number;
|
|
1044
|
+
feeAsset: string;
|
|
1045
|
+
totalExecutedQuantity: number;
|
|
1046
|
+
averageExecutedPrice: number;
|
|
1047
|
+
totalFee: number;
|
|
1048
|
+
timestamp: number;
|
|
1049
|
+
visibleQuantity: number;
|
|
1050
|
+
reduceOnly: boolean;
|
|
1051
|
+
triggered: boolean;
|
|
1052
|
+
maker: boolean;
|
|
1053
|
+
rootAlgoStatus: string;
|
|
1054
|
+
algoStatus: string;
|
|
1055
|
+
}
|
|
1056
|
+
interface Announcement {
|
|
1057
|
+
announcement_id: string;
|
|
1058
|
+
message: string;
|
|
1059
|
+
i18n: Record<PropertyKey, string | null>;
|
|
1060
|
+
url?: string | null;
|
|
1061
|
+
type: AnnouncementType | null;
|
|
1062
|
+
updated_time: number;
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
declare enum WithdrawStatus {
|
|
1067
|
+
NotSupported = "NotSupported",
|
|
1068
|
+
NotConnected = "NotConnected",
|
|
1069
|
+
Unsettle = "Unsettle",
|
|
1070
|
+
InsufficientBalance = "InsufficientBalance",
|
|
1071
|
+
Normal = "Normal"
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
interface Chain {
|
|
1075
|
+
id: number;
|
|
1076
|
+
chainNameShort: string;
|
|
1077
|
+
chainLogo: string;
|
|
1078
|
+
chainInfo: ChainInfo;
|
|
1079
|
+
minGasBalance: number;
|
|
1080
|
+
minCrossGasBalance: number;
|
|
1081
|
+
maxPrepayCrossGas: number;
|
|
1082
|
+
blockExplorerName: string;
|
|
1083
|
+
chainName: string;
|
|
1084
|
+
requestRpc: string;
|
|
1085
|
+
}
|
|
1086
|
+
interface ChainInfo {
|
|
1087
|
+
chainId: string;
|
|
1088
|
+
chainName: string;
|
|
1089
|
+
nativeCurrency: NativeCurrency;
|
|
1090
|
+
rpcUrls: string[];
|
|
1091
|
+
blockExplorerUrls: string[];
|
|
1092
|
+
}
|
|
1093
|
+
interface NativeCurrency {
|
|
1094
|
+
name: string;
|
|
1095
|
+
symbol: string;
|
|
1096
|
+
decimals: number;
|
|
1097
|
+
fix: number;
|
|
1098
|
+
}
|
|
1099
|
+
declare const Ethereum: {
|
|
1100
|
+
chainNameShort: string;
|
|
1101
|
+
id: number;
|
|
1102
|
+
chainLogo: string;
|
|
1103
|
+
chainInfo: {
|
|
1104
|
+
chainId: string;
|
|
1105
|
+
chainName: string;
|
|
1106
|
+
nativeCurrency: {
|
|
1107
|
+
name: string;
|
|
1108
|
+
symbol: string;
|
|
1109
|
+
decimals: number;
|
|
1110
|
+
fix: number;
|
|
1111
|
+
};
|
|
1112
|
+
rpcUrls: string[];
|
|
1113
|
+
blockExplorerUrls: string[];
|
|
1114
|
+
};
|
|
1115
|
+
minGasBalance: number;
|
|
1116
|
+
minCrossGasBalance: number;
|
|
1117
|
+
maxPrepayCrossGas: number;
|
|
1118
|
+
blockExplorerName: string;
|
|
1119
|
+
chainName: string;
|
|
1120
|
+
requestRpc: string;
|
|
1121
|
+
};
|
|
1122
|
+
declare const Avalanche: {
|
|
1123
|
+
id: number;
|
|
1124
|
+
chainInfo: {
|
|
1125
|
+
chainId: string;
|
|
1126
|
+
chainName: string;
|
|
1127
|
+
nativeCurrency: {
|
|
1128
|
+
name: string;
|
|
1129
|
+
symbol: string;
|
|
1130
|
+
decimals: number;
|
|
1131
|
+
fix: number;
|
|
1132
|
+
};
|
|
1133
|
+
rpcUrls: string[];
|
|
1134
|
+
blockExplorerUrls: string[];
|
|
1135
|
+
};
|
|
1136
|
+
minGasBalance: number;
|
|
1137
|
+
minCrossGasBalance: number;
|
|
1138
|
+
maxPrepayCrossGas: number;
|
|
1139
|
+
blockExplorerName: string;
|
|
1140
|
+
chainName: string;
|
|
1141
|
+
chainNameShort: string;
|
|
1142
|
+
chainLogo: string;
|
|
1143
|
+
requestRpc: string;
|
|
1144
|
+
};
|
|
1145
|
+
declare const Fuji: {
|
|
1146
|
+
id: number;
|
|
1147
|
+
chainInfo: {
|
|
1148
|
+
chainId: string;
|
|
1149
|
+
chainName: string;
|
|
1150
|
+
nativeCurrency: {
|
|
1151
|
+
name: string;
|
|
1152
|
+
symbol: string;
|
|
1153
|
+
decimals: number;
|
|
1154
|
+
fix: number;
|
|
1155
|
+
};
|
|
1156
|
+
rpcUrls: string[];
|
|
1157
|
+
blockExplorerUrls: string[];
|
|
1158
|
+
};
|
|
1159
|
+
minGasBalance: number;
|
|
1160
|
+
minCrossGasBalance: number;
|
|
1161
|
+
maxPrepayCrossGas: number;
|
|
1162
|
+
blockExplorerName: string;
|
|
1163
|
+
chainName: string;
|
|
1164
|
+
chainNameShort: string;
|
|
1165
|
+
chainLogo: string;
|
|
1166
|
+
requestRpc: string;
|
|
1167
|
+
};
|
|
1168
|
+
declare const BNB: {
|
|
1169
|
+
id: number;
|
|
1170
|
+
chainInfo: {
|
|
1171
|
+
chainId: string;
|
|
1172
|
+
chainName: string;
|
|
1173
|
+
nativeCurrency: {
|
|
1174
|
+
name: string;
|
|
1175
|
+
symbol: string;
|
|
1176
|
+
decimals: number;
|
|
1177
|
+
fix: number;
|
|
1178
|
+
};
|
|
1179
|
+
rpcUrls: string[];
|
|
1180
|
+
blockExplorerUrls: string[];
|
|
1181
|
+
};
|
|
1182
|
+
minGasBalance: number;
|
|
1183
|
+
minCrossGasBalance: number;
|
|
1184
|
+
maxPrepayCrossGas: number;
|
|
1185
|
+
blockExplorerName: string;
|
|
1186
|
+
chainName: string;
|
|
1187
|
+
chainNameShort: string;
|
|
1188
|
+
requestRpc: string;
|
|
1189
|
+
chainLogo: string;
|
|
1190
|
+
};
|
|
1191
|
+
declare const Fantom: {
|
|
1192
|
+
id: number;
|
|
1193
|
+
chainInfo: {
|
|
1194
|
+
chainId: string;
|
|
1195
|
+
chainName: string;
|
|
1196
|
+
nativeCurrency: {
|
|
1197
|
+
name: string;
|
|
1198
|
+
symbol: string;
|
|
1199
|
+
decimals: number;
|
|
1200
|
+
fix: number;
|
|
1201
|
+
};
|
|
1202
|
+
rpcUrls: string[];
|
|
1203
|
+
blockExplorerUrls: string[];
|
|
1204
|
+
};
|
|
1205
|
+
minGasBalance: number;
|
|
1206
|
+
minCrossGasBalance: number;
|
|
1207
|
+
maxPrepayCrossGas: number;
|
|
1208
|
+
blockExplorerName: string;
|
|
1209
|
+
chainName: string;
|
|
1210
|
+
chainNameShort: string;
|
|
1211
|
+
chainLogo: string;
|
|
1212
|
+
requestRpc: string;
|
|
1213
|
+
};
|
|
1214
|
+
declare const Polygon: {
|
|
1215
|
+
id: number;
|
|
1216
|
+
chainInfo: {
|
|
1217
|
+
chainId: string;
|
|
1218
|
+
chainName: string;
|
|
1219
|
+
nativeCurrency: {
|
|
1220
|
+
name: string;
|
|
1221
|
+
symbol: string;
|
|
1222
|
+
decimals: number;
|
|
1223
|
+
fix: number;
|
|
1224
|
+
};
|
|
1225
|
+
rpcUrls: string[];
|
|
1226
|
+
blockExplorerUrls: string[];
|
|
1227
|
+
};
|
|
1228
|
+
minGasBalance: number;
|
|
1229
|
+
minCrossGasBalance: number;
|
|
1230
|
+
maxPrepayCrossGas: number;
|
|
1231
|
+
blockExplorerName: string;
|
|
1232
|
+
chainName: string;
|
|
1233
|
+
chainNameShort: string;
|
|
1234
|
+
requestRpc: string;
|
|
1235
|
+
chainLogo: string;
|
|
1236
|
+
};
|
|
1237
|
+
declare const Arbitrum: {
|
|
1238
|
+
id: number;
|
|
1239
|
+
chainInfo: {
|
|
1240
|
+
chainId: string;
|
|
1241
|
+
chainName: string;
|
|
1242
|
+
nativeCurrency: {
|
|
1243
|
+
name: string;
|
|
1244
|
+
symbol: string;
|
|
1245
|
+
decimals: number;
|
|
1246
|
+
fix: number;
|
|
1247
|
+
};
|
|
1248
|
+
rpcUrls: string[];
|
|
1249
|
+
blockExplorerUrls: string[];
|
|
1250
|
+
};
|
|
1251
|
+
minGasBalance: number;
|
|
1252
|
+
minCrossGasBalance: number;
|
|
1253
|
+
maxPrepayCrossGas: number;
|
|
1254
|
+
blockExplorerName: string;
|
|
1255
|
+
chainName: string;
|
|
1256
|
+
chainNameShort: string;
|
|
1257
|
+
requestRpc: string;
|
|
1258
|
+
chainLogo: string;
|
|
1259
|
+
};
|
|
1260
|
+
declare const Optimism: {
|
|
1261
|
+
id: number;
|
|
1262
|
+
chainInfo: {
|
|
1263
|
+
chainId: string;
|
|
1264
|
+
chainName: string;
|
|
1265
|
+
nativeCurrency: {
|
|
1266
|
+
name: string;
|
|
1267
|
+
symbol: string;
|
|
1268
|
+
decimals: number;
|
|
1269
|
+
fix: number;
|
|
1270
|
+
};
|
|
1271
|
+
rpcUrls: string[];
|
|
1272
|
+
blockExplorerUrls: string[];
|
|
1273
|
+
};
|
|
1274
|
+
minGasBalance: number;
|
|
1275
|
+
minCrossGasBalance: number;
|
|
1276
|
+
maxPrepayCrossGas: number;
|
|
1277
|
+
blockExplorerName: string;
|
|
1278
|
+
chainName: string;
|
|
1279
|
+
chainNameShort: string;
|
|
1280
|
+
requestRpc: string;
|
|
1281
|
+
chainLogo: string;
|
|
1282
|
+
};
|
|
1283
|
+
declare const zkSyncEra: {
|
|
1284
|
+
id: number;
|
|
1285
|
+
chainInfo: {
|
|
1286
|
+
chainId: string;
|
|
1287
|
+
chainName: string;
|
|
1288
|
+
nativeCurrency: {
|
|
1289
|
+
name: string;
|
|
1290
|
+
symbol: string;
|
|
1291
|
+
decimals: number;
|
|
1292
|
+
fix: number;
|
|
1293
|
+
};
|
|
1294
|
+
rpcUrls: string[];
|
|
1295
|
+
blockExplorerUrls: string[];
|
|
1296
|
+
};
|
|
1297
|
+
minGasBalance: number;
|
|
1298
|
+
minCrossGasBalance: number;
|
|
1299
|
+
maxPrepayCrossGas: number;
|
|
1300
|
+
blockExplorerName: string;
|
|
1301
|
+
chainName: string;
|
|
1302
|
+
chainNameShort: string;
|
|
1303
|
+
requestRpc: string;
|
|
1304
|
+
chainLogo: string;
|
|
1305
|
+
};
|
|
1306
|
+
declare const PolygonzkEVM: {
|
|
1307
|
+
id: number;
|
|
1308
|
+
chainInfo: {
|
|
1309
|
+
chainId: string;
|
|
1310
|
+
chainName: string;
|
|
1311
|
+
nativeCurrency: {
|
|
1312
|
+
name: string;
|
|
1313
|
+
symbol: string;
|
|
1314
|
+
decimals: number;
|
|
1315
|
+
fix: number;
|
|
1316
|
+
};
|
|
1317
|
+
rpcUrls: string[];
|
|
1318
|
+
blockExplorerUrls: string[];
|
|
1319
|
+
};
|
|
1320
|
+
minGasBalance: number;
|
|
1321
|
+
minCrossGasBalance: number;
|
|
1322
|
+
maxPrepayCrossGas: number;
|
|
1323
|
+
blockExplorerName: string;
|
|
1324
|
+
chainName: string;
|
|
1325
|
+
chainNameShort: string;
|
|
1326
|
+
requestRpc: string;
|
|
1327
|
+
chainLogo: string;
|
|
1328
|
+
};
|
|
1329
|
+
declare const Linea: {
|
|
1330
|
+
id: number;
|
|
1331
|
+
chainInfo: {
|
|
1332
|
+
chainId: string;
|
|
1333
|
+
chainName: string;
|
|
1334
|
+
nativeCurrency: {
|
|
1335
|
+
name: string;
|
|
1336
|
+
symbol: string;
|
|
1337
|
+
decimals: number;
|
|
1338
|
+
fix: number;
|
|
1339
|
+
};
|
|
1340
|
+
rpcUrls: string[];
|
|
1341
|
+
blockExplorerUrls: string[];
|
|
1342
|
+
};
|
|
1343
|
+
minGasBalance: number;
|
|
1344
|
+
minCrossGasBalance: number;
|
|
1345
|
+
maxPrepayCrossGas: number;
|
|
1346
|
+
blockExplorerName: string;
|
|
1347
|
+
chainName: string;
|
|
1348
|
+
chainNameShort: string;
|
|
1349
|
+
requestRpc: string;
|
|
1350
|
+
chainLogo: string;
|
|
1351
|
+
};
|
|
1352
|
+
declare const Base: {
|
|
1353
|
+
id: number;
|
|
1354
|
+
chainInfo: {
|
|
1355
|
+
chainId: string;
|
|
1356
|
+
chainName: string;
|
|
1357
|
+
nativeCurrency: {
|
|
1358
|
+
name: string;
|
|
1359
|
+
symbol: string;
|
|
1360
|
+
decimals: number;
|
|
1361
|
+
fix: number;
|
|
1362
|
+
};
|
|
1363
|
+
rpcUrls: string[];
|
|
1364
|
+
blockExplorerUrls: string[];
|
|
1365
|
+
};
|
|
1366
|
+
minGasBalance: number;
|
|
1367
|
+
minCrossGasBalance: number;
|
|
1368
|
+
maxPrepayCrossGas: number;
|
|
1369
|
+
blockExplorerName: string;
|
|
1370
|
+
chainName: string;
|
|
1371
|
+
chainNameShort: string;
|
|
1372
|
+
requestRpc: string;
|
|
1373
|
+
chainLogo: string;
|
|
1374
|
+
};
|
|
1375
|
+
declare const Mantle: {
|
|
1376
|
+
id: number;
|
|
1377
|
+
chainInfo: {
|
|
1378
|
+
chainId: string;
|
|
1379
|
+
chainName: string;
|
|
1380
|
+
nativeCurrency: {
|
|
1381
|
+
name: string;
|
|
1382
|
+
symbol: string;
|
|
1383
|
+
decimals: number;
|
|
1384
|
+
fix: number;
|
|
1385
|
+
};
|
|
1386
|
+
rpcUrls: string[];
|
|
1387
|
+
blockExplorerUrls: string[];
|
|
1388
|
+
};
|
|
1389
|
+
minGasBalance: number;
|
|
1390
|
+
minCrossGasBalance: number;
|
|
1391
|
+
maxPrepayCrossGas: number;
|
|
1392
|
+
blockExplorerName: string;
|
|
1393
|
+
chainName: string;
|
|
1394
|
+
chainNameShort: string;
|
|
1395
|
+
requestRpc: string;
|
|
1396
|
+
chainLogo: string;
|
|
1397
|
+
};
|
|
1398
|
+
declare const ArbitrumGoerli: {
|
|
1399
|
+
id: number;
|
|
1400
|
+
chainInfo: {
|
|
1401
|
+
chainId: string;
|
|
1402
|
+
chainName: string;
|
|
1403
|
+
nativeCurrency: {
|
|
1404
|
+
name: string;
|
|
1405
|
+
symbol: string;
|
|
1406
|
+
decimals: number;
|
|
1407
|
+
fix: number;
|
|
1408
|
+
};
|
|
1409
|
+
rpcUrls: string[];
|
|
1410
|
+
blockExplorerUrls: string[];
|
|
1411
|
+
};
|
|
1412
|
+
minGasBalance: number;
|
|
1413
|
+
minCrossGasBalance: number;
|
|
1414
|
+
maxPrepayCrossGas: number;
|
|
1415
|
+
blockExplorerName: string;
|
|
1416
|
+
chainName: string;
|
|
1417
|
+
chainNameShort: string;
|
|
1418
|
+
requestRpc: string;
|
|
1419
|
+
chainLogo: string;
|
|
1420
|
+
};
|
|
1421
|
+
declare const ArbitrumSepolia: {
|
|
1422
|
+
id: number;
|
|
1423
|
+
chainInfo: {
|
|
1424
|
+
chainId: string;
|
|
1425
|
+
chainName: string;
|
|
1426
|
+
nativeCurrency: {
|
|
1427
|
+
name: string;
|
|
1428
|
+
symbol: string;
|
|
1429
|
+
decimals: number;
|
|
1430
|
+
fix: number;
|
|
1431
|
+
};
|
|
1432
|
+
rpcUrls: string[];
|
|
1433
|
+
blockExplorerUrls: string[];
|
|
1434
|
+
};
|
|
1435
|
+
minGasBalance: number;
|
|
1436
|
+
minCrossGasBalance: number;
|
|
1437
|
+
maxPrepayCrossGas: number;
|
|
1438
|
+
blockExplorerName: string;
|
|
1439
|
+
chainName: string;
|
|
1440
|
+
chainNameShort: string;
|
|
1441
|
+
requestRpc: string;
|
|
1442
|
+
chainLogo: string;
|
|
1443
|
+
};
|
|
1444
|
+
declare const OptimismGoerli: {
|
|
1445
|
+
id: number;
|
|
1446
|
+
chainInfo: {
|
|
1447
|
+
chainId: string;
|
|
1448
|
+
chainName: string;
|
|
1449
|
+
nativeCurrency: {
|
|
1450
|
+
name: string;
|
|
1451
|
+
symbol: string;
|
|
1452
|
+
decimals: number;
|
|
1453
|
+
fix: number;
|
|
1454
|
+
};
|
|
1455
|
+
rpcUrls: string[];
|
|
1456
|
+
blockExplorerUrls: string[];
|
|
1457
|
+
};
|
|
1458
|
+
minGasBalance: number;
|
|
1459
|
+
minCrossGasBalance: number;
|
|
1460
|
+
maxPrepayCrossGas: number;
|
|
1461
|
+
blockExplorerName: string;
|
|
1462
|
+
chainName: string;
|
|
1463
|
+
chainNameShort: string;
|
|
1464
|
+
requestRpc: string;
|
|
1465
|
+
chainLogo: string;
|
|
1466
|
+
};
|
|
1467
|
+
declare const OptimismSepolia: {
|
|
1468
|
+
id: number;
|
|
1469
|
+
chainInfo: {
|
|
1470
|
+
chainId: string;
|
|
1471
|
+
chainName: string;
|
|
1472
|
+
nativeCurrency: {
|
|
1473
|
+
name: string;
|
|
1474
|
+
symbol: string;
|
|
1475
|
+
decimals: number;
|
|
1476
|
+
fix: number;
|
|
1477
|
+
};
|
|
1478
|
+
rpcUrls: string[];
|
|
1479
|
+
blockExplorerUrls: string[];
|
|
1480
|
+
};
|
|
1481
|
+
minGasBalance: number;
|
|
1482
|
+
minCrossGasBalance: number;
|
|
1483
|
+
maxPrepayCrossGas: number;
|
|
1484
|
+
blockExplorerName: string;
|
|
1485
|
+
chainName: string;
|
|
1486
|
+
chainNameShort: string;
|
|
1487
|
+
requestRpc: string;
|
|
1488
|
+
chainLogo: string;
|
|
1489
|
+
};
|
|
1490
|
+
declare const BaseSepolia: {
|
|
1491
|
+
id: number;
|
|
1492
|
+
chainInfo: {
|
|
1493
|
+
chainId: string;
|
|
1494
|
+
chainName: string;
|
|
1495
|
+
nativeCurrency: {
|
|
1496
|
+
name: string;
|
|
1497
|
+
symbol: string;
|
|
1498
|
+
decimals: number;
|
|
1499
|
+
fix: number;
|
|
1500
|
+
};
|
|
1501
|
+
rpcUrls: string[];
|
|
1502
|
+
blockExplorerUrls: string[];
|
|
1503
|
+
};
|
|
1504
|
+
minGasBalance: number;
|
|
1505
|
+
minCrossGasBalance: number;
|
|
1506
|
+
maxPrepayCrossGas: number;
|
|
1507
|
+
blockExplorerName: string;
|
|
1508
|
+
chainName: string;
|
|
1509
|
+
chainNameShort: string;
|
|
1510
|
+
requestRpc: string;
|
|
1511
|
+
chainLogo: string;
|
|
1512
|
+
};
|
|
1513
|
+
declare const MantleSepolia: {
|
|
1514
|
+
id: number;
|
|
1515
|
+
chainInfo: {
|
|
1516
|
+
chainId: string;
|
|
1517
|
+
chainName: string;
|
|
1518
|
+
nativeCurrency: {
|
|
1519
|
+
name: string;
|
|
1520
|
+
symbol: string;
|
|
1521
|
+
decimals: number;
|
|
1522
|
+
fix: number;
|
|
1523
|
+
};
|
|
1524
|
+
rpcUrls: string[];
|
|
1525
|
+
blockExplorerUrls: string[];
|
|
1526
|
+
};
|
|
1527
|
+
minGasBalance: number;
|
|
1528
|
+
minCrossGasBalance: number;
|
|
1529
|
+
maxPrepayCrossGas: number;
|
|
1530
|
+
blockExplorerName: string;
|
|
1531
|
+
chainName: string;
|
|
1532
|
+
chainNameShort: string;
|
|
1533
|
+
requestRpc: string;
|
|
1534
|
+
chainLogo: string;
|
|
1535
|
+
};
|
|
1536
|
+
declare const PolygonAmoy: {
|
|
1537
|
+
id: number;
|
|
1538
|
+
chainInfo: {
|
|
1539
|
+
chainId: string;
|
|
1540
|
+
chainName: string;
|
|
1541
|
+
nativeCurrency: {
|
|
1542
|
+
name: string;
|
|
1543
|
+
symbol: string;
|
|
1544
|
+
decimals: number;
|
|
1545
|
+
fix: number;
|
|
1546
|
+
};
|
|
1547
|
+
rpcUrls: string[];
|
|
1548
|
+
blockExplorerUrls: string[];
|
|
1549
|
+
};
|
|
1550
|
+
minGasBalance: number;
|
|
1551
|
+
minCrossGasBalance: number;
|
|
1552
|
+
maxPrepayCrossGas: number;
|
|
1553
|
+
blockExplorerName: string;
|
|
1554
|
+
chainName: string;
|
|
1555
|
+
chainNameShort: string;
|
|
1556
|
+
requestRpc: string;
|
|
1557
|
+
chainLogo: string;
|
|
1558
|
+
};
|
|
1559
|
+
declare const Sei: {
|
|
1560
|
+
id: number;
|
|
1561
|
+
chainInfo: {
|
|
1562
|
+
chainId: string;
|
|
1563
|
+
chainName: string;
|
|
1564
|
+
nativeCurrency: {
|
|
1565
|
+
name: string;
|
|
1566
|
+
symbol: string;
|
|
1567
|
+
decimals: number;
|
|
1568
|
+
fix: number;
|
|
1569
|
+
};
|
|
1570
|
+
rpcUrls: string[];
|
|
1571
|
+
blockExplorerUrls: string[];
|
|
1572
|
+
};
|
|
1573
|
+
minGasBalance: number;
|
|
1574
|
+
minCrossGasBalance: number;
|
|
1575
|
+
maxPrepayCrossGas: number;
|
|
1576
|
+
blockExplorerName: string;
|
|
1577
|
+
chainName: string;
|
|
1578
|
+
chainNameShort: string;
|
|
1579
|
+
requestRpc: string;
|
|
1580
|
+
chainLogo: string;
|
|
1581
|
+
};
|
|
1582
|
+
declare const StoryTestnet: {
|
|
1583
|
+
name: string;
|
|
1584
|
+
public_rpc_url: string;
|
|
1585
|
+
chain_id: number;
|
|
1586
|
+
currency_symbol: string;
|
|
1587
|
+
explorer_base_url: string;
|
|
1588
|
+
vault_address: string;
|
|
1589
|
+
};
|
|
1590
|
+
declare const StoryOdysseyTestnet: {
|
|
1591
|
+
id: number;
|
|
1592
|
+
chainInfo: {
|
|
1593
|
+
chainId: string;
|
|
1594
|
+
chainName: string;
|
|
1595
|
+
nativeCurrency: {
|
|
1596
|
+
name: string;
|
|
1597
|
+
symbol: string;
|
|
1598
|
+
decimals: number;
|
|
1599
|
+
fix: number;
|
|
1600
|
+
};
|
|
1601
|
+
rpcUrls: string[];
|
|
1602
|
+
blockExplorerUrls: never[];
|
|
1603
|
+
};
|
|
1604
|
+
minGasBalance: number;
|
|
1605
|
+
minCrossGasBalance: number;
|
|
1606
|
+
maxPrepayCrossGas: number;
|
|
1607
|
+
blockExplorerName: string;
|
|
1608
|
+
chainName: string;
|
|
1609
|
+
chainNameShort: string;
|
|
1610
|
+
requestRpc: string;
|
|
1611
|
+
chainLogo: string;
|
|
1612
|
+
};
|
|
1613
|
+
declare const chainsInfoMap: Map<number, Chain>;
|
|
1614
|
+
declare const SolanaDevnet: typeof Arbitrum;
|
|
1615
|
+
declare const TestnetChains: ({
|
|
1616
|
+
network_infos: {
|
|
1617
|
+
name: string;
|
|
1618
|
+
shortName: string;
|
|
1619
|
+
public_rpc_url: string;
|
|
1620
|
+
chain_id: number;
|
|
1621
|
+
currency_symbol: string;
|
|
1622
|
+
bridge_enable: boolean;
|
|
1623
|
+
mainnet: boolean;
|
|
1624
|
+
explorer_base_url: string;
|
|
1625
|
+
est_txn_mins: null;
|
|
1626
|
+
vault_address?: undefined;
|
|
1627
|
+
};
|
|
1628
|
+
token_infos: {
|
|
1629
|
+
symbol: string;
|
|
1630
|
+
address: string;
|
|
1631
|
+
decimals: number;
|
|
1632
|
+
}[];
|
|
1633
|
+
} | {
|
|
1634
|
+
network_infos: {
|
|
1635
|
+
name: string;
|
|
1636
|
+
public_rpc_url: string;
|
|
1637
|
+
chain_id: number;
|
|
1638
|
+
currency_symbol: string;
|
|
1639
|
+
explorer_base_url: string;
|
|
1640
|
+
vault_address: string;
|
|
1641
|
+
shortName?: undefined;
|
|
1642
|
+
bridge_enable?: undefined;
|
|
1643
|
+
mainnet?: undefined;
|
|
1644
|
+
est_txn_mins?: undefined;
|
|
1645
|
+
};
|
|
1646
|
+
token_infos: {
|
|
1647
|
+
symbol: string;
|
|
1648
|
+
address: string;
|
|
1649
|
+
decimals: number;
|
|
1650
|
+
}[];
|
|
1651
|
+
})[];
|
|
1652
|
+
declare const defaultMainnetChains: {
|
|
1653
|
+
id: number;
|
|
1654
|
+
chainInfo: {
|
|
1655
|
+
chainId: string;
|
|
1656
|
+
chainName: string;
|
|
1657
|
+
nativeCurrency: {
|
|
1658
|
+
name: string;
|
|
1659
|
+
symbol: string;
|
|
1660
|
+
decimals: number;
|
|
1661
|
+
fix: number;
|
|
1662
|
+
};
|
|
1663
|
+
rpcUrls: string[];
|
|
1664
|
+
blockExplorerUrls: string[];
|
|
1665
|
+
};
|
|
1666
|
+
minGasBalance: number;
|
|
1667
|
+
minCrossGasBalance: number;
|
|
1668
|
+
maxPrepayCrossGas: number;
|
|
1669
|
+
blockExplorerName: string;
|
|
1670
|
+
chainName: string;
|
|
1671
|
+
chainNameShort: string;
|
|
1672
|
+
requestRpc: string;
|
|
1673
|
+
chainLogo: string;
|
|
1674
|
+
}[];
|
|
1675
|
+
declare const defaultTestnetChains: {
|
|
1676
|
+
id: number;
|
|
1677
|
+
chainInfo: {
|
|
1678
|
+
chainId: string;
|
|
1679
|
+
chainName: string;
|
|
1680
|
+
nativeCurrency: {
|
|
1681
|
+
name: string;
|
|
1682
|
+
symbol: string;
|
|
1683
|
+
decimals: number;
|
|
1684
|
+
fix: number;
|
|
1685
|
+
};
|
|
1686
|
+
rpcUrls: string[];
|
|
1687
|
+
blockExplorerUrls: string[];
|
|
1688
|
+
};
|
|
1689
|
+
minGasBalance: number;
|
|
1690
|
+
minCrossGasBalance: number;
|
|
1691
|
+
maxPrepayCrossGas: number;
|
|
1692
|
+
blockExplorerName: string;
|
|
1693
|
+
chainName: string;
|
|
1694
|
+
chainNameShort: string;
|
|
1695
|
+
requestRpc: string;
|
|
1696
|
+
chainLogo: string;
|
|
1697
|
+
}[];
|
|
1698
|
+
declare enum ChainNamespace {
|
|
1699
|
+
evm = "EVM",
|
|
1700
|
+
solana = "SOL"
|
|
1701
|
+
}
|
|
1702
|
+
declare const AbstractChains: Set<number>;
|
|
1703
|
+
declare const SolanaChains: Set<number>;
|
|
1704
|
+
|
|
1705
|
+
declare enum TrackerEventName {
|
|
1706
|
+
/** virtual event (not send this event name to tracker) */
|
|
1707
|
+
trackIdentifyUserId = "track_identify_user_id",
|
|
1708
|
+
trackIdentify = "track_identify",
|
|
1709
|
+
trackCustomEvent = "track_custom_event",
|
|
1710
|
+
/** real event name (send this event name to tracker) */
|
|
1711
|
+
withdrawSuccess = "withdraw_request_success",
|
|
1712
|
+
withdrawFailed = "withdraw_request_failure",
|
|
1713
|
+
depositSuccess = "deposit_request_success",
|
|
1714
|
+
depositFailed = "deposit_request_failure",
|
|
1715
|
+
signinSuccess = "sign_message_success",
|
|
1716
|
+
placeOrderSuccess = "place_order_success",
|
|
1717
|
+
walletConnect = "connect_wallet_success",
|
|
1718
|
+
clickLinkDeviceButton = "click_link_device_button",
|
|
1719
|
+
signLinkDeviceMessageSuccess = "sign_link_device_message_success",
|
|
1720
|
+
linkDeviceModalClickConfirm = "link_device_modal_click_confirm",
|
|
1721
|
+
socialLoginSuccess = "social_login_success",
|
|
1722
|
+
clickSwitchNetwork = "click_switch_network",
|
|
1723
|
+
clickSwitchWallet = "click_switch_wallet",
|
|
1724
|
+
switchNetworkSuccess = "switch_network_success",
|
|
1725
|
+
clickExportPrivateKey = "click_export_private_key",
|
|
1726
|
+
switchLanguage = "switch_language",
|
|
1727
|
+
leaderboardCampaignClickTradeNow = "leaderboard_campaign_click_trade_now",
|
|
1728
|
+
leaderboardCampaignClickLearnMore = "leaderboard_campaign_click_learn_more",
|
|
1729
|
+
vaultDepositSuccess = "vault_deposit_success",
|
|
1730
|
+
vaultDepositFailed = "vault_deposit_failed",
|
|
1731
|
+
vaultWithdrawSuccess = "vault_withdraw_success",
|
|
1732
|
+
vaultWithdrawFailed = "vault_withdraw_failed",
|
|
1733
|
+
clickBBOButton = "click_bbo_button"
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
type CurrentChain = {
|
|
1737
|
+
id: number;
|
|
1738
|
+
info: API.Chain;
|
|
1739
|
+
};
|
|
1740
|
+
declare enum WS_WalletStatusEnum {
|
|
1741
|
+
NO = "NO",
|
|
1742
|
+
FAILED = "FAILED",
|
|
1743
|
+
PENDING = "PENDING",
|
|
1744
|
+
PROCESSING = "PROCESSING",
|
|
1745
|
+
COMPLETED = "COMPLETED"
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
declare const LedgerWalletKey = "orderly:ledger-wallet";
|
|
1749
|
+
declare const ConnectorKey = "orderly:connectorKey";
|
|
1750
|
+
declare const ChainKey = "order:chain";
|
|
1751
|
+
declare const LinkDeviceKey = "orderly_link_device";
|
|
1752
|
+
declare const TradingviewFullscreenKey = "orderly:tradingview-fullscreen";
|
|
1753
|
+
declare const OrderEntrySortKeys = "orderly:order_entry_sort_keys";
|
|
1754
|
+
|
|
1755
|
+
declare class ApiError extends Error {
|
|
1756
|
+
private readonly code;
|
|
1757
|
+
constructor(message: string, code: number);
|
|
1758
|
+
}
|
|
1759
|
+
declare class SDKError extends Error {
|
|
1760
|
+
constructor(message: string);
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
declare const definedTypes: {
|
|
1764
|
+
readonly EIP712Domain: readonly [{
|
|
1765
|
+
readonly name: "name";
|
|
1766
|
+
readonly type: "string";
|
|
1767
|
+
}, {
|
|
1768
|
+
readonly name: "version";
|
|
1769
|
+
readonly type: "string";
|
|
1770
|
+
}, {
|
|
1771
|
+
readonly name: "chainId";
|
|
1772
|
+
readonly type: "uint256";
|
|
1773
|
+
}, {
|
|
1774
|
+
readonly name: "verifyingContract";
|
|
1775
|
+
readonly type: "address";
|
|
1776
|
+
}];
|
|
1777
|
+
readonly Registration: readonly [{
|
|
1778
|
+
readonly name: "brokerId";
|
|
1779
|
+
readonly type: "string";
|
|
1780
|
+
}, {
|
|
1781
|
+
readonly name: "chainId";
|
|
1782
|
+
readonly type: "uint256";
|
|
1783
|
+
}, {
|
|
1784
|
+
readonly name: "timestamp";
|
|
1785
|
+
readonly type: "uint64";
|
|
1786
|
+
}, {
|
|
1787
|
+
readonly name: "registrationNonce";
|
|
1788
|
+
readonly type: "uint256";
|
|
1789
|
+
}];
|
|
1790
|
+
readonly Withdraw: readonly [{
|
|
1791
|
+
readonly name: "brokerId";
|
|
1792
|
+
readonly type: "string";
|
|
1793
|
+
}, {
|
|
1794
|
+
readonly name: "chainId";
|
|
1795
|
+
readonly type: "uint256";
|
|
1796
|
+
}, {
|
|
1797
|
+
readonly name: "receiver";
|
|
1798
|
+
readonly type: "address";
|
|
1799
|
+
}, {
|
|
1800
|
+
readonly name: "token";
|
|
1801
|
+
readonly type: "string";
|
|
1802
|
+
}, {
|
|
1803
|
+
readonly name: "amount";
|
|
1804
|
+
readonly type: "uint256";
|
|
1805
|
+
}, {
|
|
1806
|
+
readonly name: "withdrawNonce";
|
|
1807
|
+
readonly type: "uint64";
|
|
1808
|
+
}, {
|
|
1809
|
+
readonly name: "timestamp";
|
|
1810
|
+
readonly type: "uint64";
|
|
1811
|
+
}];
|
|
1812
|
+
readonly AddOrderlyKey: readonly [{
|
|
1813
|
+
readonly name: "brokerId";
|
|
1814
|
+
readonly type: "string";
|
|
1815
|
+
}, {
|
|
1816
|
+
readonly name: "chainId";
|
|
1817
|
+
readonly type: "uint256";
|
|
1818
|
+
}, {
|
|
1819
|
+
readonly name: "orderlyKey";
|
|
1820
|
+
readonly type: "string";
|
|
1821
|
+
}, {
|
|
1822
|
+
readonly name: "scope";
|
|
1823
|
+
readonly type: "string";
|
|
1824
|
+
}, {
|
|
1825
|
+
readonly name: "timestamp";
|
|
1826
|
+
readonly type: "uint64";
|
|
1827
|
+
}, {
|
|
1828
|
+
readonly name: "expiration";
|
|
1829
|
+
readonly type: "uint64";
|
|
1830
|
+
}];
|
|
1831
|
+
readonly SettlePnl: readonly [{
|
|
1832
|
+
readonly name: "brokerId";
|
|
1833
|
+
readonly type: "string";
|
|
1834
|
+
}, {
|
|
1835
|
+
readonly name: "chainId";
|
|
1836
|
+
readonly type: "uint256";
|
|
1837
|
+
}, {
|
|
1838
|
+
readonly name: "settleNonce";
|
|
1839
|
+
readonly type: "uint64";
|
|
1840
|
+
}, {
|
|
1841
|
+
readonly name: "timestamp";
|
|
1842
|
+
readonly type: "uint64";
|
|
1843
|
+
}];
|
|
1844
|
+
readonly DexRequest: readonly [{
|
|
1845
|
+
readonly name: "payloadType";
|
|
1846
|
+
readonly type: "uint8";
|
|
1847
|
+
}, {
|
|
1848
|
+
readonly name: "nonce";
|
|
1849
|
+
readonly type: "uint256";
|
|
1850
|
+
}, {
|
|
1851
|
+
readonly name: "receiver";
|
|
1852
|
+
readonly type: "address";
|
|
1853
|
+
}, {
|
|
1854
|
+
readonly name: "amount";
|
|
1855
|
+
readonly type: "uint256";
|
|
1856
|
+
}, {
|
|
1857
|
+
readonly name: "vaultId";
|
|
1858
|
+
readonly type: "bytes32";
|
|
1859
|
+
}, {
|
|
1860
|
+
readonly name: "token";
|
|
1861
|
+
readonly type: "string";
|
|
1862
|
+
}, {
|
|
1863
|
+
readonly name: "dexBrokerId";
|
|
1864
|
+
readonly type: "string";
|
|
1865
|
+
}];
|
|
1866
|
+
readonly InternalTransfer: readonly [{
|
|
1867
|
+
readonly name: "receiver";
|
|
1868
|
+
readonly type: "bytes32";
|
|
1869
|
+
}, {
|
|
1870
|
+
readonly name: "token";
|
|
1871
|
+
readonly type: "string";
|
|
1872
|
+
}, {
|
|
1873
|
+
readonly name: "amount";
|
|
1874
|
+
readonly type: "uint256";
|
|
1875
|
+
}, {
|
|
1876
|
+
readonly name: "transferNonce";
|
|
1877
|
+
readonly type: "uint64";
|
|
1878
|
+
}];
|
|
1879
|
+
};
|
|
1880
|
+
|
|
1881
|
+
declare enum AssetHistoryStatusEnum {
|
|
1882
|
+
/** @deprecated, this status is not used */
|
|
1883
|
+
NEW = "NEW",
|
|
1884
|
+
PENDING = "PENDING",
|
|
1885
|
+
CONFIRM = "CONFIRM",
|
|
1886
|
+
PROCESSING = "PROCESSING",
|
|
1887
|
+
COMPLETED = "COMPLETED",
|
|
1888
|
+
FAILED = "FAILED",
|
|
1889
|
+
PENDING_REBALANCE = "PENDING_REBALANCE"
|
|
1890
|
+
}
|
|
1891
|
+
declare enum AssetHistorySideEnum {
|
|
1892
|
+
DEPOSIT = "DEPOSIT",
|
|
1893
|
+
WITHDRAW = "WITHDRAW"
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
declare const DEFAUL_ORDERLY_KEY_SCOPE = "read,trading";
|
|
1897
|
+
|
|
1898
|
+
export { ABSTRACT_CHAIN_ID_MAP, ABSTRACT_MAINNET_CHAINID, ABSTRACT_TESTNET_CHAINID, API, ARBITRUM_MAINNET_CHAINID, ARBITRUM_MAINNET_CHAINID_HEX, ARBITRUM_TESTNET_CHAINID, ARBITRUM_TESTNET_CHAINID_HEX, AbstractChains, AbstractTestnetChainInfo, AbstractTestnetTokenInfo, AccountStatusEnum, type AlgoOrder, type AlgoOrderChildOrders, type AlgoOrderEntity, AlgoOrderRootType, AlgoOrderType, AnnouncementType, ApiError, Arbitrum, ArbitrumGoerli, ArbitrumSepolia, ArbitrumSepoliaChainInfo, ArbitrumSepoliaTokenInfo, AssetHistorySideEnum, AssetHistoryStatusEnum, Avalanche, BBOOrderType, BNB, BSC_TESTNET_CHAINID, Base, type BaseAlgoOrderEntity, type BaseOrder, BaseSepolia, type BracketOrder, type BracketOrderEntry, type Chain, type Chain as ChainConfig, type ChainInfo, ChainKey, ChainNamespace, type ChildOrder, ConnectorKey, type CurrentChain, DEFAUL_ORDERLY_KEY_SCOPE, DEPOSIT_FEE_RATE, DistributionType, EMPTY_LIST, EMPTY_OBJECT, EMPTY_OPERATION, ETHEREUM_MAINNET_CHAINID, Ethereum, ExchangeStatusEnum, Fantom, Fuji, LedgerWalletKey, Linea, LinkDeviceKey, MANTLE_TESTNET_CHAINID, MANTLE_TESTNET_CHAINID_HEX, MEDIA_TABLET, MONAD_TESTNET_CHAINID, Mantle, MantleSepolia, MaxUint256, type NativeCurrency, type NetworkId, NetworkStatusEnum, Optimism, OptimismGoerli, OptimismSepolia, type Optional, type OrderEntity, OrderEntrySortKeys, OrderLevel, OrderSide, OrderStatus, OrderType, type OrderlyOrder, Polygon, PolygonAmoy, PolygonzkEVM, PositionSide, PositionType, type RegularOrder, type RequireKeys, SDKError, SOLANA_MAINNET_CHAINID, SOLANA_TESTNET_CHAINID, STORY_TESTNET_CHAINID, Sei, SolanaChains, SolanaDevnet, SolanaDevnetChainInfo, SolanaDevnetTokenInfo, StoryOdysseyTestnet, StoryTestnet, SystemStateEnum, type TPSLOrderEntry, TesntTokenFallback, TestnetChains, TrackerEventName, TradingviewFullscreenKey, TrailingCallbackType, TriggerPriceType, WSMessage, WS_WalletStatusEnum, WithdrawStatus, chainsInfoMap, defaultMainnetChains, defaultTestnetChains, definedTypes, isNativeTokenChecker, nativeETHAddress, nativeTokenAddress, _default as version, zkSyncEra };
|