@dynamic-labs-sdk/client 1.8.1 → 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.
Files changed (78) hide show
  1. package/dist/{InvalidParamError-Btv8VGSa.native.esm.js → InvalidParamError-BqFQnYCi.native.esm.js} +23 -10
  2. package/dist/{InvalidParamError-Btv8VGSa.native.esm.js.map → InvalidParamError-BqFQnYCi.native.esm.js.map} +1 -1
  3. package/dist/{InvalidParamError-DGBih-LJ.cjs → InvalidParamError-CmwKWCyr.cjs} +24 -11
  4. package/dist/{InvalidParamError-DGBih-LJ.cjs.map → InvalidParamError-CmwKWCyr.cjs.map} +1 -1
  5. package/dist/{InvalidParamError-BKnC9rcJ.esm.js → InvalidParamError-c1J0Vmze.esm.js} +23 -10
  6. package/dist/{InvalidParamError-BKnC9rcJ.esm.js.map → InvalidParamError-c1J0Vmze.esm.js.map} +1 -1
  7. package/dist/{NotWaasWalletAccountError-CRmyVoB3.native.esm.js → NotWaasWalletAccountError-Be0QB89x.native.esm.js} +3 -3
  8. package/dist/{NotWaasWalletAccountError-CRmyVoB3.native.esm.js.map → NotWaasWalletAccountError-Be0QB89x.native.esm.js.map} +1 -1
  9. package/dist/{NotWaasWalletAccountError-CHr72wTH.esm.js → NotWaasWalletAccountError-CgwG_c2-.esm.js} +3 -3
  10. package/dist/{NotWaasWalletAccountError-CHr72wTH.esm.js.map → NotWaasWalletAccountError-CgwG_c2-.esm.js.map} +1 -1
  11. package/dist/{NotWaasWalletAccountError-i1FozGep.cjs → NotWaasWalletAccountError-DKEpLrGc.cjs} +3 -3
  12. package/dist/{NotWaasWalletAccountError-i1FozGep.cjs.map → NotWaasWalletAccountError-DKEpLrGc.cjs.map} +1 -1
  13. package/dist/client/core/createCore/getInitialState.d.ts +1 -1
  14. package/dist/client/core/createCore/getInitialState.d.ts.map +1 -1
  15. package/dist/client/createDynamicClient/createDynamicClient.d.ts.map +1 -1
  16. package/dist/client/types/DynamicClient.d.ts +9 -0
  17. package/dist/client/types/DynamicClient.d.ts.map +1 -1
  18. package/dist/core.cjs +5 -5
  19. package/dist/core.esm.js +5 -5
  20. package/dist/core.native.esm.js +5 -5
  21. package/dist/{getNetworkProviderFromNetworkId-CRuh5pgc.esm.js → getNetworkProviderFromNetworkId-CGpE_Y95.esm.js} +3 -3
  22. package/dist/{getNetworkProviderFromNetworkId-CRuh5pgc.esm.js.map → getNetworkProviderFromNetworkId-CGpE_Y95.esm.js.map} +1 -1
  23. package/dist/{getNetworkProviderFromNetworkId-Bm41knUq.native.esm.js → getNetworkProviderFromNetworkId-Cke-DBhx.native.esm.js} +4 -4
  24. package/dist/{getNetworkProviderFromNetworkId-Bm41knUq.native.esm.js.map → getNetworkProviderFromNetworkId-Cke-DBhx.native.esm.js.map} +1 -1
  25. package/dist/{getNetworkProviderFromNetworkId-BdgI7g5U.cjs → getNetworkProviderFromNetworkId-DXzopnuR.cjs} +4 -4
  26. package/dist/{getNetworkProviderFromNetworkId-BdgI7g5U.cjs.map → getNetworkProviderFromNetworkId-DXzopnuR.cjs.map} +1 -1
  27. package/dist/{getSignedSessionId-D2w_IRdt.esm.js → getSignedSessionId-C1uLkDjy.esm.js} +3 -3
  28. package/dist/{getSignedSessionId-D2w_IRdt.esm.js.map → getSignedSessionId-C1uLkDjy.esm.js.map} +1 -1
  29. package/dist/{getSignedSessionId-S6CBWkOn.native.esm.js → getSignedSessionId-C7YR-jNH.native.esm.js} +3 -3
  30. package/dist/{getSignedSessionId-S6CBWkOn.native.esm.js.map → getSignedSessionId-C7YR-jNH.native.esm.js.map} +1 -1
  31. package/dist/{getSignedSessionId-Cwmt4BkY.cjs → getSignedSessionId-CbWFH_TM.cjs} +3 -3
  32. package/dist/{getSignedSessionId-Cwmt4BkY.cjs.map → getSignedSessionId-CbWFH_TM.cjs.map} +1 -1
  33. package/dist/{getVerifiedCredentialForWalletAccount-D33r7Drd.native.esm.js → getVerifiedCredentialForWalletAccount-DAmdvMY5.native.esm.js} +2 -2
  34. package/dist/{getVerifiedCredentialForWalletAccount-D33r7Drd.native.esm.js.map → getVerifiedCredentialForWalletAccount-DAmdvMY5.native.esm.js.map} +1 -1
  35. package/dist/{getVerifiedCredentialForWalletAccount-QwfkKHfr.esm.js → getVerifiedCredentialForWalletAccount-DPTHL1pO.esm.js} +2 -2
  36. package/dist/{getVerifiedCredentialForWalletAccount-QwfkKHfr.esm.js.map → getVerifiedCredentialForWalletAccount-DPTHL1pO.esm.js.map} +1 -1
  37. package/dist/{getVerifiedCredentialForWalletAccount-CDuP1kaI.cjs → getVerifiedCredentialForWalletAccount-DidFNLGP.cjs} +3 -3
  38. package/dist/{getVerifiedCredentialForWalletAccount-CDuP1kaI.cjs.map → getVerifiedCredentialForWalletAccount-DidFNLGP.cjs.map} +1 -1
  39. package/dist/index.cjs +19 -7
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.esm.js +19 -7
  42. package/dist/index.esm.js.map +1 -1
  43. package/dist/index.native.esm.js +19 -7
  44. package/dist/index.native.esm.js.map +1 -1
  45. package/dist/{isMfaRequiredForAction-z74isCQ7.cjs → isMfaRequiredForAction-BNipdNF5.cjs} +2 -2
  46. package/dist/{isMfaRequiredForAction-z74isCQ7.cjs.map → isMfaRequiredForAction-BNipdNF5.cjs.map} +1 -1
  47. package/dist/{isMfaRequiredForAction-5p3i98-Z.esm.js → isMfaRequiredForAction-DCwLx4Ik.esm.js} +2 -2
  48. package/dist/{isMfaRequiredForAction-5p3i98-Z.esm.js.map → isMfaRequiredForAction-DCwLx4Ik.esm.js.map} +1 -1
  49. package/dist/{isMfaRequiredForAction-cmElIVof.native.esm.js → isMfaRequiredForAction-Dx4BPJVg.native.esm.js} +2 -2
  50. package/dist/{isMfaRequiredForAction-cmElIVof.native.esm.js.map → isMfaRequiredForAction-Dx4BPJVg.native.esm.js.map} +1 -1
  51. package/dist/modules/initializeClient/initializeClient.d.ts.map +1 -1
  52. package/dist/modules/initializeClient/state.d.ts +9 -0
  53. package/dist/modules/initializeClient/state.d.ts.map +1 -1
  54. package/dist/modules/state/raiseStateEvents/events.d.ts +4 -0
  55. package/dist/modules/state/raiseStateEvents/events.d.ts.map +1 -1
  56. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  57. package/dist/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.d.ts +4 -0
  58. package/dist/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.d.ts.map +1 -1
  59. package/dist/utils/getNonce/state.d.ts +5 -0
  60. package/dist/utils/getNonce/state.d.ts.map +1 -1
  61. package/dist/waas.cjs +4 -4
  62. package/dist/waas.esm.js +3 -3
  63. package/dist/waas.native.esm.js +3 -3
  64. package/dist/waasCore.cjs +3 -3
  65. package/dist/waasCore.esm.js +3 -3
  66. package/dist/waasCore.native.esm.js +3 -3
  67. package/package.json +11 -4
  68. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  69. package/android/gradle/wrapper/gradle-wrapper.properties +0 -7
  70. package/android/gradlew +0 -251
  71. package/android/gradlew.bat +0 -94
  72. package/android/settings.gradle +0 -30
  73. package/android/src/test/java/xyz/dynamic/client/keychain/KeyStoreKeyManagerTest.kt +0 -288
  74. package/android/src/test/java/xyz/dynamic/client/webview/DynamicWebViewClientTest.kt +0 -196
  75. package/android/src/test/java/xyz/dynamic/client/webview/DynamicWebViewHostOpenTest.kt +0 -347
  76. package/android/src/test/java/xyz/dynamic/client/webview/DynamicWebViewHostTest.kt +0 -171
  77. package/android/src/test/java/xyz/dynamic/client/webview/DynamicWebViewModuleTest.kt +0 -191
  78. package/react-native.config.cjs +0 -14
