zh-web-sdk 2.7.2 → 2.8.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/fund.d.ts +13 -0
- package/dist/redux/reducers/index.d.ts +2 -2
- package/dist/redux/reducers/onboarding.d.ts +3 -0
- package/dist/redux/store/index.d.ts +2 -2
- package/dist/types.d.ts +32 -15
- package/package.json +1 -1
- package/src/iframe-container/AppContainer.tsx +36 -5
- package/src/index.tsx +27 -17
- package/src/redux/reducers/constants.ts +2 -1
- package/src/redux/reducers/fund.ts +63 -0
- package/src/redux/reducers/index.ts +2 -2
- package/src/redux/reducers/onboarding.ts +12 -2
- package/src/types.ts +297 -279
- package/dist/redux/reducers/fund-with-crypto.d.ts +0 -13
- package/src/redux/reducers/fund-with-crypto.ts +0 -63
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,76 @@ 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
|
+
* zeroHashAppsURL is the base URL for all our Apps.
|
|
79
|
+
* It defaults to https://web-sdk.zerohash.com/ and will
|
|
80
|
+
* be a replacement for zeroHashOnboardingURL.
|
|
81
|
+
*/
|
|
82
|
+
zeroHashAppsURL: string
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/**
|
|
@@ -88,21 +88,21 @@ export interface IInitializeParameters {
|
|
|
88
88
|
* JWT.
|
|
89
89
|
*/
|
|
90
90
|
export interface ISetUserOnboardingJWTParameters {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
/**
|
|
92
|
+
* userOnboardingJWT is the JWT that you received from
|
|
93
|
+
* the ZeroHash HTTP API that pertains to the customer
|
|
94
|
+
* to be onboarded.
|
|
95
|
+
*/
|
|
96
|
+
userOnboardingJWT: string
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
export interface IOpenOnboardingModalParameters {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
/**
|
|
101
|
+
* userOnboardingJWT is the JWT that you received from
|
|
102
|
+
* the ZeroHash HTTP API that pertains to the customer
|
|
103
|
+
* to be onboarded.
|
|
104
|
+
*/
|
|
105
|
+
userOnboardingJWT?: string
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
/**
|
|
@@ -110,151 +110,151 @@ export interface IOpenOnboardingModalParameters {
|
|
|
110
110
|
* are registered that the host can handle.
|
|
111
111
|
*/
|
|
112
112
|
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
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
113
|
+
/**
|
|
114
|
+
* OnboardingAppLoaded is received when the onboarding
|
|
115
|
+
* app has initialized.
|
|
116
|
+
*/
|
|
117
|
+
OnboardingAppLoaded = "ONBOARDING_APP_LOADED",
|
|
118
|
+
/**
|
|
119
|
+
* OnboardingCloseButtonClicked is received when the close button
|
|
120
|
+
* has been clicked in the onboarding app
|
|
121
|
+
*/
|
|
122
|
+
OnboardingCloseButtonClicked = "ONBOARDING_CLOSE_BUTTON_CLICKED",
|
|
123
|
+
/**
|
|
124
|
+
* OnboardingCompleted is received when the onboarding flow has completed
|
|
125
|
+
* successfully with participant approved and webview can be closed.
|
|
126
|
+
*/
|
|
127
|
+
OnboardingCompleted = "ONBOARDING_COMPLETED",
|
|
128
|
+
/**
|
|
129
|
+
* OnboardingFailed is received when the onboarding
|
|
130
|
+
* flow has failed.
|
|
131
|
+
*/
|
|
132
|
+
OnboardingFailed = "ONBOARDING_FAILED",
|
|
133
|
+
/**
|
|
134
|
+
* OnboardingPendingApproval is received when the onboarding
|
|
135
|
+
* flow has completed successfully but the participant is pending approval.
|
|
136
|
+
*/
|
|
137
|
+
OnboardingPendingApproval = "ONBOARDING_PENDING_APPROVAL",
|
|
138
|
+
/**
|
|
139
|
+
* CryptoWithdrawalsAppLoaded is received when the crypto
|
|
140
|
+
* withdrawals app has initialized.
|
|
141
|
+
*/
|
|
142
|
+
CryptoWithdrawalsAppLoaded = "CRYPTO_WITHDRAWALS_APP_LOADED",
|
|
143
|
+
/**
|
|
144
|
+
* CryptoWithdrawalsCloseButtonClicked is received when the close button
|
|
145
|
+
* has been clicked in the Crypto Withdrawals app
|
|
146
|
+
*/
|
|
147
|
+
CryptoWithdrawalsCloseButtonClicked = "CRYPTO_WITHDRAWALS_CLOSE_BUTTON_CLICKED",
|
|
148
|
+
/**
|
|
149
|
+
* CryptoWithdrawalsCompleted is received when the Crypto
|
|
150
|
+
* withdrawals flow has completed successfully.
|
|
151
|
+
*/
|
|
152
|
+
CryptoWithdrawalsCompleted = "CRYPTO_WITHDRAWALS_COMPLETED",
|
|
153
|
+
/**
|
|
154
|
+
* CryptoWithdrawalsFailed is received when the Crypto
|
|
155
|
+
* withdrawals flow has failed.
|
|
156
|
+
*/
|
|
157
|
+
CryptoWithdrawalsFailed = "CRYPTO_WITHDRAWALS_FAILED",
|
|
158
|
+
/**
|
|
159
|
+
* FiatDepositsAppLoaded is received when the Fiat
|
|
160
|
+
* deposits app has initialized.
|
|
161
|
+
*/
|
|
162
|
+
FiatDepositsAppLoaded = "FIAT_DEPOSITS_APP_LOADED",
|
|
163
|
+
/**
|
|
164
|
+
* FiatDepositsCloseButtonClicked is received when the close button
|
|
165
|
+
* has been clicked in the Fiat Deposits app
|
|
166
|
+
*/
|
|
167
|
+
FiatDepositsCloseButtonClicked = "FIAT_DEPOSITS_CLOSE_BUTTON_CLICKED",
|
|
168
|
+
/**
|
|
169
|
+
* FiatDepositsCompleted is received when the Fiat
|
|
170
|
+
* deposits flow has completed successfully.
|
|
171
|
+
*/
|
|
172
|
+
FiatDepositsCompleted = "FIAT_DEPOSITS_COMPLETED",
|
|
173
|
+
/**
|
|
174
|
+
* FiatDepositsFailed is received when the Fiat
|
|
175
|
+
* deposits flow has failed.
|
|
176
|
+
*/
|
|
177
|
+
FiatDepositsFailed = "FIAT_DEPOSITS_FAILED",
|
|
178
|
+
/**
|
|
179
|
+
* FiatWithdrawalsAppLoaded is received when the Fiat
|
|
180
|
+
* withdrawals app has initialized.
|
|
181
|
+
*/
|
|
182
|
+
FiatWithdrawalsAppLoaded = "FIAT_WITHDRAWALS_APP_LOADED",
|
|
183
|
+
/**
|
|
184
|
+
* FiatWithdrawalsCloseButtonClicked is received when the close button
|
|
185
|
+
* has been clicked in the Fiat Withdrawals app
|
|
186
|
+
*/
|
|
187
|
+
FiatWithdrawalsCloseButtonClicked = "FIAT_WITHDRAWALS_CLOSE_BUTTON_CLICKED",
|
|
188
|
+
/**
|
|
189
|
+
* FiatWithdrawalsCompleted is received when the Fiat
|
|
190
|
+
* withdrawals flow has completed successfully.
|
|
191
|
+
*/
|
|
192
|
+
FiatWithdrawalsCompleted = "FIAT_WITHDRAWALS_COMPLETED",
|
|
193
|
+
/**
|
|
194
|
+
* FiatWithdrawalsFailed is received when the Fiat
|
|
195
|
+
* withdrawals flow has failed.
|
|
196
|
+
*/
|
|
197
|
+
FiatWithdrawalsFailed = "FIAT_WITHDRAWALS_FAILED",
|
|
198
|
+
/**
|
|
199
|
+
* CryptoBuyAppLoaded is received when the Crypto
|
|
200
|
+
* buy app has initialized.
|
|
201
|
+
*/
|
|
202
|
+
CryptoBuyAppLoaded = "CRYPTO_BUY_APP_LOADED",
|
|
203
|
+
/**
|
|
204
|
+
* CryptoBuyCloseButtonClicked is received when the close button
|
|
205
|
+
* has been clicked in the Crypto buy app
|
|
206
|
+
*/
|
|
207
|
+
CryptoBuyCloseButtonClicked = "CRYPTO_BUY_CLOSE_BUTTON_CLICKED",
|
|
208
|
+
/**
|
|
209
|
+
* CryptoBuyCompleted is received when the Crypto
|
|
210
|
+
* buy flow flow has completed successfully.
|
|
211
|
+
*/
|
|
212
|
+
CryptoBuyCompleted = "CRYPTO_BUY_COMPLETED",
|
|
213
|
+
/**
|
|
214
|
+
* CryptoBuyFailed is received when the Crypto
|
|
215
|
+
* buy flow has failed.
|
|
216
|
+
*/
|
|
217
|
+
CryptoBuyFailed = "CRYPTO_BUY_FAILED",
|
|
218
|
+
/**
|
|
219
|
+
* CryptoSellAppLoaded is received when the Crypto
|
|
220
|
+
* sell app has initialized.
|
|
221
|
+
*/
|
|
222
|
+
CryptoSellAppLoaded = "CRYPTO_SELL_APP_LOADED",
|
|
223
|
+
/**
|
|
224
|
+
* CryptoSellCloseButtonClicked is received when the close button
|
|
225
|
+
* has been clicked in the Crypto sell app
|
|
226
|
+
*/
|
|
227
|
+
CryptoSellCloseButtonClicked = "CRYPTO_SELL_CLOSE_BUTTON_CLICKED",
|
|
228
|
+
/**
|
|
229
|
+
* CryptoSellCompleted is received when the Crypto
|
|
230
|
+
* sell flow has completed successfully.
|
|
231
|
+
*/
|
|
232
|
+
CryptoSellCompleted = "CRYPTO_SELL_COMPLETED",
|
|
233
|
+
/**
|
|
234
|
+
* CryptoSellFailed is received when the Crypto
|
|
235
|
+
* sell flow has failed.
|
|
236
|
+
*/
|
|
237
|
+
CryptoSellFailed = "CRYPTO_SELL_FAILED",
|
|
238
|
+
/**
|
|
239
|
+
* FundAppLoaded is received when the Fund
|
|
240
|
+
* app has initialized.
|
|
241
|
+
*/
|
|
242
|
+
FundAppLoaded = "FUND_APP_LOADED",
|
|
243
|
+
/**
|
|
244
|
+
* FundCloseButtonClicked is received when the close button
|
|
245
|
+
* has been clicked in the Fund app
|
|
246
|
+
*/
|
|
247
|
+
FundCloseButtonClicked = "FUND_CLOSE_BUTTON_CLICKED",
|
|
248
|
+
/**
|
|
249
|
+
* FundCompleted is received when the
|
|
250
|
+
* Fund flow has completed successfully.
|
|
251
|
+
*/
|
|
252
|
+
FundCompleted = "FUND_COMPLETED",
|
|
253
|
+
/**
|
|
254
|
+
* FundFailed is received when the
|
|
255
|
+
* Fund flow has failed.
|
|
256
|
+
*/
|
|
257
|
+
FundFailed = "FUND_FAILED",
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
/**
|
|
@@ -262,16 +262,16 @@ export enum IncomingMessageType {
|
|
|
262
262
|
* message
|
|
263
263
|
*/
|
|
264
264
|
export interface IncomingMessage {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
265
|
+
/**
|
|
266
|
+
* type is the type of message that is used for routing
|
|
267
|
+
* the request to the appropriate handler
|
|
268
|
+
*/
|
|
269
|
+
type: IncomingMessageType
|
|
270
|
+
/**
|
|
271
|
+
* payload is any freeform value that pertains to the
|
|
272
|
+
* request
|
|
273
|
+
*/
|
|
274
|
+
payload: unknown
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
export type IncomingMessageHandler = (payload: unknown) => void;
|
|
@@ -280,10 +280,10 @@ export type IncomingMessageHandler = (payload: unknown) => void;
|
|
|
280
280
|
* IZeroHashSDK is the interface that you may use to interact with the ZeroHash SDK.
|
|
281
281
|
*/
|
|
282
282
|
export interface IZeroHashSDK {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
283
|
+
setUserOnboardingJWT(params: ISetUserOnboardingJWTParameters): void
|
|
284
|
+
isOnboardingModalOpen(): boolean
|
|
285
|
+
openOnboardingModal(params: IOpenOnboardingModalParameters): void
|
|
286
|
+
closeOnboardingModal(): void
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
/**
|
|
@@ -291,55 +291,73 @@ export interface IZeroHashSDK {
|
|
|
291
291
|
* the requested action, i.e. sdk.setJWT(AppIdentifier.ONBOARDING)
|
|
292
292
|
*/
|
|
293
293
|
export enum AppIdentifier {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
294
|
+
ONBOARDING = "onboarding",
|
|
295
|
+
CRYPTO_WITHDRAWALS = "crypto-withdrawals",
|
|
296
|
+
FIAT_DEPOSITS = "fiat-deposits",
|
|
297
|
+
FIAT_WITHDRAWALS = "fiat-withdrawals",
|
|
298
|
+
CRYPTO_BUY = "crypto-buy",
|
|
299
|
+
CRYPTO_SELL = "crypto-sell",
|
|
300
|
+
CSP_CRYPTO_WITHDRAWALS = "csp-crypto-withdrawals",
|
|
301
|
+
CSP_FIAT_WITHDRAWALS = "csp-fiat-withdrawals",
|
|
302
|
+
CSP_CRYPTO_SELL = "csp-crypto-sell",
|
|
303
|
+
FUND = "fund"
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
/**
|
|
307
307
|
* Map that maps the app AppIdentifier to the redux action prefix
|
|
308
308
|
*/
|
|
309
309
|
export const appIdentifierToActionPrefixMap = new Map(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
310
|
+
[
|
|
311
|
+
[AppIdentifier.ONBOARDING, "ONBOARDING_"],
|
|
312
|
+
[AppIdentifier.CRYPTO_WITHDRAWALS, "CRYPTO_WITHDRAWALS_"],
|
|
313
|
+
[AppIdentifier.FIAT_DEPOSITS, "FIAT_DEPOSITS_"],
|
|
314
|
+
[AppIdentifier.FIAT_WITHDRAWALS, "FIAT_WITHDRAWALS_"],
|
|
315
|
+
[AppIdentifier.CRYPTO_BUY, "CRYPTO_BUY_"],
|
|
316
|
+
[AppIdentifier.CRYPTO_SELL, "CRYPTO_SELL_"],
|
|
317
|
+
[AppIdentifier.CSP_CRYPTO_WITHDRAWALS, "CRYPTO_WITHDRAWALS_"], // CSP apps uses the same events as "regular" flow
|
|
318
|
+
[AppIdentifier.CSP_FIAT_WITHDRAWALS, "FIAT_WITHDRAWALS_"], // CSP apps uses the same events as "regular" flow
|
|
319
|
+
[AppIdentifier.CSP_CRYPTO_SELL, "CRYPTO_SELL_"],
|
|
320
|
+
[AppIdentifier.CSP_CRYPTO_SELL, "CRYPTO_SELL_"],
|
|
321
|
+
[AppIdentifier.FUND, "FUND_"],
|
|
322
|
+
])
|
|
323
323
|
|
|
324
324
|
export interface ISetJWTParameters {
|
|
325
|
-
|
|
326
|
-
|
|
325
|
+
jwt: string;
|
|
326
|
+
appIdentifier: AppIdentifier;
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
export interface Filters {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
330
|
+
getAssets?: {
|
|
331
|
+
deposit_address_creation?: string
|
|
332
|
+
stablecoin?: boolean
|
|
333
|
+
}
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
export interface IOpenModalParameters {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
337
|
+
jwt?: string;
|
|
338
|
+
appIdentifier: AppIdentifier;
|
|
339
|
+
filters?: Filters;
|
|
340
|
+
navigate?: Page;
|
|
340
341
|
}
|
|
341
342
|
|
|
342
343
|
export interface ISetFiltersParameters {
|
|
343
|
-
|
|
344
|
-
|
|
344
|
+
appIdentifier: AppIdentifier;
|
|
345
|
+
filters?: Filters;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export interface EditAddress {
|
|
349
|
+
to: "edit-address";
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Since we may extend this in the future, we use a union type to make it easy
|
|
353
|
+
* to allow for example a new CryptoBuyPage type to be added in the future or
|
|
354
|
+
* new pages for the Onboarding App with specialized props.
|
|
355
|
+
* Page is expected to be a union of "AppPage" and each App shall have it's own
|
|
356
|
+
* union of pages, such as EditAddress.
|
|
357
|
+
*/
|
|
358
|
+
export type OnboardingPage = EditAddress;
|
|
359
|
+
export type Page = OnboardingPage;
|
|
360
|
+
export interface ISetNavigateParameters {
|
|
361
|
+
appIdentifier: AppIdentifier;
|
|
362
|
+
navigate: Page;
|
|
345
363
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface IFundWithCryptoState {
|
|
2
|
-
jwt: string;
|
|
3
|
-
isAppLoaded: boolean;
|
|
4
|
-
isAppActive: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface IFundWithCryptoAction {
|
|
7
|
-
type: string;
|
|
8
|
-
jwt?: string;
|
|
9
|
-
isAppActive?: boolean;
|
|
10
|
-
isAppLoaded?: boolean;
|
|
11
|
-
}
|
|
12
|
-
declare const fundWithCryptoReducer: (state: IFundWithCryptoState | undefined, action: IFundWithCryptoAction) => IFundWithCryptoState;
|
|
13
|
-
export default fundWithCryptoReducer;
|