@dynamic-labs-sdk/client 1.18.0 → 1.19.1

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 (248) 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-CEs4SGW4.esm.js → getNetworkProviderFromNetworkId-Ct6nH2tC.esm.js} +106 -21
  23. package/dist/getNetworkProviderFromNetworkId-Ct6nH2tC.esm.js.map +1 -0
  24. package/dist/{getNetworkProviderFromNetworkId-C6DBO0OX.native.esm.js → getNetworkProviderFromNetworkId-DL6OXPUn.native.esm.js} +90 -9
  25. package/dist/getNetworkProviderFromNetworkId-DL6OXPUn.native.esm.js.map +1 -0
  26. package/dist/{getNetworkProviderFromNetworkId-CMIgKqEH.cjs → getNetworkProviderFromNetworkId-DmH039jx.cjs} +114 -17
  27. package/dist/getNetworkProviderFromNetworkId-DmH039jx.cjs.map +1 -0
  28. package/dist/{getSignedSessionId-CUqILBh8.esm.js → getSignedSessionId-CAQwZYYk.esm.js} +3 -3
  29. package/dist/{getSignedSessionId-CUqILBh8.esm.js.map → getSignedSessionId-CAQwZYYk.esm.js.map} +1 -1
  30. package/dist/{getSignedSessionId-Hp1nSbaW.native.esm.js → getSignedSessionId-CPautem1.native.esm.js} +3 -3
  31. package/dist/{getSignedSessionId-Hp1nSbaW.native.esm.js.map → getSignedSessionId-CPautem1.native.esm.js.map} +1 -1
  32. package/dist/{getSignedSessionId-De_N_Ofg.cjs → getSignedSessionId-Dz4U61DG.cjs} +3 -3
  33. package/dist/{getSignedSessionId-De_N_Ofg.cjs.map → getSignedSessionId-Dz4U61DG.cjs.map} +1 -1
  34. package/dist/{getWalletProviderByKey-D5M801xH.native.esm.js → getWalletProviderByKey-BKveb5Rh.native.esm.js} +2 -2
  35. package/dist/{getWalletProviderByKey-D5M801xH.native.esm.js.map → getWalletProviderByKey-BKveb5Rh.native.esm.js.map} +1 -1
  36. package/dist/{getWalletProviderByKey-D3e0XMjs.cjs → getWalletProviderByKey-CSVSMios.cjs} +2 -2
  37. package/dist/{getWalletProviderByKey-D3e0XMjs.cjs.map → getWalletProviderByKey-CSVSMios.cjs.map} +1 -1
  38. package/dist/{getWalletProviderByKey-CKORCA8l.esm.js → getWalletProviderByKey-DTBGx_qd.esm.js} +2 -2
  39. package/dist/{getWalletProviderByKey-CKORCA8l.esm.js.map → getWalletProviderByKey-DTBGx_qd.esm.js.map} +1 -1
  40. package/dist/index.cjs +736 -72
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.esm.js +729 -67
  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-BlVIlXMZ.esm.js → isDynamicWaasEnabled-Bb9e8w3u.esm.js} +19 -5
  47. package/dist/isDynamicWaasEnabled-Bb9e8w3u.esm.js.map +1 -0
  48. package/dist/{isDynamicWaasEnabled-BQuXZne_.cjs → isDynamicWaasEnabled-Dmbdiybh.cjs} +20 -6
  49. package/dist/isDynamicWaasEnabled-Dmbdiybh.cjs.map +1 -0
  50. package/dist/{isDynamicWaasEnabled-BaY09iv6.native.esm.js → isDynamicWaasEnabled-gu-9QF8-.native.esm.js} +19 -5
  51. package/dist/isDynamicWaasEnabled-gu-9QF8-.native.esm.js.map +1 -0
  52. package/dist/{isMfaRequiredForAction-CwOGwiDz.native.esm.js → isMfaRequiredForAction-BkrwKqo1.native.esm.js} +2 -2
  53. package/dist/{isMfaRequiredForAction-CwOGwiDz.native.esm.js.map → isMfaRequiredForAction-BkrwKqo1.native.esm.js.map} +1 -1
  54. package/dist/{isMfaRequiredForAction-Dghiguch.cjs → isMfaRequiredForAction-CHeYEkjj.cjs} +19 -2
  55. package/dist/isMfaRequiredForAction-CHeYEkjj.cjs.map +1 -0
  56. package/dist/{isMfaRequiredForAction-r9aDdmK5.esm.js → isMfaRequiredForAction-DxJQm48x.esm.js} +19 -2
  57. package/dist/isMfaRequiredForAction-DxJQm48x.esm.js.map +1 -0
  58. package/dist/{isUserOnboardingComplete-C-ioFLRR.native.esm.js → isUserOnboardingComplete-BLm0JQ_z.native.esm.js} +10 -3
  59. package/dist/{isUserOnboardingComplete-C-ioFLRR.native.esm.js.map → isUserOnboardingComplete-BLm0JQ_z.native.esm.js.map} +1 -1
  60. package/dist/{isUserOnboardingComplete-j4b_q9Pf.cjs → isUserOnboardingComplete-CruwjMvs.cjs} +11 -4
  61. package/dist/{isUserOnboardingComplete-j4b_q9Pf.cjs.map → isUserOnboardingComplete-CruwjMvs.cjs.map} +1 -1
  62. package/dist/{isUserOnboardingComplete-BMNAbXk1.esm.js → isUserOnboardingComplete-DAesufca.esm.js} +10 -3
  63. package/dist/{isUserOnboardingComplete-BMNAbXk1.esm.js.map → isUserOnboardingComplete-DAesufca.esm.js.map} +1 -1
  64. package/dist/{migrateFromFireblocks-D--uqWp5.esm.js → migrateFromFireblocks-C-lXWvvo.esm.js} +3 -3
  65. package/dist/{migrateFromFireblocks-D--uqWp5.esm.js.map → migrateFromFireblocks-C-lXWvvo.esm.js.map} +1 -1
  66. package/dist/{migrateFromFireblocks-D8Y5h0hz.native.esm.js → migrateFromFireblocks-Do4mQTl7.native.esm.js} +3 -3
  67. package/dist/{migrateFromFireblocks-D8Y5h0hz.native.esm.js.map → migrateFromFireblocks-Do4mQTl7.native.esm.js.map} +1 -1
  68. package/dist/{migrateFromFireblocks-D9pJIgt5.cjs → migrateFromFireblocks-DrHwloUB.cjs} +3 -3
  69. package/dist/{migrateFromFireblocks-D9pJIgt5.cjs.map → migrateFromFireblocks-DrHwloUB.cjs.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/services/storage/createLocalStorageAdapter/createLocalStorageAdapter.d.ts.map +1 -1
  213. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  214. package/dist/{updateAuthFromVerifyResponse-Deg9em9o.cjs → updateAuthFromVerifyResponse-CY0xTIXF.cjs} +93 -17
  215. package/dist/updateAuthFromVerifyResponse-CY0xTIXF.cjs.map +1 -0
  216. package/dist/{updateAuthFromVerifyResponse-wVY_DoiL.native.esm.js → updateAuthFromVerifyResponse-D4au3jUv.native.esm.js} +93 -17
  217. package/dist/updateAuthFromVerifyResponse-D4au3jUv.native.esm.js.map +1 -0
  218. package/dist/{updateAuthFromVerifyResponse-BQes11vz.esm.js → updateAuthFromVerifyResponse-inxvMWJB.esm.js} +93 -17
  219. package/dist/updateAuthFromVerifyResponse-inxvMWJB.esm.js.map +1 -0
  220. package/dist/waas.cjs +72 -5
  221. package/dist/waas.cjs.map +1 -1
  222. package/dist/waas.esm.js +70 -5
  223. package/dist/waas.esm.js.map +1 -1
  224. package/dist/waas.native.esm.js +70 -5
  225. package/dist/waas.native.esm.js.map +1 -1
  226. package/dist/waasCore.cjs +6 -6
  227. package/dist/waasCore.esm.js +6 -6
  228. package/dist/waasCore.native.esm.js +6 -6
  229. package/package.json +3 -3
  230. package/dist/getNetworkProviderFromNetworkId-C6DBO0OX.native.esm.js.map +0 -1
  231. package/dist/getNetworkProviderFromNetworkId-CEs4SGW4.esm.js.map +0 -1
  232. package/dist/getNetworkProviderFromNetworkId-CMIgKqEH.cjs.map +0 -1
  233. package/dist/isDynamicWaasEnabled-BQuXZne_.cjs.map +0 -1
  234. package/dist/isDynamicWaasEnabled-BaY09iv6.native.esm.js.map +0 -1
  235. package/dist/isDynamicWaasEnabled-BlVIlXMZ.esm.js.map +0 -1
  236. package/dist/isMfaRequiredForAction-Dghiguch.cjs.map +0 -1
  237. package/dist/isMfaRequiredForAction-r9aDdmK5.esm.js.map +0 -1
  238. package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts +0 -10
  239. package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts.map +0 -1
  240. package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/index.d.ts.map +0 -1
  241. package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/index.d.ts.map +0 -1
  242. package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts +0 -12
  243. package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts.map +0 -1
  244. package/dist/updateAuthFromVerifyResponse-BQes11vz.esm.js.map +0 -1
  245. package/dist/updateAuthFromVerifyResponse-Deg9em9o.cjs.map +0 -1
  246. package/dist/updateAuthFromVerifyResponse-wVY_DoiL.native.esm.js.map +0 -1
  247. /package/dist/modules/wallets/{primaryWalletAccount → selectedWalletAccount}/getPrimaryWalletAccount/index.d.ts +0 -0
  248. /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-inxvMWJB.esm.js";
2
+ import { C as getKeychainIndexedDBName, E as assertSafeNavigationUrl, F as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, G as isEqualShallow, H as isServerSideRendering, 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 getBuffer, S as MergeAccountsConfirmationError, T as createKeychainService, U as UnavailableInServerSideError, V as createLocalStorageAdapter, W as subscribeWithSelector, _ 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 createStorage } from "./getNetworkProviderFromNetworkId-Ct6nH2tC.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-DxJQm48x.esm.js";
4
+ import { n as NotWaasWalletAccountError, r as __refreshAuth_wrapped } from "./isDynamicWaasEnabled-Bb9e8w3u.esm.js";
5
+ import { a as WaasOnboardingIncompleteError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, r as isDeviceRegistrationRequired, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-DAesufca.esm.js";
6
+ import { n as getVerifiedCredentialForWalletAccount, t as getWalletProviderByKey } from "./getWalletProviderByKey-DTBGx_qd.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,21 +621,7 @@ const createAsyncTrack = () => {
592
621
  //#endregion
593
622
  //#region src/services/eventEmitter/createEventEmitter.ts
594
623
  /** @notInstrumented */
595
- const createEventEmitter = () => new EventEmitter$1();
596
-
597
- //#endregion
598
- //#region src/errors/UnavailableInServerSideError.ts
599
- var UnavailableInServerSideError = class extends BaseError {
600
- constructor(unavailableFeature) {
601
- super({
602
- cause: null,
603
- code: "unavailable_in_server_side_error",
604
- docsUrl: null,
605
- name: "UnavailableInServerSideError",
606
- shortMessage: `This function is not available in server-side rendering: ${unavailableFeature}`
607
- });
608
- }
609
- };
624
+ const createEventEmitter = () => new EventEmitter();
610
625
 
611
626
  //#endregion
612
627
  //#region src/services/fetch/createWebFetch.ts
@@ -1096,8 +1111,18 @@ const createCore = (config) => {
1096
1111
  * Manually calling `initializeClient` also allows you to catch any potential
1097
1112
  * errors that may occur during initialization.
1098
1113
  *
1114
+ * @example
1115
+ * ```ts
1116
+ * const client = createDynamicClient({
1117
+ * environmentId: 'your-environment-id',
1118
+ * appUrl: 'https://myapp.com',
1119
+ * });
1120
+ * ```
1121
+ *
1099
1122
  * @param config - The configuration for the Dynamic client, like the environment ID, app url, etc.
1100
1123
  * @returns The Dynamic client instance.
1124
+ * @see initializeClient
1125
+ * @see getDefaultClient
1101
1126
  * @instrumented
1102
1127
  */
1103
1128
  const createDynamicClient = (config) => {
@@ -1188,6 +1213,27 @@ var DeeplinkConnectAndVerifyUnsupportedError = class extends BaseError {
1188
1213
 
1189
1214
  //#endregion
1190
1215
  //#region src/errors/DeviceRegistrationIdentityMismatchError.ts
1216
+ /**
1217
+ * Thrown when completing device registration would replace the current session
1218
+ * with a different user's identity.
1219
+ *
1220
+ * The device registration token resolved to a user other than the one currently
1221
+ * authenticated, which can indicate a login-CSRF / session-fixation attempt, so
1222
+ * the returned session is rejected and the current session is left untouched.
1223
+ *
1224
+ * @example
1225
+ * ```ts
1226
+ * try {
1227
+ * await completeDeviceRegistration({ token });
1228
+ * } catch (error) {
1229
+ * if (error instanceof DeviceRegistrationIdentityMismatchError) {
1230
+ * // The current session was preserved; ask the user to retry on this device.
1231
+ * }
1232
+ * }
1233
+ * ```
1234
+ * @see completeDeviceRegistration
1235
+ * @see InvalidDeviceRegistrationRedirectError
1236
+ */
1191
1237
  var DeviceRegistrationIdentityMismatchError = class extends BaseError {
1192
1238
  constructor() {
1193
1239
  super({
@@ -1686,9 +1732,19 @@ const __requestExternalAuthElevatedToken_wrapped = instrumentFunction({
1686
1732
  * This function allows authentication using JWT tokens from external providers,
1687
1733
  * enabling integration with custom authentication systems.
1688
1734
  *
1735
+ * @example
1736
+ * ```ts
1737
+ * const response = await signInWithExternalJwt({
1738
+ * externalJwt: 'eyJhbGciOiJSUzI1NiIs...',
1739
+ * });
1740
+ * ```
1741
+ *
1689
1742
  * @param [params.externalJwt] - Optional external JWT token to authenticate with. Not required when using cookie based auth.
1743
+ * @param [params.sessionPublicKey] - Optional session public key for session-based auth.
1690
1744
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1691
1745
  * @returns A promise that resolves to the authentication response from the server.
1746
+ * @see logout
1747
+ * @see refreshAuth
1692
1748
  * @instrumented
1693
1749
  */
1694
1750
  const signInWithExternalJwt = async ({ externalJwt, sessionPublicKey } = {}, client = getDefaultClient()) => {
@@ -1721,8 +1777,21 @@ const __signInWithExternalJwt_wrapped = instrumentFunction({
1721
1777
  /**
1722
1778
  * Logs out the current user and clears all authentication data.
1723
1779
  *
1780
+ * @example
1781
+ * ```ts
1782
+ * await logout();
1783
+ * ```
1784
+ *
1785
+ * @example
1786
+ * ```ts
1787
+ * // With explicit client for multi-client setups
1788
+ * await logout(myClient);
1789
+ * ```
1790
+ *
1724
1791
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1725
1792
  * @returns A promise that resolves when the logout process is complete.
1793
+ * @see isAnyWalletAccountConnected
1794
+ * @see refreshAuth
1726
1795
  * @notInstrumented
1727
1796
  */
1728
1797
  const logout = async (client = getDefaultClient()) => {
@@ -1735,6 +1804,58 @@ const logout = async (client = getDefaultClient()) => {
1735
1804
  return __logoutWithReason_wrapped({ reason: "user-intent" }, client);
1736
1805
  };
1737
1806
 
1807
+ //#endregion
1808
+ //#region src/modules/auth/mergeUserAccounts/mergeUserAccounts.ts
1809
+ /**
1810
+ * Completes an account merge after a credential was found to already belong to
1811
+ * another user (surfaced as `MergeAccountsConfirmationError` during
1812
+ * verification / linking).
1813
+ *
1814
+ * When the merge has no field-level conflicts, call it with no resolutions to
1815
+ * merge directly. When the two accounts hold different values for the same
1816
+ * profile field, pass the user's chosen `conflictResolutions` (one per
1817
+ * conflict) so the backend knows which value to keep. On success the two users
1818
+ * are folded into one, the merged session is persisted, and the merged user is
1819
+ * returned.
1820
+ *
1821
+ * @example
1822
+ * ```ts
1823
+ * try {
1824
+ * await verifyWalletAccount({ walletAccount });
1825
+ * } catch (error) {
1826
+ * if (error instanceof MergeAccountsConfirmationError) {
1827
+ * // resolveConflicts is your own function (not provided by the SDK): given
1828
+ * // the conflicting fields, decide which value to keep for each one —
1829
+ * // usually by prompting the user — and return them as MergeUserConflictResolution[].
1830
+ * await mergeUserAccounts(
1831
+ * error.mergeConflicts
1832
+ * ? { conflictResolutions: resolveConflicts(error.mergeConflicts) }
1833
+ * : undefined,
1834
+ * );
1835
+ * }
1836
+ * }
1837
+ * ```
1838
+ * @param params.conflictResolutions - Optional per-field conflict resolutions.
1839
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1840
+ * @returns A promise that resolves to the merged user.
1841
+ * @see MergeAccountsConfirmationError
1842
+ * @see MergeUserConflictResolution
1843
+ * @notInstrumented
1844
+ */
1845
+ const mergeUserAccounts = async ({ conflictResolutions } = {}, client = getDefaultClient()) => {
1846
+ const core = getCore(client);
1847
+ const apiClient = createApiClient({}, client);
1848
+ const hasConflictResolutions = conflictResolutions !== void 0 && conflictResolutions.length > 0;
1849
+ let response;
1850
+ if (hasConflictResolutions) response = await apiClient.verifyMergeUsers({
1851
+ environmentId: core.environmentId,
1852
+ mergeUserConflictResolutions: { mergeUserResolutions: conflictResolutions }
1853
+ });
1854
+ else response = await apiClient.mergeUsers({ environmentId: core.environmentId });
1855
+ updateAuthFromVerifyResponse({ response }, client);
1856
+ return response.user;
1857
+ };
1858
+
1738
1859
  //#endregion
1739
1860
  //#region src/modules/auth/passkeys/deletePasskey/deletePasskey.ts
1740
1861
  /**
@@ -1820,10 +1941,17 @@ const serverRegisterPasskey = async ({ registration, createMfaToken }, client) =
1820
1941
  * passwordless authentication. The user will be prompted to create a passkey
1821
1942
  * using their device's biometric authentication or security key.
1822
1943
  *
1944
+ * @example
1945
+ * ```ts
1946
+ * await registerPasskey();
1947
+ * ```
1948
+ *
1823
1949
  * @param [params.createMfaToken] - Optional configuration for MFA token creation.
1824
1950
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1825
1951
  * @returns A promise that resolves to the registration response.
1826
1952
  * @throws NoWebAuthNSupportError If WebAuthn is not supported by the browser.
1953
+ * @see signInWithPasskey
1954
+ * @see getPasskeys
1827
1955
  * @instrumented
1828
1956
  */
1829
1957
  const registerPasskey = async ({ createMfaToken } = {}, client = getDefaultClient()) => {
@@ -1888,9 +2016,18 @@ const serverSigninPasskey = async ({ authentication, createMfaToken }, client) =
1888
2016
  * credential, providing passwordless authentication using biometrics or
1889
2017
  * security keys.
1890
2018
  *
2019
+ * @example
2020
+ * ```ts
2021
+ * const response = await signInWithPasskey();
2022
+ * console.log('Signed in:', response.user.email);
2023
+ * ```
2024
+ *
2025
+ * @param [params.relatedOriginRpId] - Optional relying party ID for cross-origin authentication.
1891
2026
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1892
2027
  * @returns A promise that resolves to the authentication response.
1893
2028
  * @throws NoWebAuthNSupportError If WebAuthn is not supported by the browser.
2029
+ * @see registerPasskey
2030
+ * @see getPasskeys
1894
2031
  * @instrumented
1895
2032
  */
1896
2033
  const signInWithPasskey = async ({ relatedOriginRpId } = {}, client = getDefaultClient()) => {
@@ -2086,9 +2223,19 @@ const buildOAuthUrl = async (core, provider) => {
2086
2223
  * back because of this flow, then call `completeSocialRedirect` to finish
2087
2224
  * the social authentication.
2088
2225
  *
2226
+ * @example
2227
+ * ```ts
2228
+ * await signInWithSocialRedirect({
2229
+ * provider: 'google',
2230
+ * redirectUrl: window.location.href,
2231
+ * });
2232
+ * ```
2233
+ *
2089
2234
  * @param params.provider - The social provider to authenticate with (e.g., 'google', 'github').
2090
2235
  * @param params.redirectUrl - The URL to redirect back to after authentication.
2091
2236
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
2237
+ * @see completeSocialRedirect
2238
+ * @see detectSocialRedirectUrl
2092
2239
  * @instrumented
2093
2240
  */
2094
2241
  const signInWithSocialRedirect = async ({ provider, redirectUrl }, client = getDefaultClient()) => {
@@ -2131,6 +2278,14 @@ const __signInWithSocialRedirect_wrapped = instrumentFunction({
2131
2278
  * @deprecated Renamed to {@link signInWithSocialRedirect}. This alias will be
2132
2279
  * removed in a future major version.
2133
2280
  *
2281
+ * @example
2282
+ * ```ts
2283
+ * // Prefer signInWithSocialRedirect instead
2284
+ * await signInWithSocialRedirect({ provider: 'google', redirectUrl: window.location.href });
2285
+ * ```
2286
+ *
2287
+ * @see signInWithSocialRedirect
2288
+ * @see completeSocialRedirect
2134
2289
  * @instrumented
2135
2290
  * @noHook Deprecated alias that is not exposed as a React hook.
2136
2291
  */
@@ -2148,6 +2303,45 @@ const __authenticateWithSocial_wrapped = instrumentFunction({
2148
2303
  }
2149
2304
  });
2150
2305
 
2306
+ //#endregion
2307
+ //#region src/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.ts
2308
+ /**
2309
+ * Removes the social OAuth redirect parameters that `signInWithSocialRedirect`
2310
+ * appends to the return URL from the browser's current URL, leaving every other
2311
+ * query parameter, the path, and the hash untouched.
2312
+ *
2313
+ * Call this once you have finished `completeSocialRedirect` so a page refresh
2314
+ * doesn't re-trigger the redirect flow. Unlike clearing the whole query
2315
+ * string, this preserves any of your own parameters on the callback URL.
2316
+ *
2317
+ * This reads and rewrites `window.location`, so it can only run in the
2318
+ * browser. Calling it during server-side rendering (no `window`) throws
2319
+ * `UnavailableInServerSideError`.
2320
+ *
2321
+ * @returns Nothing. The current URL is rewritten in place via
2322
+ * `window.history.replaceState`.
2323
+ *
2324
+ * @throws {UnavailableInServerSideError} When called without a `window`
2325
+ * (e.g. during server-side rendering).
2326
+ *
2327
+ * @example
2328
+ * ```ts
2329
+ * await completeSocialRedirect({ url: new URL(window.location.href) });
2330
+ * clearSocialRedirectParams();
2331
+ * ```
2332
+ *
2333
+ * @see {@link completeSocialRedirect} to finish the redirect sign-in before
2334
+ * clearing the parameters.
2335
+ * @see {@link detectSocialRedirectUrl} to check whether the current URL is a
2336
+ * social OAuth callback.
2337
+ *
2338
+ * @notInstrumented
2339
+ */
2340
+ const clearSocialRedirectParams = () => {
2341
+ if (isServerSideRendering()) throw new UnavailableInServerSideError("clearSocialRedirectParams");
2342
+ window.history.replaceState({}, "", removeDynamicOauthParamsFromUrl(window.location.href));
2343
+ };
2344
+
2151
2345
  //#endregion
2152
2346
  //#region src/modules/auth/social/oauth/processSocialCallback/processSocialCallback.ts
2153
2347
  /**
@@ -2229,12 +2423,23 @@ const __processSocialCallback_wrapped = instrumentFunction({
2229
2423
  * authenticating (or linking) the user with the social provider. This is the
2230
2424
  * final step after `signInWithSocialRedirect` + `detectSocialRedirectUrl`.
2231
2425
  *
2426
+ * @example
2427
+ * ```ts
2428
+ * const redirectUrl = detectSocialRedirectUrl();
2429
+ * if (redirectUrl) {
2430
+ * const user = await completeSocialRedirect({ url: redirectUrl });
2431
+ * }
2432
+ * ```
2433
+ *
2232
2434
  * @param params.url - The callback URL containing OAuth response parameters.
2233
2435
  * @param [params.requestedScopes] - Optional scopes to request an elevated access token when verifying (linking) a social account.
2234
2436
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
2235
2437
  * @returns A promise that resolves to the authenticated user or null.
2236
2438
  * @throws MissingSocialUrlParamError If required OAuth parameters are missing.
2237
2439
  * @throws InvalidRedirectStorageStateError If the stored state doesn't match.
2440
+ * @see signInWithSocialRedirect
2441
+ * @see detectSocialRedirectUrl
2442
+ * @see clearSocialRedirectParams
2238
2443
  * @instrumented
2239
2444
  */
2240
2445
  const completeSocialRedirect = ({ url, requestedScopes }, client = getDefaultClient()) => __processSocialCallback_wrapped({
@@ -2290,7 +2495,6 @@ const __completeSocialAuthentication_wrapped = instrumentFunction({
2290
2495
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
2291
2496
  * @returns A promise that resolves to true if the URL is an OAuth redirect, false otherwise.
2292
2497
  * @notInstrumented
2293
- * @noHook Low-level redirect-detection primitive that is not exposed as a React hook.
2294
2498
  */
2295
2499
  const detectSocialRedirectUrl = async ({ url }, client = getDefaultClient()) => {
2296
2500
  const core = getCore(client);
@@ -2322,7 +2526,19 @@ const detectOAuthRedirect = (params, client = getDefaultClient()) => detectSocia
2322
2526
  * {@link signInWithSocialRedirect} + {@link completeSocialRedirect} instead —
2323
2527
  * the browser already owns the tab so there is no popup to open.
2324
2528
  *
2529
+ * @example
2530
+ * ```ts
2531
+ * // React Native only
2532
+ * const user = await signInWithSocialPopUp({ provider: 'google' });
2533
+ * ```
2534
+ *
2535
+ * @param params.provider - The social provider to authenticate with.
2536
+ * @param [params.requestedScopes] - Optional scopes to request from the provider.
2537
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
2538
+ * @returns A promise that resolves to the authenticated user or null.
2325
2539
  * @throws MethodNotImplementedError Always on web.
2540
+ * @see signInWithSocialRedirect
2541
+ * @see completeSocialRedirect
2326
2542
  * @instrumented
2327
2543
  */
2328
2544
  const signInWithSocialPopUp = async ({ provider, requestedScopes }, client = getDefaultClient()) => {
@@ -2342,19 +2558,39 @@ const __signInWithSocialPopUp_wrapped = instrumentFunction({
2342
2558
  });
2343
2559
 
2344
2560
  //#endregion
2345
- //#region src/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.ts
2561
+ //#region src/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/getSelectedWalletAccount.ts
2346
2562
  /**
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.
2563
+ * Get the wallet account currently selected for the user.
2564
+ *
2565
+ * The SDK itself does not use or care about which wallet is "selected" — it has
2566
+ * no bearing on authentication, signing, or any other SDK behaviour. This is
2567
+ * purely a convenience for *reading* which wallet the user most recently
2568
+ * selected (derived from the backend `lastSelectedAt` timestamp, across both
2569
+ * unverified and verified wallet accounts). Applications that need a notion of
2570
+ * an active/current wallet should own that selection state themselves.
2571
+ *
2572
+ * The one exception is the wagmi integration (`@dynamic-labs-sdk/wagmi`), which
2573
+ * mirrors the selected EVM wallet into wagmi's connector state.
2574
+ *
2575
+ * @example
2576
+ * ```ts
2577
+ * const selected = getSelectedWalletAccount();
2578
+ * if (selected) {
2579
+ * console.log('Selected wallet:', selected.address);
2580
+ * }
2581
+ * ```
2582
+ *
2583
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
2584
+ * @returns The selected wallet account, or null if no wallet has been selected.
2585
+ * @see setSelectedWalletAccount
2586
+ * @see getWalletAccounts
2351
2587
  * @notInstrumented
2352
2588
  */
2353
- const getPrimaryWalletAccount = (client = getDefaultClient()) => {
2589
+ const getSelectedWalletAccount = (client = getDefaultClient()) => {
2354
2590
  const sortedLastSelectedWalletAccounts = getWalletAccounts(client).filter((walletAccount) => Boolean(walletAccount.lastSelectedAt)).sort((a, b) => b.lastSelectedAt.getTime() - a.lastSelectedAt.getTime());
2355
2591
  if (sortedLastSelectedWalletAccounts.length === 0) return null;
2356
- const [primaryWalletAccount] = sortedLastSelectedWalletAccounts;
2357
- return primaryWalletAccount;
2592
+ const [selectedWallet] = sortedLastSelectedWalletAccounts;
2593
+ return selectedWallet;
2358
2594
  };
2359
2595
 
2360
2596
  //#endregion
@@ -2376,9 +2612,9 @@ const getPrimaryWalletAccount = (client = getDefaultClient()) => {
2376
2612
  const unlinkSocialAccount = async ({ verifiedCredentialId }, client = getDefaultClient()) => {
2377
2613
  const core = getCore(client);
2378
2614
  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;
2615
+ const selectedWallet = getSelectedWalletAccount(client);
2616
+ const walletId = selectedWallet?.verifiedCredentialId?.replace("-zerodev", "") ?? void 0;
2617
+ const isEmbeddedWallet = !!selectedWallet && getVerifiedCredentialForWalletAccount({ walletAccount: selectedWallet }, client)?.walletProvider === WalletProviderEnum.EmbeddedWallet;
2382
2618
  const response = await apiClient.verifyUnlink({
2383
2619
  environmentId: core.environmentId,
2384
2620
  verifyUnlinkRequest: {
@@ -2494,10 +2730,37 @@ const getMultichainBalances = (params, client = getDefaultClient()) => getMultic
2494
2730
  //#endregion
2495
2731
  //#region src/modules/captcha/getCaptchaSettings/getCaptchaSettings.ts
2496
2732
  /**
2733
+ * The captcha providers Dynamic can be configured to use for an environment.
2734
+ * Use it to branch on which captcha widget to render for the active provider.
2735
+ *
2736
+ * Redeclared locally (rather than re-exported directly from the generated
2737
+ * `sdk-api-core`) so the public client entry point owns its own documented,
2738
+ * stable surface for this token.
2739
+ *
2740
+ * @example
2741
+ * ```ts
2742
+ * const settings = getCaptchaSettings();
2743
+ * if (settings?.provider === CaptchaProviderEnum.Hcaptcha) {
2744
+ * renderHcaptcha(settings.siteKey);
2745
+ * }
2746
+ * ```
2747
+ * @see getCaptchaSettings
2748
+ * @see CaptchaSettingsResult
2749
+ */
2750
+ const CaptchaProviderEnum = CaptchaProviderEnum$1;
2751
+ /**
2497
2752
  * Returns the active captcha provider and site key, or undefined if captcha is not enabled.
2498
2753
  * Use this to determine which captcha widget to render and which site key to pass it.
2499
2754
  *
2755
+ * @example
2756
+ * ```ts
2757
+ * const settings = getCaptchaSettings();
2758
+ * if (settings) renderCaptcha(settings.provider, settings.siteKey);
2759
+ * ```
2760
+ * @see CaptchaSettingsResult
2761
+ * @see CaptchaProviderEnum
2500
2762
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
2763
+ * @returns The active captcha provider and site key, or undefined when captcha is not enabled.
2501
2764
  * @notInstrumented
2502
2765
  */
2503
2766
  const getCaptchaSettings = (client = getDefaultClient()) => {
@@ -2506,13 +2769,13 @@ const getCaptchaSettings = (client = getDefaultClient()) => {
2506
2769
  const { security } = projectSettings;
2507
2770
  if (security.captcha) {
2508
2771
  if (security.captcha.enabled) return {
2509
- provider: security.captcha.provider ?? CaptchaProviderEnum$1.Hcaptcha,
2772
+ provider: security.captcha.provider ?? CaptchaProviderEnum.Hcaptcha,
2510
2773
  siteKey: security.captcha.siteKey
2511
2774
  };
2512
2775
  return;
2513
2776
  }
2514
2777
  if (security.hCaptcha?.enabled) return {
2515
- provider: CaptchaProviderEnum$1.Hcaptcha,
2778
+ provider: CaptchaProviderEnum.Hcaptcha,
2516
2779
  siteKey: security.hCaptcha.siteKey
2517
2780
  };
2518
2781
  };
@@ -3076,10 +3339,59 @@ const requiresConversion = async ({ transaction }, client = getDefaultClient())
3076
3339
  return !checkout.settlementConfig.settlements.some((settlement) => settlement.chainName === transaction.fromChainName && settlement.chainId === transaction.fromChainId && settlement.tokenAddress === transaction.fromToken);
3077
3340
  };
3078
3341
 
3342
+ //#endregion
3343
+ //#region src/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/clearDeviceRegistrationRedirectParams.ts
3344
+ /**
3345
+ * Removes the device registration redirect parameters that the device
3346
+ * registration email link appends to the return URL from the browser's current
3347
+ * URL, leaving every other query parameter, the path, and the hash untouched.
3348
+ *
3349
+ * Call this once you have finished `completeDeviceRegistration` so a page
3350
+ * refresh doesn't re-trigger the registration flow. Unlike clearing the whole
3351
+ * query string, this preserves any of your own parameters on the callback URL.
3352
+ *
3353
+ * This reads and rewrites `window.location`, so it can only run in the
3354
+ * browser. Calling it during server-side rendering (no `window`) throws
3355
+ * `UnavailableInServerSideError`.
3356
+ *
3357
+ * @returns Nothing. The current URL is rewritten in place via
3358
+ * `window.history.replaceState`.
3359
+ *
3360
+ * @throws {UnavailableInServerSideError} When called without a `window`
3361
+ * (e.g. during server-side rendering).
3362
+ *
3363
+ * @example
3364
+ * ```ts
3365
+ * const deviceToken = getDeviceRegistrationTokenFromUrl({ url: window.location.href });
3366
+ * await completeDeviceRegistration({ deviceToken });
3367
+ * clearDeviceRegistrationRedirectParams();
3368
+ * ```
3369
+ *
3370
+ * @see {@link completeDeviceRegistration} to finish the registration before
3371
+ * clearing the parameters.
3372
+ * @see {@link detectDeviceRegistrationRedirect} to check whether the current
3373
+ * URL is a device registration callback.
3374
+ *
3375
+ * @notInstrumented
3376
+ */
3377
+ const clearDeviceRegistrationRedirectParams = () => {
3378
+ if (isServerSideRendering()) throw new UnavailableInServerSideError("clearDeviceRegistrationRedirectParams");
3379
+ const url = new URL(window.location.href);
3380
+ url.searchParams.delete("deviceRegistrationToken");
3381
+ window.history.replaceState({}, "", url.toString());
3382
+ };
3383
+
3079
3384
  //#endregion
3080
3385
  //#region src/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.ts
3081
3386
  const DEVICE_REGISTRATION_TOKEN_HEADER = "x-dynamic-device-registration-token";
3082
- /** @instrumented */
3387
+ /**
3388
+ * Completes device registration using the token from a device registration
3389
+ * redirect, authenticating the current device against the user's account.
3390
+ *
3391
+ * @see detectDeviceRegistrationRedirect
3392
+ * @see clearDeviceRegistrationRedirectParams
3393
+ * @instrumented
3394
+ */
3083
3395
  const completeDeviceRegistration = async ({ deviceToken }, client = getDefaultClient()) => {
3084
3396
  assertDefined(deviceToken, "deviceToken is required");
3085
3397
  const core = getCore(client);
@@ -3427,11 +3739,18 @@ const cancelFlowInstrumentation = { resolved: (flow) => ({
3427
3739
  //#endregion
3428
3740
  //#region src/modules/flow/cancelFlow/cancelFlow.ts
3429
3741
  /**
3430
- * Cancels a flow before it has been broadcasted
3742
+ * Cancels a flow before it has been broadcasted.
3743
+ *
3744
+ * @example
3745
+ * ```ts
3746
+ * const cancelledFlow = await cancelFlow({ flowId: 'flow-abc123' });
3747
+ * ```
3431
3748
  *
3432
- * @param params CancelFlowParams - The flow to cancel.
3749
+ * @param params.flowId - The unique identifier of the flow to cancel.
3433
3750
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
3434
- * @returns The cancelled flow
3751
+ * @returns A promise that resolves to the cancelled flow.
3752
+ * @see getFlow
3753
+ * @see getFlowQuote
3435
3754
  * @instrumented
3436
3755
  */
3437
3756
  const cancelFlow = async ({ flowId }, client = getDefaultClient()) => {
@@ -3464,11 +3783,19 @@ const __cancelFlow_wrapped = instrumentFunction({
3464
3783
  //#endregion
3465
3784
  //#region src/modules/flow/getFlow/getFlow.ts
3466
3785
  /**
3467
- * Fetches a flow by its ID
3786
+ * Fetches a flow by its ID.
3468
3787
  *
3469
- * @param params GetFlowParams - The parameters for fetching the flow.
3788
+ * @example
3789
+ * ```ts
3790
+ * const flow = await getFlow({ flowId: 'flow-abc123' });
3791
+ * console.log('Flow status:', flow.status);
3792
+ * ```
3793
+ *
3794
+ * @param params.flowId - The unique identifier of the flow to fetch.
3470
3795
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
3471
- * @returns The flow
3796
+ * @returns A promise that resolves to the flow object.
3797
+ * @see cancelFlow
3798
+ * @see getFlowQuote
3472
3799
  * @notInstrumented
3473
3800
  */
3474
3801
  const getFlow = async ({ flowId }, client = getDefaultClient()) => {
@@ -3482,11 +3809,24 @@ const getFlow = async ({ flowId }, client = getDefaultClient()) => {
3482
3809
  //#endregion
3483
3810
  //#region src/modules/flow/getFlowQuote/getFlowQuote.ts
3484
3811
  /**
3485
- * Fetches a quote for a flow
3812
+ * Fetches a quote for a flow.
3813
+ *
3814
+ * @example
3815
+ * ```ts
3816
+ * const flow = await getFlowQuote({
3817
+ * flowId: 'flow-abc123',
3818
+ * slippage: 0.5,
3819
+ * });
3820
+ * ```
3486
3821
  *
3487
- * @param params GetFlowQuoteParams - The quote parameters.
3822
+ * @param params.flowId - The unique identifier of the flow.
3823
+ * @param [params.fromChainId] - Optional chain ID overriding the one set at attachFlowSource time.
3824
+ * @param [params.fromTokenAddress] - Optional token address (defaults to native token).
3825
+ * @param [params.slippage] - Acceptable slippage percentage.
3488
3826
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
3489
- * @returns The updated flow with quote data
3827
+ * @returns A promise that resolves to the updated flow with quote data.
3828
+ * @see getFlow
3829
+ * @see cancelFlow
3490
3830
  * @notInstrumented
3491
3831
  */
3492
3832
  const getFlowQuote = async ({ flowId, fromChainId, fromTokenAddress, slippage }, client = getDefaultClient()) => {
@@ -4008,7 +4348,17 @@ const __getMoonPayUrl_wrapped = instrumentFunction({
4008
4348
  * Allows waiting until all modules of the client have been properly initialized
4009
4349
  * and are ready for use.
4010
4350
  *
4011
- * @returns a promise that resolves once the client is fully initialized.
4351
+ * @example
4352
+ * ```ts
4353
+ * const client = createDynamicClient({ environmentId: 'env-id' });
4354
+ * await waitForClientInitialized(client);
4355
+ * // Client is now fully ready
4356
+ * ```
4357
+ *
4358
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
4359
+ * @returns A promise that resolves once the client is fully initialized.
4360
+ * @see initializeClient
4361
+ * @see createDynamicClient
4012
4362
  * @notInstrumented
4013
4363
  * @noHook Client lifecycle management is not exposed as a hook; use useInitStatus.
4014
4364
  */
@@ -4995,9 +5345,23 @@ const __setDefaultMfaDevice_wrapped = instrumentFunction({
4995
5345
  *
4996
5346
  * Once you have the OTP code, you should then use `verifyOTP` to verify it and complete the authentication process.
4997
5347
  *
5348
+ * @example
5349
+ * ```ts
5350
+ * const { verificationUUID } = await sendEmailOTP({
5351
+ * email: 'user@example.com',
5352
+ * });
5353
+ * // Then verify with the code the user received
5354
+ * await verifyOTP({
5355
+ * otpVerification: { email: 'user@example.com', verificationUUID },
5356
+ * verificationToken: '123456',
5357
+ * });
5358
+ * ```
5359
+ *
4998
5360
  * @param params.email - The email address to send the OTP to.
4999
5361
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
5000
5362
  * @returns A promise that resolves to an OTPVerification object containing the email and verification UUID.
5363
+ * @see verifyOTP
5364
+ * @see sendSmsOTP
5001
5365
  * @instrumented
5002
5366
  */
5003
5367
  const sendEmailOTP = async ({ email }, client = getDefaultClient()) => {
@@ -5955,10 +6319,22 @@ const supportedCountries = {
5955
6319
  /**
5956
6320
  * Sends a one-time password (OTP) via SMS to the specified phone number.
5957
6321
  *
6322
+ * @example
6323
+ * ```ts
6324
+ * const { verificationUUID } = await sendSmsOTP({
6325
+ * isoCountryCode: 'US',
6326
+ * phoneNumber: '5551234567',
6327
+ * });
6328
+ * // Then verify with the code the user received
6329
+ * await verifyOTP({ otpVerification: { phoneNumber: '5551234567', verificationUUID }, verificationToken: '123456' });
6330
+ * ```
6331
+ *
5958
6332
  * @param params.isoCountryCode - The ISO country code for the phone number (e.g., 'US', 'CA', 'GB').
5959
6333
  * @param params.phoneNumber - The phone number to send the OTP to.
5960
6334
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
5961
6335
  * @returns A promise that resolves to an OTPVerification object containing the phone details and verification UUID.
6336
+ * @see verifyOTP
6337
+ * @see sendEmailOTP
5962
6338
  * @instrumented
5963
6339
  */
5964
6340
  const sendSmsOTP = async ({ isoCountryCode, phoneNumber }, client = getDefaultClient()) => {
@@ -5998,10 +6374,11 @@ const __sendSmsOTP_wrapped = instrumentFunction({
5998
6374
  //#endregion
5999
6375
  //#region src/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.ts
6000
6376
  /** @notInstrumented */
6001
- const verifyOTPForUserSignIn = async ({ otpVerification, verificationToken }, client) => {
6377
+ const verifyOTPForUserSignIn = async ({ allowNewMFALinking, otpVerification, verificationToken }, client) => {
6002
6378
  const core = getCore(client);
6003
6379
  const apiClient = createApiClient({}, client);
6004
6380
  const verifyRequest = {
6381
+ ...allowNewMFALinking !== void 0 && { allowNewMFALinking },
6005
6382
  verificationToken,
6006
6383
  verificationUUID: otpVerification.verificationUUID
6007
6384
  };
@@ -6044,13 +6421,26 @@ const verifyOTPForUserUpdate = async ({ otpVerification, verificationToken, requ
6044
6421
  * This function validates the OTP code provided by the user and completes
6045
6422
  * the verification process for either sign-in or account updates.
6046
6423
  *
6424
+ * @example
6425
+ * ```ts
6426
+ * const { verificationUUID } = await sendEmailOTP({ email: 'user@example.com' });
6427
+ * const response = await verifyOTP({
6428
+ * otpVerification: { email: 'user@example.com', verificationUUID },
6429
+ * verificationToken: '123456',
6430
+ * });
6431
+ * ```
6432
+ *
6433
+ * @param [params.allowNewMFALinking] - Whether sign-in may return a credential-link elevated token for users without MFA.
6047
6434
  * @param params.otpVerification - The OTP verification object containing verification details.
6048
6435
  * @param params.verificationToken - The token received from the OTP verification process.
6436
+ * @param [params.requestedScopes] - Optional token scopes to request during verification.
6049
6437
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
6050
6438
  * @returns A promise that resolves to the verify response object upon successful verification.
6439
+ * @see sendEmailOTP
6440
+ * @see sendSmsOTP
6051
6441
  * @instrumented
6052
6442
  */
6053
- const verifyOTP = async ({ otpVerification, verificationToken, requestedScopes }, client = getDefaultClient()) => {
6443
+ const verifyOTP = async ({ allowNewMFALinking, otpVerification, requestedScopes, verificationToken }, client = getDefaultClient()) => {
6054
6444
  preconnectWaasIframe(client);
6055
6445
  let response;
6056
6446
  if (client.user) response = await verifyOTPForUserUpdate({
@@ -6059,6 +6449,7 @@ const verifyOTP = async ({ otpVerification, verificationToken, requestedScopes }
6059
6449
  verificationToken
6060
6450
  }, client);
6061
6451
  else response = await verifyOTPForUserSignIn({
6452
+ allowNewMFALinking,
6062
6453
  otpVerification,
6063
6454
  verificationToken
6064
6455
  }, client);
@@ -6157,6 +6548,33 @@ const getSwapStatus = async (params, client = getDefaultClient()) => {
6157
6548
  }
6158
6549
  };
6159
6550
 
6551
+ //#endregion
6552
+ //#region src/modules/user/checkUserScopes/checkUserScopes.ts
6553
+ /**
6554
+ * Checks whether the given user has all the specified scopes.
6555
+ *
6556
+ * The user's `scope` field is a whitespace-separated string of granted
6557
+ * permissions (per RFC 8693 §4.2). This helper splits it and verifies that
6558
+ * every entry in `scopes` is present.
6559
+ *
6560
+ * @example
6561
+ * const user = getDefaultClient().user;
6562
+ * if (user && checkUserScopes({ user, scopes: ['wallets:read'] })) {
6563
+ * showWalletBalances();
6564
+ * }
6565
+ *
6566
+ * @param params.user - The authenticated user to check.
6567
+ * @param params.scopes - The scope strings the user must have.
6568
+ * @returns `true` if the user has every scope in `scopes`, `false` otherwise.
6569
+ * @see User
6570
+ * @see updateUser
6571
+ * @notInstrumented
6572
+ */
6573
+ const checkUserScopes = ({ scopes, user }) => {
6574
+ const grantedScopes = user.scope?.split(/\s+/).filter(Boolean) ?? [];
6575
+ return scopes.every((requiredScope) => grantedScopes.includes(requiredScope));
6576
+ };
6577
+
6160
6578
  //#endregion
6161
6579
  //#region src/modules/user/deleteUser/deleteUser.ts
6162
6580
  /**
@@ -6165,8 +6583,16 @@ const getSwapStatus = async (params, client = getDefaultClient()) => {
6165
6583
  * This function performs a hard delete of the user account. Upon successful deletion,
6166
6584
  * the user will be automatically logged out and all authentication data will be cleared.
6167
6585
  *
6586
+ * @example
6587
+ * ```ts
6588
+ * // Permanently delete the user's account
6589
+ * await deleteUser();
6590
+ * ```
6591
+ *
6168
6592
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
6169
6593
  * @returns A promise that resolves when the user account is successfully deleted.
6594
+ * @see logout
6595
+ * @see refreshUser
6170
6596
  * @instrumented
6171
6597
  */
6172
6598
  const deleteUser = async (client = getDefaultClient()) => {
@@ -7500,8 +7926,14 @@ const getAddressesWithTypesFromConnectionResult = (connectionResult) => {
7500
7926
  *
7501
7927
  * Note: This function will not verify the wallet account, use the verifyWalletAccount function to do that
7502
7928
  * or connectAndVerifyWithWalletProvider to do that in a single step.
7503
- * @see verifyWalletAccount
7504
- * @see connectAndVerifyWithWalletProvider
7929
+ *
7930
+ * @example
7931
+ * ```ts
7932
+ * const walletAccount = await connectWithWalletProvider({
7933
+ * walletProviderKey: 'metamaskevm',
7934
+ * });
7935
+ * console.log(walletAccount.address);
7936
+ * ```
7505
7937
  *
7506
7938
  * @param params.walletProviderKey - The unique key identifying the wallet provider to connect to (e.g. 'metamaskevm', 'phantomsol').
7507
7939
  * @param [params.addToDynamicWalletAccounts] - Whether to add the connected wallet account to the user's wallet accounts. Defaults to true.
@@ -7509,7 +7941,9 @@ const getAddressesWithTypesFromConnectionResult = (connectionResult) => {
7509
7941
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
7510
7942
  * @returns A promise that resolves to the connected wallet account.
7511
7943
  * @throws NoAddressFoundError If the request to connect was successful but no address is connected to your app.
7512
- * @instrumented
7944
+ * @see verifyWalletAccount
7945
+ * @see connectAndVerifyWithWalletProvider
7946
+ * @instrumented
7513
7947
  */
7514
7948
  const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWalletAccounts = true, hardwareWalletVendor }, client = getDefaultClient()) => {
7515
7949
  const walletProvider = getWalletProviderByKey({ walletProviderKey }, client);
@@ -7646,9 +8080,19 @@ const getSignInMessage = async ({ nonce: nonceOverride, walletAccount }, client)
7646
8080
  * This function generates a sign-in message and requires the user to sign it
7647
8081
  * with their wallet's private key, proving they control the wallet address.
7648
8082
  *
8083
+ * @example
8084
+ * ```ts
8085
+ * const { messageToSign, signature } = await proveWalletAccountOwnership({
8086
+ * walletAccount: wallets[0],
8087
+ * });
8088
+ * // Send signature to your backend for verification
8089
+ * ```
8090
+ *
7649
8091
  * @param params.walletAccount - The wallet account to prove ownership of.
7650
8092
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
7651
8093
  * @returns A promise that resolves to an object containing the message and signature.
8094
+ * @see signMessage
8095
+ * @see verifyWalletAccount
7652
8096
  * @instrumented
7653
8097
  */
7654
8098
  const proveWalletAccountOwnership = async ({ walletAccount }, client = getDefaultClient()) => {
@@ -7752,11 +8196,22 @@ const verifyWalletAccountForSignInOrTransfer = async ({ walletAccount, isTransfe
7752
8196
  * This function requires the user to sign a message to prove wallet ownership,
7753
8197
  * then sets the wallet account as verified.
7754
8198
  *
8199
+ * @example
8200
+ * ```ts
8201
+ * const walletAccount = await connectWithWalletProvider({
8202
+ * walletProviderKey: 'metamaskevm',
8203
+ * });
8204
+ * const verified = await verifyWalletAccount({ walletAccount });
8205
+ * ```
8206
+ *
7755
8207
  * @param params.walletAccount - The wallet account to verify ownership of.
8208
+ * @param [params.requestedScopes] - Optional token scopes to request during verification.
7756
8209
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
7757
8210
  * @returns A promise that resolves to the verified wallet account.
7758
8211
  * @throws WalletAccountAlreadyVerifiedError If the wallet is already verified.
7759
8212
  * @throws WalletAlreadyLinkedToAnotherUserError If the wallet is linked to another user.
8213
+ * @see connectWithWalletProvider
8214
+ * @see connectAndVerifyWithWalletProvider
7760
8215
  * @instrumented
7761
8216
  */
7762
8217
  const verifyWalletAccount = async ({ walletAccount, requestedScopes }, client = getDefaultClient()) => {
@@ -7806,10 +8261,20 @@ const isDeeplinkWalletProvider = ({ walletProvider }) => walletProvider.walletPr
7806
8261
  * `verifyWalletAccount` separately from a new user gesture (e.g. a "Verify
7807
8262
  * Ownership" button).
7808
8263
  *
8264
+ * @example
8265
+ * ```ts
8266
+ * const walletAccount = await connectAndVerifyWithWalletProvider({
8267
+ * walletProviderKey: 'metamaskevm',
8268
+ * });
8269
+ * console.log('Verified address:', walletAccount.address);
8270
+ * ```
8271
+ *
7809
8272
  * @param params.walletProviderKey - The unique key identifying the wallet provider to connect to.
7810
8273
  * @param [params.hardwareWalletVendor] - The hardware wallet vendor, if connecting via a hardware wallet (e.g. 'ledger').
7811
8274
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
7812
8275
  * @returns A promise that resolves to the connected and verified wallet account.
8276
+ * @see connectWithWalletProvider
8277
+ * @see verifyWalletAccount
7813
8278
  * @instrumented
7814
8279
  */
7815
8280
  const connectAndVerifyWithWalletProvider = async ({ walletProviderKey, hardwareWalletVendor }, client = getDefaultClient()) => {
@@ -7871,9 +8336,17 @@ const getAvailableWalletProvidersData = (client = getDefaultClient()) => {
7871
8336
  * This function returns the list of wallet addresses that are currently
7872
8337
  * connected and available through the specified wallet provider.
7873
8338
  *
8339
+ * @example
8340
+ * ```ts
8341
+ * const addresses = getConnectedAddresses({ walletProviderKey: 'metamaskevm' });
8342
+ * console.log('Connected:', addresses);
8343
+ * ```
8344
+ *
7874
8345
  * @param params.walletProviderKey - The unique key of the wallet provider to query.
7875
8346
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
7876
8347
  * @returns An array of connected wallet addresses.
8348
+ * @see connectWithWalletProvider
8349
+ * @see getWalletAccounts
7877
8350
  * @notInstrumented
7878
8351
  */
7879
8352
  const getConnectedAddresses = ({ walletProviderKey }, client = getDefaultClient()) => {
@@ -7954,8 +8427,17 @@ const isHardwareWalletAccount = ({ walletAccount }) => walletAccount.hardwareWal
7954
8427
  * else your app considers "signed in" (e.g. `client.user`, completed onboarding,
7955
8428
  * a required embedded wallet, …).
7956
8429
  *
8430
+ * @example
8431
+ * ```ts
8432
+ * if (isAnyWalletAccountConnected()) {
8433
+ * console.log('At least one wallet is connected');
8434
+ * }
8435
+ * ```
8436
+ *
7957
8437
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
7958
8438
  * @returns True if the session has at least one wallet account, false otherwise.
8439
+ * @see getWalletAccounts
8440
+ * @see isWalletAccountVerified
7959
8441
  * @notInstrumented
7960
8442
  */
7961
8443
  const isAnyWalletAccountConnected = (client = getDefaultClient()) => getWalletAccounts(client).length > 0;
@@ -7965,8 +8447,16 @@ const isAnyWalletAccountConnected = (client = getDefaultClient()) => getWalletAc
7965
8447
  /**
7966
8448
  * Checks if a wallet account has been verified by a user.
7967
8449
  *
7968
- * @param walletAccount - The wallet account to check.
8450
+ * @example
8451
+ * ```ts
8452
+ * const wallets = getWalletAccounts();
8453
+ * const verified = wallets.filter(w => isWalletAccountVerified({ walletAccount: w }));
8454
+ * ```
8455
+ *
8456
+ * @param params.walletAccount - The wallet account to check.
7969
8457
  * @returns True if the wallet account has been verified, false otherwise.
8458
+ * @see verifyWalletAccount
8459
+ * @see getWalletAccounts
7970
8460
  * @notInstrumented
7971
8461
  */
7972
8462
  const isWalletAccountVerified = ({ walletAccount }) => {
@@ -8056,9 +8546,17 @@ const getActiveNetworkId = ({ walletAccount }, client = getDefaultClient()) => {
8056
8546
  * {@link getTokenBalances}; for a multi-chain portfolio snapshot, use
8057
8547
  * {@link getMultichainTokenBalances}.
8058
8548
  *
8549
+ * @example
8550
+ * ```ts
8551
+ * const { balance } = await getNativeBalance({ walletAccount: wallets[0] });
8552
+ * console.log('Native balance:', balance);
8553
+ * ```
8554
+ *
8059
8555
  * @param params.walletAccount - The wallet account to get the balance for.
8060
8556
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8061
8557
  * @returns A promise that resolves to an object containing the balance as a string or null.
8558
+ * @see getMultichainTokenBalances
8559
+ * @see switchActiveNetwork
8062
8560
  * @notInstrumented
8063
8561
  */
8064
8562
  const getNativeBalance = async ({ walletAccount }, client = getDefaultClient()) => {
@@ -8078,6 +8576,14 @@ const getNativeBalance = async ({ walletAccount }, client = getDefaultClient())
8078
8576
  * with the token-balance fetchers (`getTokenBalances` /
8079
8577
  * `getMultichainTokenBalances`).
8080
8578
  *
8579
+ * @example
8580
+ * ```ts
8581
+ * // Prefer getNativeBalance instead
8582
+ * const balance = await getNativeBalance({ walletAccount });
8583
+ * ```
8584
+ *
8585
+ * @see getNativeBalance
8586
+ * @see getMultichainBalances
8081
8587
  * @notInstrumented
8082
8588
  * @noHook Deprecated; the replacement is exposed via its own hook.
8083
8589
  */
@@ -8163,11 +8669,21 @@ const isProgrammaticNetworkSwitchAvailable = ({ walletAccount }, client = getDef
8163
8669
  * This function programmatically changes the network
8164
8670
  * that the wallet is currently connected to.
8165
8671
  *
8672
+ * @example
8673
+ * ```ts
8674
+ * await switchActiveNetwork({
8675
+ * walletAccount: wallets[0],
8676
+ * networkId: '137', // Polygon
8677
+ * });
8678
+ * ```
8679
+ *
8166
8680
  * @param params.networkId - The identifier of the network to switch to. Should match the networkId of the network data.
8167
8681
  * @param params.walletAccount - The wallet account to switch networks for.
8168
8682
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8169
8683
  * @returns A promise that resolves when the network switch is complete.
8170
8684
  * @throws NetworkSwitchingUnavailableError If the wallet provider doesn't support network switching.
8685
+ * @see getNativeBalance
8686
+ * @see isProgrammaticNetworkSwitchAvailable
8171
8687
  * @instrumented
8172
8688
  */
8173
8689
  const switchActiveNetwork = async ({ networkId, walletAccount }, client = getDefaultClient()) => {
@@ -8193,15 +8709,37 @@ const __switchActiveNetwork_wrapped = instrumentFunction({
8193
8709
  });
8194
8710
 
8195
8711
  //#endregion
8196
- //#region src/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.ts
8712
+ //#region src/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/setSelectedWalletAccount.ts
8197
8713
  /**
8198
- * Make the wallet account provided as the primary wallet account.
8714
+ * Set the wallet account that is currently selected for the user.
8715
+ *
8716
+ * The SDK itself does not use or care about which wallet is "selected" — this
8717
+ * only records the selection (updating the backend `lastSelectedAt` and, for
8718
+ * verified wallets, persisting it server-side) so it can later be read back via
8719
+ * `getSelectedWalletAccount`. It has no bearing on authentication or signing.
8720
+ * Applications that need a notion of an active/current wallet should own that
8721
+ * selection state themselves.
8722
+ *
8723
+ * The one exception is the wagmi integration (`@dynamic-labs-sdk/wagmi`), which
8724
+ * relies on the selected EVM wallet.
8725
+ *
8726
+ * @example
8727
+ * ```ts
8728
+ * const wallets = getWalletAccounts();
8729
+ * await setSelectedWalletAccount({ walletAccount: wallets[1] });
8730
+ * ```
8731
+ *
8732
+ * @param params.walletAccount - The wallet account to mark as selected.
8733
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8734
+ * @returns A promise that resolves when the selection is persisted.
8735
+ * @see getSelectedWalletAccount
8736
+ * @see getWalletAccounts
8199
8737
  * @instrumented
8200
- * @noHook The primary-wallet concept is discouraged and not exposed as a hook.
8738
+ * @noHook The selected-wallet concept is not exposed as a hook.
8201
8739
  */
8202
- const selectPrimaryWalletAccount = async ({ walletAccount }, client = getDefaultClient()) => {
8740
+ const setSelectedWalletAccount = async ({ walletAccount }, client = getDefaultClient()) => {
8203
8741
  const core = getCore(client);
8204
- if (getPrimaryWalletAccount(client)?.id === walletAccount.id) return;
8742
+ if (getSelectedWalletAccount(client)?.id === walletAccount.id) return;
8205
8743
  if (walletAccount.verifiedCredentialId) updateAuthFromVerifyResponse({ response: await createApiClient({}, client).selectUserWallet({
8206
8744
  environmentId: core.environmentId,
8207
8745
  userWalletSelectionRequest: { walletId: walletAccount.verifiedCredentialId }
@@ -8211,6 +8749,68 @@ const selectPrimaryWalletAccount = async ({ walletAccount }, client = getDefault
8211
8749
  lastSelectedAt: /* @__PURE__ */ new Date()
8212
8750
  }] }, client);
8213
8751
  };
8752
+ const __setSelectedWalletAccount_impl = setSelectedWalletAccount;
8753
+ const __setSelectedWalletAccount_wrapped = instrumentFunction({
8754
+ fn: __setSelectedWalletAccount_impl,
8755
+ functionName: "setSelectedWalletAccount",
8756
+ getCore: () => {
8757
+ try {
8758
+ return getCore(getDefaultClient());
8759
+ } catch {
8760
+ return;
8761
+ }
8762
+ }
8763
+ });
8764
+
8765
+ //#endregion
8766
+ //#region src/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.ts
8767
+ /**
8768
+ * Get the primary wallet account.
8769
+ *
8770
+ * @deprecated Renamed to `getSelectedWalletAccount`. The "primary wallet" naming was
8771
+ * misleading — the SDK does not use or care about which wallet is selected; it
8772
+ * only lets you *read* the user's most recently selected wallet. Migrate to
8773
+ * `getSelectedWalletAccount`, and own your own wallet-selection state in your
8774
+ * application rather than relying on the SDK's selected wallet.
8775
+ *
8776
+ * @example
8777
+ * ```ts
8778
+ * const primary = getPrimaryWalletAccount();
8779
+ * if (primary) {
8780
+ * console.log('Primary wallet:', primary.address);
8781
+ * }
8782
+ * ```
8783
+ *
8784
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8785
+ * @returns The primary wallet account, or null if no wallet has been selected.
8786
+ * @notInstrumented
8787
+ */
8788
+ const getPrimaryWalletAccount = (client = getDefaultClient()) => getSelectedWalletAccount(client);
8789
+
8790
+ //#endregion
8791
+ //#region src/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.ts
8792
+ /**
8793
+ * Make the wallet account provided as the primary wallet account.
8794
+ *
8795
+ * @deprecated Renamed to `setSelectedWalletAccount`. The "primary wallet" naming was
8796
+ * misleading — the SDK does not use or care about which wallet is selected;
8797
+ * this only records the selection so it can later be read back. Migrate to
8798
+ * `setSelectedWalletAccount`, and own your own wallet-selection state in your
8799
+ * application rather than relying on the SDK's selected wallet.
8800
+ *
8801
+ * @example
8802
+ * ```ts
8803
+ * const wallets = getWalletAccounts();
8804
+ * await selectPrimaryWalletAccount({ walletAccount: wallets[1] });
8805
+ * ```
8806
+ *
8807
+ * @param params.walletAccount - The wallet account to set as primary.
8808
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8809
+ * @returns A promise that resolves when the selection is persisted.
8810
+ * @instrumented
8811
+ * @noHook The selected-wallet concept is not exposed as a hook.
8812
+ */
8813
+ const selectPrimaryWalletAccount = async ({ walletAccount }, client = getDefaultClient()) => __setSelectedWalletAccount_wrapped({ walletAccount }, client);
8214
8814
  const __selectPrimaryWalletAccount_impl = selectPrimaryWalletAccount;
8215
8815
  const __selectPrimaryWalletAccount_wrapped = instrumentFunction({
8216
8816
  fn: __selectPrimaryWalletAccount_impl,
@@ -8227,10 +8827,23 @@ const __selectPrimaryWalletAccount_wrapped = instrumentFunction({
8227
8827
  //#endregion
8228
8828
  //#region src/modules/wallets/disconnectWalletAccount/disconnectWalletAccount.ts
8229
8829
  /**
8230
- * This function disconnects the specified wallet account with the wallet provider.
8830
+ * Disconnects the specified wallet account from its wallet provider.
8231
8831
  *
8232
- * The wallet account is not removed from the user's profile or from dynamic's state,
8832
+ * The wallet account is not removed from the user's profile or from Dynamic's state,
8233
8833
  * it is only responsible for terminating the connection with the wallet provider.
8834
+ * Use `removeWalletAccount` to fully remove a wallet from the user's session.
8835
+ *
8836
+ * @example
8837
+ * ```ts
8838
+ * const wallets = getWalletAccounts();
8839
+ * await disconnectWalletAccount({ walletAccount: wallets[0] }, client);
8840
+ * ```
8841
+ *
8842
+ * @param params.walletAccount - The wallet account to disconnect.
8843
+ * @param client - The Dynamic client instance.
8844
+ * @returns A promise that resolves when the wallet is disconnected from the provider.
8845
+ * @see removeWalletAccount
8846
+ * @see connectWithWalletProvider
8234
8847
  * @notInstrumented
8235
8848
  */
8236
8849
  const disconnectWalletAccount = async ({ walletAccount }, client) => {
@@ -8251,9 +8864,17 @@ const disconnectWalletAccount = async ({ walletAccount }, client) => {
8251
8864
  * updating local state and server records (if there is an authenticated user).
8252
8865
  * For verified wallets, it will unlink them from the user's account.
8253
8866
  *
8867
+ * @example
8868
+ * ```ts
8869
+ * const wallets = getWalletAccounts();
8870
+ * await removeWalletAccount({ walletAccount: wallets[0] });
8871
+ * ```
8872
+ *
8254
8873
  * @param params.walletAccount - The wallet account to remove.
8255
8874
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8256
8875
  * @returns A promise that resolves when the wallet account is successfully removed.
8876
+ * @see getWalletAccounts
8877
+ * @see disconnectWalletAccount
8257
8878
  * @instrumented
8258
8879
  */
8259
8880
  const removeWalletAccount = async ({ walletAccount }, client = getDefaultClient()) => {
@@ -8290,10 +8911,21 @@ const __removeWalletAccount_wrapped = instrumentFunction({
8290
8911
  * This function uses the wallet's private key to cryptographically sign
8291
8912
  * the provided message.
8292
8913
  *
8914
+ * @example
8915
+ * ```ts
8916
+ * const wallets = getWalletAccounts();
8917
+ * const { signature } = await signMessage({
8918
+ * walletAccount: wallets[0],
8919
+ * message: 'Hello Dynamic!',
8920
+ * });
8921
+ * ```
8922
+ *
8293
8923
  * @param params.walletAccount - The wallet account to use for signing.
8294
8924
  * @param params.message - The message to sign.
8295
8925
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8296
8926
  * @returns A promise that resolves to an object containing the signature.
8927
+ * @see getWalletAccounts
8928
+ * @see connectWithWalletProvider
8297
8929
  * @instrumented
8298
8930
  */
8299
8931
  const signMessage = async ({ walletAccount, message }, client = getDefaultClient()) => {
@@ -8326,13 +8958,24 @@ const __signMessage_wrapped = instrumentFunction({
8326
8958
  * Supports native token transfers and, where supported by the chain,
8327
8959
  * fungible/token transfers via the optional `token` parameter.
8328
8960
  *
8961
+ * @example
8962
+ * ```ts
8963
+ * const { transactionHash } = await transferAmount({
8964
+ * walletAccount: wallets[0],
8965
+ * amount: '0.1',
8966
+ * recipient: '0x1234...abcd',
8967
+ * });
8968
+ * ```
8969
+ *
8329
8970
  * @param params.walletAccount - The wallet account to transfer from.
8330
8971
  * @param params.amount - The amount to transfer as a decimal string (e.g. "1.5").
8331
8972
  * @param params.recipient - The recipient address.
8332
- * @param params.token - Optional token info for non-native transfers.
8973
+ * @param [params.token] - Optional token info for non-native transfers.
8333
8974
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8334
8975
  * @returns A promise that resolves to an object containing the transaction hash.
8335
8976
  * @throws If the wallet provider does not support the transfer amount method.
8977
+ * @see getWalletAccounts
8978
+ * @see signMessage
8336
8979
  * @instrumented
8337
8980
  */
8338
8981
  const transferAmount = async ({ walletAccount, amount, recipient, token }, client = getDefaultClient()) => {
@@ -8367,9 +9010,18 @@ const __transferAmount_wrapped = instrumentFunction({
8367
9010
  * This function requires the user to sign a message to prove wallet ownership,
8368
9011
  * then transfers the wallet account to the current user's account.
8369
9012
  *
9013
+ * @example
9014
+ * ```ts
9015
+ * const walletAccount = await transferWalletAccount({
9016
+ * walletProviderKey: 'metamaskevm',
9017
+ * });
9018
+ * ```
9019
+ *
8370
9020
  * @param params.walletProviderKey - The key of the wallet provider of the wallet account to transfer.
8371
9021
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8372
9022
  * @returns A promise that resolves to the transferred wallet account.
9023
+ * @see connectWithWalletProvider
9024
+ * @see verifyWalletAccount
8373
9025
  * @instrumented
8374
9026
  */
8375
9027
  const transferWalletAccount = async ({ walletProviderKey }, client = getDefaultClient()) => {
@@ -8402,10 +9054,20 @@ const __transferWalletAccount_wrapped = instrumentFunction({
8402
9054
  * This function searches through the current session's wallet accounts
8403
9055
  * to find one matching the specified address and chain.
8404
9056
  *
9057
+ * @example
9058
+ * ```ts
9059
+ * const account = getWalletAccountFromAddress({
9060
+ * address: '0x1234...abcd',
9061
+ * chain: 'EVM',
9062
+ * });
9063
+ * ```
9064
+ *
8405
9065
  * @param params.address - The wallet address to search for.
8406
9066
  * @param params.chain - The blockchain the wallet belongs to.
8407
9067
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8408
9068
  * @returns The matching wallet account, or undefined if not found.
9069
+ * @see getWalletAccounts
9070
+ * @see isWalletAccountVerified
8409
9071
  * @notInstrumented
8410
9072
  */
8411
9073
  const getWalletAccountFromAddress = ({ address, chain }, client = getDefaultClient()) => {
@@ -8564,5 +9226,5 @@ const parseUserAgent = ({ userAgent }) => {
8564
9226
  assertPackageVersion(name, version);
8565
9227
 
8566
9228
  //#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 };
9229
+ 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
9230
  //# sourceMappingURL=index.esm.js.map