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/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,76 @@ 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
- * fundWithCryptoJWT is the JWT that you received from
73
- * the ZeroHash HTTP API and have specific permissions to
74
- * perform Fund With Crypto operations.
75
- */
76
- fundWithCryptoJWT?: 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
+ * 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
- * 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
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
- * 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
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
- * 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
- * FundWithCryptoAppLoaded is received when the Fund Witch Crypto
240
- * app has initialized.
241
- */
242
- FundWithCryptoAppLoaded = "FUND_WITH_CRYPTO_APP_LOADED",
243
- /**
244
- * FundWithCryptoCloseButtonClicked is received when the close button
245
- * has been clicked in the Fund With Crypto app
246
- */
247
- FundWithCryptoCloseButtonClicked = "FUND_WITH_CRYPTO_CLOSE_BUTTON_CLICKED",
248
- /**
249
- * FundWithCryptoCompleted is received when the
250
- * Fund With Crypto flow has completed successfully.
251
- */
252
- FundWithCryptoCompleted = "FUND_WITH_CRYPTO_COMPLETED",
253
- /**
254
- * FundWithCryptoFailed is received when the
255
- * Fund With Crypto flow has failed.
256
- */
257
- FundWithCryptoFailed = "FUND_WITH_CRYPTO_FAILED",
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
- * 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
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
- setUserOnboardingJWT(params: ISetUserOnboardingJWTParameters): void
284
- isOnboardingModalOpen(): boolean
285
- openOnboardingModal(params: IOpenOnboardingModalParameters): void
286
- closeOnboardingModal(): void
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
- 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_WITH_CRYPTO = "fund-with-crypto"
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
- [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_WITH_CRYPTO, "FUND_WITH_CRYPTO_"],
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
- jwt: string;
326
- appIdentifier: AppIdentifier;
325
+ jwt: string;
326
+ appIdentifier: AppIdentifier;
327
327
  }
328
328
 
329
329
  export interface Filters {
330
- getAssets?: {
331
- deposit_address_creation?: string
332
- stablecoin?: boolean
333
- }
330
+ getAssets?: {
331
+ deposit_address_creation?: string
332
+ stablecoin?: boolean
333
+ }
334
334
  }
335
335
 
336
336
  export interface IOpenModalParameters {
337
- jwt?: string;
338
- appIdentifier: AppIdentifier;
339
- filters?: Filters;
337
+ jwt?: string;
338
+ appIdentifier: AppIdentifier;
339
+ filters?: Filters;
340
+ navigate?: Page;
340
341
  }
341
342
 
342
343
  export interface ISetFiltersParameters {
343
- appIdentifier: AppIdentifier;
344
- filters?: Filters
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;