@dynamic-labs-sdk/client 0.26.7 → 0.26.10
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-WXK434H2.esm.js → InvalidParamError-De4xrOs4.esm.js} +17 -101
- package/dist/InvalidParamError-De4xrOs4.esm.js.map +1 -0
- package/dist/{InvalidParamError-F90z0K5r.native.esm.js → InvalidParamError-DfGaCYmW.native.esm.js} +17 -101
- package/dist/InvalidParamError-DfGaCYmW.native.esm.js.map +1 -0
- package/dist/{InvalidParamError-DFpM4bIX.cjs → InvalidParamError-XWDgGlk3.cjs} +43 -127
- package/dist/InvalidParamError-XWDgGlk3.cjs.map +1 -0
- package/dist/{NotWaasWalletAccountError-D_qlVMCG.esm.js → NotWaasWalletAccountError-Bws_qXec.native.esm.js} +5 -5
- package/dist/{NotWaasWalletAccountError-QZZmjyhq.native.esm.js.map → NotWaasWalletAccountError-Bws_qXec.native.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-QZZmjyhq.native.esm.js → NotWaasWalletAccountError-CdAul2Xh.esm.js} +5 -5
- package/dist/{NotWaasWalletAccountError-D_qlVMCG.esm.js.map → NotWaasWalletAccountError-CdAul2Xh.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-DbzO2LzZ.cjs → NotWaasWalletAccountError-rJzT_0wz.cjs} +5 -5
- package/dist/{NotWaasWalletAccountError-DbzO2LzZ.cjs.map → NotWaasWalletAccountError-rJzT_0wz.cjs.map} +1 -1
- package/dist/core.cjs +53 -113
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +16 -76
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +16 -76
- package/dist/core.native.esm.js.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-BV9lOcuP.cjs → getNetworkProviderFromNetworkId-C_6K_daH.cjs} +110 -362
- package/dist/getNetworkProviderFromNetworkId-C_6K_daH.cjs.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-BVurb9VE.esm.js → getNetworkProviderFromNetworkId-Cqzo1MhF.esm.js} +41 -293
- package/dist/getNetworkProviderFromNetworkId-Cqzo1MhF.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-DbR2qejA.native.esm.js → getNetworkProviderFromNetworkId-Dz1Wd9-n.native.esm.js} +41 -293
- package/dist/getNetworkProviderFromNetworkId-Dz1Wd9-n.native.esm.js.map +1 -0
- package/dist/{getSignedSessionId-CNkcX15D.cjs → getSignedSessionId-B2YC9266.cjs} +10 -34
- package/dist/getSignedSessionId-B2YC9266.cjs.map +1 -0
- package/dist/{getSignedSessionId-DFiqF8_b.esm.js → getSignedSessionId-D-G950gE.native.esm.js} +7 -31
- package/dist/getSignedSessionId-D-G950gE.native.esm.js.map +1 -0
- package/dist/{getSignedSessionId-DXtxIjxF.native.esm.js → getSignedSessionId-G9BPBkMb.esm.js} +7 -31
- package/dist/getSignedSessionId-G9BPBkMb.esm.js.map +1 -0
- package/dist/{getVerifiedCredentialForWalletAccount-6di80gqF.esm.js → getVerifiedCredentialForWalletAccount-DqXnLSqq.esm.js} +19 -127
- package/dist/getVerifiedCredentialForWalletAccount-DqXnLSqq.esm.js.map +1 -0
- package/dist/{getVerifiedCredentialForWalletAccount-4eVkx2ZN.cjs → getVerifiedCredentialForWalletAccount-SS1WQ2i3.cjs} +67 -175
- package/dist/getVerifiedCredentialForWalletAccount-SS1WQ2i3.cjs.map +1 -0
- package/dist/{getVerifiedCredentialForWalletAccount-CHIZTYim.native.esm.js → getVerifiedCredentialForWalletAccount-a1WXUW0u.native.esm.js} +19 -127
- package/dist/getVerifiedCredentialForWalletAccount-a1WXUW0u.native.esm.js.map +1 -0
- package/dist/index.cjs +203 -635
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +161 -593
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +156 -588
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-DKSH9YEU.esm.js → isMfaRequiredForAction-CPlDnHuj.esm.js} +6 -18
- package/dist/isMfaRequiredForAction-CPlDnHuj.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-ZwjmqVg-.cjs → isMfaRequiredForAction-CYVZ_XGq.cjs} +7 -19
- package/dist/isMfaRequiredForAction-CYVZ_XGq.cjs.map +1 -0
- package/dist/{isMfaRequiredForAction-cJ294BGH.native.esm.js → isMfaRequiredForAction-CwUE98S3.native.esm.js} +6 -18
- package/dist/isMfaRequiredForAction-CwUE98S3.native.esm.js.map +1 -0
- package/dist/modules/apiClient/createApiClient.d.ts +1 -1
- package/dist/modules/apiClient/utils/deviceSignatureHeadersMiddleware/createDeviceSignatureHeadersMiddleware.d.ts +1 -1
- package/dist/modules/apiClient/utils/deviceSignatureHeadersMiddleware/createDeviceSignatureHeadersMiddleware.d.ts.map +1 -1
- package/dist/modules/auth/createVisit/createVisit.d.ts +1 -1
- package/dist/modules/auth/createVisit/createVisit.d.ts.map +1 -1
- package/dist/modules/auth/passkeys/getPasskeys/getPasskeys.d.ts +1 -1
- package/dist/modules/auth/social/getUserSocialAccounts/getUserSocialAccounts.d.ts +1 -1
- package/dist/modules/auth/social/oauth/detectOAuthRedirect/detectOAuthRedirect.d.ts +1 -1
- package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.d.ts +1 -1
- package/dist/modules/auth/updateAuthFromVerifyResponse/updateAuthFromVerifyResponse.d.ts +1 -1
- package/dist/modules/auth/updateAuthFromVerifyResponse/updateAuthFromVerifyResponse.d.ts.map +1 -1
- package/dist/modules/balances/getBalances/getBalances.d.ts +1 -1
- package/dist/modules/balances/getMultichainBalances/getMultichainBalances.d.ts +1 -1
- package/dist/modules/captcha/consumeCaptchaToken/consumeCaptchaToken.d.ts +1 -1
- package/dist/modules/checkout/getCheckoutTransaction/getCheckoutTransaction.d.ts +1 -1
- package/dist/modules/checkout/getCheckoutTransactionQuote/getCheckoutTransactionQuote.d.ts +1 -1
- package/dist/modules/checkout/trackCheckoutTransaction/trackCheckoutTransaction.d.ts +1 -1
- package/dist/modules/checkout/utils/requiresConversion/requiresConversion.d.ts +1 -1
- package/dist/modules/clientEvents/clientEvents.d.ts +3 -3
- package/dist/modules/deviceRegistration/detectDeviceRegistrationRedirect/detectDeviceRegistrationRedirect.d.ts +1 -1
- package/dist/modules/deviceRegistration/getDeviceRegistrationTokenFromUrl/getDeviceRegistrationTokenFromUrl.d.ts +1 -1
- package/dist/modules/deviceRegistration/getDeviceSigner/getDeviceSigner.d.ts +1 -1
- package/dist/modules/deviceRegistration/getDeviceSigner/getDeviceSigner.d.ts.map +1 -1
- package/dist/modules/deviceRegistration/getHeadersForNonceSignedByDeviceSigners/getHeadersForNonceSignedByDeviceSigners.d.ts +1 -1
- package/dist/modules/deviceRegistration/getHeadersForNonceSignedByDeviceSigners/getHeadersForNonceSignedByDeviceSigners.d.ts.map +1 -1
- package/dist/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.d.ts +1 -1
- package/dist/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.d.ts.map +1 -1
- package/dist/modules/extension/registerExtension/registerExtension.d.ts +1 -1
- package/dist/modules/funding/coinbase/addCoinbaseOnrampOrderEventListener/addCoinbaseOnrampOrderEventListener.d.ts +1 -1
- package/dist/modules/funding/coinbase/getCoinbaseBuyUrl/getCoinbaseBuyUrl.d.ts +1 -1
- package/dist/modules/funding/coinbase/getMissingVerificationForCoinbaseOnrampOrder/getMissingVerificationForCoinbaseOnrampOrder.d.ts +1 -1
- package/dist/modules/funding/kraken/getKrakenAccounts/getKrakenAccounts.d.ts +1 -1
- package/dist/modules/funding/kraken/getKrakenWhitelistedAddresses/getKrakenWhitelistedAddresses.d.ts +1 -1
- package/dist/modules/initializeClient/waitForClientInitialized/waitForClientInitialized.d.ts +1 -1
- package/dist/modules/initializeClient/waitForProjectSettings/waitForProjectSettings.d.ts +1 -1
- package/dist/modules/initializeClient/waitForProjectSettings/waitForProjectSettings.d.ts.map +1 -1
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getWalletConnectCatalog.d.ts +1 -1
- package/dist/modules/legacyWalletBook/getWalletConnectCatalogWalletByWalletProviderKey/getWalletConnectCatalogWalletByWalletProviderKey.d.ts +1 -1
- package/dist/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.d.ts +1 -1
- package/dist/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.d.ts.map +1 -1
- package/dist/modules/mfa/getMfaDevices/getMfaDevices.d.ts +1 -1
- package/dist/modules/mfa/getMfaMethods/getMfaMethods.d.ts +1 -1
- package/dist/modules/mfa/getMfaRecoveryCodes/getMfaRecoveryCodes.d.ts +1 -1
- package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts +1 -1
- package/dist/modules/sessionKeys/generateSessionKeys/generateSessionKeys.d.ts +1 -1
- package/dist/modules/sessionKeys/generateSessionKeys/generateSessionKeys.d.ts.map +1 -1
- package/dist/modules/sessionKeys/getSessionKeys/getSessionKeys.d.ts +1 -1
- package/dist/modules/sessionKeys/getSessionKeys/getSessionKeys.d.ts.map +1 -1
- package/dist/modules/sessionKeys/getSignedSessionId/getSignedSessionId.d.ts +1 -1
- package/dist/modules/sessionKeys/getSignedSessionId/getSignedSessionId.d.ts.map +1 -1
- package/dist/modules/swap/getSwapQuote/getSwapQuote.d.ts +1 -1
- package/dist/modules/swap/getSwapStatus/getSwapStatus.d.ts +1 -1
- package/dist/modules/wallets/getAvailableWalletProvidersData/getAvailableWalletProvidersData.d.ts +1 -1
- package/dist/modules/wallets/getConnectedAddresses/getConnectedAddresses.d.ts +1 -1
- package/dist/modules/wallets/getOwnerWalletAccountForSmartWalletAccount/getOwnerWalletAccountForSmartWalletAccount.d.ts +1 -1
- package/dist/modules/wallets/getOwnerWalletAccountForSmartWalletAccount/getOwnerWalletAccountForSmartWalletAccount.d.ts.map +1 -1
- package/dist/modules/wallets/getWalletAccounts/getWalletAccounts.d.ts +1 -1
- package/dist/modules/wallets/getWalletProviders/getWalletProviders.d.ts +1 -1
- package/dist/modules/wallets/networks/createBaseNetworkProvider/createBaseNetworkProvider.d.ts +1 -1
- package/dist/modules/wallets/networks/createBaseNetworkProvider/createBaseNetworkProvider.d.ts.map +1 -1
- package/dist/modules/wallets/networks/getActiveNetworkData/getActiveNetworkData.d.ts +1 -1
- package/dist/modules/wallets/networks/getActiveNetworkId/getActiveNetworkId.d.ts +1 -1
- package/dist/modules/wallets/networks/getBalance/getBalance.d.ts +1 -1
- package/dist/modules/wallets/networks/getBalanceForAddress/getBalanceForAddress.d.ts +1 -1
- package/dist/modules/wallets/networks/getNetworkDataForNetworkId/getNetworkDataForNetworkId.d.ts +1 -1
- package/dist/modules/wallets/networks/getNetworkDataForNetworkId/getNetworkDataForNetworkId.d.ts.map +1 -1
- package/dist/modules/wallets/networks/getNetworkProviderFromNetworkId/getNetworkProviderFromNetworkId.d.ts +1 -1
- package/dist/modules/wallets/networks/getNetworkProviderFromNetworkId/getNetworkProviderFromNetworkId.d.ts.map +1 -1
- package/dist/modules/wallets/networks/getNetworkProviders/getNetworkProviders.d.ts +1 -1
- package/dist/modules/wallets/networks/getNetworksData/getNetworksData.d.ts +1 -1
- package/dist/modules/wallets/networks/getTransactionHistory/getTransactionHistory.d.ts +1 -1
- package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts +1 -1
- package/dist/modules/wallets/unverifiedWalletAccounts/removeUnverifiedWalletAccount/removeUnverifiedWalletAccount.d.ts +1 -1
- package/dist/modules/wallets/unverifiedWalletAccounts/setUnverifiedWalletAccounts/setUnverifiedWalletAccounts.d.ts +1 -1
- package/dist/modules/wallets/utils/getSignInMessage/createSignInMessageStatement/createSignInMessageStatement.d.ts +1 -1
- package/dist/modules/wallets/utils/getSignInMessage/createSignInMessageStatement/createSignInMessageStatement.d.ts.map +1 -1
- package/dist/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.d.ts +1 -1
- package/dist/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.d.ts.map +1 -1
- package/dist/modules/wallets/utils/getWalletProviderFromWalletAccount/getWalletProviderFromWalletAccount.d.ts +1 -1
- package/dist/modules/wallets/utils/getWalletProviderFromWalletAccount/getWalletProviderFromWalletAccount.d.ts.map +1 -1
- package/dist/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.d.ts +1 -1
- package/dist/modules/wallets/walletProvider/defaultImplementations/getActiveNetworkIdFromLastKnownRegistry/getActiveNetworkIdFromLastKnownRegistry.d.ts +1 -1
- package/dist/modules/wallets/walletProvider/defaultImplementations/getActiveNetworkIdFromLastKnownRegistry/getActiveNetworkIdFromLastKnownRegistry.d.ts.map +1 -1
- package/dist/modules/wallets/walletProvider/defaultImplementations/switchActiveNetworkInLastKnownRegistry/switchActiveNetworkInLastKnownRegistry.d.ts +1 -1
- package/dist/modules/wallets/walletProvider/defaultImplementations/switchActiveNetworkInLastKnownRegistry/switchActiveNetworkInLastKnownRegistry.d.ts.map +1 -1
- package/dist/modules/wallets/walletProvider/events/createWalletProviderEventEmitter/createWalletProviderEventEmitter.d.ts +1 -1
- package/dist/modules/wallets/walletProvider/events/offWalletProviderEvent/offWalletProviderEvent.d.ts +1 -1
- package/dist/modules/wallets/walletProvider/events/onWalletProviderEvent/onWalletProviderEvent.d.ts +1 -1
- package/dist/modules/wallets/walletProvider/walletProviderKeyMap/updateWalletProviderKeysForVerifiedCredentials/updateWalletProviderKeysForVerifiedCredentials.d.ts +1 -1
- package/dist/modules/wallets/walletProvider/walletProviderKeyMap/updateWalletProviderKeysForVerifiedCredentials/updateWalletProviderKeysForVerifiedCredentials.d.ts.map +1 -1
- package/dist/services/crossTabBroadcast/createCrossTabBroadcast/createCrossTabBroadcast.d.ts +1 -1
- package/dist/services/keychain/createKeychainService/createKeychainService.d.ts +1 -1
- package/dist/services/keychain/createKeychainService/createKeychainService.d.ts.map +1 -1
- package/dist/services/logger/createLogger/createLogger.d.ts +1 -1
- package/dist/services/realtime/createRealtimeChannelSchema/createRealtimeChannelSchema.d.ts +1 -1
- package/dist/services/realtime/createRealtimeService/createRealtimeService.d.ts +1 -1
- package/dist/services/runtimeServices/createRuntimeServiceAccessKey/createRuntimeServiceAccessKey.d.ts +1 -1
- package/dist/services/storage/createLocalStorageAdapter/createLocalStorageAdapter.d.ts +1 -1
- package/dist/services/storage/createStorage/createStorage.d.ts +1 -1
- package/dist/services/storage/createStorageKeySchema/createStorageKeySchema.d.ts +1 -1
- package/dist/services/storage/createStorageKeySchema/createStorageKeySchema.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/deferredPromise/createDeferredPromise.d.ts +1 -1
- package/dist/utils/deferredPromise/createDeferredPromise.d.ts.map +1 -1
- package/dist/utils/getChainFromVerifiedCredentialChain/getChainFromVerifiedCredentialChain.d.ts +1 -1
- package/dist/utils/getChainFromVerifiedCredentialChain/getChainFromVerifiedCredentialChain.d.ts.map +1 -1
- package/dist/utils/getNonce/getNonce.d.ts +1 -1
- package/dist/utils/observable/subscribeWithSelector/subscribeWithSelector.d.ts +1 -1
- package/dist/waas.cjs +7 -7
- package/dist/waas.cjs.map +1 -1
- package/dist/waas.esm.js +6 -6
- package/dist/waas.esm.js.map +1 -1
- package/dist/waas.native.esm.js +6 -6
- package/dist/waas.native.esm.js.map +1 -1
- package/dist/waasCore.cjs +26 -26
- package/dist/waasCore.cjs.map +1 -1
- package/dist/waasCore.esm.js +25 -25
- package/dist/waasCore.esm.js.map +1 -1
- package/dist/waasCore.native.esm.js +25 -25
- package/dist/waasCore.native.esm.js.map +1 -1
- package/package.json +4 -44
- package/android/build.gradle +0 -71
- package/android/src/main/java/xyz/dynamic/client/DynamicClientPackage.kt +0 -42
- package/android/src/main/java/xyz/dynamic/client/keychain/KeyStoreKeyManager.kt +0 -147
- package/android/src/main/java/xyz/dynamic/client/keychain/KeychainModule.kt +0 -85
- package/android/src/main/java/xyz/dynamic/client/manifest/ReactNativeManifestModule.kt +0 -25
- package/dist/InvalidParamError-DFpM4bIX.cjs.map +0 -1
- package/dist/InvalidParamError-F90z0K5r.native.esm.js.map +0 -1
- package/dist/InvalidParamError-WXK434H2.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-BV9lOcuP.cjs.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-BVurb9VE.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-DbR2qejA.native.esm.js.map +0 -1
- package/dist/getSignedSessionId-CNkcX15D.cjs.map +0 -1
- package/dist/getSignedSessionId-DFiqF8_b.esm.js.map +0 -1
- package/dist/getSignedSessionId-DXtxIjxF.native.esm.js.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-4eVkx2ZN.cjs.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-6di80gqF.esm.js.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-CHIZTYim.native.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-DKSH9YEU.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-ZwjmqVg-.cjs.map +0 -1
- package/dist/isMfaRequiredForAction-cJ294BGH.native.esm.js.map +0 -1
- package/dynamic-labs-sdk-client.podspec +0 -27
- package/ios/Keychain.h +0 -4
- package/ios/Keychain.mm +0 -101
- package/ios/ReactNativeManifest.h +0 -4
- package/ios/ReactNativeManifest.mm +0 -45
- package/ios/ReactNativeManifestImpl.swift +0 -20
- package/ios/SecureEnclaveKeyManager.swift +0 -180
- package/react-native.config.cjs +0 -14
- package/src/turboModules/NativeKeychain.native.spec.ts +0 -45
- package/src/turboModules/NativeKeychain.ts +0 -21
- package/src/turboModules/NativeReactNativeManifest.native.spec.ts +0 -55
- package/src/turboModules/NativeReactNativeManifest.ts +0 -29
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNetworkProviderFromNetworkId-Dz1Wd9-n.native.esm.js","names":["item: StorageFormat<typeof value>","walletProvidersMap: Map<string, WalletProvider>","BufferPolyfill","resolve: (value: T) => void","reject: (reason?: unknown) => void","LOG_LEVELS: Record<LogLevel, number>","eventEmitter: LoggerEventEmitter","EventEmitter","minLevel: LogLevel","createKeychainService: CreateKeychainService","NativeKeychain","ABLY_STATE_TO_REALTIME_STATE: Record<string, RealtimeConnectionState>","ablyClient: BaseRealtime | undefined","connectionState: RealtimeConnectionState","connect: RealtimeService['connect']","disconnect: RealtimeService['disconnect']","subscribe: RealtimeService['subscribe']","handler: messageCallback<InboundMessage>","unsubscribe: RealtimeService['unsubscribe']","publish: RealtimeService['publish']","connectRequest: ConnectRequest","filteredUnverifiedWalletAccounts: UnverifiedWalletAccount[]","suffixFields: string[]","networkProvider"],"sources":["../src/utils/isEqualShallow/isEqualShallow.ts","../src/utils/observable/subscribeWithSelector/subscribeWithSelector.ts","../src/utils/retryOnFail/InvalidRetryOnFailCallError.ts","../src/utils/retryOnFail/retryOnFail.ts","../src/modules/auth/isSignedIn/isSignedIn.ts","../src/services/storage/createLocalStorageAdapter/createLocalStorageAdapter.native.ts","../src/errors/InvalidStorageSet.ts","../src/services/storage/createStorage/formatForStorage/isValidDateISOString/isValidDateISOString.ts","../src/services/storage/createStorage/formatForStorage/storageFormat.ts","../src/services/storage/createStorage/createStorage.ts","../src/services/storage/createStorageKeySchema/createStorageKeySchema.ts","../src/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.ts","../src/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.ts","../src/modules/sessionKeys/generateSessionKeys/generateSessionKeys.ts","../src/modules/wallets/utils/getAvailableWalletProvidersFromWalletAccounts/getAvailableWalletProvidersFromWalletAccounts.ts","../src/modules/wallets/disconnectAndTerminateWalletProviders/disconnectAndTerminateWalletProviders.ts","../src/modules/auth/logoutWithReason/logoutWithReason.ts","../src/utils/getBuffer/getBuffer.ts","../src/utils/isServerSideRendering/isServerSideRendering.ts","../src/modules/initializeClient/consts.ts","../src/utils/deferredPromise/createDeferredPromise.ts","../src/errors/CannotTrackError.ts","../src/services/crossTabBroadcast/crossTabBroadcast.schema.ts","../src/services/crossTabBroadcast/createCrossTabBroadcast/createCrossTabBroadcast.ts","../src/services/logger/createLogger/createLogger.ts","../src/errors/NativeModuleNotLinkedError.ts","../src/turboModules/NativeKeychain.ts","../src/utils/base64urlFromBytes/base64urlFromBytes.ts","../src/utils/bufferToHex/bufferToHex.ts","../src/utils/bytesFromBase64url/bytesFromBase64url.ts","../src/utils/compressRawPublicKey/compressRawPublicKey.ts","../src/utils/derToP1363/InvalidDERSignatureError.ts","../src/utils/derToP1363/derToP1363.ts","../src/services/keychain/createKeychainService/ImportKeyNotSupportedError.ts","../src/services/keychain/createKeychainService/KeyNotFoundError.ts","../src/services/keychain/createKeychainService/createKeychainService.native.ts","../src/errors/InvalidRealtimePublishError.ts","../src/errors/RealtimeNotConnectedError.ts","../src/services/realtime/createRealtimeService/createRealtimeService.ts","../src/utils/getKeychainIndexedDBName/getKeychainIndexedDBName.ts","../src/errors/NoNetworkProvidersError.ts","../src/errors/WalletAlreadyLinkedToAnotherUserError.ts","../src/errors/MethodNotImplementedError.ts","../src/modules/captcha/isCaptchaRequired/isCaptchaRequired.ts","../src/modules/captcha/setCaptchaToken/setCaptchaToken.ts","../src/services/realtime/createRealtimeChannelSchema/createRealtimeChannelSchema.ts","../src/modules/extension/hasExtension/hasExtension.ts","../src/modules/captcha/consumeCaptchaToken/consumeCaptchaToken.ts","../src/modules/auth/createVisit/createVisit.ts","../src/modules/wallets/unverifiedWalletAccounts/setUnverifiedWalletAccounts/setUnverifiedWalletAccounts.ts","../src/modules/wallets/utils/formatSignInMessage/formatSignInMessage.ts","../src/modules/wallets/utils/getSignInMessage/createSignInMessageStatement/createSignInMessageStatement.ts","../src/modules/wallets/unverifiedWalletAccounts/removeUnverifiedWalletAccount/removeUnverifiedWalletAccount.ts","../src/utils/isError/isError.ts","../src/utils/isErrorWithCode/isErrorWithCode.ts","../src/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.ts","../src/modules/wallets/walletProvider/walletProviderKeyMap/updateWalletProviderKeysForVerifiedCredentials/updateWalletProviderKeysForVerifiedCredentials.ts","../src/modules/wallets/networks/getSdkChainFromApiChainName/getSdkChainFromApiChainName.ts","../src/modules/wallets/networks/getNetworksData/getNetworksData.ts","../src/modules/wallets/networks/networkProviderBuilderRegistry/createNetworkProviderBuilderRegistry/createNetworkProviderBuilderRegistry.ts","../src/modules/wallets/networks/networkProviderBuilderRegistry/getNetworkProviderBuilderRegistry/getNetworkProviderBuilderRegistry.ts","../src/modules/wallets/networks/getNetworkProviders/getNetworkProviders.ts","../src/modules/wallets/networks/getNetworkProviderFromNetworkId/getNetworkProviderFromNetworkId.ts"],"sourcesContent":["/**\n * Shallow compare two objects.\n *\n * Source: https://github.com/pmndrs/zustand/blob/main/src/vanilla/shallow.ts\n * @not-instrumented\n */\n// eslint-disable-next-line custom-rules/require-single-object-param\nexport const isEqualShallow = <T>(objA: T, objB: T) => {\n if (Object.is(objA, objB)) return true;\n\n if (\n typeof objA !== 'object' ||\n objA === null ||\n typeof objB !== 'object' ||\n objB === null\n ) {\n return objA === objB;\n }\n\n if (objA instanceof Map && objB instanceof Map) {\n if (objA.size !== objB.size) return false;\n\n for (const [key, value] of objA) {\n if (!Object.is(value, objB.get(key))) return false;\n }\n\n return true;\n }\n\n if (objA instanceof Set && objB instanceof Set) {\n if (objA.size !== objB.size) return false;\n\n for (const value of objA) {\n if (!objB.has(value)) return false;\n }\n return true;\n }\n\n const keysA = Object.keys(objA);\n\n if (keysA.length !== Object.keys(objB).length) return false;\n\n for (const keyA of keysA) {\n if (\n !Object.prototype.hasOwnProperty.call(objB, keyA as string) ||\n !Object.is(objA[keyA as keyof T], objB[keyA as keyof T])\n ) {\n return false;\n }\n }\n\n if (objA.constructor !== objB.constructor) return false;\n\n return true;\n};\n","import { isEqualShallow } from '../../isEqualShallow';\nimport type { ObservableState } from '../observable.types';\n\n/**\n * Allows subscribing to a slice of the state.\n * The slice is a computation of the states.\n *\n * The callback will only be called when the slice has changed.\n * Change is determined by shallow comparison.\n *\n * Returns a function to unsubscribe the callback.\n * @not-instrumented\n */\nexport const subscribeWithSelector =\n // eslint-disable-next-line custom-rules/require-single-object-param\n <T extends Record<string, unknown>, Slice>(\n observable: ObservableState<T>,\n selector: (value: T) => Slice\n ) =>\n // eslint-disable-next-line custom-rules/require-single-object-param\n (callback: (slice: Slice) => void) => {\n let lastSlice = selector(observable.get());\n\n return observable.subscribe((value) => {\n const nextSlice = selector(value);\n\n if (isEqualShallow(nextSlice, lastSlice)) return;\n\n lastSlice = nextSlice;\n\n callback(nextSlice);\n });\n };\n","import { BaseError } from '../../errors/base';\n\n/**\n * This error is thrown when the `retryOnFail` function is called with an invalid\n * number of retries (i.e. less than 0).\n */\nexport class InvalidRetryOnFailCallError extends BaseError {\n // eslint-disable-next-line custom-rules/require-single-object-param\n constructor(maxRetries: number) {\n super({\n cause: null,\n code: 'invalid_retry_on_fail_call_error',\n docsUrl: null,\n name: 'InvalidRetryOnFailCallError',\n shortMessage: `Invalid retries parameter for retryOnFail call: ${maxRetries}`,\n });\n }\n}\n","import { InvalidRetryOnFailCallError } from './InvalidRetryOnFailCallError';\n\nexport type RetryOnFailParams<T> = {\n /**\n * The delay between retries in milliseconds.\n */\n delay?: number;\n /**\n * The function to call.\n */\n fn: () => Promise<T>;\n /**\n * The maximum number of retries.\n *\n * When set to 0, the function will be called only once and is\n * therefore equivalent to calling the function directly.\n */\n maxRetries: number;\n};\n\n/** @not-instrumented */\nexport const retryOnFail = async <T>({\n delay = 0,\n fn,\n maxRetries,\n}: RetryOnFailParams<T>) => {\n for (let retry = 0; retry <= maxRetries; retry++) {\n try {\n return await fn();\n } catch (error) {\n if (retry >= maxRetries) {\n throw error;\n }\n\n if (delay > 0) {\n await new Promise((resolve) => setTimeout(resolve, delay));\n }\n }\n }\n\n /**\n * Reaching this point should never happen and this\n * error is thrown to help us debug the issue.\n */\n throw new InvalidRetryOnFailCallError(maxRetries);\n};\n","import { getDefaultClient } from '../../../client/defaultClient';\nimport { getWalletAccounts } from '../../wallets/getWalletAccounts';\n\n/**\n * Checks if the user is currently signed in to the Dynamic client.\n *\n * The client is considered to be in a signed in state if a user has\n * authenticated or if the client has at least one wallet connected.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if the user is signed in, false otherwise.\n * @not-instrumented\n */\nexport const isSignedIn = (client = getDefaultClient()) =>\n Boolean(client.user || getWalletAccounts(client).length > 0);\n","// eslint-disable-next-line import/no-extraneous-dependencies\nimport AsyncStorage from '@react-native-async-storage/async-storage';\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport {\n getGenericPassword,\n resetGenericPassword,\n setGenericPassword,\n} from 'react-native-keychain';\n\nimport type { StorageAdapter } from '../storage.types';\n\nconst NAMESPACE = 'dynamic';\n\nconst namespaceKey = (key: string): string => `${NAMESPACE}:${key}`;\n\n/**\n * Creates a localStorage adapter for React Native.\n * Routes operations based on the `storageTier` option:\n * - `'default'`: uses AsyncStorage\n * - `'secure'`: uses react-native-keychain\n * @not-instrumented\n */\nexport const createLocalStorageAdapter = (): StorageAdapter => {\n return {\n getItem: async (key, options) => {\n if (options.storageTier === 'secure') {\n const result = await getGenericPassword({ service: key });\n\n if (!result) {\n return null;\n }\n\n return result.password;\n } else {\n return AsyncStorage.getItem(namespaceKey(key));\n }\n },\n removeItem: async (key, options) => {\n if (options.storageTier === 'secure') {\n await resetGenericPassword({ service: key });\n } else {\n await AsyncStorage.removeItem(namespaceKey(key));\n }\n },\n setItem: async (key, value, options) => {\n if (options.storageTier === 'secure') {\n await setGenericPassword(key, value, { service: key });\n } else {\n await AsyncStorage.setItem(namespaceKey(key), value);\n }\n },\n };\n};\n","import { BaseError } from './base';\n\ntype InvalidStorageSetParams = {\n key: string;\n value: string;\n};\n\nexport class InvalidStorageSet extends BaseError {\n constructor({ key, value }: InvalidStorageSetParams) {\n super({\n cause: null,\n code: 'invalid_storage_set',\n docsUrl: null,\n metaMessages: [`key: ${key}`, value],\n name: 'InvalidStorageSet',\n shortMessage: 'Tried to store a value that does not match the schema',\n });\n }\n}\n","/**\n * Returns whether the given string is a valid ISO date string.\n *\n * Does not support timezone offsets.\n * @not-instrumented\n */\n// eslint-disable-next-line custom-rules/require-single-object-param\nexport const isValidDateISOString = (value: string): boolean => {\n const date = new Date(value);\n\n return !isNaN(date.getTime()) && date.toISOString() === value;\n};\n","/* eslint-disable custom-rules/function-name-matches-filename */\nimport type { StorageFormat } from '../../storage.types';\nimport { isValidDateISOString } from './isValidDateISOString';\n\nconst DATE_PREFIX = '__DATE__';\n\n/** @not-instrumented */\nexport const formatForStorage = (value: unknown) => {\n const item: StorageFormat<typeof value> = { value };\n\n return JSON.stringify(item, (_, entry) => {\n // You might think that entry here would be a Date and one could simply do \"entry instanceof Date\",\n // but actually it will be a string already (no idea why JSON.stringify does this)\n if (isValidDateISOString(entry)) {\n return `${DATE_PREFIX}${entry}`;\n }\n\n return entry;\n });\n};\n\n/** @not-instrumented */\n// eslint-disable-next-line custom-rules/one-function-per-file, custom-rules/require-single-object-param\nexport const parseFromStorage = <T>(value: string): StorageFormat<T> | null => {\n try {\n const parsed = JSON.parse(value, (_, entry) => {\n if (typeof entry === 'string' && entry.startsWith(DATE_PREFIX)) {\n return new Date(entry.slice(DATE_PREFIX.length));\n }\n\n return entry;\n }) as StorageFormat<T>;\n\n return parsed;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error) {\n return null;\n }\n};\n","import type { Storage, StorageAdapter, StorageAdapterOptions, StorageTier } from '../storage.types';\nimport { InvalidStorageSet } from './../../../errors/InvalidStorageSet';\nimport { formatForStorage } from './formatForStorage';\nimport { parseFromStorage } from './formatForStorage/storageFormat';\n\ntype CreateWebStorageParams = {\n prefix?: string;\n storageAdapter: StorageAdapter;\n};\n\n/**\n * Creates a Storage service to interact with storage adapter.\n * Reads the `storageTier` from each key's config and passes it\n * to the adapter on every operation, defaulting to `'default'`.\n * @not-instrumented\n */\nexport const createStorage = ({\n prefix = '',\n storageAdapter,\n}: CreateWebStorageParams): Storage => {\n const getPrefixedKey = (key: string) => (prefix ? `${prefix}_${key}` : key);\n\n const getAdapterOptions = (storageTier?: StorageTier): StorageAdapterOptions => ({\n storageTier: storageTier ?? 'default',\n });\n\n return {\n getItem: async (storageKeySchema) => {\n const prefixedKey = getPrefixedKey(storageKeySchema.key);\n const options = getAdapterOptions(storageKeySchema.config?.storageTier);\n\n const rawItem = await storageAdapter.getItem(prefixedKey, options);\n\n const parsedItem = rawItem ? parseFromStorage(rawItem) : null;\n\n /**\n * The item saved to localStorage may be malformed.\n * In this case, we remove it and return null.\n */\n if (parsedItem !== null) {\n const parsed = storageKeySchema.schema.safeParse(parsedItem.value);\n\n if (parsed.success) {\n return parsed.data;\n }\n }\n\n /**\n * The item saved to localStorage may be malformed.\n * In this case, we remove it and return null.\n */\n\n await storageAdapter.removeItem(prefixedKey, options);\n\n return null;\n },\n\n removeItem: async (storageKeySchema) => {\n await storageAdapter.removeItem(\n getPrefixedKey(storageKeySchema.key),\n getAdapterOptions(storageKeySchema.config?.storageTier),\n );\n },\n\n setItem: async (storageKeySchema, value) => {\n const parsed = storageKeySchema.schema.safeParse(value);\n\n if (!parsed.success) {\n throw new InvalidStorageSet({\n key: storageKeySchema.key,\n value: JSON.stringify(value),\n });\n }\n\n const item = formatForStorage(parsed.data);\n\n await storageAdapter.setItem(\n getPrefixedKey(storageKeySchema.key),\n item,\n getAdapterOptions(storageKeySchema.config?.storageTier),\n );\n },\n };\n};\n","import type * as z from 'zod/mini';\n\nimport type { StorageKeySchema, StorageKeySchemaConfig } from '../storage.types';\n\n/** @not-instrumented */\nexport const createStorageKeySchema = <T>(params: {\n config?: StorageKeySchemaConfig;\n key: string;\n schema: z.ZodMiniType<T>;\n}): StorageKeySchema<T> => {\n return params;\n};\n","import * as z from 'zod/mini';\n\nimport { createStorageKeySchema } from '../../../services/storage';\n\n/**\n * The schema to track the expiration time of the project settings.\n */\nexport const projectSettingsExpirationStorageKeySchema = createStorageKeySchema(\n {\n key: 'projectSettingsExpiration',\n schema: z.number(),\n }\n);\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { retryOnFail } from '../../../utils/retryOnFail';\nimport { createApiClient } from '../../apiClient';\nimport { CLIENT_SDK_NAME } from '../../apiClient/constants';\nimport { isSignedIn } from '../../auth/isSignedIn';\nimport { projectSettingsExpirationStorageKeySchema } from './projectSettingsExpirationScheme';\n\n/**\n * Expiration time of the project settings in milliseconds.\n */\nexport const PROJECT_SETTINGS_EXPIRATION_TIME = 1000 * 60 * 5; // 5 minutes\n\n/**\n * Fetches and updates the project settings from the API.\n *\n * This function retrieves the latest project configuration settings\n * from Dynamic's servers, including authentication options, enabled chains,\n * and security configurations. The settings are cached for performance.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the updated project settings.\n * @not-instrumented\n */\nexport const fetchProjectSettings = async (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const currentExpiration = await core.storage.getItem(\n projectSettingsExpirationStorageKeySchema\n );\n\n const hasProjectSettings = Boolean(client.projectSettings);\n const isExpired = currentExpiration && currentExpiration < Date.now();\n\n // We want to cache the project settings if its valid and user is connected.\n // This avoids unnecessary API calls and speeds up the initial load.\n if (hasProjectSettings && !isExpired && isSignedIn(client)) {\n return client.projectSettings;\n }\n\n const apiClient = createApiClient({}, client);\n\n core.logger.debug('[fetchProjectSettings] Fetching project settings...');\n\n const doFetch = async () =>\n apiClient.getEnvironmentSettings(\n {\n environmentId: core.environmentId,\n sdkVersion: `${CLIENT_SDK_NAME}/${core.version}`,\n },\n {\n credentials: 'omit',\n }\n );\n\n const projectSettings = await retryOnFail({\n fn: doFetch,\n maxRetries: 2,\n });\n\n core.state.set({ projectSettings: projectSettings ?? null });\n\n await core.storage.setItem(\n projectSettingsExpirationStorageKeySchema,\n Date.now() + PROJECT_SETTINGS_EXPIRATION_TIME\n );\n\n return projectSettings;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport type { SessionKeys } from '../sessionKeys.types';\n\n/** @not-instrumented */\nexport const generateSessionKeys = async (\n client: DynamicClient\n): Promise<SessionKeys> => {\n const core = getCore(client);\n\n await core.keychain.removeKey('session');\n\n const publicKey = await core.keychain.generateKey('session');\n\n assertDefined(publicKey, 'Public key not found');\n\n core.state.set({\n sessionKeys: publicKey,\n });\n\n return { publicKey };\n};\n","import { getCore } from '../../../../client/core/getCore';\nimport type { DynamicClient } from '../../../../client/types';\nimport { getWalletAccounts } from '../../getWalletAccounts';\nimport type { WalletProvider } from '../../walletProvider';\nimport { getWalletProviderFromWalletAccount } from '../getWalletProviderFromWalletAccount';\n\n/** @not-instrumented */\nexport const getAvailableWalletProvidersFromWalletAccounts = (\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n const walletProvidersMap: Map<string, WalletProvider> = new Map();\n\n const walletAccounts = getWalletAccounts(client);\n\n walletAccounts.forEach((walletAccount) => {\n if (walletProvidersMap.has(walletAccount.walletProviderKey)) {\n return;\n }\n\n try {\n const walletProvider = getWalletProviderFromWalletAccount(\n {\n walletAccount,\n },\n client\n );\n\n walletProvidersMap.set(walletAccount.walletProviderKey, walletProvider);\n } catch (error) {\n core.logger.debug('Wallet provider not found for wallet account', {\n error,\n walletAccount: walletAccount.address,\n });\n }\n });\n\n return Array.from(walletProvidersMap.values());\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types/DynamicClient';\nimport type { LogoutReason } from '../../auth/logoutReason';\nimport { getAvailableWalletProvidersFromWalletAccounts } from '../utils/getAvailableWalletProvidersFromWalletAccounts';\n\n/**\n * Disconnect and terminate each wallet provider, if available.\n * @not-instrumented\n */\nexport const disconnectAndTerminateWalletProviders = async (\n { reason }: { reason?: LogoutReason },\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n const walletProviders = getAvailableWalletProvidersFromWalletAccounts(client);\n\n await Promise.all(\n walletProviders.map(async (walletProvider) => {\n if (walletProvider.terminate) {\n await walletProvider.terminate({ reason });\n }\n\n if (walletProvider.disconnect) {\n try {\n await walletProvider.disconnect();\n } catch (err) {\n core.logger.error(\n `Error disconnecting from wallet ${walletProvider.key}`,\n err\n );\n }\n }\n })\n );\n};\n","import type { DynamicClient } from '../../../client/types';\nimport { getCore } from '../../../client/core/getCore';\nimport { setCookie } from '../../../utils/setCookie';\nimport { createApiClient } from '../../apiClient';\nimport { emitEvent } from '../../clientEvents';\nimport { fetchProjectSettings } from '../../projectSettings/fetchProjectSettings';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport { generateSessionKeys } from '../../sessionKeys/generateSessionKeys';\nimport { disconnectAndTerminateWalletProviders } from '../../wallets/disconnectAndTerminateWalletProviders';\nimport { DYNAMIC_AUTH_COOKIE_NAME } from '../consts';\nimport type { LogoutReason } from '../logoutReason';\n\n/**\n * Logs the user out with an explicit reason.\n *\n * Revokes the session, clears auth state, terminates wallet providers, and\n * emits the `logout` client event with the given reason. The reason is also\n * captured as an argument on the function-instrumentation event, which is\n * how Datadog distinguishes between different logout causes.\n *\n * Use this instead of the public `logout` when triggering a logout from\n * internal or extension code — the caller owns the reason string, so the\n * telemetry correctly attributes *why* the logout happened.\n *\n * @param params - The logout params.\n * @param params.reason - Why the logout is being triggered. Extension authors\n * needing a reason outside the SDK catalog can cast with `as LogoutReason`.\n * @param client - The Dynamic client instance.\n * @instrumented\n */\nexport const logoutWithReason = async (\n { reason }: { reason: LogoutReason },\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n core.logger.debug('[logoutWithReason] Logging out...', { reason });\n\n await disconnectAndTerminateWalletProviders({ reason }, client);\n\n if (client.user !== null) {\n const apiClient = createApiClient({}, client);\n\n try {\n await apiClient.revokeSession({\n environmentId: core.environmentId,\n });\n } catch (error) {\n core.logger.error('Failed to revoke session', error);\n }\n\n /**\n * This deletes the auth cookie if it exists.\n * If the cookie doesn't exist, this sets a new cookie that expires immediately.\n */\n if (isCookieEnabled(client)) {\n setCookie(\n `${DYNAMIC_AUTH_COOKIE_NAME}=; Max-Age=-99999999; path=/; SameSite=Lax`\n );\n }\n }\n\n await core.keychain.removeKey('session');\n\n core.state.set({\n captchaToken: null,\n elevatedAccessTokens: [],\n legacyToken: null,\n mfaToken: null,\n sessionExpiresAt: null,\n sessionKeys: null,\n token: null,\n unverifiedWalletAccounts: [],\n user: null,\n });\n\n emitEvent({ args: { reason }, event: 'logout' }, client);\n\n // Refetch project settings\n void fetchProjectSettings(client);\n\n // Regenerate session keys\n void generateSessionKeys(client);\n};\n","/* eslint-disable no-restricted-globals */\nimport { Buffer as BufferPolyfill } from 'buffer';\n\n/** @not-instrumented */\nexport const getBuffer = () =>\n typeof Buffer !== 'undefined' ? Buffer : BufferPolyfill;\n","/**\n * Indicates if the code is running in a server-side environment.\n * @not-instrumented\n */\n// eslint-disable-next-line no-restricted-globals\nexport const isServerSideRendering = () => typeof window === 'undefined';\n","export const REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY =\n 'refresh-user-state-from-cookie';\n\nexport const INITIALIZE_STORAGE_SYNC_TRACKER_KEY = 'initialize-storage-sync';\n\nexport const FETCH_PROJECT_SETTINGS_TRACKER_KEY = 'fetch-project-settings';\n\nexport const GENERATE_SESSION_KEYS_TRACKER_KEY = 'generate-session-keys';\n\nexport const REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY =\n 'refresh-user-state-from-valid-token';\n","import type { DeferredPromise } from './deferredPromise.types';\n\n/** @not-instrumented */\nexport const createDeferredPromise = <T>(): DeferredPromise<T> => {\n let resolve: (value: T) => void;\n let reject: (reason?: unknown) => void;\n\n const promise = new Promise<T>((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n\n return {\n promise,\n reject: (reason?: unknown) => reject?.(reason),\n resolve: (value: T) => resolve?.(value),\n };\n};\n","import { BaseError } from './base';\n\nexport class CannotTrackError extends BaseError {\n constructor() {\n super({\n cause: null,\n code: 'cannot_track_error',\n docsUrl: null,\n name: 'CannotTrackError',\n shortMessage: 'All track calls must be performed in the same node tick',\n });\n }\n}\n","import * as z from 'zod/mini';\n\n/**\n * Schema for validating cross-tab broadcast messages.\n */\nexport const CrossTabBroadcastMessageSchema = z.object({\n args: z.optional(z.unknown()),\n event: z.string(),\n});\n","import EventEmitter from 'eventemitter3';\n\nimport { isServerSideRendering } from '../../../utils/isServerSideRendering';\nimport { CrossTabBroadcastMessageSchema } from '../crossTabBroadcast.schema';\nimport type { CrossTabBroadcast } from '../crossTabBroadcast.types';\n\ntype CreateCrossTabBroadcastParams = {\n channelName: string;\n};\n\n/**\n * Creates a cross-tab broadcast service instance using the BroadcastChannel API.\n *\n * Enables communication between multiple tabs/windows of the same application.\n * Messages are validated against the schema and invalid messages are silently ignored.\n *\n * In SSR or when BroadcastChannel is unavailable, returns a no-op implementation.\n *\n * @param params - Configuration parameters\n * @param params.channelName - The name of the broadcast channel to use\n * @returns A cross-tab broadcast service instance\n * @not-instrumented\n */\nexport const createCrossTabBroadcast = ({\n channelName,\n}: CreateCrossTabBroadcastParams): CrossTabBroadcast => {\n // SSR check - return no-op implementation\n // eslint-disable-next-line no-restricted-globals\n if (isServerSideRendering() || typeof BroadcastChannel === 'undefined') {\n return {\n off: () => {},\n on: () => {},\n send: () => {},\n };\n }\n\n // eslint-disable-next-line no-restricted-globals\n const channel = new BroadcastChannel(channelName);\n const eventEmitter = new EventEmitter();\n\n // Message handler with validation\n const handleMessage = (messageEvent: MessageEvent) => {\n const parsed = CrossTabBroadcastMessageSchema.safeParse(messageEvent.data);\n\n if (!parsed.success) {\n // Silently ignore invalid messages (consistent with storage patterns)\n return;\n }\n\n const { args, event } = parsed.data;\n eventEmitter.emit(event, args);\n };\n\n channel.addEventListener('message', handleMessage);\n\n return {\n off: (event, callback) => {\n eventEmitter.off(event, callback);\n },\n\n on: (event, callback) => {\n eventEmitter.on(event, callback);\n },\n\n send: ({ args, event }) => {\n channel.postMessage({ args, event });\n },\n };\n};\n","import { EventEmitter } from 'eventemitter3';\n\nimport type { LogLevel, Logger, LoggerEventEmitter } from '../logger.types';\n\n/**\n * Configuration options for the logger\n * @not-instrumented\n */\ntype CreateLoggerOptions = {\n level?: LogLevel;\n};\n\n/**\n * Log levels and their corresponding numeric values\n */\nconst LOG_LEVELS: Record<LogLevel, number> = {\n debug: 0,\n error: 3,\n info: 1,\n warn: 2,\n};\n\n// Assign to avoid lint errors\nconst defaultConsole = console;\n\n/**\n * Creates a logger instance with configurable log level and event emission capabilities.\n * @returns A logger instance with debug, info, warn, and error methods\n * @not-instrumented\n */\nexport const createLogger = (options: CreateLoggerOptions = {}): Logger => {\n const eventEmitter: LoggerEventEmitter = new EventEmitter();\n\n // Default to 'debug' if no level is provided\n const minLevel: LogLevel = options.level ?? 'warn';\n\n // Helper to decide if we should log based on current log level\n // eslint-disable-next-line custom-rules/require-single-object-param\n const shouldLog = (level: LogLevel): boolean => {\n return LOG_LEVELS[level] >= LOG_LEVELS[minLevel];\n };\n\n // Helper to format the log message\n // eslint-disable-next-line custom-rules/require-single-object-param\n const formatMessage = (level: LogLevel, message: string): string => {\n const timestamp = new Date().toISOString();\n\n return `[${timestamp}] ${level.toUpperCase()}: ${message}`;\n };\n\n // Unified logger function that checks the level and calls the appropriate console method\n // eslint-disable-next-line custom-rules/require-single-object-param\n const log = (\n level: LogLevel,\n consoleMethod: (...data: unknown[]) => void,\n message: string,\n ...args: unknown[]\n ) => {\n eventEmitter.emit('log', level, message, ...args);\n\n if (!shouldLog(level)) return;\n\n consoleMethod(formatMessage(level, message), ...args);\n };\n\n return {\n debug: (message, ...args) =>\n log('debug', defaultConsole.debug, message, ...args),\n\n error: (message, ...args) =>\n log('error', defaultConsole.error, message, ...args),\n\n info: (message, ...args) =>\n log('info', defaultConsole.info, message, ...args),\n\n off: eventEmitter.off.bind(eventEmitter),\n\n on: eventEmitter.on.bind(eventEmitter),\n warn: (message, ...args) =>\n log('warn', defaultConsole.warn, message, ...args),\n };\n};\n","import { BaseError } from './base';\n\ntype NativeModuleNotLinkedErrorParams = {\n moduleName: string;\n};\n\nexport class NativeModuleNotLinkedError extends BaseError {\n constructor({ moduleName }: NativeModuleNotLinkedErrorParams) {\n super({\n cause: null,\n code: 'native_module_not_linked_error',\n details: [\n `The \"${moduleName}\" TurboModule is not registered with React Native.`,\n 'This usually means the native module was not autolinked into the host app,',\n 'or the app binary was not rebuilt after installing the SDK.',\n '',\n 'To resolve:',\n ' 1. Ensure \"@dynamic-labs-sdk/client\" is a direct dependency of the app',\n ' and reinstall (e.g. `pnpm install`).',\n ' 2. Rebuild the native app:',\n ' iOS: `cd ios && pod install && cd .. && npx react-native run-ios`',\n ' Android: `npx react-native run-android`',\n ' Expo: `npx expo prebuild --clean` then run the app.',\n ' 3. Confirm autolinking sees the package:',\n ' `npx expo-modules-autolinking react-native-config --json`',\n ].join('\\n'),\n docsUrl: null,\n name: 'NativeModuleNotLinkedError',\n shortMessage: `Native TurboModule \"${moduleName}\" is not linked.`,\n });\n }\n}\n","// This file is a TurboModule spec consumed by React Native codegen.\n// The `interface`, `default export`, and `react-native` import are hard\n// requirements of the codegen parser and intentionally deviate from the\n// project's conventions. Codegen discovers specs by the `Native*` filename\n// prefix, so this file cannot be renamed to `.native.ts`.\n\n \n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { type TurboModule, TurboModuleRegistry } from 'react-native';\n\n\nexport interface Spec extends TurboModule {\n deleteKey(key: string): Promise<void>;\n generateKeyPair(key: string): Promise<{ publicKey: string }>;\n getPublicKey(key: string): Promise<{ publicKey: string } | null>;\n hasKey(key: string): Promise<boolean>;\n isAvailable(): Promise<boolean>;\n sign(key: string, payload: string): Promise<{ signature: string }>;\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default TurboModuleRegistry.getEnforcing<Spec>('Keychain');\n","/**\n * Encodes a Uint8Array to a base64url string (RFC 4648 S5, no padding).\n * Used to encode binary data before sending to native modules over the bridge.\n *\n * @not-instrumented\n */\nexport const base64urlFromBytes = (bytes: Uint8Array): string =>\n btoa(String.fromCodePoint(...bytes))\n .replaceAll('+', '-')\n .replaceAll('/', '_')\n .replaceAll('=', '');\n","/**\n * Converts an ArrayBuffer or Uint8Array to a hex-encoded string\n * @not-instrumented\n */\nexport const bufferToHex = (buffer: ArrayBufferLike | Uint8Array) =>\n [...(buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer))]\n .map((x) => x.toString(16).padStart(2, '0'))\n .join('');\n","/**\n * Decodes a base64url-encoded string (RFC 4648 S5, no padding) to a Uint8Array.\n * Used to decode binary data received from native modules over the bridge.\n *\n * @not-instrumented\n */\n// eslint-disable-next-line custom-rules/require-single-object-param\nexport const bytesFromBase64url = (s: string): Uint8Array => {\n const base64 = s.replaceAll('-', '+').replaceAll('_', '/');\n return Uint8Array.from(atob(base64), (c) => c.codePointAt(0) ?? 0);\n};\n","/**\n * Accepts a public key array buffer, and returns a buffer with the compressed version of the public key\n * @not-instrumented\n */\nexport const compressRawPublicKey = (rawPublicKey: ArrayBuffer) => {\n const rawPublicKeyBytes = new Uint8Array(rawPublicKey);\n const len = rawPublicKeyBytes.byteLength;\n\n // Drop the y coordinate\n const compressedBytes = rawPublicKeyBytes.slice(0, (1 + len) >>> 1);\n\n // Encode the parity of `y` in first bit\n compressedBytes[0] = 0x2 | (rawPublicKeyBytes[len - 1] & 0x01);\n return compressedBytes.buffer;\n};\n","import { BaseError } from '../../errors/base';\n\nexport class InvalidDERSignatureError extends BaseError {\n // eslint-disable-next-line custom-rules/require-single-object-param\n constructor(message: string) {\n super({\n cause: null,\n code: 'invalid_der_signature_error',\n docsUrl: null,\n name: 'InvalidDERSignatureError',\n shortMessage: message,\n });\n }\n}\n","import { InvalidDERSignatureError } from './InvalidDERSignatureError';\n\n/**\n * Converts a DER/X9.62 encoded ECDSA signature to IEEE P1363 format (r || s).\n * Native secure enclaves produce DER-encoded signatures; the server expects P1363.\n *\n * @not-instrumented\n */\nexport const derToP1363 = (der: Uint8Array): Uint8Array => {\n // DER structure: 30 <len> 02 <r_len> <r_bytes> 02 <s_len> <s_bytes>\n if (der.length < 8 || der[0] !== 0x30) {\n throw new InvalidDERSignatureError('Invalid DER signature format');\n }\n\n // skip 30 <len>\n let offset = 2;\n\n // Parse r\n if (offset >= der.length || der[offset] !== 0x02) {\n throw new InvalidDERSignatureError(\n 'Invalid DER signature: missing r INTEGER tag'\n );\n }\n\n // skip 02 tag\n offset += 1;\n\n if (offset >= der.length) {\n throw new InvalidDERSignatureError(\n 'Invalid DER signature: missing r length'\n );\n }\n const rLen = der[offset];\n offset += 1;\n\n if (offset + rLen > der.length) {\n throw new InvalidDERSignatureError(\n 'Invalid DER signature: r bytes out of bounds'\n );\n }\n let rBytes = der.slice(offset, offset + rLen);\n offset += rLen;\n\n // Parse s\n if (offset >= der.length || der[offset] !== 0x02) {\n throw new InvalidDERSignatureError(\n 'Invalid DER signature: missing s INTEGER tag'\n );\n }\n\n // skip 02 tag\n offset += 1;\n\n if (offset >= der.length) {\n throw new InvalidDERSignatureError(\n 'Invalid DER signature: missing s length'\n );\n }\n const sLen = der[offset];\n offset += 1;\n\n if (offset + sLen > der.length) {\n throw new InvalidDERSignatureError(\n 'Invalid DER signature: s bytes out of bounds'\n );\n }\n let sBytes = der.slice(offset, offset + sLen);\n\n // Strip leading zero padding (DER adds a 0x00 prefix when high bit is set)\n if (rBytes.length === 33 && rBytes[0] === 0) rBytes = rBytes.slice(1);\n if (sBytes.length === 33 && sBytes[0] === 0) sBytes = sBytes.slice(1);\n\n // Pad to 32 bytes each\n const result = new Uint8Array(64);\n result.set(rBytes, 32 - rBytes.length);\n result.set(sBytes, 64 - sBytes.length);\n return result;\n};\n","import { BaseError } from '../../../errors/base';\n\nexport class ImportKeyNotSupportedError extends BaseError {\n constructor() {\n super({\n cause: null,\n code: 'import_key_not_supported_error',\n details:\n 'Hardware-backed keystores cannot import external private keys.',\n docsUrl: null,\n name: 'ImportKeyNotSupportedError',\n shortMessage: 'importKey is not supported on React Native.',\n });\n }\n}\n","import { BaseError } from '../../../errors/base';\n\nexport class KeyNotFoundError extends BaseError {\n // eslint-disable-next-line custom-rules/require-single-object-param\n constructor(keyName: string) {\n super({\n cause: null,\n code: 'key_not_found',\n docsUrl: null,\n name: 'KeyNotFoundError',\n shortMessage: `Key \"${keyName}\" not found in keychain`,\n });\n }\n}\n","import { NativeModuleNotLinkedError } from '../../../errors/NativeModuleNotLinkedError';\nimport NativeKeychain from '../../../turboModules/NativeKeychain';\nimport { base64urlFromBytes } from '../../../utils/base64urlFromBytes';\nimport { bufferToHex } from '../../../utils/bufferToHex';\nimport { bytesFromBase64url } from '../../../utils/bytesFromBase64url';\nimport { compressRawPublicKey } from '../../../utils/compressRawPublicKey';\nimport { derToP1363 } from '../../../utils/derToP1363';\nimport type { CreateKeychainService } from './createKeychainService.types';\nimport { ImportKeyNotSupportedError } from './ImportKeyNotSupportedError';\nimport { KeyNotFoundError } from './KeyNotFoundError';\n\n/**\n * Creates a KeychainService backed by the platform's secure hardware\n * (iOS Secure Enclave / Android KeyStore with StrongBox or TEE).\n *\n * Keys are generated and stored inside the secure hardware and never\n * leave the device. The native module returns base64url-encoded data\n * which this wrapper converts to the hex format the SDK expects.\n *\n * @throws NativeModuleNotLinkedError if the native Keychain TurboModule is not available.\n *\n * @not-instrumented\n */\nexport const createKeychainService: CreateKeychainService = () => {\n if (NativeKeychain == null) {\n throw new NativeModuleNotLinkedError({ moduleName: 'Keychain' });\n }\n\n const nativeModule = NativeKeychain;\n\n // eslint-disable-next-line custom-rules/require-single-object-param\n const generateKey = async (keyName: string): Promise<string> => {\n const result = await nativeModule.generateKeyPair(keyName);\n const uncompressedKey = bytesFromBase64url(result.publicKey);\n return bufferToHex(\n compressRawPublicKey(uncompressedKey.buffer as ArrayBuffer)\n );\n };\n\n /**\n * Importing external private keys is not supported on hardware-backed\n * keystores (Secure Enclave / Android KeyStore). Keys must be generated\n * on-device via generateKey().\n */\n const importKey = (): Promise<string> => {\n throw new ImportKeyNotSupportedError();\n };\n\n // eslint-disable-next-line custom-rules/require-single-object-param\n const getPublicKey = async (keyName: string): Promise<string | null> => {\n const result = await nativeModule.getPublicKey(keyName);\n\n if (result == null) {\n return null;\n }\n\n const uncompressedKey = bytesFromBase64url(result.publicKey);\n return bufferToHex(\n compressRawPublicKey(uncompressedKey.buffer as ArrayBuffer)\n );\n };\n\n // eslint-disable-next-line custom-rules/require-single-object-param\n const sign = async (keyName: string, message: string): Promise<string> => {\n const hasKeyResult = await nativeModule.hasKey(keyName);\n\n if (!hasKeyResult) {\n throw new KeyNotFoundError(keyName);\n }\n\n // Encode the message to UTF-8 bytes, then base64url-encode for the bridge\n const encodedMessage = new TextEncoder().encode(message);\n const base64urlPayload = base64urlFromBytes(encodedMessage);\n\n const result = await nativeModule.sign(keyName, base64urlPayload);\n\n // Native returns DER-encoded signature; convert to P1363 hex\n const derSignature = bytesFromBase64url(result.signature);\n return bufferToHex(derToP1363(derSignature));\n };\n\n // eslint-disable-next-line custom-rules/require-single-object-param\n const hasKey = async (keyName: string): Promise<boolean> => {\n return nativeModule.hasKey(keyName);\n };\n\n // eslint-disable-next-line custom-rules/require-single-object-param\n const removeKey = async (keyName: string): Promise<void> => {\n await nativeModule.deleteKey(keyName);\n };\n\n return {\n generateKey,\n getPublicKey,\n hasKey,\n importKey,\n removeKey,\n sign,\n };\n};\n","import { BaseError } from './base';\n\ntype InvalidRealtimePublishParams = {\n channel: string;\n};\n\nexport class InvalidRealtimePublishError extends BaseError {\n constructor({ channel }: InvalidRealtimePublishParams) {\n super({\n cause: null,\n code: 'invalid_realtime_publish',\n docsUrl: null,\n metaMessages: [`channel: ${channel}`],\n name: 'InvalidRealtimePublishError',\n shortMessage:\n 'Tried to publish data that does not match the channel schema',\n });\n }\n}\n","import { BaseError } from './base';\n\nexport class RealtimeNotConnectedError extends BaseError {\n constructor() {\n super({\n cause: null,\n code: 'realtime_not_connected_error',\n docsUrl: null,\n name: 'RealtimeNotConnectedError',\n shortMessage:\n 'Realtime service is not connected. Call connect() before subscribing or publishing.',\n });\n }\n}\n","import type { InboundMessage, RealtimeChannel, messageCallback } from 'ably';\nimport type { BaseRealtime } from 'ably/modular';\nimport EventEmitter from 'eventemitter3';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { InvalidRealtimePublishError } from '../../../errors/InvalidRealtimePublishError';\nimport { RealtimeNotConnectedError } from '../../../errors/RealtimeNotConnectedError';\nimport { createApiClient } from '../../../modules/apiClient';\nimport { isServerSideRendering } from '../../../utils/isServerSideRendering';\nimport type {\n RealtimeChannelSchema,\n RealtimeConnectionState,\n RealtimeEventMap,\n RealtimeService,\n} from '../realtime.types';\n\nconst ABLY_STATE_TO_REALTIME_STATE: Record<string, RealtimeConnectionState> = {\n closed: 'closed',\n closing: 'closing',\n connected: 'connected',\n connecting: 'connecting',\n disconnected: 'disconnected',\n failed: 'failed',\n initialized: 'idle',\n suspended: 'suspended',\n};\n\nconst mapAblyState = (ablyState: string): RealtimeConnectionState =>\n ABLY_STATE_TO_REALTIME_STATE[ablyState] ?? 'idle';\n\n/**\n * Creates a realtime pub/sub service backed by Ably.\n *\n * The service starts idle. Call `connect({ client })` to establish\n * a connection, passing the DynamicClient explicitly.\n *\n * SSR environments receive a no-op implementation.\n * @not-instrumented\n */\n \nexport const createRealtimeService = (): RealtimeService => {\n if (isServerSideRendering()) {\n return {\n connect: () => Promise.resolve(),\n disconnect: () => {},\n getConnectionState: () => 'idle',\n off: () => {},\n on: () => {},\n publish: () => Promise.resolve(),\n subscribe: () => Promise.resolve(),\n unsubscribe: () => {},\n };\n }\n\n const eventEmitter = new EventEmitter<RealtimeEventMap>();\n const channels = new Map<string, RealtimeChannel>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const handlerMap = new WeakMap<(message: { data: any }) => void, messageCallback<InboundMessage>>();\n\n let ablyClient: BaseRealtime | undefined;\n let connectionState: RealtimeConnectionState = 'idle';\n let isConnecting = false;\n\n const setConnectionState = (state: RealtimeConnectionState) => {\n connectionState = state;\n eventEmitter.emit('connectionStateChange', state);\n };\n\n // eslint-disable-next-line custom-rules/require-single-object-param\n const getOrCreateChannel = (channelName: string): RealtimeChannel => {\n const existing = channels.get(channelName);\n\n if (existing) {\n return existing;\n }\n\n if (!ablyClient) {\n throw new RealtimeNotConnectedError();\n }\n\n const channel = ablyClient.channels.get(channelName);\n channels.set(channelName, channel);\n\n return channel;\n };\n\n const connect: RealtimeService['connect'] = async ({ client, headers }) => {\n if (isConnecting) {\n return;\n }\n\n isConnecting = true;\n\n try {\n const core = getCore(client);\n\n if (ablyClient) {\n ablyClient.close();\n channels.clear();\n }\n\n // Dynamic import to keep the module tree-shakeable\n // and avoid loading Ably in SSR environments\n const {\n BaseRealtime: AblyBaseRealtime,\n FetchRequest,\n WebSocketTransport,\n } = await import('ably/modular');\n\n ablyClient = new AblyBaseRealtime({\n // authCallback must return void (not Promise<void>), so we use\n // .then().catch() instead of async/await to avoid returning a Promise\n // to Ably's callback-style auth handler.\n authCallback: (_tokenParams, callback) => {\n const apiClient = createApiClient({ headers }, client);\n\n apiClient\n .getRealtimeAuthToken({ environmentId: core.environmentId })\n .then((response) => {\n callback(null, response.token);\n })\n .catch((err: unknown) => {\n const message = err instanceof Error ? err.message : String(err);\n callback(message, null);\n });\n },\n autoConnect: false,\n plugins: { FetchRequest, WebSocketTransport },\n });\n\n ablyClient.connection.on((stateChange) => {\n setConnectionState(mapAblyState(stateChange.current));\n });\n\n ablyClient.connect();\n } finally {\n isConnecting = false;\n }\n };\n\n const disconnect: RealtimeService['disconnect'] = () => {\n if (!ablyClient) {\n return;\n }\n\n for (const channel of channels.values()) {\n channel.detach().catch(() => {});\n }\n\n channels.clear();\n ablyClient.close();\n ablyClient = undefined;\n };\n\n const subscribe: RealtimeService['subscribe'] = async <T>({\n channelSchema,\n callback,\n }: {\n callback: (message: { data: T }) => void;\n channelSchema: RealtimeChannelSchema<T>;\n }) => {\n const channel = getOrCreateChannel(channelSchema.channel);\n\n const handler: messageCallback<InboundMessage> = (message) => {\n const parsed = channelSchema.schema.safeParse(message.data);\n\n if (!parsed.success) {\n return;\n }\n\n callback({ data: parsed.data });\n };\n\n handlerMap.set(callback, handler);\n\n await channel.subscribe(handler);\n };\n\n const unsubscribe: RealtimeService['unsubscribe'] = <T>({\n channelSchema,\n callback,\n }: {\n callback: (message: { data: T }) => void;\n channelSchema: RealtimeChannelSchema<T>;\n }) => {\n const channel = channels.get(channelSchema.channel);\n\n if (!channel) {\n return;\n }\n\n const handler = handlerMap.get(callback);\n\n if (handler) {\n channel.unsubscribe(handler);\n handlerMap.delete(callback);\n }\n };\n\n const publish: RealtimeService['publish'] = async <T>({\n channelSchema,\n data,\n }: {\n channelSchema: RealtimeChannelSchema<T>;\n data: T;\n }) => {\n const parsed = channelSchema.schema.safeParse(data);\n\n if (!parsed.success) {\n throw new InvalidRealtimePublishError({ channel: channelSchema.channel });\n }\n\n const channel = getOrCreateChannel(channelSchema.channel);\n await channel.publish('message', parsed.data);\n };\n\n return {\n connect,\n disconnect,\n getConnectionState: () => connectionState,\n off: (event, callback) => {\n eventEmitter.off(event, callback);\n },\n on: (event, callback) => {\n eventEmitter.on(event, callback);\n },\n publish,\n subscribe,\n unsubscribe,\n };\n};\n","type GetKeychainIndexedDBNameParams = {\n environmentId: string;\n};\n\n/**\n * Builds the IndexedDB database name used by the keychain service for a given\n * environment. Centralizing this avoids drift between the SDK and any\n * extension code that needs to read or migrate the same database.\n *\n * @param params.environmentId - The Dynamic environment id.\n * @returns The IndexedDB database name for the keychain.\n * @not-instrumented\n */\nexport const getKeychainIndexedDBName = ({\n environmentId,\n}: GetKeychainIndexedDBNameParams): string =>\n `dynamic_${environmentId}_keychain`;\n","import { BaseError } from './base';\n\nexport class NoNetworkProvidersError extends BaseError {\n constructor() {\n super({\n cause: null,\n code: 'no_network_providers',\n docsUrl: null,\n name: 'NoNetworkProvidersError',\n shortMessage: 'No networks were registered in the client',\n });\n }\n}\n","import { BaseError, type BaseErrorParameters } from './base';\n\nexport class WalletAlreadyLinkedToAnotherUserError extends BaseError {\n constructor({ cause }: Pick<BaseErrorParameters, 'cause'>) {\n super({\n cause,\n code: 'wallet_already_linked_to_another_user_error',\n docsUrl: null,\n name: 'WalletAlreadyLinkedToAnotherUserError',\n shortMessage: 'This wallet is already linked to another user',\n });\n }\n}\n","import { BaseError } from './base';\n\nexport class MethodNotImplementedError extends BaseError {\n // eslint-disable-next-line custom-rules/require-single-object-param\n constructor(methodName: string) {\n super({\n cause: null,\n code: 'method_not_implemented_error',\n docsUrl: null,\n name: 'MethodNotImplementedError',\n shortMessage: `This method is not implemented: ${methodName}`,\n });\n }\n}\n","import { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/** @not-instrumented */\nexport const isCaptchaRequired = (client = getDefaultClient()) => {\n const projectSettings = client.projectSettings;\n\n assertDefined(projectSettings, 'Project settings are not available');\n\n return projectSettings.security.hCaptcha?.enabled ?? false;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\n\ntype SetCaptchaTokenProps = {\n captchaToken: string;\n};\n\n/**\n * Sets the given captcha token in the client state.\n *\n * @param params.captchaToken - The captcha token to set.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @instrumented\n */\nexport const setCaptchaToken = (\n { captchaToken }: SetCaptchaTokenProps,\n client = getDefaultClient()\n) => {\n const core = getCore(client);\n\n core.state.set({\n captchaToken,\n });\n};\n","import type * as z from 'zod/mini';\n\nimport type { RealtimeChannelSchema } from '../realtime.types';\n\n/**\n * Defines a typed schema for a realtime channel — analogous to `createStorageKeySchema`\n * for storage. Pairs a channel name with a Zod schema that validates the shape of\n * messages sent and received on that channel. Pass the result to the realtime service's\n * `subscribe` / `unsubscribe` / `publish` methods to get end-to-end type safety.\n * @not-instrumented\n */\nexport const createRealtimeChannelSchema = <T>(params: {\n channel: string;\n schema: z.ZodMiniType<T>;\n}): RealtimeChannelSchema<T> => params;\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\n\ntype HasExtensionParams = {\n extensionKey: string;\n};\n\n/**\n * Checks if a specific extension has been applied to the Dynamic client.\n *\n * Extensions add optional features to the Dynamic SDK,\n * such as EVM, Solana, or other chain support.\n *\n * @param params.extensionKey - The unique key identifying the extension to check for.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if the extension is applied, false otherwise.\n * @not-instrumented\n */\nexport const hasExtension = (\n { extensionKey }: HasExtensionParams,\n client = getDefaultClient()\n) => {\n const core = getCore(client);\n\n return core.extensions.has(extensionKey);\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport { isCaptchaRequired } from '../isCaptchaRequired';\n\n/**\n * Retrieves the current captcha token from the client state and sets it to null.\n * @not-instrumented\n */\nexport const consumeCaptchaToken = (\n client: DynamicClient\n): string | undefined => {\n const core = getCore(client);\n\n const captchaToken = core.state.get().captchaToken;\n\n if (isCaptchaRequired(client)) {\n assertDefined(captchaToken, 'Captcha token is required');\n }\n\n core.state.set({\n captchaToken: null,\n });\n\n return captchaToken ?? undefined;\n};\n","import {\n AuthModeEnum,\n type ChainEnum,\n type ConnectRequest,\n} from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { createApiClient } from '../../apiClient';\nimport { getWalletProviderFromWalletAccount } from '../../wallets/utils/getWalletProviderFromWalletAccount';\nimport { normalizeWalletNameWithChain } from '../../wallets/utils/normalizeWalletNameWithChain';\nimport type { WalletAccount } from '../../wallets/walletAccount';\n\ntype CreateVisitParams = {\n authMode?: AuthModeEnum;\n walletAccount: WalletAccount;\n};\n\n/* \n In older SDK versions we used to have the concept of \"connect-only\" vs \"connect-and-sign\". \n The only difference in backend is it stores some extra data for connect-only, \n so we can just default to using it.\n*/\n/** @not-instrumented */\nexport const createVisit = async (\n { walletAccount, authMode = AuthModeEnum.Only }: CreateVisitParams,\n client: DynamicClient\n) => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const walletProvider = getWalletProviderFromWalletAccount(\n { walletAccount },\n client\n );\n\n try {\n const walletName = normalizeWalletNameWithChain({\n chain: walletProvider.chain,\n displayName: walletProvider.metadata.displayName,\n });\n\n const connectRequest: ConnectRequest = {\n address: walletAccount.address,\n authMode,\n // eslint-disable-next-line custom-rules/ban-chain-enum\n chain: walletProvider.chain as ChainEnum,\n provider: walletProvider.walletProviderType,\n walletName,\n };\n\n await apiClient.createVisit({\n connectRequest,\n environmentId: core.environmentId,\n });\n } catch (error) {\n core.logger.error('Error creating visit', { error });\n }\n};\n","import { getCore } from '../../../../client/core/getCore';\nimport type { DynamicClient } from '../../../../client/types';\nimport type { UnverifiedWalletAccount } from '../unverifiedWalletAccounts.types';\n\ntype SetUnverifiedWalletAccountsParams = {\n unverifiedWalletAccountsToUpdate: UnverifiedWalletAccount[];\n};\n\n/**\n * Updates the unverified wallet account in the client state.\n * This will add new wallet accounts and override those with matching ids,\n * but will leave other preexisting wallet accounts unchanged.\n * @not-instrumented\n */\nexport const setUnverifiedWalletAccounts = (\n { unverifiedWalletAccountsToUpdate }: SetUnverifiedWalletAccountsParams,\n client: DynamicClient\n): void => {\n if (unverifiedWalletAccountsToUpdate.length === 0) {\n return;\n }\n\n const core = getCore(client);\n\n const unverifiedWalletAccountsToUpdateIds =\n unverifiedWalletAccountsToUpdate.map(({ id }) => id);\n\n const filteredUnverifiedWalletAccounts: UnverifiedWalletAccount[] = core.state\n .get()\n .unverifiedWalletAccounts.filter(\n (unverifiedWalletAccount) =>\n !unverifiedWalletAccountsToUpdateIds.includes(\n unverifiedWalletAccount.id\n )\n );\n\n core.state.set({\n unverifiedWalletAccounts: [\n ...filteredUnverifiedWalletAccounts,\n ...unverifiedWalletAccountsToUpdate,\n ],\n });\n};\n","type FormatSignInMessageParams = {\n address: string;\n blockchainName: string;\n chainId?: string;\n domain: string;\n issuedAt?: string;\n nonce: string;\n requestId?: string;\n resources?: string[];\n statement?: string;\n uri: string;\n};\n\n/**\n * Formats a sign in message to prove ownership of an address.\n * @not-instrumented\n */\nexport const formatSignInMessage = async ({\n domain,\n blockchainName,\n address,\n uri,\n chainId,\n nonce,\n issuedAt,\n requestId,\n statement,\n resources,\n}: FormatSignInMessageParams) => {\n // This format follows the sign-in with ethereum (SIWE) standard,\n // but we are using it also for non-ethereum wallets for now (eg. Solana)\n // for more context on format and fields, please see:\n // https://docs.login.xyz/general-information/siwe-overview/eip-4361\n const header = `${domain} wants you to sign in with your ${blockchainName} account:`;\n const prefix = [header, address].join('\\n');\n\n // If there is a statement, we want to add a gap between the prefix and the statement\n // two times '\\n', first to move statement to next line and second to add a gap between prefix and statement\n const prefixWithStatementGap = statement ? '\\n\\n' : '\\n';\n const prefixWithStatement = `${[prefix, statement].join(\n prefixWithStatementGap\n )}\\n`;\n\n const suffixFields: string[] = [];\n suffixFields.push(`URI: ${uri}`);\n suffixFields.push('Version: 1');\n if (chainId) {\n suffixFields.push(`Chain ID: ${chainId}`);\n }\n\n suffixFields.push(`Nonce: ${nonce}`);\n\n if (issuedAt) {\n suffixFields.push(`Issued At: ${issuedAt}`);\n }\n\n if (requestId) {\n suffixFields.push(`Request ID: ${requestId}`);\n }\n\n if (resources?.length) {\n suffixFields.push(\n `Resources:${resources.map((resource) => '\\n- ' + resource).join()}`\n );\n }\n\n const suffix = suffixFields.join('\\n');\n\n return [prefixWithStatement, suffix].join('\\n');\n};\n","import { getCore } from '../../../../../client/core/getCore';\nimport type { DynamicClient } from '../../../../../client/types';\n\n/** @not-instrumented */\nexport const createSignInMessageStatement = (client: DynamicClient) => {\n const core = getCore(client);\n\n const appName =\n core.metadata?.name ?? client.projectSettings?.general.displayName;\n\n return `Welcome to ${appName}. Signing is the only way we can truly know that you are the owner of the wallet you are connecting. Signing is a safe, gas-less transaction that does not in any way give ${appName} permission to perform any transactions with your wallet.`;\n};\n","import { getCore } from '../../../../client/core/getCore';\nimport type { DynamicClient } from '../../../../client/types';\nimport { checkAndRaiseWalletAccountsChangedEvent } from '../../../auth/updateAuthFromVerifyResponse/checkAndRaiseWalletAccountsChangedEvent';\nimport type { UnverifiedWalletAccount } from '../unverifiedWalletAccounts.types';\n\ntype RemoveUnverifiedWalletAccountParams = {\n unverifiedWalletAccount: UnverifiedWalletAccount;\n};\n\n/**\n * Removes an unverified wallet account from the client's state.\n * @not-instrumented\n */\nexport const removeUnverifiedWalletAccount = (\n { unverifiedWalletAccount }: RemoveUnverifiedWalletAccountParams,\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n const previousState = core.state.get();\n\n const { unverifiedWalletAccounts } = core.state.get();\n\n const filteredUnverifiedWalletAccounts = unverifiedWalletAccounts.filter(\n (account) => account.id !== unverifiedWalletAccount.id\n );\n\n core.state.set({\n unverifiedWalletAccounts: filteredUnverifiedWalletAccounts,\n });\n\n /**\n * We check before raising because the wallet account we are removing might still\n * be present in wallet accounts due to having been moved to verified credentials.\n */\n checkAndRaiseWalletAccountsChangedEvent({ previousState }, client);\n};\n","/**\n * Check if the given value is an Error object\n * @not-instrumented\n */\nexport const isError = (error: unknown): error is Error =>\n error instanceof Error;\n","import { isError } from '../isError';\n\n/**\n * Check if the given value is an Error object with a specific code\n * @not-instrumented\n */\n// eslint-disable-next-line custom-rules/require-single-object-param\nexport const isErrorWithCode = <T extends string>(\n error: unknown,\n code: T\n): error is Error & { code: T } => {\n if (!isError(error)) return false;\n\n return 'code' in error && error.code === code;\n};\n","import type {\n ChainEnum,\n TokenScope,\n VerifyResponse,\n WalletAddressType,\n WalletProviderEnum,\n} from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { isErrorWithCode } from '../../../utils/isErrorWithCode';\nimport { createApiClient } from '../../apiClient';\nimport { consumeCaptchaToken } from '../../captcha/consumeCaptchaToken';\nimport type { Chain } from '../../chain';\nimport { normalizeWalletNameWithChain } from '../utils/normalizeWalletNameWithChain';\nimport type { WalletAddressWithType } from '../walletAccount/walletAccount.types';\nimport { WalletAlreadyLinkedToAnotherUserError } from './../../../errors/WalletAlreadyLinkedToAnotherUserError';\n\ntype VerifyMessageSignatureOwnershipParams = {\n addressesWithTypes?: WalletAddressWithType[];\n chain: Chain;\n isTransfer?: boolean;\n messageToSign: string;\n networkId?: string;\n requestedScopes?: TokenScope[];\n signature: string;\n walletAddress: string;\n walletDisplayName: string;\n walletProviderType: WalletProviderEnum;\n};\n\n/**\n * Verifies a signed message by calling either the verifyLink, verifyTransfer or verify API function,\n * depending on whether the user is signing in, linking or transferring a wallet.\n *\n * Does NOT call updateAuthFromVerifyResponse, it should be called from the return of this function.\n * @not-instrumented\n */\nexport const verifyMessageSignatureOwnership = async (\n {\n messageToSign,\n walletAddress,\n addressesWithTypes,\n signature,\n chain,\n isTransfer = false,\n walletDisplayName,\n walletProviderType,\n networkId,\n requestedScopes,\n }: VerifyMessageSignatureOwnershipParams,\n client: DynamicClient\n): Promise<VerifyResponse> => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const walletName = normalizeWalletNameWithChain({\n chain,\n displayName: walletDisplayName,\n });\n\n let verifyApiFunction;\n\n if (!client.user) {\n // If the user is not authenticated, call the walletsSignin API function to sign in\n verifyApiFunction = apiClient.walletsSignin.bind(apiClient);\n } else if (isTransfer) {\n // If the user is authenticated and is transferring a wallet, call the verifyTransfer API function\n verifyApiFunction = apiClient.verifyTransfer.bind(apiClient);\n } else if (client.user && requestedScopes) {\n // Scopes = step-up auth: user requests permission for a sensitive op (e.g. wallet export).\n // We grant it only if they prove they own an existing credential (walletsVerify).\n // Must use walletsVerify: user is already logged in (not signin) and credential exists (not transfer/link).\n // If the user is authenticated and requested scopes are provided, call the walletsVerify API function\n verifyApiFunction = apiClient.walletsVerify.bind(apiClient);\n } else {\n // If the user is authenticated and is signing in, call the verifyLink API function\n verifyApiFunction = apiClient.verifyLink.bind(apiClient);\n }\n\n try {\n return await verifyApiFunction({\n environmentId: core.environmentId,\n verifyRequest: {\n // mapping to handle typecasting for address type\n additionalWalletAddresses: addressesWithTypes?.map((address) => ({\n address: address.address,\n publicKey: address.publicKey,\n type: address.type as WalletAddressType,\n })),\n captchaToken: consumeCaptchaToken(client),\n // eslint-disable-next-line custom-rules/ban-chain-enum\n chain: chain as ChainEnum,\n messageToSign,\n network: networkId,\n publicWalletAddress: walletAddress,\n requestedScopes,\n signedMessage: signature,\n walletName,\n walletProvider: walletProviderType,\n },\n });\n } catch (error) {\n core.logger.error('Failed to verify message signature ownership', error);\n\n if (\n isErrorWithCode(error, 'reassign_wallet_confirm') ||\n isErrorWithCode(error, 'merge_accounts_confirmation')\n ) {\n throw new WalletAlreadyLinkedToAnotherUserError({\n cause: error,\n });\n }\n\n throw error;\n }\n};\n","import { getCore } from '../../../../../client/core/getCore';\nimport type { DynamicClient } from '../../../../../client/types';\n\ntype updateWalletProviderKeysForVerifiedCredentialsParams = {\n keysToUpdate: Record<string, string>;\n};\n\n/** @not-instrumented */\nexport const updateWalletProviderKeysForVerifiedCredentials = (\n { keysToUpdate }: updateWalletProviderKeysForVerifiedCredentialsParams,\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n core.state.set({\n walletProviderKeyMap: {\n ...core.state.get().walletProviderKeyMap,\n ...keysToUpdate,\n },\n });\n};\n","import type { Chain } from '../../../chain';\nimport { CHAINS_INFO_MAP } from '../../constants';\n\n/**\n * Maps the chain name from the API to the SDK chain name\n * @not-instrumented\n */\n// eslint-disable-next-line custom-rules/require-single-object-param\nexport const getSdkChainFromApiChainName = (\n chainName: string\n): Chain | null => {\n const chains = Object.keys(CHAINS_INFO_MAP) as Chain[];\n\n const chain = chains.find(\n (chain) => CHAINS_INFO_MAP[chain].apiChainName === chainName\n );\n\n return chain || null;\n};\n","import { getCore } from '../../../../client/core/getCore';\nimport { getDefaultClient } from '../../../../client/defaultClient';\nimport { assertDefined } from '../../../../utils/assertDefined';\nimport { getSdkChainFromApiChainName } from '../getSdkChainFromApiChainName';\nimport type { NetworkData } from '../networkProvider/networkProvider.types';\n\n/**\n * Retrieves all available network configurations from project settings.\n *\n * This function returns detailed configuration data for all networks enabled\n * in your Dynamic project, including RPC URLs, native currencies, and metadata.\n *\n * If a `transformers.networkData` callback was provided in the client configuration,\n * it will be applied to each network before returning the data. This allows you to\n * customize network properties (such as RPC URLs) in a centralized way.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns An array of network configuration data for all enabled networks.\n * @not-instrumented\n */\nexport const getNetworksData = (client = getDefaultClient()): NetworkData[] => {\n const core = getCore(client);\n const { state, transformers } = core;\n\n const networkDataTransformer =\n transformers?.networkData ?? ((networkData) => networkData);\n\n const { projectSettings } = state.get();\n\n assertDefined(projectSettings, 'projectSettings not found');\n\n const networks = projectSettings.networks;\n\n if (!networks) {\n return [];\n }\n\n const networksData = networks\n .map((network) => {\n if (!network.chainName) return [];\n\n const chain = getSdkChainFromApiChainName(network.chainName);\n\n if (!network?.networks?.length || !chain) return [];\n\n return network.networks.map((networkConfiguration) => {\n const networkData: NetworkData = {\n blockExplorerUrls: networkConfiguration.blockExplorerUrls,\n chain,\n cluster: networkConfiguration.cluster,\n displayName:\n networkConfiguration.vanityName || networkConfiguration.name,\n genesisHash: networkConfiguration.genesisHash,\n iconUrl: networkConfiguration.iconUrls[0],\n name: networkConfiguration.name,\n nativeCurrency: {\n decimals: networkConfiguration.nativeCurrency.decimals,\n iconUrl: networkConfiguration.nativeCurrency.iconUrl,\n name: networkConfiguration.nativeCurrency.name,\n symbol: networkConfiguration.nativeCurrency.symbol,\n },\n networkId: networkConfiguration.networkId,\n rpcUrls: {\n http: [\n ...(networkConfiguration.privateCustomerRpcUrls ?? []),\n ...(networkConfiguration.rpcUrls ?? []),\n ],\n },\n testnet: networkConfiguration.isTestnet ?? false,\n };\n\n return networkDataTransformer(networkData);\n });\n })\n .flat();\n\n return networksData;\n};\n","import type { Chain } from '../../../../chain';\nimport type {\n NetworkProviderBuilder,\n NetworkProviderBuilderRegistry,\n} from '../networkProviderBuilderRegistry.types';\n\n/** @not-instrumented */\nexport const createNetworkProviderBuilderRegistry =\n (): NetworkProviderBuilderRegistry => {\n const registry = new Map<Chain, NetworkProviderBuilder>();\n\n return {\n get: () => registry,\n register: (networkProviderBuilder) => {\n registry.set(networkProviderBuilder.chain, networkProviderBuilder);\n },\n };\n };\n","import { createRuntimeServiceAccessKey } from '../../../../../services/runtimeServices';\nimport { createNetworkProviderBuilderRegistry } from '../createNetworkProviderBuilderRegistry';\n\nexport const getNetworkProviderBuilderRegistry = createRuntimeServiceAccessKey(\n 'networkProviderBuilderRegistry',\n createNetworkProviderBuilderRegistry\n);\n","import type { DynamicClient } from '../../../../client/types';\nimport { getNetworksData } from '../getNetworksData';\nimport type { NetworkProvider } from '../networkProvider';\nimport { getNetworkProviderBuilderRegistry } from '../networkProviderBuilderRegistry';\n\n/**\n * Retrieves all registered network providers for enabled chains.\n * @not-instrumented\n */\nexport const getNetworkProviders = (\n client: DynamicClient\n): NetworkProvider[] => {\n const networkProviderBuilderRegistry =\n getNetworkProviderBuilderRegistry(client);\n\n const registeredNetworkProviderBuilders = Array.from(\n networkProviderBuilderRegistry.get().values()\n );\n\n const networksData = getNetworksData(client);\n\n const networkProviders = registeredNetworkProviderBuilders.map(\n ({ builder, chain }) => {\n const networksDataForChain = networksData.filter(\n (networkData) => networkData.chain === chain\n );\n\n return networksDataForChain.map(builder);\n }\n );\n\n return networkProviders.flat();\n};\n","import type { DynamicClient } from '../../../../client/types';\nimport { NoNetworkProvidersError } from '../../../../errors/NoNetworkProvidersError';\nimport { assertDefined } from '../../../../utils/assertDefined';\nimport type { Chain } from '../../../chain';\nimport { getNetworkProviders } from '../getNetworkProviders';\nimport type { NetworkProvider } from '../networkProvider/networkProvider.types';\n\ntype GetNetworkProviderFromNetworkIdProps = {\n chain: Chain;\n networkId: string;\n};\n\n/** @not-instrumented */\nexport const getNetworkProviderFromNetworkId = (\n { networkId, chain }: GetNetworkProviderFromNetworkIdProps,\n client: DynamicClient\n): NetworkProvider => {\n const networkProviders = getNetworkProviders(client);\n\n if (networkProviders.length === 0) {\n throw new NoNetworkProvidersError();\n }\n\n const networkProvider = networkProviders.find(\n (networkProvider) =>\n networkProvider.networkId === networkId && networkProvider.chain === chain\n );\n\n assertDefined(\n networkProvider,\n `No network provider found for chain ${chain} with network id ${networkId}`\n );\n\n return networkProvider;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAOA,MAAa,kBAAqB,MAAS,SAAY;AACrD,KAAI,OAAO,GAAG,MAAM,KAAK,CAAE,QAAO;AAElC,KACE,OAAO,SAAS,YAChB,SAAS,QACT,OAAO,SAAS,YAChB,SAAS,KAET,QAAO,SAAS;AAGlB,KAAI,gBAAgB,OAAO,gBAAgB,KAAK;AAC9C,MAAI,KAAK,SAAS,KAAK,KAAM,QAAO;AAEpC,OAAK,MAAM,CAAC,KAAK,UAAU,KACzB,KAAI,CAAC,OAAO,GAAG,OAAO,KAAK,IAAI,IAAI,CAAC,CAAE,QAAO;AAG/C,SAAO;;AAGT,KAAI,gBAAgB,OAAO,gBAAgB,KAAK;AAC9C,MAAI,KAAK,SAAS,KAAK,KAAM,QAAO;AAEpC,OAAK,MAAM,SAAS,KAClB,KAAI,CAAC,KAAK,IAAI,MAAM,CAAE,QAAO;AAE/B,SAAO;;CAGT,MAAM,QAAQ,OAAO,KAAK,KAAK;AAE/B,KAAI,MAAM,WAAW,OAAO,KAAK,KAAK,CAAC,OAAQ,QAAO;AAEtD,MAAK,MAAM,QAAQ,MACjB,KACE,CAAC,OAAO,UAAU,eAAe,KAAK,MAAM,KAAe,IAC3D,CAAC,OAAO,GAAG,KAAK,OAAkB,KAAK,MAAiB,CAExD,QAA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,EACP,MAAM,CACJ,GAAI,qBAAqB,0BAA0B,EAAE,EACrD,GAAI,qBAAqB,WAAW,EAAE,CACvC,EACF;IACD,SAAS,qBAAqB,aAAa;IAC5C,CAEyC;IAC1C;GACF,CACD,MAAM;;;;;;ACnEX,MAAa,6CAC2B;CACpC,MAAM,2BAAW,IAAI,KAAoC;AAEzD,QAAO;EACL,WAAW;EACX,WAAW,2BAA2B;AACpC,YAAS,IAAI,uBAAuB,OAAO,uBAAuB;;EAErE;;;;;ACbL,MAAa,oCAAoC,8BAC/C,kCACA,qCACD;;;;;;;;ACGD,MAAa,uBACX,WACsB;CACtB,MAAM,iCACJ,kCAAkC,OAAO;CAE3C,MAAM,oCAAoC,MAAM,KAC9C,+BAA+B,KAAK,CAAC,QAAQ,CAC9C;CAED,MAAM,eAAe,gBAAgB,OAAO;AAY5C,QAVyB,kCAAkC,KACxD,EAAE,SAAS,YAAY;AAKtB,SAJ6B,aAAa,QACvC,gBAAgB,YAAY,UAAU,MACxC,CAE2B,IAAI,QAAQ;GAE3C,CAEuB,MAAM;;;;;;AClBhC,MAAa,mCACX,EAAE,WAAW,SACb,WACoB;CACpB,MAAM,mBAAmB,oBAAoB,OAAO;AAEpD,KAAI,iBAAiB,WAAW,EAC9B,OAAM,IAAI,yBAAyB;CAGrC,MAAM,kBAAkB,iBAAiB,MACtC,sBACCC,kBAAgB,cAAc,aAAaA,kBAAgB,UAAU,MACxE;AAED,eACE,iBACA,uCAAuC,MAAM,mBAAmB,YACjE;AAED,QAAO"}
|
|
@@ -1,24 +1,12 @@
|
|
|
1
|
-
const require_InvalidParamError = require('./InvalidParamError-
|
|
2
|
-
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-
|
|
1
|
+
const require_InvalidParamError = require('./InvalidParamError-XWDgGlk3.cjs');
|
|
2
|
+
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-CYVZ_XGq.cjs');
|
|
3
3
|
|
|
4
4
|
//#region src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts
|
|
5
|
-
/** @instrumented */
|
|
5
|
+
/** @not-instrumented */
|
|
6
6
|
const consumeMfaTokenIfRequiredForAction = async ({ mfaAction }, client) => {
|
|
7
7
|
if (!await require_isMfaRequiredForAction.isMfaRequiredForAction({ mfaAction }, client)) return;
|
|
8
8
|
return require_isMfaRequiredForAction.__consumeMfaToken_wrapped(client);
|
|
9
9
|
};
|
|
10
|
-
const __consumeMfaTokenIfRequiredForAction_impl = consumeMfaTokenIfRequiredForAction;
|
|
11
|
-
const __consumeMfaTokenIfRequiredForAction_wrapped = require_InvalidParamError.instrumentFunction({
|
|
12
|
-
fn: __consumeMfaTokenIfRequiredForAction_impl,
|
|
13
|
-
functionName: "consumeMfaTokenIfRequiredForAction",
|
|
14
|
-
getCore: () => {
|
|
15
|
-
try {
|
|
16
|
-
return require_InvalidParamError.getCore(require_InvalidParamError.getDefaultClient());
|
|
17
|
-
} catch {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
10
|
|
|
23
11
|
//#endregion
|
|
24
12
|
//#region src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts
|
|
@@ -38,41 +26,29 @@ const generateSessionSignature = async ({ sessionId }, client) => {
|
|
|
38
26
|
|
|
39
27
|
//#endregion
|
|
40
28
|
//#region src/modules/sessionKeys/getSignedSessionId/getSignedSessionId.ts
|
|
41
|
-
/** @instrumented */
|
|
29
|
+
/** @not-instrumented */
|
|
42
30
|
const getSignedSessionId = async (client) => {
|
|
43
31
|
const sessionId = require_InvalidParamError.getCore(client).state.get().user?.sessionId;
|
|
44
32
|
require_InvalidParamError.assertDefined(sessionId, "Session ID is required");
|
|
45
33
|
const { signature: signedSessionId } = await generateSessionSignature({ sessionId }, client);
|
|
46
34
|
require_InvalidParamError.assertDefined(signedSessionId, "Signed session ID is required");
|
|
47
|
-
const nonce = await require_InvalidParamError.
|
|
35
|
+
const nonce = await require_InvalidParamError.getNonce(client);
|
|
48
36
|
const { signature: nonceSignature } = await generateNonceSignature({ nonce }, client);
|
|
49
37
|
require_InvalidParamError.assertDefined(nonceSignature, "Nonce signature is required");
|
|
50
38
|
return { signature: `${signedSessionId}/${nonceSignature}/${nonce}` };
|
|
51
39
|
};
|
|
52
|
-
const __getSignedSessionId_impl = getSignedSessionId;
|
|
53
|
-
const __getSignedSessionId_wrapped = require_InvalidParamError.instrumentFunction({
|
|
54
|
-
fn: __getSignedSessionId_impl,
|
|
55
|
-
functionName: "getSignedSessionId",
|
|
56
|
-
getCore: () => {
|
|
57
|
-
try {
|
|
58
|
-
return require_InvalidParamError.getCore(require_InvalidParamError.getDefaultClient());
|
|
59
|
-
} catch {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
40
|
|
|
65
41
|
//#endregion
|
|
66
|
-
Object.defineProperty(exports, '
|
|
42
|
+
Object.defineProperty(exports, 'consumeMfaTokenIfRequiredForAction', {
|
|
67
43
|
enumerable: true,
|
|
68
44
|
get: function () {
|
|
69
|
-
return
|
|
45
|
+
return consumeMfaTokenIfRequiredForAction;
|
|
70
46
|
}
|
|
71
47
|
});
|
|
72
|
-
Object.defineProperty(exports, '
|
|
48
|
+
Object.defineProperty(exports, 'getSignedSessionId', {
|
|
73
49
|
enumerable: true,
|
|
74
50
|
get: function () {
|
|
75
|
-
return
|
|
51
|
+
return getSignedSessionId;
|
|
76
52
|
}
|
|
77
53
|
});
|
|
78
|
-
//# sourceMappingURL=getSignedSessionId-
|
|
54
|
+
//# sourceMappingURL=getSignedSessionId-B2YC9266.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSignedSessionId-B2YC9266.cjs","names":["isMfaRequiredForAction","consumeMfaToken","getCore","getCore","getCore","getNonce"],"sources":["../src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts","../src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts","../src/modules/sessionKeys/generateSessionSignature/generateSessionSignature.ts","../src/modules/sessionKeys/getSignedSessionId/getSignedSessionId.ts"],"sourcesContent":["import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { consumeMfaToken } from '../consumeMfaToken';\nimport { isMfaRequiredForAction } from '../isMfaRequiredForAction';\n\ntype ConsumeMfaTokenIfRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/** @not-instrumented */\nexport const consumeMfaTokenIfRequiredForAction = async (\n { mfaAction }: ConsumeMfaTokenIfRequiredForActionParams,\n client: DynamicClient\n): Promise<string | undefined> => {\n const isRequiredForAction = await isMfaRequiredForAction(\n { mfaAction },\n client\n );\n\n if (!isRequiredForAction) {\n return;\n }\n\n return consumeMfaToken(client);\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\n\ntype GenerateNonceSignatureParams = {\n nonce: string;\n};\n\n/** @not-instrumented */\nexport const generateNonceSignature = async (\n { nonce }: GenerateNonceSignatureParams,\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n assertDefined(core.keychain, 'Keychain service not available');\n\n const signature = await core.keychain.sign('session', nonce);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\n\ntype GenerateSessionSignatureParams = {\n sessionId: string;\n};\n\n/** @not-instrumented */\nexport const generateSessionSignature = async (\n { sessionId }: GenerateSessionSignatureParams,\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n const signature = await core.keychain.sign('session', sessionId);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport { getNonce } from '../../../utils/getNonce';\nimport { generateNonceSignature } from '../generateNonceSignature';\nimport { generateSessionSignature } from '../generateSessionSignature';\n\n/** @not-instrumented */\nexport const getSignedSessionId = async (client: DynamicClient) => {\n const core = getCore(client);\n\n const sessionId = core.state.get().user?.sessionId;\n assertDefined(sessionId, 'Session ID is required');\n\n const { signature: signedSessionId } = await generateSessionSignature(\n {\n sessionId,\n },\n client\n );\n\n assertDefined(signedSessionId, 'Signed session ID is required');\n\n const nonce = await getNonce(client);\n\n const { signature: nonceSignature } = await generateNonceSignature(\n {\n nonce,\n },\n client\n );\n\n assertDefined(nonceSignature, 'Nonce signature is required');\n\n const signature = `${signedSessionId}/${nonceSignature}/${nonce}`;\n\n return { signature };\n};\n"],"mappings":";;;;;AAWA,MAAa,qCAAqC,OAChD,EAAE,aACF,WACgC;AAMhC,KAAI,CALwB,MAAMA,sDAChC,EAAE,WAAW,EACb,OACD,CAGC;AAGF,QAAOC,yDAAgB,OAAO;;;;;;ACfhC,MAAa,yBAAyB,OACpC,EAAE,SACF,WACG;CACH,MAAM,OAAOC,kCAAQ,OAAO;AAE5B,yCAAc,KAAK,UAAU,iCAAiC;AAI9D,QAAO,EAAE,WAFS,MAAM,KAAK,SAAS,KAAK,WAAW,MAAM,EAExC;;;;;;ACXtB,MAAa,2BAA2B,OACtC,EAAE,aACF,WACG;AAKH,QAAO,EAAE,WAFS,MAFLC,kCAAQ,OAAO,CAEC,SAAS,KAAK,WAAW,UAAU,EAE5C;;;;;;ACRtB,MAAa,qBAAqB,OAAO,WAA0B;CAGjE,MAAM,YAFOC,kCAAQ,OAAO,CAEL,MAAM,KAAK,CAAC,MAAM;AACzC,yCAAc,WAAW,yBAAyB;CAElD,MAAM,EAAE,WAAW,oBAAoB,MAAM,yBAC3C,EACE,WACD,EACD,OACD;AAED,yCAAc,iBAAiB,gCAAgC;CAE/D,MAAM,QAAQ,MAAMC,mCAAS,OAAO;CAEpC,MAAM,EAAE,WAAW,mBAAmB,MAAM,uBAC1C,EACE,OACD,EACD,OACD;AAED,yCAAc,gBAAgB,8BAA8B;AAI5D,QAAO,EAAE,WAFS,GAAG,gBAAgB,GAAG,eAAe,GAAG,SAEtC"}
|
package/dist/{getSignedSessionId-DFiqF8_b.esm.js → getSignedSessionId-D-G950gE.native.esm.js}
RENAMED
|
@@ -1,24 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-
|
|
1
|
+
import { h as getNonce, w as assertDefined, z as getCore } from "./InvalidParamError-DfGaCYmW.native.esm.js";
|
|
2
|
+
import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-CwUE98S3.native.esm.js";
|
|
3
3
|
|
|
4
4
|
//#region src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts
|
|
5
|
-
/** @instrumented */
|
|
5
|
+
/** @not-instrumented */
|
|
6
6
|
const consumeMfaTokenIfRequiredForAction = async ({ mfaAction }, client) => {
|
|
7
7
|
if (!await isMfaRequiredForAction({ mfaAction }, client)) return;
|
|
8
8
|
return __consumeMfaToken_wrapped(client);
|
|
9
9
|
};
|
|
10
|
-
const __consumeMfaTokenIfRequiredForAction_impl = consumeMfaTokenIfRequiredForAction;
|
|
11
|
-
const __consumeMfaTokenIfRequiredForAction_wrapped = instrumentFunction({
|
|
12
|
-
fn: __consumeMfaTokenIfRequiredForAction_impl,
|
|
13
|
-
functionName: "consumeMfaTokenIfRequiredForAction",
|
|
14
|
-
getCore: () => {
|
|
15
|
-
try {
|
|
16
|
-
return getCore(getDefaultClient());
|
|
17
|
-
} catch {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
10
|
|
|
23
11
|
//#endregion
|
|
24
12
|
//#region src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts
|
|
@@ -38,30 +26,18 @@ const generateSessionSignature = async ({ sessionId }, client) => {
|
|
|
38
26
|
|
|
39
27
|
//#endregion
|
|
40
28
|
//#region src/modules/sessionKeys/getSignedSessionId/getSignedSessionId.ts
|
|
41
|
-
/** @instrumented */
|
|
29
|
+
/** @not-instrumented */
|
|
42
30
|
const getSignedSessionId = async (client) => {
|
|
43
31
|
const sessionId = getCore(client).state.get().user?.sessionId;
|
|
44
32
|
assertDefined(sessionId, "Session ID is required");
|
|
45
33
|
const { signature: signedSessionId } = await generateSessionSignature({ sessionId }, client);
|
|
46
34
|
assertDefined(signedSessionId, "Signed session ID is required");
|
|
47
|
-
const nonce = await
|
|
35
|
+
const nonce = await getNonce(client);
|
|
48
36
|
const { signature: nonceSignature } = await generateNonceSignature({ nonce }, client);
|
|
49
37
|
assertDefined(nonceSignature, "Nonce signature is required");
|
|
50
38
|
return { signature: `${signedSessionId}/${nonceSignature}/${nonce}` };
|
|
51
39
|
};
|
|
52
|
-
const __getSignedSessionId_impl = getSignedSessionId;
|
|
53
|
-
const __getSignedSessionId_wrapped = instrumentFunction({
|
|
54
|
-
fn: __getSignedSessionId_impl,
|
|
55
|
-
functionName: "getSignedSessionId",
|
|
56
|
-
getCore: () => {
|
|
57
|
-
try {
|
|
58
|
-
return getCore(getDefaultClient());
|
|
59
|
-
} catch {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
40
|
|
|
65
41
|
//#endregion
|
|
66
|
-
export {
|
|
67
|
-
//# sourceMappingURL=getSignedSessionId-
|
|
42
|
+
export { consumeMfaTokenIfRequiredForAction as n, getSignedSessionId as t };
|
|
43
|
+
//# sourceMappingURL=getSignedSessionId-D-G950gE.native.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSignedSessionId-D-G950gE.native.esm.js","names":["consumeMfaToken"],"sources":["../src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts","../src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts","../src/modules/sessionKeys/generateSessionSignature/generateSessionSignature.ts","../src/modules/sessionKeys/getSignedSessionId/getSignedSessionId.ts"],"sourcesContent":["import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { consumeMfaToken } from '../consumeMfaToken';\nimport { isMfaRequiredForAction } from '../isMfaRequiredForAction';\n\ntype ConsumeMfaTokenIfRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/** @not-instrumented */\nexport const consumeMfaTokenIfRequiredForAction = async (\n { mfaAction }: ConsumeMfaTokenIfRequiredForActionParams,\n client: DynamicClient\n): Promise<string | undefined> => {\n const isRequiredForAction = await isMfaRequiredForAction(\n { mfaAction },\n client\n );\n\n if (!isRequiredForAction) {\n return;\n }\n\n return consumeMfaToken(client);\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\n\ntype GenerateNonceSignatureParams = {\n nonce: string;\n};\n\n/** @not-instrumented */\nexport const generateNonceSignature = async (\n { nonce }: GenerateNonceSignatureParams,\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n assertDefined(core.keychain, 'Keychain service not available');\n\n const signature = await core.keychain.sign('session', nonce);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\n\ntype GenerateSessionSignatureParams = {\n sessionId: string;\n};\n\n/** @not-instrumented */\nexport const generateSessionSignature = async (\n { sessionId }: GenerateSessionSignatureParams,\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n const signature = await core.keychain.sign('session', sessionId);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport { getNonce } from '../../../utils/getNonce';\nimport { generateNonceSignature } from '../generateNonceSignature';\nimport { generateSessionSignature } from '../generateSessionSignature';\n\n/** @not-instrumented */\nexport const getSignedSessionId = async (client: DynamicClient) => {\n const core = getCore(client);\n\n const sessionId = core.state.get().user?.sessionId;\n assertDefined(sessionId, 'Session ID is required');\n\n const { signature: signedSessionId } = await generateSessionSignature(\n {\n sessionId,\n },\n client\n );\n\n assertDefined(signedSessionId, 'Signed session ID is required');\n\n const nonce = await getNonce(client);\n\n const { signature: nonceSignature } = await generateNonceSignature(\n {\n nonce,\n },\n client\n );\n\n assertDefined(nonceSignature, 'Nonce signature is required');\n\n const signature = `${signedSessionId}/${nonceSignature}/${nonce}`;\n\n return { signature };\n};\n"],"mappings":";;;;;AAWA,MAAa,qCAAqC,OAChD,EAAE,aACF,WACgC;AAMhC,KAAI,CALwB,MAAM,uBAChC,EAAE,WAAW,EACb,OACD,CAGC;AAGF,QAAOA,0BAAgB,OAAO;;;;;;ACfhC,MAAa,yBAAyB,OACpC,EAAE,SACF,WACG;CACH,MAAM,OAAO,QAAQ,OAAO;AAE5B,eAAc,KAAK,UAAU,iCAAiC;AAI9D,QAAO,EAAE,WAFS,MAAM,KAAK,SAAS,KAAK,WAAW,MAAM,EAExC;;;;;;ACXtB,MAAa,2BAA2B,OACtC,EAAE,aACF,WACG;AAKH,QAAO,EAAE,WAFS,MAFL,QAAQ,OAAO,CAEC,SAAS,KAAK,WAAW,UAAU,EAE5C;;;;;;ACRtB,MAAa,qBAAqB,OAAO,WAA0B;CAGjE,MAAM,YAFO,QAAQ,OAAO,CAEL,MAAM,KAAK,CAAC,MAAM;AACzC,eAAc,WAAW,yBAAyB;CAElD,MAAM,EAAE,WAAW,oBAAoB,MAAM,yBAC3C,EACE,WACD,EACD,OACD;AAED,eAAc,iBAAiB,gCAAgC;CAE/D,MAAM,QAAQ,MAAM,SAAS,OAAO;CAEpC,MAAM,EAAE,WAAW,mBAAmB,MAAM,uBAC1C,EACE,OACD,EACD,OACD;AAED,eAAc,gBAAgB,8BAA8B;AAI5D,QAAO,EAAE,WAFS,GAAG,gBAAgB,GAAG,eAAe,GAAG,SAEtC"}
|
package/dist/{getSignedSessionId-DXtxIjxF.native.esm.js → getSignedSessionId-G9BPBkMb.esm.js}
RENAMED
|
@@ -1,24 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-
|
|
1
|
+
import { h as getNonce, w as assertDefined, z as getCore } from "./InvalidParamError-De4xrOs4.esm.js";
|
|
2
|
+
import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-CPlDnHuj.esm.js";
|
|
3
3
|
|
|
4
4
|
//#region src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts
|
|
5
|
-
/** @instrumented */
|
|
5
|
+
/** @not-instrumented */
|
|
6
6
|
const consumeMfaTokenIfRequiredForAction = async ({ mfaAction }, client) => {
|
|
7
7
|
if (!await isMfaRequiredForAction({ mfaAction }, client)) return;
|
|
8
8
|
return __consumeMfaToken_wrapped(client);
|
|
9
9
|
};
|
|
10
|
-
const __consumeMfaTokenIfRequiredForAction_impl = consumeMfaTokenIfRequiredForAction;
|
|
11
|
-
const __consumeMfaTokenIfRequiredForAction_wrapped = instrumentFunction({
|
|
12
|
-
fn: __consumeMfaTokenIfRequiredForAction_impl,
|
|
13
|
-
functionName: "consumeMfaTokenIfRequiredForAction",
|
|
14
|
-
getCore: () => {
|
|
15
|
-
try {
|
|
16
|
-
return getCore(getDefaultClient());
|
|
17
|
-
} catch {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
10
|
|
|
23
11
|
//#endregion
|
|
24
12
|
//#region src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts
|
|
@@ -38,30 +26,18 @@ const generateSessionSignature = async ({ sessionId }, client) => {
|
|
|
38
26
|
|
|
39
27
|
//#endregion
|
|
40
28
|
//#region src/modules/sessionKeys/getSignedSessionId/getSignedSessionId.ts
|
|
41
|
-
/** @instrumented */
|
|
29
|
+
/** @not-instrumented */
|
|
42
30
|
const getSignedSessionId = async (client) => {
|
|
43
31
|
const sessionId = getCore(client).state.get().user?.sessionId;
|
|
44
32
|
assertDefined(sessionId, "Session ID is required");
|
|
45
33
|
const { signature: signedSessionId } = await generateSessionSignature({ sessionId }, client);
|
|
46
34
|
assertDefined(signedSessionId, "Signed session ID is required");
|
|
47
|
-
const nonce = await
|
|
35
|
+
const nonce = await getNonce(client);
|
|
48
36
|
const { signature: nonceSignature } = await generateNonceSignature({ nonce }, client);
|
|
49
37
|
assertDefined(nonceSignature, "Nonce signature is required");
|
|
50
38
|
return { signature: `${signedSessionId}/${nonceSignature}/${nonce}` };
|
|
51
39
|
};
|
|
52
|
-
const __getSignedSessionId_impl = getSignedSessionId;
|
|
53
|
-
const __getSignedSessionId_wrapped = instrumentFunction({
|
|
54
|
-
fn: __getSignedSessionId_impl,
|
|
55
|
-
functionName: "getSignedSessionId",
|
|
56
|
-
getCore: () => {
|
|
57
|
-
try {
|
|
58
|
-
return getCore(getDefaultClient());
|
|
59
|
-
} catch {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
40
|
|
|
65
41
|
//#endregion
|
|
66
|
-
export {
|
|
67
|
-
//# sourceMappingURL=getSignedSessionId-
|
|
42
|
+
export { consumeMfaTokenIfRequiredForAction as n, getSignedSessionId as t };
|
|
43
|
+
//# sourceMappingURL=getSignedSessionId-G9BPBkMb.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSignedSessionId-G9BPBkMb.esm.js","names":["consumeMfaToken"],"sources":["../src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts","../src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts","../src/modules/sessionKeys/generateSessionSignature/generateSessionSignature.ts","../src/modules/sessionKeys/getSignedSessionId/getSignedSessionId.ts"],"sourcesContent":["import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { consumeMfaToken } from '../consumeMfaToken';\nimport { isMfaRequiredForAction } from '../isMfaRequiredForAction';\n\ntype ConsumeMfaTokenIfRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/** @not-instrumented */\nexport const consumeMfaTokenIfRequiredForAction = async (\n { mfaAction }: ConsumeMfaTokenIfRequiredForActionParams,\n client: DynamicClient\n): Promise<string | undefined> => {\n const isRequiredForAction = await isMfaRequiredForAction(\n { mfaAction },\n client\n );\n\n if (!isRequiredForAction) {\n return;\n }\n\n return consumeMfaToken(client);\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\n\ntype GenerateNonceSignatureParams = {\n nonce: string;\n};\n\n/** @not-instrumented */\nexport const generateNonceSignature = async (\n { nonce }: GenerateNonceSignatureParams,\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n assertDefined(core.keychain, 'Keychain service not available');\n\n const signature = await core.keychain.sign('session', nonce);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\n\ntype GenerateSessionSignatureParams = {\n sessionId: string;\n};\n\n/** @not-instrumented */\nexport const generateSessionSignature = async (\n { sessionId }: GenerateSessionSignatureParams,\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n const signature = await core.keychain.sign('session', sessionId);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport { getNonce } from '../../../utils/getNonce';\nimport { generateNonceSignature } from '../generateNonceSignature';\nimport { generateSessionSignature } from '../generateSessionSignature';\n\n/** @not-instrumented */\nexport const getSignedSessionId = async (client: DynamicClient) => {\n const core = getCore(client);\n\n const sessionId = core.state.get().user?.sessionId;\n assertDefined(sessionId, 'Session ID is required');\n\n const { signature: signedSessionId } = await generateSessionSignature(\n {\n sessionId,\n },\n client\n );\n\n assertDefined(signedSessionId, 'Signed session ID is required');\n\n const nonce = await getNonce(client);\n\n const { signature: nonceSignature } = await generateNonceSignature(\n {\n nonce,\n },\n client\n );\n\n assertDefined(nonceSignature, 'Nonce signature is required');\n\n const signature = `${signedSessionId}/${nonceSignature}/${nonce}`;\n\n return { signature };\n};\n"],"mappings":";;;;;AAWA,MAAa,qCAAqC,OAChD,EAAE,aACF,WACgC;AAMhC,KAAI,CALwB,MAAM,uBAChC,EAAE,WAAW,EACb,OACD,CAGC;AAGF,QAAOA,0BAAgB,OAAO;;;;;;ACfhC,MAAa,yBAAyB,OACpC,EAAE,SACF,WACG;CACH,MAAM,OAAO,QAAQ,OAAO;AAE5B,eAAc,KAAK,UAAU,iCAAiC;AAI9D,QAAO,EAAE,WAFS,MAAM,KAAK,SAAS,KAAK,WAAW,MAAM,EAExC;;;;;;ACXtB,MAAa,2BAA2B,OACtC,EAAE,aACF,WACG;AAKH,QAAO,EAAE,WAFS,MAFL,QAAQ,OAAO,CAEC,SAAS,KAAK,WAAW,UAAU,EAE5C;;;;;;ACRtB,MAAa,qBAAqB,OAAO,WAA0B;CAGjE,MAAM,YAFO,QAAQ,OAAO,CAEL,MAAM,KAAK,CAAC,MAAM;AACzC,eAAc,WAAW,yBAAyB;CAElD,MAAM,EAAE,WAAW,oBAAoB,MAAM,yBAC3C,EACE,WACD,EACD,OACD;AAED,eAAc,iBAAiB,gCAAgC;CAE/D,MAAM,QAAQ,MAAM,SAAS,OAAO;CAEpC,MAAM,EAAE,WAAW,mBAAmB,MAAM,uBAC1C,EACE,OACD,EACD,OACD;AAED,eAAc,gBAAgB,8BAA8B;AAI5D,QAAO,EAAE,WAFS,GAAG,gBAAgB,GAAG,eAAe,GAAG,SAEtC"}
|