@ultrade/ultrade-js-sdk 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +117 -0
- package/dist/argsAsObj/affiliates.args.d.ts +22 -0
- package/dist/argsAsObj/auth.args.d.ts +24 -0
- package/dist/argsAsObj/client.args.d.ts +21 -0
- package/dist/argsAsObj/index.d.ts +8 -0
- package/dist/argsAsObj/market.args.d.ts +53 -0
- package/dist/argsAsObj/social.args.d.ts +39 -0
- package/dist/argsAsObj/system.args.d.ts +7 -0
- package/dist/argsAsObj/trading.args.d.ts +12 -0
- package/dist/argsAsObj/wallet.args.d.ts +31 -0
- package/dist/client.d.ts +112 -0
- package/dist/const/auth.const.d.ts +1 -0
- package/dist/const/client.const.d.ts +8 -0
- package/dist/const/index.d.ts +2 -0
- package/dist/enum/account.enum.d.ts +42 -0
- package/dist/enum/affiliates.enum.d.ts +5 -0
- package/dist/enum/common.enum.d.ts +15 -0
- package/dist/enum/index.d.ts +6 -0
- package/dist/enum/market.enum.d.ts +252 -0
- package/dist/enum/social.enum.d.ts +6 -0
- package/dist/{src/enums.d.ts → enum/socket.enum.d.ts} +0 -16
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1 -1
- package/dist/interface/account.interface.d.ts +64 -0
- package/dist/interface/affiliates.interface.d.ts +42 -0
- package/dist/interface/auth.interface.d.ts +19 -0
- package/dist/interface/client.interface.d.ts +12 -0
- package/dist/interface/index.d.ts +11 -0
- package/dist/interface/market.interface.d.ts +232 -0
- package/dist/interface/notification.interface.d.ts +6 -0
- package/dist/interface/social.interface.d.ts +145 -0
- package/dist/interface/socket.interface.d.ts +47 -0
- package/dist/interface/system.interface.d.ts +20 -0
- package/dist/interface/trading.interface.d.ts +38 -0
- package/dist/interface/wallet.interface.d.ts +143 -0
- package/dist/{src/localStorage.d.ts → localStorage.d.ts} +1 -1
- package/dist/{src/sockets.d.ts → sockets.d.ts} +1 -1
- package/dist/{src → utils}/algodService.d.ts +6 -8
- package/dist/utils/algorand.util.d.ts +4 -0
- package/dist/utils/client.util.d.ts +6 -0
- package/dist/utils/index.d.ts +3 -0
- package/package.json +9 -6
- package/dist/src/client.d.ts +0 -143
- package/dist/src/index.d.ts +0 -2
- package/dist/src/interfaces.d.ts +0 -136
- package/dist/src/utils.d.ts +0 -2
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface AffiliateSummaryStat {
|
|
2
|
+
value: number | null;
|
|
3
|
+
trend: number | null;
|
|
4
|
+
}
|
|
5
|
+
export interface AffiliateTrendStat {
|
|
6
|
+
value: number;
|
|
7
|
+
time: number;
|
|
8
|
+
}
|
|
9
|
+
export interface AffiliateStats<T> {
|
|
10
|
+
totalRevenue: T;
|
|
11
|
+
linkClicks: T;
|
|
12
|
+
registrations: T;
|
|
13
|
+
firstTimeDepositors: T;
|
|
14
|
+
totalTradingVolume: T;
|
|
15
|
+
totalFees: T;
|
|
16
|
+
}
|
|
17
|
+
export interface AffiliateSummaryStats extends AffiliateStats<AffiliateSummaryStat> {
|
|
18
|
+
}
|
|
19
|
+
export interface AffiliateTrendStats extends AffiliateStats<AffiliateTrendStat[]> {
|
|
20
|
+
}
|
|
21
|
+
export interface DashboardInfo {
|
|
22
|
+
feeShare: number;
|
|
23
|
+
referralLink: string;
|
|
24
|
+
summaryStats: AffiliateSummaryStats;
|
|
25
|
+
trendStats: AffiliateTrendStats | null;
|
|
26
|
+
}
|
|
27
|
+
export interface IAffiliateDashboardStatus {
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
isAffiliate: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface IAffiliateProgress {
|
|
32
|
+
totalTradingVolumeUsd: number;
|
|
33
|
+
unlockThreshold: number;
|
|
34
|
+
}
|
|
35
|
+
export interface IAffiliateForClient {
|
|
36
|
+
getAffiliatesStatus(companyId: number): Promise<IAffiliateDashboardStatus>;
|
|
37
|
+
createAffiliate(companyId: number): Promise<DashboardInfo>;
|
|
38
|
+
getAffiliateProgress(companyId: number): Promise<IAffiliateProgress>;
|
|
39
|
+
getAffiliateInfo(companyId: number, range: string): Promise<DashboardInfo>;
|
|
40
|
+
countAffiliateDepost(companyId: number): Promise<void>;
|
|
41
|
+
countAffiliateClick(referralToken: string): Promise<void>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface Signer {
|
|
2
|
+
signAndSend: ([]: Iterable<any, void, undefined>) => any;
|
|
3
|
+
signMessage: (msg: string, encoding?: BufferEncoding) => Promise<string>;
|
|
4
|
+
signMessageByToken: (msg: string, encoding?: BufferEncoding) => Promise<string>;
|
|
5
|
+
}
|
|
6
|
+
export interface AuthCredentials {
|
|
7
|
+
company: string;
|
|
8
|
+
clientId?: string;
|
|
9
|
+
clientSecret?: string;
|
|
10
|
+
mnemonic?: string;
|
|
11
|
+
signer: Signer;
|
|
12
|
+
}
|
|
13
|
+
export interface WalletCredentials {
|
|
14
|
+
address: string;
|
|
15
|
+
chain: string;
|
|
16
|
+
provider: string;
|
|
17
|
+
token: string;
|
|
18
|
+
tradingKey?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IAccountForClient, IMarketForClient, ISystemForClient, IWalletForClient, SocketIOFactory, IAffiliateForClient, ISocialForClient } from "./index.ts";
|
|
2
|
+
import { Network } from "../const/index.ts";
|
|
3
|
+
export interface ClientOptions {
|
|
4
|
+
network: Network;
|
|
5
|
+
apiUrl?: string;
|
|
6
|
+
algoSdkClient: any;
|
|
7
|
+
websocketUrl: string;
|
|
8
|
+
companyId?: number;
|
|
9
|
+
socketIO: SocketIOFactory;
|
|
10
|
+
}
|
|
11
|
+
export interface IClient extends IMarketForClient, IAccountForClient, IWalletForClient, ISystemForClient, IAffiliateForClient, ISocialForClient {
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./account.interface";
|
|
2
|
+
export * from "./auth.interface";
|
|
3
|
+
export * from "./client.interface";
|
|
4
|
+
export * from "./market.interface";
|
|
5
|
+
export * from "./social.interface";
|
|
6
|
+
export * from "./socket.interface";
|
|
7
|
+
export * from "./trading.interface";
|
|
8
|
+
export * from "./wallet.interface";
|
|
9
|
+
export * from "./system.interface";
|
|
10
|
+
export * from "./notification.interface";
|
|
11
|
+
export * from "./affiliates.interface";
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { KYCAuthenticationStatus } from "../../../shared/dist/browser/enums";
|
|
2
|
+
import { BLOCKCHAINS, OrderStatus, OrderTypeEnum, OrderUpdateStaus, PairSettingsIds } from "../enum/index.ts";
|
|
3
|
+
export interface IPairDto {
|
|
4
|
+
id: number;
|
|
5
|
+
base_chain_id: number;
|
|
6
|
+
base_currency: string;
|
|
7
|
+
base_decimal: number;
|
|
8
|
+
base_id: string;
|
|
9
|
+
min_order_size: string;
|
|
10
|
+
min_price_increment: string;
|
|
11
|
+
min_size_increment: string;
|
|
12
|
+
is_active: boolean;
|
|
13
|
+
pairId: number;
|
|
14
|
+
pair_key: string;
|
|
15
|
+
pair_name: string;
|
|
16
|
+
price_chain_id: number;
|
|
17
|
+
price_currency: string;
|
|
18
|
+
price_decimal: number;
|
|
19
|
+
price_id: string;
|
|
20
|
+
restrictedCountries: string[];
|
|
21
|
+
inuseWithPartners: number[];
|
|
22
|
+
pairSettings: {
|
|
23
|
+
[PairSettingsIds.MFT_AUDIO_LINK]?: string;
|
|
24
|
+
[PairSettingsIds.MFT_TITLE]?: string;
|
|
25
|
+
[PairSettingsIds.VIEW_BASE_COIN_ICON_LINK]?: string;
|
|
26
|
+
[PairSettingsIds.VIEW_BASE_COIN_MARKET_LINK]?: string;
|
|
27
|
+
[PairSettingsIds.VIEW_PRICE_COIN_ICON_LINK]?: string;
|
|
28
|
+
[PairSettingsIds.VIEW_PRICE_COIN_MARKET_LINK]?: string;
|
|
29
|
+
[PairSettingsIds.MAKER_FEE]?: string;
|
|
30
|
+
[PairSettingsIds.TAKER_FEE]?: string;
|
|
31
|
+
[PairSettingsIds.MODE_PRE_SALE]?: {
|
|
32
|
+
sellerAddress: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
delisting_date?: Date;
|
|
36
|
+
new_orders_disabled?: boolean;
|
|
37
|
+
current_price?: string;
|
|
38
|
+
h?: string;
|
|
39
|
+
l?: string;
|
|
40
|
+
l_p?: string;
|
|
41
|
+
price_24?: string;
|
|
42
|
+
total_24?: string;
|
|
43
|
+
volume_24?: string;
|
|
44
|
+
change_24?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface IGetDepth {
|
|
47
|
+
buy: string[][];
|
|
48
|
+
sell: string[][];
|
|
49
|
+
pair: string;
|
|
50
|
+
ts: number;
|
|
51
|
+
U: number;
|
|
52
|
+
u: number;
|
|
53
|
+
}
|
|
54
|
+
export interface IGetLastTrades {
|
|
55
|
+
tradeId: number;
|
|
56
|
+
amount: string;
|
|
57
|
+
createdAt: number;
|
|
58
|
+
price: string;
|
|
59
|
+
isBuyerMaker: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface CodexBalanceDto {
|
|
62
|
+
hash: string;
|
|
63
|
+
loginAddress: string;
|
|
64
|
+
loginChainId: number;
|
|
65
|
+
tokenId: number;
|
|
66
|
+
tokenAddress: string;
|
|
67
|
+
tokenChainId: number;
|
|
68
|
+
amount: string;
|
|
69
|
+
lockedAmount: string;
|
|
70
|
+
}
|
|
71
|
+
export type OrderSideShort = "B" | "S";
|
|
72
|
+
export interface ITradeDto {
|
|
73
|
+
tradeId: number;
|
|
74
|
+
amount: string;
|
|
75
|
+
price: string;
|
|
76
|
+
createdAt: number;
|
|
77
|
+
updatedAt?: number;
|
|
78
|
+
total?: string;
|
|
79
|
+
orderId?: number;
|
|
80
|
+
orderSide?: OrderSideShort;
|
|
81
|
+
pairId?: number;
|
|
82
|
+
baseTokenId?: number;
|
|
83
|
+
baseTokenDecimal?: number;
|
|
84
|
+
quoteTokenId?: number;
|
|
85
|
+
quoteTokenDecimal?: number;
|
|
86
|
+
status?: string;
|
|
87
|
+
fee?: string;
|
|
88
|
+
isBuyer?: boolean;
|
|
89
|
+
isMaker?: boolean;
|
|
90
|
+
}
|
|
91
|
+
export interface IOrderDto {
|
|
92
|
+
id: number;
|
|
93
|
+
pairId: number;
|
|
94
|
+
pair: string;
|
|
95
|
+
status: OrderStatus;
|
|
96
|
+
side: 0 | 1;
|
|
97
|
+
type: OrderTypeEnum;
|
|
98
|
+
price: string;
|
|
99
|
+
amount: string;
|
|
100
|
+
filledAmount: string;
|
|
101
|
+
total: string;
|
|
102
|
+
filledTotal: string;
|
|
103
|
+
avgPrice: string;
|
|
104
|
+
userId: string;
|
|
105
|
+
createdAt: number;
|
|
106
|
+
updatedAt?: number;
|
|
107
|
+
completedAt?: number;
|
|
108
|
+
trades?: ITradeDto[];
|
|
109
|
+
}
|
|
110
|
+
export interface Order extends IOrderDto {
|
|
111
|
+
executed: boolean;
|
|
112
|
+
updateStatus?: OrderUpdateStaus;
|
|
113
|
+
base_currency: string;
|
|
114
|
+
base_decimal: number;
|
|
115
|
+
price_currency: string;
|
|
116
|
+
price_decimal: number;
|
|
117
|
+
min_size_increment: string;
|
|
118
|
+
min_price_increment: string;
|
|
119
|
+
price_id: number;
|
|
120
|
+
}
|
|
121
|
+
export interface Chain {
|
|
122
|
+
chainId: number;
|
|
123
|
+
whChainId: string;
|
|
124
|
+
tmc: string;
|
|
125
|
+
name: BLOCKCHAINS;
|
|
126
|
+
}
|
|
127
|
+
export interface AccountAssetType {
|
|
128
|
+
id: number;
|
|
129
|
+
index: string;
|
|
130
|
+
name: string | null;
|
|
131
|
+
decimal: number;
|
|
132
|
+
img: string;
|
|
133
|
+
amount: string;
|
|
134
|
+
lockedAmount: string;
|
|
135
|
+
unit_name: string | null;
|
|
136
|
+
chainId: number;
|
|
137
|
+
usd_value?: number;
|
|
138
|
+
isWrapped?: boolean;
|
|
139
|
+
}
|
|
140
|
+
export interface CCTPAssets {
|
|
141
|
+
chainId: number;
|
|
142
|
+
address: string;
|
|
143
|
+
unifiedChainId: number;
|
|
144
|
+
}
|
|
145
|
+
export type MappedCCTPAssets = {
|
|
146
|
+
[key: string]: CCTPAssets[];
|
|
147
|
+
};
|
|
148
|
+
export interface CCTPUnifiedAssets {
|
|
149
|
+
id: number;
|
|
150
|
+
chainId: number;
|
|
151
|
+
address: string;
|
|
152
|
+
symbol: string;
|
|
153
|
+
}
|
|
154
|
+
export interface IGetKycStatus {
|
|
155
|
+
kycStatus?: KYCAuthenticationStatus;
|
|
156
|
+
}
|
|
157
|
+
export interface IGetKycInitLink {
|
|
158
|
+
url: string;
|
|
159
|
+
}
|
|
160
|
+
export interface IGetDollarValues {
|
|
161
|
+
[key: string]: number;
|
|
162
|
+
}
|
|
163
|
+
export interface IWithdrawalFee {
|
|
164
|
+
fee: string;
|
|
165
|
+
dollarValue: string;
|
|
166
|
+
}
|
|
167
|
+
export interface IGetPrice {
|
|
168
|
+
ask: number;
|
|
169
|
+
bid: number;
|
|
170
|
+
last: number;
|
|
171
|
+
}
|
|
172
|
+
export interface IGetHistoryResponse {
|
|
173
|
+
t: number[];
|
|
174
|
+
o: number[];
|
|
175
|
+
c: number[];
|
|
176
|
+
l: number[];
|
|
177
|
+
h: number[];
|
|
178
|
+
v: number[];
|
|
179
|
+
q: number[];
|
|
180
|
+
s: string;
|
|
181
|
+
b: number;
|
|
182
|
+
}
|
|
183
|
+
interface IGetSymbolsItem {
|
|
184
|
+
pairKey: string;
|
|
185
|
+
}
|
|
186
|
+
export type IGetSymbols = IGetSymbolsItem[];
|
|
187
|
+
import { CreateOrderArgs, CancelOrderArgs } from "./index.ts";
|
|
188
|
+
export interface ICancelOrderResponse {
|
|
189
|
+
orderId: number;
|
|
190
|
+
isCancelled: boolean;
|
|
191
|
+
amount?: string;
|
|
192
|
+
filledAmount?: string;
|
|
193
|
+
filledTotal?: string;
|
|
194
|
+
averageExecutedPrice?: string;
|
|
195
|
+
}
|
|
196
|
+
export interface ICancelMultipleOrdersResponseItem {
|
|
197
|
+
orderId: number;
|
|
198
|
+
pairId: number;
|
|
199
|
+
isCancelled: boolean;
|
|
200
|
+
reason?: string;
|
|
201
|
+
amount?: string;
|
|
202
|
+
filledAmount?: string;
|
|
203
|
+
filledTotal?: string;
|
|
204
|
+
}
|
|
205
|
+
export type ICancelMultipleOrdersResponse = ICancelMultipleOrdersResponseItem[];
|
|
206
|
+
export interface IMarketForClient {
|
|
207
|
+
getPairList(companyId?: number): Promise<IPairDto[]>;
|
|
208
|
+
getPair(symbol: string | number): Promise<IPairDto>;
|
|
209
|
+
getPrice(symbol: string): Promise<IGetPrice>;
|
|
210
|
+
getDepth(symbol: string, depth: number): Promise<IGetDepth>;
|
|
211
|
+
getSymbols(mask?: string): Promise<IGetSymbols>;
|
|
212
|
+
getLastTrades(symbol: string): Promise<IGetLastTrades>;
|
|
213
|
+
getHistory(symbol: string, interval: string, startTime?: number, endTime?: number, limit?: number, page?: number): Promise<IGetHistoryResponse>;
|
|
214
|
+
getOrders(symbol?: string, status?: number, limit?: number, endTime?: number, startTime?: number): Promise<IOrderDto[]>;
|
|
215
|
+
getOrderById(orderId: number): Promise<Order>;
|
|
216
|
+
getBalances(): Promise<CodexBalanceDto[]>;
|
|
217
|
+
getChains(): Promise<Chain[]>;
|
|
218
|
+
getCodexAssets(): Promise<CodexBalanceDto>;
|
|
219
|
+
getCCTPAssets(): Promise<MappedCCTPAssets>;
|
|
220
|
+
getCCTPUnifiedAssets(): Promise<CCTPUnifiedAssets[]>;
|
|
221
|
+
getWithdrawalFee(assetAddress: string, chainId: number): Promise<IWithdrawalFee>;
|
|
222
|
+
getKycStatus(): Promise<IGetKycStatus>;
|
|
223
|
+
getKycInitLink(embeddedAppUrl: string | null): Promise<IGetKycInitLink>;
|
|
224
|
+
getDollarValues(assetIds?: number[]): Promise<IGetDollarValues>;
|
|
225
|
+
createOrder(order: CreateOrderArgs): Promise<IOrderDto>;
|
|
226
|
+
cancelOrder(order: CancelOrderArgs): Promise<ICancelOrderResponse>;
|
|
227
|
+
cancelMultipleOrders(data: {
|
|
228
|
+
orderIds?: number[];
|
|
229
|
+
pairId?: number;
|
|
230
|
+
}): Promise<ICancelMultipleOrdersResponse>;
|
|
231
|
+
}
|
|
232
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
export interface TelegramData {
|
|
2
|
+
auth_date: number;
|
|
3
|
+
id: number;
|
|
4
|
+
first_name: string;
|
|
5
|
+
hash: string;
|
|
6
|
+
photo_url: string;
|
|
7
|
+
username: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ISocialAccount {
|
|
10
|
+
points: number;
|
|
11
|
+
address: string;
|
|
12
|
+
email?: string;
|
|
13
|
+
emailVerified: boolean;
|
|
14
|
+
twitterAccount?: {
|
|
15
|
+
userName: string;
|
|
16
|
+
twitterId: string;
|
|
17
|
+
name: string;
|
|
18
|
+
permissions: {
|
|
19
|
+
canFollowAccounts: boolean;
|
|
20
|
+
canCreateTweets: boolean;
|
|
21
|
+
canLikeTweets: boolean;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
telegramAccount?: {
|
|
25
|
+
userName: string;
|
|
26
|
+
telegramId: string;
|
|
27
|
+
};
|
|
28
|
+
discordAccount?: {
|
|
29
|
+
userName: string;
|
|
30
|
+
discordId: string;
|
|
31
|
+
name: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface ILeaderboardItem {
|
|
35
|
+
address: string;
|
|
36
|
+
currentPoints: number;
|
|
37
|
+
tasksCompleted: number;
|
|
38
|
+
twitter?: string;
|
|
39
|
+
discord?: string;
|
|
40
|
+
telegram?: string;
|
|
41
|
+
order: number;
|
|
42
|
+
}
|
|
43
|
+
export interface IUnlock {
|
|
44
|
+
id: number;
|
|
45
|
+
companyId: number;
|
|
46
|
+
seasonId: number;
|
|
47
|
+
name: string;
|
|
48
|
+
description: string;
|
|
49
|
+
points: number;
|
|
50
|
+
enabled: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface IAction {
|
|
53
|
+
id: number;
|
|
54
|
+
companyId: number;
|
|
55
|
+
seasonId: number;
|
|
56
|
+
source: string;
|
|
57
|
+
name: string;
|
|
58
|
+
description: string;
|
|
59
|
+
points: number;
|
|
60
|
+
enabled: boolean;
|
|
61
|
+
}
|
|
62
|
+
export interface IActionHistory {
|
|
63
|
+
id: number;
|
|
64
|
+
address: string;
|
|
65
|
+
companyId: number;
|
|
66
|
+
actionId: number;
|
|
67
|
+
seasonId: number;
|
|
68
|
+
source: string;
|
|
69
|
+
points: number;
|
|
70
|
+
referenceId?: string;
|
|
71
|
+
createdAt: Date;
|
|
72
|
+
}
|
|
73
|
+
export interface ISocialSettings {
|
|
74
|
+
[key: string]: any;
|
|
75
|
+
}
|
|
76
|
+
export interface ISocialSeason {
|
|
77
|
+
id: number;
|
|
78
|
+
companyId: number;
|
|
79
|
+
startDate: Date;
|
|
80
|
+
endDate?: Date;
|
|
81
|
+
name: string;
|
|
82
|
+
isSelected: boolean;
|
|
83
|
+
status: string;
|
|
84
|
+
createdAt: Date;
|
|
85
|
+
updatedAt: Date;
|
|
86
|
+
}
|
|
87
|
+
export interface ITelegramConnectResponse {
|
|
88
|
+
address: string;
|
|
89
|
+
telegramId: string;
|
|
90
|
+
userName: string;
|
|
91
|
+
createdAt: Date;
|
|
92
|
+
}
|
|
93
|
+
export interface ICompanyTweet {
|
|
94
|
+
id: string;
|
|
95
|
+
companyId: number;
|
|
96
|
+
seasonId: number;
|
|
97
|
+
type: string;
|
|
98
|
+
text: string;
|
|
99
|
+
enabled: boolean;
|
|
100
|
+
isProcessed: boolean;
|
|
101
|
+
expiresAt: Date;
|
|
102
|
+
createdAt: Date;
|
|
103
|
+
updatedAt: Date;
|
|
104
|
+
}
|
|
105
|
+
export interface IAIStyle {
|
|
106
|
+
id: number;
|
|
107
|
+
title: string;
|
|
108
|
+
content: string;
|
|
109
|
+
enabled: boolean;
|
|
110
|
+
type: string;
|
|
111
|
+
createdAt: Date;
|
|
112
|
+
updatedAt: Date;
|
|
113
|
+
}
|
|
114
|
+
export interface IAIGeneratedComment {
|
|
115
|
+
comment: string | null;
|
|
116
|
+
requestsLeft: number;
|
|
117
|
+
}
|
|
118
|
+
export interface ISocialForClient {
|
|
119
|
+
getSocialAccount(): Promise<ISocialAccount | undefined>;
|
|
120
|
+
addSocialEmail(email: string, embeddedAppUrl: string): Promise<void>;
|
|
121
|
+
verifySocialEmail(email: string, hash: string): Promise<void>;
|
|
122
|
+
getLeaderboards(): Promise<ILeaderboardItem[]>;
|
|
123
|
+
getUnlocks(): Promise<IUnlock[]>;
|
|
124
|
+
getSocialSettings(): Promise<ISocialSettings>;
|
|
125
|
+
getSeason(ultradeId?: number): Promise<ISocialSeason>;
|
|
126
|
+
getPastSeasons(): Promise<ISocialSeason[]>;
|
|
127
|
+
addTelegram(data: TelegramData): Promise<ITelegramConnectResponse>;
|
|
128
|
+
disconnectTelegram(data: TelegramData): Promise<void>;
|
|
129
|
+
getDiscordConnectionUrl(url: string): Promise<string>;
|
|
130
|
+
disconnectDiscord(): Promise<void>;
|
|
131
|
+
getTwitterConnectionUrl(appUrl: string, permissions?: string): Promise<string>;
|
|
132
|
+
disconnectTwitter(): Promise<void>;
|
|
133
|
+
getTweets(): Promise<ICompanyTweet[]>;
|
|
134
|
+
actionWithTweet(data: {
|
|
135
|
+
actions: Array<{
|
|
136
|
+
id: number;
|
|
137
|
+
text?: string;
|
|
138
|
+
}>;
|
|
139
|
+
tweetId?: string;
|
|
140
|
+
}): Promise<void>;
|
|
141
|
+
getActions(): Promise<IAction[]>;
|
|
142
|
+
getActionHistory(): Promise<IActionHistory[]>;
|
|
143
|
+
getAIStyles(): Promise<IAIStyle[]>;
|
|
144
|
+
getAIComment(styleId: number, tweetId: string): Promise<IAIGeneratedComment>;
|
|
145
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { STREAMS } from "../enum/index.ts";
|
|
2
|
+
export interface SocketIOClient {
|
|
3
|
+
connected: boolean;
|
|
4
|
+
id: string;
|
|
5
|
+
on: (event: string, handler: (...args: unknown[]) => void) => void;
|
|
6
|
+
off: (event: string, handler?: (...args: unknown[]) => void) => void;
|
|
7
|
+
emit: (event: string, ...args: unknown[]) => void;
|
|
8
|
+
onAny: (handler: (event: string, ...args: unknown[]) => void) => void;
|
|
9
|
+
disconnect: () => void;
|
|
10
|
+
io: {
|
|
11
|
+
on: (event: string, handler: (...args: unknown[]) => void) => void;
|
|
12
|
+
off: (event: string, handler?: (...args: unknown[]) => void) => void;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface SocketIOFactory {
|
|
16
|
+
(url: string, options?: unknown): SocketIOClient;
|
|
17
|
+
}
|
|
18
|
+
export interface AppSocketState {
|
|
19
|
+
address: string;
|
|
20
|
+
appId: number;
|
|
21
|
+
orderFilter: string;
|
|
22
|
+
pairKey: string;
|
|
23
|
+
pairId: number;
|
|
24
|
+
}
|
|
25
|
+
interface WSOptions {
|
|
26
|
+
address: string;
|
|
27
|
+
token?: string;
|
|
28
|
+
tradingKey?: string;
|
|
29
|
+
message?: string;
|
|
30
|
+
signature?: string;
|
|
31
|
+
depth?: number;
|
|
32
|
+
companyId?: number;
|
|
33
|
+
interval?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface SubscribeOptions {
|
|
36
|
+
symbol: string;
|
|
37
|
+
streams: STREAMS[];
|
|
38
|
+
options: WSOptions;
|
|
39
|
+
}
|
|
40
|
+
export interface ServerToClientEvents {
|
|
41
|
+
reconnect: () => void;
|
|
42
|
+
}
|
|
43
|
+
export interface ClientToServerEvents {
|
|
44
|
+
subscribe: (options: SubscribeOptions) => void;
|
|
45
|
+
unsubscribe: (options: SubscribeOptions) => void;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MaintenanceMode } from "../../../shared/dist/browser/enums";
|
|
2
|
+
import { UserNotification } from "./account.interface";
|
|
3
|
+
import { UpdateUserNotificationDto } from "./notification.interface";
|
|
4
|
+
export interface ISystemVersion {
|
|
5
|
+
version: string | null;
|
|
6
|
+
}
|
|
7
|
+
export interface ISystemMaintenance {
|
|
8
|
+
mode: MaintenanceMode;
|
|
9
|
+
}
|
|
10
|
+
export interface IUnreadNotificationsCount {
|
|
11
|
+
count: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ISystemForClient {
|
|
14
|
+
getVersion(): Promise<ISystemVersion>;
|
|
15
|
+
getMaintenance(): Promise<ISystemMaintenance>;
|
|
16
|
+
getNotifications(): Promise<UserNotification[]>;
|
|
17
|
+
getNotificationsUnreadCount(): Promise<IUnreadNotificationsCount>;
|
|
18
|
+
readNotifications(notifications: UpdateUserNotificationDto[]): Promise<UpdateUserNotificationDto[]>;
|
|
19
|
+
ping(): Promise<number>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type OrderSide = 'S' | 'B';
|
|
2
|
+
export type OrderType = 'L' | 'I' | 'P' | 'M';
|
|
3
|
+
export interface CancelOrderArgs {
|
|
4
|
+
orderId: number;
|
|
5
|
+
orderSide: OrderSide;
|
|
6
|
+
orderType: OrderType;
|
|
7
|
+
amount: string;
|
|
8
|
+
price: string;
|
|
9
|
+
baseTokenAddress: string;
|
|
10
|
+
baseChain: string;
|
|
11
|
+
baseCurrency: string;
|
|
12
|
+
baseDecimal: number;
|
|
13
|
+
priceTokenAddress: string;
|
|
14
|
+
priceChain: string;
|
|
15
|
+
priceCurrency: string;
|
|
16
|
+
priceDecimal: number;
|
|
17
|
+
}
|
|
18
|
+
export interface CreateOrderArgs {
|
|
19
|
+
pairId: number;
|
|
20
|
+
companyId: number;
|
|
21
|
+
orderSide: OrderSide;
|
|
22
|
+
orderType: OrderType;
|
|
23
|
+
amount: string;
|
|
24
|
+
price: string;
|
|
25
|
+
decimalPrice: number;
|
|
26
|
+
address: string;
|
|
27
|
+
chainId: number;
|
|
28
|
+
baseTokenAddress: string;
|
|
29
|
+
baseTokenChainId: number;
|
|
30
|
+
baseChain: string;
|
|
31
|
+
baseCurrency: string;
|
|
32
|
+
baseDecimal: number;
|
|
33
|
+
priceTokenAddress: string;
|
|
34
|
+
priceTokenChainId: number;
|
|
35
|
+
priceChain: string;
|
|
36
|
+
priceCurrency: string;
|
|
37
|
+
priceDecimal: number;
|
|
38
|
+
}
|