@dynamic-labs-sdk/client 1.18.0 → 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 +5 -5
- package/dist/core.esm.js +7 -7
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +7 -7
- 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 +21 -0
- package/dist/errors/DeviceRegistrationIdentityMismatchError.d.ts.map +1 -1
- package/dist/errors/MergeAccountsConfirmationError.d.ts +49 -0
- package/dist/errors/MergeAccountsConfirmationError.d.ts.map +1 -0
- package/dist/errors/WalletScreeningBlockedError.d.ts +13 -0
- package/dist/errors/WalletScreeningBlockedError.d.ts.map +1 -1
- package/dist/exports/index.d.ts +15 -5
- 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-CMIgKqEH.cjs → getNetworkProviderFromNetworkId-BJX2AMGR.cjs} +74 -4
- package/dist/getNetworkProviderFromNetworkId-BJX2AMGR.cjs.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-C6DBO0OX.native.esm.js → getNetworkProviderFromNetworkId-Bsv12Q6B.native.esm.js} +90 -9
- package/dist/getNetworkProviderFromNetworkId-Bsv12Q6B.native.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-CEs4SGW4.esm.js → getNetworkProviderFromNetworkId-D3uwhdMN.esm.js} +72 -8
- package/dist/getNetworkProviderFromNetworkId-D3uwhdMN.esm.js.map +1 -0
- package/dist/{getSignedSessionId-De_N_Ofg.cjs → getSignedSessionId-BIZJGg61.cjs} +3 -3
- package/dist/{getSignedSessionId-De_N_Ofg.cjs.map → getSignedSessionId-BIZJGg61.cjs.map} +1 -1
- package/dist/{getSignedSessionId-CUqILBh8.esm.js → getSignedSessionId-CnSAMO3P.esm.js} +3 -3
- package/dist/{getSignedSessionId-CUqILBh8.esm.js.map → getSignedSessionId-CnSAMO3P.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-Hp1nSbaW.native.esm.js → getSignedSessionId-DXDi7NkE.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-Hp1nSbaW.native.esm.js.map → getSignedSessionId-DXDi7NkE.native.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-D3e0XMjs.cjs → getWalletProviderByKey-C6aS7KgD.cjs} +2 -2
- package/dist/{getWalletProviderByKey-D3e0XMjs.cjs.map → getWalletProviderByKey-C6aS7KgD.cjs.map} +1 -1
- package/dist/{getWalletProviderByKey-CKORCA8l.esm.js → getWalletProviderByKey-Cr8m-Nax.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-CKORCA8l.esm.js.map → getWalletProviderByKey-Cr8m-Nax.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-D5M801xH.native.esm.js → getWalletProviderByKey-DVk2t98D.native.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-D5M801xH.native.esm.js.map → getWalletProviderByKey-DVk2t98D.native.esm.js.map} +1 -1
- package/dist/index.cjs +732 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +729 -53
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +656 -52
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isDynamicWaasEnabled-BQuXZne_.cjs → isDynamicWaasEnabled-BawttOeb.cjs} +20 -6
- package/dist/isDynamicWaasEnabled-BawttOeb.cjs.map +1 -0
- package/dist/{isDynamicWaasEnabled-BlVIlXMZ.esm.js → isDynamicWaasEnabled-DDrg89y1.esm.js} +19 -5
- package/dist/isDynamicWaasEnabled-DDrg89y1.esm.js.map +1 -0
- package/dist/{isDynamicWaasEnabled-BaY09iv6.native.esm.js → isDynamicWaasEnabled-Dj_sLoBO.native.esm.js} +19 -5
- package/dist/isDynamicWaasEnabled-Dj_sLoBO.native.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-Dghiguch.cjs → isMfaRequiredForAction-BuvyBN_r.cjs} +19 -2
- package/dist/isMfaRequiredForAction-BuvyBN_r.cjs.map +1 -0
- package/dist/{isMfaRequiredForAction-r9aDdmK5.esm.js → isMfaRequiredForAction-DTp4CZBt.esm.js} +19 -2
- package/dist/isMfaRequiredForAction-DTp4CZBt.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-CwOGwiDz.native.esm.js → isMfaRequiredForAction-EY-OQORc.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-CwOGwiDz.native.esm.js.map → isMfaRequiredForAction-EY-OQORc.native.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-j4b_q9Pf.cjs → isUserOnboardingComplete-CkyzRYrg.cjs} +11 -4
- package/dist/{isUserOnboardingComplete-j4b_q9Pf.cjs.map → isUserOnboardingComplete-CkyzRYrg.cjs.map} +1 -1
- package/dist/{isUserOnboardingComplete-C-ioFLRR.native.esm.js → isUserOnboardingComplete-D3HrBYje.native.esm.js} +10 -3
- package/dist/{isUserOnboardingComplete-C-ioFLRR.native.esm.js.map → isUserOnboardingComplete-D3HrBYje.native.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-BMNAbXk1.esm.js → isUserOnboardingComplete-Dy2Ygp0u.esm.js} +10 -3
- package/dist/{isUserOnboardingComplete-BMNAbXk1.esm.js.map → isUserOnboardingComplete-Dy2Ygp0u.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-D8Y5h0hz.native.esm.js → migrateFromFireblocks-B5qWGLCM.native.esm.js} +3 -3
- package/dist/{migrateFromFireblocks-D8Y5h0hz.native.esm.js.map → migrateFromFireblocks-B5qWGLCM.native.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-D9pJIgt5.cjs → migrateFromFireblocks-Dp-QA9hi.cjs} +3 -3
- package/dist/{migrateFromFireblocks-D9pJIgt5.cjs.map → migrateFromFireblocks-Dp-QA9hi.cjs.map} +1 -1
- package/dist/{migrateFromFireblocks-D--uqWp5.esm.js → migrateFromFireblocks-MAatsk_w.esm.js} +3 -3
- package/dist/{migrateFromFireblocks-D--uqWp5.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/signInWithExternalJwt/signInWithExternalJwt.d.ts +11 -1
- 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/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 -0
- package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts.map +1 -1
- package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts +9 -0
- 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/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.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 +41 -5
- package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.d.ts.map +1 -1
- 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 +1 -1
- package/dist/modules/captcha/getCaptchaSettings/index.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/flow/cancelFlow/cancelFlow.d.ts +10 -3
- package/dist/modules/flow/cancelFlow/cancelFlow.d.ts.map +1 -1
- 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/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/otp/sendEmailOTP/sendEmailOTP.d.ts +14 -0
- package/dist/modules/otp/sendEmailOTP/sendEmailOTP.d.ts.map +1 -1
- package/dist/modules/otp/sendSmsOTP/sendSmsOTP.d.ts +12 -0
- package/dist/modules/otp/sendSmsOTP/sendSmsOTP.d.ts.map +1 -1
- package/dist/modules/otp/verifyOTP/verifyOTP.d.ts +33 -1
- 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 +8 -1
- package/dist/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.d.ts.map +1 -1
- package/dist/modules/user/refreshAuth/refreshAuth.d.ts +17 -3
- 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/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/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 +1 -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/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/{updateAuthFromVerifyResponse-wVY_DoiL.native.esm.js → updateAuthFromVerifyResponse-DFjqCSu2.native.esm.js} +93 -17
- package/dist/updateAuthFromVerifyResponse-DFjqCSu2.native.esm.js.map +1 -0
- package/dist/{updateAuthFromVerifyResponse-BQes11vz.esm.js → updateAuthFromVerifyResponse-_oYRLK_w.esm.js} +93 -17
- package/dist/updateAuthFromVerifyResponse-_oYRLK_w.esm.js.map +1 -0
- package/dist/{updateAuthFromVerifyResponse-Deg9em9o.cjs → updateAuthFromVerifyResponse-pgYXvDvj.cjs} +93 -17
- package/dist/updateAuthFromVerifyResponse-pgYXvDvj.cjs.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-C6DBO0OX.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-CEs4SGW4.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-CMIgKqEH.cjs.map +0 -1
- package/dist/isDynamicWaasEnabled-BQuXZne_.cjs.map +0 -1
- package/dist/isDynamicWaasEnabled-BaY09iv6.native.esm.js.map +0 -1
- package/dist/isDynamicWaasEnabled-BlVIlXMZ.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-Dghiguch.cjs.map +0 -1
- package/dist/isMfaRequiredForAction-r9aDdmK5.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/updateAuthFromVerifyResponse-BQes11vz.esm.js.map +0 -1
- package/dist/updateAuthFromVerifyResponse-Deg9em9o.cjs.map +0 -1
- package/dist/updateAuthFromVerifyResponse-wVY_DoiL.native.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
|
*/
|
|
@@ -1098,8 +1127,18 @@ const createCore = (config) => {
|
|
|
1098
1127
|
* Manually calling `initializeClient` also allows you to catch any potential
|
|
1099
1128
|
* errors that may occur during initialization.
|
|
1100
1129
|
*
|
|
1130
|
+
* @example
|
|
1131
|
+
* ```ts
|
|
1132
|
+
* const client = createDynamicClient({
|
|
1133
|
+
* environmentId: 'your-environment-id',
|
|
1134
|
+
* appUrl: 'https://myapp.com',
|
|
1135
|
+
* });
|
|
1136
|
+
* ```
|
|
1137
|
+
*
|
|
1101
1138
|
* @param config - The configuration for the Dynamic client, like the environment ID, app url, etc.
|
|
1102
1139
|
* @returns The Dynamic client instance.
|
|
1140
|
+
* @see initializeClient
|
|
1141
|
+
* @see getDefaultClient
|
|
1103
1142
|
* @instrumented
|
|
1104
1143
|
*/
|
|
1105
1144
|
const createDynamicClient = (config) => {
|
|
@@ -1190,6 +1229,27 @@ var DeeplinkConnectAndVerifyUnsupportedError = class extends require_updateAuthF
|
|
|
1190
1229
|
|
|
1191
1230
|
//#endregion
|
|
1192
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
|
+
*/
|
|
1193
1253
|
var DeviceRegistrationIdentityMismatchError = class extends require_updateAuthFromVerifyResponse.BaseError {
|
|
1194
1254
|
constructor() {
|
|
1195
1255
|
super({
|
|
@@ -1688,9 +1748,19 @@ const __requestExternalAuthElevatedToken_wrapped = require_updateAuthFromVerifyR
|
|
|
1688
1748
|
* This function allows authentication using JWT tokens from external providers,
|
|
1689
1749
|
* enabling integration with custom authentication systems.
|
|
1690
1750
|
*
|
|
1751
|
+
* @example
|
|
1752
|
+
* ```ts
|
|
1753
|
+
* const response = await signInWithExternalJwt({
|
|
1754
|
+
* externalJwt: 'eyJhbGciOiJSUzI1NiIs...',
|
|
1755
|
+
* });
|
|
1756
|
+
* ```
|
|
1757
|
+
*
|
|
1691
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.
|
|
1692
1760
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1693
1761
|
* @returns A promise that resolves to the authentication response from the server.
|
|
1762
|
+
* @see logout
|
|
1763
|
+
* @see refreshAuth
|
|
1694
1764
|
* @instrumented
|
|
1695
1765
|
*/
|
|
1696
1766
|
const signInWithExternalJwt = async ({ externalJwt, sessionPublicKey } = {}, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -1723,8 +1793,21 @@ const __signInWithExternalJwt_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
1723
1793
|
/**
|
|
1724
1794
|
* Logs out the current user and clears all authentication data.
|
|
1725
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
|
+
*
|
|
1726
1807
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1727
1808
|
* @returns A promise that resolves when the logout process is complete.
|
|
1809
|
+
* @see isAnyWalletAccountConnected
|
|
1810
|
+
* @see refreshAuth
|
|
1728
1811
|
* @notInstrumented
|
|
1729
1812
|
*/
|
|
1730
1813
|
const logout = async (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -1737,6 +1820,58 @@ const logout = async (client = require_updateAuthFromVerifyResponse.getDefaultCl
|
|
|
1737
1820
|
return require_isMfaRequiredForAction.__logoutWithReason_wrapped({ reason: "user-intent" }, client);
|
|
1738
1821
|
};
|
|
1739
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
|
+
|
|
1740
1875
|
//#endregion
|
|
1741
1876
|
//#region src/modules/auth/passkeys/deletePasskey/deletePasskey.ts
|
|
1742
1877
|
/**
|
|
@@ -1822,10 +1957,17 @@ const serverRegisterPasskey = async ({ registration, createMfaToken }, client) =
|
|
|
1822
1957
|
* passwordless authentication. The user will be prompted to create a passkey
|
|
1823
1958
|
* using their device's biometric authentication or security key.
|
|
1824
1959
|
*
|
|
1960
|
+
* @example
|
|
1961
|
+
* ```ts
|
|
1962
|
+
* await registerPasskey();
|
|
1963
|
+
* ```
|
|
1964
|
+
*
|
|
1825
1965
|
* @param [params.createMfaToken] - Optional configuration for MFA token creation.
|
|
1826
1966
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1827
1967
|
* @returns A promise that resolves to the registration response.
|
|
1828
1968
|
* @throws NoWebAuthNSupportError If WebAuthn is not supported by the browser.
|
|
1969
|
+
* @see signInWithPasskey
|
|
1970
|
+
* @see getPasskeys
|
|
1829
1971
|
* @instrumented
|
|
1830
1972
|
*/
|
|
1831
1973
|
const registerPasskey = async ({ createMfaToken } = {}, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -1890,9 +2032,18 @@ const serverSigninPasskey = async ({ authentication, createMfaToken }, client) =
|
|
|
1890
2032
|
* credential, providing passwordless authentication using biometrics or
|
|
1891
2033
|
* security keys.
|
|
1892
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.
|
|
1893
2042
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1894
2043
|
* @returns A promise that resolves to the authentication response.
|
|
1895
2044
|
* @throws NoWebAuthNSupportError If WebAuthn is not supported by the browser.
|
|
2045
|
+
* @see registerPasskey
|
|
2046
|
+
* @see getPasskeys
|
|
1896
2047
|
* @instrumented
|
|
1897
2048
|
*/
|
|
1898
2049
|
const signInWithPasskey = async ({ relatedOriginRpId } = {}, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -2088,9 +2239,19 @@ const buildOAuthUrl = async (core, provider) => {
|
|
|
2088
2239
|
* back because of this flow, then call `completeSocialRedirect` to finish
|
|
2089
2240
|
* the social authentication.
|
|
2090
2241
|
*
|
|
2242
|
+
* @example
|
|
2243
|
+
* ```ts
|
|
2244
|
+
* await signInWithSocialRedirect({
|
|
2245
|
+
* provider: 'google',
|
|
2246
|
+
* redirectUrl: window.location.href,
|
|
2247
|
+
* });
|
|
2248
|
+
* ```
|
|
2249
|
+
*
|
|
2091
2250
|
* @param params.provider - The social provider to authenticate with (e.g., 'google', 'github').
|
|
2092
2251
|
* @param params.redirectUrl - The URL to redirect back to after authentication.
|
|
2093
2252
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2253
|
+
* @see completeSocialRedirect
|
|
2254
|
+
* @see detectSocialRedirectUrl
|
|
2094
2255
|
* @instrumented
|
|
2095
2256
|
*/
|
|
2096
2257
|
const signInWithSocialRedirect = async ({ provider, redirectUrl }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -2133,6 +2294,14 @@ const __signInWithSocialRedirect_wrapped = require_updateAuthFromVerifyResponse.
|
|
|
2133
2294
|
* @deprecated Renamed to {@link signInWithSocialRedirect}. This alias will be
|
|
2134
2295
|
* removed in a future major version.
|
|
2135
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
|
|
2136
2305
|
* @instrumented
|
|
2137
2306
|
* @noHook Deprecated alias that is not exposed as a React hook.
|
|
2138
2307
|
*/
|
|
@@ -2150,6 +2319,45 @@ const __authenticateWithSocial_wrapped = require_updateAuthFromVerifyResponse.in
|
|
|
2150
2319
|
}
|
|
2151
2320
|
});
|
|
2152
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
|
+
|
|
2153
2361
|
//#endregion
|
|
2154
2362
|
//#region src/modules/auth/social/oauth/processSocialCallback/processSocialCallback.ts
|
|
2155
2363
|
/**
|
|
@@ -2231,12 +2439,23 @@ const __processSocialCallback_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
2231
2439
|
* authenticating (or linking) the user with the social provider. This is the
|
|
2232
2440
|
* final step after `signInWithSocialRedirect` + `detectSocialRedirectUrl`.
|
|
2233
2441
|
*
|
|
2442
|
+
* @example
|
|
2443
|
+
* ```ts
|
|
2444
|
+
* const redirectUrl = detectSocialRedirectUrl();
|
|
2445
|
+
* if (redirectUrl) {
|
|
2446
|
+
* const user = await completeSocialRedirect({ url: redirectUrl });
|
|
2447
|
+
* }
|
|
2448
|
+
* ```
|
|
2449
|
+
*
|
|
2234
2450
|
* @param params.url - The callback URL containing OAuth response parameters.
|
|
2235
2451
|
* @param [params.requestedScopes] - Optional scopes to request an elevated access token when verifying (linking) a social account.
|
|
2236
2452
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2237
2453
|
* @returns A promise that resolves to the authenticated user or null.
|
|
2238
2454
|
* @throws MissingSocialUrlParamError If required OAuth parameters are missing.
|
|
2239
2455
|
* @throws InvalidRedirectStorageStateError If the stored state doesn't match.
|
|
2456
|
+
* @see signInWithSocialRedirect
|
|
2457
|
+
* @see detectSocialRedirectUrl
|
|
2458
|
+
* @see clearSocialRedirectParams
|
|
2240
2459
|
* @instrumented
|
|
2241
2460
|
*/
|
|
2242
2461
|
const completeSocialRedirect = ({ url, requestedScopes }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => __processSocialCallback_wrapped({
|
|
@@ -2292,7 +2511,6 @@ const __completeSocialAuthentication_wrapped = require_updateAuthFromVerifyRespo
|
|
|
2292
2511
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2293
2512
|
* @returns A promise that resolves to true if the URL is an OAuth redirect, false otherwise.
|
|
2294
2513
|
* @notInstrumented
|
|
2295
|
-
* @noHook Low-level redirect-detection primitive that is not exposed as a React hook.
|
|
2296
2514
|
*/
|
|
2297
2515
|
const detectSocialRedirectUrl = async ({ url }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
2298
2516
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
@@ -2324,7 +2542,19 @@ const detectOAuthRedirect = (params, client = require_updateAuthFromVerifyRespon
|
|
|
2324
2542
|
* {@link signInWithSocialRedirect} + {@link completeSocialRedirect} instead —
|
|
2325
2543
|
* the browser already owns the tab so there is no popup to open.
|
|
2326
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.
|
|
2327
2555
|
* @throws MethodNotImplementedError Always on web.
|
|
2556
|
+
* @see signInWithSocialRedirect
|
|
2557
|
+
* @see completeSocialRedirect
|
|
2328
2558
|
* @instrumented
|
|
2329
2559
|
*/
|
|
2330
2560
|
const signInWithSocialPopUp = async ({ provider, requestedScopes }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -2344,19 +2574,39 @@ const __signInWithSocialPopUp_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
2344
2574
|
});
|
|
2345
2575
|
|
|
2346
2576
|
//#endregion
|
|
2347
|
-
//#region src/modules/wallets/
|
|
2577
|
+
//#region src/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/getSelectedWalletAccount.ts
|
|
2348
2578
|
/**
|
|
2349
|
-
* Get the
|
|
2350
|
-
*
|
|
2351
|
-
*
|
|
2352
|
-
*
|
|
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
|
|
2353
2603
|
* @notInstrumented
|
|
2354
2604
|
*/
|
|
2355
|
-
const
|
|
2605
|
+
const getSelectedWalletAccount = (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
2356
2606
|
const sortedLastSelectedWalletAccounts = require_updateAuthFromVerifyResponse.getWalletAccounts(client).filter((walletAccount) => Boolean(walletAccount.lastSelectedAt)).sort((a, b) => b.lastSelectedAt.getTime() - a.lastSelectedAt.getTime());
|
|
2357
2607
|
if (sortedLastSelectedWalletAccounts.length === 0) return null;
|
|
2358
|
-
const [
|
|
2359
|
-
return
|
|
2608
|
+
const [selectedWallet] = sortedLastSelectedWalletAccounts;
|
|
2609
|
+
return selectedWallet;
|
|
2360
2610
|
};
|
|
2361
2611
|
|
|
2362
2612
|
//#endregion
|
|
@@ -2378,9 +2628,9 @@ const getPrimaryWalletAccount = (client = require_updateAuthFromVerifyResponse.g
|
|
|
2378
2628
|
const unlinkSocialAccount = async ({ verifiedCredentialId }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
2379
2629
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
2380
2630
|
const apiClient = require_updateAuthFromVerifyResponse.createApiClient({ elevatedAccessTokenScope: _dynamic_labs_sdk_api_core.TokenScope.Credentialunlink }, client);
|
|
2381
|
-
const
|
|
2382
|
-
const walletId =
|
|
2383
|
-
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;
|
|
2384
2634
|
const response = await apiClient.verifyUnlink({
|
|
2385
2635
|
environmentId: core.environmentId,
|
|
2386
2636
|
verifyUnlinkRequest: {
|
|
@@ -2496,10 +2746,37 @@ const getMultichainBalances = (params, client = require_updateAuthFromVerifyResp
|
|
|
2496
2746
|
//#endregion
|
|
2497
2747
|
//#region src/modules/captcha/getCaptchaSettings/getCaptchaSettings.ts
|
|
2498
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
|
+
/**
|
|
2499
2768
|
* Returns the active captcha provider and site key, or undefined if captcha is not enabled.
|
|
2500
2769
|
* Use this to determine which captcha widget to render and which site key to pass it.
|
|
2501
2770
|
*
|
|
2771
|
+
* @example
|
|
2772
|
+
* ```ts
|
|
2773
|
+
* const settings = getCaptchaSettings();
|
|
2774
|
+
* if (settings) renderCaptcha(settings.provider, settings.siteKey);
|
|
2775
|
+
* ```
|
|
2776
|
+
* @see CaptchaSettingsResult
|
|
2777
|
+
* @see CaptchaProviderEnum
|
|
2502
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.
|
|
2503
2780
|
* @notInstrumented
|
|
2504
2781
|
*/
|
|
2505
2782
|
const getCaptchaSettings = (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -2508,13 +2785,13 @@ const getCaptchaSettings = (client = require_updateAuthFromVerifyResponse.getDef
|
|
|
2508
2785
|
const { security } = projectSettings;
|
|
2509
2786
|
if (security.captcha) {
|
|
2510
2787
|
if (security.captcha.enabled) return {
|
|
2511
|
-
provider: security.captcha.provider ??
|
|
2788
|
+
provider: security.captcha.provider ?? CaptchaProviderEnum.Hcaptcha,
|
|
2512
2789
|
siteKey: security.captcha.siteKey
|
|
2513
2790
|
};
|
|
2514
2791
|
return;
|
|
2515
2792
|
}
|
|
2516
2793
|
if (security.hCaptcha?.enabled) return {
|
|
2517
|
-
provider:
|
|
2794
|
+
provider: CaptchaProviderEnum.Hcaptcha,
|
|
2518
2795
|
siteKey: security.hCaptcha.siteKey
|
|
2519
2796
|
};
|
|
2520
2797
|
};
|
|
@@ -3078,10 +3355,59 @@ const requiresConversion = async ({ transaction }, client = require_updateAuthFr
|
|
|
3078
3355
|
return !checkout.settlementConfig.settlements.some((settlement) => settlement.chainName === transaction.fromChainName && settlement.chainId === transaction.fromChainId && settlement.tokenAddress === transaction.fromToken);
|
|
3079
3356
|
};
|
|
3080
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
|
+
|
|
3081
3400
|
//#endregion
|
|
3082
3401
|
//#region src/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.ts
|
|
3083
3402
|
const DEVICE_REGISTRATION_TOKEN_HEADER = "x-dynamic-device-registration-token";
|
|
3084
|
-
/**
|
|
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
|
+
*/
|
|
3085
3411
|
const completeDeviceRegistration = async ({ deviceToken }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
3086
3412
|
require_updateAuthFromVerifyResponse.assertDefined(deviceToken, "deviceToken is required");
|
|
3087
3413
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
@@ -3429,11 +3755,18 @@ const cancelFlowInstrumentation = { resolved: (flow) => ({
|
|
|
3429
3755
|
//#endregion
|
|
3430
3756
|
//#region src/modules/flow/cancelFlow/cancelFlow.ts
|
|
3431
3757
|
/**
|
|
3432
|
-
* Cancels a flow before it has been broadcasted
|
|
3758
|
+
* Cancels a flow before it has been broadcasted.
|
|
3433
3759
|
*
|
|
3434
|
-
* @
|
|
3760
|
+
* @example
|
|
3761
|
+
* ```ts
|
|
3762
|
+
* const cancelledFlow = await cancelFlow({ flowId: 'flow-abc123' });
|
|
3763
|
+
* ```
|
|
3764
|
+
*
|
|
3765
|
+
* @param params.flowId - The unique identifier of the flow to cancel.
|
|
3435
3766
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
3436
|
-
* @returns
|
|
3767
|
+
* @returns A promise that resolves to the cancelled flow.
|
|
3768
|
+
* @see getFlow
|
|
3769
|
+
* @see getFlowQuote
|
|
3437
3770
|
* @instrumented
|
|
3438
3771
|
*/
|
|
3439
3772
|
const cancelFlow = async ({ flowId }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -3466,11 +3799,19 @@ const __cancelFlow_wrapped = require_updateAuthFromVerifyResponse.instrumentFunc
|
|
|
3466
3799
|
//#endregion
|
|
3467
3800
|
//#region src/modules/flow/getFlow/getFlow.ts
|
|
3468
3801
|
/**
|
|
3469
|
-
* Fetches a flow by its ID
|
|
3802
|
+
* Fetches a flow by its ID.
|
|
3803
|
+
*
|
|
3804
|
+
* @example
|
|
3805
|
+
* ```ts
|
|
3806
|
+
* const flow = await getFlow({ flowId: 'flow-abc123' });
|
|
3807
|
+
* console.log('Flow status:', flow.status);
|
|
3808
|
+
* ```
|
|
3470
3809
|
*
|
|
3471
|
-
* @param params
|
|
3810
|
+
* @param params.flowId - The unique identifier of the flow to fetch.
|
|
3472
3811
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
3473
|
-
* @returns
|
|
3812
|
+
* @returns A promise that resolves to the flow object.
|
|
3813
|
+
* @see cancelFlow
|
|
3814
|
+
* @see getFlowQuote
|
|
3474
3815
|
* @notInstrumented
|
|
3475
3816
|
*/
|
|
3476
3817
|
const getFlow = async ({ flowId }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -3484,11 +3825,24 @@ const getFlow = async ({ flowId }, client = require_updateAuthFromVerifyResponse
|
|
|
3484
3825
|
//#endregion
|
|
3485
3826
|
//#region src/modules/flow/getFlowQuote/getFlowQuote.ts
|
|
3486
3827
|
/**
|
|
3487
|
-
* 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
|
+
* ```
|
|
3488
3837
|
*
|
|
3489
|
-
* @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.
|
|
3490
3842
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
3491
|
-
* @returns
|
|
3843
|
+
* @returns A promise that resolves to the updated flow with quote data.
|
|
3844
|
+
* @see getFlow
|
|
3845
|
+
* @see cancelFlow
|
|
3492
3846
|
* @notInstrumented
|
|
3493
3847
|
*/
|
|
3494
3848
|
const getFlowQuote = async ({ flowId, fromChainId, fromTokenAddress, slippage }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -4010,7 +4364,17 @@ const __getMoonPayUrl_wrapped = require_updateAuthFromVerifyResponse.instrumentF
|
|
|
4010
4364
|
* Allows waiting until all modules of the client have been properly initialized
|
|
4011
4365
|
* and are ready for use.
|
|
4012
4366
|
*
|
|
4013
|
-
* @
|
|
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
|
|
4014
4378
|
* @notInstrumented
|
|
4015
4379
|
* @noHook Client lifecycle management is not exposed as a hook; use useInitStatus.
|
|
4016
4380
|
*/
|
|
@@ -4997,9 +5361,23 @@ const __setDefaultMfaDevice_wrapped = require_updateAuthFromVerifyResponse.instr
|
|
|
4997
5361
|
*
|
|
4998
5362
|
* Once you have the OTP code, you should then use `verifyOTP` to verify it and complete the authentication process.
|
|
4999
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
|
+
*
|
|
5000
5376
|
* @param params.email - The email address to send the OTP to.
|
|
5001
5377
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
5002
5378
|
* @returns A promise that resolves to an OTPVerification object containing the email and verification UUID.
|
|
5379
|
+
* @see verifyOTP
|
|
5380
|
+
* @see sendSmsOTP
|
|
5003
5381
|
* @instrumented
|
|
5004
5382
|
*/
|
|
5005
5383
|
const sendEmailOTP = async ({ email }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -5957,10 +6335,22 @@ const supportedCountries = {
|
|
|
5957
6335
|
/**
|
|
5958
6336
|
* Sends a one-time password (OTP) via SMS to the specified phone number.
|
|
5959
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
|
+
*
|
|
5960
6348
|
* @param params.isoCountryCode - The ISO country code for the phone number (e.g., 'US', 'CA', 'GB').
|
|
5961
6349
|
* @param params.phoneNumber - The phone number to send the OTP to.
|
|
5962
6350
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
5963
6351
|
* @returns A promise that resolves to an OTPVerification object containing the phone details and verification UUID.
|
|
6352
|
+
* @see verifyOTP
|
|
6353
|
+
* @see sendEmailOTP
|
|
5964
6354
|
* @instrumented
|
|
5965
6355
|
*/
|
|
5966
6356
|
const sendSmsOTP = async ({ isoCountryCode, phoneNumber }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -6000,10 +6390,11 @@ const __sendSmsOTP_wrapped = require_updateAuthFromVerifyResponse.instrumentFunc
|
|
|
6000
6390
|
//#endregion
|
|
6001
6391
|
//#region src/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.ts
|
|
6002
6392
|
/** @notInstrumented */
|
|
6003
|
-
const verifyOTPForUserSignIn = async ({ otpVerification, verificationToken }, client) => {
|
|
6393
|
+
const verifyOTPForUserSignIn = async ({ allowNewMFALinking, otpVerification, verificationToken }, client) => {
|
|
6004
6394
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
6005
6395
|
const apiClient = require_updateAuthFromVerifyResponse.createApiClient({}, client);
|
|
6006
6396
|
const verifyRequest = {
|
|
6397
|
+
...allowNewMFALinking !== void 0 && { allowNewMFALinking },
|
|
6007
6398
|
verificationToken,
|
|
6008
6399
|
verificationUUID: otpVerification.verificationUUID
|
|
6009
6400
|
};
|
|
@@ -6046,13 +6437,26 @@ const verifyOTPForUserUpdate = async ({ otpVerification, verificationToken, requ
|
|
|
6046
6437
|
* This function validates the OTP code provided by the user and completes
|
|
6047
6438
|
* the verification process for either sign-in or account updates.
|
|
6048
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.
|
|
6049
6450
|
* @param params.otpVerification - The OTP verification object containing verification details.
|
|
6050
6451
|
* @param params.verificationToken - The token received from the OTP verification process.
|
|
6452
|
+
* @param [params.requestedScopes] - Optional token scopes to request during verification.
|
|
6051
6453
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6052
6454
|
* @returns A promise that resolves to the verify response object upon successful verification.
|
|
6455
|
+
* @see sendEmailOTP
|
|
6456
|
+
* @see sendSmsOTP
|
|
6053
6457
|
* @instrumented
|
|
6054
6458
|
*/
|
|
6055
|
-
const verifyOTP = async ({
|
|
6459
|
+
const verifyOTP = async ({ allowNewMFALinking, otpVerification, requestedScopes, verificationToken }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
6056
6460
|
require_isUserOnboardingComplete.preconnectWaasIframe(client);
|
|
6057
6461
|
let response;
|
|
6058
6462
|
if (client.user) response = await verifyOTPForUserUpdate({
|
|
@@ -6061,6 +6465,7 @@ const verifyOTP = async ({ otpVerification, verificationToken, requestedScopes }
|
|
|
6061
6465
|
verificationToken
|
|
6062
6466
|
}, client);
|
|
6063
6467
|
else response = await verifyOTPForUserSignIn({
|
|
6468
|
+
allowNewMFALinking,
|
|
6064
6469
|
otpVerification,
|
|
6065
6470
|
verificationToken
|
|
6066
6471
|
}, client);
|
|
@@ -6159,6 +6564,33 @@ const getSwapStatus = async (params, client = require_updateAuthFromVerifyRespon
|
|
|
6159
6564
|
}
|
|
6160
6565
|
};
|
|
6161
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
|
+
|
|
6162
6594
|
//#endregion
|
|
6163
6595
|
//#region src/modules/user/deleteUser/deleteUser.ts
|
|
6164
6596
|
/**
|
|
@@ -6167,8 +6599,16 @@ const getSwapStatus = async (params, client = require_updateAuthFromVerifyRespon
|
|
|
6167
6599
|
* This function performs a hard delete of the user account. Upon successful deletion,
|
|
6168
6600
|
* the user will be automatically logged out and all authentication data will be cleared.
|
|
6169
6601
|
*
|
|
6602
|
+
* @example
|
|
6603
|
+
* ```ts
|
|
6604
|
+
* // Permanently delete the user's account
|
|
6605
|
+
* await deleteUser();
|
|
6606
|
+
* ```
|
|
6607
|
+
*
|
|
6170
6608
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6171
6609
|
* @returns A promise that resolves when the user account is successfully deleted.
|
|
6610
|
+
* @see logout
|
|
6611
|
+
* @see refreshUser
|
|
6172
6612
|
* @instrumented
|
|
6173
6613
|
*/
|
|
6174
6614
|
const deleteUser = async (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -7502,8 +7942,14 @@ const getAddressesWithTypesFromConnectionResult = (connectionResult) => {
|
|
|
7502
7942
|
*
|
|
7503
7943
|
* Note: This function will not verify the wallet account, use the verifyWalletAccount function to do that
|
|
7504
7944
|
* or connectAndVerifyWithWalletProvider to do that in a single step.
|
|
7505
|
-
*
|
|
7506
|
-
* @
|
|
7945
|
+
*
|
|
7946
|
+
* @example
|
|
7947
|
+
* ```ts
|
|
7948
|
+
* const walletAccount = await connectWithWalletProvider({
|
|
7949
|
+
* walletProviderKey: 'metamaskevm',
|
|
7950
|
+
* });
|
|
7951
|
+
* console.log(walletAccount.address);
|
|
7952
|
+
* ```
|
|
7507
7953
|
*
|
|
7508
7954
|
* @param params.walletProviderKey - The unique key identifying the wallet provider to connect to (e.g. 'metamaskevm', 'phantomsol').
|
|
7509
7955
|
* @param [params.addToDynamicWalletAccounts] - Whether to add the connected wallet account to the user's wallet accounts. Defaults to true.
|
|
@@ -7511,7 +7957,9 @@ const getAddressesWithTypesFromConnectionResult = (connectionResult) => {
|
|
|
7511
7957
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
7512
7958
|
* @returns A promise that resolves to the connected wallet account.
|
|
7513
7959
|
* @throws NoAddressFoundError If the request to connect was successful but no address is connected to your app.
|
|
7514
|
-
*
|
|
7960
|
+
* @see verifyWalletAccount
|
|
7961
|
+
* @see connectAndVerifyWithWalletProvider
|
|
7962
|
+
* @instrumented
|
|
7515
7963
|
*/
|
|
7516
7964
|
const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWalletAccounts = true, hardwareWalletVendor }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
7517
7965
|
const walletProvider = require_getWalletProviderByKey.getWalletProviderByKey({ walletProviderKey }, client);
|
|
@@ -7648,9 +8096,19 @@ const getSignInMessage = async ({ nonce: nonceOverride, walletAccount }, client)
|
|
|
7648
8096
|
* This function generates a sign-in message and requires the user to sign it
|
|
7649
8097
|
* with their wallet's private key, proving they control the wallet address.
|
|
7650
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
|
+
*
|
|
7651
8107
|
* @param params.walletAccount - The wallet account to prove ownership of.
|
|
7652
8108
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
7653
8109
|
* @returns A promise that resolves to an object containing the message and signature.
|
|
8110
|
+
* @see signMessage
|
|
8111
|
+
* @see verifyWalletAccount
|
|
7654
8112
|
* @instrumented
|
|
7655
8113
|
*/
|
|
7656
8114
|
const proveWalletAccountOwnership = async ({ walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -7754,11 +8212,22 @@ const verifyWalletAccountForSignInOrTransfer = async ({ walletAccount, isTransfe
|
|
|
7754
8212
|
* This function requires the user to sign a message to prove wallet ownership,
|
|
7755
8213
|
* then sets the wallet account as verified.
|
|
7756
8214
|
*
|
|
8215
|
+
* @example
|
|
8216
|
+
* ```ts
|
|
8217
|
+
* const walletAccount = await connectWithWalletProvider({
|
|
8218
|
+
* walletProviderKey: 'metamaskevm',
|
|
8219
|
+
* });
|
|
8220
|
+
* const verified = await verifyWalletAccount({ walletAccount });
|
|
8221
|
+
* ```
|
|
8222
|
+
*
|
|
7757
8223
|
* @param params.walletAccount - The wallet account to verify ownership of.
|
|
8224
|
+
* @param [params.requestedScopes] - Optional token scopes to request during verification.
|
|
7758
8225
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
7759
8226
|
* @returns A promise that resolves to the verified wallet account.
|
|
7760
8227
|
* @throws WalletAccountAlreadyVerifiedError If the wallet is already verified.
|
|
7761
8228
|
* @throws WalletAlreadyLinkedToAnotherUserError If the wallet is linked to another user.
|
|
8229
|
+
* @see connectWithWalletProvider
|
|
8230
|
+
* @see connectAndVerifyWithWalletProvider
|
|
7762
8231
|
* @instrumented
|
|
7763
8232
|
*/
|
|
7764
8233
|
const verifyWalletAccount = async ({ walletAccount, requestedScopes }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -7808,10 +8277,20 @@ const isDeeplinkWalletProvider = ({ walletProvider }) => walletProvider.walletPr
|
|
|
7808
8277
|
* `verifyWalletAccount` separately from a new user gesture (e.g. a "Verify
|
|
7809
8278
|
* Ownership" button).
|
|
7810
8279
|
*
|
|
8280
|
+
* @example
|
|
8281
|
+
* ```ts
|
|
8282
|
+
* const walletAccount = await connectAndVerifyWithWalletProvider({
|
|
8283
|
+
* walletProviderKey: 'metamaskevm',
|
|
8284
|
+
* });
|
|
8285
|
+
* console.log('Verified address:', walletAccount.address);
|
|
8286
|
+
* ```
|
|
8287
|
+
*
|
|
7811
8288
|
* @param params.walletProviderKey - The unique key identifying the wallet provider to connect to.
|
|
7812
8289
|
* @param [params.hardwareWalletVendor] - The hardware wallet vendor, if connecting via a hardware wallet (e.g. 'ledger').
|
|
7813
8290
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
7814
8291
|
* @returns A promise that resolves to the connected and verified wallet account.
|
|
8292
|
+
* @see connectWithWalletProvider
|
|
8293
|
+
* @see verifyWalletAccount
|
|
7815
8294
|
* @instrumented
|
|
7816
8295
|
*/
|
|
7817
8296
|
const connectAndVerifyWithWalletProvider = async ({ walletProviderKey, hardwareWalletVendor }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -7873,9 +8352,17 @@ const getAvailableWalletProvidersData = (client = require_updateAuthFromVerifyRe
|
|
|
7873
8352
|
* This function returns the list of wallet addresses that are currently
|
|
7874
8353
|
* connected and available through the specified wallet provider.
|
|
7875
8354
|
*
|
|
8355
|
+
* @example
|
|
8356
|
+
* ```ts
|
|
8357
|
+
* const addresses = getConnectedAddresses({ walletProviderKey: 'metamaskevm' });
|
|
8358
|
+
* console.log('Connected:', addresses);
|
|
8359
|
+
* ```
|
|
8360
|
+
*
|
|
7876
8361
|
* @param params.walletProviderKey - The unique key of the wallet provider to query.
|
|
7877
8362
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
7878
8363
|
* @returns An array of connected wallet addresses.
|
|
8364
|
+
* @see connectWithWalletProvider
|
|
8365
|
+
* @see getWalletAccounts
|
|
7879
8366
|
* @notInstrumented
|
|
7880
8367
|
*/
|
|
7881
8368
|
const getConnectedAddresses = ({ walletProviderKey }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -7956,8 +8443,17 @@ const isHardwareWalletAccount = ({ walletAccount }) => walletAccount.hardwareWal
|
|
|
7956
8443
|
* else your app considers "signed in" (e.g. `client.user`, completed onboarding,
|
|
7957
8444
|
* a required embedded wallet, …).
|
|
7958
8445
|
*
|
|
8446
|
+
* @example
|
|
8447
|
+
* ```ts
|
|
8448
|
+
* if (isAnyWalletAccountConnected()) {
|
|
8449
|
+
* console.log('At least one wallet is connected');
|
|
8450
|
+
* }
|
|
8451
|
+
* ```
|
|
8452
|
+
*
|
|
7959
8453
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
7960
8454
|
* @returns True if the session has at least one wallet account, false otherwise.
|
|
8455
|
+
* @see getWalletAccounts
|
|
8456
|
+
* @see isWalletAccountVerified
|
|
7961
8457
|
* @notInstrumented
|
|
7962
8458
|
*/
|
|
7963
8459
|
const isAnyWalletAccountConnected = (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => require_updateAuthFromVerifyResponse.getWalletAccounts(client).length > 0;
|
|
@@ -7967,8 +8463,16 @@ const isAnyWalletAccountConnected = (client = require_updateAuthFromVerifyRespon
|
|
|
7967
8463
|
/**
|
|
7968
8464
|
* Checks if a wallet account has been verified by a user.
|
|
7969
8465
|
*
|
|
7970
|
-
* @
|
|
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.
|
|
7971
8473
|
* @returns True if the wallet account has been verified, false otherwise.
|
|
8474
|
+
* @see verifyWalletAccount
|
|
8475
|
+
* @see getWalletAccounts
|
|
7972
8476
|
* @notInstrumented
|
|
7973
8477
|
*/
|
|
7974
8478
|
const isWalletAccountVerified = ({ walletAccount }) => {
|
|
@@ -8058,9 +8562,17 @@ const getActiveNetworkId = ({ walletAccount }, client = require_updateAuthFromVe
|
|
|
8058
8562
|
* {@link getTokenBalances}; for a multi-chain portfolio snapshot, use
|
|
8059
8563
|
* {@link getMultichainTokenBalances}.
|
|
8060
8564
|
*
|
|
8565
|
+
* @example
|
|
8566
|
+
* ```ts
|
|
8567
|
+
* const { balance } = await getNativeBalance({ walletAccount: wallets[0] });
|
|
8568
|
+
* console.log('Native balance:', balance);
|
|
8569
|
+
* ```
|
|
8570
|
+
*
|
|
8061
8571
|
* @param params.walletAccount - The wallet account to get the balance for.
|
|
8062
8572
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8063
8573
|
* @returns A promise that resolves to an object containing the balance as a string or null.
|
|
8574
|
+
* @see getMultichainTokenBalances
|
|
8575
|
+
* @see switchActiveNetwork
|
|
8064
8576
|
* @notInstrumented
|
|
8065
8577
|
*/
|
|
8066
8578
|
const getNativeBalance = async ({ walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -8080,6 +8592,14 @@ const getNativeBalance = async ({ walletAccount }, client = require_updateAuthFr
|
|
|
8080
8592
|
* with the token-balance fetchers (`getTokenBalances` /
|
|
8081
8593
|
* `getMultichainTokenBalances`).
|
|
8082
8594
|
*
|
|
8595
|
+
* @example
|
|
8596
|
+
* ```ts
|
|
8597
|
+
* // Prefer getNativeBalance instead
|
|
8598
|
+
* const balance = await getNativeBalance({ walletAccount });
|
|
8599
|
+
* ```
|
|
8600
|
+
*
|
|
8601
|
+
* @see getNativeBalance
|
|
8602
|
+
* @see getMultichainBalances
|
|
8083
8603
|
* @notInstrumented
|
|
8084
8604
|
* @noHook Deprecated; the replacement is exposed via its own hook.
|
|
8085
8605
|
*/
|
|
@@ -8165,11 +8685,21 @@ const isProgrammaticNetworkSwitchAvailable = ({ walletAccount }, client = requir
|
|
|
8165
8685
|
* This function programmatically changes the network
|
|
8166
8686
|
* that the wallet is currently connected to.
|
|
8167
8687
|
*
|
|
8688
|
+
* @example
|
|
8689
|
+
* ```ts
|
|
8690
|
+
* await switchActiveNetwork({
|
|
8691
|
+
* walletAccount: wallets[0],
|
|
8692
|
+
* networkId: '137', // Polygon
|
|
8693
|
+
* });
|
|
8694
|
+
* ```
|
|
8695
|
+
*
|
|
8168
8696
|
* @param params.networkId - The identifier of the network to switch to. Should match the networkId of the network data.
|
|
8169
8697
|
* @param params.walletAccount - The wallet account to switch networks for.
|
|
8170
8698
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8171
8699
|
* @returns A promise that resolves when the network switch is complete.
|
|
8172
8700
|
* @throws NetworkSwitchingUnavailableError If the wallet provider doesn't support network switching.
|
|
8701
|
+
* @see getNativeBalance
|
|
8702
|
+
* @see isProgrammaticNetworkSwitchAvailable
|
|
8173
8703
|
* @instrumented
|
|
8174
8704
|
*/
|
|
8175
8705
|
const switchActiveNetwork = async ({ networkId, walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -8195,15 +8725,37 @@ const __switchActiveNetwork_wrapped = require_updateAuthFromVerifyResponse.instr
|
|
|
8195
8725
|
});
|
|
8196
8726
|
|
|
8197
8727
|
//#endregion
|
|
8198
|
-
//#region src/modules/wallets/
|
|
8728
|
+
//#region src/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/setSelectedWalletAccount.ts
|
|
8199
8729
|
/**
|
|
8200
|
-
*
|
|
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
|
|
8201
8753
|
* @instrumented
|
|
8202
|
-
* @noHook The
|
|
8754
|
+
* @noHook The selected-wallet concept is not exposed as a hook.
|
|
8203
8755
|
*/
|
|
8204
|
-
const
|
|
8756
|
+
const setSelectedWalletAccount = async ({ walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
8205
8757
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
8206
|
-
if (
|
|
8758
|
+
if (getSelectedWalletAccount(client)?.id === walletAccount.id) return;
|
|
8207
8759
|
if (walletAccount.verifiedCredentialId) require_updateAuthFromVerifyResponse.updateAuthFromVerifyResponse({ response: await require_updateAuthFromVerifyResponse.createApiClient({}, client).selectUserWallet({
|
|
8208
8760
|
environmentId: core.environmentId,
|
|
8209
8761
|
userWalletSelectionRequest: { walletId: walletAccount.verifiedCredentialId }
|
|
@@ -8213,6 +8765,68 @@ const selectPrimaryWalletAccount = async ({ walletAccount }, client = require_up
|
|
|
8213
8765
|
lastSelectedAt: /* @__PURE__ */ new Date()
|
|
8214
8766
|
}] }, client);
|
|
8215
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);
|
|
8216
8830
|
const __selectPrimaryWalletAccount_impl = selectPrimaryWalletAccount;
|
|
8217
8831
|
const __selectPrimaryWalletAccount_wrapped = require_updateAuthFromVerifyResponse.instrumentFunction({
|
|
8218
8832
|
fn: __selectPrimaryWalletAccount_impl,
|
|
@@ -8229,10 +8843,23 @@ const __selectPrimaryWalletAccount_wrapped = require_updateAuthFromVerifyRespons
|
|
|
8229
8843
|
//#endregion
|
|
8230
8844
|
//#region src/modules/wallets/disconnectWalletAccount/disconnectWalletAccount.ts
|
|
8231
8845
|
/**
|
|
8232
|
-
*
|
|
8846
|
+
* Disconnects the specified wallet account from its wallet provider.
|
|
8233
8847
|
*
|
|
8234
|
-
* 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,
|
|
8235
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
|
|
8236
8863
|
* @notInstrumented
|
|
8237
8864
|
*/
|
|
8238
8865
|
const disconnectWalletAccount = async ({ walletAccount }, client) => {
|
|
@@ -8253,9 +8880,17 @@ const disconnectWalletAccount = async ({ walletAccount }, client) => {
|
|
|
8253
8880
|
* updating local state and server records (if there is an authenticated user).
|
|
8254
8881
|
* For verified wallets, it will unlink them from the user's account.
|
|
8255
8882
|
*
|
|
8883
|
+
* @example
|
|
8884
|
+
* ```ts
|
|
8885
|
+
* const wallets = getWalletAccounts();
|
|
8886
|
+
* await removeWalletAccount({ walletAccount: wallets[0] });
|
|
8887
|
+
* ```
|
|
8888
|
+
*
|
|
8256
8889
|
* @param params.walletAccount - The wallet account to remove.
|
|
8257
8890
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8258
8891
|
* @returns A promise that resolves when the wallet account is successfully removed.
|
|
8892
|
+
* @see getWalletAccounts
|
|
8893
|
+
* @see disconnectWalletAccount
|
|
8259
8894
|
* @instrumented
|
|
8260
8895
|
*/
|
|
8261
8896
|
const removeWalletAccount = async ({ walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -8292,10 +8927,21 @@ const __removeWalletAccount_wrapped = require_updateAuthFromVerifyResponse.instr
|
|
|
8292
8927
|
* This function uses the wallet's private key to cryptographically sign
|
|
8293
8928
|
* the provided message.
|
|
8294
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
|
+
*
|
|
8295
8939
|
* @param params.walletAccount - The wallet account to use for signing.
|
|
8296
8940
|
* @param params.message - The message to sign.
|
|
8297
8941
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8298
8942
|
* @returns A promise that resolves to an object containing the signature.
|
|
8943
|
+
* @see getWalletAccounts
|
|
8944
|
+
* @see connectWithWalletProvider
|
|
8299
8945
|
* @instrumented
|
|
8300
8946
|
*/
|
|
8301
8947
|
const signMessage = async ({ walletAccount, message }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -8328,13 +8974,24 @@ const __signMessage_wrapped = require_updateAuthFromVerifyResponse.instrumentFun
|
|
|
8328
8974
|
* Supports native token transfers and, where supported by the chain,
|
|
8329
8975
|
* fungible/token transfers via the optional `token` parameter.
|
|
8330
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
|
+
*
|
|
8331
8986
|
* @param params.walletAccount - The wallet account to transfer from.
|
|
8332
8987
|
* @param params.amount - The amount to transfer as a decimal string (e.g. "1.5").
|
|
8333
8988
|
* @param params.recipient - The recipient address.
|
|
8334
|
-
* @param params.token - Optional token info for non-native transfers.
|
|
8989
|
+
* @param [params.token] - Optional token info for non-native transfers.
|
|
8335
8990
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8336
8991
|
* @returns A promise that resolves to an object containing the transaction hash.
|
|
8337
8992
|
* @throws If the wallet provider does not support the transfer amount method.
|
|
8993
|
+
* @see getWalletAccounts
|
|
8994
|
+
* @see signMessage
|
|
8338
8995
|
* @instrumented
|
|
8339
8996
|
*/
|
|
8340
8997
|
const transferAmount = async ({ walletAccount, amount, recipient, token }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -8369,9 +9026,18 @@ const __transferAmount_wrapped = require_updateAuthFromVerifyResponse.instrument
|
|
|
8369
9026
|
* This function requires the user to sign a message to prove wallet ownership,
|
|
8370
9027
|
* then transfers the wallet account to the current user's account.
|
|
8371
9028
|
*
|
|
9029
|
+
* @example
|
|
9030
|
+
* ```ts
|
|
9031
|
+
* const walletAccount = await transferWalletAccount({
|
|
9032
|
+
* walletProviderKey: 'metamaskevm',
|
|
9033
|
+
* });
|
|
9034
|
+
* ```
|
|
9035
|
+
*
|
|
8372
9036
|
* @param params.walletProviderKey - The key of the wallet provider of the wallet account to transfer.
|
|
8373
9037
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8374
9038
|
* @returns A promise that resolves to the transferred wallet account.
|
|
9039
|
+
* @see connectWithWalletProvider
|
|
9040
|
+
* @see verifyWalletAccount
|
|
8375
9041
|
* @instrumented
|
|
8376
9042
|
*/
|
|
8377
9043
|
const transferWalletAccount = async ({ walletProviderKey }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -8404,10 +9070,20 @@ const __transferWalletAccount_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
8404
9070
|
* This function searches through the current session's wallet accounts
|
|
8405
9071
|
* to find one matching the specified address and chain.
|
|
8406
9072
|
*
|
|
9073
|
+
* @example
|
|
9074
|
+
* ```ts
|
|
9075
|
+
* const account = getWalletAccountFromAddress({
|
|
9076
|
+
* address: '0x1234...abcd',
|
|
9077
|
+
* chain: 'EVM',
|
|
9078
|
+
* });
|
|
9079
|
+
* ```
|
|
9080
|
+
*
|
|
8407
9081
|
* @param params.address - The wallet address to search for.
|
|
8408
9082
|
* @param params.chain - The blockchain the wallet belongs to.
|
|
8409
9083
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8410
9084
|
* @returns The matching wallet account, or undefined if not found.
|
|
9085
|
+
* @see getWalletAccounts
|
|
9086
|
+
* @see isWalletAccountVerified
|
|
8411
9087
|
* @notInstrumented
|
|
8412
9088
|
*/
|
|
8413
9089
|
const getWalletAccountFromAddress = ({ address, chain }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
@@ -8567,12 +9243,7 @@ const parseUserAgent = ({ userAgent }) => {
|
|
|
8567
9243
|
|
|
8568
9244
|
//#endregion
|
|
8569
9245
|
exports.BaseError = require_updateAuthFromVerifyResponse.BaseError;
|
|
8570
|
-
|
|
8571
|
-
enumerable: true,
|
|
8572
|
-
get: function () {
|
|
8573
|
-
return _dynamic_labs_sdk_api_core.CaptchaProviderEnum;
|
|
8574
|
-
}
|
|
8575
|
-
});
|
|
9246
|
+
exports.CaptchaProviderEnum = CaptchaProviderEnum;
|
|
8576
9247
|
exports.CheckoutSessionTokenMissingError = CheckoutSessionTokenMissingError;
|
|
8577
9248
|
exports.ClientAlreadyInitializedError = ClientAlreadyInitializedError;
|
|
8578
9249
|
exports.DeeplinkConnectAndVerifyUnsupportedError = DeeplinkConnectAndVerifyUnsupportedError;
|
|
@@ -8598,6 +9269,7 @@ Object.defineProperty(exports, 'MFAAction', {
|
|
|
8598
9269
|
return _dynamic_labs_sdk_api_core.MFAAction;
|
|
8599
9270
|
}
|
|
8600
9271
|
});
|
|
9272
|
+
exports.MergeAccountsConfirmationError = require_getNetworkProviderFromNetworkId.MergeAccountsConfirmationError;
|
|
8601
9273
|
exports.MfaInvalidOtpError = require_updateAuthFromVerifyResponse.MfaInvalidOtpError;
|
|
8602
9274
|
exports.MfaRateLimitedError = require_updateAuthFromVerifyResponse.MfaRateLimitedError;
|
|
8603
9275
|
exports.MissingRedirectStorageStateError = MissingRedirectStorageStateError;
|
|
@@ -8657,6 +9329,9 @@ exports.canConnectWithHardwareWallet = canConnectWithHardwareWallet;
|
|
|
8657
9329
|
exports.cancelCheckoutTransaction = __cancelCheckoutTransaction_wrapped;
|
|
8658
9330
|
exports.cancelFlow = __cancelFlow_wrapped;
|
|
8659
9331
|
exports.checkStepUpAuth = __checkStepUpAuth_wrapped;
|
|
9332
|
+
exports.checkUserScopes = checkUserScopes;
|
|
9333
|
+
exports.clearDeviceRegistrationRedirectParams = clearDeviceRegistrationRedirectParams;
|
|
9334
|
+
exports.clearSocialRedirectParams = clearSocialRedirectParams;
|
|
8660
9335
|
exports.completeDeviceRegistration = __completeDeviceRegistration_wrapped;
|
|
8661
9336
|
exports.completeSocialAuthentication = __completeSocialAuthentication_wrapped;
|
|
8662
9337
|
exports.completeSocialRedirect = __completeSocialRedirect_wrapped;
|
|
@@ -8714,6 +9389,7 @@ exports.getOwnerWalletAccountForSmartWalletAccount = getOwnerWalletAccountForSma
|
|
|
8714
9389
|
exports.getPasskeys = getPasskeys;
|
|
8715
9390
|
exports.getPrimaryWalletAccount = getPrimaryWalletAccount;
|
|
8716
9391
|
exports.getRegisteredDevices = getRegisteredDevices;
|
|
9392
|
+
exports.getSelectedWalletAccount = getSelectedWalletAccount;
|
|
8717
9393
|
exports.getSwapQuote = getSwapQuote;
|
|
8718
9394
|
exports.getSwapStatus = getSwapStatus;
|
|
8719
9395
|
exports.getTokenBalances = getTokenBalances;
|
|
@@ -8745,6 +9421,7 @@ exports.isUserOnboardingComplete = require_isUserOnboardingComplete.isUserOnboar
|
|
|
8745
9421
|
exports.isWalletAccountVerified = isWalletAccountVerified;
|
|
8746
9422
|
exports.logout = logout;
|
|
8747
9423
|
exports.matchWalletProvidersToCatalogGroup = matchWalletProvidersToCatalogGroup;
|
|
9424
|
+
exports.mergeUserAccounts = mergeUserAccounts;
|
|
8748
9425
|
exports.offEvent = require_updateAuthFromVerifyResponse.offEvent;
|
|
8749
9426
|
exports.offWalletProviderEvent = offWalletProviderEvent;
|
|
8750
9427
|
exports.onEvent = require_updateAuthFromVerifyResponse.onEvent;
|
|
@@ -8769,6 +9446,7 @@ exports.sendSmsOTP = __sendSmsOTP_wrapped;
|
|
|
8769
9446
|
exports.setCaptchaToken = require_getNetworkProviderFromNetworkId.__setCaptchaToken_wrapped;
|
|
8770
9447
|
exports.setDefaultMfaDevice = __setDefaultMfaDevice_wrapped;
|
|
8771
9448
|
exports.setInstrumentationEnabled = __setInstrumentationEnabled_wrapped;
|
|
9449
|
+
exports.setSelectedWalletAccount = __setSelectedWalletAccount_wrapped;
|
|
8772
9450
|
exports.signInWithExternalJwt = __signInWithExternalJwt_wrapped;
|
|
8773
9451
|
exports.signInWithPasskey = __signInWithPasskey_wrapped;
|
|
8774
9452
|
exports.signInWithSocialPopUp = __signInWithSocialPopUp_wrapped;
|