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/src/types.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  declare global {
2
- interface Window {
3
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
- zerohash: any
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
- * 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
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
- * 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
+ /**
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
- * 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
+ /**
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
- * 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
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
- FundCloseButtonClicked = "FUND_CLOSE_BUTTON_CLICKED",
273
+ ProfileCloseButtonClicked = "PROFILE_CLOSE_BUTTON_CLICKED",
248
274
  /**
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.
275
+ * ProfileFailed is received when the
276
+ * Profile flow has failed.
256
277
  */
257
- FundFailed = "FUND_FAILED",
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
- * 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
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
- setUserOnboardingJWT(params: ISetUserOnboardingJWTParameters): void
284
- isOnboardingModalOpen(): boolean
285
- openOnboardingModal(params: IOpenOnboardingModalParameters): void
286
- closeOnboardingModal(): void
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
- 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"
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
- [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
- ])
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
- jwt: string;
326
- appIdentifier: AppIdentifier;
348
+ jwt: string;
349
+ appIdentifier: AppIdentifier;
327
350
  }
328
351
 
329
352
  export interface Filters {
330
- getAssets?: {
331
- deposit_address_creation?: string
332
- stablecoin?: boolean
333
- }
353
+ getAssets?: {
354
+ deposit_address_creation?: string
355
+ stablecoin?: boolean
356
+ }
334
357
  }
335
358
 
336
359
  export interface IOpenModalParameters {
337
- jwt?: string;
338
- appIdentifier: AppIdentifier;
339
- filters?: Filters;
360
+ jwt?: string;
361
+ appIdentifier: AppIdentifier;
362
+ filters?: Filters;
363
+ navigate?: Page;
340
364
  }
341
365
 
342
366
  export interface ISetFiltersParameters {
343
- appIdentifier: AppIdentifier;
344
- filters?: Filters
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
  }