zh-web-sdk 2.7.3 → 2.9.0
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/iframe-container/AppContainer.d.ts +4 -2
- package/dist/index.d.ts +8 -3
- package/dist/index.js +7 -7
- package/dist/index.js.map +4 -4
- package/dist/redux/reducers/constants.d.ts +1 -0
- package/dist/redux/reducers/index.d.ts +2 -1
- package/dist/redux/reducers/onboarding.d.ts +3 -0
- package/dist/redux/reducers/profile.d.ts +13 -0
- package/dist/redux/store/index.d.ts +2 -1
- package/dist/types.d.ts +41 -2
- package/package.json +1 -1
- package/src/iframe-container/AppContainer.tsx +42 -4
- package/src/index.tsx +31 -3
- package/src/redux/reducers/constants.ts +2 -1
- package/src/redux/reducers/index.ts +2 -0
- package/src/redux/reducers/onboarding.ts +12 -2
- package/src/redux/reducers/profile.ts +63 -0
- package/src/types.ts +317 -276
package/src/types.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
declare global {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
interface Window {
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
+
zerohash: any
|
|
5
|
+
}
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -10,76 +10,82 @@ declare global {
|
|
|
10
10
|
* required for initializing the platform SDK
|
|
11
11
|
*/
|
|
12
12
|
export interface IInitializeParameters {
|
|
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
|
-
|
|
13
|
+
/**
|
|
14
|
+
* zeroHashOnboardingURL should be set to the URL of
|
|
15
|
+
* the webapp for onboarding users onto the ZeroHash
|
|
16
|
+
* platform.
|
|
17
|
+
* @deprecated please use zeroHashAppsURL.
|
|
18
|
+
*/
|
|
19
|
+
zeroHashOnboardingURL?: string
|
|
20
|
+
/**
|
|
21
|
+
* rootQuerySelector is a query selector string that
|
|
22
|
+
* allows creating the ZeroHash UI subtree under a
|
|
23
|
+
* custom element.
|
|
24
|
+
*
|
|
25
|
+
* The default #zh-root query selector will be used
|
|
26
|
+
* instead otherwise. #zh-root will be a <div> appended
|
|
27
|
+
* as a child of the body in no specified order.
|
|
28
|
+
*/
|
|
29
|
+
rootQuerySelector?: string
|
|
30
|
+
/**
|
|
31
|
+
* userOnboardingJWT is the JWT that you received from
|
|
32
|
+
* the ZeroHash HTTP API that pertains to the customer
|
|
33
|
+
* to be onboarded.
|
|
34
|
+
*
|
|
35
|
+
* This is optional in the constructor and can be
|
|
36
|
+
* deferred to setUserOnboardingJWT() at a later time
|
|
37
|
+
* but must be provided before opening the onboarding
|
|
38
|
+
* UI in order for the onboarding UI to be loaded.
|
|
39
|
+
*/
|
|
40
|
+
userOnboardingJWT?: string
|
|
41
|
+
/**
|
|
42
|
+
* cryptoWithdrawalsJWT is the JWT that you received from
|
|
43
|
+
* the ZeroHash HTTP API and have specific permissions to
|
|
44
|
+
* perform crypto withdrawals.
|
|
45
|
+
*/
|
|
46
|
+
cryptoWithdrawalsJWT?: string
|
|
47
|
+
/**
|
|
48
|
+
* fiatDepositsJWT is the JWT that you received from
|
|
49
|
+
* the ZeroHash HTTP API and have specific permissions to
|
|
50
|
+
* perform Fiat Deposits.
|
|
51
|
+
*/
|
|
52
|
+
fiatDepositsJWT?: string
|
|
53
|
+
/**
|
|
54
|
+
* fiatWithdrawalsJWT is the JWT that you received from
|
|
55
|
+
* the ZeroHash HTTP API and have specific permissions to
|
|
56
|
+
* perform Fiat Withdrawals.
|
|
57
|
+
*/
|
|
58
|
+
fiatWithdrawalsJWT?: string
|
|
59
|
+
/**
|
|
60
|
+
* cryptoBuyJWT is the JWT that you received from
|
|
61
|
+
* the ZeroHash HTTP API and have specific permissions to
|
|
62
|
+
* perform Crypto Buy.
|
|
63
|
+
*/
|
|
64
|
+
cryptoBuyJWT?: string
|
|
65
|
+
/**
|
|
66
|
+
* cryptoSellJWT is the JWT that you received from
|
|
67
|
+
* the ZeroHash HTTP API and have specific permissions to
|
|
68
|
+
* perform Crypto Sell.
|
|
69
|
+
*/
|
|
70
|
+
cryptoSellJWT?: string
|
|
71
|
+
/**
|
|
72
|
+
* fundJWT is the JWT that you received from
|
|
73
|
+
* the ZeroHash HTTP API and have specific permissions to
|
|
74
|
+
* perform Fund operations.
|
|
75
|
+
*/
|
|
76
|
+
fundJWT?: string
|
|
77
|
+
/**
|
|
78
|
+
* profileJWT is the JWT that you received from
|
|
79
|
+
* the ZeroHash HTTP API and have specific permissions to
|
|
80
|
+
* perform Profile operations.
|
|
81
|
+
*/
|
|
82
|
+
profileJWT?: string
|
|
83
|
+
/**
|
|
84
|
+
* zeroHashAppsURL is the base URL for all our Apps.
|
|
85
|
+
* It defaults to https://web-sdk.zerohash.com/ and will
|
|
86
|
+
* be a replacement for zeroHashOnboardingURL.
|
|
87
|
+
*/
|
|
88
|
+
zeroHashAppsURL: string
|
|
83
89
|
}
|
|
84
90
|
|
|
85
91
|
/**
|
|
@@ -88,21 +94,21 @@ export interface IInitializeParameters {
|
|
|
88
94
|
* JWT.
|
|
89
95
|
*/
|
|
90
96
|
export interface ISetUserOnboardingJWTParameters {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
+
/**
|
|
98
|
+
* userOnboardingJWT is the JWT that you received from
|
|
99
|
+
* the ZeroHash HTTP API that pertains to the customer
|
|
100
|
+
* to be onboarded.
|
|
101
|
+
*/
|
|
102
|
+
userOnboardingJWT: string
|
|
97
103
|
}
|
|
98
104
|
|
|
99
105
|
export interface IOpenOnboardingModalParameters {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
/**
|
|
107
|
+
* userOnboardingJWT is the JWT that you received from
|
|
108
|
+
* the ZeroHash HTTP API that pertains to the customer
|
|
109
|
+
* to be onboarded.
|
|
110
|
+
*/
|
|
111
|
+
userOnboardingJWT?: string
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
/**
|
|
@@ -110,151 +116,166 @@ export interface IOpenOnboardingModalParameters {
|
|
|
110
116
|
* are registered that the host can handle.
|
|
111
117
|
*/
|
|
112
118
|
export enum IncomingMessageType {
|
|
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
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
119
|
+
/**
|
|
120
|
+
* OnboardingAppLoaded is received when the onboarding
|
|
121
|
+
* app has initialized.
|
|
122
|
+
*/
|
|
123
|
+
OnboardingAppLoaded = "ONBOARDING_APP_LOADED",
|
|
124
|
+
/**
|
|
125
|
+
* OnboardingCloseButtonClicked is received when the close button
|
|
126
|
+
* has been clicked in the onboarding app
|
|
127
|
+
*/
|
|
128
|
+
OnboardingCloseButtonClicked = "ONBOARDING_CLOSE_BUTTON_CLICKED",
|
|
129
|
+
/**
|
|
130
|
+
* OnboardingCompleted is received when the onboarding flow has completed
|
|
131
|
+
* successfully with participant approved and webview can be closed.
|
|
132
|
+
*/
|
|
133
|
+
OnboardingCompleted = "ONBOARDING_COMPLETED",
|
|
134
|
+
/**
|
|
135
|
+
* OnboardingFailed is received when the onboarding
|
|
136
|
+
* flow has failed.
|
|
137
|
+
*/
|
|
138
|
+
OnboardingFailed = "ONBOARDING_FAILED",
|
|
139
|
+
/**
|
|
140
|
+
* OnboardingPendingApproval is received when the onboarding
|
|
141
|
+
* flow has completed successfully but the participant is pending approval.
|
|
142
|
+
*/
|
|
143
|
+
OnboardingPendingApproval = "ONBOARDING_PENDING_APPROVAL",
|
|
144
|
+
/**
|
|
145
|
+
* CryptoWithdrawalsAppLoaded is received when the crypto
|
|
146
|
+
* withdrawals app has initialized.
|
|
147
|
+
*/
|
|
148
|
+
CryptoWithdrawalsAppLoaded = "CRYPTO_WITHDRAWALS_APP_LOADED",
|
|
149
|
+
/**
|
|
150
|
+
* CryptoWithdrawalsCloseButtonClicked is received when the close button
|
|
151
|
+
* has been clicked in the Crypto Withdrawals app
|
|
152
|
+
*/
|
|
153
|
+
CryptoWithdrawalsCloseButtonClicked = "CRYPTO_WITHDRAWALS_CLOSE_BUTTON_CLICKED",
|
|
154
|
+
/**
|
|
155
|
+
* CryptoWithdrawalsCompleted is received when the Crypto
|
|
156
|
+
* withdrawals flow has completed successfully.
|
|
157
|
+
*/
|
|
158
|
+
CryptoWithdrawalsCompleted = "CRYPTO_WITHDRAWALS_COMPLETED",
|
|
159
|
+
/**
|
|
160
|
+
* CryptoWithdrawalsFailed is received when the Crypto
|
|
161
|
+
* withdrawals flow has failed.
|
|
162
|
+
*/
|
|
163
|
+
CryptoWithdrawalsFailed = "CRYPTO_WITHDRAWALS_FAILED",
|
|
164
|
+
/**
|
|
165
|
+
* FiatDepositsAppLoaded is received when the Fiat
|
|
166
|
+
* deposits app has initialized.
|
|
167
|
+
*/
|
|
168
|
+
FiatDepositsAppLoaded = "FIAT_DEPOSITS_APP_LOADED",
|
|
169
|
+
/**
|
|
170
|
+
* FiatDepositsCloseButtonClicked is received when the close button
|
|
171
|
+
* has been clicked in the Fiat Deposits app
|
|
172
|
+
*/
|
|
173
|
+
FiatDepositsCloseButtonClicked = "FIAT_DEPOSITS_CLOSE_BUTTON_CLICKED",
|
|
174
|
+
/**
|
|
175
|
+
* FiatDepositsCompleted is received when the Fiat
|
|
176
|
+
* deposits flow has completed successfully.
|
|
177
|
+
*/
|
|
178
|
+
FiatDepositsCompleted = "FIAT_DEPOSITS_COMPLETED",
|
|
179
|
+
/**
|
|
180
|
+
* FiatDepositsFailed is received when the Fiat
|
|
181
|
+
* deposits flow has failed.
|
|
182
|
+
*/
|
|
183
|
+
FiatDepositsFailed = "FIAT_DEPOSITS_FAILED",
|
|
184
|
+
/**
|
|
185
|
+
* FiatWithdrawalsAppLoaded is received when the Fiat
|
|
186
|
+
* withdrawals app has initialized.
|
|
187
|
+
*/
|
|
188
|
+
FiatWithdrawalsAppLoaded = "FIAT_WITHDRAWALS_APP_LOADED",
|
|
189
|
+
/**
|
|
190
|
+
* FiatWithdrawalsCloseButtonClicked is received when the close button
|
|
191
|
+
* has been clicked in the Fiat Withdrawals app
|
|
192
|
+
*/
|
|
193
|
+
FiatWithdrawalsCloseButtonClicked = "FIAT_WITHDRAWALS_CLOSE_BUTTON_CLICKED",
|
|
194
|
+
/**
|
|
195
|
+
* FiatWithdrawalsCompleted is received when the Fiat
|
|
196
|
+
* withdrawals flow has completed successfully.
|
|
197
|
+
*/
|
|
198
|
+
FiatWithdrawalsCompleted = "FIAT_WITHDRAWALS_COMPLETED",
|
|
199
|
+
/**
|
|
200
|
+
* FiatWithdrawalsFailed is received when the Fiat
|
|
201
|
+
* withdrawals flow has failed.
|
|
202
|
+
*/
|
|
203
|
+
FiatWithdrawalsFailed = "FIAT_WITHDRAWALS_FAILED",
|
|
204
|
+
/**
|
|
205
|
+
* CryptoBuyAppLoaded is received when the Crypto
|
|
206
|
+
* buy app has initialized.
|
|
207
|
+
*/
|
|
208
|
+
CryptoBuyAppLoaded = "CRYPTO_BUY_APP_LOADED",
|
|
209
|
+
/**
|
|
210
|
+
* CryptoBuyCloseButtonClicked is received when the close button
|
|
211
|
+
* has been clicked in the Crypto buy app
|
|
212
|
+
*/
|
|
213
|
+
CryptoBuyCloseButtonClicked = "CRYPTO_BUY_CLOSE_BUTTON_CLICKED",
|
|
214
|
+
/**
|
|
215
|
+
* CryptoBuyCompleted is received when the Crypto
|
|
216
|
+
* buy flow flow has completed successfully.
|
|
217
|
+
*/
|
|
218
|
+
CryptoBuyCompleted = "CRYPTO_BUY_COMPLETED",
|
|
219
|
+
/**
|
|
220
|
+
* CryptoBuyFailed is received when the Crypto
|
|
221
|
+
* buy flow has failed.
|
|
222
|
+
*/
|
|
223
|
+
CryptoBuyFailed = "CRYPTO_BUY_FAILED",
|
|
224
|
+
/**
|
|
225
|
+
* CryptoSellAppLoaded is received when the Crypto
|
|
226
|
+
* sell app has initialized.
|
|
227
|
+
*/
|
|
228
|
+
CryptoSellAppLoaded = "CRYPTO_SELL_APP_LOADED",
|
|
229
|
+
/**
|
|
230
|
+
* CryptoSellCloseButtonClicked is received when the close button
|
|
231
|
+
* has been clicked in the Crypto sell app
|
|
232
|
+
*/
|
|
233
|
+
CryptoSellCloseButtonClicked = "CRYPTO_SELL_CLOSE_BUTTON_CLICKED",
|
|
234
|
+
/**
|
|
235
|
+
* CryptoSellCompleted is received when the Crypto
|
|
236
|
+
* sell flow has completed successfully.
|
|
237
|
+
*/
|
|
238
|
+
CryptoSellCompleted = "CRYPTO_SELL_COMPLETED",
|
|
239
|
+
/**
|
|
240
|
+
* CryptoSellFailed is received when the Crypto
|
|
241
|
+
* sell flow has failed.
|
|
242
|
+
*/
|
|
243
|
+
CryptoSellFailed = "CRYPTO_SELL_FAILED",
|
|
244
|
+
/**
|
|
245
|
+
* FundAppLoaded is received when the Fund
|
|
246
|
+
* app has initialized.
|
|
247
|
+
*/
|
|
248
|
+
FundAppLoaded = "FUND_APP_LOADED",
|
|
249
|
+
/**
|
|
250
|
+
* FundCloseButtonClicked is received when the close button
|
|
251
|
+
* has been clicked in the Fund app
|
|
252
|
+
*/
|
|
253
|
+
FundCloseButtonClicked = "FUND_CLOSE_BUTTON_CLICKED",
|
|
254
|
+
/**
|
|
255
|
+
* FundCompleted is received when the
|
|
256
|
+
* Fund flow has completed successfully.
|
|
257
|
+
*/
|
|
258
|
+
FundCompleted = "FUND_COMPLETED",
|
|
259
|
+
/**
|
|
260
|
+
* FundFailed is received when the
|
|
261
|
+
* Fund flow has failed.
|
|
262
|
+
*/
|
|
263
|
+
FundFailed = "FUND_FAILED",
|
|
264
|
+
/**
|
|
265
|
+
* ProfileAppLoaded is received when the Profile
|
|
266
|
+
* app has initialized.
|
|
267
|
+
*/
|
|
268
|
+
ProfileAppLoaded = "PROFILE_APP_LOADED",
|
|
269
|
+
/**
|
|
270
|
+
* ProfileCloseButtonClicked is received when the close button
|
|
271
|
+
* has been clicked in the Profile app
|
|
246
272
|
*/
|
|
247
|
-
|
|
273
|
+
ProfileCloseButtonClicked = "PROFILE_CLOSE_BUTTON_CLICKED",
|
|
248
274
|
/**
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
*/
|
|
252
|
-
FundCompleted = "FUND_COMPLETED",
|
|
253
|
-
/**
|
|
254
|
-
* FundFailed is received when the
|
|
255
|
-
* Fund flow has failed.
|
|
275
|
+
* ProfileFailed is received when the
|
|
276
|
+
* Profile flow has failed.
|
|
256
277
|
*/
|
|
257
|
-
|
|
278
|
+
ProfileFailed = "PROFILE_FAILED",
|
|
258
279
|
}
|
|
259
280
|
|
|
260
281
|
/**
|
|
@@ -262,16 +283,16 @@ export enum IncomingMessageType {
|
|
|
262
283
|
* message
|
|
263
284
|
*/
|
|
264
285
|
export interface IncomingMessage {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
286
|
+
/**
|
|
287
|
+
* type is the type of message that is used for routing
|
|
288
|
+
* the request to the appropriate handler
|
|
289
|
+
*/
|
|
290
|
+
type: IncomingMessageType
|
|
291
|
+
/**
|
|
292
|
+
* payload is any freeform value that pertains to the
|
|
293
|
+
* request
|
|
294
|
+
*/
|
|
295
|
+
payload: unknown
|
|
275
296
|
}
|
|
276
297
|
|
|
277
298
|
export type IncomingMessageHandler = (payload: unknown) => void;
|
|
@@ -280,10 +301,10 @@ export type IncomingMessageHandler = (payload: unknown) => void;
|
|
|
280
301
|
* IZeroHashSDK is the interface that you may use to interact with the ZeroHash SDK.
|
|
281
302
|
*/
|
|
282
303
|
export interface IZeroHashSDK {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
304
|
+
setUserOnboardingJWT(params: ISetUserOnboardingJWTParameters): void
|
|
305
|
+
isOnboardingModalOpen(): boolean
|
|
306
|
+
openOnboardingModal(params: IOpenOnboardingModalParameters): void
|
|
307
|
+
closeOnboardingModal(): void
|
|
287
308
|
}
|
|
288
309
|
|
|
289
310
|
/**
|
|
@@ -291,55 +312,75 @@ export interface IZeroHashSDK {
|
|
|
291
312
|
* the requested action, i.e. sdk.setJWT(AppIdentifier.ONBOARDING)
|
|
292
313
|
*/
|
|
293
314
|
export enum AppIdentifier {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
315
|
+
ONBOARDING = "onboarding",
|
|
316
|
+
CRYPTO_WITHDRAWALS = "crypto-withdrawals",
|
|
317
|
+
FIAT_DEPOSITS = "fiat-deposits",
|
|
318
|
+
FIAT_WITHDRAWALS = "fiat-withdrawals",
|
|
319
|
+
CRYPTO_BUY = "crypto-buy",
|
|
320
|
+
CRYPTO_SELL = "crypto-sell",
|
|
321
|
+
CSP_CRYPTO_WITHDRAWALS = "csp-crypto-withdrawals",
|
|
322
|
+
CSP_FIAT_WITHDRAWALS = "csp-fiat-withdrawals",
|
|
323
|
+
CSP_CRYPTO_SELL = "csp-crypto-sell",
|
|
324
|
+
FUND = "fund",
|
|
325
|
+
PROFILE = "profile"
|
|
304
326
|
}
|
|
305
327
|
|
|
306
328
|
/**
|
|
307
329
|
* Map that maps the app AppIdentifier to the redux action prefix
|
|
308
330
|
*/
|
|
309
331
|
export const appIdentifierToActionPrefixMap = new Map(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
]
|
|
332
|
+
[
|
|
333
|
+
[AppIdentifier.ONBOARDING, "ONBOARDING_"],
|
|
334
|
+
[AppIdentifier.CRYPTO_WITHDRAWALS, "CRYPTO_WITHDRAWALS_"],
|
|
335
|
+
[AppIdentifier.FIAT_DEPOSITS, "FIAT_DEPOSITS_"],
|
|
336
|
+
[AppIdentifier.FIAT_WITHDRAWALS, "FIAT_WITHDRAWALS_"],
|
|
337
|
+
[AppIdentifier.CRYPTO_BUY, "CRYPTO_BUY_"],
|
|
338
|
+
[AppIdentifier.CRYPTO_SELL, "CRYPTO_SELL_"],
|
|
339
|
+
[AppIdentifier.CSP_CRYPTO_WITHDRAWALS, "CRYPTO_WITHDRAWALS_"], // CSP apps uses the same events as "regular" flow
|
|
340
|
+
[AppIdentifier.CSP_FIAT_WITHDRAWALS, "FIAT_WITHDRAWALS_"], // CSP apps uses the same events as "regular" flow
|
|
341
|
+
[AppIdentifier.CSP_CRYPTO_SELL, "CRYPTO_SELL_"],
|
|
342
|
+
[AppIdentifier.CSP_CRYPTO_SELL, "CRYPTO_SELL_"],
|
|
343
|
+
[AppIdentifier.FUND, "FUND_"],
|
|
344
|
+
[AppIdentifier.PROFILE, "PROFILE_"],
|
|
345
|
+
])
|
|
323
346
|
|
|
324
347
|
export interface ISetJWTParameters {
|
|
325
|
-
|
|
326
|
-
|
|
348
|
+
jwt: string;
|
|
349
|
+
appIdentifier: AppIdentifier;
|
|
327
350
|
}
|
|
328
351
|
|
|
329
352
|
export interface Filters {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
353
|
+
getAssets?: {
|
|
354
|
+
deposit_address_creation?: string
|
|
355
|
+
stablecoin?: boolean
|
|
356
|
+
}
|
|
334
357
|
}
|
|
335
358
|
|
|
336
359
|
export interface IOpenModalParameters {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
360
|
+
jwt?: string;
|
|
361
|
+
appIdentifier: AppIdentifier;
|
|
362
|
+
filters?: Filters;
|
|
363
|
+
navigate?: Page;
|
|
340
364
|
}
|
|
341
365
|
|
|
342
366
|
export interface ISetFiltersParameters {
|
|
343
|
-
|
|
344
|
-
|
|
367
|
+
appIdentifier: AppIdentifier;
|
|
368
|
+
filters?: Filters;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export interface EditAddress {
|
|
372
|
+
to: "edit-address";
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Since we may extend this in the future, we use a union type to make it easy
|
|
376
|
+
* to allow for example a new CryptoBuyPage type to be added in the future or
|
|
377
|
+
* new pages for the Onboarding App with specialized props.
|
|
378
|
+
* Page is expected to be a union of "AppPage" and each App shall have it's own
|
|
379
|
+
* union of pages, such as EditAddress.
|
|
380
|
+
*/
|
|
381
|
+
export type OnboardingPage = EditAddress;
|
|
382
|
+
export type Page = OnboardingPage;
|
|
383
|
+
export interface ISetNavigateParameters {
|
|
384
|
+
appIdentifier: AppIdentifier;
|
|
385
|
+
navigate: Page;
|
|
345
386
|
}
|