@dynamic-labs-sdk/client 1.33.0 → 1.33.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/{apiClient-4r7VAsLC.native.esm.js → apiClient-B0eCQXEJ.native.esm.js} +3 -3
- package/dist/{apiClient-4r7VAsLC.native.esm.js.map → apiClient-B0eCQXEJ.native.esm.js.map} +1 -1
- package/dist/core.cjs +24 -5
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +9 -8
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +9 -8
- package/dist/core.native.esm.js.map +1 -1
- package/dist/exports/core.d.ts +8 -0
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-D9oRzWA6.esm.js → getNetworkProviderFromNetworkId-CgxCy8qP.esm.js} +9 -8
- package/dist/getNetworkProviderFromNetworkId-CgxCy8qP.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-DOrcvuFv.cjs → getNetworkProviderFromNetworkId-DaxDzIv4.cjs} +9 -2
- package/dist/getNetworkProviderFromNetworkId-DaxDzIv4.cjs.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-BV229QF3.native.esm.js → getNetworkProviderFromNetworkId-OXG2gPby.native.esm.js} +10 -9
- package/dist/getNetworkProviderFromNetworkId-OXG2gPby.native.esm.js.map +1 -0
- package/dist/{getSignedSessionId-Cd8CCp5d.native.esm.js → getSignedSessionId-B2s2UuwJ.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-Cd8CCp5d.native.esm.js.map → getSignedSessionId-B2s2UuwJ.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-DA-MMsJm.esm.js → getSignedSessionId-DdMeCIV-.esm.js} +3 -3
- package/dist/{getSignedSessionId-DA-MMsJm.esm.js.map → getSignedSessionId-DdMeCIV-.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-4qHh_BOh.cjs → getSignedSessionId-KiBgLtda.cjs} +3 -3
- package/dist/{getSignedSessionId-4qHh_BOh.cjs.map → getSignedSessionId-KiBgLtda.cjs.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-Fr3bEKeU.esm.js → getVerifiedCredentialForWalletAccount-DzZ-0SaQ.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-Fr3bEKeU.esm.js.map → getVerifiedCredentialForWalletAccount-DzZ-0SaQ.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-Bw5q7QZn.cjs → getVerifiedCredentialForWalletAccount-y2drOcyb.cjs} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-Bw5q7QZn.cjs.map → getVerifiedCredentialForWalletAccount-y2drOcyb.cjs.map} +1 -1
- package/dist/index.cjs +56 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +50 -63
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +50 -63
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-BdU62usM.esm.js → isMfaRequiredForAction-BLegdReE.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-BdU62usM.esm.js.map → isMfaRequiredForAction-BLegdReE.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-Djd-jkSl.cjs → isMfaRequiredForAction-By7uHgpn.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-Djd-jkSl.cjs.map → isMfaRequiredForAction-By7uHgpn.cjs.map} +1 -1
- package/dist/{isMfaRequiredForAction-DZfEkyIU.native.esm.js → isMfaRequiredForAction-CXuuO-wy.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-DZfEkyIU.native.esm.js.map → isMfaRequiredForAction-CXuuO-wy.native.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-BEZOYohA.esm.js → isUserOnboardingComplete-Bvh4NLBz.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-BEZOYohA.esm.js.map → isUserOnboardingComplete-Bvh4NLBz.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-Bwvv6Urs.cjs → isUserOnboardingComplete-DMefkHRY.cjs} +3 -3
- package/dist/{isUserOnboardingComplete-Bwvv6Urs.cjs.map → isUserOnboardingComplete-DMefkHRY.cjs.map} +1 -1
- package/dist/{isUserOnboardingComplete-CEUkAzCi.native.esm.js → isUserOnboardingComplete-hn1rWlA-.native.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-CEUkAzCi.native.esm.js.map → isUserOnboardingComplete-hn1rWlA-.native.esm.js.map} +1 -1
- package/dist/{logoutWithReason-I6vShLpA.esm.js → logoutWithReason-B-cf-dUs.esm.js} +62 -50
- package/dist/logoutWithReason-B-cf-dUs.esm.js.map +1 -0
- package/dist/{logoutWithReason-DvnEa2Uv.native.esm.js → logoutWithReason-C4AgSbjv.native.esm.js} +61 -49
- package/dist/logoutWithReason-C4AgSbjv.native.esm.js.map +1 -0
- package/dist/{logoutWithReason-B-ZF0VmN.cjs → logoutWithReason-c1DmyRBx.cjs} +73 -55
- package/dist/logoutWithReason-c1DmyRBx.cjs.map +1 -0
- package/dist/{migrateFromFireblocks-6I7lkraQ.native.esm.js → migrateFromFireblocks-B0pkwAaK.native.esm.js} +2 -2
- package/dist/{migrateFromFireblocks-6I7lkraQ.native.esm.js.map → migrateFromFireblocks-B0pkwAaK.native.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-Dtk6t8hN.esm.js → migrateFromFireblocks-B76sFd7a.esm.js} +2 -2
- package/dist/{migrateFromFireblocks-Dtk6t8hN.esm.js.map → migrateFromFireblocks-B76sFd7a.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-C23-24bK.cjs → migrateFromFireblocks-RCqy2qOG.cjs} +2 -2
- package/dist/{migrateFromFireblocks-C23-24bK.cjs.map → migrateFromFireblocks-RCqy2qOG.cjs.map} +1 -1
- package/dist/modules/initializeClient/consts.d.ts +1 -0
- package/dist/modules/initializeClient/consts.d.ts.map +1 -1
- package/dist/modules/initializeClient/initializeClient.d.ts.map +1 -1
- package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts +4 -5
- package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts +8 -3
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/parseGovernedResponse.d.ts +34 -0
- package/dist/modules/waas/businessAccounts/parseGovernedResponse.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.d.ts +4 -3
- package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.d.ts +4 -3
- package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/removeBusinessAccountWallet/removeBusinessAccountWallet.d.ts +4 -3
- package/dist/modules/waas/businessAccounts/removeBusinessAccountWallet/removeBusinessAccountWallet.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/transferBusinessAccountOwnership/transferBusinessAccountOwnership.d.ts +4 -3
- package/dist/modules/waas/businessAccounts/transferBusinessAccountOwnership/transferBusinessAccountOwnership.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.d.ts +4 -3
- package/dist/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/{waas-C0IDCf3u.cjs → waas-7vSYuH3H.cjs} +104 -30
- package/dist/waas-7vSYuH3H.cjs.map +1 -0
- package/dist/{waas-DJeW02-Y.native.esm.js → waas-DIlnOHm6.native.esm.js} +104 -30
- package/dist/waas-DIlnOHm6.native.esm.js.map +1 -0
- package/dist/{waas-D_alZrtb.esm.js → waas-H5xyBfTI.esm.js} +104 -30
- package/dist/waas-H5xyBfTI.esm.js.map +1 -0
- package/dist/waas.cjs +4 -4
- package/dist/waas.esm.js +4 -4
- package/dist/waas.native.esm.js +4 -4
- package/dist/waasCore.cjs +5 -5
- package/dist/waasCore.esm.js +5 -5
- package/dist/waasCore.native.esm.js +5 -5
- package/package.json +3 -3
- package/dist/getNetworkProviderFromNetworkId-BV229QF3.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-D9oRzWA6.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-DOrcvuFv.cjs.map +0 -1
- package/dist/logoutWithReason-B-ZF0VmN.cjs.map +0 -1
- package/dist/logoutWithReason-DvnEa2Uv.native.esm.js.map +0 -1
- package/dist/logoutWithReason-I6vShLpA.esm.js.map +0 -1
- package/dist/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.d.ts +0 -5
- package/dist/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.d.ts.map +0 -1
- package/dist/waas-C0IDCf3u.cjs.map +0 -1
- package/dist/waas-DJeW02-Y.native.esm.js.map +0 -1
- package/dist/waas-D_alZrtb.esm.js.map +0 -1
package/dist/index.native.esm.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { $ as createLocalStorageAdapter, A as offEvent, B as normalizeAddress, Ct as getCore, D as WalletProviderPriority, Dt as name, E as getWalletProviders, Et as TokenScope, L as getChainFromVerifiedCredentialChain, M as onceEvent, O as getWalletProviderRegistry, Ot as version, P as getWalletAccounts, Q as createStorageKeySchema, R as CHAINS_INFO_MAP, U as isUserMissingMfaAuth, V as splitWalletProviderKey, X as fetchAndStoreNonces, Y as getNonce, Z as updateNoncePoolStorage, _ as checkAndRaiseWalletAccountsChangedEvent, _t as getElevatedAccessToken, a as resolveInstrumentationCore, at as LinkCredentialError, bt as getDefaultClient, c as DEFAULT_PII_FIELDS, d as extractSessionId, et as NONCE_POOL_SIZE, f as updateAuthFromVerifyResponse, ft as SDK_API_CORE_VERSION, g as InvalidParamError, gt as ValueMustBeDefinedError, h as decodeJwt, ht as assertDefined, i as __refreshAuth_wrapped, it as MfaInvalidOtpError, j as onEvent, k as emitEvent, l as getUserAgent, m as parseElevatedAccessToken, mt as isCookieEnabled, n as NoWalletProviderFoundError, nt as SandboxMaximumThresholdReachedError, o as instrumentFunction, ot as InvalidExternalAuthError, p as upsertElevatedAccessToken, r as createApiClient, rt as MfaRateLimitedError, s as scrubParameters, st as APIError, t as getWalletProviderFromWalletAccount, tt as UnauthorizedError, u as getOperatingSystem, ut as DYNAMIC_ICONIC_SPRITE_URL, vt as randomString, wt as BaseError, xt as setDefaultClient, y as initializeWaasClientsForEagerRecovery, yt as getPlatform, z as formatWalletAccountId } from "./apiClient-
|
|
2
|
-
import { a as TransactionBroadcastError, i as NotWaasWalletAccountError } from "./migrateFromFireblocks-
|
|
3
|
-
import { $ as WaasChainEnum } from "./waas-
|
|
4
|
-
import { A as createLogger, B as
|
|
5
|
-
import { a as
|
|
6
|
-
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-
|
|
7
|
-
import { a as WaasRbacStaleRetryUnsafeError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, o as WaasOnboardingIncompleteError, r as isDeviceRegistrationRequired, s as WaasLoadFailedError, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-
|
|
1
|
+
import { $ as createLocalStorageAdapter, A as offEvent, B as normalizeAddress, Ct as getCore, D as WalletProviderPriority, Dt as name, E as getWalletProviders, Et as TokenScope, L as getChainFromVerifiedCredentialChain, M as onceEvent, O as getWalletProviderRegistry, Ot as version, P as getWalletAccounts, Q as createStorageKeySchema, R as CHAINS_INFO_MAP, U as isUserMissingMfaAuth, V as splitWalletProviderKey, X as fetchAndStoreNonces, Y as getNonce, Z as updateNoncePoolStorage, _ as checkAndRaiseWalletAccountsChangedEvent, _t as getElevatedAccessToken, a as resolveInstrumentationCore, at as LinkCredentialError, bt as getDefaultClient, c as DEFAULT_PII_FIELDS, d as extractSessionId, et as NONCE_POOL_SIZE, f as updateAuthFromVerifyResponse, ft as SDK_API_CORE_VERSION, g as InvalidParamError, gt as ValueMustBeDefinedError, h as decodeJwt, ht as assertDefined, i as __refreshAuth_wrapped, it as MfaInvalidOtpError, j as onEvent, k as emitEvent, l as getUserAgent, m as parseElevatedAccessToken, mt as isCookieEnabled, n as NoWalletProviderFoundError, nt as SandboxMaximumThresholdReachedError, o as instrumentFunction, ot as InvalidExternalAuthError, p as upsertElevatedAccessToken, r as createApiClient, rt as MfaRateLimitedError, s as scrubParameters, st as APIError, t as getWalletProviderFromWalletAccount, tt as UnauthorizedError, u as getOperatingSystem, ut as DYNAMIC_ICONIC_SPRITE_URL, vt as randomString, wt as BaseError, xt as setDefaultClient, y as initializeWaasClientsForEagerRecovery, yt as getPlatform, z as formatWalletAccountId } from "./apiClient-B0eCQXEJ.native.esm.js";
|
|
2
|
+
import { a as TransactionBroadcastError, i as NotWaasWalletAccountError } from "./migrateFromFireblocks-B0pkwAaK.native.esm.js";
|
|
3
|
+
import { $ as WaasChainEnum } from "./waas-DIlnOHm6.native.esm.js";
|
|
4
|
+
import { A as createLogger, B as MIGRATE_SESSION_KEY_TRACKER_KEY, C as MergeAccountsConfirmationError, D as createKeychainService, E as assertSafeDeeplinkUrl, F as createDeferredPromise, G as subscribeWithSelector, H as REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY, I as createAppForegroundSubscriber, K as isEqualShallow, L as FETCH_PROJECT_SETTINGS_TRACKER_KEY, M as createCrossTabBroadcast, O as assertSafeNavigationUrl, P as CannotTrackError, R as GENERATE_SESSION_KEYS_TRACKER_KEY, S as NoNetworkProvidersError, T as createRealtimeService, U as isServerSideRendering, V as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, W as getBuffer, _ as isCaptchaRequired, a as removeUnverifiedWalletAccount, b as WalletScreeningBlockedError, c as reconcileWalletAccountsAgainstClient, d as createVisit, f as getUriConnectionStarterRegistry, g as consumeCaptchaToken, h as __setCaptchaToken_wrapped, i as verifyMessageSignatureOwnership, j as createEventEmitter, l as updateWalletProviderKeysForVerifiedCredentials, m as hasExtension, o as createSignInMessageStatement, p as getNetworkProviderBuilderRegistry, q as createStorage, r as getNetworksData, s as formatSignInMessage, t as getNetworkProviderFromNetworkId, u as setUnverifiedWalletAccounts, v as getAppMetadata, w as getKeychainIndexedDBName, x as WalletAlreadyLinkedToAnotherUserError, y as MethodNotImplementedError, z as INITIALIZE_STORAGE_SYNC_TRACKER_KEY } from "./getNetworkProviderFromNetworkId-OXG2gPby.native.esm.js";
|
|
5
|
+
import { a as stateStorageKeySchema, c as getWalletProviderByKey, i as sessionStorageKeySchema, n as generateSessionKeys, o as retryOnFail, r as fetchProjectSettings, s as getVerifiedCredentialForWalletAccount, t as __logoutWithReason_wrapped } from "./logoutWithReason-C4AgSbjv.native.esm.js";
|
|
6
|
+
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-CXuuO-wy.native.esm.js";
|
|
7
|
+
import { a as WaasRbacStaleRetryUnsafeError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, o as WaasOnboardingIncompleteError, r as isDeviceRegistrationRequired, s as WaasLoadFailedError, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-hn1rWlA-.native.esm.js";
|
|
8
8
|
import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
|
|
9
9
|
import { AuthModeEnum, CaptchaProviderEnum as CaptchaProviderEnum$1, ChainEnum, ExchangeKeyEnum, JwtVerifiedCredentialFormatEnum as JwtVerifiedCredentialFormatEnum$1, MFAAction as MFAAction$1, MfaBackupCodeAcknowledgement, ProviderEnum as ProviderEnum$1, TokenScope as TokenScope$1, WaasBackupOptionsEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
10
10
|
import * as z from "zod/mini";
|
|
11
11
|
import { Linking } from "react-native";
|
|
12
|
-
import { EventEmitter } from "eventemitter3";
|
|
12
|
+
import { EventEmitter as EventEmitter$1 } from "eventemitter3";
|
|
13
13
|
import { Passkey } from "react-native-passkey";
|
|
14
14
|
|
|
15
15
|
//#region src/modules/state/raiseStateEvents/events.ts
|
|
@@ -166,57 +166,6 @@ const setupCrossTabEventSync = (client) => {
|
|
|
166
166
|
core.crossTabBroadcast.on("deviceRegistrationCompleted", handleCrossTabDeviceRegistrationCompleted);
|
|
167
167
|
};
|
|
168
168
|
|
|
169
|
-
//#endregion
|
|
170
|
-
//#region src/modules/wallets/unverifiedWalletAccounts/schema.ts
|
|
171
|
-
const unverifiedWalletAccountSchema = z.object({
|
|
172
|
-
address: z.string(),
|
|
173
|
-
addressesWithTypes: z.optional(z.array(z.object({
|
|
174
|
-
address: z.string(),
|
|
175
|
-
publicKey: z.optional(z.string()),
|
|
176
|
-
type: z.custom((val) => typeof val === "string")
|
|
177
|
-
}))),
|
|
178
|
-
chain: z.custom((val) => typeof val === "string"),
|
|
179
|
-
hardwareWalletVendor: z.optional(z.custom((val) => typeof val === "string")),
|
|
180
|
-
id: z.string(),
|
|
181
|
-
lastSelectedAt: z.nullable(z.date()),
|
|
182
|
-
walletProviderKey: z.string()
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
//#endregion
|
|
186
|
-
//#region src/modules/wallets/walletProvider/walletProviderKeyMap/schema.ts
|
|
187
|
-
const walletProviderKeyMapSchema = z.record(z.string(), z.string());
|
|
188
|
-
|
|
189
|
-
//#endregion
|
|
190
|
-
//#region src/modules/storageSync/schema.ts
|
|
191
|
-
const stateStorageKeySchema = createStorageKeySchema({
|
|
192
|
-
key: "state",
|
|
193
|
-
schema: z.object({
|
|
194
|
-
apiVersion: z.string(),
|
|
195
|
-
projectSettings: z.custom(),
|
|
196
|
-
unverifiedWalletAccounts: z.array(unverifiedWalletAccountSchema),
|
|
197
|
-
user: z.custom(),
|
|
198
|
-
walletProviderKeyMap: walletProviderKeyMapSchema
|
|
199
|
-
})
|
|
200
|
-
});
|
|
201
|
-
const sessionStorageKeySchema = createStorageKeySchema({
|
|
202
|
-
config: { storageTier: "secure" },
|
|
203
|
-
key: "session",
|
|
204
|
-
schema: z.object({
|
|
205
|
-
captchaToken: z.nullable(z.string()),
|
|
206
|
-
elevatedAccessTokens: z.array(z.object({
|
|
207
|
-
expiresAt: z.number(),
|
|
208
|
-
scopes: z.array(z.string()),
|
|
209
|
-
singleUse: z.nullable(z.boolean()),
|
|
210
|
-
token: z.string()
|
|
211
|
-
})),
|
|
212
|
-
legacyToken: z.nullable(z.string()),
|
|
213
|
-
mfaToken: z.nullable(z.string()),
|
|
214
|
-
sessionExpiration: z.number(),
|
|
215
|
-
sessionKeys: z.nullable(z.string()),
|
|
216
|
-
token: z.nullable(z.string())
|
|
217
|
-
})
|
|
218
|
-
});
|
|
219
|
-
|
|
220
169
|
//#endregion
|
|
221
170
|
//#region src/modules/keychainMigration/migrateSessionKeyToKeychain/KeyMigrationError.ts
|
|
222
171
|
var KeyMigrationError = class extends BaseError {
|
|
@@ -508,7 +457,7 @@ const initializeClient = async (client = getDefaultClient()) => {
|
|
|
508
457
|
raiseStateEvents(client);
|
|
509
458
|
setupCrossTabEventSync(client);
|
|
510
459
|
const initializeStorageSyncPromise = initializeStorageSync(client);
|
|
511
|
-
const
|
|
460
|
+
const migrationPromise = initializeStorageSyncPromise.then(async () => {
|
|
512
461
|
await migrateSessionKeyToKeychain({
|
|
513
462
|
keychain: core.keychain,
|
|
514
463
|
logger: core.logger,
|
|
@@ -517,8 +466,13 @@ const initializeClient = async (client = getDefaultClient()) => {
|
|
|
517
466
|
}).catch(() => __logoutWithReason_wrapped({ reason: "keychain-migration-failed" }, client));
|
|
518
467
|
if (core.state.get().sessionKeys && !await core.keychain.hasKey("session")) await __logoutWithReason_wrapped({ reason: "keychain-key-missing" }, client);
|
|
519
468
|
await logoutIfSessionPublicKeyMismatched(client);
|
|
520
|
-
})
|
|
521
|
-
|
|
469
|
+
});
|
|
470
|
+
core.initTrack.track({
|
|
471
|
+
name: MIGRATE_SESSION_KEY_TRACKER_KEY,
|
|
472
|
+
promise: migrationPromise
|
|
473
|
+
});
|
|
474
|
+
const fetchProjectSettingsPromise = initializeStorageSyncPromise.then(async () => {
|
|
475
|
+
await fetchProjectSettings(client);
|
|
522
476
|
});
|
|
523
477
|
fetchProjectSettingsPromise.then(() => prefetchNoncesIfNeeded(client)).catch((error) => {
|
|
524
478
|
core.logger.error("Failed to prefetch nonces:", error);
|
|
@@ -620,7 +574,7 @@ const createAsyncTrack = () => {
|
|
|
620
574
|
* This ensures no process is missed (as it would throw when tracked on a different node tick).
|
|
621
575
|
*/
|
|
622
576
|
let isTrackEnabled = true;
|
|
623
|
-
const eventEmitter = new EventEmitter();
|
|
577
|
+
const eventEmitter = new EventEmitter$1();
|
|
624
578
|
const allSettledPromise = createDeferredPromise();
|
|
625
579
|
const tracker = /* @__PURE__ */ new Map();
|
|
626
580
|
/**
|
|
@@ -2238,6 +2192,39 @@ const __signInWithExternalJwt_wrapped = instrumentFunction({
|
|
|
2238
2192
|
getCore: resolveInstrumentationCore
|
|
2239
2193
|
});
|
|
2240
2194
|
|
|
2195
|
+
//#endregion
|
|
2196
|
+
//#region src/modules/auth/isSignedIn/isSignedIn.ts
|
|
2197
|
+
/**
|
|
2198
|
+
* Checks if the user is currently signed in to the Dynamic client.
|
|
2199
|
+
*
|
|
2200
|
+
* The client is considered to be in a signed in state if a user has
|
|
2201
|
+
* authenticated or if the client has at least one wallet connected.
|
|
2202
|
+
*
|
|
2203
|
+
* @deprecated What counts as "signed in" is your app's business logic, not the
|
|
2204
|
+
* SDK's. This helper bakes in one opinion (a user OR any connected wallet),
|
|
2205
|
+
* which rarely matches every app and forces a dependency on us for every
|
|
2206
|
+
* variation. Compose your own check from the underlying primitives instead —
|
|
2207
|
+
* e.g. `Boolean(client.user) || isAnyWalletAccountConnected(client)` — and
|
|
2208
|
+
* layer in whatever your app requires (device registration, completed
|
|
2209
|
+
* onboarding, satisfied MFA, a required embedded wallet, …). See the
|
|
2210
|
+
* "Check if signed in" guide:
|
|
2211
|
+
* https://www.dynamic.xyz/docs/javascript/user-session-management
|
|
2212
|
+
*
|
|
2213
|
+
* @example
|
|
2214
|
+
* ```ts
|
|
2215
|
+
* if (isSignedIn()) {
|
|
2216
|
+
* console.log('User is authenticated or has a wallet connected');
|
|
2217
|
+
* }
|
|
2218
|
+
* ```
|
|
2219
|
+
*
|
|
2220
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2221
|
+
* @returns True if the user is signed in, false otherwise.
|
|
2222
|
+
* @see logout
|
|
2223
|
+
* @see isAnyWalletAccountConnected
|
|
2224
|
+
* @notInstrumented
|
|
2225
|
+
*/
|
|
2226
|
+
const isSignedIn = (client = getDefaultClient()) => Boolean(client.user || getWalletAccounts(client).length > 0);
|
|
2227
|
+
|
|
2241
2228
|
//#endregion
|
|
2242
2229
|
//#region src/modules/auth/logout/logout.ts
|
|
2243
2230
|
/**
|