zh-web-sdk 2.12.1 → 2.12.2
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/index.d.ts +2 -2
- package/dist/index.js +27 -27
- package/dist/index.js.map +4 -4
- package/dist/redux/reducers/fiat-account-link.d.ts +13 -0
- package/dist/redux/reducers/index.d.ts +1 -0
- package/dist/redux/store/index.d.ts +1 -0
- package/dist/types.d.ts +29 -2
- package/package.json +1 -1
- package/src/iframe-container/AppContainer.tsx +22 -15
- package/src/iframe-container/__tests__/AppContainer.test.tsx +35 -31
- package/src/index.tsx +78 -37
- package/src/redux/reducers/fiat-account-link.ts +60 -0
- package/src/redux/reducers/index.ts +2 -0
- package/src/types.ts +37 -9
package/src/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {MiniKit} from "@worldcoin/minikit-js";
|
|
1
|
+
import { MiniKit } from "@worldcoin/minikit-js";
|
|
2
2
|
|
|
3
3
|
declare global {
|
|
4
4
|
interface Window {
|
|
@@ -87,18 +87,18 @@ export interface IInitializeParameters {
|
|
|
87
87
|
* the ZeroHash HTTP API and have specific permissions to
|
|
88
88
|
* perform Profile operations.
|
|
89
89
|
*/
|
|
90
|
-
|
|
90
|
+
profileJWT?: string
|
|
91
91
|
/**
|
|
92
92
|
* cryptoAccountLinkJWT is the JWT that you received from
|
|
93
93
|
* the ZeroHash HTTP API and have specific permissions to
|
|
94
94
|
* create a new Crypto Account.
|
|
95
95
|
*/
|
|
96
96
|
cryptoAccountLinkJWT?: string
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
/**
|
|
98
|
+
* cryptoAccountLinkPayoutsJWT is the JWT that you received from
|
|
99
|
+
* the ZeroHash HTTP API and have specific permissions to
|
|
100
|
+
* create a new Crypto Account for payouts.
|
|
101
|
+
*/
|
|
102
102
|
cryptoAccountLinkPayoutsJWT?: string
|
|
103
103
|
/**
|
|
104
104
|
* payoutsJWT is the JWT that you received from
|
|
@@ -112,6 +112,12 @@ export interface IInitializeParameters {
|
|
|
112
112
|
* to perform pay.
|
|
113
113
|
*/
|
|
114
114
|
payJWT?: string
|
|
115
|
+
/**
|
|
116
|
+
* fiatAccountLinkJWT is the JWT that you received from
|
|
117
|
+
* the ZeroHash HTTP API and have specific permissions to
|
|
118
|
+
* create a new Fiat Account.
|
|
119
|
+
*/
|
|
120
|
+
fiatAccountLinkJWT?: string
|
|
115
121
|
/**
|
|
116
122
|
* zeroHashAppsURL is the base URL for all our Apps.
|
|
117
123
|
* It defaults to https://web-sdk.zerohash.com/ and will
|
|
@@ -382,6 +388,26 @@ export enum IncomingMessageType {
|
|
|
382
388
|
* PayFailed is received when the Pay flow has failed.
|
|
383
389
|
*/
|
|
384
390
|
PayFailed = "PAY_FAILED",
|
|
391
|
+
/**
|
|
392
|
+
* FiatAccountLinkAppLoaded is received when the Fiat Account Link
|
|
393
|
+
* app has initialized.
|
|
394
|
+
*/
|
|
395
|
+
FiatAccountLinkAppLoaded = "FIAT_ACCOUNT_LINK_APP_LOADED",
|
|
396
|
+
/**
|
|
397
|
+
* FiatAccountLinkCloseButtonClicked is received when the close button
|
|
398
|
+
* has been clicked in the Fiat Account Link app
|
|
399
|
+
*/
|
|
400
|
+
FiatAccountLinkCloseButtonClicked = "FIAT_ACCOUNT_LINK_CLOSE_BUTTON_CLICKED",
|
|
401
|
+
/**
|
|
402
|
+
* FiatAccountLinkFailed is received when the
|
|
403
|
+
* Fiat Account Link flow has failed.
|
|
404
|
+
*/
|
|
405
|
+
FiatAccountLinkFailed = "FIAT_ACCOUNT_LINK_FAILED",
|
|
406
|
+
/**
|
|
407
|
+
* FiatAccountLinkCompleted is received when the
|
|
408
|
+
* Fiat Account Link flow is completed.
|
|
409
|
+
*/
|
|
410
|
+
FiatAccountLinkCompleted = "FIAT_ACCOUNT_LINK_COMPLETED",
|
|
385
411
|
}
|
|
386
412
|
|
|
387
413
|
/**
|
|
@@ -432,7 +458,8 @@ export enum AppIdentifier {
|
|
|
432
458
|
CRYPTO_ACCOUNT_LINK = "crypto-account-link",
|
|
433
459
|
CRYPTO_ACCOUNT_LINK_PAYOUTS = "crypto-account-link-payouts",
|
|
434
460
|
PAYOUTS = "payouts",
|
|
435
|
-
PAY = "pay"
|
|
461
|
+
PAY = "pay",
|
|
462
|
+
FIAT_ACCOUNT_LINK = "fiat-account-link"
|
|
436
463
|
}
|
|
437
464
|
|
|
438
465
|
/**
|
|
@@ -455,7 +482,8 @@ export const appIdentifierToActionPrefixMap = new Map(
|
|
|
455
482
|
[AppIdentifier.CRYPTO_ACCOUNT_LINK, "CRYPTO_ACCOUNT_LINK_"],
|
|
456
483
|
[AppIdentifier.CRYPTO_ACCOUNT_LINK_PAYOUTS, "CRYPTO_ACCOUNT_LINK_PAYOUTS_"],
|
|
457
484
|
[AppIdentifier.PAYOUTS, "PAYOUTS_"],
|
|
458
|
-
[AppIdentifier.PAY, "PAY_"]
|
|
485
|
+
[AppIdentifier.PAY, "PAY_"],
|
|
486
|
+
[AppIdentifier.FIAT_ACCOUNT_LINK, "FIAT_ACCOUNT_LINK_"]
|
|
459
487
|
])
|
|
460
488
|
|
|
461
489
|
export interface ISetJWTParameters {
|