Repository navigation
Expand file tree
/
Copy pathtypes.d.ts
More file actions
69 lines (63 loc) · 2.59 KB
/
Copy pathtypes.d.ts
File metadata and controls
69 lines (63 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import * as functools_kit from 'functools-kit';
interface IOrderData {
symbol: string;
orderId: number;
status: "FILLED" | "CANCELED" | "NEW";
amount: string;
executedQty: string;
price: string;
time: string;
side: "BUY" | "SELL";
}
interface IDailyPnL {
date: string;
pnl: string;
walletCost: string;
amountQty: string;
amountUSDT: string;
averagePrice: string;
}
declare class WalletPrivateService {
commitTrade: (symbol: string, amountUSDT: number, averagePrice: number, takeProfitPrice: number, stopLossPrice: number) => Promise<0 | {
status: string;
content: string;
}>;
commitCancel: (symbol: string, averagePrice: number) => Promise<number>;
commitBuy: (symbol: string, amountUSDT: number, averagePrice: number) => Promise<number>;
commitSell: (symbol: string, amountUSDT: number, averagePrice: number) => Promise<number>;
fetchBalance: () => Promise<Record<string, {
usdt: number;
quantity: number;
}>>;
fetchPrice: (symbol: string) => Promise<number>;
fetchFiat: () => Promise<number>;
fetchOrders: ((symbol: string, limit: number) => Promise<IOrderData[]>) & functools_kit.IClearableTtl<string> & functools_kit.IControlMemoize<string, Promise<IOrderData[]>>;
fetchPnl: ((symbol: string, limit: number) => Promise<IDailyPnL[]>) & functools_kit.IClearableTtl<string> & functools_kit.IControlMemoize<string, Promise<IDailyPnL[]>>;
clear: () => void;
protected init: (() => Promise<void>) & functools_kit.ISingleshotClearable<() => Promise<void>>;
}
declare class WalletPublicService {
private readonly walletPrivateService;
private getRunner;
commitBuy: (symbol: string, amountUSDT: number) => Promise<number>;
commitSell: (symbol: string, amountUSDT: number) => Promise<number>;
commitTrade: (symbol: string, amountUSDT: number, takeProfitPrice: number, stopLossPrice: number) => Promise<0 | {
status: string;
content: string;
}>;
commitCancel: (symbol: string) => Promise<number>;
fetchBalance: (symbol: string) => Promise<{
usdt: number;
quantity: number;
}>;
fetchOrders: (symbol: string, limit?: number) => Promise<IOrderData[]>;
fetchPrice: (symbol: string) => Promise<number>;
fetchFiat: (symbol: string) => Promise<number>;
fetchPnl: (symbol: string, limit?: number) => Promise<IDailyPnL[]>;
commitReload: (symbol: string) => Promise<void>;
}
declare const wallet: {
walletPublicService: WalletPublicService;
walletPrivateService: WalletPrivateService;
};
export { wallet as default, wallet };