package/dist/index.esm.js CHANGED
@@ -1,8 +1,8 @@
1
- import { A as UnauthorizedError, B as APIError, C as emitEvent, E as onceEvent, F as SandboxMaximumThresholdReachedError, G as __getElevatedAccessToken_wrapped, H as isCookieEnabled, I as MfaRateLimitedError, J as DEFAULT_PII_FIELDS, K as instrumentFunction, L as MfaInvalidOtpError, O as fetchAndStoreNonces, P as getNonce, R as LinkCredentialError, T as onEvent, U as assertDefined, W as ValueMustBeDefinedError, X as extractSessionId, Y as getUserAgent, Z as randomString, _ as getChainFromVerifiedCredentialChain, a as DYNAMIC_ICONIC_SPRITE_URL, at as getCore, b as normalizeAddress, c as getWalletProviderFromWalletAccount, et as NONCE_POOL_SIZE, f as NoWalletProviderFoundError, it as BaseError, k as createApiClient, l as WalletProviderPriority, nt as setDefaultClient, o as SDK_API_CORE_VERSION, ot as name, p as getWalletAccounts, q as scrubParameters, st as version, t as InvalidParamError, tt as getDefaultClient, u as getWalletProviderRegistry, v as CHAINS_INFO_MAP, w as offEvent, x as splitWalletProviderKey, y as formatWalletAccountId, z as InvalidExternalAuthError } from "./InvalidParamError-BKnC9rcJ.esm.js";
2
- import { A as GENERATE_SESSION_KEYS_TRACKER_KEY, B as isEqualShallow, C as createKeychainService, D as CannotTrackError, F as getBuffer, I as createStorage, 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 createLocalStorageAdapter, S as createRealtimeService, T as createCrossTabBroadcast, _ as isCaptchaRequired, a as verifyMessageSignatureOwnership, b as NoNetworkProvidersError, c as formatSignInMessage, d as updateWalletProviderKeysForVerifiedCredentials, f as setUnverifiedWalletAccounts, g as consumeCaptchaToken, h as __setCaptchaToken_wrapped, i as getNetworksData, j as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, k as FETCH_PROJECT_SETTINGS_TRACKER_KEY, l as getAppMetadata, m as hasExtension, o as removeUnverifiedWalletAccount, p as createVisit, s as createSignInMessageStatement, t as getNetworkProviderFromNetworkId, u as reconcileWalletAccountsAgainstClient, v as MethodNotImplementedError, w as createLogger, x as getKeychainIndexedDBName, y as WalletAlreadyLinkedToAnotherUserError, z as subscribeWithSelector } from "./getNetworkProviderFromNetworkId-CRuh5pgc.esm.js";
3
- import { a as generateSessionKeys, c as isSignedIn, i as __logoutWithReason_wrapped, l as retryOnFail, n as getMfaMethods, o as fetchProjectSettings, r as __consumeMfaToken_wrapped, s as createStorageKeySchema, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-5p3i98-Z.esm.js";
4
- import { a as parseElevatedAccessToken, d as isUserMissingMfaAuth, f as checkAndRaiseWalletAccountsChangedEvent, i as upsertElevatedAccessToken, n as getWalletProviderByKey, o as restoreUserSharesForAllWalletAccounts, r as updateAuthFromVerifyResponse, t as getVerifiedCredentialForWalletAccount, u as getWalletProviders } from "./getVerifiedCredentialForWalletAccount-QwfkKHfr.esm.js";
5
- import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-CHr72wTH.esm.js";
1
+ import { A as UnauthorizedError, B as APIError, C as emitEvent, E as onceEvent, F as SandboxMaximumThresholdReachedError, G as __getElevatedAccessToken_wrapped, H as isCookieEnabled, I as MfaRateLimitedError, J as DEFAULT_PII_FIELDS, K as instrumentFunction, L as MfaInvalidOtpError, O as fetchAndStoreNonces, P as getNonce, R as LinkCredentialError, T as onEvent, U as assertDefined, W as ValueMustBeDefinedError, X as extractSessionId, Y as getUserAgent, Z as randomString, _ as getChainFromVerifiedCredentialChain, a as DYNAMIC_ICONIC_SPRITE_URL, at as getCore, b as normalizeAddress, c as getWalletProviderFromWalletAccount, et as NONCE_POOL_SIZE, f as NoWalletProviderFoundError, it as BaseError, k as createApiClient, l as WalletProviderPriority, nt as setDefaultClient, o as SDK_API_CORE_VERSION, ot as name, p as getWalletAccounts, q as scrubParameters, st as version, t as InvalidParamError, tt as getDefaultClient, u as getWalletProviderRegistry, v as CHAINS_INFO_MAP, w as offEvent, x as splitWalletProviderKey, y as formatWalletAccountId, z as InvalidExternalAuthError } from "./InvalidParamError-c1J0Vmze.esm.js";
2
+ import { A as GENERATE_SESSION_KEYS_TRACKER_KEY, B as isEqualShallow, C as createKeychainService, D as CannotTrackError, F as getBuffer, I as createStorage, 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 createLocalStorageAdapter, S as createRealtimeService, T as createCrossTabBroadcast, _ as isCaptchaRequired, a as verifyMessageSignatureOwnership, b as NoNetworkProvidersError, c as formatSignInMessage, d as updateWalletProviderKeysForVerifiedCredentials, f as setUnverifiedWalletAccounts, g as consumeCaptchaToken, h as __setCaptchaToken_wrapped, i as getNetworksData, j as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, k as FETCH_PROJECT_SETTINGS_TRACKER_KEY, l as getAppMetadata, m as hasExtension, o as removeUnverifiedWalletAccount, p as createVisit, s as createSignInMessageStatement, t as getNetworkProviderFromNetworkId, u as reconcileWalletAccountsAgainstClient, v as MethodNotImplementedError, w as createLogger, x as getKeychainIndexedDBName, y as WalletAlreadyLinkedToAnotherUserError, z as subscribeWithSelector } from "./getNetworkProviderFromNetworkId-CGpE_Y95.esm.js";
3
+ import { a as generateSessionKeys, c as isSignedIn, i as __logoutWithReason_wrapped, l as retryOnFail, n as getMfaMethods, o as fetchProjectSettings, r as __consumeMfaToken_wrapped, s as createStorageKeySchema, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-DCwLx4Ik.esm.js";
4
+ import { a as parseElevatedAccessToken, d as isUserMissingMfaAuth, f as checkAndRaiseWalletAccountsChangedEvent, i as upsertElevatedAccessToken, n as getWalletProviderByKey, o as restoreUserSharesForAllWalletAccounts, r as updateAuthFromVerifyResponse, t as getVerifiedCredentialForWalletAccount, u as getWalletProviders } from "./getVerifiedCredentialForWalletAccount-DPTHL1pO.esm.js";
5
+ import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-CgwG_c2-.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 { browserSupportsWebAuthn, startAuthentication, startRegistration } from
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({ initStatus: "in-progress" });
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({ initStatus: "failed" });
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);
@@ -951,9 +958,11 @@ const DEFAULT_API_BASE_URL = "https://app.dynamicauth.com/api/v0";
951
958
  const getInitialState = () => ({
952
959
  captchaToken: null,
953
960
  elevatedAccessTokens: [],
961
+ initError: null,
954
962
  initStatus: "uninitialized",
955
963
  legacyToken: null,
956
964
  mfaToken: null,
965
+ nonceFetchInFlight: null,
957
966
  prefetchedNonces: [],
958
967
  prefetchedNoncesExpiration: null,
959
968
  projectSettings: null,
@@ -1064,6 +1073,9 @@ const createDynamicClient = (config) => {
1064
1073
  get __core() {
1065
1074
  return core;
1066
1075
  },
1076
+ get initError() {
1077
+ return core.state.get().initError;
1078
+ },
1067
1079
  get initStatus() {
1068
1080
  return core.state.get().initStatus;
1069
1081
  },