@dynamic-labs-sdk/client 1.14.0 → 1.15.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/dist/{InvalidParamError-Cs4ZMEj4.cjs → InvalidParamError-BPY2yug_.cjs} +3 -3
- package/dist/{InvalidParamError-Cs4ZMEj4.cjs.map → InvalidParamError-BPY2yug_.cjs.map} +1 -1
- package/dist/{InvalidParamError-DZjc7Tjc.esm.js → InvalidParamError-CXCYtY0p.esm.js} +2 -2
- package/dist/{InvalidParamError-DZjc7Tjc.esm.js.map → InvalidParamError-CXCYtY0p.esm.js.map} +1 -1
- package/dist/{InvalidParamError-BKr8fFc1.native.esm.js → InvalidParamError-DSXDW6g4.native.esm.js} +2 -2
- package/dist/{InvalidParamError-BKr8fFc1.native.esm.js.map → InvalidParamError-DSXDW6g4.native.esm.js.map} +1 -1
- package/dist/core.cjs +5 -5
- package/dist/core.esm.js +7 -7
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +5 -5
- package/dist/{getNetworkProviderFromNetworkId-CdCEFEgT.cjs → getNetworkProviderFromNetworkId-DCwFIoM3.cjs} +4 -4
- package/dist/{getNetworkProviderFromNetworkId-CdCEFEgT.cjs.map → getNetworkProviderFromNetworkId-DCwFIoM3.cjs.map} +1 -1
- package/dist/{getNetworkProviderFromNetworkId-ChFA088e.esm.js → getNetworkProviderFromNetworkId-_pvqm2fB.esm.js} +7 -7
- package/dist/getNetworkProviderFromNetworkId-_pvqm2fB.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-DZkq74O7.native.esm.js → getNetworkProviderFromNetworkId-b-H_ta9Q.native.esm.js} +4 -4
- package/dist/{getNetworkProviderFromNetworkId-DZkq74O7.native.esm.js.map → getNetworkProviderFromNetworkId-b-H_ta9Q.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-DmDcWkqB.native.esm.js → getSignedSessionId-Co8y0azF.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-DmDcWkqB.native.esm.js.map → getSignedSessionId-Co8y0azF.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-DrrvGNcG.esm.js → getSignedSessionId-D7Q9q-oy.esm.js} +3 -3
- package/dist/{getSignedSessionId-DrrvGNcG.esm.js.map → getSignedSessionId-D7Q9q-oy.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-DceZVits.cjs → getSignedSessionId-NZR0A-EZ.cjs} +3 -3
- package/dist/{getSignedSessionId-DceZVits.cjs.map → getSignedSessionId-NZR0A-EZ.cjs.map} +1 -1
- package/dist/{getWaasWalletProviderFromWalletAccount-CKZIsFWL.cjs → getWaasWalletProviderFromWalletAccount-CUgNeKaa.cjs} +3 -3
- package/dist/{getWaasWalletProviderFromWalletAccount-CKZIsFWL.cjs.map → getWaasWalletProviderFromWalletAccount-CUgNeKaa.cjs.map} +1 -1
- package/dist/{getWaasWalletProviderFromWalletAccount-C2GdfqUr.native.esm.js → getWaasWalletProviderFromWalletAccount-DLq_TjmC.native.esm.js} +3 -3
- package/dist/{getWaasWalletProviderFromWalletAccount-C2GdfqUr.native.esm.js.map → getWaasWalletProviderFromWalletAccount-DLq_TjmC.native.esm.js.map} +1 -1
- package/dist/{getWaasWalletProviderFromWalletAccount-B_8slAdm.esm.js → getWaasWalletProviderFromWalletAccount-DNBPKg4j.esm.js} +3 -3
- package/dist/{getWaasWalletProviderFromWalletAccount-B_8slAdm.esm.js.map → getWaasWalletProviderFromWalletAccount-DNBPKg4j.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-DWYF9IxH.esm.js → getWalletProviderByKey-C4KTyeYY.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-DWYF9IxH.esm.js.map → getWalletProviderByKey-C4KTyeYY.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-OD65GUWG.cjs → getWalletProviderByKey-DZrpcmPE.cjs} +3 -3
- package/dist/{getWalletProviderByKey-OD65GUWG.cjs.map → getWalletProviderByKey-DZrpcmPE.cjs.map} +1 -1
- package/dist/{getWalletProviderByKey-BhisAyZg.native.esm.js → getWalletProviderByKey-Dk_K8Lg8.native.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-BhisAyZg.native.esm.js.map → getWalletProviderByKey-Dk_K8Lg8.native.esm.js.map} +1 -1
- package/dist/index.cjs +34 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +37 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +34 -8
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isDynamicWaasEnabled-C9gQ9M80.esm.js → isDynamicWaasEnabled-C9aVoXek.esm.js} +2 -2
- package/dist/{isDynamicWaasEnabled-C9gQ9M80.esm.js.map → isDynamicWaasEnabled-C9aVoXek.esm.js.map} +1 -1
- package/dist/{isDynamicWaasEnabled-rRFvljev.native.esm.js → isDynamicWaasEnabled-DNtxO0Bc.native.esm.js} +2 -2
- package/dist/{isDynamicWaasEnabled-rRFvljev.native.esm.js.map → isDynamicWaasEnabled-DNtxO0Bc.native.esm.js.map} +1 -1
- package/dist/{isDynamicWaasEnabled-C90E53x1.cjs → isDynamicWaasEnabled-DQ1mtWZv.cjs} +3 -3
- package/dist/{isDynamicWaasEnabled-C90E53x1.cjs.map → isDynamicWaasEnabled-DQ1mtWZv.cjs.map} +1 -1
- package/dist/{isMfaRequiredForAction-C1KaU-XS.native.esm.js → isMfaRequiredForAction-BXnpnD2X.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-C1KaU-XS.native.esm.js.map → isMfaRequiredForAction-BXnpnD2X.native.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-CTQzzCMt.esm.js → isMfaRequiredForAction-BhLg6M8J.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-CTQzzCMt.esm.js.map → isMfaRequiredForAction-BhLg6M8J.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-DFowphoV.cjs → isMfaRequiredForAction-DsOwHl4C.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-DFowphoV.cjs.map → isMfaRequiredForAction-DsOwHl4C.cjs.map} +1 -1
- package/dist/{isUserOnboardingComplete-DfDNapVu.native.esm.js → isUserOnboardingComplete-BRfyMejK.native.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-DfDNapVu.native.esm.js.map → isUserOnboardingComplete-BRfyMejK.native.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-77jTT2BB.cjs → isUserOnboardingComplete-DrgtJIFi.cjs} +4 -4
- package/dist/{isUserOnboardingComplete-77jTT2BB.cjs.map → isUserOnboardingComplete-DrgtJIFi.cjs.map} +1 -1
- package/dist/{isUserOnboardingComplete-D1gGc77y.esm.js → isUserOnboardingComplete-KFfpvN4R.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-D1gGc77y.esm.js.map → isUserOnboardingComplete-KFfpvN4R.esm.js.map} +1 -1
- package/dist/modules/wallets/verifyWalletAccountForSignInOrTransfer/verifyWalletAccountForSignInOrTransfer.d.ts.map +1 -1
- package/dist/modules/wallets/walletProvider/walletProvider.types.d.ts +8 -0
- package/dist/modules/wallets/walletProvider/walletProvider.types.d.ts.map +1 -1
- package/dist/{refreshAuth-CAPTC0sg.esm.js → refreshAuth-BnkCuIdw.esm.js} +3 -3
- package/dist/{refreshAuth-CAPTC0sg.esm.js.map → refreshAuth-BnkCuIdw.esm.js.map} +1 -1
- package/dist/{refreshAuth-aTqsU1uq.native.esm.js → refreshAuth-CfUYFXh_.native.esm.js} +3 -3
- package/dist/{refreshAuth-aTqsU1uq.native.esm.js.map → refreshAuth-CfUYFXh_.native.esm.js.map} +1 -1
- package/dist/{refreshAuth-B3XSU6GT.cjs → refreshAuth-DvHy0g8j.cjs} +3 -3
- package/dist/{refreshAuth-B3XSU6GT.cjs.map → refreshAuth-DvHy0g8j.cjs.map} +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/retryOnFetchError/index.d.ts +2 -0
- package/dist/utils/retryOnFetchError/index.d.ts.map +1 -0
- package/dist/utils/retryOnFetchError/retryOnFetchError.d.ts +36 -0
- package/dist/utils/retryOnFetchError/retryOnFetchError.d.ts.map +1 -0
- package/dist/waas.cjs +6 -6
- package/dist/waas.esm.js +5 -5
- package/dist/waas.native.esm.js +5 -5
- package/dist/waasCore.cjs +6 -6
- package/dist/waasCore.esm.js +6 -6
- package/dist/waasCore.native.esm.js +6 -6
- package/package.json +2 -2
- package/dist/getNetworkProviderFromNetworkId-ChFA088e.esm.js.map +0 -1
package/dist/index.native.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { $ as getCore, C as emitEvent, D as fetchAndStoreNonces, E as onceEvent, F as MfaRateLimitedError, G as randomString, H as assertDefined, I as MfaInvalidOtpError, J as NONCE_POOL_SIZE, L as LinkCredentialError, N as getNonce, O as createApiClient, P as SandboxMaximumThresholdReachedError, Q as BaseError, R as InvalidExternalAuthError, S as CHAINS_INFO_MAP, T as onEvent, U as ValueMustBeDefinedError, V as isCookieEnabled, W as getElevatedAccessToken, X as setDefaultClient, Y as getDefaultClient, _ as WalletProviderPriority, b as NoWalletProviderFoundError, c as SDK_API_CORE_VERSION, d as DEFAULT_PII_FIELDS, et as name, f as getUserAgent, g as getWalletProviderFromWalletAccount, h as extractSessionId, k as UnauthorizedError, l as instrumentFunction, m as getOperatingSystem, o as isUserMissingMfaAuth, p as getPlatform, s as DYNAMIC_ICONIC_SPRITE_URL, t as InvalidParamError, tt as version, u as scrubParameters, v as getWalletProviderRegistry, w as offEvent, x as getChainFromVerifiedCredentialChain, z as APIError } 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 { _ as normalizeAddress, a as parseElevatedAccessToken, g as formatWalletAccountId, i as upsertElevatedAccessToken, l as getWalletProviders, n as getVerifiedCredentialForWalletAccount, o as initializeWaasClientsForEagerRecovery, p as getWalletAccounts, r as updateAuthFromVerifyResponse, t as getWalletProviderByKey, u as checkAndRaiseWalletAccountsChangedEvent, v as splitWalletProviderKey } from "./getWalletProviderByKey-
|
|
4
|
-
import { t as __refreshAuth_wrapped } from "./refreshAuth-
|
|
5
|
-
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-
|
|
6
|
-
import { n as NotWaasWalletAccountError } from "./isDynamicWaasEnabled-
|
|
7
|
-
import { a as WaasOnboardingIncompleteError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, r as isDeviceRegistrationRequired, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-
|
|
1
|
+
import { $ as getCore, C as emitEvent, D as fetchAndStoreNonces, E as onceEvent, F as MfaRateLimitedError, G as randomString, H as assertDefined, I as MfaInvalidOtpError, J as NONCE_POOL_SIZE, L as LinkCredentialError, N as getNonce, O as createApiClient, P as SandboxMaximumThresholdReachedError, Q as BaseError, R as InvalidExternalAuthError, S as CHAINS_INFO_MAP, T as onEvent, U as ValueMustBeDefinedError, V as isCookieEnabled, W as getElevatedAccessToken, X as setDefaultClient, Y as getDefaultClient, _ as WalletProviderPriority, b as NoWalletProviderFoundError, c as SDK_API_CORE_VERSION, d as DEFAULT_PII_FIELDS, et as name, f as getUserAgent, g as getWalletProviderFromWalletAccount, h as extractSessionId, k as UnauthorizedError, l as instrumentFunction, m as getOperatingSystem, o as isUserMissingMfaAuth, p as getPlatform, s as DYNAMIC_ICONIC_SPRITE_URL, t as InvalidParamError, tt as version, u as scrubParameters, v as getWalletProviderRegistry, w as offEvent, x as getChainFromVerifiedCredentialChain, z as APIError } from "./InvalidParamError-DSXDW6g4.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-b-H_ta9Q.native.esm.js";
|
|
3
|
+
import { _ as normalizeAddress, a as parseElevatedAccessToken, g as formatWalletAccountId, i as upsertElevatedAccessToken, l as getWalletProviders, n as getVerifiedCredentialForWalletAccount, o as initializeWaasClientsForEagerRecovery, p as getWalletAccounts, r as updateAuthFromVerifyResponse, t as getWalletProviderByKey, u as checkAndRaiseWalletAccountsChangedEvent, v as splitWalletProviderKey } from "./getWalletProviderByKey-Dk_K8Lg8.native.esm.js";
|
|
4
|
+
import { t as __refreshAuth_wrapped } from "./refreshAuth-CfUYFXh_.native.esm.js";
|
|
5
|
+
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-BXnpnD2X.native.esm.js";
|
|
6
|
+
import { n as NotWaasWalletAccountError } from "./isDynamicWaasEnabled-DNtxO0Bc.native.esm.js";
|
|
7
|
+
import { a as WaasOnboardingIncompleteError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, r as isDeviceRegistrationRequired, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-BRfyMejK.native.esm.js";
|
|
8
8
|
import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
|
|
9
9
|
import { AuthModeEnum, ExchangeKeyEnum, JwtVerifiedCredentialFormatEnum, MFAAction, MfaBackupCodeAcknowledgement, ProviderEnum, TokenScope, WaasBackupOptionsEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
10
10
|
import * as z from "zod/mini";
|
|
@@ -7495,6 +7495,28 @@ const __connectWithWalletProvider_wrapped = instrumentFunction({
|
|
|
7495
7495
|
}
|
|
7496
7496
|
});
|
|
7497
7497
|
|
|
7498
|
+
//#endregion
|
|
7499
|
+
//#region src/utils/retryOnFetchError/retryOnFetchError.ts
|
|
7500
|
+
/**
|
|
7501
|
+
* Retries `fn` only when it rejects with the `TypeError` that `fetch` throws on
|
|
7502
|
+
* a transport-level network failure (the connection drops before the server
|
|
7503
|
+
* responds). Per the WHATWG Fetch standard every engine rejects with a
|
|
7504
|
+
* `TypeError` here and only the message differs.
|
|
7505
|
+
* Everything that is not a `TypeError` is rethrown immediately and never
|
|
7506
|
+
* retried.
|
|
7507
|
+
*
|
|
7508
|
+
* @notInstrumented
|
|
7509
|
+
*/
|
|
7510
|
+
const retryOnFetchError = async ({ delay = 1e3, fn, maxRetries = 2, onRetry }) => {
|
|
7511
|
+
for (let retry = 0;; retry++) try {
|
|
7512
|
+
return await fn();
|
|
7513
|
+
} catch (error) {
|
|
7514
|
+
if (retry >= maxRetries || !(error instanceof TypeError)) throw error;
|
|
7515
|
+
onRetry?.({ error });
|
|
7516
|
+
if (delay > 0) await new Promise((resolve) => setTimeout(resolve, delay));
|
|
7517
|
+
}
|
|
7518
|
+
};
|
|
7519
|
+
|
|
7498
7520
|
//#endregion
|
|
7499
7521
|
//#region src/modules/wallets/hardwareWallet/formatSignatureForHardwareWallet/formatSignatureForHardwareWallet.ts
|
|
7500
7522
|
/**
|
|
@@ -7621,7 +7643,7 @@ const verifyWalletAccountForSignInOrTransfer = async ({ walletAccount, isTransfe
|
|
|
7621
7643
|
signature
|
|
7622
7644
|
}) : signature;
|
|
7623
7645
|
const { networkId } = await walletProvider.getActiveNetworkId();
|
|
7624
|
-
const
|
|
7646
|
+
const verify = () => verifyMessageSignatureOwnership({
|
|
7625
7647
|
addressesWithTypes: walletAccount.addressesWithTypes,
|
|
7626
7648
|
chain: walletAccount.chain,
|
|
7627
7649
|
isTransfer,
|
|
@@ -7633,6 +7655,10 @@ const verifyWalletAccountForSignInOrTransfer = async ({ walletAccount, isTransfe
|
|
|
7633
7655
|
walletDisplayName: walletProvider.metadata.displayName,
|
|
7634
7656
|
walletProviderType: walletProvider.walletProviderType
|
|
7635
7657
|
}, client);
|
|
7658
|
+
const response = walletProvider.shouldRetryVerificationOnNetworkError ? await retryOnFetchError({
|
|
7659
|
+
fn: verify,
|
|
7660
|
+
onRetry: ({ error }) => getCore(client).logger.warn("Retrying wallet verification after network error", error)
|
|
7661
|
+
}) : await verify();
|
|
7636
7662
|
const walletVerifiedCredential = response.user?.verifiedCredentials.find((verifiedCredential) => isSameAddress({
|
|
7637
7663
|
chain: walletAccount.chain,
|
|
7638
7664
|
left: verifiedCredential.address ?? "",
|