@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.
Files changed (247) hide show
  1. package/dist/client/createDynamicClient/createDynamicClient.d.ts +11 -1
  2. package/dist/client/createDynamicClient/createDynamicClient.d.ts.map +1 -1
  3. package/dist/client/defaultClient/defaultClient.d.ts +12 -1
  4. package/dist/client/defaultClient/defaultClient.d.ts.map +1 -1
  5. package/dist/core.cjs +5 -5
  6. package/dist/core.esm.js +7 -7
  7. package/dist/core.esm.js.map +1 -1
  8. package/dist/core.native.esm.js +7 -7
  9. package/dist/core.native.esm.js.map +1 -1
  10. package/dist/errors/APIError/APIError.d.ts +11 -1
  11. package/dist/errors/APIError/APIError.d.ts.map +1 -1
  12. package/dist/errors/DeviceRegistrationIdentityMismatchError.d.ts +21 -0
  13. package/dist/errors/DeviceRegistrationIdentityMismatchError.d.ts.map +1 -1
  14. package/dist/errors/MergeAccountsConfirmationError.d.ts +49 -0
  15. package/dist/errors/MergeAccountsConfirmationError.d.ts.map +1 -0
  16. package/dist/errors/WalletScreeningBlockedError.d.ts +13 -0
  17. package/dist/errors/WalletScreeningBlockedError.d.ts.map +1 -1
  18. package/dist/exports/index.d.ts +15 -5
  19. package/dist/exports/index.d.ts.map +1 -1
  20. package/dist/exports/waas.d.ts +2 -0
  21. package/dist/exports/waas.d.ts.map +1 -1
  22. package/dist/{getNetworkProviderFromNetworkId-CMIgKqEH.cjs → getNetworkProviderFromNetworkId-BJX2AMGR.cjs} +74 -4
  23. package/dist/getNetworkProviderFromNetworkId-BJX2AMGR.cjs.map +1 -0
  24. package/dist/{getNetworkProviderFromNetworkId-C6DBO0OX.native.esm.js → getNetworkProviderFromNetworkId-Bsv12Q6B.native.esm.js} +90 -9
  25. package/dist/getNetworkProviderFromNetworkId-Bsv12Q6B.native.esm.js.map +1 -0
  26. package/dist/{getNetworkProviderFromNetworkId-CEs4SGW4.esm.js → getNetworkProviderFromNetworkId-D3uwhdMN.esm.js} +72 -8
  27. package/dist/getNetworkProviderFromNetworkId-D3uwhdMN.esm.js.map +1 -0
  28. package/dist/{getSignedSessionId-De_N_Ofg.cjs → getSignedSessionId-BIZJGg61.cjs} +3 -3
  29. package/dist/{getSignedSessionId-De_N_Ofg.cjs.map → getSignedSessionId-BIZJGg61.cjs.map} +1 -1
  30. package/dist/{getSignedSessionId-CUqILBh8.esm.js → getSignedSessionId-CnSAMO3P.esm.js} +3 -3
  31. package/dist/{getSignedSessionId-CUqILBh8.esm.js.map → getSignedSessionId-CnSAMO3P.esm.js.map} +1 -1
  32. package/dist/{getSignedSessionId-Hp1nSbaW.native.esm.js → getSignedSessionId-DXDi7NkE.native.esm.js} +3 -3
  33. package/dist/{getSignedSessionId-Hp1nSbaW.native.esm.js.map → getSignedSessionId-DXDi7NkE.native.esm.js.map} +1 -1
  34. package/dist/{getWalletProviderByKey-D3e0XMjs.cjs → getWalletProviderByKey-C6aS7KgD.cjs} +2 -2
  35. package/dist/{getWalletProviderByKey-D3e0XMjs.cjs.map → getWalletProviderByKey-C6aS7KgD.cjs.map} +1 -1
  36. package/dist/{getWalletProviderByKey-CKORCA8l.esm.js → getWalletProviderByKey-Cr8m-Nax.esm.js} +2 -2
  37. package/dist/{getWalletProviderByKey-CKORCA8l.esm.js.map → getWalletProviderByKey-Cr8m-Nax.esm.js.map} +1 -1
  38. package/dist/{getWalletProviderByKey-D5M801xH.native.esm.js → getWalletProviderByKey-DVk2t98D.native.esm.js} +2 -2
  39. package/dist/{getWalletProviderByKey-D5M801xH.native.esm.js.map → getWalletProviderByKey-DVk2t98D.native.esm.js.map} +1 -1
  40. package/dist/index.cjs +732 -54
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.esm.js +729 -53
  43. package/dist/index.esm.js.map +1 -1
  44. package/dist/index.native.esm.js +656 -52
  45. package/dist/index.native.esm.js.map +1 -1
  46. package/dist/{isDynamicWaasEnabled-BQuXZne_.cjs → isDynamicWaasEnabled-BawttOeb.cjs} +20 -6
  47. package/dist/isDynamicWaasEnabled-BawttOeb.cjs.map +1 -0
  48. package/dist/{isDynamicWaasEnabled-BlVIlXMZ.esm.js → isDynamicWaasEnabled-DDrg89y1.esm.js} +19 -5
  49. package/dist/isDynamicWaasEnabled-DDrg89y1.esm.js.map +1 -0
  50. package/dist/{isDynamicWaasEnabled-BaY09iv6.native.esm.js → isDynamicWaasEnabled-Dj_sLoBO.native.esm.js} +19 -5
  51. package/dist/isDynamicWaasEnabled-Dj_sLoBO.native.esm.js.map +1 -0
  52. package/dist/{isMfaRequiredForAction-Dghiguch.cjs → isMfaRequiredForAction-BuvyBN_r.cjs} +19 -2
  53. package/dist/isMfaRequiredForAction-BuvyBN_r.cjs.map +1 -0
  54. package/dist/{isMfaRequiredForAction-r9aDdmK5.esm.js → isMfaRequiredForAction-DTp4CZBt.esm.js} +19 -2
  55. package/dist/isMfaRequiredForAction-DTp4CZBt.esm.js.map +1 -0
  56. package/dist/{isMfaRequiredForAction-CwOGwiDz.native.esm.js → isMfaRequiredForAction-EY-OQORc.native.esm.js} +2 -2
  57. package/dist/{isMfaRequiredForAction-CwOGwiDz.native.esm.js.map → isMfaRequiredForAction-EY-OQORc.native.esm.js.map} +1 -1
  58. package/dist/{isUserOnboardingComplete-j4b_q9Pf.cjs → isUserOnboardingComplete-CkyzRYrg.cjs} +11 -4
  59. package/dist/{isUserOnboardingComplete-j4b_q9Pf.cjs.map → isUserOnboardingComplete-CkyzRYrg.cjs.map} +1 -1
  60. package/dist/{isUserOnboardingComplete-C-ioFLRR.native.esm.js → isUserOnboardingComplete-D3HrBYje.native.esm.js} +10 -3
  61. package/dist/{isUserOnboardingComplete-C-ioFLRR.native.esm.js.map → isUserOnboardingComplete-D3HrBYje.native.esm.js.map} +1 -1
  62. package/dist/{isUserOnboardingComplete-BMNAbXk1.esm.js → isUserOnboardingComplete-Dy2Ygp0u.esm.js} +10 -3
  63. package/dist/{isUserOnboardingComplete-BMNAbXk1.esm.js.map → isUserOnboardingComplete-Dy2Ygp0u.esm.js.map} +1 -1
  64. package/dist/{migrateFromFireblocks-D8Y5h0hz.native.esm.js → migrateFromFireblocks-B5qWGLCM.native.esm.js} +3 -3
  65. package/dist/{migrateFromFireblocks-D8Y5h0hz.native.esm.js.map → migrateFromFireblocks-B5qWGLCM.native.esm.js.map} +1 -1
  66. package/dist/{migrateFromFireblocks-D9pJIgt5.cjs → migrateFromFireblocks-Dp-QA9hi.cjs} +3 -3
  67. package/dist/{migrateFromFireblocks-D9pJIgt5.cjs.map → migrateFromFireblocks-Dp-QA9hi.cjs.map} +1 -1
  68. package/dist/{migrateFromFireblocks-D--uqWp5.esm.js → migrateFromFireblocks-MAatsk_w.esm.js} +3 -3
  69. package/dist/{migrateFromFireblocks-D--uqWp5.esm.js.map → migrateFromFireblocks-MAatsk_w.esm.js.map} +1 -1
  70. package/dist/modules/apiClient/constants.d.ts +8 -0
  71. package/dist/modules/apiClient/constants.d.ts.map +1 -1
  72. package/dist/modules/apiClient/createApiClient.d.ts.map +1 -1
  73. package/dist/modules/auth/externalAuth/signInWithExternalJwt/signInWithExternalJwt.d.ts +11 -1
  74. package/dist/modules/auth/externalAuth/signInWithExternalJwt/signInWithExternalJwt.d.ts.map +1 -1
  75. package/dist/modules/auth/isSignedIn/isSignedIn.d.ts +9 -0
  76. package/dist/modules/auth/isSignedIn/isSignedIn.d.ts.map +1 -1
  77. package/dist/modules/auth/logout/logout.d.ts +13 -0
  78. package/dist/modules/auth/logout/logout.d.ts.map +1 -1
  79. package/dist/modules/auth/mergeUserAccounts/index.d.ts +3 -0
  80. package/dist/modules/auth/mergeUserAccounts/index.d.ts.map +1 -0
  81. package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.d.ts +62 -0
  82. package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.d.ts.map +1 -0
  83. package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.types.d.ts +78 -0
  84. package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.types.d.ts.map +1 -0
  85. package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts +7 -0
  86. package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts.map +1 -1
  87. package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts +9 -0
  88. package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts.map +1 -1
  89. package/dist/modules/auth/social/oauth/authenticateWithSocial/authenticateWithSocial.d.ts +8 -0
  90. package/dist/modules/auth/social/oauth/authenticateWithSocial/authenticateWithSocial.d.ts.map +1 -1
  91. package/dist/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.d.ts +34 -0
  92. package/dist/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.d.ts.map +1 -0
  93. package/dist/modules/auth/social/oauth/clearSocialRedirectParams/index.d.ts +2 -0
  94. package/dist/modules/auth/social/oauth/clearSocialRedirectParams/index.d.ts.map +1 -0
  95. package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.d.ts +11 -0
  96. package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.d.ts.map +1 -1
  97. package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.d.ts +0 -1
  98. package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.d.ts.map +1 -1
  99. package/dist/modules/auth/social/oauth/signInWithSocialPopUp/signInWithSocialPopUp.d.ts +12 -0
  100. package/dist/modules/auth/social/oauth/signInWithSocialPopUp/signInWithSocialPopUp.d.ts.map +1 -1
  101. package/dist/modules/auth/social/oauth/signInWithSocialRedirect/signInWithSocialRedirect.d.ts +10 -0
  102. package/dist/modules/auth/social/oauth/signInWithSocialRedirect/signInWithSocialRedirect.d.ts.map +1 -1
  103. package/dist/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.d.ts.map +1 -1
  104. package/dist/modules/captcha/CaptchaProviderEnum/CaptchaProviderEnum.d.ts +37 -0
  105. package/dist/modules/captcha/CaptchaProviderEnum/CaptchaProviderEnum.d.ts.map +1 -0
  106. package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.d.ts +41 -5
  107. package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.d.ts.map +1 -1
  108. package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.types.d.ts +22 -0
  109. package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.types.d.ts.map +1 -0
  110. package/dist/modules/captcha/getCaptchaSettings/index.d.ts +1 -1
  111. package/dist/modules/captcha/getCaptchaSettings/index.d.ts.map +1 -1
  112. package/dist/modules/clientEvents/clientEvents.d.ts +34 -0
  113. package/dist/modules/clientEvents/clientEvents.d.ts.map +1 -1
  114. package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/clearDeviceRegistrationRedirectParams.d.ts +35 -0
  115. package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/clearDeviceRegistrationRedirectParams.d.ts.map +1 -0
  116. package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/index.d.ts +2 -0
  117. package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/index.d.ts.map +1 -0
  118. package/dist/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.d.ts +8 -1
  119. package/dist/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.d.ts.map +1 -1
  120. package/dist/modules/flow/cancelFlow/cancelFlow.d.ts +10 -3
  121. package/dist/modules/flow/cancelFlow/cancelFlow.d.ts.map +1 -1
  122. package/dist/modules/flow/getFlow/getFlow.d.ts +11 -3
  123. package/dist/modules/flow/getFlow/getFlow.d.ts.map +1 -1
  124. package/dist/modules/flow/getFlowQuote/getFlowQuote.d.ts +16 -3
  125. package/dist/modules/flow/getFlowQuote/getFlowQuote.d.ts.map +1 -1
  126. package/dist/modules/initializeClient/initializeClient.d.ts +16 -0
  127. package/dist/modules/initializeClient/initializeClient.d.ts.map +1 -1
  128. package/dist/modules/initializeClient/waitForClientInitialized/waitForClientInitialized.d.ts +12 -2
  129. package/dist/modules/initializeClient/waitForClientInitialized/waitForClientInitialized.d.ts.map +1 -1
  130. package/dist/modules/otp/sendEmailOTP/sendEmailOTP.d.ts +14 -0
  131. package/dist/modules/otp/sendEmailOTP/sendEmailOTP.d.ts.map +1 -1
  132. package/dist/modules/otp/sendSmsOTP/sendSmsOTP.d.ts +12 -0
  133. package/dist/modules/otp/sendSmsOTP/sendSmsOTP.d.ts.map +1 -1
  134. package/dist/modules/otp/verifyOTP/verifyOTP.d.ts +33 -1
  135. package/dist/modules/otp/verifyOTP/verifyOTP.d.ts.map +1 -1
  136. package/dist/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.d.ts +1 -1
  137. package/dist/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.d.ts.map +1 -1
  138. package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts +8 -0
  139. package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts.map +1 -1
  140. package/dist/modules/user/checkUserScopes/checkUserScopes.d.ts +28 -0
  141. package/dist/modules/user/checkUserScopes/checkUserScopes.d.ts.map +1 -0
  142. package/dist/modules/user/checkUserScopes/index.d.ts +2 -0
  143. package/dist/modules/user/checkUserScopes/index.d.ts.map +1 -0
  144. package/dist/modules/user/deleteUser/deleteUser.d.ts +8 -0
  145. package/dist/modules/user/deleteUser/deleteUser.d.ts.map +1 -1
  146. package/dist/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.d.ts +8 -1
  147. package/dist/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.d.ts.map +1 -1
  148. package/dist/modules/user/refreshAuth/refreshAuth.d.ts +17 -3
  149. package/dist/modules/user/refreshAuth/refreshAuth.d.ts.map +1 -1
  150. package/dist/modules/user/refreshUser/refreshUser.d.ts +16 -3
  151. package/dist/modules/user/refreshUser/refreshUser.d.ts.map +1 -1
  152. package/dist/modules/user/user.types.d.ts +9 -1
  153. package/dist/modules/user/user.types.d.ts.map +1 -1
  154. package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/getEmbeddedWalletsRequiringUpgrade.d.ts +30 -0
  155. package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/getEmbeddedWalletsRequiringUpgrade.d.ts.map +1 -0
  156. package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/index.d.ts +2 -0
  157. package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/index.d.ts.map +1 -0
  158. package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/hasEmbeddedWalletsRequiringUpgrade.d.ts +23 -0
  159. package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/hasEmbeddedWalletsRequiringUpgrade.d.ts.map +1 -0
  160. package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/index.d.ts +2 -0
  161. package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/index.d.ts.map +1 -0
  162. package/dist/modules/wallets/connectAndVerifyWithWalletProvider/connectAndVerifyWithWalletProvider.d.ts +11 -1
  163. package/dist/modules/wallets/connectAndVerifyWithWalletProvider/connectAndVerifyWithWalletProvider.d.ts.map +1 -1
  164. package/dist/modules/wallets/connectWithWalletProvider/connectWithWalletProvider.d.ts +11 -3
  165. package/dist/modules/wallets/connectWithWalletProvider/connectWithWalletProvider.d.ts.map +1 -1
  166. package/dist/modules/wallets/disconnectWalletAccount/disconnectWalletAccount.d.ts +16 -3
  167. package/dist/modules/wallets/disconnectWalletAccount/disconnectWalletAccount.d.ts.map +1 -1
  168. package/dist/modules/wallets/getConnectedAddresses/getConnectedAddresses.d.ts +9 -1
  169. package/dist/modules/wallets/getConnectedAddresses/getConnectedAddresses.d.ts.map +1 -1
  170. package/dist/modules/wallets/getWalletAccounts/getWalletAccounts.d.ts +11 -1
  171. package/dist/modules/wallets/getWalletAccounts/getWalletAccounts.d.ts.map +1 -1
  172. package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts +9 -0
  173. package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts.map +1 -1
  174. package/dist/modules/wallets/isWalletAccountVerified/isWalletAccountVerified.d.ts +10 -2
  175. package/dist/modules/wallets/isWalletAccountVerified/isWalletAccountVerified.d.ts.map +1 -1
  176. package/dist/modules/wallets/networks/getBalance/getBalance.d.ts +8 -0
  177. package/dist/modules/wallets/networks/getBalance/getBalance.d.ts.map +1 -1
  178. package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts +8 -0
  179. package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts.map +1 -1
  180. package/dist/modules/wallets/networks/switchActiveNetwork/switchActiveNetwork.d.ts +11 -1
  181. package/dist/modules/wallets/networks/switchActiveNetwork/switchActiveNetwork.d.ts.map +1 -1
  182. package/dist/modules/wallets/proveWalletAccountOwnership/proveWalletAccountOwnership.d.ts +10 -0
  183. package/dist/modules/wallets/proveWalletAccountOwnership/proveWalletAccountOwnership.d.ts.map +1 -1
  184. package/dist/modules/wallets/removeWalletAccount/removeWalletAccount.d.ts +9 -1
  185. package/dist/modules/wallets/removeWalletAccount/removeWalletAccount.d.ts.map +1 -1
  186. package/dist/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts +24 -0
  187. package/dist/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts.map +1 -0
  188. package/dist/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/index.d.ts.map +1 -0
  189. package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/getSelectedWalletAccount.d.ts +30 -0
  190. package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/getSelectedWalletAccount.d.ts.map +1 -0
  191. package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/index.d.ts +2 -0
  192. package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/index.d.ts.map +1 -0
  193. package/dist/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/index.d.ts.map +1 -0
  194. package/dist/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts +28 -0
  195. package/dist/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts.map +1 -0
  196. package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/index.d.ts +2 -0
  197. package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/index.d.ts.map +1 -0
  198. package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/setSelectedWalletAccount.d.ts +34 -0
  199. package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/setSelectedWalletAccount.d.ts.map +1 -0
  200. package/dist/modules/wallets/signMessage/signMessage.d.ts +12 -1
  201. package/dist/modules/wallets/signMessage/signMessage.d.ts.map +1 -1
  202. package/dist/modules/wallets/transferAmount/transferAmount.d.ts +13 -2
  203. package/dist/modules/wallets/transferAmount/transferAmount.d.ts.map +1 -1
  204. package/dist/modules/wallets/transferWalletAccount/transferWalletAccount.d.ts +10 -1
  205. package/dist/modules/wallets/transferWalletAccount/transferWalletAccount.d.ts.map +1 -1
  206. package/dist/modules/wallets/utils/getWalletAccountFromAddress/getWalletAccountFromAddress.d.ts +11 -1
  207. package/dist/modules/wallets/utils/getWalletAccountFromAddress/getWalletAccountFromAddress.d.ts.map +1 -1
  208. package/dist/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.d.ts +1 -0
  209. package/dist/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.d.ts.map +1 -1
  210. package/dist/modules/wallets/verifyWalletAccount/verifyWalletAccount.d.ts +12 -1
  211. package/dist/modules/wallets/verifyWalletAccount/verifyWalletAccount.d.ts.map +1 -1
  212. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  213. package/dist/{updateAuthFromVerifyResponse-wVY_DoiL.native.esm.js → updateAuthFromVerifyResponse-DFjqCSu2.native.esm.js} +93 -17
  214. package/dist/updateAuthFromVerifyResponse-DFjqCSu2.native.esm.js.map +1 -0
  215. package/dist/{updateAuthFromVerifyResponse-BQes11vz.esm.js → updateAuthFromVerifyResponse-_oYRLK_w.esm.js} +93 -17
  216. package/dist/updateAuthFromVerifyResponse-_oYRLK_w.esm.js.map +1 -0
  217. package/dist/{updateAuthFromVerifyResponse-Deg9em9o.cjs → updateAuthFromVerifyResponse-pgYXvDvj.cjs} +93 -17
  218. package/dist/updateAuthFromVerifyResponse-pgYXvDvj.cjs.map +1 -0
  219. package/dist/waas.cjs +72 -5
  220. package/dist/waas.cjs.map +1 -1
  221. package/dist/waas.esm.js +70 -5
  222. package/dist/waas.esm.js.map +1 -1
  223. package/dist/waas.native.esm.js +70 -5
  224. package/dist/waas.native.esm.js.map +1 -1
  225. package/dist/waasCore.cjs +6 -6
  226. package/dist/waasCore.esm.js +6 -6
  227. package/dist/waasCore.native.esm.js +6 -6
  228. package/package.json +3 -3
  229. package/dist/getNetworkProviderFromNetworkId-C6DBO0OX.native.esm.js.map +0 -1
  230. package/dist/getNetworkProviderFromNetworkId-CEs4SGW4.esm.js.map +0 -1
  231. package/dist/getNetworkProviderFromNetworkId-CMIgKqEH.cjs.map +0 -1
  232. package/dist/isDynamicWaasEnabled-BQuXZne_.cjs.map +0 -1
  233. package/dist/isDynamicWaasEnabled-BaY09iv6.native.esm.js.map +0 -1
  234. package/dist/isDynamicWaasEnabled-BlVIlXMZ.esm.js.map +0 -1
  235. package/dist/isMfaRequiredForAction-Dghiguch.cjs.map +0 -1
  236. package/dist/isMfaRequiredForAction-r9aDdmK5.esm.js.map +0 -1
  237. package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts +0 -10
  238. package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts.map +0 -1
  239. package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/index.d.ts.map +0 -1
  240. package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/index.d.ts.map +0 -1
  241. package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts +0 -12
  242. package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts.map +0 -1
  243. package/dist/updateAuthFromVerifyResponse-BQes11vz.esm.js.map +0 -1
  244. package/dist/updateAuthFromVerifyResponse-Deg9em9o.cjs.map +0 -1
  245. package/dist/updateAuthFromVerifyResponse-wVY_DoiL.native.esm.js.map +0 -1
  246. /package/dist/modules/wallets/{primaryWalletAccount → selectedWalletAccount}/getPrimaryWalletAccount/index.d.ts +0 -0
  247. /package/dist/modules/wallets/{primaryWalletAccount → selectedWalletAccount}/selectPrimaryWalletAccount/index.d.ts +0 -0
