Skip to content

Commit bac2382

Browse files
committed
refactor
1 parent e98efea commit bac2382

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

src/enum/Enum.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export enum REQUEST_STATUS_FIELD {
33
ERROR = 0,
44
PENDING = 1,
55
ACCEPTED = 3,
6-
REJECTED = 4
6+
REJECTED = 4,
77
}
88

99
export enum DAY_FIELD {
@@ -13,7 +13,7 @@ export enum DAY_FIELD {
1313
THURSDAY = 4,
1414
FRIDAY = 5,
1515
SATURDAY = 6,
16-
SUNDAY = 7
16+
SUNDAY = 7,
1717
}
1818

1919
export enum CMD_FIELD {
@@ -24,20 +24,20 @@ export enum CMD_FIELD {
2424
BUY_STOP = 4,
2525
SELL_STOP = 5,
2626
BALANCE = 6,
27-
CREDIT = 7
27+
CREDIT = 7,
2828
}
2929

3030
export enum TYPE_FIELD {
3131
OPEN = 0,
3232
PENDING = 1,
3333
CLOSE = 2,
3434
MODIFY = 3,
35-
DELETE = 4
35+
DELETE = 4,
3636
}
3737

3838
export enum STATE_FIELD {
3939
MODIFIED = 'Modified',
40-
DELETED = 'Deleted'
40+
DELETED = 'Deleted',
4141
}
4242

4343
export enum PERIOD_FIELD {
@@ -62,20 +62,20 @@ export const CHART_RATE_LIMIT_BY_PERIOD: any = {
6262
PERIOD_H4: 1560, // 13 month
6363
PERIOD_D1: 19200, // 52 years
6464
PERIOD_W1: 3840, // 73 years
65-
PERIOD_MN1: 960 // 80 years
65+
PERIOD_MN1: 960, // 80 years
6666
}
6767

6868
export enum TransactionStatus {
6969
waiting = 0,
7070
sent = 1,
7171
successful = 2,
7272
timeout = 3,
73-
interrupted = 4
73+
interrupted = 4,
7474
}
7575

7676
export enum TransactionType {
7777
SOCKET = 'Socket',
78-
STREAM = 'Stream'
78+
STREAM = 'Stream',
7979
}
8080

8181
export enum ConnectionStatus {
@@ -88,7 +88,7 @@ export enum PositionType {
8888
open = 0,
8989
closed = 1,
9090
limit = 2,
91-
source = 3
91+
source = 3,
9292
}
9393

9494
export enum Candle {
@@ -97,7 +97,7 @@ export enum Candle {
9797
close = 2,
9898
low = 3,
9999
high = 4,
100-
volume = 5
100+
volume = 5,
101101
}
102102

103103
export enum errorCode {
@@ -108,7 +108,7 @@ export enum errorCode {
108108
XAPINODE_4 = 'XAPINODE_4', // Trading disabled
109109
XAPINODE_BE103 = 'XAPINODE_BE103', // User is not logged
110110
BE005 = 'BE005', // "userPasswordCheck: Invalid login or password"
111-
BE118 = 'BE118' // User already logged
111+
BE118 = 'BE118', // User already logged
112112
}
113113

114114
export enum Listeners {
@@ -119,7 +119,7 @@ export enum Listeners {
119119
xapi_onBalanceChange = 'xapi_onBalanceChange',
120120
xapi_onConnectionChange = 'xapi_onConnectionChange',
121121
xapi_onReject = 'xapi_onReject',
122-
xapi_onReady = 'xapi_onReady'
122+
xapi_onReady = 'xapi_onReady',
123123
}
124124

125125
export const Currency2Pair: any = {
@@ -144,7 +144,7 @@ export const Currency2Pair: any = {
144144
'CLP': 'USDCLP',
145145
'DKK': 'VWS.DK_4',
146146
'BTC': 'XEMBTC',
147-
'ETH': 'TRXETH'
147+
'ETH': 'TRXETH',
148148
}
149149

150150
export type RelevantCurrencies =

src/interface/Definitions.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import {CMD_FIELD, DAY_FIELD, PERIOD_FIELD, REQUEST_STATUS_FIELD, STATE_FIELD, TYPE_FIELD} from '..'
22

33
export interface CHART_RANGE_INFO_RECORD {
4-
end: number,
5-
period: PERIOD_FIELD,
6-
start: number,
7-
symbol: string,
4+
end: number
5+
period: PERIOD_FIELD
6+
start: number
7+
symbol: string
88
ticks: number
99
}
1010

1111
export interface CHART_LAST_INFO_RECORD {
12-
period: PERIOD_FIELD,
13-
start: number,
12+
period: PERIOD_FIELD
13+
start: number
1414
symbol: string
1515
}
1616

src/interface/Interface.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export interface MessagesQueue {
1010
}
1111

1212
export interface TransactionResolveSocket<T> {
13-
returnData: T,
14-
time: Time,
13+
returnData: T
14+
time: Time
1515
transaction: Transaction<TransactionResolveSocket<T>, null>
1616
json: string
1717
}
@@ -21,7 +21,7 @@ export interface TransactionResolveStream {
2121
}
2222

2323
export interface Transaction<Resolve, Reject> {
24-
status: TransactionStatus,
24+
status: TransactionStatus
2525
command: string
2626
createdAt: Time
2727
transactionId: string
@@ -38,19 +38,19 @@ export interface Transaction<Resolve, Reject> {
3838
json: any
3939
}
4040
transactionPromise: {
41-
resolve: null | ((resolve: Resolve | null) => void),
41+
resolve: null | ((resolve: Resolve | null) => void)
4242
reject: null | ((reject: Reject | null) => void)
4343
}
4444
stack: string | undefined
4545
}
4646

4747
export interface AddTransaction {
48-
command: string,
49-
json: any,
50-
args: any,
51-
transactionId: string,
52-
resolve: any,
53-
reject: any,
48+
command: string
49+
json: any
50+
args: any
51+
transactionId: string
52+
resolve: any
53+
reject: any
5454
urgent: boolean
5555
stack: string | undefined
5656
}
@@ -86,7 +86,7 @@ export interface TradePosition {
8686

8787
export interface TradePositions {
8888
[position: number]: {
89-
value: TradePosition | null,
89+
value: TradePosition | null
9090
lastUpdated: Time
9191
}
9292
}

0 commit comments

Comments
 (0)