@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
package/dist/index.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as extractSessionId, B as name, C as isCookieEnabled, D as instrumentFunction, E as __getElevatedAccessToken_wrapped, F as getDefaultClient, I as setDefaultClient, O as DEFAULT_PII_FIELDS, P as NONCE_POOL_SIZE, R as BaseError, T as ValueMustBeDefinedError, V as version, _ as MfaRateLimitedError, a as DYNAMIC_ICONIC_SPRITE_URL, b as InvalidExternalAuthError, c as CHAINS_INFO_MAP, d as UnauthorizedError, g as SandboxMaximumThresholdReachedError, h as
|
|
2
|
-
import { A as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, B as
|
|
3
|
-
import { A as
|
|
4
|
-
import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-
|
|
5
|
-
import { n as
|
|
1
|
+
import { A as extractSessionId, B as name, C as isCookieEnabled, D as instrumentFunction, E as __getElevatedAccessToken_wrapped, F as getDefaultClient, I as setDefaultClient, O as DEFAULT_PII_FIELDS, P as NONCE_POOL_SIZE, R as BaseError, T as ValueMustBeDefinedError, V as version, _ as MfaRateLimitedError, a as DYNAMIC_ICONIC_SPRITE_URL, b as InvalidExternalAuthError, c as CHAINS_INFO_MAP, d as UnauthorizedError, g as SandboxMaximumThresholdReachedError, h as getNonce, j as randomString, k as getUserAgent, l as fetchAndStoreNonces, o as SDK_API_CORE_VERSION, s as getChainFromVerifiedCredentialChain, t as InvalidParamError, u as createApiClient, v as MfaInvalidOtpError, w as assertDefined, x as APIError, y as LinkCredentialError, z as getCore } from "./InvalidParamError-De4xrOs4.esm.js";
|
|
2
|
+
import { A as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, B as createLocalStorageAdapter, C as createCrossTabBroadcast, D as FETCH_PROJECT_SETTINGS_TRACKER_KEY, E as createDeferredPromise, F as generateSessionKeys, H as retryOnFail, I as fetchProjectSettings, L as createStorageKeySchema, M as isServerSideRendering, N as getBuffer, O as GENERATE_SESSION_KEYS_TRACKER_KEY, P as __logoutWithReason_wrapped, R as createStorage, S as createLogger, T as CannotTrackError, U as subscribeWithSelector, V as isSignedIn, W as isEqualShallow, _ as WalletAlreadyLinkedToAnotherUserError, a as updateWalletProviderKeysForVerifiedCredentials, b as createRealtimeService, c as createSignInMessageStatement, d as createVisit, f as hasExtension, g as isCaptchaRequired, h as consumeCaptchaToken, i as getNetworksData, j as REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY, k as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, l as formatSignInMessage, m as __setCaptchaToken_wrapped, o as verifyMessageSignatureOwnership, p as createRealtimeChannelSchema, s as removeUnverifiedWalletAccount, t as getNetworkProviderFromNetworkId, u as setUnverifiedWalletAccounts, v as NoNetworkProvidersError, x as createKeychainService, y as getKeychainIndexedDBName } from "./getNetworkProviderFromNetworkId-Cqzo1MhF.esm.js";
|
|
3
|
+
import { A as onceEvent, C as formatWalletAccountId, D as emitEvent, O as offEvent, T as splitWalletProviderKey, a as parseElevatedAccessToken, b as getWalletAccounts, d as isUserMissingMfaAuth, f as checkAndRaiseWalletAccountsChangedEvent, h as getWalletProviderFromWalletAccount, i as upsertElevatedAccessToken, k as onEvent, n as getWalletProviderByKey, o as restoreUserSharesForAllWalletAccounts, p as emitWalletAccountsChangedEvent, r as updateAuthFromVerifyResponse, t as getVerifiedCredentialForWalletAccount, u as getWalletProviders, w as normalizeAddress, y as NoWalletProviderFoundError } from "./getVerifiedCredentialForWalletAccount-DqXnLSqq.esm.js";
|
|
4
|
+
import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-CdAul2Xh.esm.js";
|
|
5
|
+
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-CPlDnHuj.esm.js";
|
|
6
6
|
import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
|
|
7
7
|
import { AuthModeEnum, ExchangeKeyEnum, JwtVerifiedCredentialFormatEnum, MFAAction, MfaBackupCodeAcknowledgement, ProviderEnum, TokenScope, WaasBackupOptionsEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
8
8
|
import * as z from "zod/mini";
|
|
@@ -82,7 +82,7 @@ const setLongTimeout = ({ callback, delay }) => {
|
|
|
82
82
|
const initializeAuth = (client) => {
|
|
83
83
|
const core = getCore(client);
|
|
84
84
|
let clearExpirationTimeout = null;
|
|
85
|
-
const onChangeExpiration =
|
|
85
|
+
const onChangeExpiration = subscribeWithSelector(core.state, (state) => state.sessionExpiresAt);
|
|
86
86
|
const checkExpiration = () => {
|
|
87
87
|
const expiration = core.state.get().sessionExpiresAt;
|
|
88
88
|
clearExpirationTimeout?.();
|
|
@@ -155,7 +155,7 @@ const walletProviderKeyMapSchema = z.record(z.string(), z.string());
|
|
|
155
155
|
|
|
156
156
|
//#endregion
|
|
157
157
|
//#region src/modules/storageSync/schema.ts
|
|
158
|
-
const stateStorageKeySchema =
|
|
158
|
+
const stateStorageKeySchema = createStorageKeySchema({
|
|
159
159
|
key: "state",
|
|
160
160
|
schema: z.object({
|
|
161
161
|
apiVersion: z.string(),
|
|
@@ -167,7 +167,7 @@ const stateStorageKeySchema = __createStorageKeySchema_wrapped({
|
|
|
167
167
|
walletProviderKeyMap: walletProviderKeyMapSchema
|
|
168
168
|
})
|
|
169
169
|
});
|
|
170
|
-
const sessionStorageKeySchema =
|
|
170
|
+
const sessionStorageKeySchema = createStorageKeySchema({
|
|
171
171
|
config: { storageTier: "secure" },
|
|
172
172
|
key: "session",
|
|
173
173
|
schema: z.object({
|
|
@@ -362,7 +362,7 @@ const initializeStorageSync = async (client) => {
|
|
|
362
362
|
*/
|
|
363
363
|
const refreshUser = async (client = getDefaultClient()) => {
|
|
364
364
|
const core = getCore(client);
|
|
365
|
-
const apiClient =
|
|
365
|
+
const apiClient = createApiClient({}, client);
|
|
366
366
|
const previousState = { ...core.state.get() };
|
|
367
367
|
const user = await apiClient.getAuthenticatedUser({ environmentId: core.environmentId });
|
|
368
368
|
core.state.set({ user });
|
|
@@ -430,7 +430,7 @@ const initializeClient = async (client = getDefaultClient()) => {
|
|
|
430
430
|
}).catch(() => __logoutWithReason_wrapped({ reason: "keychain-migration-failed" }, client));
|
|
431
431
|
if (core.state.get().sessionKeys && !await core.keychain.hasKey("session")) await __logoutWithReason_wrapped({ reason: "keychain-key-missing" }, client);
|
|
432
432
|
}).then(async () => {
|
|
433
|
-
if (!core.state.get().projectSettings) await
|
|
433
|
+
if (!core.state.get().projectSettings) await fetchProjectSettings(client);
|
|
434
434
|
});
|
|
435
435
|
fetchProjectSettingsPromise.then(() => prefetchNoncesIfNeeded(client)).catch((error) => {
|
|
436
436
|
core.logger.error("Failed to prefetch nonces:", error);
|
|
@@ -439,7 +439,7 @@ const initializeClient = async (client = getDefaultClient()) => {
|
|
|
439
439
|
* Generate session keys if they don't exist
|
|
440
440
|
*/
|
|
441
441
|
const generateSessionKeysPromise = fetchProjectSettingsPromise.then(async () => {
|
|
442
|
-
if (!core.state.get().sessionKeys) await
|
|
442
|
+
if (!core.state.get().sessionKeys) await generateSessionKeys(client);
|
|
443
443
|
});
|
|
444
444
|
/**
|
|
445
445
|
* Refresh user state on initialization when cookie is enabled.
|
|
@@ -536,7 +536,7 @@ const createAsyncTrack = () => {
|
|
|
536
536
|
*/
|
|
537
537
|
let isTrackEnabled = true;
|
|
538
538
|
const eventEmitter = new EventEmitter$1();
|
|
539
|
-
const allSettledPromise =
|
|
539
|
+
const allSettledPromise = createDeferredPromise();
|
|
540
540
|
const tracker = /* @__PURE__ */ new Map();
|
|
541
541
|
/**
|
|
542
542
|
* Checks if all processes are initialized and resolves the main promise if they are.
|
|
@@ -788,7 +788,7 @@ const createPasskeyService = (_params) => ({
|
|
|
788
788
|
const createDebouncedMutex = () => {
|
|
789
789
|
const mutexState = /* @__PURE__ */ new Map();
|
|
790
790
|
return async ({ lockKey, callback, debounceTime = 0 }) => {
|
|
791
|
-
const resolutionPromise =
|
|
791
|
+
const resolutionPromise = createDeferredPromise();
|
|
792
792
|
if (!mutexState.has(lockKey)) mutexState.set(lockKey, {
|
|
793
793
|
nextCallback: null,
|
|
794
794
|
queuePromise: Promise.resolve(),
|
|
@@ -940,10 +940,10 @@ const getInitialState = () => ({
|
|
|
940
940
|
*/
|
|
941
941
|
const createCore = (config) => {
|
|
942
942
|
const apiBaseUrl = config.coreConfig?.apiBaseUrl ?? DEFAULT_API_BASE_URL;
|
|
943
|
-
const logger = config.coreConfig?.logger ??
|
|
944
|
-
const storage =
|
|
943
|
+
const logger = config.coreConfig?.logger ?? createLogger({ level: config.logLevel });
|
|
944
|
+
const storage = createStorage({
|
|
945
945
|
prefix: `dynamic_${config.environmentId}`,
|
|
946
|
-
storageAdapter: config.coreConfig?.storageAdapter ??
|
|
946
|
+
storageAdapter: config.coreConfig?.storageAdapter ?? createLocalStorageAdapter()
|
|
947
947
|
});
|
|
948
948
|
const fetch = config.coreConfig?.fetch ?? createWebFetch();
|
|
949
949
|
const openDeeplink = config.coreConfig?.openDeeplink ?? createWebDeeplinkOpener();
|
|
@@ -974,12 +974,12 @@ const createCore = (config) => {
|
|
|
974
974
|
universalLink: config.metadata?.universalLink ?? (isServerSideRendering() ? void 0 : window.location.origin)
|
|
975
975
|
};
|
|
976
976
|
const passkey = config.coreConfig?.passkey ?? createPasskeyService({ metadata });
|
|
977
|
-
const realtime = config.coreConfig?.realtime ??
|
|
977
|
+
const realtime = config.coreConfig?.realtime ?? createRealtimeService();
|
|
978
978
|
const deviceSigner = config.coreConfig?.deviceSigner;
|
|
979
979
|
const keychain = config.coreConfig?.keychain ?? createKeychainService({ dbName: getKeychainIndexedDBName({ environmentId: config.environmentId }) });
|
|
980
980
|
return {
|
|
981
981
|
apiBaseUrl,
|
|
982
|
-
crossTabBroadcast: config.coreConfig?.crossTabBroadcast ??
|
|
982
|
+
crossTabBroadcast: config.coreConfig?.crossTabBroadcast ?? createCrossTabBroadcast({ channelName: `dynamic_${config.environmentId}_broadcast` }),
|
|
983
983
|
debouncedMutex,
|
|
984
984
|
deviceSigner,
|
|
985
985
|
environmentId: config.environmentId,
|
|
@@ -1469,7 +1469,7 @@ const checkStepUpAuth = async ({ scope }, client = getDefaultClient()) => {
|
|
|
1469
1469
|
};
|
|
1470
1470
|
try {
|
|
1471
1471
|
const core = getCore(client);
|
|
1472
|
-
const response = await
|
|
1472
|
+
const response = await createApiClient({}, client).stepUpCheck({
|
|
1473
1473
|
environmentId: core.environmentId,
|
|
1474
1474
|
stepUpCheckRequest: { scope }
|
|
1475
1475
|
});
|
|
@@ -1514,7 +1514,7 @@ const __checkStepUpAuth_wrapped = instrumentFunction({
|
|
|
1514
1514
|
*/
|
|
1515
1515
|
const requestExternalAuthElevatedToken = async ({ externalJwt }, client = getDefaultClient()) => {
|
|
1516
1516
|
const core = getCore(client);
|
|
1517
|
-
const response = await
|
|
1517
|
+
const response = await createApiClient({}, client).externalAuthVerify({
|
|
1518
1518
|
environmentId: core.environmentId,
|
|
1519
1519
|
externalAuthSigninRequest: { jwt: externalJwt }
|
|
1520
1520
|
});
|
|
@@ -1557,14 +1557,14 @@ const __requestExternalAuthElevatedToken_wrapped = instrumentFunction({
|
|
|
1557
1557
|
*/
|
|
1558
1558
|
const signInWithExternalJwt = async ({ externalJwt, sessionPublicKey } = {}, client = getDefaultClient()) => {
|
|
1559
1559
|
const core = getCore(client);
|
|
1560
|
-
const response = await
|
|
1560
|
+
const response = await createApiClient({}, client).externalAuthSignin({
|
|
1561
1561
|
environmentId: core.environmentId,
|
|
1562
1562
|
externalAuthSigninRequest: {
|
|
1563
1563
|
jwt: externalJwt,
|
|
1564
1564
|
sessionPublicKey
|
|
1565
1565
|
}
|
|
1566
1566
|
});
|
|
1567
|
-
|
|
1567
|
+
updateAuthFromVerifyResponse({ response }, client);
|
|
1568
1568
|
return response;
|
|
1569
1569
|
};
|
|
1570
1570
|
const __signInWithExternalJwt_impl = signInWithExternalJwt;
|
|
@@ -1612,7 +1612,7 @@ const logout = async (client = getDefaultClient()) => {
|
|
|
1612
1612
|
*/
|
|
1613
1613
|
const deletePasskey = async ({ passkeyId }, client = getDefaultClient()) => {
|
|
1614
1614
|
const core = getCore(client);
|
|
1615
|
-
await
|
|
1615
|
+
await createApiClient({
|
|
1616
1616
|
elevatedAccessTokenScope: TokenScope.Credentialunlink,
|
|
1617
1617
|
includeMfaToken: true
|
|
1618
1618
|
}, client).deletePasskey({
|
|
@@ -1643,31 +1643,19 @@ const __deletePasskey_wrapped = instrumentFunction({
|
|
|
1643
1643
|
*
|
|
1644
1644
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1645
1645
|
* @returns A promise that resolves to an array of the user's registered passkeys.
|
|
1646
|
-
* @instrumented
|
|
1646
|
+
* @not-instrumented
|
|
1647
1647
|
*/
|
|
1648
1648
|
const getPasskeys = async (client = getDefaultClient()) => {
|
|
1649
1649
|
const core = getCore(client);
|
|
1650
|
-
return (await
|
|
1650
|
+
return (await createApiClient({}, client).getUserPasskeys({ environmentId: core.environmentId })).passkeys;
|
|
1651
1651
|
};
|
|
1652
|
-
const __getPasskeys_impl = getPasskeys;
|
|
1653
|
-
const __getPasskeys_wrapped = instrumentFunction({
|
|
1654
|
-
fn: __getPasskeys_impl,
|
|
1655
|
-
functionName: "getPasskeys",
|
|
1656
|
-
getCore: () => {
|
|
1657
|
-
try {
|
|
1658
|
-
return getCore(getDefaultClient());
|
|
1659
|
-
} catch {
|
|
1660
|
-
return;
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
});
|
|
1664
1652
|
|
|
1665
1653
|
//#endregion
|
|
1666
1654
|
//#region src/modules/auth/passkeys/getPasskeyRegistrationOptions/getPasskeyRegistrationOptions.ts
|
|
1667
1655
|
/** @not-instrumented */
|
|
1668
1656
|
const getPasskeyRegistrationOptions = async (client) => {
|
|
1669
1657
|
const core = getCore(client);
|
|
1670
|
-
return await
|
|
1658
|
+
return await createApiClient({}, client).getPasskeyRegistrationOptions({ environmentId: core.environmentId });
|
|
1671
1659
|
};
|
|
1672
1660
|
|
|
1673
1661
|
//#endregion
|
|
@@ -1675,7 +1663,7 @@ const getPasskeyRegistrationOptions = async (client) => {
|
|
|
1675
1663
|
/** @not-instrumented */
|
|
1676
1664
|
const serverRegisterPasskey = async ({ registration, createMfaToken }, client) => {
|
|
1677
1665
|
const core = getCore(client);
|
|
1678
|
-
return await
|
|
1666
|
+
return await createApiClient({ elevatedAccessTokenScope: TokenScope.Credentiallink }, client).registerPasskey({
|
|
1679
1667
|
environmentId: core.environmentId,
|
|
1680
1668
|
passkeyRegisterRequest: {
|
|
1681
1669
|
...registration,
|
|
@@ -1711,7 +1699,7 @@ const registerPasskey = async ({ createMfaToken } = {}, client = getDefaultClien
|
|
|
1711
1699
|
createMfaToken,
|
|
1712
1700
|
registration: await core.passkey.register({ optionsJSON: options })
|
|
1713
1701
|
}, client);
|
|
1714
|
-
|
|
1702
|
+
updateAuthFromVerifyResponse({ response }, client);
|
|
1715
1703
|
return response;
|
|
1716
1704
|
};
|
|
1717
1705
|
const __registerPasskey_impl = registerPasskey;
|
|
@@ -1732,7 +1720,7 @@ const __registerPasskey_wrapped = instrumentFunction({
|
|
|
1732
1720
|
/** @not-instrumented */
|
|
1733
1721
|
const getPasskeyAuthenticationSignInOptions = async ({ relatedOriginRpId } = {}, client) => {
|
|
1734
1722
|
const core = getCore(client);
|
|
1735
|
-
return await
|
|
1723
|
+
return await createApiClient({}, client).getPasskeyAuthenticationSigninOptions({
|
|
1736
1724
|
environmentId: core.environmentId,
|
|
1737
1725
|
relatedOriginRpId
|
|
1738
1726
|
});
|
|
@@ -1743,7 +1731,7 @@ const getPasskeyAuthenticationSignInOptions = async ({ relatedOriginRpId } = {},
|
|
|
1743
1731
|
/** @not-instrumented */
|
|
1744
1732
|
const serverSigninPasskey = async ({ authentication, createMfaToken }, client) => {
|
|
1745
1733
|
const core = getCore(client);
|
|
1746
|
-
return await
|
|
1734
|
+
return await createApiClient({}, client).signinWithPasskey({
|
|
1747
1735
|
environmentId: core.environmentId,
|
|
1748
1736
|
passkeyAuthRequest: {
|
|
1749
1737
|
...authentication,
|
|
@@ -1775,7 +1763,7 @@ const signInWithPasskey = async ({ relatedOriginRpId } = {}, client = getDefault
|
|
|
1775
1763
|
if (!core.passkey.isSupported()) throw new NoWebAuthNSupportError();
|
|
1776
1764
|
const formattedOptions = { ...await getPasskeyAuthenticationSignInOptions({ relatedOriginRpId }, client) };
|
|
1777
1765
|
const response = await serverSigninPasskey({ authentication: await core.passkey.authenticate({ optionsJSON: formattedOptions }) }, client);
|
|
1778
|
-
|
|
1766
|
+
updateAuthFromVerifyResponse({ response }, client);
|
|
1779
1767
|
return response;
|
|
1780
1768
|
};
|
|
1781
1769
|
const __signInWithPasskey_impl = signInWithPasskey;
|
|
@@ -1798,7 +1786,7 @@ const __signInWithPasskey_wrapped = instrumentFunction({
|
|
|
1798
1786
|
*
|
|
1799
1787
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1800
1788
|
* @returns An array of `SocialAccount` objects associated with the user.
|
|
1801
|
-
* @instrumented
|
|
1789
|
+
* @not-instrumented
|
|
1802
1790
|
*/
|
|
1803
1791
|
const getUserSocialAccounts = (client = getDefaultClient()) => {
|
|
1804
1792
|
const { user } = client;
|
|
@@ -1813,18 +1801,6 @@ const getUserSocialAccounts = (client = getDefaultClient()) => {
|
|
|
1813
1801
|
verifiedCredentialId: credential.id
|
|
1814
1802
|
}));
|
|
1815
1803
|
};
|
|
1816
|
-
const __getUserSocialAccounts_impl = getUserSocialAccounts;
|
|
1817
|
-
const __getUserSocialAccounts_wrapped = instrumentFunction({
|
|
1818
|
-
fn: __getUserSocialAccounts_impl,
|
|
1819
|
-
functionName: "getUserSocialAccounts",
|
|
1820
|
-
getCore: () => {
|
|
1821
|
-
try {
|
|
1822
|
-
return getCore(getDefaultClient());
|
|
1823
|
-
} catch {
|
|
1824
|
-
return;
|
|
1825
|
-
}
|
|
1826
|
-
}
|
|
1827
|
-
});
|
|
1828
1804
|
|
|
1829
1805
|
//#endregion
|
|
1830
1806
|
//#region src/modules/auth/social/removeDynamicOauthParamsFromUrl/removeDynamicOauthParamsFromUrl.ts
|
|
@@ -1839,7 +1815,7 @@ const removeDynamicOauthParamsFromUrl = (url) => {
|
|
|
1839
1815
|
//#endregion
|
|
1840
1816
|
//#region src/modules/auth/social/oauth/redirectStateStorageSchema/redirectStateStorageSchema.ts
|
|
1841
1817
|
/** The schema to track the state of the OAuth flow. */
|
|
1842
|
-
const redirectStateStorageKeySchema =
|
|
1818
|
+
const redirectStateStorageKeySchema = createStorageKeySchema({
|
|
1843
1819
|
key: "redirectState",
|
|
1844
1820
|
schema: z.object({
|
|
1845
1821
|
codeVerifier: z.optional(z.string()),
|
|
@@ -1974,7 +1950,7 @@ const buildOAuthUrl = async (core, provider) => {
|
|
|
1974
1950
|
*/
|
|
1975
1951
|
const signInWithSocialRedirect = async ({ provider, redirectUrl }, client = getDefaultClient()) => {
|
|
1976
1952
|
const core = getCore(client);
|
|
1977
|
-
const apiClient =
|
|
1953
|
+
const apiClient = createApiClient({}, client);
|
|
1978
1954
|
await core.initTrack.waitForAll();
|
|
1979
1955
|
const providerType = provider;
|
|
1980
1956
|
const { url, state, codeVerifier } = await buildOAuthUrl(core, providerType);
|
|
@@ -2018,7 +1994,7 @@ const __signInWithSocialRedirect_wrapped = instrumentFunction({
|
|
|
2018
1994
|
* @param params.url - The URL to check for OAuth redirect parameters.
|
|
2019
1995
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2020
1996
|
* @returns A promise that resolves to true if the URL is an OAuth redirect, false otherwise.
|
|
2021
|
-
* @instrumented
|
|
1997
|
+
* @not-instrumented
|
|
2022
1998
|
*/
|
|
2023
1999
|
const detectSocialRedirectUrl = async ({ url }, client = getDefaultClient()) => {
|
|
2024
2000
|
const core = getCore(client);
|
|
@@ -2028,18 +2004,6 @@ const detectSocialRedirectUrl = async ({ url }, client = getDefaultClient()) =>
|
|
|
2028
2004
|
await core.initTrack.waitForAll();
|
|
2029
2005
|
return (await core.storage.getItem(redirectStateStorageKeySchema))?.state === dynamicOauthState;
|
|
2030
2006
|
};
|
|
2031
|
-
const __detectSocialRedirectUrl_impl = detectSocialRedirectUrl;
|
|
2032
|
-
const __detectSocialRedirectUrl_wrapped = instrumentFunction({
|
|
2033
|
-
fn: __detectSocialRedirectUrl_impl,
|
|
2034
|
-
functionName: "detectSocialRedirectUrl",
|
|
2035
|
-
getCore: () => {
|
|
2036
|
-
try {
|
|
2037
|
-
return getCore(getDefaultClient());
|
|
2038
|
-
} catch {
|
|
2039
|
-
return;
|
|
2040
|
-
}
|
|
2041
|
-
}
|
|
2042
|
-
});
|
|
2043
2007
|
|
|
2044
2008
|
//#endregion
|
|
2045
2009
|
//#region src/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.ts
|
|
@@ -2060,7 +2024,7 @@ const __detectSocialRedirectUrl_wrapped = instrumentFunction({
|
|
|
2060
2024
|
*/
|
|
2061
2025
|
const completeSocialRedirect = async ({ url, requestedScopes }, client = getDefaultClient()) => {
|
|
2062
2026
|
const core = getCore(client);
|
|
2063
|
-
const apiClient =
|
|
2027
|
+
const apiClient = createApiClient({}, client);
|
|
2064
2028
|
await core.initTrack.waitForAll();
|
|
2065
2029
|
const dynamicOauthState = url.searchParams.get("dynamicOauthState");
|
|
2066
2030
|
const dynamicOauthCode = url.searchParams.get("dynamicOauthCode");
|
|
@@ -2085,14 +2049,14 @@ const completeSocialRedirect = async ({ url, requestedScopes }, client = getDefa
|
|
|
2085
2049
|
else response = await apiClient.oauthSignIn({
|
|
2086
2050
|
environmentId: core.environmentId,
|
|
2087
2051
|
oauthRequest: {
|
|
2088
|
-
captchaToken:
|
|
2052
|
+
captchaToken: consumeCaptchaToken(client),
|
|
2089
2053
|
code: dynamicOauthCode,
|
|
2090
2054
|
codeVerifier,
|
|
2091
2055
|
state: dynamicOauthState
|
|
2092
2056
|
},
|
|
2093
2057
|
providerType: provider
|
|
2094
2058
|
});
|
|
2095
|
-
|
|
2059
|
+
updateAuthFromVerifyResponse({ response }, client);
|
|
2096
2060
|
return response.user;
|
|
2097
2061
|
};
|
|
2098
2062
|
const __completeSocialRedirect_impl = completeSocialRedirect;
|
|
@@ -2158,21 +2122,9 @@ const __completeSocialAuthentication_wrapped = instrumentFunction({
|
|
|
2158
2122
|
* @deprecated Renamed to {@link detectSocialRedirectUrl}. This alias will be
|
|
2159
2123
|
* removed in a future major version.
|
|
2160
2124
|
*
|
|
2161
|
-
* @instrumented
|
|
2125
|
+
* @not-instrumented
|
|
2162
2126
|
*/
|
|
2163
|
-
const detectOAuthRedirect = (params, client = getDefaultClient()) =>
|
|
2164
|
-
const __detectOAuthRedirect_impl = detectOAuthRedirect;
|
|
2165
|
-
const __detectOAuthRedirect_wrapped = instrumentFunction({
|
|
2166
|
-
fn: __detectOAuthRedirect_impl,
|
|
2167
|
-
functionName: "detectOAuthRedirect",
|
|
2168
|
-
getCore: () => {
|
|
2169
|
-
try {
|
|
2170
|
-
return getCore(getDefaultClient());
|
|
2171
|
-
} catch {
|
|
2172
|
-
return;
|
|
2173
|
-
}
|
|
2174
|
-
}
|
|
2175
|
-
});
|
|
2127
|
+
const detectOAuthRedirect = (params, client = getDefaultClient()) => detectSocialRedirectUrl(params, client);
|
|
2176
2128
|
|
|
2177
2129
|
//#endregion
|
|
2178
2130
|
//#region src/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.ts
|
|
@@ -2181,26 +2133,14 @@ const __detectOAuthRedirect_wrapped = instrumentFunction({
|
|
|
2181
2133
|
* The primary wallet account is the one that was last selected by the user.
|
|
2182
2134
|
* This information is stored in both unverified and verified wallet accounts.
|
|
2183
2135
|
* This function consolidates this information to determine which wallet was most recently selected.
|
|
2184
|
-
* @instrumented
|
|
2136
|
+
* @not-instrumented
|
|
2185
2137
|
*/
|
|
2186
2138
|
const getPrimaryWalletAccount = (client = getDefaultClient()) => {
|
|
2187
|
-
const sortedLastSelectedWalletAccounts =
|
|
2139
|
+
const sortedLastSelectedWalletAccounts = getWalletAccounts(client).filter((walletAccount) => Boolean(walletAccount.lastSelectedAt)).sort((a, b) => b.lastSelectedAt.getTime() - a.lastSelectedAt.getTime());
|
|
2188
2140
|
if (sortedLastSelectedWalletAccounts.length === 0) return null;
|
|
2189
2141
|
const [primaryWalletAccount] = sortedLastSelectedWalletAccounts;
|
|
2190
2142
|
return primaryWalletAccount;
|
|
2191
2143
|
};
|
|
2192
|
-
const __getPrimaryWalletAccount_impl = getPrimaryWalletAccount;
|
|
2193
|
-
const __getPrimaryWalletAccount_wrapped = instrumentFunction({
|
|
2194
|
-
fn: __getPrimaryWalletAccount_impl,
|
|
2195
|
-
functionName: "getPrimaryWalletAccount",
|
|
2196
|
-
getCore: () => {
|
|
2197
|
-
try {
|
|
2198
|
-
return getCore(getDefaultClient());
|
|
2199
|
-
} catch {
|
|
2200
|
-
return;
|
|
2201
|
-
}
|
|
2202
|
-
}
|
|
2203
|
-
});
|
|
2204
2144
|
|
|
2205
2145
|
//#endregion
|
|
2206
2146
|
//#region src/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.ts
|
|
@@ -2214,8 +2154,8 @@ const __getPrimaryWalletAccount_wrapped = instrumentFunction({
|
|
|
2214
2154
|
*/
|
|
2215
2155
|
const unlinkSocialAccount = async ({ verifiedCredentialId }, client = getDefaultClient()) => {
|
|
2216
2156
|
const core = getCore(client);
|
|
2217
|
-
const apiClient =
|
|
2218
|
-
const walletId =
|
|
2157
|
+
const apiClient = createApiClient({}, client);
|
|
2158
|
+
const walletId = getPrimaryWalletAccount(client)?.verifiedCredentialId?.replace("-zerodev", "");
|
|
2219
2159
|
const response = await apiClient.verifyUnlink({
|
|
2220
2160
|
environmentId: core.environmentId,
|
|
2221
2161
|
verifyUnlinkRequest: {
|
|
@@ -2223,7 +2163,7 @@ const unlinkSocialAccount = async ({ verifiedCredentialId }, client = getDefault
|
|
|
2223
2163
|
walletId: walletId ?? void 0
|
|
2224
2164
|
}
|
|
2225
2165
|
});
|
|
2226
|
-
|
|
2166
|
+
updateAuthFromVerifyResponse({ response }, client);
|
|
2227
2167
|
return response;
|
|
2228
2168
|
};
|
|
2229
2169
|
const __unlinkSocialAccount_impl = unlinkSocialAccount;
|
|
@@ -2253,9 +2193,9 @@ const __unlinkSocialAccount_wrapped = instrumentFunction({
|
|
|
2253
2193
|
*/
|
|
2254
2194
|
const getBalances = async ({ walletAccount, networkId, includePrices, includeNative, filterSpamTokens, whitelistedContracts, forceRefresh }, client = getDefaultClient()) => {
|
|
2255
2195
|
const core = getCore(client);
|
|
2256
|
-
const apiClient =
|
|
2196
|
+
const apiClient = createApiClient({}, client);
|
|
2257
2197
|
if (!networkId) {
|
|
2258
|
-
const activeNetworkId = await
|
|
2198
|
+
const activeNetworkId = await getWalletProviderFromWalletAccount({ walletAccount }, client).getActiveNetworkId();
|
|
2259
2199
|
networkId = Number(activeNetworkId.networkId);
|
|
2260
2200
|
}
|
|
2261
2201
|
return await apiClient.getAccountBalances({
|
|
@@ -2270,18 +2210,6 @@ const getBalances = async ({ walletAccount, networkId, includePrices, includeNat
|
|
|
2270
2210
|
whitelistedContracts
|
|
2271
2211
|
});
|
|
2272
2212
|
};
|
|
2273
|
-
const __getBalances_impl = getBalances;
|
|
2274
|
-
const __getBalances_wrapped = instrumentFunction({
|
|
2275
|
-
fn: __getBalances_impl,
|
|
2276
|
-
functionName: "getBalances",
|
|
2277
|
-
getCore: () => {
|
|
2278
|
-
try {
|
|
2279
|
-
return getCore(getDefaultClient());
|
|
2280
|
-
} catch {
|
|
2281
|
-
return;
|
|
2282
|
-
}
|
|
2283
|
-
}
|
|
2284
|
-
});
|
|
2285
2213
|
|
|
2286
2214
|
//#endregion
|
|
2287
2215
|
//#region src/modules/balances/getMultichainBalances/getMultichainBalances.ts
|
|
@@ -2294,33 +2222,21 @@ const __getBalances_wrapped = instrumentFunction({
|
|
|
2294
2222
|
* @param params.balanceRequest - The balance request configuration specifying which chains, networks and addresses to query.
|
|
2295
2223
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2296
2224
|
* @returns A promise that resolves to the chain balances across multiple networks.
|
|
2297
|
-
* @instrumented
|
|
2225
|
+
* @not-instrumented
|
|
2298
2226
|
*/
|
|
2299
2227
|
const getMultichainBalances = async ({ balanceRequest }, client = getDefaultClient()) => {
|
|
2300
2228
|
const core = getCore(client);
|
|
2301
|
-
return (await
|
|
2229
|
+
return (await createApiClient({}, client).postMultichainAccountBalances({
|
|
2302
2230
|
environmentId: core.environmentId,
|
|
2303
2231
|
multichainAccountBalancesRequest: balanceRequest
|
|
2304
2232
|
})).chainBalances;
|
|
2305
2233
|
};
|
|
2306
|
-
const __getMultichainBalances_impl = getMultichainBalances;
|
|
2307
|
-
const __getMultichainBalances_wrapped = instrumentFunction({
|
|
2308
|
-
fn: __getMultichainBalances_impl,
|
|
2309
|
-
functionName: "getMultichainBalances",
|
|
2310
|
-
getCore: () => {
|
|
2311
|
-
try {
|
|
2312
|
-
return getCore(getDefaultClient());
|
|
2313
|
-
} catch {
|
|
2314
|
-
return;
|
|
2315
|
-
}
|
|
2316
|
-
}
|
|
2317
|
-
});
|
|
2318
2234
|
|
|
2319
2235
|
//#endregion
|
|
2320
2236
|
//#region src/modules/checkout/utils/createCheckoutSessionTokenStorageKey/createCheckoutSessionTokenStorageKey.ts
|
|
2321
2237
|
/** @not-instrumented */
|
|
2322
2238
|
const createCheckoutSessionTokenStorageKey = (transactionId) => {
|
|
2323
|
-
return
|
|
2239
|
+
return createStorageKeySchema({
|
|
2324
2240
|
key: `checkoutSessionToken:${transactionId}`,
|
|
2325
2241
|
schema: z.string()
|
|
2326
2242
|
});
|
|
@@ -2331,7 +2247,7 @@ const createCheckoutSessionTokenStorageKey = (transactionId) => {
|
|
|
2331
2247
|
/** @not-instrumented */
|
|
2332
2248
|
const createCheckoutApiClient = async ({ transactionId }, client) => {
|
|
2333
2249
|
const core = getCore(client);
|
|
2334
|
-
const apiClient =
|
|
2250
|
+
const apiClient = createApiClient({}, client);
|
|
2335
2251
|
const sessionToken = await core.storage.getItem(createCheckoutSessionTokenStorageKey(transactionId));
|
|
2336
2252
|
if (!sessionToken) throw new CheckoutSessionTokenMissingError({ transactionId });
|
|
2337
2253
|
return {
|
|
@@ -2482,7 +2398,7 @@ const checkoutTransactionEventSchema = z.object({
|
|
|
2482
2398
|
* Channel name follows the backend convention: `transaction:{transactionId}`.
|
|
2483
2399
|
* @not-instrumented
|
|
2484
2400
|
*/
|
|
2485
|
-
const createCheckoutTransactionChannelSchema = (transactionId) =>
|
|
2401
|
+
const createCheckoutTransactionChannelSchema = (transactionId) => createRealtimeChannelSchema({
|
|
2486
2402
|
channel: `transaction:${transactionId}`,
|
|
2487
2403
|
schema: checkoutTransactionEventSchema
|
|
2488
2404
|
});
|
|
@@ -2566,7 +2482,7 @@ const subscribeToCheckoutTransaction = async ({ transactionId }, client) => {
|
|
|
2566
2482
|
*/
|
|
2567
2483
|
const createCheckoutTransaction = async (params, client = getDefaultClient()) => {
|
|
2568
2484
|
const core = getCore(client);
|
|
2569
|
-
const apiClient =
|
|
2485
|
+
const apiClient = createApiClient({}, client);
|
|
2570
2486
|
const checkouts = await getCheckouts(client);
|
|
2571
2487
|
const checkoutId = params.checkoutId || checkouts?.[0]?.id;
|
|
2572
2488
|
assertDefined(checkoutId, "No checkout found. Please make sure you have a Checkout setup in the Dashboard.");
|
|
@@ -2611,27 +2527,15 @@ const __createCheckoutTransaction_wrapped = instrumentFunction({
|
|
|
2611
2527
|
* @param params GetCheckoutTransactionParams - The parameters for fetching the transaction.
|
|
2612
2528
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2613
2529
|
* @returns The checkout transaction
|
|
2614
|
-
* @instrumented
|
|
2530
|
+
* @not-instrumented
|
|
2615
2531
|
*/
|
|
2616
2532
|
const getCheckoutTransaction = async ({ transactionId }, client = getDefaultClient()) => {
|
|
2617
2533
|
const core = getCore(client);
|
|
2618
|
-
return
|
|
2534
|
+
return createApiClient({}, client).getCheckoutTransaction({
|
|
2619
2535
|
environmentId: core.environmentId,
|
|
2620
2536
|
transactionId
|
|
2621
2537
|
});
|
|
2622
2538
|
};
|
|
2623
|
-
const __getCheckoutTransaction_impl = getCheckoutTransaction;
|
|
2624
|
-
const __getCheckoutTransaction_wrapped = instrumentFunction({
|
|
2625
|
-
fn: __getCheckoutTransaction_impl,
|
|
2626
|
-
functionName: "getCheckoutTransaction",
|
|
2627
|
-
getCore: () => {
|
|
2628
|
-
try {
|
|
2629
|
-
return getCore(getDefaultClient());
|
|
2630
|
-
} catch {
|
|
2631
|
-
return;
|
|
2632
|
-
}
|
|
2633
|
-
}
|
|
2634
|
-
});
|
|
2635
2539
|
|
|
2636
2540
|
//#endregion
|
|
2637
2541
|
//#region src/modules/checkout/getCheckoutTransactionQuote/getCheckoutTransactionQuote.ts
|
|
@@ -2641,7 +2545,7 @@ const __getCheckoutTransaction_wrapped = instrumentFunction({
|
|
|
2641
2545
|
* @param params GetCheckoutTransactionQuoteParams - The quote parameters.
|
|
2642
2546
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2643
2547
|
* @returns The updated checkout transaction with quote data
|
|
2644
|
-
* @instrumented
|
|
2548
|
+
* @not-instrumented
|
|
2645
2549
|
*/
|
|
2646
2550
|
const getCheckoutTransactionQuote = async ({ fromTokenAddress, slippage, transactionId }, client = getDefaultClient()) => {
|
|
2647
2551
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
@@ -2655,18 +2559,6 @@ const getCheckoutTransactionQuote = async ({ fromTokenAddress, slippage, transac
|
|
|
2655
2559
|
xDynamicCheckoutSessionToken: sessionToken
|
|
2656
2560
|
});
|
|
2657
2561
|
};
|
|
2658
|
-
const __getCheckoutTransactionQuote_impl = getCheckoutTransactionQuote;
|
|
2659
|
-
const __getCheckoutTransactionQuote_wrapped = instrumentFunction({
|
|
2660
|
-
fn: __getCheckoutTransactionQuote_impl,
|
|
2661
|
-
functionName: "getCheckoutTransactionQuote",
|
|
2662
|
-
getCore: () => {
|
|
2663
|
-
try {
|
|
2664
|
-
return getCore(getDefaultClient());
|
|
2665
|
-
} catch {
|
|
2666
|
-
return;
|
|
2667
|
-
}
|
|
2668
|
-
}
|
|
2669
|
-
});
|
|
2670
2562
|
|
|
2671
2563
|
//#endregion
|
|
2672
2564
|
//#region src/modules/checkout/prepareCheckoutTransaction/prepareCheckoutTransaction.ts
|
|
@@ -2752,7 +2644,7 @@ const SWAP_SUPPORTED_CHAINS = [
|
|
|
2752
2644
|
*/
|
|
2753
2645
|
const executeSwapTransaction = async ({ walletAccount, signingPayload, onStepChange }, client = getDefaultClient()) => {
|
|
2754
2646
|
if (!SWAP_SUPPORTED_CHAINS.includes(walletAccount.chain)) throw new InvalidParamError(`Chain ${walletAccount.chain} is not supported for swap transactions`);
|
|
2755
|
-
const walletProvider =
|
|
2647
|
+
const walletProvider = getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
2756
2648
|
assertWalletProviderMethodDefined(walletProvider, "executeSwapTransaction");
|
|
2757
2649
|
const requiredNetworkId = signingPayload.chainId;
|
|
2758
2650
|
if (requiredNetworkId && walletProvider.switchActiveNetwork) {
|
|
@@ -2839,21 +2731,9 @@ const __submitCheckoutTransaction_wrapped = instrumentFunction({
|
|
|
2839
2731
|
*
|
|
2840
2732
|
* @param params.transactionId - The ID of the checkout transaction to track.
|
|
2841
2733
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2842
|
-
* @instrumented
|
|
2734
|
+
* @not-instrumented
|
|
2843
2735
|
*/
|
|
2844
2736
|
const trackCheckoutTransaction = ({ transactionId }, client = getDefaultClient()) => subscribeToCheckoutTransaction({ transactionId }, client);
|
|
2845
|
-
const __trackCheckoutTransaction_impl = trackCheckoutTransaction;
|
|
2846
|
-
const __trackCheckoutTransaction_wrapped = instrumentFunction({
|
|
2847
|
-
fn: __trackCheckoutTransaction_impl,
|
|
2848
|
-
functionName: "trackCheckoutTransaction",
|
|
2849
|
-
getCore: () => {
|
|
2850
|
-
try {
|
|
2851
|
-
return getCore(getDefaultClient());
|
|
2852
|
-
} catch {
|
|
2853
|
-
return;
|
|
2854
|
-
}
|
|
2855
|
-
}
|
|
2856
|
-
});
|
|
2857
2737
|
|
|
2858
2738
|
//#endregion
|
|
2859
2739
|
//#region src/modules/checkout/utils/requiresConversion/requiresConversion.ts
|
|
@@ -2869,7 +2749,7 @@ const __trackCheckoutTransaction_wrapped = instrumentFunction({
|
|
|
2869
2749
|
* @param params - The from token details and the checkout's settlement config.
|
|
2870
2750
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2871
2751
|
* @returns Whether a token conversion is required
|
|
2872
|
-
* @instrumented
|
|
2752
|
+
* @not-instrumented
|
|
2873
2753
|
*/
|
|
2874
2754
|
const requiresConversion = async ({ transaction }, client = getDefaultClient()) => {
|
|
2875
2755
|
if (!transaction.fromChainId || !transaction.fromChainName || !transaction.fromToken) throw new InvalidParamError("Transaction is missing source information. Make sure that attachCheckoutTransactionSource has been called before calling this function.");
|
|
@@ -2877,18 +2757,6 @@ const requiresConversion = async ({ transaction }, client = getDefaultClient())
|
|
|
2877
2757
|
assertDefined(checkout, "Could not find checkout associated with transaction.");
|
|
2878
2758
|
return !checkout.settlementConfig.settlements.some((settlement) => settlement.chainName === transaction.fromChainName && settlement.chainId === transaction.fromChainId && settlement.tokenAddress === transaction.fromToken);
|
|
2879
2759
|
};
|
|
2880
|
-
const __requiresConversion_impl = requiresConversion;
|
|
2881
|
-
const __requiresConversion_wrapped = instrumentFunction({
|
|
2882
|
-
fn: __requiresConversion_impl,
|
|
2883
|
-
functionName: "requiresConversion",
|
|
2884
|
-
getCore: () => {
|
|
2885
|
-
try {
|
|
2886
|
-
return getCore(getDefaultClient());
|
|
2887
|
-
} catch {
|
|
2888
|
-
return;
|
|
2889
|
-
}
|
|
2890
|
-
}
|
|
2891
|
-
});
|
|
2892
2760
|
|
|
2893
2761
|
//#endregion
|
|
2894
2762
|
//#region src/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.ts
|
|
@@ -2897,8 +2765,8 @@ const DEVICE_REGISTRATION_TOKEN_HEADER = "x-dynamic-device-registration-token";
|
|
|
2897
2765
|
const completeDeviceRegistration = async ({ deviceToken }, client = getDefaultClient()) => {
|
|
2898
2766
|
assertDefined(deviceToken, "deviceToken is required");
|
|
2899
2767
|
const core = getCore(client);
|
|
2900
|
-
const response = await
|
|
2901
|
-
|
|
2768
|
+
const response = await createApiClient({ headers: { [DEVICE_REGISTRATION_TOKEN_HEADER]: deviceToken } }, client).deviceRegistration({ environmentId: core.environmentId });
|
|
2769
|
+
updateAuthFromVerifyResponse({ response }, client);
|
|
2902
2770
|
emitEvent({ event: "deviceRegistrationCompleted" }, client);
|
|
2903
2771
|
return response;
|
|
2904
2772
|
};
|
|
@@ -2925,7 +2793,7 @@ const __completeDeviceRegistration_wrapped = instrumentFunction({
|
|
|
2925
2793
|
*
|
|
2926
2794
|
* @returns The device token as a string if valid.
|
|
2927
2795
|
* @throws InvalidDeviceRegistrationRedirectError If the URL is not a valid device registration redirect.
|
|
2928
|
-
* @instrumented
|
|
2796
|
+
* @not-instrumented
|
|
2929
2797
|
*/
|
|
2930
2798
|
const getDeviceRegistrationTokenFromUrl = ({ url }) => {
|
|
2931
2799
|
let urlObject;
|
|
@@ -2938,18 +2806,6 @@ const getDeviceRegistrationTokenFromUrl = ({ url }) => {
|
|
|
2938
2806
|
if (!deviceRegistrationToken || deviceRegistrationToken.trim() === "") throw new InvalidDeviceRegistrationRedirectError();
|
|
2939
2807
|
return deviceRegistrationToken;
|
|
2940
2808
|
};
|
|
2941
|
-
const __getDeviceRegistrationTokenFromUrl_impl = getDeviceRegistrationTokenFromUrl;
|
|
2942
|
-
const __getDeviceRegistrationTokenFromUrl_wrapped = instrumentFunction({
|
|
2943
|
-
fn: __getDeviceRegistrationTokenFromUrl_impl,
|
|
2944
|
-
functionName: "getDeviceRegistrationTokenFromUrl",
|
|
2945
|
-
getCore: () => {
|
|
2946
|
-
try {
|
|
2947
|
-
return getCore(getDefaultClient());
|
|
2948
|
-
} catch {
|
|
2949
|
-
return;
|
|
2950
|
-
}
|
|
2951
|
-
}
|
|
2952
|
-
});
|
|
2953
2809
|
|
|
2954
2810
|
//#endregion
|
|
2955
2811
|
//#region src/modules/deviceRegistration/detectDeviceRegistrationRedirect/detectDeviceRegistrationRedirect.ts
|
|
@@ -2960,35 +2816,23 @@ const __getDeviceRegistrationTokenFromUrl_wrapped = instrumentFunction({
|
|
|
2960
2816
|
* if it contains device registration redirect data from a device authentication flow.
|
|
2961
2817
|
*
|
|
2962
2818
|
* @returns True if the URL is a device registration redirect, false otherwise.
|
|
2963
|
-
* @instrumented
|
|
2819
|
+
* @not-instrumented
|
|
2964
2820
|
*/
|
|
2965
2821
|
const detectDeviceRegistrationRedirect = ({ url }) => {
|
|
2966
2822
|
try {
|
|
2967
|
-
|
|
2823
|
+
getDeviceRegistrationTokenFromUrl({ url });
|
|
2968
2824
|
return true;
|
|
2969
2825
|
} catch {
|
|
2970
2826
|
return false;
|
|
2971
2827
|
}
|
|
2972
2828
|
};
|
|
2973
|
-
const __detectDeviceRegistrationRedirect_impl = detectDeviceRegistrationRedirect;
|
|
2974
|
-
const __detectDeviceRegistrationRedirect_wrapped = instrumentFunction({
|
|
2975
|
-
fn: __detectDeviceRegistrationRedirect_impl,
|
|
2976
|
-
functionName: "detectDeviceRegistrationRedirect",
|
|
2977
|
-
getCore: () => {
|
|
2978
|
-
try {
|
|
2979
|
-
return getCore(getDefaultClient());
|
|
2980
|
-
} catch {
|
|
2981
|
-
return;
|
|
2982
|
-
}
|
|
2983
|
-
}
|
|
2984
|
-
});
|
|
2985
2829
|
|
|
2986
2830
|
//#endregion
|
|
2987
2831
|
//#region src/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.ts
|
|
2988
|
-
/** @instrumented */
|
|
2832
|
+
/** @not-instrumented */
|
|
2989
2833
|
const getRegisteredDevices = async (client = getDefaultClient()) => {
|
|
2990
2834
|
const core = getCore(client);
|
|
2991
|
-
const apiClient =
|
|
2835
|
+
const apiClient = createApiClient({}, client);
|
|
2992
2836
|
try {
|
|
2993
2837
|
return (await apiClient.listDeviceRegistrations({ environmentId: core.environmentId })).deviceRegistrations;
|
|
2994
2838
|
} catch (error) {
|
|
@@ -3000,18 +2844,6 @@ const getRegisteredDevices = async (client = getDefaultClient()) => {
|
|
|
3000
2844
|
throw error;
|
|
3001
2845
|
}
|
|
3002
2846
|
};
|
|
3003
|
-
const __getRegisteredDevices_impl = getRegisteredDevices;
|
|
3004
|
-
const __getRegisteredDevices_wrapped = instrumentFunction({
|
|
3005
|
-
fn: __getRegisteredDevices_impl,
|
|
3006
|
-
functionName: "getRegisteredDevices",
|
|
3007
|
-
getCore: () => {
|
|
3008
|
-
try {
|
|
3009
|
-
return getCore(getDefaultClient());
|
|
3010
|
-
} catch {
|
|
3011
|
-
return;
|
|
3012
|
-
}
|
|
3013
|
-
}
|
|
3014
|
-
});
|
|
3015
2847
|
|
|
3016
2848
|
//#endregion
|
|
3017
2849
|
//#region src/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.ts
|
|
@@ -3032,7 +2864,7 @@ const isDeviceRegistrationRequired = (user) => Boolean(user.scope?.includes("dev
|
|
|
3032
2864
|
/** @instrumented */
|
|
3033
2865
|
const revokeAllRegisteredDevices = async (client = getDefaultClient()) => {
|
|
3034
2866
|
const core = getCore(client);
|
|
3035
|
-
await
|
|
2867
|
+
await createApiClient({}, client).deleteAllDeviceRegistrations({ environmentId: core.environmentId });
|
|
3036
2868
|
await __logoutWithReason_wrapped({ reason: "all-devices-revoked" }, client);
|
|
3037
2869
|
};
|
|
3038
2870
|
const __revokeAllRegisteredDevices_impl = revokeAllRegisteredDevices;
|
|
@@ -3054,7 +2886,7 @@ const __revokeAllRegisteredDevices_wrapped = instrumentFunction({
|
|
|
3054
2886
|
const revokeRegisteredDevice = async ({ deviceRegistrationId }, client = getDefaultClient()) => {
|
|
3055
2887
|
assertDefined(deviceRegistrationId, "deviceRegistrationId is required");
|
|
3056
2888
|
const core = getCore(client);
|
|
3057
|
-
if ((await
|
|
2889
|
+
if ((await createApiClient({}, client).deleteDeviceRegistration({
|
|
3058
2890
|
deviceRegistrationId,
|
|
3059
2891
|
environmentId: core.environmentId
|
|
3060
2892
|
})).currentDeviceRevoked) await __logoutWithReason_wrapped({ reason: "device-revoked" }, client);
|
|
@@ -3082,7 +2914,7 @@ const __revokeRegisteredDevice_wrapped = instrumentFunction({
|
|
|
3082
2914
|
* @returns A function to remove the listener.
|
|
3083
2915
|
* @throws {ValueMustBeDefinedError} If the window is not available.
|
|
3084
2916
|
* @docs https://docs.cdp.coinbase.com/onramp-&-offramp/onramp-apis/apple-pay-onramp-api#events-names
|
|
3085
|
-
* @instrumented
|
|
2917
|
+
* @not-instrumented
|
|
3086
2918
|
*/
|
|
3087
2919
|
const addCoinbaseOnrampOrderEventListener = ({ listener }, client = getDefaultClient()) => {
|
|
3088
2920
|
const core = getCore(client);
|
|
@@ -3106,18 +2938,6 @@ const addCoinbaseOnrampOrderEventListener = ({ listener }, client = getDefaultCl
|
|
|
3106
2938
|
window.removeEventListener("message", handleMessageEvent);
|
|
3107
2939
|
};
|
|
3108
2940
|
};
|
|
3109
|
-
const __addCoinbaseOnrampOrderEventListener_impl = addCoinbaseOnrampOrderEventListener;
|
|
3110
|
-
const __addCoinbaseOnrampOrderEventListener_wrapped = instrumentFunction({
|
|
3111
|
-
fn: __addCoinbaseOnrampOrderEventListener_impl,
|
|
3112
|
-
functionName: "addCoinbaseOnrampOrderEventListener",
|
|
3113
|
-
getCore: () => {
|
|
3114
|
-
try {
|
|
3115
|
-
return getCore(getDefaultClient());
|
|
3116
|
-
} catch {
|
|
3117
|
-
return;
|
|
3118
|
-
}
|
|
3119
|
-
}
|
|
3120
|
-
});
|
|
3121
2941
|
|
|
3122
2942
|
//#endregion
|
|
3123
2943
|
//#region src/modules/funding/coinbase/getMissingVerificationForCoinbaseOnrampOrder/getMissingVerificationForCoinbaseOnrampOrder.ts
|
|
@@ -3135,7 +2955,7 @@ const __addCoinbaseOnrampOrderEventListener_wrapped = instrumentFunction({
|
|
|
3135
2955
|
* @returns FieldMissingVerificationForCoinbaseOnramp[] - An array of fields that are missing verification for a Coinbase onramp order
|
|
3136
2956
|
* @throws {InvalidParamError} - If the payment method is not valid
|
|
3137
2957
|
* @throws {ValueMustBeDefinedError} - If the user is not authenticated
|
|
3138
|
-
* @instrumented
|
|
2958
|
+
* @not-instrumented
|
|
3139
2959
|
*/
|
|
3140
2960
|
const getMissingVerificationForCoinbaseOnrampOrder = ({ paymentMethod }, client = getDefaultClient()) => {
|
|
3141
2961
|
if (paymentMethod !== "GUEST_CHECKOUT_APPLE_PAY") throw new InvalidParamError(`Invalid payment method: ${paymentMethod}`);
|
|
@@ -3170,18 +2990,6 @@ const getMissingVerificationForCoinbaseOnrampOrder = ({ paymentMethod }, client
|
|
|
3170
2990
|
});
|
|
3171
2991
|
return fieldsMissingVerification;
|
|
3172
2992
|
};
|
|
3173
|
-
const __getMissingVerificationForCoinbaseOnrampOrder_impl = getMissingVerificationForCoinbaseOnrampOrder;
|
|
3174
|
-
const __getMissingVerificationForCoinbaseOnrampOrder_wrapped = instrumentFunction({
|
|
3175
|
-
fn: __getMissingVerificationForCoinbaseOnrampOrder_impl,
|
|
3176
|
-
functionName: "getMissingVerificationForCoinbaseOnrampOrder",
|
|
3177
|
-
getCore: () => {
|
|
3178
|
-
try {
|
|
3179
|
-
return getCore(getDefaultClient());
|
|
3180
|
-
} catch {
|
|
3181
|
-
return;
|
|
3182
|
-
}
|
|
3183
|
-
}
|
|
3184
|
-
});
|
|
3185
2993
|
|
|
3186
2994
|
//#endregion
|
|
3187
2995
|
//#region src/modules/funding/coinbase/utils/validateUserCredentialsForCoinbaseOnrampOrder/validateUserCredentialsForCoinbaseOnrampOrder.ts
|
|
@@ -3189,7 +2997,7 @@ const __getMissingVerificationForCoinbaseOnrampOrder_wrapped = instrumentFunctio
|
|
|
3189
2997
|
const validateUserCredentialsForCoinbaseOnrampOrder = (client) => {
|
|
3190
2998
|
const { user } = client;
|
|
3191
2999
|
assertDefined(user, "User is not authenticated");
|
|
3192
|
-
const fieldsMissingVerification =
|
|
3000
|
+
const fieldsMissingVerification = getMissingVerificationForCoinbaseOnrampOrder({ paymentMethod: "GUEST_CHECKOUT_APPLE_PAY" }, client);
|
|
3193
3001
|
if (fieldsMissingVerification.find((field) => field.field === "email")) throw new MissingUserVerificationError({
|
|
3194
3002
|
informationToVerify: "email",
|
|
3195
3003
|
message: "User must have a verified email to create a Coinbase onramp order"
|
|
@@ -3220,7 +3028,7 @@ const validateUserCredentialsForCoinbaseOnrampOrder = (client) => {
|
|
|
3220
3028
|
const createCoinbaseOnrampOrder = async (orderParams, client = getDefaultClient()) => {
|
|
3221
3029
|
const user = validateUserCredentialsForCoinbaseOnrampOrder(client);
|
|
3222
3030
|
const core = getCore(client);
|
|
3223
|
-
const apiClient =
|
|
3031
|
+
const apiClient = createApiClient({ includeMfaToken: true }, client);
|
|
3224
3032
|
const { isSandbox, ...restOrderParams } = orderParams;
|
|
3225
3033
|
const orderResponse = await apiClient.createCoinbaseOnrampOrder({
|
|
3226
3034
|
coinbaseOnrampOrderCreateRequest: {
|
|
@@ -3260,27 +3068,15 @@ const __createCoinbaseOnrampOrder_wrapped = instrumentFunction({
|
|
|
3260
3068
|
* @param buyUrlParams CoinbaseOnrampGetBuyUrlRequest - The parameters for the buy URL.
|
|
3261
3069
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
3262
3070
|
* @returns an object containing the buy URL
|
|
3263
|
-
* @instrumented
|
|
3071
|
+
* @not-instrumented
|
|
3264
3072
|
*/
|
|
3265
3073
|
const getCoinbaseBuyUrl = async (buyUrlParams, client = getDefaultClient()) => {
|
|
3266
3074
|
const core = getCore(client);
|
|
3267
|
-
return await
|
|
3075
|
+
return await createApiClient({ includeMfaToken: true }, client).generateCoinbaseOnrampBuyUrl({
|
|
3268
3076
|
coinbaseOnrampGetBuyUrlRequest: buyUrlParams,
|
|
3269
3077
|
environmentId: core.environmentId
|
|
3270
3078
|
});
|
|
3271
3079
|
};
|
|
3272
|
-
const __getCoinbaseBuyUrl_impl = getCoinbaseBuyUrl;
|
|
3273
|
-
const __getCoinbaseBuyUrl_wrapped = instrumentFunction({
|
|
3274
|
-
fn: __getCoinbaseBuyUrl_impl,
|
|
3275
|
-
functionName: "getCoinbaseBuyUrl",
|
|
3276
|
-
getCore: () => {
|
|
3277
|
-
try {
|
|
3278
|
-
return getCore(getDefaultClient());
|
|
3279
|
-
} catch {
|
|
3280
|
-
return;
|
|
3281
|
-
}
|
|
3282
|
-
}
|
|
3283
|
-
});
|
|
3284
3080
|
|
|
3285
3081
|
//#endregion
|
|
3286
3082
|
//#region src/modules/funding/cryptoDotCom/createCryptoDotComPayment/createCryptoDotComPayment.ts
|
|
@@ -3294,7 +3090,7 @@ const __getCoinbaseBuyUrl_wrapped = instrumentFunction({
|
|
|
3294
3090
|
*/
|
|
3295
3091
|
const createCryptoDotComPayment = async (paymentParams, client = getDefaultClient()) => {
|
|
3296
3092
|
const core = getCore(client);
|
|
3297
|
-
return await
|
|
3093
|
+
return await createApiClient({ includeMfaToken: true }, client).createCryptoDotComPayment({
|
|
3298
3094
|
cryptoDotComPaymentCreateRequest: {
|
|
3299
3095
|
...paymentParams,
|
|
3300
3096
|
chain: paymentParams.chain
|
|
@@ -3327,7 +3123,7 @@ const __createCryptoDotComPayment_wrapped = instrumentFunction({
|
|
|
3327
3123
|
*/
|
|
3328
3124
|
const createKrakenExchangeTransfer = async (transferParams, client = getDefaultClient()) => {
|
|
3329
3125
|
const core = getCore(client);
|
|
3330
|
-
const apiClient =
|
|
3126
|
+
const apiClient = createApiClient({ includeMfaToken: true }, client);
|
|
3331
3127
|
const { accountId, ...createExchangeTransferRequest } = transferParams;
|
|
3332
3128
|
return await apiClient.postExchangeAccountTransfer({
|
|
3333
3129
|
accountId,
|
|
@@ -3361,25 +3157,13 @@ const __createKrakenExchangeTransfer_wrapped = instrumentFunction({
|
|
|
3361
3157
|
*/
|
|
3362
3158
|
const getKrakenAccounts = async (params, client = getDefaultClient()) => {
|
|
3363
3159
|
const core = getCore(client);
|
|
3364
|
-
return await
|
|
3160
|
+
return await createApiClient({ includeMfaToken: true }, client).getUserAccounts({
|
|
3365
3161
|
chainName: params?.chainName,
|
|
3366
3162
|
environmentId: core.environmentId,
|
|
3367
3163
|
exchangeKey: ExchangeKeyEnum.Kraken,
|
|
3368
3164
|
networkId: params?.networkId
|
|
3369
3165
|
});
|
|
3370
3166
|
};
|
|
3371
|
-
const __getKrakenAccounts_impl = getKrakenAccounts;
|
|
3372
|
-
const __getKrakenAccounts_wrapped = instrumentFunction({
|
|
3373
|
-
fn: __getKrakenAccounts_impl,
|
|
3374
|
-
functionName: "getKrakenAccounts",
|
|
3375
|
-
getCore: () => {
|
|
3376
|
-
try {
|
|
3377
|
-
return getCore(getDefaultClient());
|
|
3378
|
-
} catch {
|
|
3379
|
-
return;
|
|
3380
|
-
}
|
|
3381
|
-
}
|
|
3382
|
-
});
|
|
3383
3167
|
|
|
3384
3168
|
//#endregion
|
|
3385
3169
|
//#region src/modules/funding/kraken/getKrakenWhitelistedAddresses/getKrakenWhitelistedAddresses.ts
|
|
@@ -3388,27 +3172,15 @@ const __getKrakenAccounts_wrapped = instrumentFunction({
|
|
|
3388
3172
|
*
|
|
3389
3173
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
3390
3174
|
* @returns Transfer destinations response with whitelisted addresses
|
|
3391
|
-
* @instrumented
|
|
3175
|
+
* @not-instrumented
|
|
3392
3176
|
*/
|
|
3393
3177
|
const getKrakenWhitelistedAddresses = async (client = getDefaultClient()) => {
|
|
3394
3178
|
const core = getCore(client);
|
|
3395
|
-
return await
|
|
3179
|
+
return await createApiClient({ includeMfaToken: true }, client).getExchangeTransferDestinations({
|
|
3396
3180
|
environmentId: core.environmentId,
|
|
3397
3181
|
exchangeKey: ExchangeKeyEnum.Kraken
|
|
3398
3182
|
});
|
|
3399
3183
|
};
|
|
3400
|
-
const __getKrakenWhitelistedAddresses_impl = getKrakenWhitelistedAddresses;
|
|
3401
|
-
const __getKrakenWhitelistedAddresses_wrapped = instrumentFunction({
|
|
3402
|
-
fn: __getKrakenWhitelistedAddresses_impl,
|
|
3403
|
-
functionName: "getKrakenWhitelistedAddresses",
|
|
3404
|
-
getCore: () => {
|
|
3405
|
-
try {
|
|
3406
|
-
return getCore(getDefaultClient());
|
|
3407
|
-
} catch {
|
|
3408
|
-
return;
|
|
3409
|
-
}
|
|
3410
|
-
}
|
|
3411
|
-
});
|
|
3412
3184
|
|
|
3413
3185
|
//#endregion
|
|
3414
3186
|
//#region src/modules/initializeClient/waitForClientInitialized/waitForClientInitialized.ts
|
|
@@ -3417,23 +3189,11 @@ const __getKrakenWhitelistedAddresses_wrapped = instrumentFunction({
|
|
|
3417
3189
|
* and are ready for use.
|
|
3418
3190
|
*
|
|
3419
3191
|
* @returns a promise that resolves once the client is fully initialized.
|
|
3420
|
-
* @instrumented
|
|
3192
|
+
* @not-instrumented
|
|
3421
3193
|
*/
|
|
3422
3194
|
const waitForClientInitialized = async (client = getDefaultClient()) => {
|
|
3423
3195
|
await getCore(client).initTrack.waitForAll();
|
|
3424
3196
|
};
|
|
3425
|
-
const __waitForClientInitialized_impl = waitForClientInitialized;
|
|
3426
|
-
const __waitForClientInitialized_wrapped = instrumentFunction({
|
|
3427
|
-
fn: __waitForClientInitialized_impl,
|
|
3428
|
-
functionName: "waitForClientInitialized",
|
|
3429
|
-
getCore: () => {
|
|
3430
|
-
try {
|
|
3431
|
-
return getCore(getDefaultClient());
|
|
3432
|
-
} catch {
|
|
3433
|
-
return;
|
|
3434
|
-
}
|
|
3435
|
-
}
|
|
3436
|
-
});
|
|
3437
3197
|
|
|
3438
3198
|
//#endregion
|
|
3439
3199
|
//#region src/modules/instrumentation/setInstrumentationEnabled/setInstrumentationEnabled.ts
|
|
@@ -3519,7 +3279,7 @@ const fetchWithTimeout = async (client) => {
|
|
|
3519
3279
|
/**
|
|
3520
3280
|
* The schema to store the cached wallet book data.
|
|
3521
3281
|
*/
|
|
3522
|
-
const walletBookCacheStorageKeySchema =
|
|
3282
|
+
const walletBookCacheStorageKeySchema = createStorageKeySchema({
|
|
3523
3283
|
key: "legacyWalletBookCache",
|
|
3524
3284
|
schema: z.object({
|
|
3525
3285
|
groups: z.record(z.string(), z.any()),
|
|
@@ -3762,7 +3522,7 @@ const getChainFromWalletSchema = ({ wallet, walletKey }) => {
|
|
|
3762
3522
|
const firstChain = wallet.chains[0];
|
|
3763
3523
|
const chainPrefix = extractChainPrefix({ chainIdentifier: firstChain });
|
|
3764
3524
|
try {
|
|
3765
|
-
return
|
|
3525
|
+
return getChainFromVerifiedCredentialChain(chainPrefix);
|
|
3766
3526
|
} catch {}
|
|
3767
3527
|
}
|
|
3768
3528
|
if (walletKey) {
|
|
@@ -3840,23 +3600,11 @@ const transformWalletBook = ({ walletBook }) => {
|
|
|
3840
3600
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
3841
3601
|
* @returns A promise that resolves to the WalletConnect catalog containing groups and wallets.
|
|
3842
3602
|
* @throws If unable to fetch the wallet book from the API (when both CDN fetch and cache retrieval fail).
|
|
3843
|
-
* @instrumented
|
|
3603
|
+
* @not-instrumented
|
|
3844
3604
|
*/
|
|
3845
3605
|
const getWalletConnectCatalog = async (client = getDefaultClient()) => {
|
|
3846
3606
|
return transformWalletBook({ walletBook: await fetchLegacyWalletBook(client) });
|
|
3847
3607
|
};
|
|
3848
|
-
const __getWalletConnectCatalog_impl = getWalletConnectCatalog;
|
|
3849
|
-
const __getWalletConnectCatalog_wrapped = instrumentFunction({
|
|
3850
|
-
fn: __getWalletConnectCatalog_impl,
|
|
3851
|
-
functionName: "getWalletConnectCatalog",
|
|
3852
|
-
getCore: () => {
|
|
3853
|
-
try {
|
|
3854
|
-
return getCore(getDefaultClient());
|
|
3855
|
-
} catch {
|
|
3856
|
-
return;
|
|
3857
|
-
}
|
|
3858
|
-
}
|
|
3859
|
-
});
|
|
3860
3608
|
|
|
3861
3609
|
//#endregion
|
|
3862
3610
|
//#region src/modules/wallets/walletProvider/extractChainFromNormalizedName/extractChainFromNormalizedName.ts
|
|
@@ -3886,7 +3634,7 @@ const extractChainFromNormalizedName = ({ normalizedWalletNameWithChain }) => {
|
|
|
3886
3634
|
* @param params.walletProviderKey - The wallet provider key to get the catalog wallet entry for.
|
|
3887
3635
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
3888
3636
|
* @returns A promise that resolves to the WalletConnect catalog wallet entry, or undefined if not found.
|
|
3889
|
-
* @instrumented
|
|
3637
|
+
* @not-instrumented
|
|
3890
3638
|
*/
|
|
3891
3639
|
const getWalletConnectCatalogWalletByWalletProviderKey = async ({ walletProviderKey }, client = getDefaultClient()) => {
|
|
3892
3640
|
const { normalizedWalletNameWithChain } = splitWalletProviderKey(walletProviderKey);
|
|
@@ -3895,7 +3643,7 @@ const getWalletConnectCatalogWalletByWalletProviderKey = async ({ walletProvider
|
|
|
3895
3643
|
let walletProviderName = normalizedWalletNameWithChain.toLowerCase();
|
|
3896
3644
|
if (walletProviderName.endsWith(chain.toLowerCase())) walletProviderName = walletProviderName.slice(0, -chain.length);
|
|
3897
3645
|
walletProviderName = walletProviderName.replace(/wallet/g, "");
|
|
3898
|
-
const walletConnectCatalog = await
|
|
3646
|
+
const walletConnectCatalog = await getWalletConnectCatalog(client);
|
|
3899
3647
|
for (const [walletKey, wallet] of Object.entries(walletConnectCatalog.wallets)) {
|
|
3900
3648
|
if (wallet.chain !== chain) continue;
|
|
3901
3649
|
const walletKeyLower = walletKey.toLowerCase();
|
|
@@ -3903,18 +3651,6 @@ const getWalletConnectCatalogWalletByWalletProviderKey = async ({ walletProvider
|
|
|
3903
3651
|
if (walletKeyLower.includes(walletProviderName) || walletNameLower.includes(walletProviderName)) return wallet;
|
|
3904
3652
|
}
|
|
3905
3653
|
};
|
|
3906
|
-
const __getWalletConnectCatalogWalletByWalletProviderKey_impl = getWalletConnectCatalogWalletByWalletProviderKey;
|
|
3907
|
-
const __getWalletConnectCatalogWalletByWalletProviderKey_wrapped = instrumentFunction({
|
|
3908
|
-
fn: __getWalletConnectCatalogWalletByWalletProviderKey_impl,
|
|
3909
|
-
functionName: "getWalletConnectCatalogWalletByWalletProviderKey",
|
|
3910
|
-
getCore: () => {
|
|
3911
|
-
try {
|
|
3912
|
-
return getCore(getDefaultClient());
|
|
3913
|
-
} catch {
|
|
3914
|
-
return;
|
|
3915
|
-
}
|
|
3916
|
-
}
|
|
3917
|
-
});
|
|
3918
3654
|
|
|
3919
3655
|
//#endregion
|
|
3920
3656
|
//#region src/modules/user/updateUser/updateUser.ts
|
|
@@ -3933,11 +3669,11 @@ const __getWalletConnectCatalogWalletByWalletProviderKey_wrapped = instrumentFun
|
|
|
3933
3669
|
*/
|
|
3934
3670
|
const updateUser = async ({ userFields }, client = getDefaultClient()) => {
|
|
3935
3671
|
const core = getCore(client);
|
|
3936
|
-
const response = await
|
|
3672
|
+
const response = await createApiClient({ includeMfaToken: true }, client).updateSelf({
|
|
3937
3673
|
environmentId: core.environmentId,
|
|
3938
3674
|
userFields
|
|
3939
3675
|
});
|
|
3940
|
-
|
|
3676
|
+
updateAuthFromVerifyResponse({ response }, client);
|
|
3941
3677
|
if (response.emailVerification) return {
|
|
3942
3678
|
email: response.emailVerification.email,
|
|
3943
3679
|
verificationUUID: response.emailVerification.verificationUUID
|
|
@@ -4008,7 +3744,7 @@ const __acknowledgeRecoveryCodes_wrapped = instrumentFunction({
|
|
|
4008
3744
|
*/
|
|
4009
3745
|
const authenticateMfaRecoveryCode = async ({ code, createMfaTokenOptions, requestedScopes }, client = getDefaultClient()) => {
|
|
4010
3746
|
const core = getCore(client);
|
|
4011
|
-
const apiClient =
|
|
3747
|
+
const apiClient = createApiClient({}, client);
|
|
4012
3748
|
try {
|
|
4013
3749
|
const response = await apiClient.authMfaRecovery({
|
|
4014
3750
|
environmentId: core.environmentId,
|
|
@@ -4018,7 +3754,7 @@ const authenticateMfaRecoveryCode = async ({ code, createMfaTokenOptions, reques
|
|
|
4018
3754
|
requestedScopes
|
|
4019
3755
|
}
|
|
4020
3756
|
});
|
|
4021
|
-
|
|
3757
|
+
updateAuthFromVerifyResponse({ response }, client);
|
|
4022
3758
|
emitEvent({
|
|
4023
3759
|
args: { mfaToken: response.mfaToken },
|
|
4024
3760
|
event: "mfaCompletionSuccess"
|
|
@@ -4038,7 +3774,7 @@ const authenticateMfaRecoveryCode = async ({ code, createMfaTokenOptions, reques
|
|
|
4038
3774
|
/** @not-instrumented */
|
|
4039
3775
|
const getPasskeyAuthenticationOptions = async ({ relatedOriginRpId } = {}, client) => {
|
|
4040
3776
|
const core = getCore(client);
|
|
4041
|
-
return await
|
|
3777
|
+
return await createApiClient({}, client).getPasskeyAuthenticationOptions({
|
|
4042
3778
|
environmentId: core.environmentId,
|
|
4043
3779
|
relatedOriginRpId
|
|
4044
3780
|
});
|
|
@@ -4049,7 +3785,7 @@ const getPasskeyAuthenticationOptions = async ({ relatedOriginRpId } = {}, clien
|
|
|
4049
3785
|
/** @not-instrumented */
|
|
4050
3786
|
const serverAuthenticatePasskey = async ({ authentication, createMfaToken, requestedScopes }, client) => {
|
|
4051
3787
|
const core = getCore(client);
|
|
4052
|
-
return await
|
|
3788
|
+
return await createApiClient({}, client).authenticateMfaPasskeyDevice({
|
|
4053
3789
|
environmentId: core.environmentId,
|
|
4054
3790
|
passkeyAuthRequest: {
|
|
4055
3791
|
...authentication,
|
|
@@ -4098,7 +3834,7 @@ const authenticatePasskeyMFA = async ({ createMfaToken, relatedOriginRpId, reque
|
|
|
4098
3834
|
createMfaToken,
|
|
4099
3835
|
requestedScopes
|
|
4100
3836
|
}, client);
|
|
4101
|
-
|
|
3837
|
+
updateAuthFromVerifyResponse({ response }, client);
|
|
4102
3838
|
emitEvent({
|
|
4103
3839
|
args: { mfaToken: response.mfaToken },
|
|
4104
3840
|
event: "mfaCompletionSuccess"
|
|
@@ -4131,7 +3867,7 @@ const authenticatePasskeyMFA = async ({ createMfaToken, relatedOriginRpId, reque
|
|
|
4131
3867
|
*/
|
|
4132
3868
|
const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions, requestedScopes }, client = getDefaultClient()) => {
|
|
4133
3869
|
const core = getCore(client);
|
|
4134
|
-
const apiClient =
|
|
3870
|
+
const apiClient = createApiClient({}, client);
|
|
4135
3871
|
try {
|
|
4136
3872
|
const response = await apiClient.authMfaTotpDevice({
|
|
4137
3873
|
environmentId: core.environmentId,
|
|
@@ -4142,7 +3878,7 @@ const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions
|
|
|
4142
3878
|
requestedScopes
|
|
4143
3879
|
}
|
|
4144
3880
|
});
|
|
4145
|
-
|
|
3881
|
+
updateAuthFromVerifyResponse({ response }, client);
|
|
4146
3882
|
emitEvent({
|
|
4147
3883
|
args: {
|
|
4148
3884
|
deviceId,
|
|
@@ -4177,7 +3913,7 @@ const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions
|
|
|
4177
3913
|
*/
|
|
4178
3914
|
const createNewMfaRecoveryCodes = async (client = getDefaultClient()) => {
|
|
4179
3915
|
const core = getCore(client);
|
|
4180
|
-
return
|
|
3916
|
+
return createApiClient({}, client).createNewRecoveryCodes({ environmentId: core.environmentId });
|
|
4181
3917
|
};
|
|
4182
3918
|
const __createNewMfaRecoveryCodes_impl = createNewMfaRecoveryCodes;
|
|
4183
3919
|
const __createNewMfaRecoveryCodes_wrapped = instrumentFunction({
|
|
@@ -4215,7 +3951,7 @@ const deleteMfaDevice = async ({ deviceId, mfaAuthToken }, client = getDefaultCl
|
|
|
4215
3951
|
consume: false,
|
|
4216
3952
|
scope: TokenScope.Credentialunlink
|
|
4217
3953
|
}, client)) assertDefined(mfaAuthToken, "mfaAuthToken is required");
|
|
4218
|
-
return
|
|
3954
|
+
return createApiClient({ elevatedAccessTokenScope: TokenScope.Credentialunlink }, client).deleteMfaDevice({
|
|
4219
3955
|
environmentId: core.environmentId,
|
|
4220
3956
|
mfaDeviceId: deviceId,
|
|
4221
3957
|
xMfaAuthToken: mfaAuthToken ?? ""
|
|
@@ -4244,25 +3980,13 @@ const __deleteMfaDevice_wrapped = instrumentFunction({
|
|
|
4244
3980
|
*
|
|
4245
3981
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4246
3982
|
* @returns A promise that resolves to an array of the user's registered MFA devices.
|
|
4247
|
-
* @instrumented
|
|
3983
|
+
* @not-instrumented
|
|
4248
3984
|
*/
|
|
4249
3985
|
const getMfaDevices = async (client = getDefaultClient()) => {
|
|
4250
3986
|
const core = getCore(client);
|
|
4251
|
-
const { devices } = await
|
|
3987
|
+
const { devices } = await createApiClient({}, client).getUserMfaDevices({ environmentId: core.environmentId });
|
|
4252
3988
|
return devices;
|
|
4253
3989
|
};
|
|
4254
|
-
const __getMfaDevices_impl = getMfaDevices;
|
|
4255
|
-
const __getMfaDevices_wrapped = instrumentFunction({
|
|
4256
|
-
fn: __getMfaDevices_impl,
|
|
4257
|
-
functionName: "getMfaDevices",
|
|
4258
|
-
getCore: () => {
|
|
4259
|
-
try {
|
|
4260
|
-
return getCore(getDefaultClient());
|
|
4261
|
-
} catch {
|
|
4262
|
-
return;
|
|
4263
|
-
}
|
|
4264
|
-
}
|
|
4265
|
-
});
|
|
4266
3990
|
|
|
4267
3991
|
//#endregion
|
|
4268
3992
|
//#region src/modules/mfa/getMfaRecoveryCodes/getMfaRecoveryCodes.ts
|
|
@@ -4276,24 +4000,12 @@ const __getMfaDevices_wrapped = instrumentFunction({
|
|
|
4276
4000
|
*
|
|
4277
4001
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4278
4002
|
* @returns A promise that resolves to the user's MFA recovery codes.
|
|
4279
|
-
* @instrumented
|
|
4003
|
+
* @not-instrumented
|
|
4280
4004
|
*/
|
|
4281
4005
|
const getMfaRecoveryCodes = async (client = getDefaultClient()) => {
|
|
4282
4006
|
const core = getCore(client);
|
|
4283
|
-
return
|
|
4007
|
+
return createApiClient({}, client).getRecoveryCodes({ environmentId: core.environmentId });
|
|
4284
4008
|
};
|
|
4285
|
-
const __getMfaRecoveryCodes_impl = getMfaRecoveryCodes;
|
|
4286
|
-
const __getMfaRecoveryCodes_wrapped = instrumentFunction({
|
|
4287
|
-
fn: __getMfaRecoveryCodes_impl,
|
|
4288
|
-
functionName: "getMfaRecoveryCodes",
|
|
4289
|
-
getCore: () => {
|
|
4290
|
-
try {
|
|
4291
|
-
return getCore(getDefaultClient());
|
|
4292
|
-
} catch {
|
|
4293
|
-
return;
|
|
4294
|
-
}
|
|
4295
|
-
}
|
|
4296
|
-
});
|
|
4297
4009
|
|
|
4298
4010
|
//#endregion
|
|
4299
4011
|
//#region src/modules/mfa/isPendingRecoveryCodesAcknowledgment/isPendingRecoveryCodesAcknowledgment.ts
|
|
@@ -4328,7 +4040,7 @@ const isPendingRecoveryCodesAcknowledgment = (client = getDefaultClient()) => {
|
|
|
4328
4040
|
*/
|
|
4329
4041
|
const registerTotpMfaDevice = async (client = getDefaultClient()) => {
|
|
4330
4042
|
const core = getCore(client);
|
|
4331
|
-
return
|
|
4043
|
+
return createApiClient({ elevatedAccessTokenScope: TokenScope.Credentiallink }, client).registerTotpMfaDevice({ environmentId: core.environmentId });
|
|
4332
4044
|
};
|
|
4333
4045
|
const __registerTotpMfaDevice_impl = registerTotpMfaDevice;
|
|
4334
4046
|
const __registerTotpMfaDevice_wrapped = instrumentFunction({
|
|
@@ -4358,7 +4070,7 @@ const __registerTotpMfaDevice_wrapped = instrumentFunction({
|
|
|
4358
4070
|
*/
|
|
4359
4071
|
const setDefaultMfaDevice = async ({ deviceId }, client = getDefaultClient()) => {
|
|
4360
4072
|
const core = getCore(client);
|
|
4361
|
-
const apiClient =
|
|
4073
|
+
const apiClient = createApiClient({}, client);
|
|
4362
4074
|
assertDefined(deviceId, "deviceId is required");
|
|
4363
4075
|
return apiClient.updateUserMfaDevice({
|
|
4364
4076
|
environmentId: core.environmentId,
|
|
@@ -4393,9 +4105,9 @@ const __setDefaultMfaDevice_wrapped = instrumentFunction({
|
|
|
4393
4105
|
*/
|
|
4394
4106
|
const sendEmailOTP = async ({ email }, client = getDefaultClient()) => {
|
|
4395
4107
|
const core = getCore(client);
|
|
4396
|
-
const { verificationUUID } = await
|
|
4108
|
+
const { verificationUUID } = await createApiClient({}, client).createEmailVerification({
|
|
4397
4109
|
emailVerificationCreateRequest: {
|
|
4398
|
-
captchaToken:
|
|
4110
|
+
captchaToken: consumeCaptchaToken(client),
|
|
4399
4111
|
email
|
|
4400
4112
|
},
|
|
4401
4113
|
environmentId: core.environmentId
|
|
@@ -5354,12 +5066,12 @@ const supportedCountries = {
|
|
|
5354
5066
|
*/
|
|
5355
5067
|
const sendSmsOTP = async ({ isoCountryCode, phoneNumber }, client = getDefaultClient()) => {
|
|
5356
5068
|
const core = getCore(client);
|
|
5357
|
-
const apiClient =
|
|
5069
|
+
const apiClient = createApiClient({}, client);
|
|
5358
5070
|
const phoneCountryCode = supportedCountries[isoCountryCode].code;
|
|
5359
5071
|
const { verificationUUID } = await apiClient.createSmsVerification({
|
|
5360
5072
|
environmentId: core.environmentId,
|
|
5361
5073
|
smsVerificationCreateRequest: {
|
|
5362
|
-
captchaToken:
|
|
5074
|
+
captchaToken: consumeCaptchaToken(client),
|
|
5363
5075
|
isoCountryCode,
|
|
5364
5076
|
phoneCountryCode,
|
|
5365
5077
|
phoneNumber
|
|
@@ -5391,7 +5103,7 @@ const __sendSmsOTP_wrapped = instrumentFunction({
|
|
|
5391
5103
|
/** @not-instrumented */
|
|
5392
5104
|
const verifyOTPForUserSignIn = async ({ otpVerification, verificationToken }, client) => {
|
|
5393
5105
|
const core = getCore(client);
|
|
5394
|
-
const apiClient =
|
|
5106
|
+
const apiClient = createApiClient({}, client);
|
|
5395
5107
|
const verifyRequest = {
|
|
5396
5108
|
verificationToken,
|
|
5397
5109
|
verificationUUID: otpVerification.verificationUUID
|
|
@@ -5411,7 +5123,7 @@ const verifyOTPForUserSignIn = async ({ otpVerification, verificationToken }, cl
|
|
|
5411
5123
|
/** @not-instrumented */
|
|
5412
5124
|
const verifyOTPForUserUpdate = async ({ otpVerification, verificationToken, requestedScopes }, client) => {
|
|
5413
5125
|
const core = getCore(client);
|
|
5414
|
-
const apiClient =
|
|
5126
|
+
const apiClient = createApiClient({}, client);
|
|
5415
5127
|
const verifyRequest = {
|
|
5416
5128
|
verificationToken,
|
|
5417
5129
|
verificationUUID: otpVerification.verificationUUID
|
|
@@ -5452,7 +5164,7 @@ const verifyOTP = async ({ otpVerification, verificationToken, requestedScopes }
|
|
|
5452
5164
|
otpVerification,
|
|
5453
5165
|
verificationToken
|
|
5454
5166
|
}, client);
|
|
5455
|
-
|
|
5167
|
+
updateAuthFromVerifyResponse({ response }, client);
|
|
5456
5168
|
return response;
|
|
5457
5169
|
};
|
|
5458
5170
|
const __verifyOTP_impl = verifyOTP;
|
|
@@ -5476,11 +5188,11 @@ const __verifyOTP_wrapped = instrumentFunction({
|
|
|
5476
5188
|
* @param params GetSwapQuoteParams - The parameters for the swap quote.
|
|
5477
5189
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
5478
5190
|
* @returns The swap quote details. Use the `signingPayload` field to get the transaction data for the wallet to sign.
|
|
5479
|
-
* @instrumented
|
|
5191
|
+
* @not-instrumented
|
|
5480
5192
|
*/
|
|
5481
5193
|
const getSwapQuote = async (params, client = getDefaultClient()) => {
|
|
5482
5194
|
const core = getCore(client);
|
|
5483
|
-
const apiClient =
|
|
5195
|
+
const apiClient = createApiClient({}, client);
|
|
5484
5196
|
if (!params.from.amount && !params.to.amount) throw new InvalidParamError("Either from.amount or to.amount is required");
|
|
5485
5197
|
if (params.from.amount && params.to.amount) throw new InvalidParamError("Only one of from.amount or to.amount is allowed");
|
|
5486
5198
|
return await apiClient.swapQuote({
|
|
@@ -5502,18 +5214,6 @@ const getSwapQuote = async (params, client = getDefaultClient()) => {
|
|
|
5502
5214
|
}
|
|
5503
5215
|
});
|
|
5504
5216
|
};
|
|
5505
|
-
const __getSwapQuote_impl = getSwapQuote;
|
|
5506
|
-
const __getSwapQuote_wrapped = instrumentFunction({
|
|
5507
|
-
fn: __getSwapQuote_impl,
|
|
5508
|
-
functionName: "getSwapQuote",
|
|
5509
|
-
getCore: () => {
|
|
5510
|
-
try {
|
|
5511
|
-
return getCore(getDefaultClient());
|
|
5512
|
-
} catch {
|
|
5513
|
-
return;
|
|
5514
|
-
}
|
|
5515
|
-
}
|
|
5516
|
-
});
|
|
5517
5217
|
|
|
5518
5218
|
//#endregion
|
|
5519
5219
|
//#region src/modules/swap/getSwapStatus/getSwapStatus.ts
|
|
@@ -5523,11 +5223,11 @@ const __getSwapQuote_wrapped = instrumentFunction({
|
|
|
5523
5223
|
* @param params GetSwapStatusParams - The parameters for the swap status.
|
|
5524
5224
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
5525
5225
|
* @returns The swap status.
|
|
5526
|
-
* @instrumented
|
|
5226
|
+
* @not-instrumented
|
|
5527
5227
|
*/
|
|
5528
5228
|
const getSwapStatus = async (params, client = getDefaultClient()) => {
|
|
5529
5229
|
const core = getCore(client);
|
|
5530
|
-
const apiClient =
|
|
5230
|
+
const apiClient = createApiClient({}, client);
|
|
5531
5231
|
let from;
|
|
5532
5232
|
if (params.from) from = {
|
|
5533
5233
|
chainId: params.from.networkId,
|
|
@@ -5558,18 +5258,6 @@ const getSwapStatus = async (params, client = getDefaultClient()) => {
|
|
|
5558
5258
|
});
|
|
5559
5259
|
}
|
|
5560
5260
|
};
|
|
5561
|
-
const __getSwapStatus_impl = getSwapStatus;
|
|
5562
|
-
const __getSwapStatus_wrapped = instrumentFunction({
|
|
5563
|
-
fn: __getSwapStatus_impl,
|
|
5564
|
-
functionName: "getSwapStatus",
|
|
5565
|
-
getCore: () => {
|
|
5566
|
-
try {
|
|
5567
|
-
return getCore(getDefaultClient());
|
|
5568
|
-
} catch {
|
|
5569
|
-
return;
|
|
5570
|
-
}
|
|
5571
|
-
}
|
|
5572
|
-
});
|
|
5573
5261
|
|
|
5574
5262
|
//#endregion
|
|
5575
5263
|
//#region src/modules/user/deleteUser/deleteUser.ts
|
|
@@ -5585,7 +5273,7 @@ const __getSwapStatus_wrapped = instrumentFunction({
|
|
|
5585
5273
|
*/
|
|
5586
5274
|
const deleteUser = async (client = getDefaultClient()) => {
|
|
5587
5275
|
const core = getCore(client);
|
|
5588
|
-
await
|
|
5276
|
+
await createApiClient({ includeMfaToken: true }, client).hardDeleteUser({ environmentId: core.environmentId });
|
|
5589
5277
|
await __logoutWithReason_wrapped({ reason: "user-deleted" }, client);
|
|
5590
5278
|
};
|
|
5591
5279
|
const __deleteUser_impl = deleteUser;
|
|
@@ -5641,7 +5329,7 @@ const isUserOnboardingComplete = (client = getDefaultClient()) => {
|
|
|
5641
5329
|
* @not-instrumented
|
|
5642
5330
|
*/
|
|
5643
5331
|
const assertWalletAccountSigningAvailability = async ({ walletAccount }, client = getDefaultClient()) => {
|
|
5644
|
-
const { addresses } = await
|
|
5332
|
+
const { addresses } = await getWalletProviderFromWalletAccount({ walletAccount }, client).getConnectedAddresses();
|
|
5645
5333
|
if (addresses.length > 0 && !addresses.includes(walletAccount.address)) throw new WalletAccountNotSelectedError({
|
|
5646
5334
|
expectedAddress: walletAccount.address,
|
|
5647
5335
|
selectedAddress: addresses[0]
|
|
@@ -5665,7 +5353,7 @@ const assertWalletAccountSigningAvailability = async ({ walletAccount }, client
|
|
|
5665
5353
|
* @instrumented
|
|
5666
5354
|
*/
|
|
5667
5355
|
const confirmTransaction = async ({ walletAccount, transactionHash }, client = getDefaultClient()) => {
|
|
5668
|
-
const walletProvider =
|
|
5356
|
+
const walletProvider = getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
5669
5357
|
assertWalletProviderMethodDefined(walletProvider, "confirmTransaction");
|
|
5670
5358
|
await walletProvider.confirmTransaction({
|
|
5671
5359
|
transactionHash,
|
|
@@ -5741,7 +5429,7 @@ const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWallet
|
|
|
5741
5429
|
const walletProvider = getWalletProviderByKey({ walletProviderKey }, client);
|
|
5742
5430
|
assertWalletProviderMethodDefined(walletProvider, "connect");
|
|
5743
5431
|
const { addresses } = await walletProvider.connect();
|
|
5744
|
-
const currentAddresses =
|
|
5432
|
+
const currentAddresses = getWalletAccounts(client).map(({ address }) => address);
|
|
5745
5433
|
const mainAddress = addresses?.length ? addresses[0].address : null;
|
|
5746
5434
|
/**
|
|
5747
5435
|
* This error is thrown in case the wallet has no addresses connected
|
|
@@ -5765,9 +5453,9 @@ const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWallet
|
|
|
5765
5453
|
};
|
|
5766
5454
|
if (currentAddresses.includes(mainAddress)) return walletAccount;
|
|
5767
5455
|
if (addToDynamicWalletAccounts) {
|
|
5768
|
-
|
|
5456
|
+
setUnverifiedWalletAccounts({ unverifiedWalletAccountsToUpdate: [walletAccount] }, client);
|
|
5769
5457
|
emitWalletAccountsChangedEvent(client);
|
|
5770
|
-
|
|
5458
|
+
createVisit({ walletAccount }, client);
|
|
5771
5459
|
}
|
|
5772
5460
|
return walletAccount;
|
|
5773
5461
|
};
|
|
@@ -5819,8 +5507,8 @@ const getSignInMessage = async ({ nonce: nonceOverride, walletAccount }, client)
|
|
|
5819
5507
|
assertDefined(universalLink, "Universal link is not set");
|
|
5820
5508
|
const url = new URL(universalLink);
|
|
5821
5509
|
const domain = url.host;
|
|
5822
|
-
const nonce = nonceOverride ?? await
|
|
5823
|
-
const walletProvider =
|
|
5510
|
+
const nonce = nonceOverride ?? await getNonce(client);
|
|
5511
|
+
const walletProvider = getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
5824
5512
|
if (walletProvider.chain === "STARK")
|
|
5825
5513
|
/**
|
|
5826
5514
|
* Starknet requires the strings to be 31 chars long
|
|
@@ -5831,7 +5519,7 @@ const getSignInMessage = async ({ nonce: nonceOverride, walletAccount }, client)
|
|
|
5831
5519
|
domain: domain.substring(0, 31),
|
|
5832
5520
|
nonce
|
|
5833
5521
|
});
|
|
5834
|
-
const statement =
|
|
5522
|
+
const statement = createSignInMessageStatement(client);
|
|
5835
5523
|
return await formatSignInMessage({
|
|
5836
5524
|
address: walletAccount.address,
|
|
5837
5525
|
blockchainName: CHAINS_INFO_MAP[walletProvider.chain].blockchainName,
|
|
@@ -5859,7 +5547,7 @@ const getSignInMessage = async ({ nonce: nonceOverride, walletAccount }, client)
|
|
|
5859
5547
|
* @instrumented
|
|
5860
5548
|
*/
|
|
5861
5549
|
const proveWalletAccountOwnership = async ({ walletAccount }, client = getDefaultClient()) => {
|
|
5862
|
-
const walletProvider =
|
|
5550
|
+
const walletProvider = getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
5863
5551
|
assertWalletProviderMethodDefined(walletProvider, "signMessage");
|
|
5864
5552
|
const messageToSign = await getSignInMessage({
|
|
5865
5553
|
nonce: walletProvider.getConnectProofNonce?.(),
|
|
@@ -5903,14 +5591,14 @@ const isSameAddress = ({ chain, left, right }) => normalizeAddress({
|
|
|
5903
5591
|
/** @not-instrumented */
|
|
5904
5592
|
const verifyWalletAccountForSignInOrTransfer = async ({ walletAccount, isTransfer, requestedScopes }, client) => {
|
|
5905
5593
|
if (walletAccount.verifiedCredentialId) throw new WalletAccountAlreadyVerifiedError(walletAccount.address);
|
|
5906
|
-
const walletProvider =
|
|
5594
|
+
const walletProvider = getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
5907
5595
|
const { messageToSign, signature } = await __proveWalletAccountOwnership_wrapped({ walletAccount }, client);
|
|
5908
5596
|
const formattedSignature = walletAccount.hardwareWalletVendor ? formatSignatureForHardwareWallet({
|
|
5909
5597
|
hardwareWalletVendor: walletAccount.hardwareWalletVendor,
|
|
5910
5598
|
signature
|
|
5911
5599
|
}) : signature;
|
|
5912
5600
|
const { networkId } = await walletProvider.getActiveNetworkId();
|
|
5913
|
-
const response = await
|
|
5601
|
+
const response = await verifyMessageSignatureOwnership({
|
|
5914
5602
|
addressesWithTypes: walletAccount.addressesWithTypes,
|
|
5915
5603
|
chain: walletAccount.chain,
|
|
5916
5604
|
isTransfer,
|
|
@@ -5928,17 +5616,17 @@ const verifyWalletAccountForSignInOrTransfer = async ({ walletAccount, isTransfe
|
|
|
5928
5616
|
right: walletAccount.address
|
|
5929
5617
|
}));
|
|
5930
5618
|
assertDefined(walletVerifiedCredential, `After verifying, still unable to find verified wallet credential for wallet account ${walletAccount.address} on chain ${walletAccount.chain}`);
|
|
5931
|
-
|
|
5619
|
+
updateWalletProviderKeysForVerifiedCredentials({ keysToUpdate: { [walletVerifiedCredential.id]: walletProvider.key } }, client);
|
|
5932
5620
|
/**
|
|
5933
5621
|
* Adds the user with the new wallet verified credential
|
|
5934
5622
|
* This will add the new verified wallet account to the client`s state
|
|
5935
5623
|
*/
|
|
5936
|
-
|
|
5624
|
+
updateAuthFromVerifyResponse({ response }, client);
|
|
5937
5625
|
/**
|
|
5938
5626
|
* Remove the now verified wallet account from the unverified wallet accounts
|
|
5939
5627
|
*/
|
|
5940
|
-
|
|
5941
|
-
const verifiedWalletAccount =
|
|
5628
|
+
removeUnverifiedWalletAccount({ unverifiedWalletAccount: walletAccount }, client);
|
|
5629
|
+
const verifiedWalletAccount = getWalletAccounts(client).find(({ address }) => isSameAddress({
|
|
5942
5630
|
chain: walletAccount.chain,
|
|
5943
5631
|
left: address,
|
|
5944
5632
|
right: walletAccount.address
|
|
@@ -6024,7 +5712,7 @@ const connectAndVerifyWithWalletProvider = async ({ walletProviderKey, hardwareW
|
|
|
6024
5712
|
walletProviderKey
|
|
6025
5713
|
}, client);
|
|
6026
5714
|
await __verifyWalletAccount_wrapped({ walletAccount }, client);
|
|
6027
|
-
|
|
5715
|
+
createVisit({
|
|
6028
5716
|
authMode: AuthModeEnum.AndSign,
|
|
6029
5717
|
walletAccount
|
|
6030
5718
|
}, client);
|
|
@@ -6053,10 +5741,10 @@ const __connectAndVerifyWithWalletProvider_wrapped = instrumentFunction({
|
|
|
6053
5741
|
*
|
|
6054
5742
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6055
5743
|
* @returns An array of wallet provider data including chain, keys, and metadata.
|
|
6056
|
-
* @instrumented
|
|
5744
|
+
* @not-instrumented
|
|
6057
5745
|
*/
|
|
6058
5746
|
const getAvailableWalletProvidersData = (client = getDefaultClient()) => {
|
|
6059
|
-
return
|
|
5747
|
+
return getWalletProviders(client).filter((walletProvider) => Boolean(walletProvider.connect)).map((walletProvider) => ({
|
|
6060
5748
|
chain: walletProvider.chain,
|
|
6061
5749
|
groupKey: walletProvider.groupKey,
|
|
6062
5750
|
key: walletProvider.key,
|
|
@@ -6064,18 +5752,6 @@ const getAvailableWalletProvidersData = (client = getDefaultClient()) => {
|
|
|
6064
5752
|
walletProviderType: walletProvider.walletProviderType
|
|
6065
5753
|
}));
|
|
6066
5754
|
};
|
|
6067
|
-
const __getAvailableWalletProvidersData_impl = getAvailableWalletProvidersData;
|
|
6068
|
-
const __getAvailableWalletProvidersData_wrapped = instrumentFunction({
|
|
6069
|
-
fn: __getAvailableWalletProvidersData_impl,
|
|
6070
|
-
functionName: "getAvailableWalletProvidersData",
|
|
6071
|
-
getCore: () => {
|
|
6072
|
-
try {
|
|
6073
|
-
return getCore(getDefaultClient());
|
|
6074
|
-
} catch {
|
|
6075
|
-
return;
|
|
6076
|
-
}
|
|
6077
|
-
}
|
|
6078
|
-
});
|
|
6079
5755
|
|
|
6080
5756
|
//#endregion
|
|
6081
5757
|
//#region src/modules/wallets/getConnectedAddresses/getConnectedAddresses.ts
|
|
@@ -6088,44 +5764,20 @@ const __getAvailableWalletProvidersData_wrapped = instrumentFunction({
|
|
|
6088
5764
|
* @param params.walletProviderKey - The unique key of the wallet provider to query.
|
|
6089
5765
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6090
5766
|
* @returns An array of connected wallet addresses.
|
|
6091
|
-
* @instrumented
|
|
5767
|
+
* @not-instrumented
|
|
6092
5768
|
*/
|
|
6093
5769
|
const getConnectedAddresses = ({ walletProviderKey }, client = getDefaultClient()) => {
|
|
6094
5770
|
return getWalletProviderByKey({ walletProviderKey }, client).getConnectedAddresses();
|
|
6095
5771
|
};
|
|
6096
|
-
const __getConnectedAddresses_impl = getConnectedAddresses;
|
|
6097
|
-
const __getConnectedAddresses_wrapped = instrumentFunction({
|
|
6098
|
-
fn: __getConnectedAddresses_impl,
|
|
6099
|
-
functionName: "getConnectedAddresses",
|
|
6100
|
-
getCore: () => {
|
|
6101
|
-
try {
|
|
6102
|
-
return getCore(getDefaultClient());
|
|
6103
|
-
} catch {
|
|
6104
|
-
return;
|
|
6105
|
-
}
|
|
6106
|
-
}
|
|
6107
|
-
});
|
|
6108
5772
|
|
|
6109
5773
|
//#endregion
|
|
6110
5774
|
//#region src/modules/wallets/getOwnerWalletAccountForSmartWalletAccount/getOwnerWalletAccountForSmartWalletAccount.ts
|
|
6111
|
-
/** @instrumented */
|
|
5775
|
+
/** @not-instrumented */
|
|
6112
5776
|
const getOwnerWalletAccountForSmartWalletAccount = ({ smartWalletAccount }, client = getDefaultClient()) => {
|
|
6113
|
-
const smartWalletVerifiedCredential =
|
|
5777
|
+
const smartWalletVerifiedCredential = getVerifiedCredentialForWalletAccount({ walletAccount: smartWalletAccount }, client);
|
|
6114
5778
|
assertDefined(smartWalletVerifiedCredential?.signerRefId, "Invalid smart wallet account");
|
|
6115
|
-
return
|
|
5779
|
+
return getWalletAccounts(client).find((walletAccount) => walletAccount.verifiedCredentialId === smartWalletVerifiedCredential.signerRefId);
|
|
6116
5780
|
};
|
|
6117
|
-
const __getOwnerWalletAccountForSmartWalletAccount_impl = getOwnerWalletAccountForSmartWalletAccount;
|
|
6118
|
-
const __getOwnerWalletAccountForSmartWalletAccount_wrapped = instrumentFunction({
|
|
6119
|
-
fn: __getOwnerWalletAccountForSmartWalletAccount_impl,
|
|
6120
|
-
functionName: "getOwnerWalletAccountForSmartWalletAccount",
|
|
6121
|
-
getCore: () => {
|
|
6122
|
-
try {
|
|
6123
|
-
return getCore(getDefaultClient());
|
|
6124
|
-
} catch {
|
|
6125
|
-
return;
|
|
6126
|
-
}
|
|
6127
|
-
}
|
|
6128
|
-
});
|
|
6129
5781
|
|
|
6130
5782
|
//#endregion
|
|
6131
5783
|
//#region src/modules/wallets/getWalletAccountAddressByType/getWalletAccountAddressByType.ts
|
|
@@ -6243,25 +5895,13 @@ const __addNetwork_wrapped = instrumentFunction({
|
|
|
6243
5895
|
* @param params.walletAccount - The wallet account to get network data for.
|
|
6244
5896
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6245
5897
|
* @returns A promise that resolves to the network data, or undefined if not found.
|
|
6246
|
-
* @instrumented
|
|
5898
|
+
* @not-instrumented
|
|
6247
5899
|
*/
|
|
6248
5900
|
const getActiveNetworkData = async ({ walletAccount }, client = getDefaultClient()) => {
|
|
6249
|
-
const walletProvider =
|
|
5901
|
+
const walletProvider = getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
6250
5902
|
const { networkId } = await walletProvider.getActiveNetworkId();
|
|
6251
|
-
return { networkData:
|
|
5903
|
+
return { networkData: getNetworksData(client).find((data) => data.networkId === networkId && data.chain === walletProvider.chain) };
|
|
6252
5904
|
};
|
|
6253
|
-
const __getActiveNetworkData_impl = getActiveNetworkData;
|
|
6254
|
-
const __getActiveNetworkData_wrapped = instrumentFunction({
|
|
6255
|
-
fn: __getActiveNetworkData_impl,
|
|
6256
|
-
functionName: "getActiveNetworkData",
|
|
6257
|
-
getCore: () => {
|
|
6258
|
-
try {
|
|
6259
|
-
return getCore(getDefaultClient());
|
|
6260
|
-
} catch {
|
|
6261
|
-
return;
|
|
6262
|
-
}
|
|
6263
|
-
}
|
|
6264
|
-
});
|
|
6265
5905
|
|
|
6266
5906
|
//#endregion
|
|
6267
5907
|
//#region src/modules/wallets/networks/getActiveNetworkId/getActiveNetworkId.ts
|
|
@@ -6271,23 +5911,11 @@ const __getActiveNetworkData_wrapped = instrumentFunction({
|
|
|
6271
5911
|
* @param params.walletAccount - The wallet account to get the network ID for.
|
|
6272
5912
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6273
5913
|
* @returns A promise that resolves to the active network ID for the wallet account.
|
|
6274
|
-
* @instrumented
|
|
5914
|
+
* @not-instrumented
|
|
6275
5915
|
*/
|
|
6276
5916
|
const getActiveNetworkId = ({ walletAccount }, client = getDefaultClient()) => {
|
|
6277
|
-
return
|
|
5917
|
+
return getWalletProviderFromWalletAccount({ walletAccount }, client).getActiveNetworkId();
|
|
6278
5918
|
};
|
|
6279
|
-
const __getActiveNetworkId_impl = getActiveNetworkId;
|
|
6280
|
-
const __getActiveNetworkId_wrapped = instrumentFunction({
|
|
6281
|
-
fn: __getActiveNetworkId_impl,
|
|
6282
|
-
functionName: "getActiveNetworkId",
|
|
6283
|
-
getCore: () => {
|
|
6284
|
-
try {
|
|
6285
|
-
return getCore(getDefaultClient());
|
|
6286
|
-
} catch {
|
|
6287
|
-
return;
|
|
6288
|
-
}
|
|
6289
|
-
}
|
|
6290
|
-
});
|
|
6291
5919
|
|
|
6292
5920
|
//#endregion
|
|
6293
5921
|
//#region src/modules/wallets/networks/getBalance/getBalance.ts
|
|
@@ -6300,28 +5928,16 @@ const __getActiveNetworkId_wrapped = instrumentFunction({
|
|
|
6300
5928
|
* @param params.walletAccount - The wallet account to get the balance for.
|
|
6301
5929
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6302
5930
|
* @returns A promise that resolves to an object containing the balance as a string or null.
|
|
6303
|
-
* @instrumented
|
|
5931
|
+
* @not-instrumented
|
|
6304
5932
|
*/
|
|
6305
5933
|
const getBalance = async ({ walletAccount }, client = getDefaultClient()) => {
|
|
6306
|
-
const walletProvider =
|
|
5934
|
+
const walletProvider = getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
6307
5935
|
const { networkId } = await walletProvider.getActiveNetworkId();
|
|
6308
|
-
return
|
|
5936
|
+
return getNetworkProviderFromNetworkId({
|
|
6309
5937
|
chain: walletProvider.chain,
|
|
6310
5938
|
networkId
|
|
6311
5939
|
}, client).getBalance({ address: walletAccount.address });
|
|
6312
5940
|
};
|
|
6313
|
-
const __getBalance_impl = getBalance;
|
|
6314
|
-
const __getBalance_wrapped = instrumentFunction({
|
|
6315
|
-
fn: __getBalance_impl,
|
|
6316
|
-
functionName: "getBalance",
|
|
6317
|
-
getCore: () => {
|
|
6318
|
-
try {
|
|
6319
|
-
return getCore(getDefaultClient());
|
|
6320
|
-
} catch {
|
|
6321
|
-
return;
|
|
6322
|
-
}
|
|
6323
|
-
}
|
|
6324
|
-
});
|
|
6325
5941
|
|
|
6326
5942
|
//#endregion
|
|
6327
5943
|
//#region src/modules/wallets/networks/getBalanceForAddress/getBalanceForAddress.ts
|
|
@@ -6336,28 +5952,16 @@ const __getBalance_wrapped = instrumentFunction({
|
|
|
6336
5952
|
* @param params.networkId - The specific network ID within the chain.
|
|
6337
5953
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6338
5954
|
* @returns A promise that resolves to an object containing the balance as a string or null.
|
|
6339
|
-
* @instrumented
|
|
5955
|
+
* @not-instrumented
|
|
6340
5956
|
*/
|
|
6341
5957
|
const getBalanceForAddress = async ({ address, chain, networkId }, client = getDefaultClient()) => {
|
|
6342
|
-
const networkProvider =
|
|
5958
|
+
const networkProvider = getNetworkProviderFromNetworkId({
|
|
6343
5959
|
chain,
|
|
6344
5960
|
networkId
|
|
6345
5961
|
}, client);
|
|
6346
5962
|
assertDefined(networkProvider, `No network found for chain ${chain} and network id ${networkId}. Please ensure you've enabled this network in the Dashboard.`);
|
|
6347
5963
|
return networkProvider.getBalance({ address });
|
|
6348
5964
|
};
|
|
6349
|
-
const __getBalanceForAddress_impl = getBalanceForAddress;
|
|
6350
|
-
const __getBalanceForAddress_wrapped = instrumentFunction({
|
|
6351
|
-
fn: __getBalanceForAddress_impl,
|
|
6352
|
-
functionName: "getBalanceForAddress",
|
|
6353
|
-
getCore: () => {
|
|
6354
|
-
try {
|
|
6355
|
-
return getCore(getDefaultClient());
|
|
6356
|
-
} catch {
|
|
6357
|
-
return;
|
|
6358
|
-
}
|
|
6359
|
-
}
|
|
6360
|
-
});
|
|
6361
5965
|
|
|
6362
5966
|
//#endregion
|
|
6363
5967
|
//#region src/modules/wallets/networks/getTransactionHistory/getTransactionHistory.ts
|
|
@@ -6374,29 +5978,17 @@ const __getBalanceForAddress_wrapped = instrumentFunction({
|
|
|
6374
5978
|
* @param [params.offset] - The offset to use for pagination.
|
|
6375
5979
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6376
5980
|
* @returns A promise that resolves to the transaction history along with nextOffset for the given wallet address and chain.
|
|
6377
|
-
* @instrumented
|
|
5981
|
+
* @not-instrumented
|
|
6378
5982
|
*/
|
|
6379
5983
|
const getTransactionHistory = async (params, client = getDefaultClient()) => {
|
|
6380
5984
|
const core = getCore(client);
|
|
6381
|
-
return await
|
|
5985
|
+
return await createApiClient({}, client).getWalletTransactions({
|
|
6382
5986
|
address: params.address,
|
|
6383
5987
|
chainName: params.chain,
|
|
6384
5988
|
environmentId: core.environmentId,
|
|
6385
5989
|
networkId: params.networkId
|
|
6386
5990
|
});
|
|
6387
5991
|
};
|
|
6388
|
-
const __getTransactionHistory_impl = getTransactionHistory;
|
|
6389
|
-
const __getTransactionHistory_wrapped = instrumentFunction({
|
|
6390
|
-
fn: __getTransactionHistory_impl,
|
|
6391
|
-
functionName: "getTransactionHistory",
|
|
6392
|
-
getCore: () => {
|
|
6393
|
-
try {
|
|
6394
|
-
return getCore(getDefaultClient());
|
|
6395
|
-
} catch {
|
|
6396
|
-
return;
|
|
6397
|
-
}
|
|
6398
|
-
}
|
|
6399
|
-
});
|
|
6400
5992
|
|
|
6401
5993
|
//#endregion
|
|
6402
5994
|
//#region src/modules/wallets/networks/isProgrammaticNetworkSwitchAvailable/isProgrammaticNetworkSwitchAvailable.ts
|
|
@@ -6460,12 +6052,12 @@ const __switchActiveNetwork_wrapped = instrumentFunction({
|
|
|
6460
6052
|
*/
|
|
6461
6053
|
const selectPrimaryWalletAccount = async ({ walletAccount }, client = getDefaultClient()) => {
|
|
6462
6054
|
const core = getCore(client);
|
|
6463
|
-
if (
|
|
6464
|
-
if (walletAccount.verifiedCredentialId)
|
|
6055
|
+
if (getPrimaryWalletAccount(client)?.id === walletAccount.id) return;
|
|
6056
|
+
if (walletAccount.verifiedCredentialId) updateAuthFromVerifyResponse({ response: await createApiClient({}, client).selectUserWallet({
|
|
6465
6057
|
environmentId: core.environmentId,
|
|
6466
6058
|
userWalletSelectionRequest: { walletId: walletAccount.verifiedCredentialId }
|
|
6467
6059
|
}) }, client);
|
|
6468
|
-
else
|
|
6060
|
+
else setUnverifiedWalletAccounts({ unverifiedWalletAccountsToUpdate: [{
|
|
6469
6061
|
...walletAccount,
|
|
6470
6062
|
lastSelectedAt: /* @__PURE__ */ new Date()
|
|
6471
6063
|
}] }, client);
|
|
@@ -6494,7 +6086,7 @@ const __selectPrimaryWalletAccount_wrapped = instrumentFunction({
|
|
|
6494
6086
|
*/
|
|
6495
6087
|
const disconnectWalletAccount = async ({ walletAccount }, client) => {
|
|
6496
6088
|
try {
|
|
6497
|
-
await
|
|
6089
|
+
await getWalletProviderFromWalletAccount({ walletAccount }, client).disconnectWalletAccount?.({ walletAccount });
|
|
6498
6090
|
} catch (error) {
|
|
6499
6091
|
if (error instanceof NoWalletProviderFoundError) return;
|
|
6500
6092
|
throw error;
|
|
@@ -6517,13 +6109,13 @@ const disconnectWalletAccount = async ({ walletAccount }, client) => {
|
|
|
6517
6109
|
*/
|
|
6518
6110
|
const removeWalletAccount = async ({ walletAccount }, client = getDefaultClient()) => {
|
|
6519
6111
|
const core = getCore(client);
|
|
6520
|
-
const apiClient =
|
|
6112
|
+
const apiClient = createApiClient({}, client);
|
|
6521
6113
|
await disconnectWalletAccount({ walletAccount }, client);
|
|
6522
6114
|
if (!walletAccount.verifiedCredentialId) {
|
|
6523
|
-
|
|
6115
|
+
removeUnverifiedWalletAccount({ unverifiedWalletAccount: walletAccount }, client);
|
|
6524
6116
|
return;
|
|
6525
6117
|
}
|
|
6526
|
-
|
|
6118
|
+
updateAuthFromVerifyResponse({ response: await apiClient.verifyUnlink({
|
|
6527
6119
|
environmentId: core.environmentId,
|
|
6528
6120
|
verifyUnlinkRequest: { walletId: walletAccount.verifiedCredentialId }
|
|
6529
6121
|
}) }, client);
|
|
@@ -6556,7 +6148,7 @@ const __removeWalletAccount_wrapped = instrumentFunction({
|
|
|
6556
6148
|
* @instrumented
|
|
6557
6149
|
*/
|
|
6558
6150
|
const signMessage = async ({ walletAccount, message }, client = getDefaultClient()) => {
|
|
6559
|
-
const walletProvider =
|
|
6151
|
+
const walletProvider = getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
6560
6152
|
assertWalletProviderMethodDefined(walletProvider, "signMessage");
|
|
6561
6153
|
const { signature } = await walletProvider.signMessage({
|
|
6562
6154
|
message,
|
|
@@ -6595,7 +6187,7 @@ const __signMessage_wrapped = instrumentFunction({
|
|
|
6595
6187
|
* @instrumented
|
|
6596
6188
|
*/
|
|
6597
6189
|
const transferAmount = async ({ walletAccount, amount, recipient, token }, client = getDefaultClient()) => {
|
|
6598
|
-
const walletProvider =
|
|
6190
|
+
const walletProvider = getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
6599
6191
|
assertWalletProviderMethodDefined(walletProvider, "transferAmount");
|
|
6600
6192
|
const { transactionHash } = await walletProvider.transferAmount({
|
|
6601
6193
|
amount,
|
|
@@ -6668,7 +6260,7 @@ const __transferWalletAccount_wrapped = instrumentFunction({
|
|
|
6668
6260
|
* @not-instrumented
|
|
6669
6261
|
*/
|
|
6670
6262
|
const getWalletAccountFromAddress = ({ address, chain }, client = getDefaultClient()) => {
|
|
6671
|
-
return
|
|
6263
|
+
return getWalletAccounts(client).find((walletAccount) => walletAccount.address === address && walletAccount.chain === chain);
|
|
6672
6264
|
};
|
|
6673
6265
|
|
|
6674
6266
|
//#endregion
|
|
@@ -6682,25 +6274,13 @@ const getWalletAccountFromAddress = ({ address, chain }, client = getDefaultClie
|
|
|
6682
6274
|
* @param params.event - The event name to remove the listener from.
|
|
6683
6275
|
* @param params.walletProviderKey - The unique key identifying the wallet provider to remove the listener from.
|
|
6684
6276
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6685
|
-
* @instrumented
|
|
6277
|
+
* @not-instrumented
|
|
6686
6278
|
*/
|
|
6687
6279
|
const offWalletProviderEvent = ({ callback, event, walletProviderKey }, client = getDefaultClient()) => {
|
|
6688
6280
|
const walletProvider = getWalletProviderByKey({ walletProviderKey }, client);
|
|
6689
6281
|
assertWalletProviderMethodDefined(walletProvider, "events");
|
|
6690
6282
|
walletProvider.events.off(event, callback);
|
|
6691
6283
|
};
|
|
6692
|
-
const __offWalletProviderEvent_impl = offWalletProviderEvent;
|
|
6693
|
-
const __offWalletProviderEvent_wrapped = instrumentFunction({
|
|
6694
|
-
fn: __offWalletProviderEvent_impl,
|
|
6695
|
-
functionName: "offWalletProviderEvent",
|
|
6696
|
-
getCore: () => {
|
|
6697
|
-
try {
|
|
6698
|
-
return getCore(getDefaultClient());
|
|
6699
|
-
} catch {
|
|
6700
|
-
return;
|
|
6701
|
-
}
|
|
6702
|
-
}
|
|
6703
|
-
});
|
|
6704
6284
|
|
|
6705
6285
|
//#endregion
|
|
6706
6286
|
//#region src/modules/wallets/walletProvider/events/onWalletProviderEvent/onWalletProviderEvent.ts
|
|
@@ -6712,7 +6292,7 @@ const __offWalletProviderEvent_wrapped = instrumentFunction({
|
|
|
6712
6292
|
* @param params.walletProviderKey - The unique key identifying the wallet provider to listen to.
|
|
6713
6293
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6714
6294
|
* @returns A function that can be called to remove the listener.
|
|
6715
|
-
* @instrumented
|
|
6295
|
+
* @not-instrumented
|
|
6716
6296
|
*/
|
|
6717
6297
|
const onWalletProviderEvent = ({ callback, event, walletProviderKey }, client = getDefaultClient()) => {
|
|
6718
6298
|
const walletProvider = getWalletProviderByKey({ walletProviderKey }, client);
|
|
@@ -6722,18 +6302,6 @@ const onWalletProviderEvent = ({ callback, event, walletProviderKey }, client =
|
|
|
6722
6302
|
walletProvider.events.off(event, callback);
|
|
6723
6303
|
};
|
|
6724
6304
|
};
|
|
6725
|
-
const __onWalletProviderEvent_impl = onWalletProviderEvent;
|
|
6726
|
-
const __onWalletProviderEvent_wrapped = instrumentFunction({
|
|
6727
|
-
fn: __onWalletProviderEvent_impl,
|
|
6728
|
-
functionName: "onWalletProviderEvent",
|
|
6729
|
-
getCore: () => {
|
|
6730
|
-
try {
|
|
6731
|
-
return getCore(getDefaultClient());
|
|
6732
|
-
} catch {
|
|
6733
|
-
return;
|
|
6734
|
-
}
|
|
6735
|
-
}
|
|
6736
|
-
});
|
|
6737
6305
|
|
|
6738
6306
|
//#endregion
|
|
6739
6307
|
//#region src/utils/parseUserAgent/parseUserAgent.ts
|
|
@@ -6816,5 +6384,5 @@ const parseUserAgent = ({ userAgent }) => {
|
|
|
6816
6384
|
assertPackageVersion(name, version);
|
|
6817
6385
|
|
|
6818
6386
|
//#endregion
|
|
6819
|
-
export { BaseError, CheckoutSessionTokenMissingError, ClientAlreadyInitializedError, DeeplinkConnectAndVerifyUnsupportedError, FeeEstimationFailedError, InvalidDeviceRegistrationRedirectError, InvalidExternalAuthError, InvalidParamError, InvalidRedirectStorageStateError, LinkCredentialError, MFAAction, MfaInvalidOtpError, MfaRateLimitedError, MissingRedirectStorageStateError, MissingSocialUrlParamError, MissingUserVerificationError, NetworkAddingUnavailableError, NetworkNotAddedError, NetworkSwitchingUnavailableError, NoAddressFoundError, NoNetworkProvidersError, NoPasskeyCredentialsFoundError, NoSmartWalletAccountSignerFoundError, NoWebAuthNSupportError, NotWaasWalletAccountError, SandboxMaximumThresholdReachedError, SimulationFailedError, TokenSwapError, UnauthorizedError, UnavailableInServerSideError, UnrecognizedNetworkError, UserNotAuthenticatedError, UserRejectedError, WalletAccountAlreadyVerifiedError, WalletAccountNotSelectedError, WalletAlreadyLinkedToAnotherUserError, WalletProviderMethodUnavailableError, __acknowledgeRecoveryCodes_wrapped as acknowledgeRecoveryCodes,
|
|
6387
|
+
export { BaseError, CheckoutSessionTokenMissingError, ClientAlreadyInitializedError, DeeplinkConnectAndVerifyUnsupportedError, FeeEstimationFailedError, InvalidDeviceRegistrationRedirectError, InvalidExternalAuthError, InvalidParamError, InvalidRedirectStorageStateError, LinkCredentialError, MFAAction, MfaInvalidOtpError, MfaRateLimitedError, MissingRedirectStorageStateError, MissingSocialUrlParamError, MissingUserVerificationError, NetworkAddingUnavailableError, NetworkNotAddedError, NetworkSwitchingUnavailableError, NoAddressFoundError, NoNetworkProvidersError, NoPasskeyCredentialsFoundError, NoSmartWalletAccountSignerFoundError, NoWebAuthNSupportError, NotWaasWalletAccountError, SandboxMaximumThresholdReachedError, SimulationFailedError, TokenSwapError, UnauthorizedError, UnavailableInServerSideError, UnrecognizedNetworkError, UserNotAuthenticatedError, UserRejectedError, WalletAccountAlreadyVerifiedError, WalletAccountNotSelectedError, WalletAlreadyLinkedToAnotherUserError, WalletProviderMethodUnavailableError, __acknowledgeRecoveryCodes_wrapped as acknowledgeRecoveryCodes, addCoinbaseOnrampOrderEventListener, __addNetwork_wrapped as addNetwork, assertWalletAccountSigningAvailability, assertWalletProviderMethodDefined, __attachCheckoutTransactionSource_wrapped as attachCheckoutTransactionSource, authenticateMfaRecoveryCode, authenticatePasskeyMFA, authenticateTotpMfaDevice, __authenticateWithSocial_wrapped as authenticateWithSocial, __broadcastCheckoutTransaction_wrapped as broadcastCheckoutTransaction, canConnectWithHardwareWallet, __cancelCheckoutTransaction_wrapped as cancelCheckoutTransaction, __checkStepUpAuth_wrapped as checkStepUpAuth, __completeDeviceRegistration_wrapped as completeDeviceRegistration, __completeSocialAuthentication_wrapped as completeSocialAuthentication, __completeSocialRedirect_wrapped as completeSocialRedirect, __confirmTransaction_wrapped as confirmTransaction, __connectAndVerifyWithWalletProvider_wrapped as connectAndVerifyWithWalletProvider, __connectWithWalletProvider_wrapped as connectWithWalletProvider, __consumeMfaToken_wrapped as consumeMfaToken, __createCheckoutTransaction_wrapped as createCheckoutTransaction, __createCoinbaseOnrampOrder_wrapped as createCoinbaseOnrampOrder, __createCryptoDotComPayment_wrapped as createCryptoDotComPayment, __createDynamicClient_wrapped as createDynamicClient, __createKrakenExchangeTransfer_wrapped as createKrakenExchangeTransfer, __createNewMfaRecoveryCodes_wrapped as createNewMfaRecoveryCodes, __deleteMfaDevice_wrapped as deleteMfaDevice, __deletePasskey_wrapped as deletePasskey, __deleteUser_wrapped as deleteUser, detectDeviceRegistrationRedirect, detectOAuthRedirect, detectSocialRedirectUrl, __executeSwapTransaction_wrapped as executeSwapTransaction, fetchProjectSettings, getActiveNetworkData, getActiveNetworkId, getAvailableWalletProvidersData, getBalance, getBalanceForAddress, getBalances, getCheckoutTransaction, getCheckoutTransactionQuote, getCoinbaseBuyUrl, getConnectedAddresses, getDefaultClient, getDeviceRegistrationTokenFromUrl, __getElevatedAccessToken_wrapped as getElevatedAccessToken, getKrakenAccounts, getKrakenWhitelistedAddresses, getMfaDevices, getMfaMethods, getMfaRecoveryCodes, getMissingVerificationForCoinbaseOnrampOrder, getMultichainBalances, getNetworksData, getOwnerWalletAccountForSmartWalletAccount, getPasskeys, getPrimaryWalletAccount, getRegisteredDevices, getSwapQuote, getSwapStatus, getTransactionHistory, getUserSocialAccounts, getWalletAccountAddressByType, getWalletAccountFromAddress, getWalletAccounts, getWalletConnectCatalog, getWalletConnectCatalogWalletByWalletProviderKey, getWalletProviderDataByKey, hasExtension, __initializeClient_wrapped as initializeClient, isCaptchaRequired, isDeeplinkWalletProvider, isDeviceRegistrationRequired, isHardwareWalletAccount, isMfaRequiredForAction, isMobile, isPendingRecoveryCodesAcknowledgment, isProgrammaticNetworkSwitchAvailable, isSignedIn, isUserMissingMfaAuth, isUserOnboardingComplete, isWalletAccountVerified, logout, offEvent, offWalletProviderEvent, onEvent, onWalletProviderEvent, onceEvent, parseUserAgent, __prepareCheckoutTransaction_wrapped as prepareCheckoutTransaction, __proveWalletAccountOwnership_wrapped as proveWalletAccountOwnership, __refreshAuth_wrapped as refreshAuth, __refreshUser_wrapped as refreshUser, __registerPasskey_wrapped as registerPasskey, __registerTotpMfaDevice_wrapped as registerTotpMfaDevice, __removeWalletAccount_wrapped as removeWalletAccount, __requestExternalAuthElevatedToken_wrapped as requestExternalAuthElevatedToken, requiresConversion, __revokeAllRegisteredDevices_wrapped as revokeAllRegisteredDevices, __revokeRegisteredDevice_wrapped as revokeRegisteredDevice, __selectPrimaryWalletAccount_wrapped as selectPrimaryWalletAccount, __sendEmailOTP_wrapped as sendEmailOTP, __sendSmsOTP_wrapped as sendSmsOTP, __setCaptchaToken_wrapped as setCaptchaToken, __setDefaultMfaDevice_wrapped as setDefaultMfaDevice, __setInstrumentationEnabled_wrapped as setInstrumentationEnabled, __signInWithExternalJwt_wrapped as signInWithExternalJwt, __signInWithPasskey_wrapped as signInWithPasskey, __signInWithSocialRedirect_wrapped as signInWithSocialRedirect, __signMessage_wrapped as signMessage, __submitCheckoutTransaction_wrapped as submitCheckoutTransaction, supportedCountries, __switchActiveNetwork_wrapped as switchActiveNetwork, trackCheckoutTransaction, __transferAmount_wrapped as transferAmount, __transferWalletAccount_wrapped as transferWalletAccount, __unlinkSocialAccount_wrapped as unlinkSocialAccount, __updateUser_wrapped as updateUser, __verifyOTP_wrapped as verifyOTP, __verifyWalletAccount_wrapped as verifyWalletAccount, waitForClientInitialized };
|
|
6820
6388
|
//# sourceMappingURL=index.esm.js.map
|