package/dist/index.esm.js CHANGED
@@ -1,13 +1,13 @@
1
- import { $ as SandboxMaximumThresholdReachedError, A as NoWalletProviderFoundError, B as emitEvent, C as getOperatingSystem, D as WalletProviderPriority, E as getWalletProviderFromWalletAccount, F as CHAINS_INFO_MAP, H as onEvent, I as formatWalletAccountId, J as UnauthorizedError, K as fetchAndStoreNonces, L as normalizeAddress, O as getWalletProviderRegistry, P as getChainFromVerifiedCredentialChain, Q as getNonce, R as splitWalletProviderKey, S as getPlatform, U as onceEvent, V as offEvent, _ as SDK_API_CORE_VERSION, _t as BaseError, a as initializeWaasClientsForEagerRecovery, b as DEFAULT_PII_FIELDS, bt as version, ct as ValueMustBeDefinedError, et as MfaRateLimitedError, f as getWalletProviders, g as DYNAMIC_ICONIC_SPRITE_URL, ht as setDefaultClient, i as InvalidParamError, it as APIError, j as getWalletAccounts, lt as getElevatedAccessToken, m as checkAndRaiseWalletAccountsChangedEvent, mt as getDefaultClient, n as upsertElevatedAccessToken, nt as LinkCredentialError, ot as isCookieEnabled, p as isUserMissingMfaAuth, pt as NONCE_POOL_SIZE, q as createApiClient, r as parseElevatedAccessToken, rt as InvalidExternalAuthError, st as assertDefined, t as updateAuthFromVerifyResponse, tt as MfaInvalidOtpError, ut as randomString, v as instrumentFunction, vt as getCore, w as extractSessionId, x as getUserAgent, y as scrubParameters, yt as name } from "./updateAuthFromVerifyResponse-BQes11vz.esm.js";
2
- import { A as CannotTrackError, C as createRealtimeService, D as createLogger, F as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, H as subscribeWithSelector, I as REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY, L as isServerSideRendering, M as FETCH_PROJECT_SETTINGS_TRACKER_KEY, N as GENERATE_SESSION_KEYS_TRACKER_KEY, O as createCrossTabBroadcast, P as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, R as getBuffer, S as getKeychainIndexedDBName, T as assertSafeNavigationUrl, U as isEqualShallow, V as createLocalStorageAdapter, _ as consumeCaptchaToken, a as verifyMessageSignatureOwnership, b as WalletAlreadyLinkedToAnotherUserError, c as formatSignInMessage, d as updateWalletProviderKeysForVerifiedCredentials, f as setUnverifiedWalletAccounts, g as MethodNotImplementedError, h as __setCaptchaToken_wrapped, i as getNetworksData, j as createDeferredPromise, l as getAppMetadata, m as hasExtension, o as removeUnverifiedWalletAccount, p as createVisit, s as createSignInMessageStatement, t as getNetworkProviderFromNetworkId, u as reconcileWalletAccountsAgainstClient, v as isCaptchaRequired, w as createKeychainService, x as NoNetworkProvidersError, y as WalletScreeningBlockedError, z as createStorage } from "./getNetworkProviderFromNetworkId-CEs4SGW4.esm.js";
3
- import { a as generateSessionKeys, c as isSignedIn, i as __logoutWithReason_wrapped, l as retryOnFail, n as getMfaMethods, o as fetchProjectSettings, r as __consumeMfaToken_wrapped, s as createStorageKeySchema, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-r9aDdmK5.esm.js";
4
- import { n as NotWaasWalletAccountError, r as __refreshAuth_wrapped } from "./isDynamicWaasEnabled-BlVIlXMZ.esm.js";
5
- import { a as WaasOnboardingIncompleteError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, r as isDeviceRegistrationRequired, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-BMNAbXk1.esm.js";
6
- import { n as getVerifiedCredentialForWalletAccount, t as getWalletProviderByKey } from "./getWalletProviderByKey-CKORCA8l.esm.js";
1
+ import { $ as MfaRateLimitedError, A as getWalletAccounts, B as offEvent, C as extractSessionId, D as getWalletProviderRegistry, E as WalletProviderPriority, F as formatWalletAccountId, G as fetchAndStoreNonces, H as onceEvent, I as normalizeAddress, K as createApiClient, L as splitWalletProviderKey, N as getChainFromVerifiedCredentialChain, P as CHAINS_INFO_MAP, Q as SandboxMaximumThresholdReachedError, S as getOperatingSystem, T as getWalletProviderFromWalletAccount, V as onEvent, Z as getNonce, _ as SDK_API_CORE_VERSION, _t as BaseError, a as initializeWaasClientsForEagerRecovery, at as isCookieEnabled, b as DEFAULT_PII_FIELDS, bt as version, ct as getElevatedAccessToken, et as MfaInvalidOtpError, f as getWalletProviders, g as DYNAMIC_ICONIC_SPRITE_URL, ht as setDefaultClient, i as InvalidParamError, k as NoWalletProviderFoundError, lt as randomString, m as checkAndRaiseWalletAccountsChangedEvent, mt as getDefaultClient, n as upsertElevatedAccessToken, nt as InvalidExternalAuthError, ot as assertDefined, p as isUserMissingMfaAuth, pt as NONCE_POOL_SIZE, q as UnauthorizedError, r as parseElevatedAccessToken, rt as APIError, st as ValueMustBeDefinedError, t as updateAuthFromVerifyResponse, tt as LinkCredentialError, ut as getPlatform, v as instrumentFunction, vt as getCore, x as getUserAgent, y as scrubParameters, yt as name, z as emitEvent } from "./updateAuthFromVerifyResponse-_oYRLK_w.esm.js";
2
+ import { B as createStorage, C as getKeychainIndexedDBName, E as assertSafeNavigationUrl, F as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, H as createLocalStorageAdapter, I as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, L as REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY, M as createDeferredPromise, N as FETCH_PROJECT_SETTINGS_TRACKER_KEY, O as createLogger, P as GENERATE_SESSION_KEYS_TRACKER_KEY, R as isServerSideRendering, S as MergeAccountsConfirmationError, T as createKeychainService, U as subscribeWithSelector, W as isEqualShallow, _ as consumeCaptchaToken, a as verifyMessageSignatureOwnership, b as WalletAlreadyLinkedToAnotherUserError, c as formatSignInMessage, d as updateWalletProviderKeysForVerifiedCredentials, f as setUnverifiedWalletAccounts, g as MethodNotImplementedError, h as __setCaptchaToken_wrapped, i as getNetworksData, j as CannotTrackError, k as createCrossTabBroadcast, l as getAppMetadata, m as hasExtension, o as removeUnverifiedWalletAccount, p as createVisit, s as createSignInMessageStatement, t as getNetworkProviderFromNetworkId, u as reconcileWalletAccountsAgainstClient, v as isCaptchaRequired, w as createRealtimeService, x as NoNetworkProvidersError, y as WalletScreeningBlockedError, z as getBuffer } from "./getNetworkProviderFromNetworkId-D3uwhdMN.esm.js";
3
+ import { a as generateSessionKeys, c as isSignedIn, i as __logoutWithReason_wrapped, l as retryOnFail, n as getMfaMethods, o as fetchProjectSettings, r as __consumeMfaToken_wrapped, s as createStorageKeySchema, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-DTp4CZBt.esm.js";
4
+ import { n as NotWaasWalletAccountError, r as __refreshAuth_wrapped } from "./isDynamicWaasEnabled-DDrg89y1.esm.js";
5
+ import { a as WaasOnboardingIncompleteError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, r as isDeviceRegistrationRequired, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-Dy2Ygp0u.esm.js";
6
+ import { n as getVerifiedCredentialForWalletAccount, t as getWalletProviderByKey } from "./getWalletProviderByKey-Cr8m-Nax.esm.js";
7
7
  import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
8
- import { AuthModeEnum, CaptchaProviderEnum, CaptchaProviderEnum as CaptchaProviderEnum$1, ExchangeKeyEnum, JwtVerifiedCredentialFormatEnum, JwtVerifiedCredentialFormatEnum as JwtVerifiedCredentialFormatEnum$1, MFAAction, MfaBackupCodeAcknowledgement, ProviderEnum, ProviderEnum as ProviderEnum$1, TokenScope, TokenScope as TokenScope$1, WaasBackupOptionsEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
8
+ import { AuthModeEnum, CaptchaProviderEnum as CaptchaProviderEnum$1, ExchangeKeyEnum, JwtVerifiedCredentialFormatEnum, JwtVerifiedCredentialFormatEnum as JwtVerifiedCredentialFormatEnum$1, MFAAction, MfaBackupCodeAcknowledgement, ProviderEnum, ProviderEnum as ProviderEnum$1, TokenScope, TokenScope as TokenScope$1, WaasBackupOptionsEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
9
9
  import * as z from "zod/mini";
10
- import EventEmitter$1, { EventEmitter } from "eventemitter3";
10
+ import EventEmitter, { EventEmitter as EventEmitter$1 } from "eventemitter3";
11
11
  import { browserSupportsWebAuthn, startAuthentication, startRegistration } from "@simplewebauthn/browser";
12
12
 
13
13
  //#region src/modules/state/raiseStateEvents/events.ts
@@ -353,13 +353,26 @@ const initializeStorageSync = async (client) => {
353
353
  //#endregion
354
354
  //#region src/modules/user/refreshUser/refreshUser.ts
355
355
  /**
356
- * Refreshes the current user's data from the server.
356
+ * Refreshes the current user's profile from the server.
357
357
  *
358
- * This function fetches the latest authenticated user information from the backend
359
- * and updates the local user state.
358
+ * This fetches the latest authenticated user from the backend and updates only
359
+ * the local user state, returning the `SdkUser`. It does not touch the auth
360
+ * token — use it when you just need up-to-date user data.
361
+ *
362
+ * Prefer `refreshAuth` when you need to rotate the auth token as well: it runs
363
+ * a full verify, updates both token and user state, and returns the raw
364
+ * `VerifyResponse` (including the new token).
365
+ *
366
+ * @example
367
+ * ```ts
368
+ * const user = await refreshUser();
369
+ * console.log('Updated user:', user.email);
370
+ * ```
360
371
  *
361
372
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
362
373
  * @returns A promise that resolves to the authenticated user.
374
+ * @see refreshAuth
375
+ * @see deleteUser
363
376
  * @instrumented
364
377
  * @noHook Low-level refresh primitive that is not exposed as a React hook.
365
378
  */
@@ -410,9 +423,25 @@ var ClientAlreadyInitializedError = class extends BaseError {
410
423
  *
411
424
  * You only need to call this function if you are not using `autoInitialize: true` in createDynamicClient.
412
425
  *
426
+ * @example
427
+ * ```ts
428
+ * const client = createDynamicClient({
429
+ * environmentId: 'env-id',
430
+ * autoInitialize: false,
431
+ * });
432
+ *
433
+ * try {
434
+ * await initializeClient(client);
435
+ * } catch (error) {
436
+ * console.error('Failed to initialize:', error);
437
+ * }
438
+ * ```
439
+ *
413
440
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
414
441
  * @returns A promise that resolves when initialization is complete.
415
442
  * @throws ClientAlreadyInitializedError If the client is already initialized.
443
+ * @see createDynamicClient
444
+ * @see waitForClientInitialized
416
445
  * @instrumented
417
446
  * @noHook Client lifecycle management is not exposed as a React hook.
418
447
  */
@@ -545,7 +574,7 @@ const createAsyncTrack = () => {
545
574
  * This ensures no process is missed (as it would throw when tracked on a different node tick).
546
575
  */
547
576
  let isTrackEnabled = true;
548
- const eventEmitter = new EventEmitter();
577
+ const eventEmitter = new EventEmitter$1();
549
578
  const allSettledPromise = createDeferredPromise();
550
579
  const tracker = /* @__PURE__ */ new Map();
551
580
  /**
@@ -592,7 +621,7 @@ const createAsyncTrack = () => {
592
621
  //#endregion
593
622
  //#region src/services/eventEmitter/createEventEmitter.ts
594
623
  /** @notInstrumented */
595
- const createEventEmitter = () => new EventEmitter$1();
624
+ const createEventEmitter = () => new EventEmitter();
596
625
 
597
626
  //#endregion
598
627
  //#region src/errors/UnavailableInServerSideError.ts
@@ -1096,8 +1125,18 @@ const createCore = (config) => {
1096
1125
  * Manually calling `initializeClient` also allows you to catch any potential
1097
1126
  * errors that may occur during initialization.
1098
1127
  *
1128
+ * @example
1129
+ * ```ts
1130
+ * const client = createDynamicClient({
1131
+ * environmentId: 'your-environment-id',
1132
+ * appUrl: 'https://myapp.com',
1133
+ * });
1134
+ * ```
1135
+ *
1099
1136
  * @param config - The configuration for the Dynamic client, like the environment ID, app url, etc.
1100
1137
  * @returns The Dynamic client instance.
1138
+ * @see initializeClient
1139
+ * @see getDefaultClient
1101
1140
  * @instrumented
1102
1141
  */
1103
1142
  const createDynamicClient = (config) => {
@@ -1188,6 +1227,27 @@ var DeeplinkConnectAndVerifyUnsupportedError = class extends BaseError {
1188
1227
 
1189
1228
  //#endregion
1190
1229
  //#region src/errors/DeviceRegistrationIdentityMismatchError.ts
1230
+ /**
1231
+ * Thrown when completing device registration would replace the current session
1232
+ * with a different user's identity.
1233
+ *
1234
+ * The device registration token resolved to a user other than the one currently
1235
+ * authenticated, which can indicate a login-CSRF / session-fixation attempt, so
1236
+ * the returned session is rejected and the current session is left untouched.
1237
+ *
1238
+ * @example
1239
+ * ```ts
1240
+ * try {
1241
+ * await completeDeviceRegistration({ token });
1242
+ * } catch (error) {
1243
+ * if (error instanceof DeviceRegistrationIdentityMismatchError) {
1244
+ * // The current session was preserved; ask the user to retry on this device.
1245
+ * }
1246
+ * }
1247
+ * ```
1248
+ * @see completeDeviceRegistration
1249
+ * @see InvalidDeviceRegistrationRedirectError
1250
+ */
1191
1251
  var DeviceRegistrationIdentityMismatchError = class extends BaseError {
1192
1252
  constructor() {
1193
1253
  super({
@@ -1686,9 +1746,19 @@ const __requestExternalAuthElevatedToken_wrapped = instrumentFunction({
1686
1746
  * This function allows authentication using JWT tokens from external providers,
1687
1747
  * enabling integration with custom authentication systems.
1688
1748
  *
1749
+ * @example
1750
+ * ```ts
1751
+ * const response = await signInWithExternalJwt({
1752
+ * externalJwt: 'eyJhbGciOiJSUzI1NiIs...',
1753
+ * });
1754
+ * ```
1755
+ *
1689
1756
  * @param [params.externalJwt] - Optional external JWT token to authenticate with. Not required when using cookie based auth.
1757
+ * @param [params.sessionPublicKey] - Optional session public key for session-based auth.
1690
1758
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1691
1759
  * @returns A promise that resolves to the authentication response from the server.
1760
+ * @see logout
1761
+ * @see refreshAuth
1692
1762
  * @instrumented
1693
1763
  */
1694
1764
  const signInWithExternalJwt = async ({ externalJwt, sessionPublicKey } = {}, client = getDefaultClient()) => {
@@ -1721,8 +1791,21 @@ const __signInWithExternalJwt_wrapped = instrumentFunction({
1721
1791
  /**
1722
1792
  * Logs out the current user and clears all authentication data.
1723
1793
  *
1794
+ * @example
1795
+ * ```ts
1796
+ * await logout();
1797
+ * ```
1798
+ *
1799
+ * @example
1800
+ * ```ts
1801
+ * // With explicit client for multi-client setups
1802
+ * await logout(myClient);
1803
+ * ```
1804
+ *
1724
1805
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1725
1806
  * @returns A promise that resolves when the logout process is complete.
1807
+ * @see isAnyWalletAccountConnected
1808
+ * @see refreshAuth
1726
1809
  * @notInstrumented
1727
1810
  */
1728
1811
  const logout = async (client = getDefaultClient()) => {
@@ -1735,6 +1818,58 @@ const logout = async (client = getDefaultClient()) => {
1735
1818
  return __logoutWithReason_wrapped({ reason: "user-intent" }, client);
1736
1819
  };
1737
1820
 
1821
+ //#endregion
1822
+ //#region src/modules/auth/mergeUserAccounts/mergeUserAccounts.ts
1823
+ /**
1824
+ * Completes an account merge after a credential was found to already belong to
1825
+ * another user (surfaced as `MergeAccountsConfirmationError` during
1826
+ * verification / linking).
1827
+ *
1828
+ * When the merge has no field-level conflicts, call it with no resolutions to
1829
+ * merge directly. When the two accounts hold different values for the same
1830
+ * profile field, pass the user's chosen `conflictResolutions` (one per
1831
+ * conflict) so the backend knows which value to keep. On success the two users
1832
+ * are folded into one, the merged session is persisted, and the merged user is
1833
+ * returned.
1834
+ *
1835
+ * @example
1836
+ * ```ts
1837
+ * try {
1838
+ * await verifyWalletAccount({ walletAccount });
1839
+ * } catch (error) {
1840
+ * if (error instanceof MergeAccountsConfirmationError) {
1841
+ * // resolveConflicts is your own function (not provided by the SDK): given
1842
+ * // the conflicting fields, decide which value to keep for each one —
1843
+ * // usually by prompting the user — and return them as MergeUserConflictResolution[].
1844
+ * await mergeUserAccounts(
1845
+ * error.mergeConflicts
1846
+ * ? { conflictResolutions: resolveConflicts(error.mergeConflicts) }
1847
+ * : undefined,
1848
+ * );
1849
+ * }
1850
+ * }
1851
+ * ```
1852
+ * @param params.conflictResolutions - Optional per-field conflict resolutions.
1853
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1854
+ * @returns A promise that resolves to the merged user.
1855
+ * @see MergeAccountsConfirmationError
1856
+ * @see MergeUserConflictResolution
1857
+ * @notInstrumented
1858
+ */
1859
+ const mergeUserAccounts = async ({ conflictResolutions } = {}, client = getDefaultClient()) => {
1860
+ const core = getCore(client);
1861
+ const apiClient = createApiClient({}, client);
1862
+ const hasConflictResolutions = conflictResolutions !== void 0 && conflictResolutions.length > 0;
1863
+ let response;
1864
+ if (hasConflictResolutions) response = await apiClient.verifyMergeUsers({
1865
+ environmentId: core.environmentId,
1866
+ mergeUserConflictResolutions: { mergeUserResolutions: conflictResolutions }
1867
+ });
1868
+ else response = await apiClient.mergeUsers({ environmentId: core.environmentId });
1869
+ updateAuthFromVerifyResponse({ response }, client);
1870
+ return response.user;
1871
+ };
1872
+
1738
1873
  //#endregion
1739
1874
  //#region src/modules/auth/passkeys/deletePasskey/deletePasskey.ts
1740
1875
  /**
@@ -1820,10 +1955,17 @@ const serverRegisterPasskey = async ({ registration, createMfaToken }, client) =
1820
1955
  * passwordless authentication. The user will be prompted to create a passkey
1821
1956
  * using their device's biometric authentication or security key.
1822
1957
  *
1958
+ * @example
1959
+ * ```ts
1960
+ * await registerPasskey();
1961
+ * ```
1962
+ *
1823
1963
  * @param [params.createMfaToken] - Optional configuration for MFA token creation.
1824
1964
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1825
1965
  * @returns A promise that resolves to the registration response.
1826
1966
  * @throws NoWebAuthNSupportError If WebAuthn is not supported by the browser.
1967
+ * @see signInWithPasskey
1968
+ * @see getPasskeys
1827
1969
  * @instrumented
1828
1970
  */
1829
1971
  const registerPasskey = async ({ createMfaToken } = {}, client = getDefaultClient()) => {
@@ -1888,9 +2030,18 @@ const serverSigninPasskey = async ({ authentication, createMfaToken }, client) =
1888
2030
  * credential, providing passwordless authentication using biometrics or
1889
2031
  * security keys.
1890
2032
  *
2033
+ * @example
2034
+ * ```ts
2035
+ * const response = await signInWithPasskey();
2036
+ * console.log('Signed in:', response.user.email);
2037
+ * ```
2038
+ *
2039
+ * @param [params.relatedOriginRpId] - Optional relying party ID for cross-origin authentication.
1891
2040
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1892
2041
  * @returns A promise that resolves to the authentication response.
1893
2042
  * @throws NoWebAuthNSupportError If WebAuthn is not supported by the browser.
2043
+ * @see registerPasskey
2044
+ * @see getPasskeys
1894
2045
  * @instrumented
1895
2046
  */
1896
2047
  const signInWithPasskey = async ({ relatedOriginRpId } = {}, client = getDefaultClient()) => {
@@ -2086,9 +2237,19 @@ const buildOAuthUrl = async (core, provider) => {
2086
2237
  * back because of this flow, then call `completeSocialRedirect` to finish
2087
2238
  * the social authentication.
2088
2239
  *
2240
+ * @example
2241
+ * ```ts
2242
+ * await signInWithSocialRedirect({
2243
+ * provider: 'google',
2244
+ * redirectUrl: window.location.href,
2245
+ * });
2246
+ * ```
2247
+ *
2089
2248
  * @param params.provider - The social provider to authenticate with (e.g., 'google', 'github').
2090
2249
  * @param params.redirectUrl - The URL to redirect back to after authentication.
2091
2250
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
2251
+ * @see completeSocialRedirect
2252
+ * @see detectSocialRedirectUrl
2092
2253
  * @instrumented
2093
2254
  */
2094
2255
  const signInWithSocialRedirect = async ({ provider, redirectUrl }, client = getDefaultClient()) => {
@@ -2131,6 +2292,14 @@ const __signInWithSocialRedirect_wrapped = instrumentFunction({
2131
2292
  * @deprecated Renamed to {@link signInWithSocialRedirect}. This alias will be
2132
2293
  * removed in a future major version.
2133
2294
  *
2295
+ * @example
2296
+ * ```ts
2297
+ * // Prefer signInWithSocialRedirect instead
2298
+ * await signInWithSocialRedirect({ provider: 'google', redirectUrl: window.location.href });
2299
+ * ```
2300
+ *
2301
+ * @see signInWithSocialRedirect
2302
+ * @see completeSocialRedirect
2134
2303
  * @instrumented
2135
2304
  * @noHook Deprecated alias that is not exposed as a React hook.
2136
2305
  */
@@ -2148,6 +2317,45 @@ const __authenticateWithSocial_wrapped = instrumentFunction({
2148
2317
  }
2149
2318
  });
2150
2319
 
2320
+ //#endregion
2321
+ //#region src/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.ts
2322
+ /**
2323
+ * Removes the social OAuth redirect parameters that `signInWithSocialRedirect`
2324
+ * appends to the return URL from the browser's current URL, leaving every other
2325
+ * query parameter, the path, and the hash untouched.
2326
+ *
2327
+ * Call this once you have finished `completeSocialRedirect` so a page refresh
2328
+ * doesn't re-trigger the redirect flow. Unlike clearing the whole query
2329
+ * string, this preserves any of your own parameters on the callback URL.
2330
+ *
2331
+ * This reads and rewrites `window.location`, so it can only run in the
2332
+ * browser. Calling it during server-side rendering (no `window`) throws
2333
+ * `UnavailableInServerSideError`.
2334
+ *
2335
+ * @returns Nothing. The current URL is rewritten in place via
2336
+ * `window.history.replaceState`.
2337
+ *
2338
+ * @throws {UnavailableInServerSideError} When called without a `window`
2339
+ * (e.g. during server-side rendering).
2340
+ *
2341
+ * @example
2342
+ * ```ts
2343
+ * await completeSocialRedirect({ url: new URL(window.location.href) });
2344
+ * clearSocialRedirectParams();
2345
+ * ```
2346
+ *
2347
+ * @see {@link completeSocialRedirect} to finish the redirect sign-in before
2348
+ * clearing the parameters.
2349
+ * @see {@link detectSocialRedirectUrl} to check whether the current URL is a
2350
+ * social OAuth callback.
2351
+ *
2352
+ * @notInstrumented
2353
+ */
2354
+ const clearSocialRedirectParams = () => {
2355
+ if (isServerSideRendering()) throw new UnavailableInServerSideError("clearSocialRedirectParams");
2356
+ window.history.replaceState({}, "", removeDynamicOauthParamsFromUrl(window.location.href));
2357
+ };
2358
+
2151
2359
  //#endregion
2152
2360
  //#region src/modules/auth/social/oauth/processSocialCallback/processSocialCallback.ts
2153
2361
  /**
@@ -2229,12 +2437,23 @@ const __processSocialCallback_wrapped = instrumentFunction({
2229
2437
  * authenticating (or linking) the user with the social provider. This is the
2230
2438
  * final step after `signInWithSocialRedirect` + `detectSocialRedirectUrl`.
2231
2439
  *
2440
+ * @example
2441
+ * ```ts
2442
+ * const redirectUrl = detectSocialRedirectUrl();
2443
+ * if (redirectUrl) {
2444
+ * const user = await completeSocialRedirect({ url: redirectUrl });
2445
+ * }
2446
+ * ```
2447
+ *
2232
2448
  * @param params.url - The callback URL containing OAuth response parameters.
2233
2449
  * @param [params.requestedScopes] - Optional scopes to request an elevated access token when verifying (linking) a social account.
2234
2450
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
2235
2451
  * @returns A promise that resolves to the authenticated user or null.
2236
2452
  * @throws MissingSocialUrlParamError If required OAuth parameters are missing.
2237
2453
  * @throws InvalidRedirectStorageStateError If the stored state doesn't match.
2454
+ * @see signInWithSocialRedirect
2455
+ * @see detectSocialRedirectUrl
2456
+ * @see clearSocialRedirectParams
2238
2457
  * @instrumented
2239
2458
  */
2240
2459
  const completeSocialRedirect = ({ url, requestedScopes }, client = getDefaultClient()) => __processSocialCallback_wrapped({
@@ -2290,7 +2509,6 @@ const __completeSocialAuthentication_wrapped = instrumentFunction({
2290
2509
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
2291
2510
  * @returns A promise that resolves to true if the URL is an OAuth redirect, false otherwise.
2292
2511
  * @notInstrumented
2293
- * @noHook Low-level redirect-detection primitive that is not exposed as a React hook.
2294
2512
  */
2295
2513
  const detectSocialRedirectUrl = async ({ url }, client = getDefaultClient()) => {
2296
2514
  const core = getCore(client);
@@ -2322,7 +2540,19 @@ const detectOAuthRedirect = (params, client = getDefaultClient()) => detectSocia
2322
2540
  * {@link signInWithSocialRedirect} + {@link completeSocialRedirect} instead —
2323
2541
  * the browser already owns the tab so there is no popup to open.
2324
2542
  *
2543
+ * @example
2544
+ * ```ts
2545
+ * // React Native only
2546
+ * const user = await signInWithSocialPopUp({ provider: 'google' });
2547
+ * ```
2548
+ *
2549
+ * @param params.provider - The social provider to authenticate with.
2550
+ * @param [params.requestedScopes] - Optional scopes to request from the provider.
2551
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
2552
+ * @returns A promise that resolves to the authenticated user or null.
2325
2553
  * @throws MethodNotImplementedError Always on web.
2554
+ * @see signInWithSocialRedirect
2555
+ * @see completeSocialRedirect
2326
2556
  * @instrumented
2327
2557
  */
2328
2558
  const signInWithSocialPopUp = async ({ provider, requestedScopes }, client = getDefaultClient()) => {
@@ -2342,19 +2572,39 @@ const __signInWithSocialPopUp_wrapped = instrumentFunction({
2342
2572
  });
2343
2573
 
2344
2574
  //#endregion
2345
- //#region src/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.ts
2575
+ //#region src/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/getSelectedWalletAccount.ts
2346
2576
  /**
2347
- * Get the primary wallet account.
2348
- * The primary wallet account is the one that was last selected by the user.
2349
- * This information is stored in both unverified and verified wallet accounts.
2350
- * This function consolidates this information to determine which wallet was most recently selected.
2577
+ * Get the wallet account currently selected for the user.
2578
+ *
2579
+ * The SDK itself does not use or care about which wallet is "selected" — it has
2580
+ * no bearing on authentication, signing, or any other SDK behaviour. This is
2581
+ * purely a convenience for *reading* which wallet the user most recently
2582
+ * selected (derived from the backend `lastSelectedAt` timestamp, across both
2583
+ * unverified and verified wallet accounts). Applications that need a notion of
2584
+ * an active/current wallet should own that selection state themselves.
2585
+ *
2586
+ * The one exception is the wagmi integration (`@dynamic-labs-sdk/wagmi`), which
2587
+ * mirrors the selected EVM wallet into wagmi's connector state.
2588
+ *
2589
+ * @example
2590
+ * ```ts
2591
+ * const selected = getSelectedWalletAccount();
2592
+ * if (selected) {
2593
+ * console.log('Selected wallet:', selected.address);
2594
+ * }
2595
+ * ```
2596
+ *
2597
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
2598
+ * @returns The selected wallet account, or null if no wallet has been selected.
2599
+ * @see setSelectedWalletAccount
2600
+ * @see getWalletAccounts
2351
2601
  * @notInstrumented
2352
2602
  */
2353
- const getPrimaryWalletAccount = (client = getDefaultClient()) => {
2603
+ const getSelectedWalletAccount = (client = getDefaultClient()) => {
2354
2604
  const sortedLastSelectedWalletAccounts = getWalletAccounts(client).filter((walletAccount) => Boolean(walletAccount.lastSelectedAt)).sort((a, b) => b.lastSelectedAt.getTime() - a.lastSelectedAt.getTime());
2355
2605
  if (sortedLastSelectedWalletAccounts.length === 0) return null;
2356
- const [primaryWalletAccount] = sortedLastSelectedWalletAccounts;
2357
- return primaryWalletAccount;
2606
+ const [selectedWallet] = sortedLastSelectedWalletAccounts;
2607
+ return selectedWallet;
2358
2608
  };
2359
2609
 
2360
2610
  //#endregion
@@ -2376,9 +2626,9 @@ const getPrimaryWalletAccount = (client = getDefaultClient()) => {
2376
2626
  const unlinkSocialAccount = async ({ verifiedCredentialId }, client = getDefaultClient()) => {
2377
2627
  const core = getCore(client);
2378
2628
  const apiClient = createApiClient({ elevatedAccessTokenScope: TokenScope$1.Credentialunlink }, client);
2379
- const primaryWalletAccount = getPrimaryWalletAccount(client);
2380
- const walletId = primaryWalletAccount?.verifiedCredentialId?.replace("-zerodev", "") ?? void 0;
2381
- const isEmbeddedWallet = !!primaryWalletAccount && getVerifiedCredentialForWalletAccount({ walletAccount: primaryWalletAccount }, client)?.walletProvider === WalletProviderEnum.EmbeddedWallet;
2629
+ const selectedWallet = getSelectedWalletAccount(client);
2630
+ const walletId = selectedWallet?.verifiedCredentialId?.replace("-zerodev", "") ?? void 0;
2631
+ const isEmbeddedWallet = !!selectedWallet && getVerifiedCredentialForWalletAccount({ walletAccount: selectedWallet }, client)?.walletProvider === WalletProviderEnum.EmbeddedWallet;
2382
2632
  const response = await apiClient.verifyUnlink({
2383
2633
  environmentId: core.environmentId,
2384
2634
  verifyUnlinkRequest: {
@@ -2494,10 +2744,37 @@ const getMultichainBalances = (params, client = getDefaultClient()) => getMultic
2494
2744
  //#endregion
2495
2745
  //#region src/modules/captcha/getCaptchaSettings/getCaptchaSettings.ts
2496
2746
  /**
2747
+ * The captcha providers Dynamic can be configured to use for an environment.
2748
+ * Use it to branch on which captcha widget to render for the active provider.
2749
+ *
2750
+ * Redeclared locally (rather than re-exported directly from the generated
2751
+ * `sdk-api-core`) so the public client entry point owns its own documented,
2752
+ * stable surface for this token.
2753
+ *
2754
+ * @example
2755
+ * ```ts
2756
+ * const settings = getCaptchaSettings();
2757
+ * if (settings?.provider === CaptchaProviderEnum.Hcaptcha) {
2758
+ * renderHcaptcha(settings.siteKey);
2759
+ * }
2760
+ * ```
2761
+ * @see getCaptchaSettings
2762
+ * @see CaptchaSettingsResult
2763
+ */
2764
+ const CaptchaProviderEnum = CaptchaProviderEnum$1;
2765
+ /**
2497
2766
  * Returns the active captcha provider and site key, or undefined if captcha is not enabled.
2498
2767
  * Use this to determine which captcha widget to render and which site key to pass it.
2499
2768
  *
2769
+ * @example
2770
+ * ```ts
2771
+ * const settings = getCaptchaSettings();
2772
+ * if (settings) renderCaptcha(settings.provider, settings.siteKey);
2773
+ * ```
2774
+ * @see CaptchaSettingsResult
2775
+ * @see CaptchaProviderEnum
2500
2776
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
2777
+ * @returns The active captcha provider and site key, or undefined when captcha is not enabled.
2501
2778
  * @notInstrumented
2502
2779
  */
2503
2780
  const getCaptchaSettings = (client = getDefaultClient()) => {
@@ -2506,13 +2783,13 @@ const getCaptchaSettings = (client = getDefaultClient()) => {
2506
2783
  const { security } = projectSettings;
2507
2784
  if (security.captcha) {
2508
2785
  if (security.captcha.enabled) return {
2509
- provider: security.captcha.provider ?? CaptchaProviderEnum$1.Hcaptcha,
2786
+ provider: security.captcha.provider ?? CaptchaProviderEnum.Hcaptcha,
2510
2787
  siteKey: security.captcha.siteKey
2511
2788
  };
2512
2789
  return;
2513
2790
  }
2514
2791
  if (security.hCaptcha?.enabled) return {
2515
- provider: CaptchaProviderEnum$1.Hcaptcha,
2792
+ provider: CaptchaProviderEnum.Hcaptcha,
2516
2793
  siteKey: security.hCaptcha.siteKey
2517
2794
  };
2518
2795
  };
@@ -3076,10 +3353,59 @@ const requiresConversion = async ({ transaction }, client = getDefaultClient())
3076
3353
  return !checkout.settlementConfig.settlements.some((settlement) => settlement.chainName === transaction.fromChainName && settlement.chainId === transaction.fromChainId && settlement.tokenAddress === transaction.fromToken);
3077
3354
  };
3078
3355
 
3356
+ //#endregion
3357
+ //#region src/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/clearDeviceRegistrationRedirectParams.ts
3358
+ /**
3359
+ * Removes the device registration redirect parameters that the device
3360
+ * registration email link appends to the return URL from the browser's current
3361
+ * URL, leaving every other query parameter, the path, and the hash untouched.
3362
+ *
3363
+ * Call this once you have finished `completeDeviceRegistration` so a page
3364
+ * refresh doesn't re-trigger the registration flow. Unlike clearing the whole
3365
+ * query string, this preserves any of your own parameters on the callback URL.
3366
+ *
3367
+ * This reads and rewrites `window.location`, so it can only run in the
3368
+ * browser. Calling it during server-side rendering (no `window`) throws
3369
+ * `UnavailableInServerSideError`.
3370
+ *
3371
+ * @returns Nothing. The current URL is rewritten in place via
3372
+ * `window.history.replaceState`.
3373
+ *
3374
+ * @throws {UnavailableInServerSideError} When called without a `window`
3375
+ * (e.g. during server-side rendering).
3376
+ *
3377
+ * @example
3378
+ * ```ts
3379
+ * const deviceToken = getDeviceRegistrationTokenFromUrl({ url: window.location.href });
3380
+ * await completeDeviceRegistration({ deviceToken });
3381
+ * clearDeviceRegistrationRedirectParams();
3382
+ * ```
3383
+ *
3384
+ * @see {@link completeDeviceRegistration} to finish the registration before
3385
+ * clearing the parameters.
3386
+ * @see {@link detectDeviceRegistrationRedirect} to check whether the current
3387
+ * URL is a device registration callback.
3388
+ *
3389
+ * @notInstrumented
3390
+ */
3391
+ const clearDeviceRegistrationRedirectParams = () => {
3392
+ if (isServerSideRendering()) throw new UnavailableInServerSideError("clearDeviceRegistrationRedirectParams");
3393
+ const url = new URL(window.location.href);
3394
+ url.searchParams.delete("deviceRegistrationToken");
3395
+ window.history.replaceState({}, "", url.toString());
3396
+ };
3397
+
3079
3398
  //#endregion
3080
3399
  //#region src/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.ts
3081
3400
  const DEVICE_REGISTRATION_TOKEN_HEADER = "x-dynamic-device-registration-token";
3082
- /** @instrumented */
3401
+ /**
3402
+ * Completes device registration using the token from a device registration
3403
+ * redirect, authenticating the current device against the user's account.
3404
+ *
3405
+ * @see detectDeviceRegistrationRedirect
3406
+ * @see clearDeviceRegistrationRedirectParams
3407
+ * @instrumented
3408
+ */
3083
3409
  const completeDeviceRegistration = async ({ deviceToken }, client = getDefaultClient()) => {
3084
3410
  assertDefined(deviceToken, "deviceToken is required");
3085
3411
  const core = getCore(client);
@@ -3427,11 +3753,18 @@ const cancelFlowInstrumentation = { resolved: (flow) => ({
3427
3753
  //#endregion
3428
3754
  //#region src/modules/flow/cancelFlow/cancelFlow.ts
3429
3755
  /**
3430
- * Cancels a flow before it has been broadcasted
3756
+ * Cancels a flow before it has been broadcasted.
3757
+ *
3758
+ * @example
3759
+ * ```ts
3760
+ * const cancelledFlow = await cancelFlow({ flowId: 'flow-abc123' });
3761
+ * ```
3431
3762
  *
3432
- * @param params CancelFlowParams - The flow to cancel.
3763
+ * @param params.flowId - The unique identifier of the flow to cancel.
3433
3764
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
3434
- * @returns The cancelled flow
3765
+ * @returns A promise that resolves to the cancelled flow.
3766
+ * @see getFlow
3767
+ * @see getFlowQuote
3435
3768
  * @instrumented
3436
3769
  */
3437
3770
  const cancelFlow = async ({ flowId }, client = getDefaultClient()) => {
@@ -3464,11 +3797,19 @@ const __cancelFlow_wrapped = instrumentFunction({
3464
3797
  //#endregion
3465
3798
  //#region src/modules/flow/getFlow/getFlow.ts
3466
3799
  /**
3467
- * Fetches a flow by its ID
3800
+ * Fetches a flow by its ID.
3801
+ *
3802
+ * @example
3803
+ * ```ts
3804
+ * const flow = await getFlow({ flowId: 'flow-abc123' });
3805
+ * console.log('Flow status:', flow.status);
3806
+ * ```
3468
3807
  *
3469
- * @param params GetFlowParams - The parameters for fetching the flow.
3808
+ * @param params.flowId - The unique identifier of the flow to fetch.
3470
3809
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
3471
- * @returns The flow
3810
+ * @returns A promise that resolves to the flow object.
3811
+ * @see cancelFlow
3812
+ * @see getFlowQuote
3472
3813
  * @notInstrumented
3473
3814
  */
3474
3815
  const getFlow = async ({ flowId }, client = getDefaultClient()) => {
@@ -3482,11 +3823,24 @@ const getFlow = async ({ flowId }, client = getDefaultClient()) => {
3482
3823
  //#endregion
3483
3824
  //#region src/modules/flow/getFlowQuote/getFlowQuote.ts
3484
3825
  /**
3485
- * Fetches a quote for a flow
3826
+ * Fetches a quote for a flow.
3486
3827
  *
3487
- * @param params GetFlowQuoteParams - The quote parameters.
3828
+ * @example
3829
+ * ```ts
3830
+ * const flow = await getFlowQuote({
3831
+ * flowId: 'flow-abc123',
3832
+ * slippage: 0.5,
3833
+ * });
3834
+ * ```
3835
+ *
3836
+ * @param params.flowId - The unique identifier of the flow.
3837
+ * @param [params.fromChainId] - Optional chain ID overriding the one set at attachFlowSource time.
3838
+ * @param [params.fromTokenAddress] - Optional token address (defaults to native token).
3839
+ * @param [params.slippage] - Acceptable slippage percentage.
3488
3840
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
3489
- * @returns The updated flow with quote data
3841
+ * @returns A promise that resolves to the updated flow with quote data.
3842
+ * @see getFlow
3843
+ * @see cancelFlow
3490
3844
  * @notInstrumented
3491
3845
  */
3492
3846
  const getFlowQuote = async ({ flowId, fromChainId, fromTokenAddress, slippage }, client = getDefaultClient()) => {
@@ -4008,7 +4362,17 @@ const __getMoonPayUrl_wrapped = instrumentFunction({
4008
4362
  * Allows waiting until all modules of the client have been properly initialized
4009
4363
  * and are ready for use.
4010
4364
  *
4011
- * @returns a promise that resolves once the client is fully initialized.
4365
+ * @example
4366
+ * ```ts
4367
+ * const client = createDynamicClient({ environmentId: 'env-id' });
4368
+ * await waitForClientInitialized(client);
4369
+ * // Client is now fully ready
4370
+ * ```
4371
+ *
4372
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
4373
+ * @returns A promise that resolves once the client is fully initialized.
4374
+ * @see initializeClient
4375
+ * @see createDynamicClient
4012
4376
  * @notInstrumented
4013
4377
  * @noHook Client lifecycle management is not exposed as a hook; use useInitStatus.
4014
4378
  */
@@ -4995,9 +5359,23 @@ const __setDefaultMfaDevice_wrapped = instrumentFunction({
4995
5359
  *
4996
5360
  * Once you have the OTP code, you should then use `verifyOTP` to verify it and complete the authentication process.
4997
5361
  *
5362
+ * @example
5363
+ * ```ts
5364
+ * const { verificationUUID } = await sendEmailOTP({
5365
+ * email: 'user@example.com',
5366
+ * });
5367
+ * // Then verify with the code the user received
5368
+ * await verifyOTP({
5369
+ * otpVerification: { email: 'user@example.com', verificationUUID },
5370
+ * verificationToken: '123456',
5371
+ * });
5372
+ * ```
5373
+ *
4998
5374
  * @param params.email - The email address to send the OTP to.
4999
5375
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
5000
5376
  * @returns A promise that resolves to an OTPVerification object containing the email and verification UUID.
5377
+ * @see verifyOTP
5378
+ * @see sendSmsOTP
5001
5379
  * @instrumented
5002
5380
  */
5003
5381
  const sendEmailOTP = async ({ email }, client = getDefaultClient()) => {
@@ -5955,10 +6333,22 @@ const supportedCountries = {
5955
6333
  /**
5956
6334
  * Sends a one-time password (OTP) via SMS to the specified phone number.
5957
6335
  *
6336
+ * @example
6337
+ * ```ts
6338
+ * const { verificationUUID } = await sendSmsOTP({
6339
+ * isoCountryCode: 'US',
6340
+ * phoneNumber: '5551234567',
6341
+ * });
6342
+ * // Then verify with the code the user received
6343
+ * await verifyOTP({ otpVerification: { phoneNumber: '5551234567', verificationUUID }, verificationToken: '123456' });
6344
+ * ```
6345
+ *
5958
6346
  * @param params.isoCountryCode - The ISO country code for the phone number (e.g., 'US', 'CA', 'GB').
5959
6347
  * @param params.phoneNumber - The phone number to send the OTP to.
5960
6348
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
5961
6349
  * @returns A promise that resolves to an OTPVerification object containing the phone details and verification UUID.
6350
+ * @see verifyOTP
6351
+ * @see sendEmailOTP
5962
6352
  * @instrumented
5963
6353
  */
5964
6354
  const sendSmsOTP = async ({ isoCountryCode, phoneNumber }, client = getDefaultClient()) => {
@@ -5998,10 +6388,11 @@ const __sendSmsOTP_wrapped = instrumentFunction({
5998
6388
  //#endregion
5999
6389
  //#region src/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.ts
6000
6390
  /** @notInstrumented */
6001
- const verifyOTPForUserSignIn = async ({ otpVerification, verificationToken }, client) => {
6391
+ const verifyOTPForUserSignIn = async ({ allowNewMFALinking, otpVerification, verificationToken }, client) => {
6002
6392
  const core = getCore(client);
6003
6393
  const apiClient = createApiClient({}, client);
6004
6394
  const verifyRequest = {
6395
+ ...allowNewMFALinking !== void 0 && { allowNewMFALinking },
6005
6396
  verificationToken,
6006
6397
  verificationUUID: otpVerification.verificationUUID
6007
6398
  };
@@ -6044,13 +6435,26 @@ const verifyOTPForUserUpdate = async ({ otpVerification, verificationToken, requ
6044
6435
  * This function validates the OTP code provided by the user and completes
6045
6436
  * the verification process for either sign-in or account updates.
6046
6437
  *
6438
+ * @example
6439
+ * ```ts
6440
+ * const { verificationUUID } = await sendEmailOTP({ email: 'user@example.com' });
6441
+ * const response = await verifyOTP({
6442
+ * otpVerification: { email: 'user@example.com', verificationUUID },
6443
+ * verificationToken: '123456',
6444
+ * });
6445
+ * ```
6446
+ *
6447
+ * @param [params.allowNewMFALinking] - Whether sign-in may return a credential-link elevated token for users without MFA.
6047
6448
  * @param params.otpVerification - The OTP verification object containing verification details.
6048
6449
  * @param params.verificationToken - The token received from the OTP verification process.
6450
+ * @param [params.requestedScopes] - Optional token scopes to request during verification.
6049
6451
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
6050
6452
  * @returns A promise that resolves to the verify response object upon successful verification.
6453
+ * @see sendEmailOTP
6454
+ * @see sendSmsOTP
6051
6455
  * @instrumented
6052
6456
  */
6053
- const verifyOTP = async ({ otpVerification, verificationToken, requestedScopes }, client = getDefaultClient()) => {
6457
+ const verifyOTP = async ({ allowNewMFALinking, otpVerification, requestedScopes, verificationToken }, client = getDefaultClient()) => {
6054
6458
  preconnectWaasIframe(client);
6055
6459
  let response;
6056
6460
  if (client.user) response = await verifyOTPForUserUpdate({
@@ -6059,6 +6463,7 @@ const verifyOTP = async ({ otpVerification, verificationToken, requestedScopes }
6059
6463
  verificationToken
6060
6464
  }, client);
6061
6465
  else response = await verifyOTPForUserSignIn({
6466
+ allowNewMFALinking,
6062
6467
  otpVerification,
6063
6468
  verificationToken
6064
6469
  }, client);
@@ -6157,6 +6562,33 @@ const getSwapStatus = async (params, client = getDefaultClient()) => {
6157
6562
  }
6158
6563
  };
6159
6564
 
6565
+ //#endregion
6566
+ //#region src/modules/user/checkUserScopes/checkUserScopes.ts
6567
+ /**
6568
+ * Checks whether the given user has all the specified scopes.
6569
+ *
6570
+ * The user's `scope` field is a whitespace-separated string of granted
6571
+ * permissions (per RFC 8693 §4.2). This helper splits it and verifies that
6572
+ * every entry in `scopes` is present.
6573
+ *
6574
+ * @example
6575
+ * const user = getDefaultClient().user;
6576
+ * if (user && checkUserScopes({ user, scopes: ['wallets:read'] })) {
6577
+ * showWalletBalances();
6578
+ * }
6579
+ *
6580
+ * @param params.user - The authenticated user to check.
6581
+ * @param params.scopes - The scope strings the user must have.
6582
+ * @returns `true` if the user has every scope in `scopes`, `false` otherwise.
6583
+ * @see User
6584
+ * @see updateUser
6585
+ * @notInstrumented
6586
+ */
6587
+ const checkUserScopes = ({ scopes, user }) => {
6588
+ const grantedScopes = user.scope?.split(/\s+/).filter(Boolean) ?? [];
6589
+ return scopes.every((requiredScope) => grantedScopes.includes(requiredScope));
6590
+ };
6591
+
6160
6592
  //#endregion
6161
6593
  //#region src/modules/user/deleteUser/deleteUser.ts
6162
6594
  /**
@@ -6165,8 +6597,16 @@ const getSwapStatus = async (params, client = getDefaultClient()) => {
6165
6597
  * This function performs a hard delete of the user account. Upon successful deletion,
6166
6598
  * the user will be automatically logged out and all authentication data will be cleared.
6167
6599
  *
6600
+ * @example
6601
+ * ```ts
6602
+ * // Permanently delete the user's account
6603
+ * await deleteUser();
6604
+ * ```
6605
+ *
6168
6606
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
6169
6607
  * @returns A promise that resolves when the user account is successfully deleted.
6608
+ * @see logout
6609
+ * @see refreshUser
6170
6610
  * @instrumented
6171
6611
  */
6172
6612
  const deleteUser = async (client = getDefaultClient()) => {
@@ -7500,8 +7940,14 @@ const getAddressesWithTypesFromConnectionResult = (connectionResult) => {
7500
7940
  *
7501
7941
  * Note: This function will not verify the wallet account, use the verifyWalletAccount function to do that
7502
7942
  * or connectAndVerifyWithWalletProvider to do that in a single step.
7503
- * @see verifyWalletAccount
7504
- * @see connectAndVerifyWithWalletProvider
7943
+ *
7944
+ * @example
7945
+ * ```ts
7946
+ * const walletAccount = await connectWithWalletProvider({
7947
+ * walletProviderKey: 'metamaskevm',
7948
+ * });
7949
+ * console.log(walletAccount.address);
7950
+ * ```
7505
7951
  *
7506
7952
  * @param params.walletProviderKey - The unique key identifying the wallet provider to connect to (e.g. 'metamaskevm', 'phantomsol').
7507
7953
  * @param [params.addToDynamicWalletAccounts] - Whether to add the connected wallet account to the user's wallet accounts. Defaults to true.
@@ -7509,7 +7955,9 @@ const getAddressesWithTypesFromConnectionResult = (connectionResult) => {
7509
7955
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
7510
7956
  * @returns A promise that resolves to the connected wallet account.
7511
7957
  * @throws NoAddressFoundError If the request to connect was successful but no address is connected to your app.
7512
- * @instrumented
7958
+ * @see verifyWalletAccount
7959
+ * @see connectAndVerifyWithWalletProvider
7960
+ * @instrumented
7513
7961
  */
7514
7962
  const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWalletAccounts = true, hardwareWalletVendor }, client = getDefaultClient()) => {
7515
7963
  const walletProvider = getWalletProviderByKey({ walletProviderKey }, client);
@@ -7646,9 +8094,19 @@ const getSignInMessage = async ({ nonce: nonceOverride, walletAccount }, client)
7646
8094
  * This function generates a sign-in message and requires the user to sign it
7647
8095
  * with their wallet's private key, proving they control the wallet address.
7648
8096
  *
8097
+ * @example
8098
+ * ```ts
8099
+ * const { messageToSign, signature } = await proveWalletAccountOwnership({
8100
+ * walletAccount: wallets[0],
8101
+ * });
8102
+ * // Send signature to your backend for verification
8103
+ * ```
8104
+ *
7649
8105
  * @param params.walletAccount - The wallet account to prove ownership of.
7650
8106
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
7651
8107
  * @returns A promise that resolves to an object containing the message and signature.
8108
+ * @see signMessage
8109
+ * @see verifyWalletAccount
7652
8110
  * @instrumented
7653
8111
  */
7654
8112
  const proveWalletAccountOwnership = async ({ walletAccount }, client = getDefaultClient()) => {
@@ -7752,11 +8210,22 @@ const verifyWalletAccountForSignInOrTransfer = async ({ walletAccount, isTransfe
7752
8210
  * This function requires the user to sign a message to prove wallet ownership,
7753
8211
  * then sets the wallet account as verified.
7754
8212
  *
8213
+ * @example
8214
+ * ```ts
8215
+ * const walletAccount = await connectWithWalletProvider({
8216
+ * walletProviderKey: 'metamaskevm',
8217
+ * });
8218
+ * const verified = await verifyWalletAccount({ walletAccount });
8219
+ * ```
8220
+ *
7755
8221
  * @param params.walletAccount - The wallet account to verify ownership of.
8222
+ * @param [params.requestedScopes] - Optional token scopes to request during verification.
7756
8223
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
7757
8224
  * @returns A promise that resolves to the verified wallet account.
7758
8225
  * @throws WalletAccountAlreadyVerifiedError If the wallet is already verified.
7759
8226
  * @throws WalletAlreadyLinkedToAnotherUserError If the wallet is linked to another user.
8227
+ * @see connectWithWalletProvider
8228
+ * @see connectAndVerifyWithWalletProvider
7760
8229
  * @instrumented
7761
8230
  */
7762
8231
  const verifyWalletAccount = async ({ walletAccount, requestedScopes }, client = getDefaultClient()) => {
@@ -7806,10 +8275,20 @@ const isDeeplinkWalletProvider = ({ walletProvider }) => walletProvider.walletPr
7806
8275
  * `verifyWalletAccount` separately from a new user gesture (e.g. a "Verify
7807
8276
  * Ownership" button).
7808
8277
  *
8278
+ * @example
8279
+ * ```ts
8280
+ * const walletAccount = await connectAndVerifyWithWalletProvider({
8281
+ * walletProviderKey: 'metamaskevm',
8282
+ * });
8283
+ * console.log('Verified address:', walletAccount.address);
8284
+ * ```
8285
+ *
7809
8286
  * @param params.walletProviderKey - The unique key identifying the wallet provider to connect to.
7810
8287
  * @param [params.hardwareWalletVendor] - The hardware wallet vendor, if connecting via a hardware wallet (e.g. 'ledger').
7811
8288
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
7812
8289
  * @returns A promise that resolves to the connected and verified wallet account.
8290
+ * @see connectWithWalletProvider
8291
+ * @see verifyWalletAccount
7813
8292
  * @instrumented
7814
8293
  */
7815
8294
  const connectAndVerifyWithWalletProvider = async ({ walletProviderKey, hardwareWalletVendor }, client = getDefaultClient()) => {
@@ -7871,9 +8350,17 @@ const getAvailableWalletProvidersData = (client = getDefaultClient()) => {
7871
8350
  * This function returns the list of wallet addresses that are currently
7872
8351
  * connected and available through the specified wallet provider.
7873
8352
  *
8353
+ * @example
8354
+ * ```ts
8355
+ * const addresses = getConnectedAddresses({ walletProviderKey: 'metamaskevm' });
8356
+ * console.log('Connected:', addresses);
8357
+ * ```
8358
+ *
7874
8359
  * @param params.walletProviderKey - The unique key of the wallet provider to query.
7875
8360
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
7876
8361
  * @returns An array of connected wallet addresses.
8362
+ * @see connectWithWalletProvider
8363
+ * @see getWalletAccounts
7877
8364
  * @notInstrumented
7878
8365
  */
7879
8366
  const getConnectedAddresses = ({ walletProviderKey }, client = getDefaultClient()) => {
@@ -7954,8 +8441,17 @@ const isHardwareWalletAccount = ({ walletAccount }) => walletAccount.hardwareWal
7954
8441
  * else your app considers "signed in" (e.g. `client.user`, completed onboarding,
7955
8442
  * a required embedded wallet, …).
7956
8443
  *
8444
+ * @example
8445
+ * ```ts
8446
+ * if (isAnyWalletAccountConnected()) {
8447
+ * console.log('At least one wallet is connected');
8448
+ * }
8449
+ * ```
8450
+ *
7957
8451
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
7958
8452
  * @returns True if the session has at least one wallet account, false otherwise.
8453
+ * @see getWalletAccounts
8454
+ * @see isWalletAccountVerified
7959
8455
  * @notInstrumented
7960
8456
  */
7961
8457
  const isAnyWalletAccountConnected = (client = getDefaultClient()) => getWalletAccounts(client).length > 0;
@@ -7965,8 +8461,16 @@ const isAnyWalletAccountConnected = (client = getDefaultClient()) => getWalletAc
7965
8461
  /**
7966
8462
  * Checks if a wallet account has been verified by a user.
7967
8463
  *
7968
- * @param walletAccount - The wallet account to check.
8464
+ * @example
8465
+ * ```ts
8466
+ * const wallets = getWalletAccounts();
8467
+ * const verified = wallets.filter(w => isWalletAccountVerified({ walletAccount: w }));
8468
+ * ```
8469
+ *
8470
+ * @param params.walletAccount - The wallet account to check.
7969
8471
  * @returns True if the wallet account has been verified, false otherwise.
8472
+ * @see verifyWalletAccount
8473
+ * @see getWalletAccounts
7970
8474
  * @notInstrumented
7971
8475
  */
7972
8476
  const isWalletAccountVerified = ({ walletAccount }) => {
@@ -8056,9 +8560,17 @@ const getActiveNetworkId = ({ walletAccount }, client = getDefaultClient()) => {
8056
8560
  * {@link getTokenBalances}; for a multi-chain portfolio snapshot, use
8057
8561
  * {@link getMultichainTokenBalances}.
8058
8562
  *
8563
+ * @example
8564
+ * ```ts
8565
+ * const { balance } = await getNativeBalance({ walletAccount: wallets[0] });
8566
+ * console.log('Native balance:', balance);
8567
+ * ```
8568
+ *
8059
8569
  * @param params.walletAccount - The wallet account to get the balance for.
8060
8570
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8061
8571
  * @returns A promise that resolves to an object containing the balance as a string or null.
8572
+ * @see getMultichainTokenBalances
8573
+ * @see switchActiveNetwork
8062
8574
  * @notInstrumented
8063
8575
  */
8064
8576
  const getNativeBalance = async ({ walletAccount }, client = getDefaultClient()) => {
@@ -8078,6 +8590,14 @@ const getNativeBalance = async ({ walletAccount }, client = getDefaultClient())
8078
8590
  * with the token-balance fetchers (`getTokenBalances` /
8079
8591
  * `getMultichainTokenBalances`).
8080
8592
  *
8593
+ * @example
8594
+ * ```ts
8595
+ * // Prefer getNativeBalance instead
8596
+ * const balance = await getNativeBalance({ walletAccount });
8597
+ * ```
8598
+ *
8599
+ * @see getNativeBalance
8600
+ * @see getMultichainBalances
8081
8601
  * @notInstrumented
8082
8602
  * @noHook Deprecated; the replacement is exposed via its own hook.
8083
8603
  */
@@ -8163,11 +8683,21 @@ const isProgrammaticNetworkSwitchAvailable = ({ walletAccount }, client = getDef
8163
8683
  * This function programmatically changes the network
8164
8684
  * that the wallet is currently connected to.
8165
8685
  *
8686
+ * @example
8687
+ * ```ts
8688
+ * await switchActiveNetwork({
8689
+ * walletAccount: wallets[0],
8690
+ * networkId: '137', // Polygon
8691
+ * });
8692
+ * ```
8693
+ *
8166
8694
  * @param params.networkId - The identifier of the network to switch to. Should match the networkId of the network data.
8167
8695
  * @param params.walletAccount - The wallet account to switch networks for.
8168
8696
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8169
8697
  * @returns A promise that resolves when the network switch is complete.
8170
8698
  * @throws NetworkSwitchingUnavailableError If the wallet provider doesn't support network switching.
8699
+ * @see getNativeBalance
8700
+ * @see isProgrammaticNetworkSwitchAvailable
8171
8701
  * @instrumented
8172
8702
  */
8173
8703
  const switchActiveNetwork = async ({ networkId, walletAccount }, client = getDefaultClient()) => {
@@ -8193,15 +8723,37 @@ const __switchActiveNetwork_wrapped = instrumentFunction({
8193
8723
  });
8194
8724
 
8195
8725
  //#endregion
8196
- //#region src/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.ts
8726
+ //#region src/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/setSelectedWalletAccount.ts
8197
8727
  /**
8198
- * Make the wallet account provided as the primary wallet account.
8728
+ * Set the wallet account that is currently selected for the user.
8729
+ *
8730
+ * The SDK itself does not use or care about which wallet is "selected" — this
8731
+ * only records the selection (updating the backend `lastSelectedAt` and, for
8732
+ * verified wallets, persisting it server-side) so it can later be read back via
8733
+ * `getSelectedWalletAccount`. It has no bearing on authentication or signing.
8734
+ * Applications that need a notion of an active/current wallet should own that
8735
+ * selection state themselves.
8736
+ *
8737
+ * The one exception is the wagmi integration (`@dynamic-labs-sdk/wagmi`), which
8738
+ * relies on the selected EVM wallet.
8739
+ *
8740
+ * @example
8741
+ * ```ts
8742
+ * const wallets = getWalletAccounts();
8743
+ * await setSelectedWalletAccount({ walletAccount: wallets[1] });
8744
+ * ```
8745
+ *
8746
+ * @param params.walletAccount - The wallet account to mark as selected.
8747
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8748
+ * @returns A promise that resolves when the selection is persisted.
8749
+ * @see getSelectedWalletAccount
8750
+ * @see getWalletAccounts
8199
8751
  * @instrumented
8200
- * @noHook The primary-wallet concept is discouraged and not exposed as a hook.
8752
+ * @noHook The selected-wallet concept is not exposed as a hook.
8201
8753
  */
8202
- const selectPrimaryWalletAccount = async ({ walletAccount }, client = getDefaultClient()) => {
8754
+ const setSelectedWalletAccount = async ({ walletAccount }, client = getDefaultClient()) => {
8203
8755
  const core = getCore(client);
8204
- if (getPrimaryWalletAccount(client)?.id === walletAccount.id) return;
8756
+ if (getSelectedWalletAccount(client)?.id === walletAccount.id) return;
8205
8757
  if (walletAccount.verifiedCredentialId) updateAuthFromVerifyResponse({ response: await createApiClient({}, client).selectUserWallet({
8206
8758
  environmentId: core.environmentId,
8207
8759
  userWalletSelectionRequest: { walletId: walletAccount.verifiedCredentialId }
@@ -8211,6 +8763,68 @@ const selectPrimaryWalletAccount = async ({ walletAccount }, client = getDefault
8211
8763
  lastSelectedAt: /* @__PURE__ */ new Date()
8212
8764
  }] }, client);
8213
8765
  };
8766
+ const __setSelectedWalletAccount_impl = setSelectedWalletAccount;
8767
+ const __setSelectedWalletAccount_wrapped = instrumentFunction({
8768
+ fn: __setSelectedWalletAccount_impl,
8769
+ functionName: "setSelectedWalletAccount",
8770
+ getCore: () => {
8771
+ try {
8772
+ return getCore(getDefaultClient());
8773
+ } catch {
8774
+ return;
8775
+ }
8776
+ }
8777
+ });
8778
+
8779
+ //#endregion
8780
+ //#region src/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.ts
8781
+ /**
8782
+ * Get the primary wallet account.
8783
+ *
8784
+ * @deprecated Renamed to `getSelectedWalletAccount`. The "primary wallet" naming was
8785
+ * misleading — the SDK does not use or care about which wallet is selected; it
8786
+ * only lets you *read* the user's most recently selected wallet. Migrate to
8787
+ * `getSelectedWalletAccount`, and own your own wallet-selection state in your
8788
+ * application rather than relying on the SDK's selected wallet.
8789
+ *
8790
+ * @example
8791
+ * ```ts
8792
+ * const primary = getPrimaryWalletAccount();
8793
+ * if (primary) {
8794
+ * console.log('Primary wallet:', primary.address);
8795
+ * }
8796
+ * ```
8797
+ *
8798
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8799
+ * @returns The primary wallet account, or null if no wallet has been selected.
8800
+ * @notInstrumented
8801
+ */
8802
+ const getPrimaryWalletAccount = (client = getDefaultClient()) => getSelectedWalletAccount(client);
8803
+
8804
+ //#endregion
8805
+ //#region src/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.ts
8806
+ /**
8807
+ * Make the wallet account provided as the primary wallet account.
8808
+ *
8809
+ * @deprecated Renamed to `setSelectedWalletAccount`. The "primary wallet" naming was
8810
+ * misleading — the SDK does not use or care about which wallet is selected;
8811
+ * this only records the selection so it can later be read back. Migrate to
8812
+ * `setSelectedWalletAccount`, and own your own wallet-selection state in your
8813
+ * application rather than relying on the SDK's selected wallet.
8814
+ *
8815
+ * @example
8816
+ * ```ts
8817
+ * const wallets = getWalletAccounts();
8818
+ * await selectPrimaryWalletAccount({ walletAccount: wallets[1] });
8819
+ * ```
8820
+ *
8821
+ * @param params.walletAccount - The wallet account to set as primary.
8822
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8823
+ * @returns A promise that resolves when the selection is persisted.
8824
+ * @instrumented
8825
+ * @noHook The selected-wallet concept is not exposed as a hook.
8826
+ */
8827
+ const selectPrimaryWalletAccount = async ({ walletAccount }, client = getDefaultClient()) => __setSelectedWalletAccount_wrapped({ walletAccount }, client);
8214
8828
  const __selectPrimaryWalletAccount_impl = selectPrimaryWalletAccount;
8215
8829
  const __selectPrimaryWalletAccount_wrapped = instrumentFunction({
8216
8830
  fn: __selectPrimaryWalletAccount_impl,
@@ -8227,10 +8841,23 @@ const __selectPrimaryWalletAccount_wrapped = instrumentFunction({
8227
8841
  //#endregion
8228
8842
  //#region src/modules/wallets/disconnectWalletAccount/disconnectWalletAccount.ts
8229
8843
  /**
8230
- * This function disconnects the specified wallet account with the wallet provider.
8844
+ * Disconnects the specified wallet account from its wallet provider.
8231
8845
  *
8232
- * The wallet account is not removed from the user's profile or from dynamic's state,
8846
+ * The wallet account is not removed from the user's profile or from Dynamic's state,
8233
8847
  * it is only responsible for terminating the connection with the wallet provider.
8848
+ * Use `removeWalletAccount` to fully remove a wallet from the user's session.
8849
+ *
8850
+ * @example
8851
+ * ```ts
8852
+ * const wallets = getWalletAccounts();
8853
+ * await disconnectWalletAccount({ walletAccount: wallets[0] }, client);
8854
+ * ```
8855
+ *
8856
+ * @param params.walletAccount - The wallet account to disconnect.
8857
+ * @param client - The Dynamic client instance.
8858
+ * @returns A promise that resolves when the wallet is disconnected from the provider.
8859
+ * @see removeWalletAccount
8860
+ * @see connectWithWalletProvider
8234
8861
  * @notInstrumented
8235
8862
  */
8236
8863
  const disconnectWalletAccount = async ({ walletAccount }, client) => {
@@ -8251,9 +8878,17 @@ const disconnectWalletAccount = async ({ walletAccount }, client) => {
8251
8878
  * updating local state and server records (if there is an authenticated user).
8252
8879
  * For verified wallets, it will unlink them from the user's account.
8253
8880
  *
8881
+ * @example
8882
+ * ```ts
8883
+ * const wallets = getWalletAccounts();
8884
+ * await removeWalletAccount({ walletAccount: wallets[0] });
8885
+ * ```
8886
+ *
8254
8887
  * @param params.walletAccount - The wallet account to remove.
8255
8888
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8256
8889
  * @returns A promise that resolves when the wallet account is successfully removed.
8890
+ * @see getWalletAccounts
8891
+ * @see disconnectWalletAccount
8257
8892
  * @instrumented
8258
8893
  */
8259
8894
  const removeWalletAccount = async ({ walletAccount }, client = getDefaultClient()) => {
@@ -8290,10 +8925,21 @@ const __removeWalletAccount_wrapped = instrumentFunction({
8290
8925
  * This function uses the wallet's private key to cryptographically sign
8291
8926
  * the provided message.
8292
8927
  *
8928
+ * @example
8929
+ * ```ts
8930
+ * const wallets = getWalletAccounts();
8931
+ * const { signature } = await signMessage({
8932
+ * walletAccount: wallets[0],
8933
+ * message: 'Hello Dynamic!',
8934
+ * });
8935
+ * ```
8936
+ *
8293
8937
  * @param params.walletAccount - The wallet account to use for signing.
8294
8938
  * @param params.message - The message to sign.
8295
8939
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8296
8940
  * @returns A promise that resolves to an object containing the signature.
8941
+ * @see getWalletAccounts
8942
+ * @see connectWithWalletProvider
8297
8943
  * @instrumented
8298
8944
  */
8299
8945
  const signMessage = async ({ walletAccount, message }, client = getDefaultClient()) => {
@@ -8326,13 +8972,24 @@ const __signMessage_wrapped = instrumentFunction({
8326
8972
  * Supports native token transfers and, where supported by the chain,
8327
8973
  * fungible/token transfers via the optional `token` parameter.
8328
8974
  *
8975
+ * @example
8976
+ * ```ts
8977
+ * const { transactionHash } = await transferAmount({
8978
+ * walletAccount: wallets[0],
8979
+ * amount: '0.1',
8980
+ * recipient: '0x1234...abcd',
8981
+ * });
8982
+ * ```
8983
+ *
8329
8984
  * @param params.walletAccount - The wallet account to transfer from.
8330
8985
  * @param params.amount - The amount to transfer as a decimal string (e.g. "1.5").
8331
8986
  * @param params.recipient - The recipient address.
8332
- * @param params.token - Optional token info for non-native transfers.
8987
+ * @param [params.token] - Optional token info for non-native transfers.
8333
8988
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8334
8989
  * @returns A promise that resolves to an object containing the transaction hash.
8335
8990
  * @throws If the wallet provider does not support the transfer amount method.
8991
+ * @see getWalletAccounts
8992
+ * @see signMessage
8336
8993
  * @instrumented
8337
8994
  */
8338
8995
  const transferAmount = async ({ walletAccount, amount, recipient, token }, client = getDefaultClient()) => {
@@ -8367,9 +9024,18 @@ const __transferAmount_wrapped = instrumentFunction({
8367
9024
  * This function requires the user to sign a message to prove wallet ownership,
8368
9025
  * then transfers the wallet account to the current user's account.
8369
9026
  *
9027
+ * @example
9028
+ * ```ts
9029
+ * const walletAccount = await transferWalletAccount({
9030
+ * walletProviderKey: 'metamaskevm',
9031
+ * });
9032
+ * ```
9033
+ *
8370
9034
  * @param params.walletProviderKey - The key of the wallet provider of the wallet account to transfer.
8371
9035
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8372
9036
  * @returns A promise that resolves to the transferred wallet account.
9037
+ * @see connectWithWalletProvider
9038
+ * @see verifyWalletAccount
8373
9039
  * @instrumented
8374
9040
  */
8375
9041
  const transferWalletAccount = async ({ walletProviderKey }, client = getDefaultClient()) => {
@@ -8402,10 +9068,20 @@ const __transferWalletAccount_wrapped = instrumentFunction({
8402
9068
  * This function searches through the current session's wallet accounts
8403
9069
  * to find one matching the specified address and chain.
8404
9070
  *
9071
+ * @example
9072
+ * ```ts
9073
+ * const account = getWalletAccountFromAddress({
9074
+ * address: '0x1234...abcd',
9075
+ * chain: 'EVM',
9076
+ * });
9077
+ * ```
9078
+ *
8405
9079
  * @param params.address - The wallet address to search for.
8406
9080
  * @param params.chain - The blockchain the wallet belongs to.
8407
9081
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8408
9082
  * @returns The matching wallet account, or undefined if not found.
9083
+ * @see getWalletAccounts
9084
+ * @see isWalletAccountVerified
8409
9085
  * @notInstrumented
8410
9086
  */
8411
9087
  const getWalletAccountFromAddress = ({ address, chain }, client = getDefaultClient()) => {
@@ -8564,5 +9240,5 @@ const parseUserAgent = ({ userAgent }) => {
8564
9240
  assertPackageVersion(name, version);
8565
9241
 
8566
9242
  //#endregion
8567
- export { BaseError, CaptchaProviderEnum, CheckoutSessionTokenMissingError, ClientAlreadyInitializedError, DeeplinkConnectAndVerifyUnsupportedError, DeviceRegistrationIdentityMismatchError, FeeEstimationFailedError, FlowSessionTokenMissingError, GOOGLE_DRIVE_BACKUP_REQUIRED_SCOPES, InvalidDeviceRegistrationRedirectError, InvalidExternalAuthError, InvalidParamError, InvalidRedirectStorageStateError, InvalidSocialCallbackOriginError, JwtVerifiedCredentialFormatEnum, LinkCredentialError, MFAAction, MfaInvalidOtpError, MfaRateLimitedError, MissingRedirectStorageStateError, MissingSocialUrlParamError, MissingUserVerificationError, NetworkAddingUnavailableError, NetworkNotAddedError, NetworkSwitchingUnavailableError, NoAddressFoundError, NoNetworkProvidersError, NoPasskeyCredentialsFoundError, NoSmartWalletAccountSignerFoundError, NoWebAuthNSupportError, NotWaasWalletAccountError, ProviderEnum, SandboxMaximumThresholdReachedError, SimulationFailedError, TokenScope, TokenSwapError, UnauthorizedError, UnavailableInServerSideError, UnrecognizedNetworkError, UserCancelledSocialPopUpError, UserNotAuthenticatedError, UserRejectedError, WaasOnboardingIncompleteError, WalletAccountAlreadyVerifiedError, WalletAccountNotSelectedError, WalletAlreadyLinkedToAnotherUserError, WalletProviderMethodUnavailableError, WalletScreeningBlockedError, __acknowledgeRecoveryCodes_wrapped as acknowledgeRecoveryCodes, addCoinbaseOnrampOrderEventListener, __addNetwork_wrapped as addNetwork, appendConnectionUriToDeeplink, assertWalletAccountSigningAvailability, assertWalletProviderMethodDefined, __attachCheckoutTransactionSource_wrapped as attachCheckoutTransactionSource, __attachFlowSource_wrapped as attachFlowSource, authenticateMfaRecoveryCode, authenticatePasskeyMFA, authenticateTotpMfaDevice, __authenticateWithSocial_wrapped as authenticateWithSocial, __broadcastCheckoutTransaction_wrapped as broadcastCheckoutTransaction, __broadcastFlow_wrapped as broadcastFlow, canConnectWithHardwareWallet, __cancelCheckoutTransaction_wrapped as cancelCheckoutTransaction, __cancelFlow_wrapped as cancelFlow, __checkStepUpAuth_wrapped as checkStepUpAuth, __completeDeviceRegistration_wrapped as completeDeviceRegistration, __completeSocialAuthentication_wrapped as completeSocialAuthentication, __completeSocialRedirect_wrapped as completeSocialRedirect, __confirmTransaction_wrapped as confirmTransaction, __connectAndVerifyWithWalletProvider_wrapped as connectAndVerifyWithWalletProvider, __connectWithWalletProvider_wrapped as connectWithWalletProvider, __consumeMfaToken_wrapped as consumeMfaToken, __createCheckoutTransaction_wrapped as createCheckoutTransaction, __createCoinbaseOnrampOrder_wrapped as createCoinbaseOnrampOrder, __createCryptoDotComPayment_wrapped as createCryptoDotComPayment, __createDynamicClient_wrapped as createDynamicClient, createKrakenExchangeTransfer, __createNewMfaRecoveryCodes_wrapped as createNewMfaRecoveryCodes, __deleteMfaDevice_wrapped as deleteMfaDevice, __deletePasskey_wrapped as deletePasskey, __deleteUser_wrapped as deleteUser, detectDeviceRegistrationRedirect, detectOAuthRedirect, detectSocialRedirectUrl, excludeInstalledFromCatalog, __executeSwapTransaction_wrapped as executeSwapTransaction, fetchProjectSettings, findMissingGoogleDriveBackupScopes, getActiveNetworkData, getActiveNetworkId, getAvailableWalletProvidersData, getBalance, getBalanceForAddress, getBalances, getCaptchaSettings, getCheckoutTransaction, getCheckoutTransactionQuote, getCoinbaseBuyUrl, getConnectedAddresses, getDefaultClient, getDeviceRegistrationTokenFromUrl, getElevatedAccessToken, getFlow, getFlowQuote, __getGoogleDriveBackupReadiness_wrapped as getGoogleDriveBackupReadiness, getInstallationLinkForCurrentPlatform, getKrakenAccounts, getKrakenWhitelistedAddresses, getMfaDevices, getMfaMethods, getMfaRecoveryCodes, getMissingVerificationForCoinbaseOnrampOrder, __getMoonPayCurrencies_wrapped as getMoonPayCurrencies, __getMoonPayUrl_wrapped as getMoonPayUrl, getMultichainBalances, getMultichainTokenBalances, getNativeBalance, getNetworksData, getOwnerWalletAccountForSmartWalletAccount, getPasskeys, getPrimaryWalletAccount, getRegisteredDevices, getSwapQuote, getSwapStatus, getTokenBalances, getTransactionHistory, getUserSocialAccounts, getWalletAccountAddressByType, getWalletAccountFromAddress, getWalletAccounts, getWalletConnectCatalog, getWalletConnectCatalogWalletByWalletProviderKey, getWalletOptionsCatalogue, getWalletProviderDataByKey, hasAllGoogleDriveBackupScopes, hasExtension, __initializeClient_wrapped as initializeClient, isAnyWalletAccountConnected, isCaptchaRequired, isDeeplinkWalletProvider, isDeviceRegistrationRequired, isHardwareWalletAccount, isInsufficientGoogleDriveScopesError, isMfaRequiredForAction, isMobile, isPendingRecoveryCodesAcknowledgment, isProgrammaticNetworkSwitchAvailable, isSignedIn, isUserMissingMfaAuth, isUserOnboardingComplete, isWalletAccountVerified, logout, matchWalletProvidersToCatalogGroup, offEvent, offWalletProviderEvent, onEvent, onWalletProviderEvent, onceEvent, parseUserAgent, __prepareCheckoutTransaction_wrapped as prepareCheckoutTransaction, __prepareFlowSigning_wrapped as prepareFlowSigning, __proveWalletAccountOwnership_wrapped as proveWalletAccountOwnership, __refreshAuth_wrapped as refreshAuth, __refreshUser_wrapped as refreshUser, __registerPasskey_wrapped as registerPasskey, __registerTotpMfaDevice_wrapped as registerTotpMfaDevice, __removeWalletAccount_wrapped as removeWalletAccount, __requestExternalAuthElevatedToken_wrapped as requestExternalAuthElevatedToken, requiresConversion, __revokeAllRegisteredDevices_wrapped as revokeAllRegisteredDevices, __revokeRegisteredDevice_wrapped as revokeRegisteredDevice, __selectPrimaryWalletAccount_wrapped as selectPrimaryWalletAccount, __sendEmailOTP_wrapped as sendEmailOTP, __sendSmsOTP_wrapped as sendSmsOTP, __setCaptchaToken_wrapped as setCaptchaToken, __setDefaultMfaDevice_wrapped as setDefaultMfaDevice, __setInstrumentationEnabled_wrapped as setInstrumentationEnabled, __signInWithExternalJwt_wrapped as signInWithExternalJwt, __signInWithPasskey_wrapped as signInWithPasskey, __signInWithSocialPopUp_wrapped as signInWithSocialPopUp, __signInWithSocialRedirect_wrapped as signInWithSocialRedirect, __signMessage_wrapped as signMessage, __submitCheckoutTransaction_wrapped as submitCheckoutTransaction, __submitFlowTransaction_wrapped as submitFlowTransaction, supportedCountries, __switchActiveNetwork_wrapped as switchActiveNetwork, trackCheckoutTransaction, __transferAmount_wrapped as transferAmount, __transferWalletAccount_wrapped as transferWalletAccount, __unlinkSocialAccount_wrapped as unlinkSocialAccount, __updateUser_wrapped as updateUser, __verifyOTP_wrapped as verifyOTP, __verifyWalletAccount_wrapped as verifyWalletAccount, waitForClientInitialized };
9243
+ export { BaseError, CaptchaProviderEnum, CheckoutSessionTokenMissingError, ClientAlreadyInitializedError, DeeplinkConnectAndVerifyUnsupportedError, DeviceRegistrationIdentityMismatchError, FeeEstimationFailedError, FlowSessionTokenMissingError, GOOGLE_DRIVE_BACKUP_REQUIRED_SCOPES, InvalidDeviceRegistrationRedirectError, InvalidExternalAuthError, InvalidParamError, InvalidRedirectStorageStateError, InvalidSocialCallbackOriginError, JwtVerifiedCredentialFormatEnum, LinkCredentialError, MFAAction, MergeAccountsConfirmationError, MfaInvalidOtpError, MfaRateLimitedError, MissingRedirectStorageStateError, MissingSocialUrlParamError, MissingUserVerificationError, NetworkAddingUnavailableError, NetworkNotAddedError, NetworkSwitchingUnavailableError, NoAddressFoundError, NoNetworkProvidersError, NoPasskeyCredentialsFoundError, NoSmartWalletAccountSignerFoundError, NoWebAuthNSupportError, NotWaasWalletAccountError, ProviderEnum, SandboxMaximumThresholdReachedError, SimulationFailedError, TokenScope, TokenSwapError, UnauthorizedError, UnavailableInServerSideError, UnrecognizedNetworkError, UserCancelledSocialPopUpError, UserNotAuthenticatedError, UserRejectedError, WaasOnboardingIncompleteError, WalletAccountAlreadyVerifiedError, WalletAccountNotSelectedError, WalletAlreadyLinkedToAnotherUserError, WalletProviderMethodUnavailableError, WalletScreeningBlockedError, __acknowledgeRecoveryCodes_wrapped as acknowledgeRecoveryCodes, addCoinbaseOnrampOrderEventListener, __addNetwork_wrapped as addNetwork, appendConnectionUriToDeeplink, assertWalletAccountSigningAvailability, assertWalletProviderMethodDefined, __attachCheckoutTransactionSource_wrapped as attachCheckoutTransactionSource, __attachFlowSource_wrapped as attachFlowSource, authenticateMfaRecoveryCode, authenticatePasskeyMFA, authenticateTotpMfaDevice, __authenticateWithSocial_wrapped as authenticateWithSocial, __broadcastCheckoutTransaction_wrapped as broadcastCheckoutTransaction, __broadcastFlow_wrapped as broadcastFlow, canConnectWithHardwareWallet, __cancelCheckoutTransaction_wrapped as cancelCheckoutTransaction, __cancelFlow_wrapped as cancelFlow, __checkStepUpAuth_wrapped as checkStepUpAuth, checkUserScopes, clearDeviceRegistrationRedirectParams, clearSocialRedirectParams, __completeDeviceRegistration_wrapped as completeDeviceRegistration, __completeSocialAuthentication_wrapped as completeSocialAuthentication, __completeSocialRedirect_wrapped as completeSocialRedirect, __confirmTransaction_wrapped as confirmTransaction, __connectAndVerifyWithWalletProvider_wrapped as connectAndVerifyWithWalletProvider, __connectWithWalletProvider_wrapped as connectWithWalletProvider, __consumeMfaToken_wrapped as consumeMfaToken, __createCheckoutTransaction_wrapped as createCheckoutTransaction, __createCoinbaseOnrampOrder_wrapped as createCoinbaseOnrampOrder, __createCryptoDotComPayment_wrapped as createCryptoDotComPayment, __createDynamicClient_wrapped as createDynamicClient, createKrakenExchangeTransfer, __createNewMfaRecoveryCodes_wrapped as createNewMfaRecoveryCodes, __deleteMfaDevice_wrapped as deleteMfaDevice, __deletePasskey_wrapped as deletePasskey, __deleteUser_wrapped as deleteUser, detectDeviceRegistrationRedirect, detectOAuthRedirect, detectSocialRedirectUrl, excludeInstalledFromCatalog, __executeSwapTransaction_wrapped as executeSwapTransaction, fetchProjectSettings, findMissingGoogleDriveBackupScopes, getActiveNetworkData, getActiveNetworkId, getAvailableWalletProvidersData, getBalance, getBalanceForAddress, getBalances, getCaptchaSettings, getCheckoutTransaction, getCheckoutTransactionQuote, getCoinbaseBuyUrl, getConnectedAddresses, getDefaultClient, getDeviceRegistrationTokenFromUrl, getElevatedAccessToken, getFlow, getFlowQuote, __getGoogleDriveBackupReadiness_wrapped as getGoogleDriveBackupReadiness, getInstallationLinkForCurrentPlatform, getKrakenAccounts, getKrakenWhitelistedAddresses, getMfaDevices, getMfaMethods, getMfaRecoveryCodes, getMissingVerificationForCoinbaseOnrampOrder, __getMoonPayCurrencies_wrapped as getMoonPayCurrencies, __getMoonPayUrl_wrapped as getMoonPayUrl, getMultichainBalances, getMultichainTokenBalances, getNativeBalance, getNetworksData, getOwnerWalletAccountForSmartWalletAccount, getPasskeys, getPrimaryWalletAccount, getRegisteredDevices, getSelectedWalletAccount, getSwapQuote, getSwapStatus, getTokenBalances, getTransactionHistory, getUserSocialAccounts, getWalletAccountAddressByType, getWalletAccountFromAddress, getWalletAccounts, getWalletConnectCatalog, getWalletConnectCatalogWalletByWalletProviderKey, getWalletOptionsCatalogue, getWalletProviderDataByKey, hasAllGoogleDriveBackupScopes, hasExtension, __initializeClient_wrapped as initializeClient, isAnyWalletAccountConnected, isCaptchaRequired, isDeeplinkWalletProvider, isDeviceRegistrationRequired, isHardwareWalletAccount, isInsufficientGoogleDriveScopesError, isMfaRequiredForAction, isMobile, isPendingRecoveryCodesAcknowledgment, isProgrammaticNetworkSwitchAvailable, isSignedIn, isUserMissingMfaAuth, isUserOnboardingComplete, isWalletAccountVerified, logout, matchWalletProvidersToCatalogGroup, mergeUserAccounts, offEvent, offWalletProviderEvent, onEvent, onWalletProviderEvent, onceEvent, parseUserAgent, __prepareCheckoutTransaction_wrapped as prepareCheckoutTransaction, __prepareFlowSigning_wrapped as prepareFlowSigning, __proveWalletAccountOwnership_wrapped as proveWalletAccountOwnership, __refreshAuth_wrapped as refreshAuth, __refreshUser_wrapped as refreshUser, __registerPasskey_wrapped as registerPasskey, __registerTotpMfaDevice_wrapped as registerTotpMfaDevice, __removeWalletAccount_wrapped as removeWalletAccount, __requestExternalAuthElevatedToken_wrapped as requestExternalAuthElevatedToken, requiresConversion, __revokeAllRegisteredDevices_wrapped as revokeAllRegisteredDevices, __revokeRegisteredDevice_wrapped as revokeRegisteredDevice, __selectPrimaryWalletAccount_wrapped as selectPrimaryWalletAccount, __sendEmailOTP_wrapped as sendEmailOTP, __sendSmsOTP_wrapped as sendSmsOTP, __setCaptchaToken_wrapped as setCaptchaToken, __setDefaultMfaDevice_wrapped as setDefaultMfaDevice, __setInstrumentationEnabled_wrapped as setInstrumentationEnabled, __setSelectedWalletAccount_wrapped as setSelectedWalletAccount, __signInWithExternalJwt_wrapped as signInWithExternalJwt, __signInWithPasskey_wrapped as signInWithPasskey, __signInWithSocialPopUp_wrapped as signInWithSocialPopUp, __signInWithSocialRedirect_wrapped as signInWithSocialRedirect, __signMessage_wrapped as signMessage, __submitCheckoutTransaction_wrapped as submitCheckoutTransaction, __submitFlowTransaction_wrapped as submitFlowTransaction, supportedCountries, __switchActiveNetwork_wrapped as switchActiveNetwork, trackCheckoutTransaction, __transferAmount_wrapped as transferAmount, __transferWalletAccount_wrapped as transferWalletAccount, __unlinkSocialAccount_wrapped as unlinkSocialAccount, __updateUser_wrapped as updateUser, __verifyOTP_wrapped as verifyOTP, __verifyWalletAccount_wrapped as verifyWalletAccount, waitForClientInitialized };
8568
9244
  //# sourceMappingURL=index.esm.js.map