@dynamic-labs-sdk/client 1.17.1 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/createDynamicClient/createDynamicClient.d.ts +11 -1
- package/dist/client/createDynamicClient/createDynamicClient.d.ts.map +1 -1
- package/dist/client/defaultClient/defaultClient.d.ts +12 -1
- package/dist/client/defaultClient/defaultClient.d.ts.map +1 -1
- package/dist/core.cjs +7 -5
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +6 -6
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +6 -6
- package/dist/core.native.esm.js.map +1 -1
- package/dist/errors/APIError/APIError.d.ts +11 -1
- package/dist/errors/APIError/APIError.d.ts.map +1 -1
- package/dist/errors/DeviceRegistrationIdentityMismatchError.d.ts +26 -0
- package/dist/errors/DeviceRegistrationIdentityMismatchError.d.ts.map +1 -0
- package/dist/errors/MergeAccountsConfirmationError.d.ts +49 -0
- package/dist/errors/MergeAccountsConfirmationError.d.ts.map +1 -0
- package/dist/errors/UnsafeDeeplinkUrlError.d.ts +17 -0
- package/dist/errors/UnsafeDeeplinkUrlError.d.ts.map +1 -0
- package/dist/errors/UnsafeNavigationUrlError.d.ts +16 -0
- package/dist/errors/UnsafeNavigationUrlError.d.ts.map +1 -0
- package/dist/errors/WalletScreeningBlockedError.d.ts +27 -0
- package/dist/errors/WalletScreeningBlockedError.d.ts.map +1 -0
- package/dist/exports/core.d.ts +4 -0
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/exports/index.d.ts +18 -3
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/exports/waas.d.ts +2 -0
- package/dist/exports/waas.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-CS4r9hi7.cjs → getNetworkProviderFromNetworkId-BJX2AMGR.cjs} +190 -19
- package/dist/getNetworkProviderFromNetworkId-BJX2AMGR.cjs.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-Bfg-NkNJ.native.esm.js → getNetworkProviderFromNetworkId-Bsv12Q6B.native.esm.js} +165 -10
- package/dist/getNetworkProviderFromNetworkId-Bsv12Q6B.native.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-pknqqhk1.esm.js → getNetworkProviderFromNetworkId-D3uwhdMN.esm.js} +166 -19
- package/dist/getNetworkProviderFromNetworkId-D3uwhdMN.esm.js.map +1 -0
- package/dist/{getSignedSessionId-cMGkmojJ.cjs → getSignedSessionId-BIZJGg61.cjs} +3 -3
- package/dist/{getSignedSessionId-cMGkmojJ.cjs.map → getSignedSessionId-BIZJGg61.cjs.map} +1 -1
- package/dist/{getSignedSessionId-CUw7LJ35.esm.js → getSignedSessionId-CnSAMO3P.esm.js} +3 -3
- package/dist/{getSignedSessionId-CUw7LJ35.esm.js.map → getSignedSessionId-CnSAMO3P.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-Cl3PEqa8.native.esm.js → getSignedSessionId-DXDi7NkE.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-Cl3PEqa8.native.esm.js.map → getSignedSessionId-DXDi7NkE.native.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-CP9Te5Sz.cjs → getWalletProviderByKey-C6aS7KgD.cjs} +2 -2
- package/dist/{getWalletProviderByKey-CP9Te5Sz.cjs.map → getWalletProviderByKey-C6aS7KgD.cjs.map} +1 -1
- package/dist/{getWalletProviderByKey-lQVfIGFi.esm.js → getWalletProviderByKey-Cr8m-Nax.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-lQVfIGFi.esm.js.map → getWalletProviderByKey-Cr8m-Nax.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-24co0tBE.native.esm.js → getWalletProviderByKey-DVk2t98D.native.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-24co0tBE.native.esm.js.map → getWalletProviderByKey-DVk2t98D.native.esm.js.map} +1 -1
- package/dist/index.cjs +950 -111
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +940 -112
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +867 -111
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isDynamicWaasEnabled-BwP1oowd.cjs → isDynamicWaasEnabled-BawttOeb.cjs} +21 -9
- package/dist/isDynamicWaasEnabled-BawttOeb.cjs.map +1 -0
- package/dist/{isDynamicWaasEnabled-BYaqAOml.esm.js → isDynamicWaasEnabled-DDrg89y1.esm.js} +20 -8
- package/dist/isDynamicWaasEnabled-DDrg89y1.esm.js.map +1 -0
- package/dist/{isDynamicWaasEnabled-BXe0VyI4.native.esm.js → isDynamicWaasEnabled-Dj_sLoBO.native.esm.js} +20 -8
- package/dist/isDynamicWaasEnabled-Dj_sLoBO.native.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-Btejc5g3.cjs → isMfaRequiredForAction-BuvyBN_r.cjs} +21 -6
- package/dist/isMfaRequiredForAction-BuvyBN_r.cjs.map +1 -0
- package/dist/{isMfaRequiredForAction-CqEcCTIe.esm.js → isMfaRequiredForAction-DTp4CZBt.esm.js} +21 -6
- package/dist/isMfaRequiredForAction-DTp4CZBt.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-Demz9zlH.native.esm.js → isMfaRequiredForAction-EY-OQORc.native.esm.js} +3 -5
- package/dist/isMfaRequiredForAction-EY-OQORc.native.esm.js.map +1 -0
- package/dist/{isUserOnboardingComplete-C86NDY7I.cjs → isUserOnboardingComplete-CkyzRYrg.cjs} +14 -4
- package/dist/isUserOnboardingComplete-CkyzRYrg.cjs.map +1 -0
- package/dist/{isUserOnboardingComplete-CBrAH0ZF.esm.js → isUserOnboardingComplete-D3HrBYje.native.esm.js} +13 -3
- package/dist/isUserOnboardingComplete-D3HrBYje.native.esm.js.map +1 -0
- package/dist/{isUserOnboardingComplete-Cr-YTpcU.native.esm.js → isUserOnboardingComplete-Dy2Ygp0u.esm.js} +13 -3
- package/dist/isUserOnboardingComplete-Dy2Ygp0u.esm.js.map +1 -0
- package/dist/{migrateFromFireblocks-D-J6-gRo.native.esm.js → migrateFromFireblocks-B5qWGLCM.native.esm.js} +3 -3
- package/dist/{migrateFromFireblocks-D-J6-gRo.native.esm.js.map → migrateFromFireblocks-B5qWGLCM.native.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-B_q8Oawb.cjs → migrateFromFireblocks-Dp-QA9hi.cjs} +3 -3
- package/dist/{migrateFromFireblocks-B_q8Oawb.cjs.map → migrateFromFireblocks-Dp-QA9hi.cjs.map} +1 -1
- package/dist/{migrateFromFireblocks-Bbx2wHZD.esm.js → migrateFromFireblocks-MAatsk_w.esm.js} +3 -3
- package/dist/{migrateFromFireblocks-Bbx2wHZD.esm.js.map → migrateFromFireblocks-MAatsk_w.esm.js.map} +1 -1
- package/dist/modules/apiClient/constants.d.ts +8 -0
- package/dist/modules/apiClient/constants.d.ts.map +1 -1
- package/dist/modules/apiClient/createApiClient.d.ts.map +1 -1
- package/dist/modules/auth/externalAuth/requestExternalAuthElevatedToken/requestExternalAuthElevatedToken.d.ts +0 -1
- package/dist/modules/auth/externalAuth/requestExternalAuthElevatedToken/requestExternalAuthElevatedToken.d.ts.map +1 -1
- package/dist/modules/auth/externalAuth/signInWithExternalJwt/signInWithExternalJwt.d.ts +11 -2
- package/dist/modules/auth/externalAuth/signInWithExternalJwt/signInWithExternalJwt.d.ts.map +1 -1
- package/dist/modules/auth/isSignedIn/isSignedIn.d.ts +9 -0
- package/dist/modules/auth/isSignedIn/isSignedIn.d.ts.map +1 -1
- package/dist/modules/auth/logout/logout.d.ts +13 -0
- package/dist/modules/auth/logout/logout.d.ts.map +1 -1
- package/dist/modules/auth/logoutWithReason/logoutWithReason.d.ts.map +1 -1
- package/dist/modules/auth/mergeUserAccounts/index.d.ts +3 -0
- package/dist/modules/auth/mergeUserAccounts/index.d.ts.map +1 -0
- package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.d.ts +62 -0
- package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.d.ts.map +1 -0
- package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.types.d.ts +78 -0
- package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.types.d.ts.map +1 -0
- package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts +7 -1
- package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts.map +1 -1
- package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts +9 -1
- package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/authenticateWithSocial/authenticateWithSocial.d.ts +8 -0
- package/dist/modules/auth/social/oauth/authenticateWithSocial/authenticateWithSocial.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.d.ts +34 -0
- package/dist/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/clearSocialRedirectParams/index.d.ts +2 -0
- package/dist/modules/auth/social/oauth/clearSocialRedirectParams/index.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.d.ts +11 -0
- package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.d.ts +0 -1
- package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/signInWithSocialPopUp/signInWithSocialPopUp.d.ts +12 -0
- package/dist/modules/auth/social/oauth/signInWithSocialPopUp/signInWithSocialPopUp.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/getOAuthBaseUrl/getOAuthBaseUrl.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/signInWithSocialRedirect.d.ts +10 -0
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/signInWithSocialRedirect.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.d.ts +0 -1
- package/dist/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.d.ts.map +1 -1
- package/dist/modules/auth/updateAuthFromVerifyResponse/updateAuthFromVerifyResponse.d.ts.map +1 -1
- package/dist/modules/captcha/CaptchaProviderEnum/CaptchaProviderEnum.d.ts +37 -0
- package/dist/modules/captcha/CaptchaProviderEnum/CaptchaProviderEnum.d.ts.map +1 -0
- package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.d.ts +50 -0
- package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.d.ts.map +1 -0
- package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.types.d.ts +22 -0
- package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.types.d.ts.map +1 -0
- package/dist/modules/captcha/getCaptchaSettings/index.d.ts +3 -0
- package/dist/modules/captcha/getCaptchaSettings/index.d.ts.map +1 -0
- package/dist/modules/captcha/isCaptchaRequired/isCaptchaRequired.d.ts.map +1 -1
- package/dist/modules/captcha/setCaptchaToken/setCaptchaToken.d.ts +0 -1
- package/dist/modules/captcha/setCaptchaToken/setCaptchaToken.d.ts.map +1 -1
- package/dist/modules/clientEvents/clientEvents.d.ts +34 -0
- package/dist/modules/clientEvents/clientEvents.d.ts.map +1 -1
- package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/clearDeviceRegistrationRedirectParams.d.ts +35 -0
- package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/clearDeviceRegistrationRedirectParams.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/index.d.ts +2 -0
- package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/index.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.d.ts +8 -1
- package/dist/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.d.ts.map +1 -1
- package/dist/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.d.ts +1 -0
- package/dist/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.d.ts.map +1 -1
- package/dist/modules/flow/attachFlowSource/attachFlowSource.instrumentation.d.ts +9 -0
- package/dist/modules/flow/attachFlowSource/attachFlowSource.instrumentation.d.ts.map +1 -0
- package/dist/modules/flow/broadcastFlow/broadcastFlow.instrumentation.d.ts +9 -0
- package/dist/modules/flow/broadcastFlow/broadcastFlow.instrumentation.d.ts.map +1 -0
- package/dist/modules/flow/cancelFlow/cancelFlow.d.ts +10 -3
- package/dist/modules/flow/cancelFlow/cancelFlow.d.ts.map +1 -1
- package/dist/modules/flow/cancelFlow/cancelFlow.instrumentation.d.ts +8 -0
- package/dist/modules/flow/cancelFlow/cancelFlow.instrumentation.d.ts.map +1 -0
- package/dist/modules/flow/getFlow/getFlow.d.ts +11 -3
- package/dist/modules/flow/getFlow/getFlow.d.ts.map +1 -1
- package/dist/modules/flow/getFlowQuote/getFlowQuote.d.ts +16 -3
- package/dist/modules/flow/getFlowQuote/getFlowQuote.d.ts.map +1 -1
- package/dist/modules/flow/prepareFlowSigning/prepareFlowSigning.instrumentation.d.ts +9 -0
- package/dist/modules/flow/prepareFlowSigning/prepareFlowSigning.instrumentation.d.ts.map +1 -0
- package/dist/modules/flow/submitFlowTransaction/submitFlowTransaction.instrumentation.d.ts +9 -0
- package/dist/modules/flow/submitFlowTransaction/submitFlowTransaction.instrumentation.d.ts.map +1 -0
- package/dist/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.d.ts +0 -4
- package/dist/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.d.ts.map +1 -1
- package/dist/modules/initializeClient/initializeClient.d.ts +16 -0
- package/dist/modules/initializeClient/initializeClient.d.ts.map +1 -1
- package/dist/modules/initializeClient/waitForClientInitialized/waitForClientInitialized.d.ts +12 -2
- package/dist/modules/initializeClient/waitForClientInitialized/waitForClientInitialized.d.ts.map +1 -1
- package/dist/modules/mfa/consumeMfaToken/consumeMfaToken.d.ts +0 -1
- package/dist/modules/mfa/consumeMfaToken/consumeMfaToken.d.ts.map +1 -1
- package/dist/modules/mfa/createNewMfaRecoveryCodes/createNewMfaRecoveryCodes.d.ts +0 -1
- package/dist/modules/mfa/createNewMfaRecoveryCodes/createNewMfaRecoveryCodes.d.ts.map +1 -1
- package/dist/modules/mfa/isPendingRecoveryCodesAcknowledgment/isPendingRecoveryCodesAcknowledgment.d.ts +1 -0
- package/dist/modules/mfa/isPendingRecoveryCodesAcknowledgment/isPendingRecoveryCodesAcknowledgment.d.ts.map +1 -1
- package/dist/modules/mfa/isUserMissingMfaAuth/isUserMissingMfaAuth.d.ts +1 -0
- package/dist/modules/mfa/isUserMissingMfaAuth/isUserMissingMfaAuth.d.ts.map +1 -1
- package/dist/modules/mfa/registerTotpMfaDevice/registerTotpMfaDevice.d.ts +0 -3
- package/dist/modules/mfa/registerTotpMfaDevice/registerTotpMfaDevice.d.ts.map +1 -1
- package/dist/modules/otp/sendEmailOTP/sendEmailOTP.d.ts +14 -1
- package/dist/modules/otp/sendEmailOTP/sendEmailOTP.d.ts.map +1 -1
- package/dist/modules/otp/sendSmsOTP/sendSmsOTP.d.ts +12 -1
- package/dist/modules/otp/sendSmsOTP/sendSmsOTP.d.ts.map +1 -1
- package/dist/modules/otp/verifyOTP/verifyOTP.d.ts +33 -2
- package/dist/modules/otp/verifyOTP/verifyOTP.d.ts.map +1 -1
- package/dist/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.d.ts +1 -1
- package/dist/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.d.ts.map +1 -1
- package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts +8 -0
- package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts.map +1 -1
- package/dist/modules/user/checkUserScopes/checkUserScopes.d.ts +28 -0
- package/dist/modules/user/checkUserScopes/checkUserScopes.d.ts.map +1 -0
- package/dist/modules/user/checkUserScopes/index.d.ts +2 -0
- package/dist/modules/user/checkUserScopes/index.d.ts.map +1 -0
- package/dist/modules/user/deleteUser/deleteUser.d.ts +8 -0
- package/dist/modules/user/deleteUser/deleteUser.d.ts.map +1 -1
- package/dist/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.d.ts +9 -1
- package/dist/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.d.ts.map +1 -1
- package/dist/modules/user/refreshAuth/refreshAuth.d.ts +17 -4
- package/dist/modules/user/refreshAuth/refreshAuth.d.ts.map +1 -1
- package/dist/modules/user/refreshUser/refreshUser.d.ts +16 -3
- package/dist/modules/user/refreshUser/refreshUser.d.ts.map +1 -1
- package/dist/modules/user/updateUser/updateUser.d.ts +0 -1
- package/dist/modules/user/updateUser/updateUser.d.ts.map +1 -1
- package/dist/modules/user/user.types.d.ts +9 -1
- package/dist/modules/user/user.types.d.ts.map +1 -1
- package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/getEmbeddedWalletsRequiringUpgrade.d.ts +30 -0
- package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/getEmbeddedWalletsRequiringUpgrade.d.ts.map +1 -0
- package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/index.d.ts +2 -0
- package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/index.d.ts.map +1 -0
- package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/hasEmbeddedWalletsRequiringUpgrade.d.ts +23 -0
- package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/hasEmbeddedWalletsRequiringUpgrade.d.ts.map +1 -0
- package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/index.d.ts +2 -0
- package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/index.d.ts.map +1 -0
- package/dist/modules/wallets/connectAndVerifyWithWalletProvider/connectAndVerifyWithWalletProvider.d.ts +11 -1
- package/dist/modules/wallets/connectAndVerifyWithWalletProvider/connectAndVerifyWithWalletProvider.d.ts.map +1 -1
- package/dist/modules/wallets/connectWithWalletProvider/connectWithWalletProvider.d.ts +11 -3
- package/dist/modules/wallets/connectWithWalletProvider/connectWithWalletProvider.d.ts.map +1 -1
- package/dist/modules/wallets/disconnectWalletAccount/disconnectWalletAccount.d.ts +16 -3
- package/dist/modules/wallets/disconnectWalletAccount/disconnectWalletAccount.d.ts.map +1 -1
- package/dist/modules/wallets/getConnectedAddresses/getConnectedAddresses.d.ts +9 -1
- package/dist/modules/wallets/getConnectedAddresses/getConnectedAddresses.d.ts.map +1 -1
- package/dist/modules/wallets/getWalletAccounts/getWalletAccounts.d.ts +11 -1
- package/dist/modules/wallets/getWalletAccounts/getWalletAccounts.d.ts.map +1 -1
- package/dist/modules/wallets/getWalletProviderDataByKey/getWalletProviderDataByKey.d.ts +2 -1
- package/dist/modules/wallets/getWalletProviderDataByKey/getWalletProviderDataByKey.d.ts.map +1 -1
- package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts +9 -0
- package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts.map +1 -1
- package/dist/modules/wallets/isWalletAccountVerified/isWalletAccountVerified.d.ts +10 -2
- package/dist/modules/wallets/isWalletAccountVerified/isWalletAccountVerified.d.ts.map +1 -1
- package/dist/modules/wallets/networks/getBalance/getBalance.d.ts +8 -0
- package/dist/modules/wallets/networks/getBalance/getBalance.d.ts.map +1 -1
- package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts +8 -0
- package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts.map +1 -1
- package/dist/modules/wallets/networks/switchActiveNetwork/switchActiveNetwork.d.ts +11 -1
- package/dist/modules/wallets/networks/switchActiveNetwork/switchActiveNetwork.d.ts.map +1 -1
- package/dist/modules/wallets/proveWalletAccountOwnership/proveWalletAccountOwnership.d.ts +10 -0
- package/dist/modules/wallets/proveWalletAccountOwnership/proveWalletAccountOwnership.d.ts.map +1 -1
- package/dist/modules/wallets/removeWalletAccount/removeWalletAccount.d.ts +9 -1
- package/dist/modules/wallets/removeWalletAccount/removeWalletAccount.d.ts.map +1 -1
- package/dist/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts +24 -0
- package/dist/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts.map +1 -0
- package/dist/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/index.d.ts.map +1 -0
- package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/getSelectedWalletAccount.d.ts +30 -0
- package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/getSelectedWalletAccount.d.ts.map +1 -0
- package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/index.d.ts +2 -0
- package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/index.d.ts.map +1 -0
- package/dist/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/index.d.ts.map +1 -0
- package/dist/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts +28 -0
- package/dist/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts.map +1 -0
- package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/index.d.ts +2 -0
- package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/index.d.ts.map +1 -0
- package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/setSelectedWalletAccount.d.ts +34 -0
- package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/setSelectedWalletAccount.d.ts.map +1 -0
- package/dist/modules/wallets/signMessage/signMessage.d.ts +12 -1
- package/dist/modules/wallets/signMessage/signMessage.d.ts.map +1 -1
- package/dist/modules/wallets/transferAmount/transferAmount.d.ts +13 -2
- package/dist/modules/wallets/transferAmount/transferAmount.d.ts.map +1 -1
- package/dist/modules/wallets/transferWalletAccount/transferWalletAccount.d.ts +10 -1
- package/dist/modules/wallets/transferWalletAccount/transferWalletAccount.d.ts.map +1 -1
- package/dist/modules/wallets/utils/getWalletAccountFromAddress/getWalletAccountFromAddress.d.ts +11 -1
- package/dist/modules/wallets/utils/getWalletAccountFromAddress/getWalletAccountFromAddress.d.ts.map +1 -1
- package/dist/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.d.ts +3 -0
- package/dist/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.d.ts.map +1 -1
- package/dist/modules/wallets/verifyWalletAccount/verifyWalletAccount.d.ts +12 -1
- package/dist/modules/wallets/verifyWalletAccount/verifyWalletAccount.d.ts.map +1 -1
- package/dist/services/instrumentation/createInstrumentation/createInstrumentation.d.ts.map +1 -1
- package/dist/services/instrumentation/instrumentFunction/instrumentFunction.d.ts +40 -34
- package/dist/services/instrumentation/instrumentFunction/instrumentFunction.d.ts.map +1 -1
- package/dist/services/instrumentation/instrumentation.types.d.ts +50 -19
- package/dist/services/instrumentation/instrumentation.types.d.ts.map +1 -1
- package/dist/services/keychain/createKeychainService/createKeychainService.d.ts.map +1 -1
- package/dist/services/navigate/createNavigationHandler/createNavigationHandler.d.ts.map +1 -1
- package/dist/services/openDeeplink/createWebDeeplinkOpener/createWebDeeplinkOpener.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/{updateAuthFromVerifyResponse-D1w-Aw9P.native.esm.js → updateAuthFromVerifyResponse-DFjqCSu2.native.esm.js} +235 -159
- package/dist/updateAuthFromVerifyResponse-DFjqCSu2.native.esm.js.map +1 -0
- package/dist/{updateAuthFromVerifyResponse-azIi_3FB.esm.js → updateAuthFromVerifyResponse-_oYRLK_w.esm.js} +235 -159
- package/dist/updateAuthFromVerifyResponse-_oYRLK_w.esm.js.map +1 -0
- package/dist/{updateAuthFromVerifyResponse-CElYpi97.cjs → updateAuthFromVerifyResponse-pgYXvDvj.cjs} +241 -159
- package/dist/updateAuthFromVerifyResponse-pgYXvDvj.cjs.map +1 -0
- package/dist/utils/assertSafeDeeplinkUrl/assertSafeDeeplinkUrl.d.ts +12 -0
- package/dist/utils/assertSafeDeeplinkUrl/assertSafeDeeplinkUrl.d.ts.map +1 -0
- package/dist/utils/assertSafeDeeplinkUrl/index.d.ts +2 -0
- package/dist/utils/assertSafeDeeplinkUrl/index.d.ts.map +1 -0
- package/dist/utils/assertSafeNavigationUrl/assertSafeNavigationUrl.d.ts +12 -0
- package/dist/utils/assertSafeNavigationUrl/assertSafeNavigationUrl.d.ts.map +1 -0
- package/dist/utils/assertSafeNavigationUrl/index.d.ts +2 -0
- package/dist/utils/assertSafeNavigationUrl/index.d.ts.map +1 -0
- package/dist/utils/getSecureCookieAttribute/getSecureCookieAttribute.d.ts +18 -0
- package/dist/utils/getSecureCookieAttribute/getSecureCookieAttribute.d.ts.map +1 -0
- package/dist/utils/getSecureCookieAttribute/index.d.ts +2 -0
- package/dist/utils/getSecureCookieAttribute/index.d.ts.map +1 -0
- package/dist/waas.cjs +72 -5
- package/dist/waas.cjs.map +1 -1
- package/dist/waas.esm.js +70 -5
- package/dist/waas.esm.js.map +1 -1
- package/dist/waas.native.esm.js +70 -5
- package/dist/waas.native.esm.js.map +1 -1
- package/dist/waasCore.cjs +6 -6
- package/dist/waasCore.esm.js +6 -6
- package/dist/waasCore.native.esm.js +6 -6
- package/package.json +3 -3
- package/dist/getNetworkProviderFromNetworkId-Bfg-NkNJ.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-CS4r9hi7.cjs.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-pknqqhk1.esm.js.map +0 -1
- package/dist/isDynamicWaasEnabled-BXe0VyI4.native.esm.js.map +0 -1
- package/dist/isDynamicWaasEnabled-BYaqAOml.esm.js.map +0 -1
- package/dist/isDynamicWaasEnabled-BwP1oowd.cjs.map +0 -1
- package/dist/isMfaRequiredForAction-Btejc5g3.cjs.map +0 -1
- package/dist/isMfaRequiredForAction-CqEcCTIe.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-Demz9zlH.native.esm.js.map +0 -1
- package/dist/isUserOnboardingComplete-C86NDY7I.cjs.map +0 -1
- package/dist/isUserOnboardingComplete-CBrAH0ZF.esm.js.map +0 -1
- package/dist/isUserOnboardingComplete-Cr-YTpcU.native.esm.js.map +0 -1
- package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts +0 -10
- package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts.map +0 -1
- package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/index.d.ts.map +0 -1
- package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/index.d.ts.map +0 -1
- package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts +0 -12
- package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts.map +0 -1
- package/dist/services/instrumentation/instrumentFunction/extractParams/extractParams.d.ts +0 -28
- package/dist/services/instrumentation/instrumentFunction/extractParams/extractParams.d.ts.map +0 -1
- package/dist/services/instrumentation/instrumentFunction/scrubResolvedValue/scrubResolvedValue.d.ts +0 -15
- package/dist/services/instrumentation/instrumentFunction/scrubResolvedValue/scrubResolvedValue.d.ts.map +0 -1
- package/dist/updateAuthFromVerifyResponse-CElYpi97.cjs.map +0 -1
- package/dist/updateAuthFromVerifyResponse-D1w-Aw9P.native.esm.js.map +0 -1
- package/dist/updateAuthFromVerifyResponse-azIi_3FB.esm.js.map +0 -1
- /package/dist/modules/wallets/{primaryWalletAccount → selectedWalletAccount}/getPrimaryWalletAccount/index.d.ts +0 -0
- /package/dist/modules/wallets/{primaryWalletAccount → selectedWalletAccount}/selectPrimaryWalletAccount/index.d.ts +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-
|
|
2
|
-
const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-
|
|
3
|
-
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-
|
|
4
|
-
const require_isDynamicWaasEnabled = require('./isDynamicWaasEnabled-
|
|
5
|
-
const require_isUserOnboardingComplete = require('./isUserOnboardingComplete-
|
|
6
|
-
const require_getWalletProviderByKey = require('./getWalletProviderByKey-
|
|
1
|
+
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-BuvyBN_r.cjs');
|
|
2
|
+
const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-pgYXvDvj.cjs');
|
|
3
|
+
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-BJX2AMGR.cjs');
|
|
4
|
+
const require_isDynamicWaasEnabled = require('./isDynamicWaasEnabled-BawttOeb.cjs');
|
|
5
|
+
const require_isUserOnboardingComplete = require('./isUserOnboardingComplete-CkyzRYrg.cjs');
|
|
6
|
+
const require_getWalletProviderByKey = require('./getWalletProviderByKey-C6aS7KgD.cjs');
|
|
7
7
|
let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
|
|
8
8
|
let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
|
|
9
9
|
let zod_mini = require("zod/mini");
|
|
@@ -355,13 +355,26 @@ const initializeStorageSync = async (client) => {
|
|
|
355
355
|
//#endregion
|
|
356
356
|
//#region src/modules/user/refreshUser/refreshUser.ts
|
|
357
357
|
/**
|
|
358
|
-
* Refreshes the current user's
|
|
358
|
+
* Refreshes the current user's profile from the server.
|
|
359
359
|
*
|
|
360
|
-
* This
|
|
361
|
-
*
|
|
360
|
+
* This fetches the latest authenticated user from the backend and updates only
|
|
361
|
+
* the local user state, returning the `SdkUser`. It does not touch the auth
|
|
362
|
+
* token — use it when you just need up-to-date user data.
|
|
363
|
+
*
|
|
364
|
+
* Prefer `refreshAuth` when you need to rotate the auth token as well: it runs
|
|
365
|
+
* a full verify, updates both token and user state, and returns the raw
|
|
366
|
+
* `VerifyResponse` (including the new token).
|
|
367
|
+
*
|
|
368
|
+
* @example
|
|
369
|
+
* ```ts
|
|
370
|
+
* const user = await refreshUser();
|
|
371
|
+
* console.log('Updated user:', user.email);
|
|
372
|
+
* ```
|
|
362
373
|
*
|
|
363
374
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
364
375
|
* @returns A promise that resolves to the authenticated user.
|
|
376
|
+
* @see refreshAuth
|
|
377
|
+
* @see deleteUser
|
|
365
378
|
* @instrumented
|
|
366
379
|
* @noHook Low-level refresh primitive that is not exposed as a React hook.
|
|
367
380
|
*/
|
|
@@ -412,9 +425,25 @@ var ClientAlreadyInitializedError = class extends require_updateAuthFromVerifyRe
|
|
|
412
425
|
*
|
|
413
426
|
* You only need to call this function if you are not using `autoInitialize: true` in createDynamicClient.
|
|
414
427
|
*
|
|
428
|
+
* @example
|
|
429
|
+
* ```ts
|
|
430
|
+
* const client = createDynamicClient({
|
|
431
|
+
* environmentId: 'env-id',
|
|
432
|
+
* autoInitialize: false,
|
|
433
|
+
* });
|
|
434
|
+
*
|
|
435
|
+
* try {
|
|
436
|
+
* await initializeClient(client);
|
|
437
|
+
* } catch (error) {
|
|
438
|
+
* console.error('Failed to initialize:', error);
|
|
439
|
+
* }
|
|
440
|
+
* ```
|
|
441
|
+
*
|
|
415
442
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
416
443
|
* @returns A promise that resolves when initialization is complete.
|
|
417
444
|
* @throws ClientAlreadyInitializedError If the client is already initialized.
|
|
445
|
+
* @see createDynamicClient
|
|
446
|
+
* @see waitForClientInitialized
|
|
418
447
|
* @instrumented
|
|
419
448
|
* @noHook Client lifecycle management is not exposed as a React hook.
|
|
420
449
|
*/
|
|
@@ -751,10 +780,67 @@ const createDynamicTransport = (params) => {
|
|
|
751
780
|
const createNavigationHandler = () => {
|
|
752
781
|
if (require_getNetworkProviderFromNetworkId.isServerSideRendering()) return () => Promise.reject(new UnavailableInServerSideError("createNavigationHandler"));
|
|
753
782
|
return async (url) => {
|
|
783
|
+
require_getNetworkProviderFromNetworkId.assertSafeNavigationUrl(url);
|
|
754
784
|
window.location.href = url;
|
|
755
785
|
};
|
|
756
786
|
};
|
|
757
787
|
|
|
788
|
+
//#endregion
|
|
789
|
+
//#region src/errors/UnsafeDeeplinkUrlError.ts
|
|
790
|
+
/**
|
|
791
|
+
* Thrown when a deeplink is opened with a URL whose scheme can execute script
|
|
792
|
+
* in the current origin (`javascript:`, `data:`, `vbscript:`). Unlike
|
|
793
|
+
* navigation, deeplinks legitimately use custom app schemes (e.g. `phantom:`,
|
|
794
|
+
* `metamask:`), so this guards via a denylist of dangerous schemes rather than
|
|
795
|
+
* an `http(s)` allowlist, preventing DOM XSS through the `window.location.assign`
|
|
796
|
+
* sink while leaving valid wallet deeplinks untouched.
|
|
797
|
+
*/
|
|
798
|
+
var UnsafeDeeplinkUrlError = class extends require_updateAuthFromVerifyResponse.BaseError {
|
|
799
|
+
constructor({ scheme }) {
|
|
800
|
+
super({
|
|
801
|
+
cause: null,
|
|
802
|
+
code: "unsafe_deeplink_url_error",
|
|
803
|
+
docsUrl: null,
|
|
804
|
+
name: "UnsafeDeeplinkUrlError",
|
|
805
|
+
shortMessage: `Refusing to open a deeplink with an unsafe scheme "${scheme}". Script-executing schemes (javascript:, data:, vbscript:) are not allowed. This may indicate a compromised or misconfigured deeplink URL.`
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
//#endregion
|
|
811
|
+
//#region src/utils/assertSafeDeeplinkUrl/assertSafeDeeplinkUrl.ts
|
|
812
|
+
/**
|
|
813
|
+
* Schemes that can execute script in the current origin and must never reach a
|
|
814
|
+
* deeplink navigation sink. Deeplinks legitimately use arbitrary custom app
|
|
815
|
+
* schemes (e.g. `phantom:`, `metamask:`), so a denylist of dangerous schemes is
|
|
816
|
+
* used here instead of the `http(s)` allowlist applied to standard navigation.
|
|
817
|
+
*/
|
|
818
|
+
const DANGEROUS_DEEPLINK_SCHEMES = new Set([
|
|
819
|
+
"javascript:",
|
|
820
|
+
"data:",
|
|
821
|
+
"vbscript:",
|
|
822
|
+
"blob:"
|
|
823
|
+
]);
|
|
824
|
+
/**
|
|
825
|
+
* Asserts that the given deeplink URL is safe to open, i.e. its scheme is not
|
|
826
|
+
* one that can execute script (`javascript:`, `data:`, `vbscript:`, `blob:`). Used as a
|
|
827
|
+
* defense-in-depth guard on the `window.location.assign` deeplink sink to
|
|
828
|
+
* prevent DOM XSS, while still permitting custom wallet app schemes.
|
|
829
|
+
*
|
|
830
|
+
* @param url - The deeplink URL string to validate.
|
|
831
|
+
* @throws {UnsafeDeeplinkUrlError} If the URL cannot be parsed or its scheme can execute script.
|
|
832
|
+
* @notInstrumented
|
|
833
|
+
*/
|
|
834
|
+
const assertSafeDeeplinkUrl = (url) => {
|
|
835
|
+
let parsed;
|
|
836
|
+
try {
|
|
837
|
+
parsed = new URL(url);
|
|
838
|
+
} catch {
|
|
839
|
+
throw new UnsafeDeeplinkUrlError({ scheme: "unknown" });
|
|
840
|
+
}
|
|
841
|
+
if (DANGEROUS_DEEPLINK_SCHEMES.has(parsed.protocol)) throw new UnsafeDeeplinkUrlError({ scheme: parsed.protocol });
|
|
842
|
+
};
|
|
843
|
+
|
|
758
844
|
//#endregion
|
|
759
845
|
//#region src/services/openDeeplink/createWebDeeplinkOpener/createWebDeeplinkOpener.ts
|
|
760
846
|
/**
|
|
@@ -774,6 +860,7 @@ const createNavigationHandler = () => {
|
|
|
774
860
|
const createWebDeeplinkOpener = () => {
|
|
775
861
|
if (require_getNetworkProviderFromNetworkId.isServerSideRendering()) return () => Promise.reject(new UnavailableInServerSideError("createWebDeeplinkOpener"));
|
|
776
862
|
return async (url) => {
|
|
863
|
+
assertSafeDeeplinkUrl(url);
|
|
777
864
|
window.location.assign(url);
|
|
778
865
|
};
|
|
779
866
|
};
|
|
@@ -1040,8 +1127,18 @@ const createCore = (config) => {
|
|
|
1040
1127
|
* Manually calling `initializeClient` also allows you to catch any potential
|
|
1041
1128
|
* errors that may occur during initialization.
|
|
1042
1129
|
*
|
|
1130
|
+
* @example
|
|
1131
|
+
* ```ts
|
|
1132
|
+
* const client = createDynamicClient({
|
|
1133
|
+
* environmentId: 'your-environment-id',
|
|
1134
|
+
* appUrl: 'https://myapp.com',
|
|
1135
|
+
* });
|
|
1136
|
+
* ```
|
|
1137
|
+
*
|
|
1043
1138
|
* @param config - The configuration for the Dynamic client, like the environment ID, app url, etc.
|
|
1044
1139
|
* @returns The Dynamic client instance.
|
|
1140
|
+
* @see initializeClient
|
|
1141
|
+
* @see getDefaultClient
|
|
1045
1142
|
* @instrumented
|
|
1046
1143
|
*/
|
|
1047
1144
|
const createDynamicClient = (config) => {
|
|
@@ -1130,6 +1227,42 @@ var DeeplinkConnectAndVerifyUnsupportedError = class extends require_updateAuthF
|
|
|
1130
1227
|
}
|
|
1131
1228
|
};
|
|
1132
1229
|
|
|
1230
|
+
//#endregion
|
|
1231
|
+
//#region src/errors/DeviceRegistrationIdentityMismatchError.ts
|
|
1232
|
+
/**
|
|
1233
|
+
* Thrown when completing device registration would replace the current session
|
|
1234
|
+
* with a different user's identity.
|
|
1235
|
+
*
|
|
1236
|
+
* The device registration token resolved to a user other than the one currently
|
|
1237
|
+
* authenticated, which can indicate a login-CSRF / session-fixation attempt, so
|
|
1238
|
+
* the returned session is rejected and the current session is left untouched.
|
|
1239
|
+
*
|
|
1240
|
+
* @example
|
|
1241
|
+
* ```ts
|
|
1242
|
+
* try {
|
|
1243
|
+
* await completeDeviceRegistration({ token });
|
|
1244
|
+
* } catch (error) {
|
|
1245
|
+
* if (error instanceof DeviceRegistrationIdentityMismatchError) {
|
|
1246
|
+
* // The current session was preserved; ask the user to retry on this device.
|
|
1247
|
+
* }
|
|
1248
|
+
* }
|
|
1249
|
+
* ```
|
|
1250
|
+
* @see completeDeviceRegistration
|
|
1251
|
+
* @see InvalidDeviceRegistrationRedirectError
|
|
1252
|
+
*/
|
|
1253
|
+
var DeviceRegistrationIdentityMismatchError = class extends require_updateAuthFromVerifyResponse.BaseError {
|
|
1254
|
+
constructor() {
|
|
1255
|
+
super({
|
|
1256
|
+
cause: null,
|
|
1257
|
+
code: "device_registration_identity_mismatch_error",
|
|
1258
|
+
docsUrl: null,
|
|
1259
|
+
metaMessages: ["The device registration token resolved to a different user than the one currently authenticated.", "This can indicate a login-CSRF / session-fixation attempt, so the returned session was rejected and the current session was left untouched."],
|
|
1260
|
+
name: "DeviceRegistrationIdentityMismatchError",
|
|
1261
|
+
shortMessage: "Device registration completion was rejected because it would have replaced the current session with a different identity."
|
|
1262
|
+
});
|
|
1263
|
+
}
|
|
1264
|
+
};
|
|
1265
|
+
|
|
1133
1266
|
//#endregion
|
|
1134
1267
|
//#region src/errors/FeeEstimationFailedError.ts
|
|
1135
1268
|
var FeeEstimationFailedError = class extends require_updateAuthFromVerifyResponse.BaseError {
|
|
@@ -1577,7 +1710,6 @@ const __checkStepUpAuth_wrapped = require_updateAuthFromVerifyResponse.instrumen
|
|
|
1577
1710
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1578
1711
|
* @returns A promise that resolves to the assertion response containing the elevated access token.
|
|
1579
1712
|
* @instrumented
|
|
1580
|
-
* @redact-params
|
|
1581
1713
|
*/
|
|
1582
1714
|
const requestExternalAuthElevatedToken = async ({ externalJwt }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
1583
1715
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
@@ -1605,8 +1737,7 @@ const __requestExternalAuthElevatedToken_wrapped = require_updateAuthFromVerifyR
|
|
|
1605
1737
|
} catch {
|
|
1606
1738
|
return;
|
|
1607
1739
|
}
|
|
1608
|
-
}
|
|
1609
|
-
redactAll: true
|
|
1740
|
+
}
|
|
1610
1741
|
});
|
|
1611
1742
|
|
|
1612
1743
|
//#endregion
|
|
@@ -1617,11 +1748,20 @@ const __requestExternalAuthElevatedToken_wrapped = require_updateAuthFromVerifyR
|
|
|
1617
1748
|
* This function allows authentication using JWT tokens from external providers,
|
|
1618
1749
|
* enabling integration with custom authentication systems.
|
|
1619
1750
|
*
|
|
1751
|
+
* @example
|
|
1752
|
+
* ```ts
|
|
1753
|
+
* const response = await signInWithExternalJwt({
|
|
1754
|
+
* externalJwt: 'eyJhbGciOiJSUzI1NiIs...',
|
|
1755
|
+
* });
|
|
1756
|
+
* ```
|
|
1757
|
+
*
|
|
1620
1758
|
* @param [params.externalJwt] - Optional external JWT token to authenticate with. Not required when using cookie based auth.
|
|
1759
|
+
* @param [params.sessionPublicKey] - Optional session public key for session-based auth.
|
|
1621
1760
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1622
1761
|
* @returns A promise that resolves to the authentication response from the server.
|
|
1762
|
+
* @see logout
|
|
1763
|
+
* @see refreshAuth
|
|
1623
1764
|
* @instrumented
|
|
1624
|
-
* @redact-params
|
|
1625
1765
|
*/
|
|
1626
1766
|
const signInWithExternalJwt = async ({ externalJwt, sessionPublicKey } = {}, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
1627
1767
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
@@ -1645,8 +1785,7 @@ const __signInWithExternalJwt_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
1645
1785
|
} catch {
|
|
1646
1786
|
return;
|
|
1647
1787
|
}
|
|
1648
|
-
}
|
|
1649
|
-
redactAll: true
|
|
1788
|
+
}
|
|
1650
1789
|
});
|
|
1651
1790
|
|
|
1652
1791
|
//#endregion
|
|
@@ -1654,8 +1793,21 @@ const __signInWithExternalJwt_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
1654
1793
|
/**
|
|
1655
1794
|
* Logs out the current user and clears all authentication data.
|
|
1656
1795
|
*
|
|
1796
|
+
* @example
|
|
1797
|
+
* ```ts
|
|
1798
|
+
* await logout();
|
|
1799
|
+
* ```
|
|
1800
|
+
*
|
|
1801
|
+
* @example
|
|
1802
|
+
* ```ts
|
|
1803
|
+
* // With explicit client for multi-client setups
|
|
1804
|
+
* await logout(myClient);
|
|
1805
|
+
* ```
|
|
1806
|
+
*
|
|
1657
1807
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1658
1808
|
* @returns A promise that resolves when the logout process is complete.
|
|
1809
|
+
* @see isAnyWalletAccountConnected
|
|
1810
|
+
* @see refreshAuth
|
|
1659
1811
|
* @notInstrumented
|
|
1660
1812
|
*/
|
|
1661
1813
|
const logout = async (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -1668,6 +1820,58 @@ const logout = async (client = require_updateAuthFromVerifyResponse.getDefaultCl
|
|
|
1668
1820
|
return require_isMfaRequiredForAction.__logoutWithReason_wrapped({ reason: "user-intent" }, client);
|
|
1669
1821
|
};
|
|
1670
1822
|
|
|
1823
|
+
//#endregion
|
|
1824
|
+
//#region src/modules/auth/mergeUserAccounts/mergeUserAccounts.ts
|
|
1825
|
+
/**
|
|
1826
|
+
* Completes an account merge after a credential was found to already belong to
|
|
1827
|
+
* another user (surfaced as `MergeAccountsConfirmationError` during
|
|
1828
|
+
* verification / linking).
|
|
1829
|
+
*
|
|
1830
|
+
* When the merge has no field-level conflicts, call it with no resolutions to
|
|
1831
|
+
* merge directly. When the two accounts hold different values for the same
|
|
1832
|
+
* profile field, pass the user's chosen `conflictResolutions` (one per
|
|
1833
|
+
* conflict) so the backend knows which value to keep. On success the two users
|
|
1834
|
+
* are folded into one, the merged session is persisted, and the merged user is
|
|
1835
|
+
* returned.
|
|
1836
|
+
*
|
|
1837
|
+
* @example
|
|
1838
|
+
* ```ts
|
|
1839
|
+
* try {
|
|
1840
|
+
* await verifyWalletAccount({ walletAccount });
|
|
1841
|
+
* } catch (error) {
|
|
1842
|
+
* if (error instanceof MergeAccountsConfirmationError) {
|
|
1843
|
+
* // resolveConflicts is your own function (not provided by the SDK): given
|
|
1844
|
+
* // the conflicting fields, decide which value to keep for each one —
|
|
1845
|
+
* // usually by prompting the user — and return them as MergeUserConflictResolution[].
|
|
1846
|
+
* await mergeUserAccounts(
|
|
1847
|
+
* error.mergeConflicts
|
|
1848
|
+
* ? { conflictResolutions: resolveConflicts(error.mergeConflicts) }
|
|
1849
|
+
* : undefined,
|
|
1850
|
+
* );
|
|
1851
|
+
* }
|
|
1852
|
+
* }
|
|
1853
|
+
* ```
|
|
1854
|
+
* @param params.conflictResolutions - Optional per-field conflict resolutions.
|
|
1855
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1856
|
+
* @returns A promise that resolves to the merged user.
|
|
1857
|
+
* @see MergeAccountsConfirmationError
|
|
1858
|
+
* @see MergeUserConflictResolution
|
|
1859
|
+
* @notInstrumented
|
|
1860
|
+
*/
|
|
1861
|
+
const mergeUserAccounts = async ({ conflictResolutions } = {}, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
1862
|
+
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
1863
|
+
const apiClient = require_updateAuthFromVerifyResponse.createApiClient({}, client);
|
|
1864
|
+
const hasConflictResolutions = conflictResolutions !== void 0 && conflictResolutions.length > 0;
|
|
1865
|
+
let response;
|
|
1866
|
+
if (hasConflictResolutions) response = await apiClient.verifyMergeUsers({
|
|
1867
|
+
environmentId: core.environmentId,
|
|
1868
|
+
mergeUserConflictResolutions: { mergeUserResolutions: conflictResolutions }
|
|
1869
|
+
});
|
|
1870
|
+
else response = await apiClient.mergeUsers({ environmentId: core.environmentId });
|
|
1871
|
+
require_updateAuthFromVerifyResponse.updateAuthFromVerifyResponse({ response }, client);
|
|
1872
|
+
return response.user;
|
|
1873
|
+
};
|
|
1874
|
+
|
|
1671
1875
|
//#endregion
|
|
1672
1876
|
//#region src/modules/auth/passkeys/deletePasskey/deletePasskey.ts
|
|
1673
1877
|
/**
|
|
@@ -1753,12 +1957,18 @@ const serverRegisterPasskey = async ({ registration, createMfaToken }, client) =
|
|
|
1753
1957
|
* passwordless authentication. The user will be prompted to create a passkey
|
|
1754
1958
|
* using their device's biometric authentication or security key.
|
|
1755
1959
|
*
|
|
1960
|
+
* @example
|
|
1961
|
+
* ```ts
|
|
1962
|
+
* await registerPasskey();
|
|
1963
|
+
* ```
|
|
1964
|
+
*
|
|
1756
1965
|
* @param [params.createMfaToken] - Optional configuration for MFA token creation.
|
|
1757
1966
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1758
1967
|
* @returns A promise that resolves to the registration response.
|
|
1759
1968
|
* @throws NoWebAuthNSupportError If WebAuthn is not supported by the browser.
|
|
1969
|
+
* @see signInWithPasskey
|
|
1970
|
+
* @see getPasskeys
|
|
1760
1971
|
* @instrumented
|
|
1761
|
-
* @redact-params
|
|
1762
1972
|
*/
|
|
1763
1973
|
const registerPasskey = async ({ createMfaToken } = {}, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
1764
1974
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
@@ -1781,8 +1991,7 @@ const __registerPasskey_wrapped = require_updateAuthFromVerifyResponse.instrumen
|
|
|
1781
1991
|
} catch {
|
|
1782
1992
|
return;
|
|
1783
1993
|
}
|
|
1784
|
-
}
|
|
1785
|
-
redactAll: true
|
|
1994
|
+
}
|
|
1786
1995
|
});
|
|
1787
1996
|
|
|
1788
1997
|
//#endregion
|
|
@@ -1823,11 +2032,19 @@ const serverSigninPasskey = async ({ authentication, createMfaToken }, client) =
|
|
|
1823
2032
|
* credential, providing passwordless authentication using biometrics or
|
|
1824
2033
|
* security keys.
|
|
1825
2034
|
*
|
|
2035
|
+
* @example
|
|
2036
|
+
* ```ts
|
|
2037
|
+
* const response = await signInWithPasskey();
|
|
2038
|
+
* console.log('Signed in:', response.user.email);
|
|
2039
|
+
* ```
|
|
2040
|
+
*
|
|
2041
|
+
* @param [params.relatedOriginRpId] - Optional relying party ID for cross-origin authentication.
|
|
1826
2042
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1827
2043
|
* @returns A promise that resolves to the authentication response.
|
|
1828
2044
|
* @throws NoWebAuthNSupportError If WebAuthn is not supported by the browser.
|
|
2045
|
+
* @see registerPasskey
|
|
2046
|
+
* @see getPasskeys
|
|
1829
2047
|
* @instrumented
|
|
1830
|
-
* @redact-params
|
|
1831
2048
|
*/
|
|
1832
2049
|
const signInWithPasskey = async ({ relatedOriginRpId } = {}, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
1833
2050
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
@@ -1847,8 +2064,7 @@ const __signInWithPasskey_wrapped = require_updateAuthFromVerifyResponse.instrum
|
|
|
1847
2064
|
} catch {
|
|
1848
2065
|
return;
|
|
1849
2066
|
}
|
|
1850
|
-
}
|
|
1851
|
-
redactAll: true
|
|
2067
|
+
}
|
|
1852
2068
|
});
|
|
1853
2069
|
|
|
1854
2070
|
//#endregion
|
|
@@ -1952,22 +2168,29 @@ const addOAuthUrlParams = ({ baseUrl, isGoogleDriveBackupEnabled, provider }) =>
|
|
|
1952
2168
|
|
|
1953
2169
|
//#endregion
|
|
1954
2170
|
//#region src/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/getOAuthBaseUrl/getOAuthBaseUrl.ts
|
|
1955
|
-
/**
|
|
2171
|
+
/**
|
|
2172
|
+
* Resolves the raw base URL string for a provider before parsing/validation.
|
|
1956
2173
|
*/
|
|
1957
|
-
const
|
|
2174
|
+
const resolveBaseUrl = (provider) => {
|
|
1958
2175
|
require_updateAuthFromVerifyResponse.assertDefined(provider.provider, "Provider type not found");
|
|
1959
2176
|
const providerType = provider.provider;
|
|
1960
2177
|
if (providerType === _dynamic_labs_sdk_api_core.ProviderEnum.Telegram) {
|
|
1961
2178
|
require_updateAuthFromVerifyResponse.assertDefined(provider.authorizationUrl, "Telegram authorization URL not found");
|
|
1962
|
-
return
|
|
2179
|
+
return provider.authorizationUrl;
|
|
1963
2180
|
}
|
|
1964
2181
|
require_updateAuthFromVerifyResponse.assertDefined(provider.baseAuthUrl, "Base auth URL not found");
|
|
1965
2182
|
if (providerType === _dynamic_labs_sdk_api_core.ProviderEnum.Shopify) {
|
|
1966
2183
|
require_updateAuthFromVerifyResponse.assertDefined(provider.shopifyStore, "Shopify store value not found in provider");
|
|
1967
|
-
|
|
1968
|
-
return new URL(loginBaseUrl);
|
|
2184
|
+
return provider.baseAuthUrl.replace("{{shopifyStore}}", provider.shopifyStore);
|
|
1969
2185
|
}
|
|
1970
|
-
return
|
|
2186
|
+
return provider.baseAuthUrl;
|
|
2187
|
+
};
|
|
2188
|
+
/** Helper function to build the OAuth base URL for a given provider. * @notInstrumented
|
|
2189
|
+
*/
|
|
2190
|
+
const getOAuthBaseUrl = (provider) => {
|
|
2191
|
+
const urlString = resolveBaseUrl(provider);
|
|
2192
|
+
require_getNetworkProviderFromNetworkId.assertSafeNavigationUrl(urlString);
|
|
2193
|
+
return new URL(urlString);
|
|
1971
2194
|
};
|
|
1972
2195
|
|
|
1973
2196
|
//#endregion
|
|
@@ -2016,9 +2239,19 @@ const buildOAuthUrl = async (core, provider) => {
|
|
|
2016
2239
|
* back because of this flow, then call `completeSocialRedirect` to finish
|
|
2017
2240
|
* the social authentication.
|
|
2018
2241
|
*
|
|
2242
|
+
* @example
|
|
2243
|
+
* ```ts
|
|
2244
|
+
* await signInWithSocialRedirect({
|
|
2245
|
+
* provider: 'google',
|
|
2246
|
+
* redirectUrl: window.location.href,
|
|
2247
|
+
* });
|
|
2248
|
+
* ```
|
|
2249
|
+
*
|
|
2019
2250
|
* @param params.provider - The social provider to authenticate with (e.g., 'google', 'github').
|
|
2020
2251
|
* @param params.redirectUrl - The URL to redirect back to after authentication.
|
|
2021
2252
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2253
|
+
* @see completeSocialRedirect
|
|
2254
|
+
* @see detectSocialRedirectUrl
|
|
2022
2255
|
* @instrumented
|
|
2023
2256
|
*/
|
|
2024
2257
|
const signInWithSocialRedirect = async ({ provider, redirectUrl }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -2061,6 +2294,14 @@ const __signInWithSocialRedirect_wrapped = require_updateAuthFromVerifyResponse.
|
|
|
2061
2294
|
* @deprecated Renamed to {@link signInWithSocialRedirect}. This alias will be
|
|
2062
2295
|
* removed in a future major version.
|
|
2063
2296
|
*
|
|
2297
|
+
* @example
|
|
2298
|
+
* ```ts
|
|
2299
|
+
* // Prefer signInWithSocialRedirect instead
|
|
2300
|
+
* await signInWithSocialRedirect({ provider: 'google', redirectUrl: window.location.href });
|
|
2301
|
+
* ```
|
|
2302
|
+
*
|
|
2303
|
+
* @see signInWithSocialRedirect
|
|
2304
|
+
* @see completeSocialRedirect
|
|
2064
2305
|
* @instrumented
|
|
2065
2306
|
* @noHook Deprecated alias that is not exposed as a React hook.
|
|
2066
2307
|
*/
|
|
@@ -2078,6 +2319,45 @@ const __authenticateWithSocial_wrapped = require_updateAuthFromVerifyResponse.in
|
|
|
2078
2319
|
}
|
|
2079
2320
|
});
|
|
2080
2321
|
|
|
2322
|
+
//#endregion
|
|
2323
|
+
//#region src/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.ts
|
|
2324
|
+
/**
|
|
2325
|
+
* Removes the social OAuth redirect parameters that `signInWithSocialRedirect`
|
|
2326
|
+
* appends to the return URL from the browser's current URL, leaving every other
|
|
2327
|
+
* query parameter, the path, and the hash untouched.
|
|
2328
|
+
*
|
|
2329
|
+
* Call this once you have finished `completeSocialRedirect` so a page refresh
|
|
2330
|
+
* doesn't re-trigger the redirect flow. Unlike clearing the whole query
|
|
2331
|
+
* string, this preserves any of your own parameters on the callback URL.
|
|
2332
|
+
*
|
|
2333
|
+
* This reads and rewrites `window.location`, so it can only run in the
|
|
2334
|
+
* browser. Calling it during server-side rendering (no `window`) throws
|
|
2335
|
+
* `UnavailableInServerSideError`.
|
|
2336
|
+
*
|
|
2337
|
+
* @returns Nothing. The current URL is rewritten in place via
|
|
2338
|
+
* `window.history.replaceState`.
|
|
2339
|
+
*
|
|
2340
|
+
* @throws {UnavailableInServerSideError} When called without a `window`
|
|
2341
|
+
* (e.g. during server-side rendering).
|
|
2342
|
+
*
|
|
2343
|
+
* @example
|
|
2344
|
+
* ```ts
|
|
2345
|
+
* await completeSocialRedirect({ url: new URL(window.location.href) });
|
|
2346
|
+
* clearSocialRedirectParams();
|
|
2347
|
+
* ```
|
|
2348
|
+
*
|
|
2349
|
+
* @see {@link completeSocialRedirect} to finish the redirect sign-in before
|
|
2350
|
+
* clearing the parameters.
|
|
2351
|
+
* @see {@link detectSocialRedirectUrl} to check whether the current URL is a
|
|
2352
|
+
* social OAuth callback.
|
|
2353
|
+
*
|
|
2354
|
+
* @notInstrumented
|
|
2355
|
+
*/
|
|
2356
|
+
const clearSocialRedirectParams = () => {
|
|
2357
|
+
if (require_getNetworkProviderFromNetworkId.isServerSideRendering()) throw new UnavailableInServerSideError("clearSocialRedirectParams");
|
|
2358
|
+
window.history.replaceState({}, "", removeDynamicOauthParamsFromUrl(window.location.href));
|
|
2359
|
+
};
|
|
2360
|
+
|
|
2081
2361
|
//#endregion
|
|
2082
2362
|
//#region src/modules/auth/social/oauth/processSocialCallback/processSocialCallback.ts
|
|
2083
2363
|
/**
|
|
@@ -2159,12 +2439,23 @@ const __processSocialCallback_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
2159
2439
|
* authenticating (or linking) the user with the social provider. This is the
|
|
2160
2440
|
* final step after `signInWithSocialRedirect` + `detectSocialRedirectUrl`.
|
|
2161
2441
|
*
|
|
2442
|
+
* @example
|
|
2443
|
+
* ```ts
|
|
2444
|
+
* const redirectUrl = detectSocialRedirectUrl();
|
|
2445
|
+
* if (redirectUrl) {
|
|
2446
|
+
* const user = await completeSocialRedirect({ url: redirectUrl });
|
|
2447
|
+
* }
|
|
2448
|
+
* ```
|
|
2449
|
+
*
|
|
2162
2450
|
* @param params.url - The callback URL containing OAuth response parameters.
|
|
2163
2451
|
* @param [params.requestedScopes] - Optional scopes to request an elevated access token when verifying (linking) a social account.
|
|
2164
2452
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2165
2453
|
* @returns A promise that resolves to the authenticated user or null.
|
|
2166
2454
|
* @throws MissingSocialUrlParamError If required OAuth parameters are missing.
|
|
2167
2455
|
* @throws InvalidRedirectStorageStateError If the stored state doesn't match.
|
|
2456
|
+
* @see signInWithSocialRedirect
|
|
2457
|
+
* @see detectSocialRedirectUrl
|
|
2458
|
+
* @see clearSocialRedirectParams
|
|
2168
2459
|
* @instrumented
|
|
2169
2460
|
*/
|
|
2170
2461
|
const completeSocialRedirect = ({ url, requestedScopes }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => __processSocialCallback_wrapped({
|
|
@@ -2220,7 +2511,6 @@ const __completeSocialAuthentication_wrapped = require_updateAuthFromVerifyRespo
|
|
|
2220
2511
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2221
2512
|
* @returns A promise that resolves to true if the URL is an OAuth redirect, false otherwise.
|
|
2222
2513
|
* @notInstrumented
|
|
2223
|
-
* @noHook Low-level redirect-detection primitive that is not exposed as a React hook.
|
|
2224
2514
|
*/
|
|
2225
2515
|
const detectSocialRedirectUrl = async ({ url }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
2226
2516
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
@@ -2252,7 +2542,19 @@ const detectOAuthRedirect = (params, client = require_updateAuthFromVerifyRespon
|
|
|
2252
2542
|
* {@link signInWithSocialRedirect} + {@link completeSocialRedirect} instead —
|
|
2253
2543
|
* the browser already owns the tab so there is no popup to open.
|
|
2254
2544
|
*
|
|
2545
|
+
* @example
|
|
2546
|
+
* ```ts
|
|
2547
|
+
* // React Native only
|
|
2548
|
+
* const user = await signInWithSocialPopUp({ provider: 'google' });
|
|
2549
|
+
* ```
|
|
2550
|
+
*
|
|
2551
|
+
* @param params.provider - The social provider to authenticate with.
|
|
2552
|
+
* @param [params.requestedScopes] - Optional scopes to request from the provider.
|
|
2553
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2554
|
+
* @returns A promise that resolves to the authenticated user or null.
|
|
2255
2555
|
* @throws MethodNotImplementedError Always on web.
|
|
2556
|
+
* @see signInWithSocialRedirect
|
|
2557
|
+
* @see completeSocialRedirect
|
|
2256
2558
|
* @instrumented
|
|
2257
2559
|
*/
|
|
2258
2560
|
const signInWithSocialPopUp = async ({ provider, requestedScopes }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -2272,19 +2574,39 @@ const __signInWithSocialPopUp_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
2272
2574
|
});
|
|
2273
2575
|
|
|
2274
2576
|
//#endregion
|
|
2275
|
-
//#region src/modules/wallets/
|
|
2577
|
+
//#region src/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/getSelectedWalletAccount.ts
|
|
2276
2578
|
/**
|
|
2277
|
-
* Get the
|
|
2278
|
-
*
|
|
2279
|
-
*
|
|
2280
|
-
*
|
|
2579
|
+
* Get the wallet account currently selected for the user.
|
|
2580
|
+
*
|
|
2581
|
+
* The SDK itself does not use or care about which wallet is "selected" — it has
|
|
2582
|
+
* no bearing on authentication, signing, or any other SDK behaviour. This is
|
|
2583
|
+
* purely a convenience for *reading* which wallet the user most recently
|
|
2584
|
+
* selected (derived from the backend `lastSelectedAt` timestamp, across both
|
|
2585
|
+
* unverified and verified wallet accounts). Applications that need a notion of
|
|
2586
|
+
* an active/current wallet should own that selection state themselves.
|
|
2587
|
+
*
|
|
2588
|
+
* The one exception is the wagmi integration (`@dynamic-labs-sdk/wagmi`), which
|
|
2589
|
+
* mirrors the selected EVM wallet into wagmi's connector state.
|
|
2590
|
+
*
|
|
2591
|
+
* @example
|
|
2592
|
+
* ```ts
|
|
2593
|
+
* const selected = getSelectedWalletAccount();
|
|
2594
|
+
* if (selected) {
|
|
2595
|
+
* console.log('Selected wallet:', selected.address);
|
|
2596
|
+
* }
|
|
2597
|
+
* ```
|
|
2598
|
+
*
|
|
2599
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2600
|
+
* @returns The selected wallet account, or null if no wallet has been selected.
|
|
2601
|
+
* @see setSelectedWalletAccount
|
|
2602
|
+
* @see getWalletAccounts
|
|
2281
2603
|
* @notInstrumented
|
|
2282
2604
|
*/
|
|
2283
|
-
const
|
|
2605
|
+
const getSelectedWalletAccount = (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
2284
2606
|
const sortedLastSelectedWalletAccounts = require_updateAuthFromVerifyResponse.getWalletAccounts(client).filter((walletAccount) => Boolean(walletAccount.lastSelectedAt)).sort((a, b) => b.lastSelectedAt.getTime() - a.lastSelectedAt.getTime());
|
|
2285
2607
|
if (sortedLastSelectedWalletAccounts.length === 0) return null;
|
|
2286
|
-
const [
|
|
2287
|
-
return
|
|
2608
|
+
const [selectedWallet] = sortedLastSelectedWalletAccounts;
|
|
2609
|
+
return selectedWallet;
|
|
2288
2610
|
};
|
|
2289
2611
|
|
|
2290
2612
|
//#endregion
|
|
@@ -2302,14 +2624,13 @@ const getPrimaryWalletAccount = (client = require_updateAuthFromVerifyResponse.g
|
|
|
2302
2624
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2303
2625
|
* @returns A promise that resolves to the verify response.
|
|
2304
2626
|
* @instrumented
|
|
2305
|
-
* @redact-params
|
|
2306
2627
|
*/
|
|
2307
2628
|
const unlinkSocialAccount = async ({ verifiedCredentialId }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
2308
2629
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
2309
2630
|
const apiClient = require_updateAuthFromVerifyResponse.createApiClient({ elevatedAccessTokenScope: _dynamic_labs_sdk_api_core.TokenScope.Credentialunlink }, client);
|
|
2310
|
-
const
|
|
2311
|
-
const walletId =
|
|
2312
|
-
const isEmbeddedWallet = !!
|
|
2631
|
+
const selectedWallet = getSelectedWalletAccount(client);
|
|
2632
|
+
const walletId = selectedWallet?.verifiedCredentialId?.replace("-zerodev", "") ?? void 0;
|
|
2633
|
+
const isEmbeddedWallet = !!selectedWallet && require_getWalletProviderByKey.getVerifiedCredentialForWalletAccount({ walletAccount: selectedWallet }, client)?.walletProvider === _dynamic_labs_sdk_api_core.WalletProviderEnum.EmbeddedWallet;
|
|
2313
2634
|
const response = await apiClient.verifyUnlink({
|
|
2314
2635
|
environmentId: core.environmentId,
|
|
2315
2636
|
verifyUnlinkRequest: {
|
|
@@ -2330,8 +2651,7 @@ const __unlinkSocialAccount_wrapped = require_updateAuthFromVerifyResponse.instr
|
|
|
2330
2651
|
} catch {
|
|
2331
2652
|
return;
|
|
2332
2653
|
}
|
|
2333
|
-
}
|
|
2334
|
-
redactAll: true
|
|
2654
|
+
}
|
|
2335
2655
|
});
|
|
2336
2656
|
|
|
2337
2657
|
//#endregion
|
|
@@ -2423,6 +2743,59 @@ const getMultichainTokenBalances = async ({ balanceRequest }, client = require_u
|
|
|
2423
2743
|
*/
|
|
2424
2744
|
const getMultichainBalances = (params, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => getMultichainTokenBalances(params, client);
|
|
2425
2745
|
|
|
2746
|
+
//#endregion
|
|
2747
|
+
//#region src/modules/captcha/getCaptchaSettings/getCaptchaSettings.ts
|
|
2748
|
+
/**
|
|
2749
|
+
* The captcha providers Dynamic can be configured to use for an environment.
|
|
2750
|
+
* Use it to branch on which captcha widget to render for the active provider.
|
|
2751
|
+
*
|
|
2752
|
+
* Redeclared locally (rather than re-exported directly from the generated
|
|
2753
|
+
* `sdk-api-core`) so the public client entry point owns its own documented,
|
|
2754
|
+
* stable surface for this token.
|
|
2755
|
+
*
|
|
2756
|
+
* @example
|
|
2757
|
+
* ```ts
|
|
2758
|
+
* const settings = getCaptchaSettings();
|
|
2759
|
+
* if (settings?.provider === CaptchaProviderEnum.Hcaptcha) {
|
|
2760
|
+
* renderHcaptcha(settings.siteKey);
|
|
2761
|
+
* }
|
|
2762
|
+
* ```
|
|
2763
|
+
* @see getCaptchaSettings
|
|
2764
|
+
* @see CaptchaSettingsResult
|
|
2765
|
+
*/
|
|
2766
|
+
const CaptchaProviderEnum = _dynamic_labs_sdk_api_core.CaptchaProviderEnum;
|
|
2767
|
+
/**
|
|
2768
|
+
* Returns the active captcha provider and site key, or undefined if captcha is not enabled.
|
|
2769
|
+
* Use this to determine which captcha widget to render and which site key to pass it.
|
|
2770
|
+
*
|
|
2771
|
+
* @example
|
|
2772
|
+
* ```ts
|
|
2773
|
+
* const settings = getCaptchaSettings();
|
|
2774
|
+
* if (settings) renderCaptcha(settings.provider, settings.siteKey);
|
|
2775
|
+
* ```
|
|
2776
|
+
* @see CaptchaSettingsResult
|
|
2777
|
+
* @see CaptchaProviderEnum
|
|
2778
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2779
|
+
* @returns The active captcha provider and site key, or undefined when captcha is not enabled.
|
|
2780
|
+
* @notInstrumented
|
|
2781
|
+
*/
|
|
2782
|
+
const getCaptchaSettings = (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
2783
|
+
const projectSettings = client.projectSettings;
|
|
2784
|
+
if (!projectSettings) return void 0;
|
|
2785
|
+
const { security } = projectSettings;
|
|
2786
|
+
if (security.captcha) {
|
|
2787
|
+
if (security.captcha.enabled) return {
|
|
2788
|
+
provider: security.captcha.provider ?? CaptchaProviderEnum.Hcaptcha,
|
|
2789
|
+
siteKey: security.captcha.siteKey
|
|
2790
|
+
};
|
|
2791
|
+
return;
|
|
2792
|
+
}
|
|
2793
|
+
if (security.hCaptcha?.enabled) return {
|
|
2794
|
+
provider: CaptchaProviderEnum.Hcaptcha,
|
|
2795
|
+
siteKey: security.hCaptcha.siteKey
|
|
2796
|
+
};
|
|
2797
|
+
};
|
|
2798
|
+
|
|
2426
2799
|
//#endregion
|
|
2427
2800
|
//#region src/modules/checkout/utils/createCheckoutSessionTokenStorageKey/createCheckoutSessionTokenStorageKey.ts
|
|
2428
2801
|
/** @notInstrumented */
|
|
@@ -2982,14 +3355,65 @@ const requiresConversion = async ({ transaction }, client = require_updateAuthFr
|
|
|
2982
3355
|
return !checkout.settlementConfig.settlements.some((settlement) => settlement.chainName === transaction.fromChainName && settlement.chainId === transaction.fromChainId && settlement.tokenAddress === transaction.fromToken);
|
|
2983
3356
|
};
|
|
2984
3357
|
|
|
3358
|
+
//#endregion
|
|
3359
|
+
//#region src/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/clearDeviceRegistrationRedirectParams.ts
|
|
3360
|
+
/**
|
|
3361
|
+
* Removes the device registration redirect parameters that the device
|
|
3362
|
+
* registration email link appends to the return URL from the browser's current
|
|
3363
|
+
* URL, leaving every other query parameter, the path, and the hash untouched.
|
|
3364
|
+
*
|
|
3365
|
+
* Call this once you have finished `completeDeviceRegistration` so a page
|
|
3366
|
+
* refresh doesn't re-trigger the registration flow. Unlike clearing the whole
|
|
3367
|
+
* query string, this preserves any of your own parameters on the callback URL.
|
|
3368
|
+
*
|
|
3369
|
+
* This reads and rewrites `window.location`, so it can only run in the
|
|
3370
|
+
* browser. Calling it during server-side rendering (no `window`) throws
|
|
3371
|
+
* `UnavailableInServerSideError`.
|
|
3372
|
+
*
|
|
3373
|
+
* @returns Nothing. The current URL is rewritten in place via
|
|
3374
|
+
* `window.history.replaceState`.
|
|
3375
|
+
*
|
|
3376
|
+
* @throws {UnavailableInServerSideError} When called without a `window`
|
|
3377
|
+
* (e.g. during server-side rendering).
|
|
3378
|
+
*
|
|
3379
|
+
* @example
|
|
3380
|
+
* ```ts
|
|
3381
|
+
* const deviceToken = getDeviceRegistrationTokenFromUrl({ url: window.location.href });
|
|
3382
|
+
* await completeDeviceRegistration({ deviceToken });
|
|
3383
|
+
* clearDeviceRegistrationRedirectParams();
|
|
3384
|
+
* ```
|
|
3385
|
+
*
|
|
3386
|
+
* @see {@link completeDeviceRegistration} to finish the registration before
|
|
3387
|
+
* clearing the parameters.
|
|
3388
|
+
* @see {@link detectDeviceRegistrationRedirect} to check whether the current
|
|
3389
|
+
* URL is a device registration callback.
|
|
3390
|
+
*
|
|
3391
|
+
* @notInstrumented
|
|
3392
|
+
*/
|
|
3393
|
+
const clearDeviceRegistrationRedirectParams = () => {
|
|
3394
|
+
if (require_getNetworkProviderFromNetworkId.isServerSideRendering()) throw new UnavailableInServerSideError("clearDeviceRegistrationRedirectParams");
|
|
3395
|
+
const url = new URL(window.location.href);
|
|
3396
|
+
url.searchParams.delete("deviceRegistrationToken");
|
|
3397
|
+
window.history.replaceState({}, "", url.toString());
|
|
3398
|
+
};
|
|
3399
|
+
|
|
2985
3400
|
//#endregion
|
|
2986
3401
|
//#region src/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.ts
|
|
2987
3402
|
const DEVICE_REGISTRATION_TOKEN_HEADER = "x-dynamic-device-registration-token";
|
|
2988
|
-
/**
|
|
3403
|
+
/**
|
|
3404
|
+
* Completes device registration using the token from a device registration
|
|
3405
|
+
* redirect, authenticating the current device against the user's account.
|
|
3406
|
+
*
|
|
3407
|
+
* @see detectDeviceRegistrationRedirect
|
|
3408
|
+
* @see clearDeviceRegistrationRedirectParams
|
|
3409
|
+
* @instrumented
|
|
3410
|
+
*/
|
|
2989
3411
|
const completeDeviceRegistration = async ({ deviceToken }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
2990
3412
|
require_updateAuthFromVerifyResponse.assertDefined(deviceToken, "deviceToken is required");
|
|
2991
3413
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
3414
|
+
const currentUser = core.state.get().user;
|
|
2992
3415
|
const response = await require_updateAuthFromVerifyResponse.createApiClient({ headers: { [DEVICE_REGISTRATION_TOKEN_HEADER]: deviceToken } }, client).deviceRegistration({ environmentId: core.environmentId });
|
|
3416
|
+
if (currentUser && response.user?.id !== currentUser.id) throw new DeviceRegistrationIdentityMismatchError();
|
|
2993
3417
|
require_updateAuthFromVerifyResponse.updateAuthFromVerifyResponse({ response }, client);
|
|
2994
3418
|
require_updateAuthFromVerifyResponse.emitEvent({ event: "deviceRegistrationCompleted" }, client);
|
|
2995
3419
|
return response;
|
|
@@ -3170,6 +3594,22 @@ const withFlowSessionTokenCleanupOn401 = async ({ call, flowId }, client) => {
|
|
|
3170
3594
|
}
|
|
3171
3595
|
};
|
|
3172
3596
|
|
|
3597
|
+
//#endregion
|
|
3598
|
+
//#region src/modules/flow/attachFlowSource/attachFlowSource.instrumentation.ts
|
|
3599
|
+
/**
|
|
3600
|
+
* Explicit instrumentation payload for attachFlowSource. Reads the nested
|
|
3601
|
+
* `flow` and logs non-sensitive volume and routing dimensions only — never the
|
|
3602
|
+
* wallet address, and never the response's session token.
|
|
3603
|
+
*/
|
|
3604
|
+
const attachFlowSourceInstrumentation = { resolved: ({ flow }) => ({
|
|
3605
|
+
amount: flow.amount ?? null,
|
|
3606
|
+
currency: flow.currency ?? null,
|
|
3607
|
+
fromChainId: flow.fromChainId ?? null,
|
|
3608
|
+
fromChainName: flow.fromChainName ?? null,
|
|
3609
|
+
mode: flow.mode ?? null,
|
|
3610
|
+
sourceType: flow.sourceType ?? null
|
|
3611
|
+
}) };
|
|
3612
|
+
|
|
3173
3613
|
//#endregion
|
|
3174
3614
|
//#region src/modules/flow/attachFlowSource/attachFlowSource.ts
|
|
3175
3615
|
/**
|
|
@@ -3222,7 +3662,8 @@ const __attachFlowSource_wrapped = require_updateAuthFromVerifyResponse.instrume
|
|
|
3222
3662
|
} catch {
|
|
3223
3663
|
return;
|
|
3224
3664
|
}
|
|
3225
|
-
}
|
|
3665
|
+
},
|
|
3666
|
+
selectors: attachFlowSourceInstrumentation
|
|
3226
3667
|
});
|
|
3227
3668
|
|
|
3228
3669
|
//#endregion
|
|
@@ -3240,6 +3681,22 @@ const createFlowApiClient = async ({ flowId }, client) => {
|
|
|
3240
3681
|
};
|
|
3241
3682
|
};
|
|
3242
3683
|
|
|
3684
|
+
//#endregion
|
|
3685
|
+
//#region src/modules/flow/broadcastFlow/broadcastFlow.instrumentation.ts
|
|
3686
|
+
/**
|
|
3687
|
+
* Explicit instrumentation payload for broadcastFlow. Logs non-sensitive
|
|
3688
|
+
* volume and routing dimensions only — never the wallet address or any
|
|
3689
|
+
* session token — so we can understand volume moved through the flow product.
|
|
3690
|
+
*/
|
|
3691
|
+
const broadcastFlowInstrumentation = { resolved: (flow) => ({
|
|
3692
|
+
amount: flow.amount ?? null,
|
|
3693
|
+
currency: flow.currency ?? null,
|
|
3694
|
+
fromChainId: flow.fromChainId ?? null,
|
|
3695
|
+
fromChainName: flow.fromChainName ?? null,
|
|
3696
|
+
mode: flow.mode ?? null,
|
|
3697
|
+
sourceType: flow.sourceType ?? null
|
|
3698
|
+
}) };
|
|
3699
|
+
|
|
3243
3700
|
//#endregion
|
|
3244
3701
|
//#region src/modules/flow/broadcastFlow/broadcastFlow.ts
|
|
3245
3702
|
/**
|
|
@@ -3276,17 +3733,40 @@ const __broadcastFlow_wrapped = require_updateAuthFromVerifyResponse.instrumentF
|
|
|
3276
3733
|
} catch {
|
|
3277
3734
|
return;
|
|
3278
3735
|
}
|
|
3279
|
-
}
|
|
3736
|
+
},
|
|
3737
|
+
selectors: broadcastFlowInstrumentation
|
|
3280
3738
|
});
|
|
3281
3739
|
|
|
3740
|
+
//#endregion
|
|
3741
|
+
//#region src/modules/flow/cancelFlow/cancelFlow.instrumentation.ts
|
|
3742
|
+
/**
|
|
3743
|
+
* Explicit instrumentation payload for cancelFlow. Logs non-sensitive volume
|
|
3744
|
+
* and routing dimensions only — never the wallet address or any session token.
|
|
3745
|
+
*/
|
|
3746
|
+
const cancelFlowInstrumentation = { resolved: (flow) => ({
|
|
3747
|
+
amount: flow.amount ?? null,
|
|
3748
|
+
currency: flow.currency ?? null,
|
|
3749
|
+
fromChainId: flow.fromChainId ?? null,
|
|
3750
|
+
fromChainName: flow.fromChainName ?? null,
|
|
3751
|
+
mode: flow.mode ?? null,
|
|
3752
|
+
sourceType: flow.sourceType ?? null
|
|
3753
|
+
}) };
|
|
3754
|
+
|
|
3282
3755
|
//#endregion
|
|
3283
3756
|
//#region src/modules/flow/cancelFlow/cancelFlow.ts
|
|
3284
3757
|
/**
|
|
3285
|
-
* Cancels a flow before it has been broadcasted
|
|
3758
|
+
* Cancels a flow before it has been broadcasted.
|
|
3759
|
+
*
|
|
3760
|
+
* @example
|
|
3761
|
+
* ```ts
|
|
3762
|
+
* const cancelledFlow = await cancelFlow({ flowId: 'flow-abc123' });
|
|
3763
|
+
* ```
|
|
3286
3764
|
*
|
|
3287
|
-
* @param params
|
|
3765
|
+
* @param params.flowId - The unique identifier of the flow to cancel.
|
|
3288
3766
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
3289
|
-
* @returns
|
|
3767
|
+
* @returns A promise that resolves to the cancelled flow.
|
|
3768
|
+
* @see getFlow
|
|
3769
|
+
* @see getFlowQuote
|
|
3290
3770
|
* @instrumented
|
|
3291
3771
|
*/
|
|
3292
3772
|
const cancelFlow = async ({ flowId }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -3312,17 +3792,26 @@ const __cancelFlow_wrapped = require_updateAuthFromVerifyResponse.instrumentFunc
|
|
|
3312
3792
|
} catch {
|
|
3313
3793
|
return;
|
|
3314
3794
|
}
|
|
3315
|
-
}
|
|
3795
|
+
},
|
|
3796
|
+
selectors: cancelFlowInstrumentation
|
|
3316
3797
|
});
|
|
3317
3798
|
|
|
3318
3799
|
//#endregion
|
|
3319
3800
|
//#region src/modules/flow/getFlow/getFlow.ts
|
|
3320
3801
|
/**
|
|
3321
|
-
* Fetches a flow by its ID
|
|
3802
|
+
* Fetches a flow by its ID.
|
|
3322
3803
|
*
|
|
3323
|
-
* @
|
|
3804
|
+
* @example
|
|
3805
|
+
* ```ts
|
|
3806
|
+
* const flow = await getFlow({ flowId: 'flow-abc123' });
|
|
3807
|
+
* console.log('Flow status:', flow.status);
|
|
3808
|
+
* ```
|
|
3809
|
+
*
|
|
3810
|
+
* @param params.flowId - The unique identifier of the flow to fetch.
|
|
3324
3811
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
3325
|
-
* @returns
|
|
3812
|
+
* @returns A promise that resolves to the flow object.
|
|
3813
|
+
* @see cancelFlow
|
|
3814
|
+
* @see getFlowQuote
|
|
3326
3815
|
* @notInstrumented
|
|
3327
3816
|
*/
|
|
3328
3817
|
const getFlow = async ({ flowId }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -3336,11 +3825,24 @@ const getFlow = async ({ flowId }, client = require_updateAuthFromVerifyResponse
|
|
|
3336
3825
|
//#endregion
|
|
3337
3826
|
//#region src/modules/flow/getFlowQuote/getFlowQuote.ts
|
|
3338
3827
|
/**
|
|
3339
|
-
* Fetches a quote for a flow
|
|
3828
|
+
* Fetches a quote for a flow.
|
|
3829
|
+
*
|
|
3830
|
+
* @example
|
|
3831
|
+
* ```ts
|
|
3832
|
+
* const flow = await getFlowQuote({
|
|
3833
|
+
* flowId: 'flow-abc123',
|
|
3834
|
+
* slippage: 0.5,
|
|
3835
|
+
* });
|
|
3836
|
+
* ```
|
|
3340
3837
|
*
|
|
3341
|
-
* @param params
|
|
3838
|
+
* @param params.flowId - The unique identifier of the flow.
|
|
3839
|
+
* @param [params.fromChainId] - Optional chain ID overriding the one set at attachFlowSource time.
|
|
3840
|
+
* @param [params.fromTokenAddress] - Optional token address (defaults to native token).
|
|
3841
|
+
* @param [params.slippage] - Acceptable slippage percentage.
|
|
3342
3842
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
3343
|
-
* @returns
|
|
3843
|
+
* @returns A promise that resolves to the updated flow with quote data.
|
|
3844
|
+
* @see getFlow
|
|
3845
|
+
* @see cancelFlow
|
|
3344
3846
|
* @notInstrumented
|
|
3345
3847
|
*/
|
|
3346
3848
|
const getFlowQuote = async ({ flowId, fromChainId, fromTokenAddress, slippage }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -3360,6 +3862,22 @@ const getFlowQuote = async ({ flowId, fromChainId, fromTokenAddress, slippage },
|
|
|
3360
3862
|
}, client);
|
|
3361
3863
|
};
|
|
3362
3864
|
|
|
3865
|
+
//#endregion
|
|
3866
|
+
//#region src/modules/flow/prepareFlowSigning/prepareFlowSigning.instrumentation.ts
|
|
3867
|
+
/**
|
|
3868
|
+
* Explicit instrumentation payload for prepareFlowSigning. Logs non-sensitive
|
|
3869
|
+
* volume and routing dimensions only — never the wallet address or any
|
|
3870
|
+
* session token.
|
|
3871
|
+
*/
|
|
3872
|
+
const prepareFlowSigningInstrumentation = { resolved: (flow) => ({
|
|
3873
|
+
amount: flow.amount ?? null,
|
|
3874
|
+
currency: flow.currency ?? null,
|
|
3875
|
+
fromChainId: flow.fromChainId ?? null,
|
|
3876
|
+
fromChainName: flow.fromChainName ?? null,
|
|
3877
|
+
mode: flow.mode ?? null,
|
|
3878
|
+
sourceType: flow.sourceType ?? null
|
|
3879
|
+
}) };
|
|
3880
|
+
|
|
3363
3881
|
//#endregion
|
|
3364
3882
|
//#region src/modules/flow/prepareFlowSigning/prepareFlowSigning.ts
|
|
3365
3883
|
/**
|
|
@@ -3397,9 +3915,26 @@ const __prepareFlowSigning_wrapped = require_updateAuthFromVerifyResponse.instru
|
|
|
3397
3915
|
} catch {
|
|
3398
3916
|
return;
|
|
3399
3917
|
}
|
|
3400
|
-
}
|
|
3918
|
+
},
|
|
3919
|
+
selectors: prepareFlowSigningInstrumentation
|
|
3401
3920
|
});
|
|
3402
3921
|
|
|
3922
|
+
//#endregion
|
|
3923
|
+
//#region src/modules/flow/submitFlowTransaction/submitFlowTransaction.instrumentation.ts
|
|
3924
|
+
/**
|
|
3925
|
+
* Explicit instrumentation payload for submitFlowTransaction. Logs
|
|
3926
|
+
* non-sensitive volume and routing dimensions only — never the wallet address
|
|
3927
|
+
* or any session token — so executed flow volume is measurable.
|
|
3928
|
+
*/
|
|
3929
|
+
const submitFlowTransactionInstrumentation = { resolved: (flow) => ({
|
|
3930
|
+
amount: flow.amount ?? null,
|
|
3931
|
+
currency: flow.currency ?? null,
|
|
3932
|
+
fromChainId: flow.fromChainId ?? null,
|
|
3933
|
+
fromChainName: flow.fromChainName ?? null,
|
|
3934
|
+
mode: flow.mode ?? null,
|
|
3935
|
+
sourceType: flow.sourceType ?? null
|
|
3936
|
+
}) };
|
|
3937
|
+
|
|
3403
3938
|
//#endregion
|
|
3404
3939
|
//#region src/modules/flow/submitFlowTransaction/submitFlowTransaction.ts
|
|
3405
3940
|
/**
|
|
@@ -3443,7 +3978,8 @@ const __submitFlowTransaction_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
3443
3978
|
} catch {
|
|
3444
3979
|
return;
|
|
3445
3980
|
}
|
|
3446
|
-
}
|
|
3981
|
+
},
|
|
3982
|
+
selectors: submitFlowTransactionInstrumentation
|
|
3447
3983
|
});
|
|
3448
3984
|
|
|
3449
3985
|
//#endregion
|
|
@@ -3675,18 +4211,6 @@ const createKrakenExchangeTransfer = async (transferParams, client = require_upd
|
|
|
3675
4211
|
exchangeKey: _dynamic_labs_sdk_api_core.ExchangeKeyEnum.Kraken
|
|
3676
4212
|
});
|
|
3677
4213
|
};
|
|
3678
|
-
const __createKrakenExchangeTransfer_impl = createKrakenExchangeTransfer;
|
|
3679
|
-
const __createKrakenExchangeTransfer_wrapped = require_updateAuthFromVerifyResponse.instrumentFunction({
|
|
3680
|
-
fn: __createKrakenExchangeTransfer_impl,
|
|
3681
|
-
functionName: "createKrakenExchangeTransfer",
|
|
3682
|
-
getCore: () => {
|
|
3683
|
-
try {
|
|
3684
|
-
return require_updateAuthFromVerifyResponse.getCore(require_updateAuthFromVerifyResponse.getDefaultClient());
|
|
3685
|
-
} catch {
|
|
3686
|
-
return;
|
|
3687
|
-
}
|
|
3688
|
-
}
|
|
3689
|
-
});
|
|
3690
4214
|
|
|
3691
4215
|
//#endregion
|
|
3692
4216
|
//#region src/modules/funding/kraken/getKrakenAccounts/getKrakenAccounts.ts
|
|
@@ -3798,10 +4322,6 @@ var MoonPayProviderNotAvailableError = class extends require_updateAuthFromVerif
|
|
|
3798
4322
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
3799
4323
|
* @returns The signed MoonPay URL.
|
|
3800
4324
|
* @instrumented
|
|
3801
|
-
* @redact-params - the return is a bare signed onramp URL whose query string
|
|
3802
|
-
* carries the provider signature plus the user's wallet address; a bare-string
|
|
3803
|
-
* return is logged under the synthetic `result` key, which no key-based rule
|
|
3804
|
-
* covers, so redact the whole event.
|
|
3805
4325
|
*/
|
|
3806
4326
|
const getMoonPayUrl = async (params, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
3807
4327
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
@@ -3835,8 +4355,7 @@ const __getMoonPayUrl_wrapped = require_updateAuthFromVerifyResponse.instrumentF
|
|
|
3835
4355
|
} catch {
|
|
3836
4356
|
return;
|
|
3837
4357
|
}
|
|
3838
|
-
}
|
|
3839
|
-
redactAll: true
|
|
4358
|
+
}
|
|
3840
4359
|
});
|
|
3841
4360
|
|
|
3842
4361
|
//#endregion
|
|
@@ -3845,7 +4364,17 @@ const __getMoonPayUrl_wrapped = require_updateAuthFromVerifyResponse.instrumentF
|
|
|
3845
4364
|
* Allows waiting until all modules of the client have been properly initialized
|
|
3846
4365
|
* and are ready for use.
|
|
3847
4366
|
*
|
|
3848
|
-
* @
|
|
4367
|
+
* @example
|
|
4368
|
+
* ```ts
|
|
4369
|
+
* const client = createDynamicClient({ environmentId: 'env-id' });
|
|
4370
|
+
* await waitForClientInitialized(client);
|
|
4371
|
+
* // Client is now fully ready
|
|
4372
|
+
* ```
|
|
4373
|
+
*
|
|
4374
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4375
|
+
* @returns A promise that resolves once the client is fully initialized.
|
|
4376
|
+
* @see initializeClient
|
|
4377
|
+
* @see createDynamicClient
|
|
3849
4378
|
* @notInstrumented
|
|
3850
4379
|
* @noHook Client lifecycle management is not exposed as a hook; use useInitStatus.
|
|
3851
4380
|
*/
|
|
@@ -4420,7 +4949,6 @@ const getWalletConnectCatalogWalletByWalletProviderKey = async ({ walletProvider
|
|
|
4420
4949
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4421
4950
|
* @returns A promise that resolves to OTP verification details if verification is required, or undefined.
|
|
4422
4951
|
* @instrumented
|
|
4423
|
-
* @redact-params
|
|
4424
4952
|
*/
|
|
4425
4953
|
const updateUser = async ({ userFields }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
4426
4954
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
@@ -4450,8 +4978,7 @@ const __updateUser_wrapped = require_updateAuthFromVerifyResponse.instrumentFunc
|
|
|
4450
4978
|
} catch {
|
|
4451
4979
|
return;
|
|
4452
4980
|
}
|
|
4453
|
-
}
|
|
4454
|
-
redactAll: true
|
|
4981
|
+
}
|
|
4455
4982
|
});
|
|
4456
4983
|
|
|
4457
4984
|
//#endregion
|
|
@@ -4665,7 +5192,6 @@ const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions
|
|
|
4665
5192
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4666
5193
|
* @returns A promise that resolves to the newly generated recovery codes.
|
|
4667
5194
|
* @instrumented
|
|
4668
|
-
* @redact-params
|
|
4669
5195
|
*/
|
|
4670
5196
|
const createNewMfaRecoveryCodes = async (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
4671
5197
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
@@ -4681,8 +5207,7 @@ const __createNewMfaRecoveryCodes_wrapped = require_updateAuthFromVerifyResponse
|
|
|
4681
5207
|
} catch {
|
|
4682
5208
|
return;
|
|
4683
5209
|
}
|
|
4684
|
-
}
|
|
4685
|
-
redactAll: true
|
|
5210
|
+
}
|
|
4686
5211
|
});
|
|
4687
5212
|
|
|
4688
5213
|
//#endregion
|
|
@@ -4776,9 +5301,6 @@ const getMfaRecoveryCodes = async (client = require_updateAuthFromVerifyResponse
|
|
|
4776
5301
|
* @returns A promise that resolves to the TOTP registration response containing setup information,
|
|
4777
5302
|
* like the secret key and the OTP Auth URI.
|
|
4778
5303
|
* @instrumented
|
|
4779
|
-
* @redact-params - the response embeds the TOTP shared secret in both `secret`
|
|
4780
|
-
* and the `uri` (`otpauth://...?secret=...`); redact the whole event so the
|
|
4781
|
-
* seed never reaches logs via the un-keyed `uri` field.
|
|
4782
5304
|
*/
|
|
4783
5305
|
const registerTotpMfaDevice = async (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
4784
5306
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
@@ -4794,8 +5316,7 @@ const __registerTotpMfaDevice_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
4794
5316
|
} catch {
|
|
4795
5317
|
return;
|
|
4796
5318
|
}
|
|
4797
|
-
}
|
|
4798
|
-
redactAll: true
|
|
5319
|
+
}
|
|
4799
5320
|
});
|
|
4800
5321
|
|
|
4801
5322
|
//#endregion
|
|
@@ -4840,11 +5361,24 @@ const __setDefaultMfaDevice_wrapped = require_updateAuthFromVerifyResponse.instr
|
|
|
4840
5361
|
*
|
|
4841
5362
|
* Once you have the OTP code, you should then use `verifyOTP` to verify it and complete the authentication process.
|
|
4842
5363
|
*
|
|
5364
|
+
* @example
|
|
5365
|
+
* ```ts
|
|
5366
|
+
* const { verificationUUID } = await sendEmailOTP({
|
|
5367
|
+
* email: 'user@example.com',
|
|
5368
|
+
* });
|
|
5369
|
+
* // Then verify with the code the user received
|
|
5370
|
+
* await verifyOTP({
|
|
5371
|
+
* otpVerification: { email: 'user@example.com', verificationUUID },
|
|
5372
|
+
* verificationToken: '123456',
|
|
5373
|
+
* });
|
|
5374
|
+
* ```
|
|
5375
|
+
*
|
|
4843
5376
|
* @param params.email - The email address to send the OTP to.
|
|
4844
5377
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4845
5378
|
* @returns A promise that resolves to an OTPVerification object containing the email and verification UUID.
|
|
5379
|
+
* @see verifyOTP
|
|
5380
|
+
* @see sendSmsOTP
|
|
4846
5381
|
* @instrumented
|
|
4847
|
-
* @redact-params
|
|
4848
5382
|
*/
|
|
4849
5383
|
const sendEmailOTP = async ({ email }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
4850
5384
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
@@ -4872,8 +5406,7 @@ const __sendEmailOTP_wrapped = require_updateAuthFromVerifyResponse.instrumentFu
|
|
|
4872
5406
|
} catch {
|
|
4873
5407
|
return;
|
|
4874
5408
|
}
|
|
4875
|
-
}
|
|
4876
|
-
redactAll: true
|
|
5409
|
+
}
|
|
4877
5410
|
});
|
|
4878
5411
|
|
|
4879
5412
|
//#endregion
|
|
@@ -5802,12 +6335,23 @@ const supportedCountries = {
|
|
|
5802
6335
|
/**
|
|
5803
6336
|
* Sends a one-time password (OTP) via SMS to the specified phone number.
|
|
5804
6337
|
*
|
|
6338
|
+
* @example
|
|
6339
|
+
* ```ts
|
|
6340
|
+
* const { verificationUUID } = await sendSmsOTP({
|
|
6341
|
+
* isoCountryCode: 'US',
|
|
6342
|
+
* phoneNumber: '5551234567',
|
|
6343
|
+
* });
|
|
6344
|
+
* // Then verify with the code the user received
|
|
6345
|
+
* await verifyOTP({ otpVerification: { phoneNumber: '5551234567', verificationUUID }, verificationToken: '123456' });
|
|
6346
|
+
* ```
|
|
6347
|
+
*
|
|
5805
6348
|
* @param params.isoCountryCode - The ISO country code for the phone number (e.g., 'US', 'CA', 'GB').
|
|
5806
6349
|
* @param params.phoneNumber - The phone number to send the OTP to.
|
|
5807
6350
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
5808
6351
|
* @returns A promise that resolves to an OTPVerification object containing the phone details and verification UUID.
|
|
6352
|
+
* @see verifyOTP
|
|
6353
|
+
* @see sendEmailOTP
|
|
5809
6354
|
* @instrumented
|
|
5810
|
-
* @redact-params
|
|
5811
6355
|
*/
|
|
5812
6356
|
const sendSmsOTP = async ({ isoCountryCode, phoneNumber }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
5813
6357
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
@@ -5840,17 +6384,17 @@ const __sendSmsOTP_wrapped = require_updateAuthFromVerifyResponse.instrumentFunc
|
|
|
5840
6384
|
} catch {
|
|
5841
6385
|
return;
|
|
5842
6386
|
}
|
|
5843
|
-
}
|
|
5844
|
-
redactAll: true
|
|
6387
|
+
}
|
|
5845
6388
|
});
|
|
5846
6389
|
|
|
5847
6390
|
//#endregion
|
|
5848
6391
|
//#region src/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.ts
|
|
5849
6392
|
/** @notInstrumented */
|
|
5850
|
-
const verifyOTPForUserSignIn = async ({ otpVerification, verificationToken }, client) => {
|
|
6393
|
+
const verifyOTPForUserSignIn = async ({ allowNewMFALinking, otpVerification, verificationToken }, client) => {
|
|
5851
6394
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
5852
6395
|
const apiClient = require_updateAuthFromVerifyResponse.createApiClient({}, client);
|
|
5853
6396
|
const verifyRequest = {
|
|
6397
|
+
...allowNewMFALinking !== void 0 && { allowNewMFALinking },
|
|
5854
6398
|
verificationToken,
|
|
5855
6399
|
verificationUUID: otpVerification.verificationUUID
|
|
5856
6400
|
};
|
|
@@ -5893,14 +6437,26 @@ const verifyOTPForUserUpdate = async ({ otpVerification, verificationToken, requ
|
|
|
5893
6437
|
* This function validates the OTP code provided by the user and completes
|
|
5894
6438
|
* the verification process for either sign-in or account updates.
|
|
5895
6439
|
*
|
|
6440
|
+
* @example
|
|
6441
|
+
* ```ts
|
|
6442
|
+
* const { verificationUUID } = await sendEmailOTP({ email: 'user@example.com' });
|
|
6443
|
+
* const response = await verifyOTP({
|
|
6444
|
+
* otpVerification: { email: 'user@example.com', verificationUUID },
|
|
6445
|
+
* verificationToken: '123456',
|
|
6446
|
+
* });
|
|
6447
|
+
* ```
|
|
6448
|
+
*
|
|
6449
|
+
* @param [params.allowNewMFALinking] - Whether sign-in may return a credential-link elevated token for users without MFA.
|
|
5896
6450
|
* @param params.otpVerification - The OTP verification object containing verification details.
|
|
5897
6451
|
* @param params.verificationToken - The token received from the OTP verification process.
|
|
6452
|
+
* @param [params.requestedScopes] - Optional token scopes to request during verification.
|
|
5898
6453
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
5899
6454
|
* @returns A promise that resolves to the verify response object upon successful verification.
|
|
6455
|
+
* @see sendEmailOTP
|
|
6456
|
+
* @see sendSmsOTP
|
|
5900
6457
|
* @instrumented
|
|
5901
|
-
* @redact-params
|
|
5902
6458
|
*/
|
|
5903
|
-
const verifyOTP = async ({
|
|
6459
|
+
const verifyOTP = async ({ allowNewMFALinking, otpVerification, requestedScopes, verificationToken }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
5904
6460
|
require_isUserOnboardingComplete.preconnectWaasIframe(client);
|
|
5905
6461
|
let response;
|
|
5906
6462
|
if (client.user) response = await verifyOTPForUserUpdate({
|
|
@@ -5909,6 +6465,7 @@ const verifyOTP = async ({ otpVerification, verificationToken, requestedScopes }
|
|
|
5909
6465
|
verificationToken
|
|
5910
6466
|
}, client);
|
|
5911
6467
|
else response = await verifyOTPForUserSignIn({
|
|
6468
|
+
allowNewMFALinking,
|
|
5912
6469
|
otpVerification,
|
|
5913
6470
|
verificationToken
|
|
5914
6471
|
}, client);
|
|
@@ -5925,8 +6482,7 @@ const __verifyOTP_wrapped = require_updateAuthFromVerifyResponse.instrumentFunct
|
|
|
5925
6482
|
} catch {
|
|
5926
6483
|
return;
|
|
5927
6484
|
}
|
|
5928
|
-
}
|
|
5929
|
-
redactAll: true
|
|
6485
|
+
}
|
|
5930
6486
|
});
|
|
5931
6487
|
|
|
5932
6488
|
//#endregion
|
|
@@ -6008,6 +6564,33 @@ const getSwapStatus = async (params, client = require_updateAuthFromVerifyRespon
|
|
|
6008
6564
|
}
|
|
6009
6565
|
};
|
|
6010
6566
|
|
|
6567
|
+
//#endregion
|
|
6568
|
+
//#region src/modules/user/checkUserScopes/checkUserScopes.ts
|
|
6569
|
+
/**
|
|
6570
|
+
* Checks whether the given user has all the specified scopes.
|
|
6571
|
+
*
|
|
6572
|
+
* The user's `scope` field is a whitespace-separated string of granted
|
|
6573
|
+
* permissions (per RFC 8693 §4.2). This helper splits it and verifies that
|
|
6574
|
+
* every entry in `scopes` is present.
|
|
6575
|
+
*
|
|
6576
|
+
* @example
|
|
6577
|
+
* const user = getDefaultClient().user;
|
|
6578
|
+
* if (user && checkUserScopes({ user, scopes: ['wallets:read'] })) {
|
|
6579
|
+
* showWalletBalances();
|
|
6580
|
+
* }
|
|
6581
|
+
*
|
|
6582
|
+
* @param params.user - The authenticated user to check.
|
|
6583
|
+
* @param params.scopes - The scope strings the user must have.
|
|
6584
|
+
* @returns `true` if the user has every scope in `scopes`, `false` otherwise.
|
|
6585
|
+
* @see User
|
|
6586
|
+
* @see updateUser
|
|
6587
|
+
* @notInstrumented
|
|
6588
|
+
*/
|
|
6589
|
+
const checkUserScopes = ({ scopes, user }) => {
|
|
6590
|
+
const grantedScopes = user.scope?.split(/\s+/).filter(Boolean) ?? [];
|
|
6591
|
+
return scopes.every((requiredScope) => grantedScopes.includes(requiredScope));
|
|
6592
|
+
};
|
|
6593
|
+
|
|
6011
6594
|
//#endregion
|
|
6012
6595
|
//#region src/modules/user/deleteUser/deleteUser.ts
|
|
6013
6596
|
/**
|
|
@@ -6016,8 +6599,16 @@ const getSwapStatus = async (params, client = require_updateAuthFromVerifyRespon
|
|
|
6016
6599
|
* This function performs a hard delete of the user account. Upon successful deletion,
|
|
6017
6600
|
* the user will be automatically logged out and all authentication data will be cleared.
|
|
6018
6601
|
*
|
|
6602
|
+
* @example
|
|
6603
|
+
* ```ts
|
|
6604
|
+
* // Permanently delete the user's account
|
|
6605
|
+
* await deleteUser();
|
|
6606
|
+
* ```
|
|
6607
|
+
*
|
|
6019
6608
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6020
6609
|
* @returns A promise that resolves when the user account is successfully deleted.
|
|
6610
|
+
* @see logout
|
|
6611
|
+
* @see refreshUser
|
|
6021
6612
|
* @instrumented
|
|
6022
6613
|
*/
|
|
6023
6614
|
const deleteUser = async (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -7351,8 +7942,14 @@ const getAddressesWithTypesFromConnectionResult = (connectionResult) => {
|
|
|
7351
7942
|
*
|
|
7352
7943
|
* Note: This function will not verify the wallet account, use the verifyWalletAccount function to do that
|
|
7353
7944
|
* or connectAndVerifyWithWalletProvider to do that in a single step.
|
|
7354
|
-
*
|
|
7355
|
-
* @
|
|
7945
|
+
*
|
|
7946
|
+
* @example
|
|
7947
|
+
* ```ts
|
|
7948
|
+
* const walletAccount = await connectWithWalletProvider({
|
|
7949
|
+
* walletProviderKey: 'metamaskevm',
|
|
7950
|
+
* });
|
|
7951
|
+
* console.log(walletAccount.address);
|
|
7952
|
+
* ```
|
|
7356
7953
|
*
|
|
7357
7954
|
* @param params.walletProviderKey - The unique key identifying the wallet provider to connect to (e.g. 'metamaskevm', 'phantomsol').
|
|
7358
7955
|
* @param [params.addToDynamicWalletAccounts] - Whether to add the connected wallet account to the user's wallet accounts. Defaults to true.
|
|
@@ -7360,7 +7957,9 @@ const getAddressesWithTypesFromConnectionResult = (connectionResult) => {
|
|
|
7360
7957
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
7361
7958
|
* @returns A promise that resolves to the connected wallet account.
|
|
7362
7959
|
* @throws NoAddressFoundError If the request to connect was successful but no address is connected to your app.
|
|
7363
|
-
*
|
|
7960
|
+
* @see verifyWalletAccount
|
|
7961
|
+
* @see connectAndVerifyWithWalletProvider
|
|
7962
|
+
* @instrumented
|
|
7364
7963
|
*/
|
|
7365
7964
|
const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWalletAccounts = true, hardwareWalletVendor }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
7366
7965
|
const walletProvider = require_getWalletProviderByKey.getWalletProviderByKey({ walletProviderKey }, client);
|
|
@@ -7497,9 +8096,19 @@ const getSignInMessage = async ({ nonce: nonceOverride, walletAccount }, client)
|
|
|
7497
8096
|
* This function generates a sign-in message and requires the user to sign it
|
|
7498
8097
|
* with their wallet's private key, proving they control the wallet address.
|
|
7499
8098
|
*
|
|
8099
|
+
* @example
|
|
8100
|
+
* ```ts
|
|
8101
|
+
* const { messageToSign, signature } = await proveWalletAccountOwnership({
|
|
8102
|
+
* walletAccount: wallets[0],
|
|
8103
|
+
* });
|
|
8104
|
+
* // Send signature to your backend for verification
|
|
8105
|
+
* ```
|
|
8106
|
+
*
|
|
7500
8107
|
* @param params.walletAccount - The wallet account to prove ownership of.
|
|
7501
8108
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
7502
8109
|
* @returns A promise that resolves to an object containing the message and signature.
|
|
8110
|
+
* @see signMessage
|
|
8111
|
+
* @see verifyWalletAccount
|
|
7503
8112
|
* @instrumented
|
|
7504
8113
|
*/
|
|
7505
8114
|
const proveWalletAccountOwnership = async ({ walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -7603,11 +8212,22 @@ const verifyWalletAccountForSignInOrTransfer = async ({ walletAccount, isTransfe
|
|
|
7603
8212
|
* This function requires the user to sign a message to prove wallet ownership,
|
|
7604
8213
|
* then sets the wallet account as verified.
|
|
7605
8214
|
*
|
|
8215
|
+
* @example
|
|
8216
|
+
* ```ts
|
|
8217
|
+
* const walletAccount = await connectWithWalletProvider({
|
|
8218
|
+
* walletProviderKey: 'metamaskevm',
|
|
8219
|
+
* });
|
|
8220
|
+
* const verified = await verifyWalletAccount({ walletAccount });
|
|
8221
|
+
* ```
|
|
8222
|
+
*
|
|
7606
8223
|
* @param params.walletAccount - The wallet account to verify ownership of.
|
|
8224
|
+
* @param [params.requestedScopes] - Optional token scopes to request during verification.
|
|
7607
8225
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
7608
8226
|
* @returns A promise that resolves to the verified wallet account.
|
|
7609
8227
|
* @throws WalletAccountAlreadyVerifiedError If the wallet is already verified.
|
|
7610
8228
|
* @throws WalletAlreadyLinkedToAnotherUserError If the wallet is linked to another user.
|
|
8229
|
+
* @see connectWithWalletProvider
|
|
8230
|
+
* @see connectAndVerifyWithWalletProvider
|
|
7611
8231
|
* @instrumented
|
|
7612
8232
|
*/
|
|
7613
8233
|
const verifyWalletAccount = async ({ walletAccount, requestedScopes }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -7657,10 +8277,20 @@ const isDeeplinkWalletProvider = ({ walletProvider }) => walletProvider.walletPr
|
|
|
7657
8277
|
* `verifyWalletAccount` separately from a new user gesture (e.g. a "Verify
|
|
7658
8278
|
* Ownership" button).
|
|
7659
8279
|
*
|
|
8280
|
+
* @example
|
|
8281
|
+
* ```ts
|
|
8282
|
+
* const walletAccount = await connectAndVerifyWithWalletProvider({
|
|
8283
|
+
* walletProviderKey: 'metamaskevm',
|
|
8284
|
+
* });
|
|
8285
|
+
* console.log('Verified address:', walletAccount.address);
|
|
8286
|
+
* ```
|
|
8287
|
+
*
|
|
7660
8288
|
* @param params.walletProviderKey - The unique key identifying the wallet provider to connect to.
|
|
7661
8289
|
* @param [params.hardwareWalletVendor] - The hardware wallet vendor, if connecting via a hardware wallet (e.g. 'ledger').
|
|
7662
8290
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
7663
8291
|
* @returns A promise that resolves to the connected and verified wallet account.
|
|
8292
|
+
* @see connectWithWalletProvider
|
|
8293
|
+
* @see verifyWalletAccount
|
|
7664
8294
|
* @instrumented
|
|
7665
8295
|
*/
|
|
7666
8296
|
const connectAndVerifyWithWalletProvider = async ({ walletProviderKey, hardwareWalletVendor }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -7722,9 +8352,17 @@ const getAvailableWalletProvidersData = (client = require_updateAuthFromVerifyRe
|
|
|
7722
8352
|
* This function returns the list of wallet addresses that are currently
|
|
7723
8353
|
* connected and available through the specified wallet provider.
|
|
7724
8354
|
*
|
|
8355
|
+
* @example
|
|
8356
|
+
* ```ts
|
|
8357
|
+
* const addresses = getConnectedAddresses({ walletProviderKey: 'metamaskevm' });
|
|
8358
|
+
* console.log('Connected:', addresses);
|
|
8359
|
+
* ```
|
|
8360
|
+
*
|
|
7725
8361
|
* @param params.walletProviderKey - The unique key of the wallet provider to query.
|
|
7726
8362
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
7727
8363
|
* @returns An array of connected wallet addresses.
|
|
8364
|
+
* @see connectWithWalletProvider
|
|
8365
|
+
* @see getWalletAccounts
|
|
7728
8366
|
* @notInstrumented
|
|
7729
8367
|
*/
|
|
7730
8368
|
const getConnectedAddresses = ({ walletProviderKey }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -7756,6 +8394,7 @@ const getWalletAccountAddressByType = ({ type, walletAccount }) => {
|
|
|
7756
8394
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
7757
8395
|
* @returns The data for the wallet provider.
|
|
7758
8396
|
* @notInstrumented
|
|
8397
|
+
* @hook Exposed as a hook so consumers get reactive wallet provider data, updated when the wallet provider registry changes.
|
|
7759
8398
|
*/
|
|
7760
8399
|
const getWalletProviderDataByKey = ({ walletProviderKey }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
7761
8400
|
const { chain, groupKey, key, metadata, walletProviderType } = require_getWalletProviderByKey.getWalletProviderByKey({ walletProviderKey }, client);
|
|
@@ -7804,8 +8443,17 @@ const isHardwareWalletAccount = ({ walletAccount }) => walletAccount.hardwareWal
|
|
|
7804
8443
|
* else your app considers "signed in" (e.g. `client.user`, completed onboarding,
|
|
7805
8444
|
* a required embedded wallet, …).
|
|
7806
8445
|
*
|
|
8446
|
+
* @example
|
|
8447
|
+
* ```ts
|
|
8448
|
+
* if (isAnyWalletAccountConnected()) {
|
|
8449
|
+
* console.log('At least one wallet is connected');
|
|
8450
|
+
* }
|
|
8451
|
+
* ```
|
|
8452
|
+
*
|
|
7807
8453
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
7808
8454
|
* @returns True if the session has at least one wallet account, false otherwise.
|
|
8455
|
+
* @see getWalletAccounts
|
|
8456
|
+
* @see isWalletAccountVerified
|
|
7809
8457
|
* @notInstrumented
|
|
7810
8458
|
*/
|
|
7811
8459
|
const isAnyWalletAccountConnected = (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => require_updateAuthFromVerifyResponse.getWalletAccounts(client).length > 0;
|
|
@@ -7815,8 +8463,16 @@ const isAnyWalletAccountConnected = (client = require_updateAuthFromVerifyRespon
|
|
|
7815
8463
|
/**
|
|
7816
8464
|
* Checks if a wallet account has been verified by a user.
|
|
7817
8465
|
*
|
|
7818
|
-
* @
|
|
8466
|
+
* @example
|
|
8467
|
+
* ```ts
|
|
8468
|
+
* const wallets = getWalletAccounts();
|
|
8469
|
+
* const verified = wallets.filter(w => isWalletAccountVerified({ walletAccount: w }));
|
|
8470
|
+
* ```
|
|
8471
|
+
*
|
|
8472
|
+
* @param params.walletAccount - The wallet account to check.
|
|
7819
8473
|
* @returns True if the wallet account has been verified, false otherwise.
|
|
8474
|
+
* @see verifyWalletAccount
|
|
8475
|
+
* @see getWalletAccounts
|
|
7820
8476
|
* @notInstrumented
|
|
7821
8477
|
*/
|
|
7822
8478
|
const isWalletAccountVerified = ({ walletAccount }) => {
|
|
@@ -7906,9 +8562,17 @@ const getActiveNetworkId = ({ walletAccount }, client = require_updateAuthFromVe
|
|
|
7906
8562
|
* {@link getTokenBalances}; for a multi-chain portfolio snapshot, use
|
|
7907
8563
|
* {@link getMultichainTokenBalances}.
|
|
7908
8564
|
*
|
|
8565
|
+
* @example
|
|
8566
|
+
* ```ts
|
|
8567
|
+
* const { balance } = await getNativeBalance({ walletAccount: wallets[0] });
|
|
8568
|
+
* console.log('Native balance:', balance);
|
|
8569
|
+
* ```
|
|
8570
|
+
*
|
|
7909
8571
|
* @param params.walletAccount - The wallet account to get the balance for.
|
|
7910
8572
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
7911
8573
|
* @returns A promise that resolves to an object containing the balance as a string or null.
|
|
8574
|
+
* @see getMultichainTokenBalances
|
|
8575
|
+
* @see switchActiveNetwork
|
|
7912
8576
|
* @notInstrumented
|
|
7913
8577
|
*/
|
|
7914
8578
|
const getNativeBalance = async ({ walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -7928,6 +8592,14 @@ const getNativeBalance = async ({ walletAccount }, client = require_updateAuthFr
|
|
|
7928
8592
|
* with the token-balance fetchers (`getTokenBalances` /
|
|
7929
8593
|
* `getMultichainTokenBalances`).
|
|
7930
8594
|
*
|
|
8595
|
+
* @example
|
|
8596
|
+
* ```ts
|
|
8597
|
+
* // Prefer getNativeBalance instead
|
|
8598
|
+
* const balance = await getNativeBalance({ walletAccount });
|
|
8599
|
+
* ```
|
|
8600
|
+
*
|
|
8601
|
+
* @see getNativeBalance
|
|
8602
|
+
* @see getMultichainBalances
|
|
7931
8603
|
* @notInstrumented
|
|
7932
8604
|
* @noHook Deprecated; the replacement is exposed via its own hook.
|
|
7933
8605
|
*/
|
|
@@ -8013,11 +8685,21 @@ const isProgrammaticNetworkSwitchAvailable = ({ walletAccount }, client = requir
|
|
|
8013
8685
|
* This function programmatically changes the network
|
|
8014
8686
|
* that the wallet is currently connected to.
|
|
8015
8687
|
*
|
|
8688
|
+
* @example
|
|
8689
|
+
* ```ts
|
|
8690
|
+
* await switchActiveNetwork({
|
|
8691
|
+
* walletAccount: wallets[0],
|
|
8692
|
+
* networkId: '137', // Polygon
|
|
8693
|
+
* });
|
|
8694
|
+
* ```
|
|
8695
|
+
*
|
|
8016
8696
|
* @param params.networkId - The identifier of the network to switch to. Should match the networkId of the network data.
|
|
8017
8697
|
* @param params.walletAccount - The wallet account to switch networks for.
|
|
8018
8698
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8019
8699
|
* @returns A promise that resolves when the network switch is complete.
|
|
8020
8700
|
* @throws NetworkSwitchingUnavailableError If the wallet provider doesn't support network switching.
|
|
8701
|
+
* @see getNativeBalance
|
|
8702
|
+
* @see isProgrammaticNetworkSwitchAvailable
|
|
8021
8703
|
* @instrumented
|
|
8022
8704
|
*/
|
|
8023
8705
|
const switchActiveNetwork = async ({ networkId, walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -8043,15 +8725,37 @@ const __switchActiveNetwork_wrapped = require_updateAuthFromVerifyResponse.instr
|
|
|
8043
8725
|
});
|
|
8044
8726
|
|
|
8045
8727
|
//#endregion
|
|
8046
|
-
//#region src/modules/wallets/
|
|
8728
|
+
//#region src/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/setSelectedWalletAccount.ts
|
|
8047
8729
|
/**
|
|
8048
|
-
*
|
|
8730
|
+
* Set the wallet account that is currently selected for the user.
|
|
8731
|
+
*
|
|
8732
|
+
* The SDK itself does not use or care about which wallet is "selected" — this
|
|
8733
|
+
* only records the selection (updating the backend `lastSelectedAt` and, for
|
|
8734
|
+
* verified wallets, persisting it server-side) so it can later be read back via
|
|
8735
|
+
* `getSelectedWalletAccount`. It has no bearing on authentication or signing.
|
|
8736
|
+
* Applications that need a notion of an active/current wallet should own that
|
|
8737
|
+
* selection state themselves.
|
|
8738
|
+
*
|
|
8739
|
+
* The one exception is the wagmi integration (`@dynamic-labs-sdk/wagmi`), which
|
|
8740
|
+
* relies on the selected EVM wallet.
|
|
8741
|
+
*
|
|
8742
|
+
* @example
|
|
8743
|
+
* ```ts
|
|
8744
|
+
* const wallets = getWalletAccounts();
|
|
8745
|
+
* await setSelectedWalletAccount({ walletAccount: wallets[1] });
|
|
8746
|
+
* ```
|
|
8747
|
+
*
|
|
8748
|
+
* @param params.walletAccount - The wallet account to mark as selected.
|
|
8749
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8750
|
+
* @returns A promise that resolves when the selection is persisted.
|
|
8751
|
+
* @see getSelectedWalletAccount
|
|
8752
|
+
* @see getWalletAccounts
|
|
8049
8753
|
* @instrumented
|
|
8050
|
-
* @noHook The
|
|
8754
|
+
* @noHook The selected-wallet concept is not exposed as a hook.
|
|
8051
8755
|
*/
|
|
8052
|
-
const
|
|
8756
|
+
const setSelectedWalletAccount = async ({ walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
8053
8757
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
8054
|
-
if (
|
|
8758
|
+
if (getSelectedWalletAccount(client)?.id === walletAccount.id) return;
|
|
8055
8759
|
if (walletAccount.verifiedCredentialId) require_updateAuthFromVerifyResponse.updateAuthFromVerifyResponse({ response: await require_updateAuthFromVerifyResponse.createApiClient({}, client).selectUserWallet({
|
|
8056
8760
|
environmentId: core.environmentId,
|
|
8057
8761
|
userWalletSelectionRequest: { walletId: walletAccount.verifiedCredentialId }
|
|
@@ -8061,6 +8765,68 @@ const selectPrimaryWalletAccount = async ({ walletAccount }, client = require_up
|
|
|
8061
8765
|
lastSelectedAt: /* @__PURE__ */ new Date()
|
|
8062
8766
|
}] }, client);
|
|
8063
8767
|
};
|
|
8768
|
+
const __setSelectedWalletAccount_impl = setSelectedWalletAccount;
|
|
8769
|
+
const __setSelectedWalletAccount_wrapped = require_updateAuthFromVerifyResponse.instrumentFunction({
|
|
8770
|
+
fn: __setSelectedWalletAccount_impl,
|
|
8771
|
+
functionName: "setSelectedWalletAccount",
|
|
8772
|
+
getCore: () => {
|
|
8773
|
+
try {
|
|
8774
|
+
return require_updateAuthFromVerifyResponse.getCore(require_updateAuthFromVerifyResponse.getDefaultClient());
|
|
8775
|
+
} catch {
|
|
8776
|
+
return;
|
|
8777
|
+
}
|
|
8778
|
+
}
|
|
8779
|
+
});
|
|
8780
|
+
|
|
8781
|
+
//#endregion
|
|
8782
|
+
//#region src/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.ts
|
|
8783
|
+
/**
|
|
8784
|
+
* Get the primary wallet account.
|
|
8785
|
+
*
|
|
8786
|
+
* @deprecated Renamed to `getSelectedWalletAccount`. The "primary wallet" naming was
|
|
8787
|
+
* misleading — the SDK does not use or care about which wallet is selected; it
|
|
8788
|
+
* only lets you *read* the user's most recently selected wallet. Migrate to
|
|
8789
|
+
* `getSelectedWalletAccount`, and own your own wallet-selection state in your
|
|
8790
|
+
* application rather than relying on the SDK's selected wallet.
|
|
8791
|
+
*
|
|
8792
|
+
* @example
|
|
8793
|
+
* ```ts
|
|
8794
|
+
* const primary = getPrimaryWalletAccount();
|
|
8795
|
+
* if (primary) {
|
|
8796
|
+
* console.log('Primary wallet:', primary.address);
|
|
8797
|
+
* }
|
|
8798
|
+
* ```
|
|
8799
|
+
*
|
|
8800
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8801
|
+
* @returns The primary wallet account, or null if no wallet has been selected.
|
|
8802
|
+
* @notInstrumented
|
|
8803
|
+
*/
|
|
8804
|
+
const getPrimaryWalletAccount = (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => getSelectedWalletAccount(client);
|
|
8805
|
+
|
|
8806
|
+
//#endregion
|
|
8807
|
+
//#region src/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.ts
|
|
8808
|
+
/**
|
|
8809
|
+
* Make the wallet account provided as the primary wallet account.
|
|
8810
|
+
*
|
|
8811
|
+
* @deprecated Renamed to `setSelectedWalletAccount`. The "primary wallet" naming was
|
|
8812
|
+
* misleading — the SDK does not use or care about which wallet is selected;
|
|
8813
|
+
* this only records the selection so it can later be read back. Migrate to
|
|
8814
|
+
* `setSelectedWalletAccount`, and own your own wallet-selection state in your
|
|
8815
|
+
* application rather than relying on the SDK's selected wallet.
|
|
8816
|
+
*
|
|
8817
|
+
* @example
|
|
8818
|
+
* ```ts
|
|
8819
|
+
* const wallets = getWalletAccounts();
|
|
8820
|
+
* await selectPrimaryWalletAccount({ walletAccount: wallets[1] });
|
|
8821
|
+
* ```
|
|
8822
|
+
*
|
|
8823
|
+
* @param params.walletAccount - The wallet account to set as primary.
|
|
8824
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8825
|
+
* @returns A promise that resolves when the selection is persisted.
|
|
8826
|
+
* @instrumented
|
|
8827
|
+
* @noHook The selected-wallet concept is not exposed as a hook.
|
|
8828
|
+
*/
|
|
8829
|
+
const selectPrimaryWalletAccount = async ({ walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => __setSelectedWalletAccount_wrapped({ walletAccount }, client);
|
|
8064
8830
|
const __selectPrimaryWalletAccount_impl = selectPrimaryWalletAccount;
|
|
8065
8831
|
const __selectPrimaryWalletAccount_wrapped = require_updateAuthFromVerifyResponse.instrumentFunction({
|
|
8066
8832
|
fn: __selectPrimaryWalletAccount_impl,
|
|
@@ -8077,10 +8843,23 @@ const __selectPrimaryWalletAccount_wrapped = require_updateAuthFromVerifyRespons
|
|
|
8077
8843
|
//#endregion
|
|
8078
8844
|
//#region src/modules/wallets/disconnectWalletAccount/disconnectWalletAccount.ts
|
|
8079
8845
|
/**
|
|
8080
|
-
*
|
|
8846
|
+
* Disconnects the specified wallet account from its wallet provider.
|
|
8081
8847
|
*
|
|
8082
|
-
* The wallet account is not removed from the user's profile or from
|
|
8848
|
+
* The wallet account is not removed from the user's profile or from Dynamic's state,
|
|
8083
8849
|
* it is only responsible for terminating the connection with the wallet provider.
|
|
8850
|
+
* Use `removeWalletAccount` to fully remove a wallet from the user's session.
|
|
8851
|
+
*
|
|
8852
|
+
* @example
|
|
8853
|
+
* ```ts
|
|
8854
|
+
* const wallets = getWalletAccounts();
|
|
8855
|
+
* await disconnectWalletAccount({ walletAccount: wallets[0] }, client);
|
|
8856
|
+
* ```
|
|
8857
|
+
*
|
|
8858
|
+
* @param params.walletAccount - The wallet account to disconnect.
|
|
8859
|
+
* @param client - The Dynamic client instance.
|
|
8860
|
+
* @returns A promise that resolves when the wallet is disconnected from the provider.
|
|
8861
|
+
* @see removeWalletAccount
|
|
8862
|
+
* @see connectWithWalletProvider
|
|
8084
8863
|
* @notInstrumented
|
|
8085
8864
|
*/
|
|
8086
8865
|
const disconnectWalletAccount = async ({ walletAccount }, client) => {
|
|
@@ -8101,9 +8880,17 @@ const disconnectWalletAccount = async ({ walletAccount }, client) => {
|
|
|
8101
8880
|
* updating local state and server records (if there is an authenticated user).
|
|
8102
8881
|
* For verified wallets, it will unlink them from the user's account.
|
|
8103
8882
|
*
|
|
8883
|
+
* @example
|
|
8884
|
+
* ```ts
|
|
8885
|
+
* const wallets = getWalletAccounts();
|
|
8886
|
+
* await removeWalletAccount({ walletAccount: wallets[0] });
|
|
8887
|
+
* ```
|
|
8888
|
+
*
|
|
8104
8889
|
* @param params.walletAccount - The wallet account to remove.
|
|
8105
8890
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8106
8891
|
* @returns A promise that resolves when the wallet account is successfully removed.
|
|
8892
|
+
* @see getWalletAccounts
|
|
8893
|
+
* @see disconnectWalletAccount
|
|
8107
8894
|
* @instrumented
|
|
8108
8895
|
*/
|
|
8109
8896
|
const removeWalletAccount = async ({ walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -8140,10 +8927,21 @@ const __removeWalletAccount_wrapped = require_updateAuthFromVerifyResponse.instr
|
|
|
8140
8927
|
* This function uses the wallet's private key to cryptographically sign
|
|
8141
8928
|
* the provided message.
|
|
8142
8929
|
*
|
|
8930
|
+
* @example
|
|
8931
|
+
* ```ts
|
|
8932
|
+
* const wallets = getWalletAccounts();
|
|
8933
|
+
* const { signature } = await signMessage({
|
|
8934
|
+
* walletAccount: wallets[0],
|
|
8935
|
+
* message: 'Hello Dynamic!',
|
|
8936
|
+
* });
|
|
8937
|
+
* ```
|
|
8938
|
+
*
|
|
8143
8939
|
* @param params.walletAccount - The wallet account to use for signing.
|
|
8144
8940
|
* @param params.message - The message to sign.
|
|
8145
8941
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8146
8942
|
* @returns A promise that resolves to an object containing the signature.
|
|
8943
|
+
* @see getWalletAccounts
|
|
8944
|
+
* @see connectWithWalletProvider
|
|
8147
8945
|
* @instrumented
|
|
8148
8946
|
*/
|
|
8149
8947
|
const signMessage = async ({ walletAccount, message }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -8176,13 +8974,24 @@ const __signMessage_wrapped = require_updateAuthFromVerifyResponse.instrumentFun
|
|
|
8176
8974
|
* Supports native token transfers and, where supported by the chain,
|
|
8177
8975
|
* fungible/token transfers via the optional `token` parameter.
|
|
8178
8976
|
*
|
|
8977
|
+
* @example
|
|
8978
|
+
* ```ts
|
|
8979
|
+
* const { transactionHash } = await transferAmount({
|
|
8980
|
+
* walletAccount: wallets[0],
|
|
8981
|
+
* amount: '0.1',
|
|
8982
|
+
* recipient: '0x1234...abcd',
|
|
8983
|
+
* });
|
|
8984
|
+
* ```
|
|
8985
|
+
*
|
|
8179
8986
|
* @param params.walletAccount - The wallet account to transfer from.
|
|
8180
8987
|
* @param params.amount - The amount to transfer as a decimal string (e.g. "1.5").
|
|
8181
8988
|
* @param params.recipient - The recipient address.
|
|
8182
|
-
* @param params.token - Optional token info for non-native transfers.
|
|
8989
|
+
* @param [params.token] - Optional token info for non-native transfers.
|
|
8183
8990
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8184
8991
|
* @returns A promise that resolves to an object containing the transaction hash.
|
|
8185
8992
|
* @throws If the wallet provider does not support the transfer amount method.
|
|
8993
|
+
* @see getWalletAccounts
|
|
8994
|
+
* @see signMessage
|
|
8186
8995
|
* @instrumented
|
|
8187
8996
|
*/
|
|
8188
8997
|
const transferAmount = async ({ walletAccount, amount, recipient, token }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -8217,9 +9026,18 @@ const __transferAmount_wrapped = require_updateAuthFromVerifyResponse.instrument
|
|
|
8217
9026
|
* This function requires the user to sign a message to prove wallet ownership,
|
|
8218
9027
|
* then transfers the wallet account to the current user's account.
|
|
8219
9028
|
*
|
|
9029
|
+
* @example
|
|
9030
|
+
* ```ts
|
|
9031
|
+
* const walletAccount = await transferWalletAccount({
|
|
9032
|
+
* walletProviderKey: 'metamaskevm',
|
|
9033
|
+
* });
|
|
9034
|
+
* ```
|
|
9035
|
+
*
|
|
8220
9036
|
* @param params.walletProviderKey - The key of the wallet provider of the wallet account to transfer.
|
|
8221
9037
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8222
9038
|
* @returns A promise that resolves to the transferred wallet account.
|
|
9039
|
+
* @see connectWithWalletProvider
|
|
9040
|
+
* @see verifyWalletAccount
|
|
8223
9041
|
* @instrumented
|
|
8224
9042
|
*/
|
|
8225
9043
|
const transferWalletAccount = async ({ walletProviderKey }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -8252,10 +9070,20 @@ const __transferWalletAccount_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
8252
9070
|
* This function searches through the current session's wallet accounts
|
|
8253
9071
|
* to find one matching the specified address and chain.
|
|
8254
9072
|
*
|
|
9073
|
+
* @example
|
|
9074
|
+
* ```ts
|
|
9075
|
+
* const account = getWalletAccountFromAddress({
|
|
9076
|
+
* address: '0x1234...abcd',
|
|
9077
|
+
* chain: 'EVM',
|
|
9078
|
+
* });
|
|
9079
|
+
* ```
|
|
9080
|
+
*
|
|
8255
9081
|
* @param params.address - The wallet address to search for.
|
|
8256
9082
|
* @param params.chain - The blockchain the wallet belongs to.
|
|
8257
9083
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8258
9084
|
* @returns The matching wallet account, or undefined if not found.
|
|
9085
|
+
* @see getWalletAccounts
|
|
9086
|
+
* @see isWalletAccountVerified
|
|
8259
9087
|
* @notInstrumented
|
|
8260
9088
|
*/
|
|
8261
9089
|
const getWalletAccountFromAddress = ({ address, chain }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -8415,9 +9243,11 @@ const parseUserAgent = ({ userAgent }) => {
|
|
|
8415
9243
|
|
|
8416
9244
|
//#endregion
|
|
8417
9245
|
exports.BaseError = require_updateAuthFromVerifyResponse.BaseError;
|
|
9246
|
+
exports.CaptchaProviderEnum = CaptchaProviderEnum;
|
|
8418
9247
|
exports.CheckoutSessionTokenMissingError = CheckoutSessionTokenMissingError;
|
|
8419
9248
|
exports.ClientAlreadyInitializedError = ClientAlreadyInitializedError;
|
|
8420
9249
|
exports.DeeplinkConnectAndVerifyUnsupportedError = DeeplinkConnectAndVerifyUnsupportedError;
|
|
9250
|
+
exports.DeviceRegistrationIdentityMismatchError = DeviceRegistrationIdentityMismatchError;
|
|
8421
9251
|
exports.FeeEstimationFailedError = FeeEstimationFailedError;
|
|
8422
9252
|
exports.FlowSessionTokenMissingError = FlowSessionTokenMissingError;
|
|
8423
9253
|
exports.GOOGLE_DRIVE_BACKUP_REQUIRED_SCOPES = GOOGLE_DRIVE_BACKUP_REQUIRED_SCOPES;
|
|
@@ -8439,6 +9269,7 @@ Object.defineProperty(exports, 'MFAAction', {
|
|
|
8439
9269
|
return _dynamic_labs_sdk_api_core.MFAAction;
|
|
8440
9270
|
}
|
|
8441
9271
|
});
|
|
9272
|
+
exports.MergeAccountsConfirmationError = require_getNetworkProviderFromNetworkId.MergeAccountsConfirmationError;
|
|
8442
9273
|
exports.MfaInvalidOtpError = require_updateAuthFromVerifyResponse.MfaInvalidOtpError;
|
|
8443
9274
|
exports.MfaRateLimitedError = require_updateAuthFromVerifyResponse.MfaRateLimitedError;
|
|
8444
9275
|
exports.MissingRedirectStorageStateError = MissingRedirectStorageStateError;
|
|
@@ -8479,6 +9310,7 @@ exports.WalletAccountAlreadyVerifiedError = WalletAccountAlreadyVerifiedError;
|
|
|
8479
9310
|
exports.WalletAccountNotSelectedError = WalletAccountNotSelectedError;
|
|
8480
9311
|
exports.WalletAlreadyLinkedToAnotherUserError = require_getNetworkProviderFromNetworkId.WalletAlreadyLinkedToAnotherUserError;
|
|
8481
9312
|
exports.WalletProviderMethodUnavailableError = WalletProviderMethodUnavailableError;
|
|
9313
|
+
exports.WalletScreeningBlockedError = require_getNetworkProviderFromNetworkId.WalletScreeningBlockedError;
|
|
8482
9314
|
exports.acknowledgeRecoveryCodes = __acknowledgeRecoveryCodes_wrapped;
|
|
8483
9315
|
exports.addCoinbaseOnrampOrderEventListener = addCoinbaseOnrampOrderEventListener;
|
|
8484
9316
|
exports.addNetwork = __addNetwork_wrapped;
|
|
@@ -8497,6 +9329,9 @@ exports.canConnectWithHardwareWallet = canConnectWithHardwareWallet;
|
|
|
8497
9329
|
exports.cancelCheckoutTransaction = __cancelCheckoutTransaction_wrapped;
|
|
8498
9330
|
exports.cancelFlow = __cancelFlow_wrapped;
|
|
8499
9331
|
exports.checkStepUpAuth = __checkStepUpAuth_wrapped;
|
|
9332
|
+
exports.checkUserScopes = checkUserScopes;
|
|
9333
|
+
exports.clearDeviceRegistrationRedirectParams = clearDeviceRegistrationRedirectParams;
|
|
9334
|
+
exports.clearSocialRedirectParams = clearSocialRedirectParams;
|
|
8500
9335
|
exports.completeDeviceRegistration = __completeDeviceRegistration_wrapped;
|
|
8501
9336
|
exports.completeSocialAuthentication = __completeSocialAuthentication_wrapped;
|
|
8502
9337
|
exports.completeSocialRedirect = __completeSocialRedirect_wrapped;
|
|
@@ -8508,7 +9343,7 @@ exports.createCheckoutTransaction = __createCheckoutTransaction_wrapped;
|
|
|
8508
9343
|
exports.createCoinbaseOnrampOrder = __createCoinbaseOnrampOrder_wrapped;
|
|
8509
9344
|
exports.createCryptoDotComPayment = __createCryptoDotComPayment_wrapped;
|
|
8510
9345
|
exports.createDynamicClient = __createDynamicClient_wrapped;
|
|
8511
|
-
exports.createKrakenExchangeTransfer =
|
|
9346
|
+
exports.createKrakenExchangeTransfer = createKrakenExchangeTransfer;
|
|
8512
9347
|
exports.createNewMfaRecoveryCodes = __createNewMfaRecoveryCodes_wrapped;
|
|
8513
9348
|
exports.deleteMfaDevice = __deleteMfaDevice_wrapped;
|
|
8514
9349
|
exports.deletePasskey = __deletePasskey_wrapped;
|
|
@@ -8526,6 +9361,7 @@ exports.getAvailableWalletProvidersData = getAvailableWalletProvidersData;
|
|
|
8526
9361
|
exports.getBalance = getBalance;
|
|
8527
9362
|
exports.getBalanceForAddress = getBalanceForAddress;
|
|
8528
9363
|
exports.getBalances = getBalances;
|
|
9364
|
+
exports.getCaptchaSettings = getCaptchaSettings;
|
|
8529
9365
|
exports.getCheckoutTransaction = getCheckoutTransaction;
|
|
8530
9366
|
exports.getCheckoutTransactionQuote = getCheckoutTransactionQuote;
|
|
8531
9367
|
exports.getCoinbaseBuyUrl = getCoinbaseBuyUrl;
|
|
@@ -8553,6 +9389,7 @@ exports.getOwnerWalletAccountForSmartWalletAccount = getOwnerWalletAccountForSma
|
|
|
8553
9389
|
exports.getPasskeys = getPasskeys;
|
|
8554
9390
|
exports.getPrimaryWalletAccount = getPrimaryWalletAccount;
|
|
8555
9391
|
exports.getRegisteredDevices = getRegisteredDevices;
|
|
9392
|
+
exports.getSelectedWalletAccount = getSelectedWalletAccount;
|
|
8556
9393
|
exports.getSwapQuote = getSwapQuote;
|
|
8557
9394
|
exports.getSwapStatus = getSwapStatus;
|
|
8558
9395
|
exports.getTokenBalances = getTokenBalances;
|
|
@@ -8584,6 +9421,7 @@ exports.isUserOnboardingComplete = require_isUserOnboardingComplete.isUserOnboar
|
|
|
8584
9421
|
exports.isWalletAccountVerified = isWalletAccountVerified;
|
|
8585
9422
|
exports.logout = logout;
|
|
8586
9423
|
exports.matchWalletProvidersToCatalogGroup = matchWalletProvidersToCatalogGroup;
|
|
9424
|
+
exports.mergeUserAccounts = mergeUserAccounts;
|
|
8587
9425
|
exports.offEvent = require_updateAuthFromVerifyResponse.offEvent;
|
|
8588
9426
|
exports.offWalletProviderEvent = offWalletProviderEvent;
|
|
8589
9427
|
exports.onEvent = require_updateAuthFromVerifyResponse.onEvent;
|
|
@@ -8608,6 +9446,7 @@ exports.sendSmsOTP = __sendSmsOTP_wrapped;
|
|
|
8608
9446
|
exports.setCaptchaToken = require_getNetworkProviderFromNetworkId.__setCaptchaToken_wrapped;
|
|
8609
9447
|
exports.setDefaultMfaDevice = __setDefaultMfaDevice_wrapped;
|
|
8610
9448
|
exports.setInstrumentationEnabled = __setInstrumentationEnabled_wrapped;
|
|
9449
|
+
exports.setSelectedWalletAccount = __setSelectedWalletAccount_wrapped;
|
|
8611
9450
|
exports.signInWithExternalJwt = __signInWithExternalJwt_wrapped;
|
|
8612
9451
|
exports.signInWithPasskey = __signInWithPasskey_wrapped;
|
|
8613
9452
|
exports.signInWithSocialPopUp = __signInWithSocialPopUp_wrapped;
|