-
Notifications
You must be signed in to change notification settings - Fork 504
/
types.ts
157 lines (151 loc) · 3.88 KB
/
types.ts
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
import * as AT from './actionTypes'
import { CoinType, FiatType, RemoteDataType } from 'core/types'
// types
export type RateType = {
'15m': number
buy: number
last: number
sell: number
symbol: string
}
export type RatesType = {
[key in FiatType]: RateType
}
// state
export type MiscStateType = {
authorize_login: RemoteDataType<any, any>
captcha: RemoteDataType<any, any>
handle_2fa_reset: RemoteDataType<any, any>
logs: RemoteDataType<any, any>
pairing_code: RemoteDataType<any, any>
price_24h: {
[key in CoinType]: RemoteDataType<
string,
{ change: string; movement: 'none' | 'up' | 'down' }
>
}
price_index_series: RemoteDataType<any, any>
verify_email_token: RemoteDataType<any, any>
}
// actions
interface AuthorizeLoginFailureActionType {
payload: {
error: string
}
type: typeof AT.AUTHORIZE_LOGIN_FAILURE
}
interface AuthorizeLoginLoadingActionType {
type: typeof AT.AUTHORIZE_LOGIN_LOADING
}
interface AuthorizeLoginSuccessActionType {
payload: any
type: typeof AT.AUTHORIZE_LOGIN_SUCCESS
}
interface EncodePairingCodeFailureActionType {
payload: {
error: string
}
type: typeof AT.ENCODE_PAIRING_CODE_FAILURE
}
interface EncodePairingCodeLoadingActionType {
type: typeof AT.ENCODE_PAIRING_CODE_LOADING
}
interface EncodePairingCodeSuccessActionType {
payload: any
type: typeof AT.ENCODE_PAIRING_CODE_SUCCESS
}
interface FetchCaptchaFailureActionType {
payload: {
error: string
}
type: typeof AT.FETCH_CAPTCHA_FAILURE
}
interface FetchCaptchaLoadingActionType {
type: typeof AT.FETCH_CAPTCHA_LOADING
}
interface FetchCaptchaSuccessActionType {
payload: any
type: typeof AT.FETCH_CAPTCHA_SUCCESS
}
interface FetchPrice24HFailureActionType {
payload: {
base: CoinType
error: string
}
type: typeof AT.FETCH_PRICE_24H_FAILURE
}
interface FetchPrice24HLoadingActionType {
payload: {
base: CoinType
}
type: typeof AT.FETCH_PRICE_24H_LOADING
}
interface FetchPrice24HSuccessActionType {
payload: {
base: CoinType
change: string
movement: 'none' | 'up' | 'down'
}
type: typeof AT.FETCH_PRICE_24H_SUCCESS
}
interface FetchPriceIndexSeriesFailureActionType {
payload: {
error: string
}
type: typeof AT.FETCH_PRICE_INDEX_SERIES_FAILURE
}
interface FetchPriceIndexSeriesLoadingActionType {
type: typeof AT.FETCH_PRICE_INDEX_SERIES_LOADING
}
interface FetchPriceIndexSeriesSuccessActionType {
payload: any
type: typeof AT.FETCH_PRICE_INDEX_SERIES_SUCCESS
}
interface Handle2FAResetFailureActionType {
payload: {
error: string
}
type: typeof AT.HANDLE_2FA_RESET_FAILURE
}
interface Handle2FAResetLoadingActionType {
type: typeof AT.HANDLE_2FA_RESET_LOADING
}
interface Handle2FAResetSuccessActionType {
payload: any
type: typeof AT.HANDLE_2FA_RESET_SUCCESS
}
interface VerifyEmailTokenFailureActionType {
payload: {
error: string
}
type: typeof AT.VERIFY_EMAIL_TOKEN_FAILURE
}
interface VerifyEmailTokenLoadingActionType {
type: typeof AT.VERIFY_EMAIL_TOKEN_LOADING
}
interface VerifyEmailTokenSuccessActionType {
payload: any
type: typeof AT.VERIFY_EMAIL_TOKEN_SUCCESS
}
export type MiscActionTypes =
| AuthorizeLoginFailureActionType
| AuthorizeLoginLoadingActionType
| AuthorizeLoginSuccessActionType
| EncodePairingCodeFailureActionType
| EncodePairingCodeLoadingActionType
| EncodePairingCodeSuccessActionType
| FetchCaptchaFailureActionType
| FetchCaptchaLoadingActionType
| FetchCaptchaSuccessActionType
| FetchPrice24HFailureActionType
| FetchPrice24HLoadingActionType
| FetchPrice24HSuccessActionType
| FetchPriceIndexSeriesFailureActionType
| FetchPriceIndexSeriesLoadingActionType
| FetchPriceIndexSeriesSuccessActionType
| Handle2FAResetFailureActionType
| Handle2FAResetLoadingActionType
| Handle2FAResetSuccessActionType
| VerifyEmailTokenFailureActionType
| VerifyEmailTokenLoadingActionType
| VerifyEmailTokenSuccessActionType