@dynamic-labs-sdk/client 1.14.0 → 1.16.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-DHriGGNI.cjs} +4 -4
- package/dist/{InvalidParamError-Cs4ZMEj4.cjs.map → InvalidParamError-DHriGGNI.cjs.map} +1 -1
- package/dist/{InvalidParamError-BKr8fFc1.native.esm.js → InvalidParamError-DYezznCD.native.esm.js} +3 -3
- package/dist/{InvalidParamError-BKr8fFc1.native.esm.js.map → InvalidParamError-DYezznCD.native.esm.js.map} +1 -1
- package/dist/{InvalidParamError-DZjc7Tjc.esm.js → InvalidParamError-Dn_riAvL.esm.js} +3 -3
- package/dist/{InvalidParamError-DZjc7Tjc.esm.js.map → InvalidParamError-Dn_riAvL.esm.js.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-DZkq74O7.native.esm.js → getNetworkProviderFromNetworkId-BURAkmc3.native.esm.js} +4 -4
- package/dist/{getNetworkProviderFromNetworkId-DZkq74O7.native.esm.js.map → getNetworkProviderFromNetworkId-BURAkmc3.native.esm.js.map} +1 -1
- package/dist/{getNetworkProviderFromNetworkId-CdCEFEgT.cjs → getNetworkProviderFromNetworkId-BpvoqbEH.cjs} +4 -4
- package/dist/{getNetworkProviderFromNetworkId-CdCEFEgT.cjs.map → getNetworkProviderFromNetworkId-BpvoqbEH.cjs.map} +1 -1
- package/dist/{getNetworkProviderFromNetworkId-ChFA088e.esm.js → getNetworkProviderFromNetworkId-CregkqLB.esm.js} +3 -3
- package/dist/{getNetworkProviderFromNetworkId-ChFA088e.esm.js.map → getNetworkProviderFromNetworkId-CregkqLB.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-DceZVits.cjs → getSignedSessionId-C98wdvMw.cjs} +3 -3
- package/dist/{getSignedSessionId-DceZVits.cjs.map → getSignedSessionId-C98wdvMw.cjs.map} +1 -1
- package/dist/{getSignedSessionId-DrrvGNcG.esm.js → getSignedSessionId-Czpvp58E.esm.js} +3 -3
- package/dist/{getSignedSessionId-DrrvGNcG.esm.js.map → getSignedSessionId-Czpvp58E.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-DmDcWkqB.native.esm.js → getSignedSessionId-upC71vLP.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-DmDcWkqB.native.esm.js.map → getSignedSessionId-upC71vLP.native.esm.js.map} +1 -1
- package/dist/{getWaasWalletProviderFromWalletAccount-CKZIsFWL.cjs → getWaasWalletProviderFromWalletAccount-BrskhuL8.cjs} +3 -3
- package/dist/{getWaasWalletProviderFromWalletAccount-CKZIsFWL.cjs.map → getWaasWalletProviderFromWalletAccount-BrskhuL8.cjs.map} +1 -1
- package/dist/{getWaasWalletProviderFromWalletAccount-C2GdfqUr.native.esm.js → getWaasWalletProviderFromWalletAccount-DHKga3uH.native.esm.js} +3 -3
- package/dist/{getWaasWalletProviderFromWalletAccount-C2GdfqUr.native.esm.js.map → getWaasWalletProviderFromWalletAccount-DHKga3uH.native.esm.js.map} +1 -1
- package/dist/{getWaasWalletProviderFromWalletAccount-B_8slAdm.esm.js → getWaasWalletProviderFromWalletAccount-Dc6QvHVt.esm.js} +3 -3
- package/dist/{getWaasWalletProviderFromWalletAccount-B_8slAdm.esm.js.map → getWaasWalletProviderFromWalletAccount-Dc6QvHVt.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-OD65GUWG.cjs → getWalletProviderByKey-DDNCUbUe.cjs} +3 -3
- package/dist/{getWalletProviderByKey-OD65GUWG.cjs.map → getWalletProviderByKey-DDNCUbUe.cjs.map} +1 -1
- package/dist/{getWalletProviderByKey-DWYF9IxH.esm.js → getWalletProviderByKey-DTi6MhKt.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-DWYF9IxH.esm.js.map → getWalletProviderByKey-DTi6MhKt.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-BhisAyZg.native.esm.js → getWalletProviderByKey-OYhHm11_.native.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-BhisAyZg.native.esm.js.map → getWalletProviderByKey-OYhHm11_.native.esm.js.map} +1 -1
- package/dist/index.cjs +35 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +35 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +35 -9
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isDynamicWaasEnabled-C90E53x1.cjs → isDynamicWaasEnabled-Bj3v8LZ_.cjs} +3 -3
- package/dist/{isDynamicWaasEnabled-C90E53x1.cjs.map → isDynamicWaasEnabled-Bj3v8LZ_.cjs.map} +1 -1
- package/dist/{isDynamicWaasEnabled-C9gQ9M80.esm.js → isDynamicWaasEnabled-CuSe2RO1.esm.js} +2 -2
- package/dist/{isDynamicWaasEnabled-C9gQ9M80.esm.js.map → isDynamicWaasEnabled-CuSe2RO1.esm.js.map} +1 -1
- package/dist/{isDynamicWaasEnabled-rRFvljev.native.esm.js → isDynamicWaasEnabled-CvD8_c7H.native.esm.js} +2 -2
- package/dist/{isDynamicWaasEnabled-rRFvljev.native.esm.js.map → isDynamicWaasEnabled-CvD8_c7H.native.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-CTQzzCMt.esm.js → isMfaRequiredForAction-CgVdSGRA.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-CTQzzCMt.esm.js.map → isMfaRequiredForAction-CgVdSGRA.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-DFowphoV.cjs → isMfaRequiredForAction-DECknr5q.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-DFowphoV.cjs.map → isMfaRequiredForAction-DECknr5q.cjs.map} +1 -1
- package/dist/{isMfaRequiredForAction-C1KaU-XS.native.esm.js → isMfaRequiredForAction-juTvf3Pl.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-C1KaU-XS.native.esm.js.map → isMfaRequiredForAction-juTvf3Pl.native.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-D1gGc77y.esm.js → isUserOnboardingComplete-DFrrp61b.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-D1gGc77y.esm.js.map → isUserOnboardingComplete-DFrrp61b.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-DfDNapVu.native.esm.js → isUserOnboardingComplete-Dtr1_Mi4.native.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-DfDNapVu.native.esm.js.map → isUserOnboardingComplete-Dtr1_Mi4.native.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-77jTT2BB.cjs → isUserOnboardingComplete-DvCQh8Dj.cjs} +4 -4
- package/dist/{isUserOnboardingComplete-77jTT2BB.cjs.map → isUserOnboardingComplete-DvCQh8Dj.cjs.map} +1 -1
- package/dist/modules/flow/attachFlowSource/attachFlowSource.d.ts +3 -3
- package/dist/modules/flow/attachFlowSource/attachFlowSource.d.ts.map +1 -1
- package/dist/modules/wallets/networks/getActiveNetworkData/getActiveNetworkData.d.ts +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-aTqsU1uq.native.esm.js → refreshAuth-CKHkaRJo.native.esm.js} +3 -3
- package/dist/{refreshAuth-aTqsU1uq.native.esm.js.map → refreshAuth-CKHkaRJo.native.esm.js.map} +1 -1
- package/dist/{refreshAuth-CAPTC0sg.esm.js → refreshAuth-Q5fxSi3Z.esm.js} +3 -3
- package/dist/{refreshAuth-CAPTC0sg.esm.js.map → refreshAuth-Q5fxSi3Z.esm.js.map} +1 -1
- package/dist/{refreshAuth-B3XSU6GT.cjs → refreshAuth-oycoOXtD.cjs} +3 -3
- package/dist/{refreshAuth-B3XSU6GT.cjs.map → refreshAuth-oycoOXtD.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 +4 -4
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-DYezznCD.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-BURAkmc3.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-OYhHm11_.native.esm.js";
|
|
4
|
+
import { t as __refreshAuth_wrapped } from "./refreshAuth-CKHkaRJo.native.esm.js";
|
|
5
|
+
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-juTvf3Pl.native.esm.js";
|
|
6
|
+
import { n as NotWaasWalletAccountError } from "./isDynamicWaasEnabled-CvD8_c7H.native.esm.js";
|
|
7
|
+
import { a as WaasOnboardingIncompleteError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, r as isDeviceRegistrationRequired, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-Dtr1_Mi4.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";
|
|
@@ -3284,7 +3284,7 @@ const attachFlowSource = async (params, client = getDefaultClient()) => {
|
|
|
3284
3284
|
else if (params.sourceType === "deposit_address") {
|
|
3285
3285
|
flowAttachSourceRequest.fromChainId = params.fromChainId;
|
|
3286
3286
|
flowAttachSourceRequest.fromChainName = params.fromChainName;
|
|
3287
|
-
if (params.
|
|
3287
|
+
if (params.refundAddress) flowAttachSourceRequest.refundAddress = params.refundAddress;
|
|
3288
3288
|
} else {
|
|
3289
3289
|
flowAttachSourceRequest.fromAddress = params.fromAddress;
|
|
3290
3290
|
flowAttachSourceRequest.fromChainId = params.fromChainId;
|
|
@@ -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 ?? "",
|