@dynamic-labs-sdk/client 1.8.0 → 1.8.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/{InvalidParamError-Bc6OZBog.native.esm.js → InvalidParamError-BqFQnYCi.native.esm.js} +27 -15
- package/dist/InvalidParamError-BqFQnYCi.native.esm.js.map +1 -0
- package/dist/{InvalidParamError-S56rFFDP.cjs → InvalidParamError-CmwKWCyr.cjs} +24 -11
- package/dist/{InvalidParamError-S56rFFDP.cjs.map → InvalidParamError-CmwKWCyr.cjs.map} +1 -1
- package/dist/{InvalidParamError-IHYLdzFd.esm.js → InvalidParamError-c1J0Vmze.esm.js} +23 -10
- package/dist/{InvalidParamError-IHYLdzFd.esm.js.map → InvalidParamError-c1J0Vmze.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-BP-bODbJ.native.esm.js → NotWaasWalletAccountError-Be0QB89x.native.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-BP-bODbJ.native.esm.js.map → NotWaasWalletAccountError-Be0QB89x.native.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-BYEL2l-W.esm.js → NotWaasWalletAccountError-CgwG_c2-.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-BYEL2l-W.esm.js.map → NotWaasWalletAccountError-CgwG_c2-.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-CbhIKUDM.cjs → NotWaasWalletAccountError-DKEpLrGc.cjs} +3 -3
- package/dist/{NotWaasWalletAccountError-CbhIKUDM.cjs.map → NotWaasWalletAccountError-DKEpLrGc.cjs.map} +1 -1
- package/dist/client/core/createCore/getInitialState.d.ts +1 -1
- package/dist/client/core/createCore/getInitialState.d.ts.map +1 -1
- package/dist/client/createDynamicClient/createDynamicClient.d.ts.map +1 -1
- package/dist/client/types/DynamicClient.d.ts +9 -0
- package/dist/client/types/DynamicClient.d.ts.map +1 -1
- package/dist/core.cjs +5 -5
- package/dist/core.esm.js +5 -5
- package/dist/core.native.esm.js +5 -5
- package/dist/{getNetworkProviderFromNetworkId-D8rWYXlT.esm.js → getNetworkProviderFromNetworkId-CGpE_Y95.esm.js} +3 -3
- package/dist/{getNetworkProviderFromNetworkId-D8rWYXlT.esm.js.map → getNetworkProviderFromNetworkId-CGpE_Y95.esm.js.map} +1 -1
- package/dist/{getNetworkProviderFromNetworkId-DVmF7pH2.native.esm.js → getNetworkProviderFromNetworkId-Cke-DBhx.native.esm.js} +4 -4
- package/dist/{getNetworkProviderFromNetworkId-DVmF7pH2.native.esm.js.map → getNetworkProviderFromNetworkId-Cke-DBhx.native.esm.js.map} +1 -1
- package/dist/{getNetworkProviderFromNetworkId-BDdcpGHH.cjs → getNetworkProviderFromNetworkId-DXzopnuR.cjs} +4 -4
- package/dist/{getNetworkProviderFromNetworkId-BDdcpGHH.cjs.map → getNetworkProviderFromNetworkId-DXzopnuR.cjs.map} +1 -1
- package/dist/{getSignedSessionId-CND07Eca.esm.js → getSignedSessionId-C1uLkDjy.esm.js} +3 -3
- package/dist/{getSignedSessionId-CND07Eca.esm.js.map → getSignedSessionId-C1uLkDjy.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-RwV7JPn8.native.esm.js → getSignedSessionId-C7YR-jNH.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-RwV7JPn8.native.esm.js.map → getSignedSessionId-C7YR-jNH.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-BBaBCi9S.cjs → getSignedSessionId-CbWFH_TM.cjs} +3 -3
- package/dist/{getSignedSessionId-BBaBCi9S.cjs.map → getSignedSessionId-CbWFH_TM.cjs.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-BVrGV8qf.native.esm.js → getVerifiedCredentialForWalletAccount-DAmdvMY5.native.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-BVrGV8qf.native.esm.js.map → getVerifiedCredentialForWalletAccount-DAmdvMY5.native.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-BiOS65Tk.esm.js → getVerifiedCredentialForWalletAccount-DPTHL1pO.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-BiOS65Tk.esm.js.map → getVerifiedCredentialForWalletAccount-DPTHL1pO.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-FrxYWSuD.cjs → getVerifiedCredentialForWalletAccount-DidFNLGP.cjs} +3 -3
- package/dist/{getVerifiedCredentialForWalletAccount-FrxYWSuD.cjs.map → getVerifiedCredentialForWalletAccount-DidFNLGP.cjs.map} +1 -1
- package/dist/index.cjs +19 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +19 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +19 -7
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-BolTrtCO.cjs → isMfaRequiredForAction-BNipdNF5.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-BolTrtCO.cjs.map → isMfaRequiredForAction-BNipdNF5.cjs.map} +1 -1
- package/dist/{isMfaRequiredForAction-BPL_dgIM.esm.js → isMfaRequiredForAction-DCwLx4Ik.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-BPL_dgIM.esm.js.map → isMfaRequiredForAction-DCwLx4Ik.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-DQDoPsi6.native.esm.js → isMfaRequiredForAction-Dx4BPJVg.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-DQDoPsi6.native.esm.js.map → isMfaRequiredForAction-Dx4BPJVg.native.esm.js.map} +1 -1
- package/dist/modules/initializeClient/initializeClient.d.ts.map +1 -1
- package/dist/modules/initializeClient/state.d.ts +9 -0
- package/dist/modules/initializeClient/state.d.ts.map +1 -1
- package/dist/modules/state/raiseStateEvents/events.d.ts +4 -0
- package/dist/modules/state/raiseStateEvents/events.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.d.ts +4 -0
- package/dist/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.d.ts.map +1 -1
- package/dist/utils/getNonce/state.d.ts +5 -0
- package/dist/utils/getNonce/state.d.ts.map +1 -1
- package/dist/waas.cjs +4 -4
- package/dist/waas.esm.js +3 -3
- package/dist/waas.native.esm.js +3 -3
- package/dist/waasCore.cjs +3 -3
- package/dist/waasCore.esm.js +3 -3
- package/dist/waasCore.native.esm.js +4 -4
- package/dist/waasCore.native.esm.js.map +1 -1
- package/package.json +11 -4
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -7
- package/android/gradlew +0 -251
- package/android/gradlew.bat +0 -94
- package/android/settings.gradle +0 -30
- package/android/src/test/java/xyz/dynamic/client/keychain/KeyStoreKeyManagerTest.kt +0 -288
- package/android/src/test/java/xyz/dynamic/client/webview/DynamicWebViewClientTest.kt +0 -196
- package/android/src/test/java/xyz/dynamic/client/webview/DynamicWebViewHostOpenTest.kt +0 -347
- package/android/src/test/java/xyz/dynamic/client/webview/DynamicWebViewHostTest.kt +0 -171
- package/android/src/test/java/xyz/dynamic/client/webview/DynamicWebViewModuleTest.kt +0 -191
- package/dist/InvalidParamError-Bc6OZBog.native.esm.js.map +0 -1
- package/react-native.config.cjs +0 -14
package/dist/index.native.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as getUserAgent, B as getCore, C as isCookieEnabled, D as instrumentFunction, E as __getElevatedAccessToken_wrapped, F as NONCE_POOL_SIZE, H as version, I as getDefaultClient, L as setDefaultClient, M as randomString, O as scrubParameters, T as ValueMustBeDefinedError, V as name, _ as MfaRateLimitedError, a as DYNAMIC_ICONIC_SPRITE_URL, b as InvalidExternalAuthError, c as CHAINS_INFO_MAP, d as UnauthorizedError, g as SandboxMaximumThresholdReachedError, h as getNonce, j as extractSessionId, k as DEFAULT_PII_FIELDS, l as fetchAndStoreNonces, o as SDK_API_CORE_VERSION, s as getChainFromVerifiedCredentialChain, t as InvalidParamError, u as createApiClient, v as MfaInvalidOtpError, w as assertDefined, x as APIError, y as LinkCredentialError, z as BaseError } from "./InvalidParamError-
|
|
2
|
-
import { A as GENERATE_SESSION_KEYS_TRACKER_KEY, B as createStorage, C as createKeychainService, D as CannotTrackError, F as getBuffer, G as subscribeWithSelector, H as createLocalStorageAdapter, I as __logoutWithReason_wrapped, K as isEqualShallow, L as generateSessionKeys, M as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, N as REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY, O as createDeferredPromise, P as isServerSideRendering, R as fetchProjectSettings, S as createRealtimeService, T as createCrossTabBroadcast, U as isSignedIn, W as retryOnFail, _ as getAppMetadata, a as verifyMessageSignatureOwnership, b as NoNetworkProvidersError, c as formatSignInMessage, d as setUnverifiedWalletAccounts, f as createVisit, g as isCaptchaRequired, h as consumeCaptchaToken, i as getNetworksData, j as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, k as FETCH_PROJECT_SETTINGS_TRACKER_KEY, l as reconcileWalletAccountsAgainstClient, m as __setCaptchaToken_wrapped, o as removeUnverifiedWalletAccount, p as hasExtension, s as createSignInMessageStatement, t as getNetworkProviderFromNetworkId, u as updateWalletProviderKeysForVerifiedCredentials, v as MethodNotImplementedError, w as createLogger, x as getKeychainIndexedDBName, y as WalletAlreadyLinkedToAnotherUserError, z as createStorageKeySchema } from "./getNetworkProviderFromNetworkId-
|
|
3
|
-
import { A as onceEvent, C as formatWalletAccountId, D as emitEvent, O as offEvent, T as splitWalletProviderKey, _ as getWalletProviderRegistry, a as parseElevatedAccessToken, b as getWalletAccounts, d as isUserMissingMfaAuth, f as checkAndRaiseWalletAccountsChangedEvent, g as WalletProviderPriority, h as getWalletProviderFromWalletAccount, i as upsertElevatedAccessToken, k as onEvent, n as getWalletProviderByKey, o as restoreUserSharesForAllWalletAccounts, r as updateAuthFromVerifyResponse, t as getVerifiedCredentialForWalletAccount, u as getWalletProviders, w as normalizeAddress, y as NoWalletProviderFoundError } from "./getVerifiedCredentialForWalletAccount-
|
|
4
|
-
import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-
|
|
5
|
-
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-
|
|
1
|
+
import { A as getUserAgent, B as getCore, C as isCookieEnabled, D as instrumentFunction, E as __getElevatedAccessToken_wrapped, F as NONCE_POOL_SIZE, H as version, I as getDefaultClient, L as setDefaultClient, M as randomString, O as scrubParameters, T as ValueMustBeDefinedError, V as name, _ as MfaRateLimitedError, a as DYNAMIC_ICONIC_SPRITE_URL, b as InvalidExternalAuthError, c as CHAINS_INFO_MAP, d as UnauthorizedError, g as SandboxMaximumThresholdReachedError, h as getNonce, j as extractSessionId, k as DEFAULT_PII_FIELDS, l as fetchAndStoreNonces, o as SDK_API_CORE_VERSION, s as getChainFromVerifiedCredentialChain, t as InvalidParamError, u as createApiClient, v as MfaInvalidOtpError, w as assertDefined, x as APIError, y as LinkCredentialError, z as BaseError } from "./InvalidParamError-BqFQnYCi.native.esm.js";
|
|
2
|
+
import { A as GENERATE_SESSION_KEYS_TRACKER_KEY, B as createStorage, C as createKeychainService, D as CannotTrackError, F as getBuffer, G as subscribeWithSelector, H as createLocalStorageAdapter, I as __logoutWithReason_wrapped, K as isEqualShallow, L as generateSessionKeys, M as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, N as REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY, O as createDeferredPromise, P as isServerSideRendering, R as fetchProjectSettings, S as createRealtimeService, T as createCrossTabBroadcast, U as isSignedIn, W as retryOnFail, _ as getAppMetadata, a as verifyMessageSignatureOwnership, b as NoNetworkProvidersError, c as formatSignInMessage, d as setUnverifiedWalletAccounts, f as createVisit, g as isCaptchaRequired, h as consumeCaptchaToken, i as getNetworksData, j as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, k as FETCH_PROJECT_SETTINGS_TRACKER_KEY, l as reconcileWalletAccountsAgainstClient, m as __setCaptchaToken_wrapped, o as removeUnverifiedWalletAccount, p as hasExtension, s as createSignInMessageStatement, t as getNetworkProviderFromNetworkId, u as updateWalletProviderKeysForVerifiedCredentials, v as MethodNotImplementedError, w as createLogger, x as getKeychainIndexedDBName, y as WalletAlreadyLinkedToAnotherUserError, z as createStorageKeySchema } from "./getNetworkProviderFromNetworkId-Cke-DBhx.native.esm.js";
|
|
3
|
+
import { A as onceEvent, C as formatWalletAccountId, D as emitEvent, O as offEvent, T as splitWalletProviderKey, _ as getWalletProviderRegistry, a as parseElevatedAccessToken, b as getWalletAccounts, d as isUserMissingMfaAuth, f as checkAndRaiseWalletAccountsChangedEvent, g as WalletProviderPriority, h as getWalletProviderFromWalletAccount, i as upsertElevatedAccessToken, k as onEvent, n as getWalletProviderByKey, o as restoreUserSharesForAllWalletAccounts, r as updateAuthFromVerifyResponse, t as getVerifiedCredentialForWalletAccount, u as getWalletProviders, w as normalizeAddress, y as NoWalletProviderFoundError } from "./getVerifiedCredentialForWalletAccount-DAmdvMY5.native.esm.js";
|
|
4
|
+
import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-Be0QB89x.native.esm.js";
|
|
5
|
+
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-Dx4BPJVg.native.esm.js";
|
|
6
6
|
import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
|
|
7
7
|
import { AuthModeEnum, ExchangeKeyEnum, JwtVerifiedCredentialFormatEnum, MFAAction, MfaBackupCodeAcknowledgement, ProviderEnum, TokenScope, WaasBackupOptionsEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
8
8
|
import * as z from "zod/mini";
|
|
@@ -17,6 +17,7 @@ import { Passkey } from "react-native-passkey";
|
|
|
17
17
|
* will have to come to this file and remember to add it here and in the interface.
|
|
18
18
|
*/
|
|
19
19
|
const stateChangeEvents = {
|
|
20
|
+
initError: "initErrorChanged",
|
|
20
21
|
initStatus: "initStatusChanged",
|
|
21
22
|
mfaToken: "mfaTokenChanged",
|
|
22
23
|
projectSettings: "projectSettingsChanged",
|
|
@@ -446,7 +447,10 @@ const initializeClient = async (client = getDefaultClient()) => {
|
|
|
446
447
|
const core = getCore(client);
|
|
447
448
|
core.logger.debug("[initializeClient] Initializing client. Current init status", core.state.get().initStatus);
|
|
448
449
|
if (core.state.get().initStatus !== "uninitialized") throw new ClientAlreadyInitializedError();
|
|
449
|
-
core.state.set({
|
|
450
|
+
core.state.set({
|
|
451
|
+
initError: null,
|
|
452
|
+
initStatus: "in-progress"
|
|
453
|
+
});
|
|
450
454
|
initializeAuth(client);
|
|
451
455
|
raiseStateEvents(client);
|
|
452
456
|
setupCrossTabEventSync(client);
|
|
@@ -533,7 +537,10 @@ const initializeClient = async (client = getDefaultClient()) => {
|
|
|
533
537
|
core.state.set({ initStatus: "finished" });
|
|
534
538
|
} catch (error) {
|
|
535
539
|
core.logger.error("Client initialization failed", error);
|
|
536
|
-
core.state.set({
|
|
540
|
+
core.state.set({
|
|
541
|
+
initError: error instanceof Error ? error : null,
|
|
542
|
+
initStatus: "failed"
|
|
543
|
+
});
|
|
537
544
|
throw error;
|
|
538
545
|
}
|
|
539
546
|
if (client.user) restoreUserSharesForAllWalletAccounts(client);
|
|
@@ -1025,9 +1032,11 @@ const DEFAULT_API_BASE_URL = "https://app.dynamicauth.com/api/v0";
|
|
|
1025
1032
|
const getInitialState = () => ({
|
|
1026
1033
|
captchaToken: null,
|
|
1027
1034
|
elevatedAccessTokens: [],
|
|
1035
|
+
initError: null,
|
|
1028
1036
|
initStatus: "uninitialized",
|
|
1029
1037
|
legacyToken: null,
|
|
1030
1038
|
mfaToken: null,
|
|
1039
|
+
nonceFetchInFlight: null,
|
|
1031
1040
|
prefetchedNonces: [],
|
|
1032
1041
|
prefetchedNoncesExpiration: null,
|
|
1033
1042
|
projectSettings: null,
|
|
@@ -1138,6 +1147,9 @@ const createDynamicClient = (config) => {
|
|
|
1138
1147
|
get __core() {
|
|
1139
1148
|
return core;
|
|
1140
1149
|
},
|
|
1150
|
+
get initError() {
|
|
1151
|
+
return core.state.get().initError;
|
|
1152
|
+
},
|
|
1141
1153
|
get initStatus() {
|
|
1142
1154
|
return core.state.get().initStatus;
|
|
1143
1155
|
},
|