@dynamic-labs-sdk/client 1.18.0 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/dist/client/createDynamicClient/createDynamicClient.d.ts +11 -1
  2. package/dist/client/createDynamicClient/createDynamicClient.d.ts.map +1 -1
  3. package/dist/client/defaultClient/defaultClient.d.ts +12 -1
  4. package/dist/client/defaultClient/defaultClient.d.ts.map +1 -1
  5. package/dist/core.cjs +5 -5
  6. package/dist/core.esm.js +7 -7
  7. package/dist/core.esm.js.map +1 -1
  8. package/dist/core.native.esm.js +7 -7
  9. package/dist/core.native.esm.js.map +1 -1
  10. package/dist/errors/APIError/APIError.d.ts +11 -1
  11. package/dist/errors/APIError/APIError.d.ts.map +1 -1
  12. package/dist/errors/DeviceRegistrationIdentityMismatchError.d.ts +21 -0
  13. package/dist/errors/DeviceRegistrationIdentityMismatchError.d.ts.map +1 -1
  14. package/dist/errors/MergeAccountsConfirmationError.d.ts +49 -0
  15. package/dist/errors/MergeAccountsConfirmationError.d.ts.map +1 -0
  16. package/dist/errors/WalletScreeningBlockedError.d.ts +13 -0
  17. package/dist/errors/WalletScreeningBlockedError.d.ts.map +1 -1
  18. package/dist/exports/index.d.ts +15 -5
  19. package/dist/exports/index.d.ts.map +1 -1
  20. package/dist/exports/waas.d.ts +2 -0
  21. package/dist/exports/waas.d.ts.map +1 -1
  22. package/dist/{getNetworkProviderFromNetworkId-CMIgKqEH.cjs → getNetworkProviderFromNetworkId-BJX2AMGR.cjs} +74 -4
  23. package/dist/getNetworkProviderFromNetworkId-BJX2AMGR.cjs.map +1 -0
  24. package/dist/{getNetworkProviderFromNetworkId-C6DBO0OX.native.esm.js → getNetworkProviderFromNetworkId-Bsv12Q6B.native.esm.js} +90 -9
  25. package/dist/getNetworkProviderFromNetworkId-Bsv12Q6B.native.esm.js.map +1 -0
  26. package/dist/{getNetworkProviderFromNetworkId-CEs4SGW4.esm.js → getNetworkProviderFromNetworkId-D3uwhdMN.esm.js} +72 -8
  27. package/dist/getNetworkProviderFromNetworkId-D3uwhdMN.esm.js.map +1 -0
  28. package/dist/{getSignedSessionId-De_N_Ofg.cjs → getSignedSessionId-BIZJGg61.cjs} +3 -3
  29. package/dist/{getSignedSessionId-De_N_Ofg.cjs.map → getSignedSessionId-BIZJGg61.cjs.map} +1 -1
  30. package/dist/{getSignedSessionId-CUqILBh8.esm.js → getSignedSessionId-CnSAMO3P.esm.js} +3 -3
  31. package/dist/{getSignedSessionId-CUqILBh8.esm.js.map → getSignedSessionId-CnSAMO3P.esm.js.map} +1 -1
  32. package/dist/{getSignedSessionId-Hp1nSbaW.native.esm.js → getSignedSessionId-DXDi7NkE.native.esm.js} +3 -3
  33. package/dist/{getSignedSessionId-Hp1nSbaW.native.esm.js.map → getSignedSessionId-DXDi7NkE.native.esm.js.map} +1 -1
  34. package/dist/{getWalletProviderByKey-D3e0XMjs.cjs → getWalletProviderByKey-C6aS7KgD.cjs} +2 -2
  35. package/dist/{getWalletProviderByKey-D3e0XMjs.cjs.map → getWalletProviderByKey-C6aS7KgD.cjs.map} +1 -1
  36. package/dist/{getWalletProviderByKey-CKORCA8l.esm.js → getWalletProviderByKey-Cr8m-Nax.esm.js} +2 -2
  37. package/dist/{getWalletProviderByKey-CKORCA8l.esm.js.map → getWalletProviderByKey-Cr8m-Nax.esm.js.map} +1 -1
  38. package/dist/{getWalletProviderByKey-D5M801xH.native.esm.js → getWalletProviderByKey-DVk2t98D.native.esm.js} +2 -2
  39. package/dist/{getWalletProviderByKey-D5M801xH.native.esm.js.map → getWalletProviderByKey-DVk2t98D.native.esm.js.map} +1 -1
  40. package/dist/index.cjs +732 -54
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.esm.js +729 -53
  43. package/dist/index.esm.js.map +1 -1
  44. package/dist/index.native.esm.js +656 -52
  45. package/dist/index.native.esm.js.map +1 -1
  46. package/dist/{isDynamicWaasEnabled-BQuXZne_.cjs → isDynamicWaasEnabled-BawttOeb.cjs} +20 -6
  47. package/dist/isDynamicWaasEnabled-BawttOeb.cjs.map +1 -0
  48. package/dist/{isDynamicWaasEnabled-BlVIlXMZ.esm.js → isDynamicWaasEnabled-DDrg89y1.esm.js} +19 -5
  49. package/dist/isDynamicWaasEnabled-DDrg89y1.esm.js.map +1 -0
  50. package/dist/{isDynamicWaasEnabled-BaY09iv6.native.esm.js → isDynamicWaasEnabled-Dj_sLoBO.native.esm.js} +19 -5
  51. package/dist/isDynamicWaasEnabled-Dj_sLoBO.native.esm.js.map +1 -0
  52. package/dist/{isMfaRequiredForAction-Dghiguch.cjs → isMfaRequiredForAction-BuvyBN_r.cjs} +19 -2
  53. package/dist/isMfaRequiredForAction-BuvyBN_r.cjs.map +1 -0
  54. package/dist/{isMfaRequiredForAction-r9aDdmK5.esm.js → isMfaRequiredForAction-DTp4CZBt.esm.js} +19 -2
  55. package/dist/isMfaRequiredForAction-DTp4CZBt.esm.js.map +1 -0
  56. package/dist/{isMfaRequiredForAction-CwOGwiDz.native.esm.js → isMfaRequiredForAction-EY-OQORc.native.esm.js} +2 -2
  57. package/dist/{isMfaRequiredForAction-CwOGwiDz.native.esm.js.map → isMfaRequiredForAction-EY-OQORc.native.esm.js.map} +1 -1
  58. package/dist/{isUserOnboardingComplete-j4b_q9Pf.cjs → isUserOnboardingComplete-CkyzRYrg.cjs} +11 -4
  59. package/dist/{isUserOnboardingComplete-j4b_q9Pf.cjs.map → isUserOnboardingComplete-CkyzRYrg.cjs.map} +1 -1
  60. package/dist/{isUserOnboardingComplete-C-ioFLRR.native.esm.js → isUserOnboardingComplete-D3HrBYje.native.esm.js} +10 -3
  61. package/dist/{isUserOnboardingComplete-C-ioFLRR.native.esm.js.map → isUserOnboardingComplete-D3HrBYje.native.esm.js.map} +1 -1
  62. package/dist/{isUserOnboardingComplete-BMNAbXk1.esm.js → isUserOnboardingComplete-Dy2Ygp0u.esm.js} +10 -3
  63. package/dist/{isUserOnboardingComplete-BMNAbXk1.esm.js.map → isUserOnboardingComplete-Dy2Ygp0u.esm.js.map} +1 -1
  64. package/dist/{migrateFromFireblocks-D8Y5h0hz.native.esm.js → migrateFromFireblocks-B5qWGLCM.native.esm.js} +3 -3
  65. package/dist/{migrateFromFireblocks-D8Y5h0hz.native.esm.js.map → migrateFromFireblocks-B5qWGLCM.native.esm.js.map} +1 -1
  66. package/dist/{migrateFromFireblocks-D9pJIgt5.cjs → migrateFromFireblocks-Dp-QA9hi.cjs} +3 -3
  67. package/dist/{migrateFromFireblocks-D9pJIgt5.cjs.map → migrateFromFireblocks-Dp-QA9hi.cjs.map} +1 -1
  68. package/dist/{migrateFromFireblocks-D--uqWp5.esm.js → migrateFromFireblocks-MAatsk_w.esm.js} +3 -3
  69. package/dist/{migrateFromFireblocks-D--uqWp5.esm.js.map → migrateFromFireblocks-MAatsk_w.esm.js.map} +1 -1
  70. package/dist/modules/apiClient/constants.d.ts +8 -0
  71. package/dist/modules/apiClient/constants.d.ts.map +1 -1
  72. package/dist/modules/apiClient/createApiClient.d.ts.map +1 -1
  73. package/dist/modules/auth/externalAuth/signInWithExternalJwt/signInWithExternalJwt.d.ts +11 -1
  74. package/dist/modules/auth/externalAuth/signInWithExternalJwt/signInWithExternalJwt.d.ts.map +1 -1
  75. package/dist/modules/auth/isSignedIn/isSignedIn.d.ts +9 -0
  76. package/dist/modules/auth/isSignedIn/isSignedIn.d.ts.map +1 -1
  77. package/dist/modules/auth/logout/logout.d.ts +13 -0
  78. package/dist/modules/auth/logout/logout.d.ts.map +1 -1
  79. package/dist/modules/auth/mergeUserAccounts/index.d.ts +3 -0
  80. package/dist/modules/auth/mergeUserAccounts/index.d.ts.map +1 -0
  81. package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.d.ts +62 -0
  82. package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.d.ts.map +1 -0
  83. package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.types.d.ts +78 -0
  84. package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.types.d.ts.map +1 -0
  85. package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts +7 -0
  86. package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts.map +1 -1
  87. package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts +9 -0
  88. package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts.map +1 -1
  89. package/dist/modules/auth/social/oauth/authenticateWithSocial/authenticateWithSocial.d.ts +8 -0
  90. package/dist/modules/auth/social/oauth/authenticateWithSocial/authenticateWithSocial.d.ts.map +1 -1
  91. package/dist/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.d.ts +34 -0
  92. package/dist/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.d.ts.map +1 -0
  93. package/dist/modules/auth/social/oauth/clearSocialRedirectParams/index.d.ts +2 -0
  94. package/dist/modules/auth/social/oauth/clearSocialRedirectParams/index.d.ts.map +1 -0
  95. package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.d.ts +11 -0
  96. package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.d.ts.map +1 -1
  97. package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.d.ts +0 -1
  98. package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.d.ts.map +1 -1
  99. package/dist/modules/auth/social/oauth/signInWithSocialPopUp/signInWithSocialPopUp.d.ts +12 -0
  100. package/dist/modules/auth/social/oauth/signInWithSocialPopUp/signInWithSocialPopUp.d.ts.map +1 -1
  101. package/dist/modules/auth/social/oauth/signInWithSocialRedirect/signInWithSocialRedirect.d.ts +10 -0
  102. package/dist/modules/auth/social/oauth/signInWithSocialRedirect/signInWithSocialRedirect.d.ts.map +1 -1
  103. package/dist/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.d.ts.map +1 -1
  104. package/dist/modules/captcha/CaptchaProviderEnum/CaptchaProviderEnum.d.ts +37 -0
  105. package/dist/modules/captcha/CaptchaProviderEnum/CaptchaProviderEnum.d.ts.map +1 -0
  106. package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.d.ts +41 -5
  107. package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.d.ts.map +1 -1
  108. package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.types.d.ts +22 -0
  109. package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.types.d.ts.map +1 -0
  110. package/dist/modules/captcha/getCaptchaSettings/index.d.ts +1 -1
  111. package/dist/modules/captcha/getCaptchaSettings/index.d.ts.map +1 -1
  112. package/dist/modules/clientEvents/clientEvents.d.ts +34 -0
  113. package/dist/modules/clientEvents/clientEvents.d.ts.map +1 -1
  114. package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/clearDeviceRegistrationRedirectParams.d.ts +35 -0
  115. package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/clearDeviceRegistrationRedirectParams.d.ts.map +1 -0
  116. package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/index.d.ts +2 -0
  117. package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/index.d.ts.map +1 -0
  118. package/dist/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.d.ts +8 -1
  119. package/dist/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.d.ts.map +1 -1
  120. package/dist/modules/flow/cancelFlow/cancelFlow.d.ts +10 -3
  121. package/dist/modules/flow/cancelFlow/cancelFlow.d.ts.map +1 -1
  122. package/dist/modules/flow/getFlow/getFlow.d.ts +11 -3
  123. package/dist/modules/flow/getFlow/getFlow.d.ts.map +1 -1
  124. package/dist/modules/flow/getFlowQuote/getFlowQuote.d.ts +16 -3
  125. package/dist/modules/flow/getFlowQuote/getFlowQuote.d.ts.map +1 -1
  126. package/dist/modules/initializeClient/initializeClient.d.ts +16 -0
  127. package/dist/modules/initializeClient/initializeClient.d.ts.map +1 -1
  128. package/dist/modules/initializeClient/waitForClientInitialized/waitForClientInitialized.d.ts +12 -2
  129. package/dist/modules/initializeClient/waitForClientInitialized/waitForClientInitialized.d.ts.map +1 -1
  130. package/dist/modules/otp/sendEmailOTP/sendEmailOTP.d.ts +14 -0
  131. package/dist/modules/otp/sendEmailOTP/sendEmailOTP.d.ts.map +1 -1
  132. package/dist/modules/otp/sendSmsOTP/sendSmsOTP.d.ts +12 -0
  133. package/dist/modules/otp/sendSmsOTP/sendSmsOTP.d.ts.map +1 -1
  134. package/dist/modules/otp/verifyOTP/verifyOTP.d.ts +33 -1
  135. package/dist/modules/otp/verifyOTP/verifyOTP.d.ts.map +1 -1
  136. package/dist/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.d.ts +1 -1
  137. package/dist/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.d.ts.map +1 -1
  138. package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts +8 -0
  139. package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts.map +1 -1
  140. package/dist/modules/user/checkUserScopes/checkUserScopes.d.ts +28 -0
  141. package/dist/modules/user/checkUserScopes/checkUserScopes.d.ts.map +1 -0
  142. package/dist/modules/user/checkUserScopes/index.d.ts +2 -0
  143. package/dist/modules/user/checkUserScopes/index.d.ts.map +1 -0
  144. package/dist/modules/user/deleteUser/deleteUser.d.ts +8 -0
  145. package/dist/modules/user/deleteUser/deleteUser.d.ts.map +1 -1
  146. package/dist/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.d.ts +8 -1
  147. package/dist/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.d.ts.map +1 -1
  148. package/dist/modules/user/refreshAuth/refreshAuth.d.ts +17 -3
  149. package/dist/modules/user/refreshAuth/refreshAuth.d.ts.map +1 -1
  150. package/dist/modules/user/refreshUser/refreshUser.d.ts +16 -3
  151. package/dist/modules/user/refreshUser/refreshUser.d.ts.map +1 -1
  152. package/dist/modules/user/user.types.d.ts +9 -1
  153. package/dist/modules/user/user.types.d.ts.map +1 -1
  154. package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/getEmbeddedWalletsRequiringUpgrade.d.ts +30 -0
  155. package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/getEmbeddedWalletsRequiringUpgrade.d.ts.map +1 -0
  156. package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/index.d.ts +2 -0
  157. package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/index.d.ts.map +1 -0
  158. package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/hasEmbeddedWalletsRequiringUpgrade.d.ts +23 -0
  159. package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/hasEmbeddedWalletsRequiringUpgrade.d.ts.map +1 -0
  160. package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/index.d.ts +2 -0
  161. package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/index.d.ts.map +1 -0
  162. package/dist/modules/wallets/connectAndVerifyWithWalletProvider/connectAndVerifyWithWalletProvider.d.ts +11 -1
  163. package/dist/modules/wallets/connectAndVerifyWithWalletProvider/connectAndVerifyWithWalletProvider.d.ts.map +1 -1
  164. package/dist/modules/wallets/connectWithWalletProvider/connectWithWalletProvider.d.ts +11 -3
  165. package/dist/modules/wallets/connectWithWalletProvider/connectWithWalletProvider.d.ts.map +1 -1
  166. package/dist/modules/wallets/disconnectWalletAccount/disconnectWalletAccount.d.ts +16 -3
  167. package/dist/modules/wallets/disconnectWalletAccount/disconnectWalletAccount.d.ts.map +1 -1
  168. package/dist/modules/wallets/getConnectedAddresses/getConnectedAddresses.d.ts +9 -1
  169. package/dist/modules/wallets/getConnectedAddresses/getConnectedAddresses.d.ts.map +1 -1
  170. package/dist/modules/wallets/getWalletAccounts/getWalletAccounts.d.ts +11 -1
  171. package/dist/modules/wallets/getWalletAccounts/getWalletAccounts.d.ts.map +1 -1
  172. package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts +9 -0
  173. package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts.map +1 -1
  174. package/dist/modules/wallets/isWalletAccountVerified/isWalletAccountVerified.d.ts +10 -2
  175. package/dist/modules/wallets/isWalletAccountVerified/isWalletAccountVerified.d.ts.map +1 -1
  176. package/dist/modules/wallets/networks/getBalance/getBalance.d.ts +8 -0
  177. package/dist/modules/wallets/networks/getBalance/getBalance.d.ts.map +1 -1
  178. package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts +8 -0
  179. package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts.map +1 -1
  180. package/dist/modules/wallets/networks/switchActiveNetwork/switchActiveNetwork.d.ts +11 -1
  181. package/dist/modules/wallets/networks/switchActiveNetwork/switchActiveNetwork.d.ts.map +1 -1
  182. package/dist/modules/wallets/proveWalletAccountOwnership/proveWalletAccountOwnership.d.ts +10 -0
  183. package/dist/modules/wallets/proveWalletAccountOwnership/proveWalletAccountOwnership.d.ts.map +1 -1
  184. package/dist/modules/wallets/removeWalletAccount/removeWalletAccount.d.ts +9 -1
  185. package/dist/modules/wallets/removeWalletAccount/removeWalletAccount.d.ts.map +1 -1
  186. package/dist/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts +24 -0
  187. package/dist/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts.map +1 -0
  188. package/dist/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/index.d.ts.map +1 -0
  189. package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/getSelectedWalletAccount.d.ts +30 -0
  190. package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/getSelectedWalletAccount.d.ts.map +1 -0
  191. package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/index.d.ts +2 -0
  192. package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/index.d.ts.map +1 -0
  193. package/dist/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/index.d.ts.map +1 -0
  194. package/dist/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts +28 -0
  195. package/dist/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts.map +1 -0
  196. package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/index.d.ts +2 -0
  197. package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/index.d.ts.map +1 -0
  198. package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/setSelectedWalletAccount.d.ts +34 -0
  199. package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/setSelectedWalletAccount.d.ts.map +1 -0
  200. package/dist/modules/wallets/signMessage/signMessage.d.ts +12 -1
  201. package/dist/modules/wallets/signMessage/signMessage.d.ts.map +1 -1
  202. package/dist/modules/wallets/transferAmount/transferAmount.d.ts +13 -2
  203. package/dist/modules/wallets/transferAmount/transferAmount.d.ts.map +1 -1
  204. package/dist/modules/wallets/transferWalletAccount/transferWalletAccount.d.ts +10 -1
  205. package/dist/modules/wallets/transferWalletAccount/transferWalletAccount.d.ts.map +1 -1
  206. package/dist/modules/wallets/utils/getWalletAccountFromAddress/getWalletAccountFromAddress.d.ts +11 -1
  207. package/dist/modules/wallets/utils/getWalletAccountFromAddress/getWalletAccountFromAddress.d.ts.map +1 -1
  208. package/dist/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.d.ts +1 -0
  209. package/dist/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.d.ts.map +1 -1
  210. package/dist/modules/wallets/verifyWalletAccount/verifyWalletAccount.d.ts +12 -1
  211. package/dist/modules/wallets/verifyWalletAccount/verifyWalletAccount.d.ts.map +1 -1
  212. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  213. package/dist/{updateAuthFromVerifyResponse-wVY_DoiL.native.esm.js → updateAuthFromVerifyResponse-DFjqCSu2.native.esm.js} +93 -17
  214. package/dist/updateAuthFromVerifyResponse-DFjqCSu2.native.esm.js.map +1 -0
  215. package/dist/{updateAuthFromVerifyResponse-BQes11vz.esm.js → updateAuthFromVerifyResponse-_oYRLK_w.esm.js} +93 -17
  216. package/dist/updateAuthFromVerifyResponse-_oYRLK_w.esm.js.map +1 -0
  217. package/dist/{updateAuthFromVerifyResponse-Deg9em9o.cjs → updateAuthFromVerifyResponse-pgYXvDvj.cjs} +93 -17
  218. package/dist/updateAuthFromVerifyResponse-pgYXvDvj.cjs.map +1 -0
  219. package/dist/waas.cjs +72 -5
  220. package/dist/waas.cjs.map +1 -1
  221. package/dist/waas.esm.js +70 -5
  222. package/dist/waas.esm.js.map +1 -1
  223. package/dist/waas.native.esm.js +70 -5
  224. package/dist/waas.native.esm.js.map +1 -1
  225. package/dist/waasCore.cjs +6 -6
  226. package/dist/waasCore.esm.js +6 -6
  227. package/dist/waasCore.native.esm.js +6 -6
  228. package/package.json +3 -3
  229. package/dist/getNetworkProviderFromNetworkId-C6DBO0OX.native.esm.js.map +0 -1
  230. package/dist/getNetworkProviderFromNetworkId-CEs4SGW4.esm.js.map +0 -1
  231. package/dist/getNetworkProviderFromNetworkId-CMIgKqEH.cjs.map +0 -1
  232. package/dist/isDynamicWaasEnabled-BQuXZne_.cjs.map +0 -1
  233. package/dist/isDynamicWaasEnabled-BaY09iv6.native.esm.js.map +0 -1
  234. package/dist/isDynamicWaasEnabled-BlVIlXMZ.esm.js.map +0 -1
  235. package/dist/isMfaRequiredForAction-Dghiguch.cjs.map +0 -1
  236. package/dist/isMfaRequiredForAction-r9aDdmK5.esm.js.map +0 -1
  237. package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts +0 -10
  238. package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts.map +0 -1
  239. package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/index.d.ts.map +0 -1
  240. package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/index.d.ts.map +0 -1
  241. package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts +0 -12
  242. package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts.map +0 -1
  243. package/dist/updateAuthFromVerifyResponse-BQes11vz.esm.js.map +0 -1
  244. package/dist/updateAuthFromVerifyResponse-Deg9em9o.cjs.map +0 -1
  245. package/dist/updateAuthFromVerifyResponse-wVY_DoiL.native.esm.js.map +0 -1
  246. /package/dist/modules/wallets/{primaryWalletAccount → selectedWalletAccount}/getPrimaryWalletAccount/index.d.ts +0 -0
  247. /package/dist/modules/wallets/{primaryWalletAccount → selectedWalletAccount}/selectPrimaryWalletAccount/index.d.ts +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"getNetworkProviderFromNetworkId-CMIgKqEH.cjs","names":["BaseError","item: StorageFormat<typeof value>","BufferPolyfill","resolve: (value: T) => void","reject: (reason?: unknown) => void","BaseError","z","EventEmitter","LOG_LEVELS: Record<LogLevel, number>","eventEmitter: LoggerEventEmitter","EventEmitter","minLevel: LogLevel","BaseError","parsed: URL","buffer","BaseError","createKeychainService: CreateKeychainService","entry: StoredKey","BaseError","BaseError","ABLY_STATE_TO_REALTIME_STATE: Record<string, RealtimeConnectionState>","EventEmitter","ablyClient: BaseRealtime | undefined","connectionState: RealtimeConnectionState","connect: RealtimeService['connect']","getCore","createApiClient","disconnect: RealtimeService['disconnect']","subscribe: RealtimeService['subscribe']","handler: messageCallback<InboundMessage>","unsubscribe: RealtimeService['unsubscribe']","publish: RealtimeService['publish']","BaseError","BaseError","BaseError","getDefaultClient","getCore","BaseError","getDefaultClient","getCore","AuthModeEnum","getCore","createApiClient","getWalletProviderFromWalletAccount","normalizeWalletNameWithChain","connectRequest: ConnectRequest","getCore","filteredUnverifiedWalletAccounts: UnverifiedWalletAccount[]","getCore","getWalletAccounts","newWalletAccounts: WalletAccount[]","unverifiedWalletAccountsToUpdate: WalletAccount[]","verifiedCredentialIdToWalletProviderKeyMap: Record<string, string>","reconciledWalletAccounts: WalletAccount[]","getCore","suffixFields: string[]","getCore","getCore","createApiClient","normalizeWalletNameWithChain","CHAINS_INFO_MAP","getDefaultClient","getCore","createRuntimeServiceAccessKey","networkProvider"],"sources":["../src/utils/isEqualShallow/isEqualShallow.ts","../src/utils/observable/subscribeWithSelector/subscribeWithSelector.ts","../src/services/storage/createLocalStorageAdapter/createLocalStorageAdapter.ts","../src/errors/InvalidStorageSet.ts","../src/services/storage/createStorage/formatForStorage/isValidDateISOString/isValidDateISOString.ts","../src/services/storage/createStorage/formatForStorage/storageFormat.ts","../src/services/storage/createStorage/createStorage.ts","../src/utils/getBuffer/getBuffer.ts","../src/utils/isServerSideRendering/isServerSideRendering.ts","../src/modules/initializeClient/consts.ts","../src/utils/deferredPromise/createDeferredPromise.ts","../src/errors/CannotTrackError.ts","../src/services/crossTabBroadcast/crossTabBroadcast.schema.ts","../src/services/crossTabBroadcast/createCrossTabBroadcast/createCrossTabBroadcast.ts","../src/services/logger/createLogger/createLogger.ts","../src/errors/UnsafeNavigationUrlError.ts","../src/utils/assertSafeNavigationUrl/assertSafeNavigationUrl.ts","../src/utils/bufferToHex/bufferToHex.ts","../src/utils/compressRawPublicKey/compressRawPublicKey.ts","../src/services/keychain/createKeychainService/KeyNotFoundError.ts","../src/services/keychain/createKeychainService/utils/constants.ts","../src/services/keychain/createKeychainService/utils/deleteIndexedDBItem.ts","../src/services/keychain/createKeychainService/utils/getIndexedDBItem.ts","../src/services/keychain/createKeychainService/utils/setIndexedDBItem.ts","../src/services/keychain/createKeychainService/utils/openDatabase.ts","../src/services/keychain/createKeychainService/utils/withDatabase/withDatabase.ts","../src/services/keychain/createKeychainService/createKeychainService.ts","../src/errors/InvalidRealtimePublishError.ts","../src/errors/RealtimeNotConnectedError.ts","../src/services/realtime/createRealtimeService/createRealtimeService.ts","../src/utils/getKeychainIndexedDBName/getKeychainIndexedDBName.ts","../src/errors/NoNetworkProvidersError.ts","../src/errors/WalletAlreadyLinkedToAnotherUserError.ts","../src/errors/WalletScreeningBlockedError.ts","../src/modules/captcha/isCaptchaRequired/isCaptchaRequired.ts","../src/modules/captcha/consumeCaptchaToken/consumeCaptchaToken.ts","../src/errors/MethodNotImplementedError.ts","../src/modules/captcha/setCaptchaToken/setCaptchaToken.ts","../src/modules/extension/hasExtension/hasExtension.ts","../src/modules/auth/createVisit/createVisit.ts","../src/modules/wallets/unverifiedWalletAccounts/setUnverifiedWalletAccounts/setUnverifiedWalletAccounts.ts","../src/modules/wallets/walletProvider/walletProviderKeyMap/updateWalletProviderKeysForVerifiedCredentials/updateWalletProviderKeysForVerifiedCredentials.ts","../src/modules/wallets/reconcileWalletAccountsAgainstClient/reconcileWalletAccountsAgainstClient.ts","../src/utils/getAppMetadata/getAppMetadata.ts","../src/modules/wallets/utils/formatSignInMessage/formatSignInMessage.ts","../src/modules/wallets/utils/getSignInMessage/createSignInMessageStatement/createSignInMessageStatement.ts","../src/modules/wallets/unverifiedWalletAccounts/removeUnverifiedWalletAccount/removeUnverifiedWalletAccount.ts","../src/utils/isError/isError.ts","../src/utils/isErrorWithCode/isErrorWithCode.ts","../src/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.ts","../src/modules/wallets/networks/getSdkChainFromApiChainName/getSdkChainFromApiChainName.ts","../src/modules/wallets/networks/getNetworksData/getNetworksData.ts","../src/modules/wallets/networks/networkProviderBuilderRegistry/createNetworkProviderBuilderRegistry/createNetworkProviderBuilderRegistry.ts","../src/modules/wallets/networks/networkProviderBuilderRegistry/getNetworkProviderBuilderRegistry/getNetworkProviderBuilderRegistry.ts","../src/modules/wallets/networks/getNetworkProviders/getNetworkProviders.ts","../src/modules/wallets/networks/getNetworkProviderFromNetworkId/getNetworkProviderFromNetworkId.ts"],"sourcesContent":["/**\n * Shallow compare two objects.\n *\n * Source: https://github.com/pmndrs/zustand/blob/main/src/vanilla/shallow.ts\n * @notInstrumented\n */\n// eslint-disable-next-line custom-rules/require-single-object-param\nexport const isEqualShallow = <T>(objA: T, objB: T) => {\n if (Object.is(objA, objB)) return true;\n\n if (\n typeof objA !== 'object' ||\n objA === null ||\n typeof objB !== 'object' ||\n objB === null\n ) {\n return objA === objB;\n }\n\n if (objA instanceof Map && objB instanceof Map) {\n if (objA.size !== objB.size) return false;\n\n for (const [key, value] of objA) {\n if (!Object.is(value, objB.get(key))) return false;\n }\n\n return true;\n }\n\n if (objA instanceof Set && objB instanceof Set) {\n if (objA.size !== objB.size) return false;\n\n for (const value of objA) {\n if (!objB.has(value)) return false;\n }\n return true;\n }\n\n const keysA = Object.keys(objA);\n\n if (keysA.length !== Object.keys(objB).length) return false;\n\n for (const keyA of keysA) {\n if (\n !Object.prototype.hasOwnProperty.call(objB, keyA as string) ||\n !Object.is(objA[keyA as keyof T], objB[keyA as keyof T])\n ) {\n return false;\n }\n }\n\n if (objA.constructor !== objB.constructor) return false;\n\n return true;\n};\n","import { isEqualShallow } from '../../isEqualShallow';\nimport type { ObservableState } from '../observable.types';\n\n/**\n * Allows subscribing to a slice of the state.\n * The slice is a computation of the states.\n *\n * The callback will only be called when the slice has changed.\n * Change is determined by shallow comparison.\n *\n * Returns a function to unsubscribe the callback.\n * @notInstrumented\n */\nexport const subscribeWithSelector =\n // eslint-disable-next-line custom-rules/require-single-object-param\n <T extends Record<string, unknown>, Slice>(\n observable: ObservableState<T>,\n selector: (value: T) => Slice\n ) =>\n // eslint-disable-next-line custom-rules/require-single-object-param\n (callback: (slice: Slice) => void) => {\n let lastSlice = selector(observable.get());\n\n return observable.subscribe((value) => {\n const nextSlice = selector(value);\n\n if (isEqualShallow(nextSlice, lastSlice)) return;\n\n lastSlice = nextSlice;\n\n callback(nextSlice);\n });\n };\n","/* eslint-disable no-restricted-globals -- this is the abstraction for localStorage */\nimport type { StorageAdapter } from '../storage.types';\n\n/**\n * Creates a localStorage adapter.\n * @notInstrumented\n */\nexport const createLocalStorageAdapter = (): StorageAdapter => ({\n getItem: async (key) => localStorage.getItem(key),\n removeItem: async (key) => localStorage.removeItem(key),\n setItem: async (key, value) => localStorage.setItem(key, value),\n});\n","import { BaseError } from './base';\n\ntype InvalidStorageSetParams = {\n key: string;\n value: string;\n};\n\nexport class InvalidStorageSet extends BaseError {\n constructor({ key, value }: InvalidStorageSetParams) {\n super({\n cause: null,\n code: 'invalid_storage_set',\n docsUrl: null,\n metaMessages: [`key: ${key}`, value],\n name: 'InvalidStorageSet',\n shortMessage: 'Tried to store a value that does not match the schema',\n });\n }\n}\n","/**\n * Returns whether the given string is a valid ISO date string.\n *\n * Does not support timezone offsets.\n * @notInstrumented\n */\n// eslint-disable-next-line custom-rules/require-single-object-param\nexport const isValidDateISOString = (value: string): boolean => {\n const date = new Date(value);\n\n return !isNaN(date.getTime()) && date.toISOString() === value;\n};\n","/* eslint-disable custom-rules/function-name-matches-filename */\nimport type { StorageFormat } from '../../storage.types';\nimport { isValidDateISOString } from './isValidDateISOString';\n\nconst DATE_PREFIX = '__DATE__';\n\n/** @notInstrumented */\nexport const formatForStorage = (value: unknown) => {\n const item: StorageFormat<typeof value> = { value };\n\n return JSON.stringify(item, (_, entry) => {\n // You might think that entry here would be a Date and one could simply do \"entry instanceof Date\",\n // but actually it will be a string already (no idea why JSON.stringify does this)\n if (isValidDateISOString(entry)) {\n return `${DATE_PREFIX}${entry}`;\n }\n\n return entry;\n });\n};\n\n/** @notInstrumented */\n// eslint-disable-next-line custom-rules/one-function-per-file, custom-rules/require-single-object-param\nexport const parseFromStorage = <T>(value: string): StorageFormat<T> | null => {\n try {\n const parsed = JSON.parse(value, (_, entry) => {\n if (typeof entry === 'string' && entry.startsWith(DATE_PREFIX)) {\n return new Date(entry.slice(DATE_PREFIX.length));\n }\n\n return entry;\n }) as StorageFormat<T>;\n\n return parsed;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error) {\n return null;\n }\n};\n","import type { Storage, StorageAdapter, StorageAdapterOptions, StorageTier } from '../storage.types';\nimport { InvalidStorageSet } from './../../../errors/InvalidStorageSet';\nimport { formatForStorage } from './formatForStorage';\nimport { parseFromStorage } from './formatForStorage/storageFormat';\n\ntype CreateWebStorageParams = {\n prefix?: string;\n storageAdapter: StorageAdapter;\n};\n\n/**\n * Creates a Storage service to interact with storage adapter.\n * Reads the `storageTier` from each key's config and passes it\n * to the adapter on every operation, defaulting to `'default'`.\n * @notInstrumented\n */\nexport const createStorage = ({\n prefix = '',\n storageAdapter,\n}: CreateWebStorageParams): Storage => {\n const getPrefixedKey = (key: string) => (prefix ? `${prefix}_${key}` : key);\n\n const getAdapterOptions = (storageTier?: StorageTier): StorageAdapterOptions => ({\n storageTier: storageTier ?? 'default',\n });\n\n return {\n getItem: async (storageKeySchema) => {\n const prefixedKey = getPrefixedKey(storageKeySchema.key);\n const options = getAdapterOptions(storageKeySchema.config?.storageTier);\n\n const rawItem = await storageAdapter.getItem(prefixedKey, options);\n\n const parsedItem = rawItem ? parseFromStorage(rawItem) : null;\n\n /**\n * The item saved to localStorage may be malformed.\n * In this case, we remove it and return null.\n */\n if (parsedItem !== null) {\n const parsed = storageKeySchema.schema.safeParse(parsedItem.value);\n\n if (parsed.success) {\n return parsed.data;\n }\n }\n\n /**\n * The item saved to localStorage may be malformed.\n * In this case, we remove it and return null.\n */\n\n await storageAdapter.removeItem(prefixedKey, options);\n\n return null;\n },\n\n removeItem: async (storageKeySchema) => {\n await storageAdapter.removeItem(\n getPrefixedKey(storageKeySchema.key),\n getAdapterOptions(storageKeySchema.config?.storageTier),\n );\n },\n\n setItem: async (storageKeySchema, value) => {\n const parsed = storageKeySchema.schema.safeParse(value);\n\n if (!parsed.success) {\n throw new InvalidStorageSet({\n key: storageKeySchema.key,\n value: JSON.stringify(value),\n });\n }\n\n const item = formatForStorage(parsed.data);\n\n await storageAdapter.setItem(\n getPrefixedKey(storageKeySchema.key),\n item,\n getAdapterOptions(storageKeySchema.config?.storageTier),\n );\n },\n };\n};\n","/* eslint-disable no-restricted-globals */\nimport { Buffer as BufferPolyfill } from 'buffer';\n\n/** @notInstrumented */\nexport const getBuffer = () =>\n typeof Buffer !== 'undefined' ? Buffer : BufferPolyfill;\n","/**\n * Indicates if the code is running in a server-side environment.\n * @notInstrumented\n */\n// eslint-disable-next-line no-restricted-globals\nexport const isServerSideRendering = () => typeof window === 'undefined';\n","export const REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY =\n 'refresh-user-state-from-cookie';\n\nexport const INITIALIZE_STORAGE_SYNC_TRACKER_KEY = 'initialize-storage-sync';\n\nexport const FETCH_PROJECT_SETTINGS_TRACKER_KEY = 'fetch-project-settings';\n\nexport const GENERATE_SESSION_KEYS_TRACKER_KEY = 'generate-session-keys';\n\nexport const REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY =\n 'refresh-user-state-from-valid-token';\n","import type { DeferredPromise } from './deferredPromise.types';\n\n/** @notInstrumented */\nexport const createDeferredPromise = <T>(): DeferredPromise<T> => {\n let resolve: (value: T) => void;\n let reject: (reason?: unknown) => void;\n\n const promise = new Promise<T>((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n\n return {\n promise,\n reject: (reason?: unknown) => reject?.(reason),\n resolve: (value: T) => resolve?.(value),\n };\n};\n","import { BaseError } from './base';\n\nexport class CannotTrackError extends BaseError {\n constructor() {\n super({\n cause: null,\n code: 'cannot_track_error',\n docsUrl: null,\n name: 'CannotTrackError',\n shortMessage: 'All track calls must be performed in the same node tick',\n });\n }\n}\n","import * as z from 'zod/mini';\n\n/**\n * Schema for validating cross-tab broadcast messages.\n */\nexport const CrossTabBroadcastMessageSchema = z.object({\n args: z.optional(z.unknown()),\n event: z.string(),\n});\n","import EventEmitter from 'eventemitter3';\n\nimport { isServerSideRendering } from '../../../utils/isServerSideRendering';\nimport { CrossTabBroadcastMessageSchema } from '../crossTabBroadcast.schema';\nimport type { CrossTabBroadcast } from '../crossTabBroadcast.types';\n\ntype CreateCrossTabBroadcastParams = {\n channelName: string;\n};\n\n/**\n * Creates a cross-tab broadcast service instance using the BroadcastChannel API.\n *\n * Enables communication between multiple tabs/windows of the same application.\n * Messages are validated against the schema and invalid messages are silently ignored.\n *\n * In SSR or when BroadcastChannel is unavailable, returns a no-op implementation.\n *\n * @param params - Configuration parameters\n * @param params.channelName - The name of the broadcast channel to use\n * @returns A cross-tab broadcast service instance\n * @notInstrumented\n */\nexport const createCrossTabBroadcast = ({\n channelName,\n}: CreateCrossTabBroadcastParams): CrossTabBroadcast => {\n // SSR check - return no-op implementation\n // eslint-disable-next-line no-restricted-globals\n if (isServerSideRendering() || typeof BroadcastChannel === 'undefined') {\n return {\n off: () => {},\n on: () => {},\n send: () => {},\n };\n }\n\n // eslint-disable-next-line no-restricted-globals\n const channel = new BroadcastChannel(channelName);\n const eventEmitter = new EventEmitter();\n\n // Message handler with validation\n const handleMessage = (messageEvent: MessageEvent) => {\n const parsed = CrossTabBroadcastMessageSchema.safeParse(messageEvent.data);\n\n if (!parsed.success) {\n // Silently ignore invalid messages (consistent with storage patterns)\n return;\n }\n\n const { args, event } = parsed.data;\n eventEmitter.emit(event, args);\n };\n\n channel.addEventListener('message', handleMessage);\n\n return {\n off: (event, callback) => {\n eventEmitter.off(event, callback);\n },\n\n on: (event, callback) => {\n eventEmitter.on(event, callback);\n },\n\n send: ({ args, event }) => {\n channel.postMessage({ args, event });\n },\n };\n};\n","import { EventEmitter } from 'eventemitter3';\n\nimport type { LogLevel, Logger, LoggerEventEmitter } from '../logger.types';\n\n/**\n * Configuration options for the logger\n * @notInstrumented\n */\ntype CreateLoggerOptions = {\n level?: LogLevel;\n};\n\n/**\n * Log levels and their corresponding numeric values\n */\nconst LOG_LEVELS: Record<LogLevel, number> = {\n debug: 0,\n error: 3,\n info: 1,\n warn: 2,\n};\n\n// Assign to avoid lint errors\nconst defaultConsole = console;\n\n/**\n * Creates a logger instance with configurable log level and event emission capabilities.\n * @returns A logger instance with debug, info, warn, and error methods\n * @notInstrumented\n */\nexport const createLogger = (options: CreateLoggerOptions = {}): Logger => {\n const eventEmitter: LoggerEventEmitter = new EventEmitter();\n\n // Default to 'debug' if no level is provided\n const minLevel: LogLevel = options.level ?? 'warn';\n\n // Helper to decide if we should log based on current log level\n // eslint-disable-next-line custom-rules/require-single-object-param\n const shouldLog = (level: LogLevel): boolean => {\n return LOG_LEVELS[level] >= LOG_LEVELS[minLevel];\n };\n\n // Helper to format the log message\n // eslint-disable-next-line custom-rules/require-single-object-param\n const formatMessage = (level: LogLevel, message: string): string => {\n const timestamp = new Date().toISOString();\n\n return `[${timestamp}] ${level.toUpperCase()}: ${message}`;\n };\n\n // Unified logger function that checks the level and calls the appropriate console method\n // eslint-disable-next-line custom-rules/require-single-object-param\n const log = (\n level: LogLevel,\n consoleMethod: (...data: unknown[]) => void,\n message: string,\n ...args: unknown[]\n ) => {\n eventEmitter.emit('log', level, message, ...args);\n\n if (!shouldLog(level)) return;\n\n consoleMethod(formatMessage(level, message), ...args);\n };\n\n return {\n debug: (message, ...args) =>\n log('debug', defaultConsole.debug, message, ...args),\n\n error: (message, ...args) =>\n log('error', defaultConsole.error, message, ...args),\n\n info: (message, ...args) =>\n log('info', defaultConsole.info, message, ...args),\n\n off: eventEmitter.off.bind(eventEmitter),\n\n on: eventEmitter.on.bind(eventEmitter),\n warn: (message, ...args) =>\n log('warn', defaultConsole.warn, message, ...args),\n };\n};\n","import { BaseError } from './base';\n\ntype UnsafeNavigationUrlErrorParams = {\n scheme: string;\n};\n\n/**\n * Thrown when navigation is attempted to a URL whose scheme is not in the\n * allowlist (only `http:` and `https:` are permitted). Guards against DOM XSS\n * (`javascript:` URIs) and other dangerous schemes (`data:`, `blob:`, etc.)\n * that could originate from a poisoned server response or cached project\n * settings flowing into `window.location.href`.\n */\nexport class UnsafeNavigationUrlError extends BaseError {\n constructor({ scheme }: UnsafeNavigationUrlErrorParams) {\n super({\n cause: null,\n code: 'unsafe_navigation_url_error',\n docsUrl: null,\n name: 'UnsafeNavigationUrlError',\n shortMessage: `Refusing to navigate to a URL with an unsafe scheme \"${scheme}\". Only http: and https: URLs are allowed. This may indicate a compromised or misconfigured auth URL.`,\n });\n }\n}\n","import { UnsafeNavigationUrlError } from '../../errors/UnsafeNavigationUrlError';\n\n/**\n * The only URL schemes permitted for navigation. Everything else — most\n * importantly `javascript:` (DOM XSS) as well as `data:`, `blob:`, `file:`,\n * etc. — is rejected.\n */\nconst ALLOWED_NAVIGATION_SCHEMES = new Set(['http:', 'https:']);\n\n/**\n * Asserts that the given URL is safe to navigate to, i.e. its scheme is in the\n * allowlist (`http:`/`https:`). Used as a defense-in-depth guard wherever a\n * server-supplied or cached URL flows into navigation, preventing DOM XSS via\n * `javascript:` URIs and open redirects via other dangerous schemes.\n *\n * @param url - The URL string or parsed URL to validate.\n * @throws {UnsafeNavigationUrlError} If the URL cannot be parsed or its scheme is not allowed.\n * @notInstrumented\n */\n// eslint-disable-next-line custom-rules/require-single-object-param\nexport const assertSafeNavigationUrl = (url: string | URL): void => {\n let parsed: URL;\n\n try {\n parsed = url instanceof URL ? url : new URL(url);\n } catch {\n // An unparseable URL is treated as unsafe rather than allowed through.\n throw new UnsafeNavigationUrlError({ scheme: 'unknown' });\n }\n\n if (!ALLOWED_NAVIGATION_SCHEMES.has(parsed.protocol)) {\n throw new UnsafeNavigationUrlError({ scheme: parsed.protocol });\n }\n};\n","/**\n * Converts an ArrayBuffer or Uint8Array to a hex-encoded string\n * @notInstrumented\n */\nexport const bufferToHex = (buffer: ArrayBufferLike | Uint8Array) =>\n [...(buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer))]\n .map((x) => x.toString(16).padStart(2, '0'))\n .join('');\n","/**\n * Accepts a public key array buffer, and returns a buffer with the compressed version of the public key\n * @notInstrumented\n */\nexport const compressRawPublicKey = (rawPublicKey: ArrayBuffer) => {\n const rawPublicKeyBytes = new Uint8Array(rawPublicKey);\n const len = rawPublicKeyBytes.byteLength;\n\n // Drop the y coordinate\n const compressedBytes = rawPublicKeyBytes.slice(0, (1 + len) >>> 1);\n\n // Encode the parity of `y` in first bit\n compressedBytes[0] = 0x2 | (rawPublicKeyBytes[len - 1] & 0x01);\n return compressedBytes.buffer;\n};\n","import { BaseError } from '../../../errors/base';\n\nexport class KeyNotFoundError extends BaseError {\n // eslint-disable-next-line custom-rules/require-single-object-param\n constructor(keyName: string) {\n super({\n cause: null,\n code: 'key_not_found',\n docsUrl: null,\n name: 'KeyNotFoundError',\n shortMessage: `Key \"${keyName}\" not found in keychain`,\n });\n }\n}\n","export const STORE_NAME = 'keys';\n","import { STORE_NAME } from './constants';\n\nexport type DeleteIndexedDBItemOptions = {\n /** The IndexedDB database handle. */\n db: IDBDatabase;\n\n /** The key name to delete. */\n keyName: string;\n};\n\n/** @notInstrumented */\nexport const deleteIndexedDBItem = ({\n db,\n keyName,\n}: DeleteIndexedDBItemOptions): Promise<void> =>\n new Promise((resolve, reject) => {\n const transaction = db.transaction(STORE_NAME, 'readwrite');\n const store = transaction.objectStore(STORE_NAME);\n const request = store.delete(keyName);\n\n request.onsuccess = () => resolve();\n request.onerror = () => reject(request.error as Error);\n });\n","import type { StoredKey } from '../createKeychainService.types';\nimport { STORE_NAME } from './constants';\n\nexport type GetIndexedDBItemOptions = {\n /** The IndexedDB database handle. */\n db: IDBDatabase;\n\n /** The key name to look up. */\n keyName: string;\n};\n\n/** @notInstrumented */\nexport const getIndexedDBItem = ({\n db,\n keyName,\n}: GetIndexedDBItemOptions): Promise<StoredKey | undefined> =>\n new Promise((resolve, reject) => {\n const transaction = db.transaction(STORE_NAME, 'readonly');\n const store = transaction.objectStore(STORE_NAME);\n const request = store.get(keyName);\n\n request.onsuccess = () => resolve(request.result as StoredKey | undefined);\n request.onerror = () => reject(request.error as Error);\n });\n","import type { StoredKey } from '../createKeychainService.types';\nimport { STORE_NAME } from './constants';\n\nexport type SetIndexedDBItemOptions = {\n /** The IndexedDB database handle. */\n db: IDBDatabase;\n\n /** The stored key entry to write. */\n entry: StoredKey;\n};\n\n/** @notInstrumented */\nexport const setIndexedDBItem = ({\n db,\n entry,\n}: SetIndexedDBItemOptions): Promise<void> =>\n new Promise((resolve, reject) => {\n const transaction = db.transaction(STORE_NAME, 'readwrite');\n const store = transaction.objectStore(STORE_NAME);\n const request = store.put(entry);\n\n request.onsuccess = () => resolve();\n request.onerror = () => reject(request.error as Error);\n });\n","import { STORE_NAME } from './constants';\n\n/** @notInstrumented */\nexport const openDatabase = (dbName: string): Promise<IDBDatabase> =>\n new Promise((resolve, reject) => {\n const request = indexedDB.open(dbName, 1);\n\n request.onupgradeneeded = () => {\n const db = request.result;\n\n if (!db.objectStoreNames.contains(STORE_NAME)) {\n db.createObjectStore(STORE_NAME, { keyPath: 'keyName' });\n }\n };\n\n request.onsuccess = () => resolve(request.result);\n request.onerror = () => reject(request.error as Error);\n });\n","import { openDatabase } from '../openDatabase';\n\ntype WithDatabaseParams<T> = {\n dbName: string;\n operation: (db: IDBDatabase) => Promise<T>;\n};\n\n/**\n * Scopes a database connection to the lifetime of a callback.\n * Opens a connection, passes it to the operation, and guarantees\n * the connection is closed when the operation completes or throws.\n * @notInstrumented\n */\nexport const withDatabase = async <T>({\n dbName,\n operation,\n}: WithDatabaseParams<T>): Promise<T> => {\n const db = await openDatabase(dbName);\n try {\n const result = await operation(db);\n\n return result;\n } finally {\n db.close();\n }\n};\n","import { bufferToHex } from '../../../utils/bufferToHex';\nimport { compressRawPublicKey } from '../../../utils/compressRawPublicKey';\nimport type {\n CreateKeychainService,\n StoredKey,\n} from './createKeychainService.types';\nimport { KeyNotFoundError } from './KeyNotFoundError';\nimport { deleteIndexedDBItem } from './utils/deleteIndexedDBItem';\nimport { getIndexedDBItem } from './utils/getIndexedDBItem';\nimport { setIndexedDBItem } from './utils/setIndexedDBItem';\nimport { withDatabase } from './utils/withDatabase';\n\nconst DEFAULT_DB_NAME = 'dynamic_keychain';\n\n/** @notInstrumented */\nexport const createKeychainService: CreateKeychainService = (params) => {\n const dbName = params?.dbName ?? DEFAULT_DB_NAME;\n\n // In-memory key cache, keyed by keyName. sign() prefers this over IndexedDB\n // so that a cross-tab key rotation in the shared IndexedDB does not silently\n // swap the signing key out from under the current session.\n const memoryKeys = new Map<string, StoredKey>();\n\n // eslint-disable-next-line custom-rules/require-single-object-param\n const generateKey = async (keyName: string): Promise<string> => {\n const keyPair = await crypto.subtle.generateKey(\n { name: 'ECDSA', namedCurve: 'P-256' },\n false,\n ['sign']\n );\n\n const rawPublicKey = await crypto.subtle.exportKey(\n 'raw',\n keyPair.publicKey\n );\n\n const compressedPublicKey = compressRawPublicKey(rawPublicKey);\n const publicKeyHex = bufferToHex(compressedPublicKey);\n\n const entry: StoredKey = {\n keyName,\n privateKey: keyPair.privateKey,\n publicKeyHex,\n };\n\n memoryKeys.set(keyName, entry);\n\n await withDatabase({\n dbName,\n operation: (db) => setIndexedDBItem({ db, entry }),\n });\n\n return publicKeyHex;\n };\n\n // eslint-disable-next-line custom-rules/require-single-object-param\n const importKey = async (\n keyName: string,\n jwk: JsonWebKey\n ): Promise<string> => {\n const privateKey = await crypto.subtle.importKey(\n 'jwk',\n jwk,\n { name: 'ECDSA', namedCurve: 'P-256' },\n false,\n ['sign']\n );\n\n const publicJwk = { crv: jwk.crv, kty: jwk.kty, x: jwk.x, y: jwk.y };\n\n const publicCryptoKey = await crypto.subtle.importKey(\n 'jwk',\n publicJwk,\n { name: 'ECDSA', namedCurve: 'P-256' },\n true,\n ['verify']\n );\n\n const rawPublicKey = await crypto.subtle.exportKey('raw', publicCryptoKey);\n const compressedPublicKey = compressRawPublicKey(rawPublicKey);\n const publicKeyHex = bufferToHex(compressedPublicKey);\n\n const entry: StoredKey = { keyName, privateKey, publicKeyHex };\n\n memoryKeys.set(keyName, entry);\n\n await withDatabase({\n dbName,\n operation: (db) => setIndexedDBItem({ db, entry }),\n });\n\n return publicKeyHex;\n };\n\n // eslint-disable-next-line custom-rules/require-single-object-param\n const getPublicKey = async (keyName: string): Promise<string | null> => {\n const cached = memoryKeys.get(keyName);\n if (cached) {\n return cached.publicKeyHex;\n }\n\n const entry = await withDatabase({\n dbName,\n operation: (db) => getIndexedDBItem({ db, keyName }),\n });\n\n return entry?.publicKeyHex ?? null;\n };\n\n // eslint-disable-next-line custom-rules/require-single-object-param\n const sign = async (keyName: string, message: string): Promise<string> => {\n // Prefer the in-memory key so that a cross-tab IndexedDB key rotation\n // does not cause this tab to sign with a foreign private key.\n const entry =\n memoryKeys.get(keyName) ??\n (await withDatabase({\n dbName,\n operation: (db) => getIndexedDBItem({ db, keyName }),\n }));\n\n if (!entry) {\n throw new KeyNotFoundError(keyName);\n }\n\n const encoder = new TextEncoder();\n const data = encoder.encode(message);\n\n const signature = await crypto.subtle.sign(\n { hash: { name: 'SHA-256' }, name: 'ECDSA' },\n entry.privateKey,\n data\n );\n\n return bufferToHex(signature);\n };\n\n // eslint-disable-next-line custom-rules/require-single-object-param\n const hasKey = async (keyName: string): Promise<boolean> => {\n if (memoryKeys.has(keyName)) {\n return true;\n }\n\n const entry = await withDatabase({\n dbName,\n operation: (db) => getIndexedDBItem({ db, keyName }),\n });\n\n return entry !== undefined;\n };\n\n // eslint-disable-next-line custom-rules/require-single-object-param\n const removeKey = async (keyName: string): Promise<void> => {\n memoryKeys.delete(keyName);\n\n await withDatabase({\n dbName,\n operation: (db) => deleteIndexedDBItem({ db, keyName }),\n });\n };\n\n return {\n generateKey,\n getPublicKey,\n hasKey,\n importKey,\n removeKey,\n sign,\n };\n};\n","import { BaseError } from './base';\n\ntype InvalidRealtimePublishParams = {\n channel: string;\n};\n\nexport class InvalidRealtimePublishError extends BaseError {\n constructor({ channel }: InvalidRealtimePublishParams) {\n super({\n cause: null,\n code: 'invalid_realtime_publish',\n docsUrl: null,\n metaMessages: [`channel: ${channel}`],\n name: 'InvalidRealtimePublishError',\n shortMessage:\n 'Tried to publish data that does not match the channel schema',\n });\n }\n}\n","import { BaseError } from './base';\n\nexport class RealtimeNotConnectedError extends BaseError {\n constructor() {\n super({\n cause: null,\n code: 'realtime_not_connected_error',\n docsUrl: null,\n name: 'RealtimeNotConnectedError',\n shortMessage:\n 'Realtime service is not connected. Call connect() before subscribing or publishing.',\n });\n }\n}\n","import type { InboundMessage, RealtimeChannel, messageCallback } from 'ably';\nimport type { BaseRealtime } from 'ably/modular';\nimport EventEmitter from 'eventemitter3';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { InvalidRealtimePublishError } from '../../../errors/InvalidRealtimePublishError';\nimport { RealtimeNotConnectedError } from '../../../errors/RealtimeNotConnectedError';\nimport { createApiClient } from '../../../modules/apiClient';\nimport { isServerSideRendering } from '../../../utils/isServerSideRendering';\nimport type {\n RealtimeChannelSchema,\n RealtimeConnectionState,\n RealtimeEventMap,\n RealtimeService,\n} from '../realtime.types';\n\nconst ABLY_STATE_TO_REALTIME_STATE: Record<string, RealtimeConnectionState> = {\n closed: 'closed',\n closing: 'closing',\n connected: 'connected',\n connecting: 'connecting',\n disconnected: 'disconnected',\n failed: 'failed',\n initialized: 'idle',\n suspended: 'suspended',\n};\n\nconst mapAblyState = (ablyState: string): RealtimeConnectionState =>\n ABLY_STATE_TO_REALTIME_STATE[ablyState] ?? 'idle';\n\n/**\n * Creates a realtime pub/sub service backed by Ably.\n *\n * The service starts idle. Call `connect({ client })` to establish\n * a connection, passing the DynamicClient explicitly.\n *\n * SSR environments receive a no-op implementation.\n * @notInstrumented\n */\n \nexport const createRealtimeService = (): RealtimeService => {\n if (isServerSideRendering()) {\n return {\n connect: () => Promise.resolve(),\n disconnect: () => {},\n getConnectionState: () => 'idle',\n off: () => {},\n on: () => {},\n publish: () => Promise.resolve(),\n subscribe: () => Promise.resolve(),\n unsubscribe: () => {},\n };\n }\n\n const eventEmitter = new EventEmitter<RealtimeEventMap>();\n const channels = new Map<string, RealtimeChannel>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const handlerMap = new WeakMap<(message: { data: any }) => void, messageCallback<InboundMessage>>();\n\n let ablyClient: BaseRealtime | undefined;\n let connectionState: RealtimeConnectionState = 'idle';\n let isConnecting = false;\n\n const setConnectionState = (state: RealtimeConnectionState) => {\n connectionState = state;\n eventEmitter.emit('connectionStateChange', state);\n };\n\n // eslint-disable-next-line custom-rules/require-single-object-param\n const getOrCreateChannel = (channelName: string): RealtimeChannel => {\n const existing = channels.get(channelName);\n\n if (existing) {\n return existing;\n }\n\n if (!ablyClient) {\n throw new RealtimeNotConnectedError();\n }\n\n const channel = ablyClient.channels.get(channelName);\n channels.set(channelName, channel);\n\n return channel;\n };\n\n const connect: RealtimeService['connect'] = async ({ client, headers }) => {\n if (isConnecting) {\n return;\n }\n\n isConnecting = true;\n\n try {\n const core = getCore(client);\n\n if (ablyClient) {\n ablyClient.close();\n channels.clear();\n }\n\n // Dynamic import to keep the module tree-shakeable\n // and avoid loading Ably in SSR environments\n const {\n BaseRealtime: AblyBaseRealtime,\n FetchRequest,\n WebSocketTransport,\n } = await import('ably/modular');\n\n ablyClient = new AblyBaseRealtime({\n // authCallback must return void (not Promise<void>), so we use\n // .then().catch() instead of async/await to avoid returning a Promise\n // to Ably's callback-style auth handler.\n authCallback: (_tokenParams, callback) => {\n const apiClient = createApiClient({ headers }, client);\n\n apiClient\n .getRealtimeAuthToken({ environmentId: core.environmentId })\n .then((response) => {\n callback(null, response.token);\n })\n .catch((err: unknown) => {\n const message = err instanceof Error ? err.message : String(err);\n callback(message, null);\n });\n },\n autoConnect: false,\n plugins: { FetchRequest, WebSocketTransport },\n });\n\n ablyClient.connection.on((stateChange) => {\n setConnectionState(mapAblyState(stateChange.current));\n });\n\n ablyClient.connect();\n } finally {\n isConnecting = false;\n }\n };\n\n const disconnect: RealtimeService['disconnect'] = () => {\n if (!ablyClient) {\n return;\n }\n\n for (const channel of channels.values()) {\n channel.detach().catch(() => {});\n }\n\n channels.clear();\n ablyClient.close();\n ablyClient = undefined;\n };\n\n const subscribe: RealtimeService['subscribe'] = async <T>({\n channelSchema,\n callback,\n }: {\n callback: (message: { data: T }) => void;\n channelSchema: RealtimeChannelSchema<T>;\n }) => {\n const channel = getOrCreateChannel(channelSchema.channel);\n\n const handler: messageCallback<InboundMessage> = (message) => {\n const parsed = channelSchema.schema.safeParse(message.data);\n\n if (!parsed.success) {\n return;\n }\n\n callback({ data: parsed.data });\n };\n\n handlerMap.set(callback, handler);\n\n await channel.subscribe(handler);\n };\n\n const unsubscribe: RealtimeService['unsubscribe'] = <T>({\n channelSchema,\n callback,\n }: {\n callback: (message: { data: T }) => void;\n channelSchema: RealtimeChannelSchema<T>;\n }) => {\n const channel = channels.get(channelSchema.channel);\n\n if (!channel) {\n return;\n }\n\n const handler = handlerMap.get(callback);\n\n if (handler) {\n channel.unsubscribe(handler);\n handlerMap.delete(callback);\n }\n };\n\n const publish: RealtimeService['publish'] = async <T>({\n channelSchema,\n data,\n }: {\n channelSchema: RealtimeChannelSchema<T>;\n data: T;\n }) => {\n const parsed = channelSchema.schema.safeParse(data);\n\n if (!parsed.success) {\n throw new InvalidRealtimePublishError({ channel: channelSchema.channel });\n }\n\n const channel = getOrCreateChannel(channelSchema.channel);\n await channel.publish('message', parsed.data);\n };\n\n return {\n connect,\n disconnect,\n getConnectionState: () => connectionState,\n off: (event, callback) => {\n eventEmitter.off(event, callback);\n },\n on: (event, callback) => {\n eventEmitter.on(event, callback);\n },\n publish,\n subscribe,\n unsubscribe,\n };\n};\n","type GetKeychainIndexedDBNameParams = {\n environmentId: string;\n};\n\n/**\n * Builds the IndexedDB database name used by the keychain service for a given\n * environment. Centralizing this avoids drift between the SDK and any\n * extension code that needs to read or migrate the same database.\n *\n * @param params.environmentId - The Dynamic environment id.\n * @returns The IndexedDB database name for the keychain.\n * @notInstrumented\n */\nexport const getKeychainIndexedDBName = ({\n environmentId,\n}: GetKeychainIndexedDBNameParams): string =>\n `dynamic_${environmentId}_keychain`;\n","import { BaseError } from './base';\n\nexport class NoNetworkProvidersError extends BaseError {\n constructor() {\n super({\n cause: null,\n code: 'no_network_providers',\n docsUrl: null,\n name: 'NoNetworkProvidersError',\n shortMessage: 'No networks were registered in the client',\n });\n }\n}\n","import { BaseError, type BaseErrorParameters } from './base';\n\nexport class WalletAlreadyLinkedToAnotherUserError extends BaseError {\n constructor({ cause }: Pick<BaseErrorParameters, 'cause'>) {\n super({\n cause,\n code: 'wallet_already_linked_to_another_user_error',\n docsUrl: null,\n name: 'WalletAlreadyLinkedToAnotherUserError',\n shortMessage: 'This wallet is already linked to another user',\n });\n }\n}\n","import { BaseError, type BaseErrorParameters } from './base';\n\n/**\n * Thrown when a wallet is rejected during verification because it failed the\n * project's compliance screening (e.g. it appears on a sanctions list).\n *\n * The screening runs server-side and is enabled per environment in the Dynamic\n * dashboard. This typed error lets consumers detect the blocked-wallet case and\n * render an \"access denied\" experience without having to inspect the raw API\n * error code themselves.\n */\nexport class WalletScreeningBlockedError extends BaseError {\n constructor({ cause }: Pick<BaseErrorParameters, 'cause'>) {\n super({\n cause,\n code: 'wallet_screening_blocked',\n docsUrl: null,\n name: 'WalletScreeningBlockedError',\n shortMessage:\n 'This wallet was blocked by compliance screening and cannot be used',\n });\n }\n}\n","import { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/** @notInstrumented */\nexport const isCaptchaRequired = (client = getDefaultClient()) => {\n const projectSettings = client.projectSettings;\n\n assertDefined(projectSettings, 'Project settings are not available');\n\n const { security } = projectSettings;\n\n // Prefer the provider-agnostic captcha field; fall back to the legacy hCaptcha field.\n return security.captcha?.enabled ?? security.hCaptcha?.enabled ?? false;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport { isCaptchaRequired } from '../isCaptchaRequired';\n\n/**\n * Retrieves the current captcha token from the client state and sets it to null.\n * @notInstrumented\n */\nexport const consumeCaptchaToken = (\n client: DynamicClient\n): string | undefined => {\n const core = getCore(client);\n\n const captchaToken = core.state.get().captchaToken;\n\n if (isCaptchaRequired(client)) {\n assertDefined(captchaToken, 'Captcha token is required');\n }\n\n core.state.set({\n captchaToken: null,\n });\n\n return captchaToken ?? undefined;\n};\n","import { BaseError } from './base';\n\nexport class MethodNotImplementedError extends BaseError {\n // eslint-disable-next-line custom-rules/require-single-object-param\n constructor(methodName: string) {\n super({\n cause: null,\n code: 'method_not_implemented_error',\n docsUrl: null,\n name: 'MethodNotImplementedError',\n shortMessage: `This method is not implemented: ${methodName}`,\n });\n }\n}\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\n\ntype SetCaptchaTokenProps = {\n captchaToken: string;\n};\n\n/**\n * Sets the given captcha token in the client state.\n *\n * @param params.captchaToken - The captcha token to set.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @instrumented\n */\nexport const setCaptchaToken = (\n { captchaToken }: SetCaptchaTokenProps,\n client = getDefaultClient()\n) => {\n const core = getCore(client);\n\n core.state.set({\n captchaToken,\n });\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\n\ntype HasExtensionParams = {\n extensionKey: string;\n};\n\n/**\n * Checks if a specific extension has been applied to the Dynamic client.\n *\n * Extensions add optional features to the Dynamic SDK,\n * such as EVM, Solana, or other chain support.\n *\n * @param params.extensionKey - The unique key identifying the extension to check for.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if the extension is applied, false otherwise.\n * @notInstrumented\n */\nexport const hasExtension = (\n { extensionKey }: HasExtensionParams,\n client = getDefaultClient()\n) => {\n const core = getCore(client);\n\n return core.extensions.has(extensionKey);\n};\n","import {\n AuthModeEnum,\n type ChainEnum,\n type ConnectRequest,\n} from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { createApiClient } from '../../apiClient';\nimport { getWalletProviderFromWalletAccount } from '../../wallets/utils/getWalletProviderFromWalletAccount';\nimport { normalizeWalletNameWithChain } from '../../wallets/utils/normalizeWalletNameWithChain';\nimport type { WalletAccount } from '../../wallets/walletAccount';\n\ntype CreateVisitParams = {\n authMode?: AuthModeEnum;\n walletAccount: WalletAccount;\n};\n\n/* \n In older SDK versions we used to have the concept of \"connect-only\" vs \"connect-and-sign\". \n The only difference in backend is it stores some extra data for connect-only, \n so we can just default to using it.\n*/\n/** @notInstrumented */\nexport const createVisit = async (\n { walletAccount, authMode = AuthModeEnum.Only }: CreateVisitParams,\n client: DynamicClient\n) => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const walletProvider = getWalletProviderFromWalletAccount(\n { walletAccount },\n client\n );\n\n try {\n const walletName = normalizeWalletNameWithChain({\n chain: walletProvider.chain,\n displayName: walletProvider.metadata.displayName,\n });\n\n const connectRequest: ConnectRequest = {\n address: walletAccount.address,\n authMode,\n // eslint-disable-next-line custom-rules/ban-chain-enum\n chain: walletProvider.chain as ChainEnum,\n provider: walletProvider.walletProviderType,\n walletName,\n };\n\n await apiClient.createVisit({\n connectRequest,\n environmentId: core.environmentId,\n });\n } catch (error) {\n core.logger.error('Error creating visit', { error });\n }\n};\n","import { getCore } from '../../../../client/core/getCore';\nimport type { DynamicClient } from '../../../../client/types';\nimport type { UnverifiedWalletAccount } from '../unverifiedWalletAccounts.types';\n\ntype SetUnverifiedWalletAccountsParams = {\n unverifiedWalletAccountsToUpdate: UnverifiedWalletAccount[];\n};\n\n/**\n * Updates the unverified wallet account in the client state.\n * This will add new wallet accounts and override those with matching ids,\n * but will leave other preexisting wallet accounts unchanged.\n * @notInstrumented\n */\nexport const setUnverifiedWalletAccounts = (\n { unverifiedWalletAccountsToUpdate }: SetUnverifiedWalletAccountsParams,\n client: DynamicClient\n): void => {\n if (unverifiedWalletAccountsToUpdate.length === 0) {\n return;\n }\n\n const core = getCore(client);\n\n const unverifiedWalletAccountsToUpdateIds =\n unverifiedWalletAccountsToUpdate.map(({ id }) => id);\n\n const filteredUnverifiedWalletAccounts: UnverifiedWalletAccount[] = core.state\n .get()\n .unverifiedWalletAccounts.filter(\n (unverifiedWalletAccount) =>\n !unverifiedWalletAccountsToUpdateIds.includes(\n unverifiedWalletAccount.id\n )\n );\n\n core.state.set({\n unverifiedWalletAccounts: [\n ...filteredUnverifiedWalletAccounts,\n ...unverifiedWalletAccountsToUpdate,\n ],\n });\n};\n","import { getCore } from '../../../../../client/core/getCore';\nimport type { DynamicClient } from '../../../../../client/types';\n\ntype updateWalletProviderKeysForVerifiedCredentialsParams = {\n keysToUpdate: Record<string, string>;\n};\n\n/** @notInstrumented */\nexport const updateWalletProviderKeysForVerifiedCredentials = (\n { keysToUpdate }: updateWalletProviderKeysForVerifiedCredentialsParams,\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n core.state.set({\n walletProviderKeyMap: {\n ...core.state.get().walletProviderKeyMap,\n ...keysToUpdate,\n },\n });\n};\n","import type { DynamicClient } from '../../../client/types';\nimport { createVisit } from '../../auth/createVisit';\nimport { emitWalletAccountsChangedEvent } from '../emitWalletAccountsChangedEvent';\nimport { getWalletAccounts } from '../getWalletAccounts';\nimport { setUnverifiedWalletAccounts } from '../unverifiedWalletAccounts/setUnverifiedWalletAccounts';\nimport type { WalletAccount } from '../walletAccount';\nimport { updateWalletProviderKeysForVerifiedCredentials } from '../walletProvider/walletProviderKeyMap/updateWalletProviderKeysForVerifiedCredentials';\n\ntype ReconcileWalletAccountsAgainstClientParams = {\n /** Whether to write new or updated unverified accounts to client state. Defaults to `true`. */\n addToDynamicWalletAccounts?: boolean;\n /** Freshly-connected wallet account candidates to reconcile. */\n walletAccounts: WalletAccount[];\n /** Wallet provider key these candidates were connected through. */\n walletProviderKey: string;\n};\n\n/**\n * Reconciles freshly-connected wallet accounts against the client state. For\n * each candidate it classifies as new, a re-connect of an existing unverified\n * account, or a re-connect of an already-verified account, then runs the\n * appropriate state mutation (`setUnverifiedWalletAccounts`,\n * `updateWalletProviderKeysForVerifiedCredentials`, `createVisit` for truly-new\n * entries) and emits a single `walletAccountsChanged` event if anything\n * actually changed. Returns the candidates with `verifiedCredentialId`\n * populated when the address already corresponded to a verified credential.\n *\n * @notInstrumented\n */\nexport const reconcileWalletAccountsAgainstClient = (\n {\n addToDynamicWalletAccounts = true,\n walletAccounts,\n walletProviderKey,\n }: ReconcileWalletAccountsAgainstClientParams,\n client: DynamicClient\n): WalletAccount[] => {\n if (walletAccounts.length === 0) {\n return [];\n }\n\n const existingWalletAccounts = getWalletAccounts(client);\n\n const newWalletAccounts: WalletAccount[] = [];\n const unverifiedWalletAccountsToUpdate: WalletAccount[] = [];\n const verifiedCredentialIdToWalletProviderKeyMap: Record<string, string> = {};\n\n const reconciledWalletAccounts: WalletAccount[] = walletAccounts.map(\n (candidate) => {\n const matchingExistingWalletAccount = existingWalletAccounts.find(\n (existingWalletAccount) => existingWalletAccount.id === candidate.id\n );\n\n if (!matchingExistingWalletAccount) {\n newWalletAccounts.push(candidate);\n return candidate;\n }\n\n const isWalletProviderKeyChanged =\n matchingExistingWalletAccount.walletProviderKey !== walletProviderKey;\n\n if (matchingExistingWalletAccount.verifiedCredentialId) {\n if (isWalletProviderKeyChanged) {\n verifiedCredentialIdToWalletProviderKeyMap[\n matchingExistingWalletAccount.verifiedCredentialId\n ] = walletProviderKey;\n }\n\n return {\n ...candidate,\n verifiedCredentialId:\n matchingExistingWalletAccount.verifiedCredentialId,\n };\n }\n\n if (isWalletProviderKeyChanged) {\n unverifiedWalletAccountsToUpdate.push(candidate);\n }\n\n return candidate;\n }\n );\n\n let walletAccountsChanged = false;\n\n if (Object.keys(verifiedCredentialIdToWalletProviderKeyMap).length > 0) {\n updateWalletProviderKeysForVerifiedCredentials(\n { keysToUpdate: verifiedCredentialIdToWalletProviderKeyMap },\n client\n );\n\n walletAccountsChanged = true;\n }\n\n if (addToDynamicWalletAccounts) {\n const accountsToWrite = [\n ...unverifiedWalletAccountsToUpdate,\n ...newWalletAccounts,\n ];\n\n if (accountsToWrite.length > 0) {\n setUnverifiedWalletAccounts(\n { unverifiedWalletAccountsToUpdate: accountsToWrite },\n client\n );\n\n walletAccountsChanged = true;\n\n for (const newWalletAccount of newWalletAccounts) {\n void createVisit({ walletAccount: newWalletAccount }, client);\n }\n }\n }\n\n if (walletAccountsChanged) {\n emitWalletAccountsChangedEvent(client);\n }\n\n return reconciledWalletAccounts;\n};\n","import { getCore } from '../../client/core/getCore';\nimport type { DynamicClient } from '../../client/types';\n\nexport type AppMetadata = {\n appLogoUrl: string | undefined;\n appName: string;\n appNativeLink?: string;\n appUniversalLink?: string;\n};\n\n/**\n * Reads the customer-supplied app name, logo, native link, and universal link.\n * — preferring `core.metadata` (set on the client) over project-settings fallbacks.\n *\n * @param client - The Dynamic client whose configuration drives the result.\n * @notInstrumented\n */\nexport const getAppMetadata = (client: DynamicClient): AppMetadata => {\n const core = getCore(client);\n const generalSettings = client.projectSettings?.general;\n\n return {\n appLogoUrl: core.metadata?.iconUrl ?? generalSettings?.appLogo ?? undefined,\n appName: core.metadata?.name ?? generalSettings?.displayName ?? '',\n appNativeLink: core.metadata?.nativeLink,\n appUniversalLink: core.metadata?.universalLink,\n };\n};\n","type FormatSignInMessageParams = {\n address: string;\n blockchainName: string;\n chainId?: string;\n domain: string;\n issuedAt?: string;\n nonce: string;\n requestId?: string;\n resources?: string[];\n statement?: string;\n uri: string;\n};\n\n/**\n * Formats a sign in message to prove ownership of an address.\n * @notInstrumented\n */\nexport const formatSignInMessage = async ({\n domain,\n blockchainName,\n address,\n uri,\n chainId,\n nonce,\n issuedAt,\n requestId,\n statement,\n resources,\n}: FormatSignInMessageParams) => {\n // This format follows the sign-in with ethereum (SIWE) standard,\n // but we are using it also for non-ethereum wallets for now (eg. Solana)\n // for more context on format and fields, please see:\n // https://docs.login.xyz/general-information/siwe-overview/eip-4361\n const header = `${domain} wants you to sign in with your ${blockchainName} account:`;\n const prefix = [header, address].join('\\n');\n\n // If there is a statement, we want to add a gap between the prefix and the statement\n // two times '\\n', first to move statement to next line and second to add a gap between prefix and statement\n const prefixWithStatementGap = statement ? '\\n\\n' : '\\n';\n const prefixWithStatement = `${[prefix, statement].join(\n prefixWithStatementGap\n )}\\n`;\n\n const suffixFields: string[] = [];\n suffixFields.push(`URI: ${uri}`);\n suffixFields.push('Version: 1');\n if (chainId) {\n suffixFields.push(`Chain ID: ${chainId}`);\n }\n\n suffixFields.push(`Nonce: ${nonce}`);\n\n if (issuedAt) {\n suffixFields.push(`Issued At: ${issuedAt}`);\n }\n\n if (requestId) {\n suffixFields.push(`Request ID: ${requestId}`);\n }\n\n if (resources?.length) {\n suffixFields.push(\n `Resources:${resources.map((resource) => '\\n- ' + resource).join()}`\n );\n }\n\n const suffix = suffixFields.join('\\n');\n\n return [prefixWithStatement, suffix].join('\\n');\n};\n","import type { DynamicClient } from '../../../../../client/types';\nimport { getAppMetadata } from '../../../../../utils/getAppMetadata';\n\n/** @notInstrumented */\nexport const createSignInMessageStatement = (client: DynamicClient) => {\n const { appName } = getAppMetadata(client);\n\n return `Welcome to ${appName}. Signing is the only way we can truly know that you are the owner of the wallet you are connecting. Signing is a safe, gas-less transaction that does not in any way give ${appName} permission to perform any transactions with your wallet.`;\n};\n","import { getCore } from '../../../../client/core/getCore';\nimport type { DynamicClient } from '../../../../client/types';\nimport { checkAndRaiseWalletAccountsChangedEvent } from '../../../auth/updateAuthFromVerifyResponse/checkAndRaiseWalletAccountsChangedEvent';\nimport type { UnverifiedWalletAccount } from '../unverifiedWalletAccounts.types';\n\ntype RemoveUnverifiedWalletAccountParams = {\n unverifiedWalletAccount: UnverifiedWalletAccount;\n};\n\n/**\n * Removes an unverified wallet account from the client's state.\n * @notInstrumented\n */\nexport const removeUnverifiedWalletAccount = (\n { unverifiedWalletAccount }: RemoveUnverifiedWalletAccountParams,\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n const previousState = core.state.get();\n\n const { unverifiedWalletAccounts } = core.state.get();\n\n const filteredUnverifiedWalletAccounts = unverifiedWalletAccounts.filter(\n (account) => account.id !== unverifiedWalletAccount.id\n );\n\n core.state.set({\n unverifiedWalletAccounts: filteredUnverifiedWalletAccounts,\n });\n\n /**\n * We check before raising because the wallet account we are removing might still\n * be present in wallet accounts due to having been moved to verified credentials.\n */\n checkAndRaiseWalletAccountsChangedEvent({ previousState }, client);\n};\n","/**\n * Check if the given value is an Error object\n * @notInstrumented\n */\nexport const isError = (error: unknown): error is Error =>\n error instanceof Error;\n","import { isError } from '../isError';\n\n/**\n * Check if the given value is an Error object with a specific code\n * @notInstrumented\n */\n// eslint-disable-next-line custom-rules/require-single-object-param\nexport const isErrorWithCode = <T extends string>(\n error: unknown,\n code: T\n): error is Error & { code: T } => {\n if (!isError(error)) return false;\n\n return 'code' in error && error.code === code;\n};\n","import type {\n ChainEnum,\n TokenScope,\n VerifyResponse,\n WalletAddressType,\n WalletProviderEnum,\n} from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { isErrorWithCode } from '../../../utils/isErrorWithCode';\nimport { createApiClient } from '../../apiClient';\nimport { consumeCaptchaToken } from '../../captcha/consumeCaptchaToken';\nimport type { Chain } from '../../chain';\nimport { normalizeWalletNameWithChain } from '../utils/normalizeWalletNameWithChain';\nimport type { WalletAddressWithType } from '../walletAccount/walletAccount.types';\nimport { WalletAlreadyLinkedToAnotherUserError } from './../../../errors/WalletAlreadyLinkedToAnotherUserError';\nimport { WalletScreeningBlockedError } from './../../../errors/WalletScreeningBlockedError';\n\ntype VerifyMessageSignatureOwnershipParams = {\n addressesWithTypes?: WalletAddressWithType[];\n chain: Chain;\n isTransfer?: boolean;\n messageToSign: string;\n networkId?: string;\n requestedScopes?: TokenScope[];\n signature: string;\n walletAddress: string;\n walletDisplayName: string;\n walletProviderType: WalletProviderEnum;\n};\n\n/**\n * Verifies a signed message by calling either the verifyLink, verifyTransfer or verify API function,\n * depending on whether the user is signing in, linking or transferring a wallet.\n *\n * Does NOT call updateAuthFromVerifyResponse, it should be called from the return of this function.\n * @throws WalletAlreadyLinkedToAnotherUserError If the wallet is already linked to another user.\n * @throws WalletScreeningBlockedError If the wallet was blocked by the project's compliance screening.\n * @notInstrumented\n */\nexport const verifyMessageSignatureOwnership = async (\n {\n messageToSign,\n walletAddress,\n addressesWithTypes,\n signature,\n chain,\n isTransfer = false,\n walletDisplayName,\n walletProviderType,\n networkId,\n requestedScopes,\n }: VerifyMessageSignatureOwnershipParams,\n client: DynamicClient\n): Promise<VerifyResponse> => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const walletName = normalizeWalletNameWithChain({\n chain,\n displayName: walletDisplayName,\n });\n\n let verifyApiFunction;\n\n if (!client.user) {\n // If the user is not authenticated, call the walletsSignin API function to sign in\n verifyApiFunction = apiClient.walletsSignin.bind(apiClient);\n } else if (isTransfer) {\n // If the user is authenticated and is transferring a wallet, call the verifyTransfer API function\n verifyApiFunction = apiClient.verifyTransfer.bind(apiClient);\n } else if (client.user && requestedScopes) {\n // Scopes = step-up auth: user requests permission for a sensitive op (e.g. wallet export).\n // We grant it only if they prove they own an existing credential (walletsVerify).\n // Must use walletsVerify: user is already logged in (not signin) and credential exists (not transfer/link).\n // If the user is authenticated and requested scopes are provided, call the walletsVerify API function\n verifyApiFunction = apiClient.walletsVerify.bind(apiClient);\n } else {\n // If the user is authenticated and is signing in, call the verifyLink API function\n verifyApiFunction = apiClient.verifyLink.bind(apiClient);\n }\n\n try {\n return await verifyApiFunction({\n environmentId: core.environmentId,\n verifyRequest: {\n // mapping to handle typecasting for address type\n additionalWalletAddresses: addressesWithTypes?.map((address) => ({\n address: address.address,\n publicKey: address.publicKey,\n type: address.type as WalletAddressType,\n })),\n captchaToken: consumeCaptchaToken(client),\n // eslint-disable-next-line custom-rules/ban-chain-enum\n chain: chain as ChainEnum,\n messageToSign,\n network: networkId,\n publicWalletAddress: walletAddress,\n requestedScopes,\n signedMessage: signature,\n walletName,\n walletProvider: walletProviderType,\n },\n });\n } catch (error) {\n core.logger.error('Failed to verify message signature ownership', error);\n\n if (\n isErrorWithCode(error, 'reassign_wallet_confirm') ||\n isErrorWithCode(error, 'merge_accounts_confirmation')\n ) {\n throw new WalletAlreadyLinkedToAnotherUserError({\n cause: error,\n });\n }\n\n if (isErrorWithCode(error, 'chainalysis_blocked_wallet')) {\n throw new WalletScreeningBlockedError({\n cause: error,\n });\n }\n\n throw error;\n }\n};\n","import type { Chain } from '../../../chain';\nimport { CHAINS_INFO_MAP } from '../../constants';\n\n/**\n * Maps the chain name from the API to the SDK chain name\n * @notInstrumented\n */\n// eslint-disable-next-line custom-rules/require-single-object-param\nexport const getSdkChainFromApiChainName = (\n chainName: string\n): Chain | null => {\n const chains = Object.keys(CHAINS_INFO_MAP) as Chain[];\n\n const chain = chains.find(\n (chain) => CHAINS_INFO_MAP[chain].apiChainName === chainName\n );\n\n return chain || null;\n};\n","import { getCore } from '../../../../client/core/getCore';\nimport { getDefaultClient } from '../../../../client/defaultClient';\nimport { assertDefined } from '../../../../utils/assertDefined';\nimport { getSdkChainFromApiChainName } from '../getSdkChainFromApiChainName';\nimport type { NetworkData } from '../networkProvider/networkProvider.types';\n\n/**\n * Retrieves all available network configurations from project settings.\n *\n * This function returns detailed configuration data for all networks enabled\n * in your Dynamic project, including RPC URLs, native currencies, and metadata.\n *\n * If a `transformers.networkData` callback was provided in the client configuration,\n * it will be applied to each network before returning the data. This allows you to\n * customize network properties (such as RPC URLs) in a centralized way.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns An array of network configuration data for all enabled networks.\n * @notInstrumented\n */\nexport const getNetworksData = (client = getDefaultClient()): NetworkData[] => {\n const core = getCore(client);\n const { state, transformers } = core;\n\n const networkDataTransformer =\n transformers?.networkData ?? ((networkData) => networkData);\n\n const { projectSettings } = state.get();\n\n assertDefined(projectSettings, 'projectSettings not found');\n\n const networks = projectSettings.networks;\n\n if (!networks) {\n return [];\n }\n\n const networksData = networks\n .map((network) => {\n if (!network.chainName) return [];\n\n const chain = getSdkChainFromApiChainName(network.chainName);\n\n if (!network?.networks?.length || !chain) return [];\n\n return network.networks.map((networkConfiguration) => {\n const networkData: NetworkData = {\n blockExplorerUrls: networkConfiguration.blockExplorerUrls,\n chain,\n cluster: networkConfiguration.cluster,\n displayName:\n networkConfiguration.vanityName || networkConfiguration.name,\n genesisHash: networkConfiguration.genesisHash,\n iconUrl: networkConfiguration.iconUrls[0],\n name: networkConfiguration.name,\n nativeCurrency: {\n decimals: networkConfiguration.nativeCurrency.decimals,\n iconUrl: networkConfiguration.nativeCurrency.iconUrl,\n name: networkConfiguration.nativeCurrency.name,\n symbol: networkConfiguration.nativeCurrency.symbol,\n },\n networkId: networkConfiguration.networkId,\n rpcUrls: {\n http: [\n ...(networkConfiguration.privateCustomerRpcUrls ?? []),\n ...(networkConfiguration.rpcUrls ?? []),\n ],\n },\n testnet: networkConfiguration.isTestnet ?? false,\n };\n\n return networkDataTransformer(networkData);\n });\n })\n .flat();\n\n return networksData;\n};\n","import type { Chain } from '../../../../chain';\nimport type {\n NetworkProviderBuilder,\n NetworkProviderBuilderRegistry,\n} from '../networkProviderBuilderRegistry.types';\n\n/** @notInstrumented */\nexport const createNetworkProviderBuilderRegistry =\n (): NetworkProviderBuilderRegistry => {\n const registry = new Map<Chain, NetworkProviderBuilder>();\n\n return {\n get: () => registry,\n register: (networkProviderBuilder) => {\n registry.set(networkProviderBuilder.chain, networkProviderBuilder);\n },\n };\n };\n","import { createRuntimeServiceAccessKey } from '../../../../../services/runtimeServices';\nimport { createNetworkProviderBuilderRegistry } from '../createNetworkProviderBuilderRegistry';\n\nexport const getNetworkProviderBuilderRegistry = createRuntimeServiceAccessKey(\n 'networkProviderBuilderRegistry',\n createNetworkProviderBuilderRegistry\n);\n","import type { DynamicClient } from '../../../../client/types';\nimport { getNetworksData } from '../getNetworksData';\nimport type { NetworkProvider } from '../networkProvider';\nimport { getNetworkProviderBuilderRegistry } from '../networkProviderBuilderRegistry';\n\n/**\n * Retrieves all registered network providers for enabled chains.\n * @notInstrumented\n */\nexport const getNetworkProviders = (\n client: DynamicClient\n): NetworkProvider[] => {\n const networkProviderBuilderRegistry =\n getNetworkProviderBuilderRegistry(client);\n\n const registeredNetworkProviderBuilders = Array.from(\n networkProviderBuilderRegistry.get().values()\n );\n\n const networksData = getNetworksData(client);\n\n const networkProviders = registeredNetworkProviderBuilders.map(\n ({ builder, chain }) => {\n const networksDataForChain = networksData.filter(\n (networkData) => networkData.chain === chain\n );\n\n return networksDataForChain.map(builder);\n }\n );\n\n return networkProviders.flat();\n};\n","import type { DynamicClient } from '../../../../client/types';\nimport { NoNetworkProvidersError } from '../../../../errors/NoNetworkProvidersError';\nimport { assertDefined } from '../../../../utils/assertDefined';\nimport type { Chain } from '../../../chain';\nimport { getNetworkProviders } from '../getNetworkProviders';\nimport type { NetworkProvider } from '../networkProvider/networkProvider.types';\n\ntype GetNetworkProviderFromNetworkIdProps = {\n chain: Chain;\n networkId: string;\n};\n\n/** @notInstrumented */\nexport const getNetworkProviderFromNetworkId = (\n { networkId, chain }: GetNetworkProviderFromNetworkIdProps,\n client: DynamicClient\n): NetworkProvider => {\n const networkProviders = getNetworkProviders(client);\n\n if (networkProviders.length === 0) {\n throw new NoNetworkProvidersError();\n }\n\n const networkProvider = networkProviders.find(\n (networkProvider) =>\n networkProvider.networkId === networkId && networkProvider.chain === chain\n );\n\n assertDefined(\n networkProvider,\n `No network provider found for chain ${chain} with network id ${networkId}`\n );\n\n return networkProvider;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAOA,MAAa,kBAAqB,MAAS,SAAY;AACrD,KAAI,OAAO,GAAG,MAAM,KAAK,CAAE,QAAO;AAElC,KACE,OAAO,SAAS,YAChB,SAAS,QACT,OAAO,SAAS,YAChB,SAAS,KAET,QAAO,SAAS;AAGlB,KAAI,gBAAgB,OAAO,gBAAgB,KAAK;AAC9C,MAAI,KAAK,SAAS,KAAK,KAAM,QAAO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,KAC9C,+BAA+B,KAAK,CAAC,QAAQ,CAC9C;CAED,MAAM,eAAe,gBAAgB,OAAO;AAY5C,QAVyB,kCAAkC,KACxD,EAAE,SAAS,YAAY;AAKtB,SAJ6B,aAAa,QACvC,gBAAgB,YAAY,UAAU,MACxC,CAE2B,IAAI,QAAQ;GAE3C,CAEuB,MAAM;;;;;;AClBhC,MAAa,mCACX,EAAE,WAAW,SACb,WACoB;CACpB,MAAM,mBAAmB,oBAAoB,OAAO;AAEpD,KAAI,iBAAiB,WAAW,EAC9B,OAAM,IAAI,yBAAyB;CAGrC,MAAM,kBAAkB,iBAAiB,MACtC,sBACCC,kBAAgB,cAAc,aAAaA,kBAAgB,UAAU,MACxE;AAED,oDACE,iBACA,uCAAuC,MAAM,mBAAmB,YACjE;AAED,QAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"isDynamicWaasEnabled-BQuXZne_.cjs","names":["BaseError","getDefaultClient","EmbeddedWalletVersionEnum"],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts","../src/errors/NotWaasWalletAccountError.ts","../src/modules/waas/isDynamicWaasEnabled/isDynamicWaasEnabled.ts"],"sourcesContent":["import type { VerifyResponse } from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\nimport { updateAuthFromVerifyResponse } from '../../auth/updateAuthFromVerifyResponse';\n\n/**\n * Refreshes the current user's data from the server.\n *\n * This function fetches the latest user information and token from the backend\n * updating the local user and token states with any changes.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the verify response.\n * @instrumented\n */\nexport const refreshAuth = async (\n client = getDefaultClient()\n): Promise<VerifyResponse> => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const response = await apiClient.refreshAuth({\n environmentId: core.environmentId,\n });\n\n updateAuthFromVerifyResponse({ response }, client);\n\n return response;\n};\n","import { BaseError } from './base';\n\ntype NotWaasWalletAccountErrorParams = {\n walletAddress: string;\n};\n\nexport class NotWaasWalletAccountError extends BaseError {\n constructor({ walletAddress }: NotWaasWalletAccountErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_account_error',\n docsUrl: null,\n name: 'NotWaasWalletAccountError',\n shortMessage: `Wallet account ${walletAddress} is not a Dynamic WaaS wallet account`,\n });\n }\n}\n","import { EmbeddedWalletVersionEnum } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Checks if Dynamic WaaS (Wallet as a Service) is enabled for the current project.\n *\n * This function examines the project settings to determine if Dynamic WaaS is\n * enabled in the Dynamic Dashboard or not.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if Dynamic WaaS is enabled, false otherwise.\n * @notInstrumented\n */\nexport const isDynamicWaasEnabled = (client = getDefaultClient()) => {\n const projectSettings = client.projectSettings;\n\n assertDefined(projectSettings, 'Project settings are not available');\n\n const embeddedWalletSettings = projectSettings.sdk.embeddedWallets;\n\n const dynamicWaasIsEnabled =\n embeddedWalletSettings?.defaultWalletVersion ===\n EmbeddedWalletVersionEnum.V3;\n\n return dynamicWaasIsEnabled;\n};\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAE,cAAa,OACb,SAAM,uDAAY;CAElB,MAAM,OAAA,6CAAW,OAAM;wBACN,qDAAK,EAAa,EAAA,OAAA,eAGnC,eAAA,KAAA;AAGD,mEAAA,EAAA,UAAA,EAAA,OAAA;;;;;;;;;;;;;;;;;;ACxBD,IAAa,4BAAb,cAA+CA,+CAAU;CACvD,YAAY,EAAE,iBAAkD;AAC9D,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,kBAAkB,cAAc;GAC/C,CAAC;;;;;;;;;;;;;;;;ACCN,MAAa,wBAAwB,SAASC,uDAAkB,KAAK;CACnE,MAAM,kBAAkB,OAAO;AAE/B,oDAAc,iBAAiB,qCAAqC;AAQpE,QAN+B,gBAAgB,IAAI,iBAGzB,yBACxBC,qDAA0B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"isDynamicWaasEnabled-BaY09iv6.native.esm.js","names":[],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts","../src/errors/NotWaasWalletAccountError.ts","../src/modules/waas/isDynamicWaasEnabled/isDynamicWaasEnabled.ts"],"sourcesContent":["import type { VerifyResponse } from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\nimport { updateAuthFromVerifyResponse } from '../../auth/updateAuthFromVerifyResponse';\n\n/**\n * Refreshes the current user's data from the server.\n *\n * This function fetches the latest user information and token from the backend\n * updating the local user and token states with any changes.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the verify response.\n * @instrumented\n */\nexport const refreshAuth = async (\n client = getDefaultClient()\n): Promise<VerifyResponse> => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const response = await apiClient.refreshAuth({\n environmentId: core.environmentId,\n });\n\n updateAuthFromVerifyResponse({ response }, client);\n\n return response;\n};\n","import { BaseError } from './base';\n\ntype NotWaasWalletAccountErrorParams = {\n walletAddress: string;\n};\n\nexport class NotWaasWalletAccountError extends BaseError {\n constructor({ walletAddress }: NotWaasWalletAccountErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_account_error',\n docsUrl: null,\n name: 'NotWaasWalletAccountError',\n shortMessage: `Wallet account ${walletAddress} is not a Dynamic WaaS wallet account`,\n });\n }\n}\n","import { EmbeddedWalletVersionEnum } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Checks if Dynamic WaaS (Wallet as a Service) is enabled for the current project.\n *\n * This function examines the project settings to determine if Dynamic WaaS is\n * enabled in the Dynamic Dashboard or not.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if Dynamic WaaS is enabled, false otherwise.\n * @notInstrumented\n */\nexport const isDynamicWaasEnabled = (client = getDefaultClient()) => {\n const projectSettings = client.projectSettings;\n\n assertDefined(projectSettings, 'Project settings are not available');\n\n const embeddedWalletSettings = projectSettings.sdk.embeddedWallets;\n\n const dynamicWaasIsEnabled =\n embeddedWalletSettings?.defaultWalletVersion ===\n EmbeddedWalletVersionEnum.V3;\n\n return dynamicWaasIsEnabled;\n};\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAE,cAAa,OACb,SAAM,kBAAY;CAElB,MAAM,OAAA,QAAW,OAAM;wBACN,gBAAK,EAAa,EAAA,OAAA,eAGnC,eAAA,KAAA;AAGD,8BAAA,EAAA,UAAA,EAAA,OAAA;;;;;;;;;;;;;;;;;;ACxBD,IAAa,4BAAb,cAA+C,UAAU;CACvD,YAAY,EAAE,iBAAkD;AAC9D,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,kBAAkB,cAAc;GAC/C,CAAC;;;;;;;;;;;;;;;;ACCN,MAAa,wBAAwB,SAAS,kBAAkB,KAAK;CACnE,MAAM,kBAAkB,OAAO;AAE/B,eAAc,iBAAiB,qCAAqC;AAQpE,QAN+B,gBAAgB,IAAI,iBAGzB,yBACxB,0BAA0B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"isDynamicWaasEnabled-BlVIlXMZ.esm.js","names":[],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts","../src/errors/NotWaasWalletAccountError.ts","../src/modules/waas/isDynamicWaasEnabled/isDynamicWaasEnabled.ts"],"sourcesContent":["import type { VerifyResponse } from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\nimport { updateAuthFromVerifyResponse } from '../../auth/updateAuthFromVerifyResponse';\n\n/**\n * Refreshes the current user's data from the server.\n *\n * This function fetches the latest user information and token from the backend\n * updating the local user and token states with any changes.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the verify response.\n * @instrumented\n */\nexport const refreshAuth = async (\n client = getDefaultClient()\n): Promise<VerifyResponse> => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const response = await apiClient.refreshAuth({\n environmentId: core.environmentId,\n });\n\n updateAuthFromVerifyResponse({ response }, client);\n\n return response;\n};\n","import { BaseError } from './base';\n\ntype NotWaasWalletAccountErrorParams = {\n walletAddress: string;\n};\n\nexport class NotWaasWalletAccountError extends BaseError {\n constructor({ walletAddress }: NotWaasWalletAccountErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_account_error',\n docsUrl: null,\n name: 'NotWaasWalletAccountError',\n shortMessage: `Wallet account ${walletAddress} is not a Dynamic WaaS wallet account`,\n });\n }\n}\n","import { EmbeddedWalletVersionEnum } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Checks if Dynamic WaaS (Wallet as a Service) is enabled for the current project.\n *\n * This function examines the project settings to determine if Dynamic WaaS is\n * enabled in the Dynamic Dashboard or not.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if Dynamic WaaS is enabled, false otherwise.\n * @notInstrumented\n */\nexport const isDynamicWaasEnabled = (client = getDefaultClient()) => {\n const projectSettings = client.projectSettings;\n\n assertDefined(projectSettings, 'Project settings are not available');\n\n const embeddedWalletSettings = projectSettings.sdk.embeddedWallets;\n\n const dynamicWaasIsEnabled =\n embeddedWalletSettings?.defaultWalletVersion ===\n EmbeddedWalletVersionEnum.V3;\n\n return dynamicWaasIsEnabled;\n};\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAE,cAAa,OACb,SAAM,kBAAY;CAElB,MAAM,OAAA,QAAW,OAAM;wBACN,gBAAK,EAAa,EAAA,OAAA,eAGnC,eAAA,KAAA;AAGD,8BAAA,EAAA,UAAA,EAAA,OAAA;;;;;;;;;;;;;;;;;;ACxBD,IAAa,4BAAb,cAA+C,UAAU;CACvD,YAAY,EAAE,iBAAkD;AAC9D,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,kBAAkB,cAAc;GAC/C,CAAC;;;;;;;;;;;;;;;;ACCN,MAAa,wBAAwB,SAAS,kBAAkB,KAAK;CACnE,MAAM,kBAAkB,OAAO;AAE/B,eAAc,iBAAiB,qCAAqC;AAQpE,QAN+B,gBAAgB,IAAI,iBAGzB,yBACxB,0BAA0B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"isMfaRequiredForAction-Dghiguch.cjs","names":["BaseError","getDefaultClient","getWalletAccounts","z","getDefaultClient","getCore","createApiClient","CLIENT_SDK_NAME","getCore","getCore","walletProvidersMap: Map<string, WalletProvider>","getWalletAccounts","getWalletProviderFromWalletAccount","getCore","getDefaultClient","getCore","createApiClient","getDefaultClient"],"sources":["../src/utils/retryOnFail/InvalidRetryOnFailCallError.ts","../src/utils/retryOnFail/retryOnFail.ts","../src/modules/auth/isSignedIn/isSignedIn.ts","../src/services/storage/createStorageKeySchema/createStorageKeySchema.ts","../src/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.ts","../src/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.ts","../src/modules/sessionKeys/generateSessionKeys/generateSessionKeys.ts","../src/modules/wallets/utils/getAvailableWalletProvidersFromWalletAccounts/getAvailableWalletProvidersFromWalletAccounts.ts","../src/modules/wallets/destroyWalletProviders/destroyWalletProviders.ts","../src/modules/auth/logoutWithReason/logoutWithReason.ts","../src/modules/mfa/consumeMfaToken/consumeMfaToken.ts","../src/modules/mfa/getMfaMethods/getMfaMethods.ts","../src/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.ts"],"sourcesContent":["import { BaseError } from '../../errors/base';\n\n/**\n * This error is thrown when the `retryOnFail` function is called with an invalid\n * number of retries (i.e. less than 0).\n */\nexport class InvalidRetryOnFailCallError extends BaseError {\n // eslint-disable-next-line custom-rules/require-single-object-param\n constructor(maxRetries: number) {\n super({\n cause: null,\n code: 'invalid_retry_on_fail_call_error',\n docsUrl: null,\n name: 'InvalidRetryOnFailCallError',\n shortMessage: `Invalid retries parameter for retryOnFail call: ${maxRetries}`,\n });\n }\n}\n","import { InvalidRetryOnFailCallError } from './InvalidRetryOnFailCallError';\n\nexport type RetryOnFailParams<T> = {\n /**\n * The delay between retries in milliseconds.\n */\n delay?: number;\n /**\n * The function to call.\n */\n fn: () => Promise<T>;\n /**\n * The maximum number of retries.\n *\n * When set to 0, the function will be called only once and is\n * therefore equivalent to calling the function directly.\n */\n maxRetries: number;\n};\n\n/** @notInstrumented */\nexport const retryOnFail = async <T>({\n delay = 0,\n fn,\n maxRetries,\n}: RetryOnFailParams<T>) => {\n for (let retry = 0; retry <= maxRetries; retry++) {\n try {\n return await fn();\n } catch (error) {\n if (retry >= maxRetries) {\n throw error;\n }\n\n if (delay > 0) {\n await new Promise((resolve) => setTimeout(resolve, delay));\n }\n }\n }\n\n /**\n * Reaching this point should never happen and this\n * error is thrown to help us debug the issue.\n */\n throw new InvalidRetryOnFailCallError(maxRetries);\n};\n","import { getDefaultClient } from '../../../client/defaultClient';\nimport { getWalletAccounts } from '../../wallets/getWalletAccounts';\n\n/**\n * Checks if the user is currently signed in to the Dynamic client.\n *\n * The client is considered to be in a signed in state if a user has\n * authenticated or if the client has at least one wallet connected.\n *\n * @deprecated What counts as \"signed in\" is your app's business logic, not the\n * SDK's. This helper bakes in one opinion (a user OR any connected wallet),\n * which rarely matches every app and forces a dependency on us for every\n * variation. Compose your own check from the underlying primitives instead —\n * e.g. `Boolean(client.user) || isAnyWalletAccountConnected(client)` — and\n * layer in whatever your app requires (device registration, completed\n * onboarding, satisfied MFA, a required embedded wallet, …). See the\n * \"Check if signed in\" guide:\n * https://www.dynamic.xyz/docs/javascript/user-session-management\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if the user is signed in, false otherwise.\n * @notInstrumented\n */\nexport const isSignedIn = (client = getDefaultClient()) =>\n Boolean(client.user || getWalletAccounts(client).length > 0);\n","import type * as z from 'zod/mini';\n\nimport type { StorageKeySchema, StorageKeySchemaConfig } from '../storage.types';\n\n/** @notInstrumented */\nexport const createStorageKeySchema = <T>(params: {\n config?: StorageKeySchemaConfig;\n key: string;\n schema: z.ZodMiniType<T>;\n}): StorageKeySchema<T> => {\n return params;\n};\n","import * as z from 'zod/mini';\n\nimport { createStorageKeySchema } from '../../../services/storage';\n\n/**\n * The schema to track the expiration time of the project settings.\n */\nexport const projectSettingsExpirationStorageKeySchema = createStorageKeySchema(\n {\n key: 'projectSettingsExpiration',\n schema: z.number(),\n }\n);\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { retryOnFail } from '../../../utils/retryOnFail';\nimport { createApiClient } from '../../apiClient';\nimport { CLIENT_SDK_NAME } from '../../apiClient/constants';\nimport { isSignedIn } from '../../auth/isSignedIn';\nimport { projectSettingsExpirationStorageKeySchema } from './projectSettingsExpirationScheme';\n\n/**\n * Expiration time of the project settings in milliseconds.\n */\nexport const PROJECT_SETTINGS_EXPIRATION_TIME = 1000 * 60 * 5; // 5 minutes\n\n/**\n * Fetches and updates the project settings from the API.\n *\n * This function retrieves the latest project configuration settings\n * from Dynamic's servers, including authentication options, enabled chains,\n * and security configurations. The settings are cached for performance.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the updated project settings.\n * @notInstrumented\n * @noHook Internal settings fetch that is not part of the public hook surface.\n */\nexport const fetchProjectSettings = async (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const currentExpiration = await core.storage.getItem(\n projectSettingsExpirationStorageKeySchema\n );\n\n const hasProjectSettings = Boolean(client.projectSettings);\n const isExpired = currentExpiration && currentExpiration < Date.now();\n\n // We want to cache the project settings if its valid and user is connected.\n // This avoids unnecessary API calls and speeds up the initial load.\n if (hasProjectSettings && !isExpired && isSignedIn(client)) {\n return client.projectSettings;\n }\n\n const apiClient = createApiClient({}, client);\n\n core.logger.debug('[fetchProjectSettings] Fetching project settings...');\n\n const doFetch = async () =>\n apiClient.getEnvironmentSettings(\n {\n environmentId: core.environmentId,\n sdkVersion: `${CLIENT_SDK_NAME}/${core.version}`,\n },\n {\n credentials: 'omit',\n }\n );\n\n const projectSettings = await retryOnFail({\n fn: doFetch,\n maxRetries: 2,\n });\n\n core.state.set({ projectSettings: projectSettings ?? null });\n\n await core.storage.setItem(\n projectSettingsExpirationStorageKeySchema,\n Date.now() + PROJECT_SETTINGS_EXPIRATION_TIME\n );\n\n return projectSettings;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport type { SessionKeys } from '../sessionKeys.types';\n\n/** @notInstrumented */\nexport const generateSessionKeys = async (\n client: DynamicClient\n): Promise<SessionKeys> => {\n const core = getCore(client);\n\n const currentState = core.state.get();\n\n const isRotation = Boolean(currentState.sessionKeys);\n\n const logContext = {\n environmentId: core.environmentId,\n operation: isRotation ? 'rotate' : 'create',\n userId: currentState.user?.id ?? null,\n };\n\n core.logger.info(\n isRotation\n ? '[generateSessionKeys] Rotating session key...'\n : '[generateSessionKeys] Creating session key...',\n logContext\n );\n\n await core.keychain.removeKey('session');\n\n const publicKey = await core.keychain.generateKey('session');\n\n assertDefined(publicKey, 'Public key not found');\n\n core.state.set({\n sessionKeys: publicKey,\n });\n\n core.logger.info(\n isRotation\n ? '[generateSessionKeys] Session key rotated'\n : '[generateSessionKeys] Session key created',\n logContext\n );\n\n return { publicKey };\n};\n","import { getCore } from '../../../../client/core/getCore';\nimport type { DynamicClient } from '../../../../client/types';\nimport { getWalletAccounts } from '../../getWalletAccounts';\nimport type { WalletProvider } from '../../walletProvider';\nimport { getWalletProviderFromWalletAccount } from '../getWalletProviderFromWalletAccount';\n\n/** @notInstrumented */\nexport const getAvailableWalletProvidersFromWalletAccounts = (\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n const walletProvidersMap: Map<string, WalletProvider> = new Map();\n\n const walletAccounts = getWalletAccounts(client);\n\n walletAccounts.forEach((walletAccount) => {\n if (walletProvidersMap.has(walletAccount.walletProviderKey)) {\n return;\n }\n\n try {\n const walletProvider = getWalletProviderFromWalletAccount(\n {\n walletAccount,\n },\n client\n );\n\n walletProvidersMap.set(walletAccount.walletProviderKey, walletProvider);\n } catch (error) {\n core.logger.debug('Wallet provider not found for wallet account', {\n error,\n walletAccount: walletAccount.address,\n });\n }\n });\n\n return Array.from(walletProvidersMap.values());\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types/DynamicClient';\nimport type { LogoutReason } from '../../auth/logoutReason';\nimport { getAvailableWalletProvidersFromWalletAccounts } from '../utils/getAvailableWalletProvidersFromWalletAccounts';\n\n/**\n * Tear down every wallet provider on the client.\n *\n * Each provider's `destroy` is responsible for its own local + remote\n * cleanup. We swallow errors so a failing destroy on one provider does not\n * block teardown of the others (e.g. during logout).\n *\n * @notInstrumented\n */\nexport const destroyWalletProviders = async (\n { reason }: { reason?: LogoutReason },\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n const walletProviders = getAvailableWalletProvidersFromWalletAccounts(client);\n\n await Promise.all(\n walletProviders.map(async (walletProvider) => {\n if (!walletProvider.destroy) return;\n try {\n await walletProvider.destroy({ reason });\n } catch (err) {\n core.logger.error(\n `Error destroying wallet provider ${walletProvider.key}`,\n err\n );\n }\n })\n );\n};\n","import type { DynamicClient } from '../../../client/types';\nimport { getCore } from '../../../client/core/getCore';\nimport { getSecureCookieAttribute } from '../../../utils/getSecureCookieAttribute';\nimport { setCookie } from '../../../utils/setCookie';\nimport { createApiClient } from '../../apiClient';\nimport { emitEvent } from '../../clientEvents';\nimport { fetchProjectSettings } from '../../projectSettings/fetchProjectSettings';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport { generateSessionKeys } from '../../sessionKeys/generateSessionKeys';\nimport { destroyWalletProviders } from '../../wallets/destroyWalletProviders';\nimport { DYNAMIC_AUTH_COOKIE_NAME } from '../consts';\nimport type { LogoutReason } from '../logoutReason';\n\n/**\n * Logs the user out with an explicit reason.\n *\n * Revokes the session, clears auth state, terminates wallet providers, and\n * emits the `logout` client event with the given reason. The reason is also\n * captured as an argument on the function-instrumentation event, which is\n * how Datadog distinguishes between different logout causes.\n *\n * Use this instead of the public `logout` when triggering a logout from\n * internal or extension code — the caller owns the reason string, so the\n * telemetry correctly attributes *why* the logout happened.\n *\n * @param params - The logout params.\n * @param params.reason - Why the logout is being triggered. Extension authors\n * needing a reason outside the SDK catalog can cast with `as LogoutReason`.\n * @param client - The Dynamic client instance.\n * @instrumented\n */\nexport const logoutWithReason = async (\n { reason }: { reason: LogoutReason },\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n core.logger.debug('[logoutWithReason] Logging out...', { reason });\n\n await destroyWalletProviders({ reason }, client);\n\n if (client.user !== null) {\n const apiClient = createApiClient({}, client);\n\n try {\n await apiClient.revokeSession({\n environmentId: core.environmentId,\n });\n } catch (error) {\n core.logger.error('Failed to revoke session', error);\n }\n\n /**\n * This deletes the auth cookie if it exists.\n * If the cookie doesn't exist, this sets a new cookie that expires immediately.\n */\n if (isCookieEnabled(client)) {\n // Match the Secure attribute used when the cookie was written so the\n // deletion cookie is accepted consistently in a secure context.\n const secureAttribute = getSecureCookieAttribute();\n\n setCookie(\n `${DYNAMIC_AUTH_COOKIE_NAME}=; Max-Age=-99999999; path=/; SameSite=Lax${secureAttribute}`\n );\n }\n }\n\n await core.keychain.removeKey('session');\n\n core.state.set({\n captchaToken: null,\n elevatedAccessTokens: [],\n legacyToken: null,\n mfaToken: null,\n sessionExpiresAt: null,\n sessionKeys: null,\n token: null,\n unverifiedWalletAccounts: [],\n user: null,\n });\n\n emitEvent({ args: { reason }, event: 'logout' }, client);\n\n // Refetch project settings\n void fetchProjectSettings(client);\n\n // Regenerate session keys\n void generateSessionKeys(client);\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Consumes and clears the current MFA token from the client state.\n *\n * This function retrieves the MFA token obtained from a successful MFA authentication,\n * and removes it from the client, to prevent it from being used again.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns The MFA token that was consumed.\n * @throws Error if no MFA token is found.\n * @instrumented\n */\nexport const consumeMfaToken = (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const mfaToken = core.state.get().mfaToken;\n\n assertDefined(mfaToken, 'No MFA token found');\n\n core.state.set({\n mfaToken: null,\n });\n\n return mfaToken;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\n\n/**\n * Retrieves the available MFA methods for the current user.\n *\n * This function fetches information about which multi-factor authentication\n * methods are available and configured for the user's account.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the user's MFA methods configuration.\n * @notInstrumented\n */\nexport const getMfaMethods = async (client = getDefaultClient()) => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const userMfaMethods = await apiClient.getUserMfaMethods({\n environmentId: core.environmentId,\n verifiedOnly: true,\n });\n\n return userMfaMethods;\n};\n","import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { getMfaMethods } from '../getMfaMethods';\n\ntype IsMfaRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/**\n * Checks if MFA is required for a specific action.\n *\n * This function determines whether multi-factor authentication is required\n * for the specified action based on project settings and user configuration.\n *\n * @param params.mfaAction - The action to check MFA requirements for.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to true if MFA is required for the action, false otherwise.\n * @notInstrumented\n */\nexport const isMfaRequiredForAction = async (\n { mfaAction }: IsMfaRequiredForActionParams,\n client = getDefaultClient()\n) => {\n const projectSettings = client.projectSettings;\n\n const isRequiredForAction = projectSettings?.security?.mfa?.actions?.some(\n (action) => action.action === mfaAction && action.required\n );\n\n // if mfa is not required for the action, return false\n // no matter if general mfa is set to required or not\n if (!isRequiredForAction) {\n return false;\n }\n\n const isMfaMethodRequired = projectSettings?.security?.mfa?.required;\n\n // if mfa is required for the action and also set as required in general, return true\n if (isMfaMethodRequired) {\n return true;\n }\n\n const mfaMethods = await getMfaMethods(client);\n // if general mfa is optional, but user has registered methods,\n // then it should be required for the action\n return mfaMethods.userHasVerifiedMfaMethods;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAa,8BAAb,cAAiDA,+CAAU;CAEzD,YAAY,YAAoB;AAC9B,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,mDAAmD;GAClE,CAAC;;;;;;;ACMN,MAAa,cAAc,OAAU,EACnC,QAAQ,GACR,IACA,iBAC0B;AAC1B,MAAK,IAAI,QAAQ,GAAG,SAAS,YAAY,QACvC,KAAI;AACF,SAAO,MAAM,IAAI;UACV,OAAO;AACd,MAAI,SAAS,WACX,OAAM;AAGR,MAAI,QAAQ,EACV,OAAM,IAAI,SAAS,YAAY,WAAW,SAAS,MAAM,CAAC;;;;;;AAShE,OAAM,IAAI,4BAA4B,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;ACrBnD,MAAa,cAAc,SAASC,uDAAkB,KACpD,QAAQ,OAAO,QAAQC,uDAAkB,OAAO,CAAC,SAAS,EAAE;;;;;ACnB9D,MAAa,0BAA6B,WAIf;AACzB,QAAO;;;;;;;;ACHT,MAAa,4C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AA;AAEpB,MAAE,MAAA,IAAa;EACb,cAAc;EACd,sBAAsB,EAAA;EACtB,aAAa;EACb,UAAO;EACP,kBAAA;EACA,aAAU;EACV,OAAA;;EAEF,MAAA;;AAGA,gDAAK;EAAA,MAAA,EAAA,QAAqB;EAAA,OAAO;EAAA,EAAA,OAAA;AAGjC,CAAK,qBAAoB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrElC,MAAE,mBAAsB,SAAU,uDAAU,KAAA;;;AAK1C,oDAAY,UAAI,qBAAA;kBAGhB,UAAO,MACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACbD,MAAa,gBAAgB,OAAO,SAASC,uDAAkB,KAAK;CAClE,MAAM,OAAOC,6CAAQ,OAAO;AAQ5B,QALuB,MAFLC,qDAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;;ACDJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAASC,uDAAkB,KACxB;CACH,MAAM,kBAAkB,OAAO;AAQ/B,KAAI,CANwB,iBAAiB,UAAU,KAAK,SAAS,MAClE,WAAW,OAAO,WAAW,aAAa,OAAO,SACnD,CAKC,QAAO;AAMT,KAH4B,iBAAiB,UAAU,KAAK,SAI1D,QAAO;AAMT,SAHmB,MAAM,cAAc,OAAO,EAG5B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"isMfaRequiredForAction-r9aDdmK5.esm.js","names":["walletProvidersMap: Map<string, WalletProvider>"],"sources":["../src/utils/retryOnFail/InvalidRetryOnFailCallError.ts","../src/utils/retryOnFail/retryOnFail.ts","../src/modules/auth/isSignedIn/isSignedIn.ts","../src/services/storage/createStorageKeySchema/createStorageKeySchema.ts","../src/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.ts","../src/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.ts","../src/modules/sessionKeys/generateSessionKeys/generateSessionKeys.ts","../src/modules/wallets/utils/getAvailableWalletProvidersFromWalletAccounts/getAvailableWalletProvidersFromWalletAccounts.ts","../src/modules/wallets/destroyWalletProviders/destroyWalletProviders.ts","../src/modules/auth/logoutWithReason/logoutWithReason.ts","../src/modules/mfa/consumeMfaToken/consumeMfaToken.ts","../src/modules/mfa/getMfaMethods/getMfaMethods.ts","../src/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.ts"],"sourcesContent":["import { BaseError } from '../../errors/base';\n\n/**\n * This error is thrown when the `retryOnFail` function is called with an invalid\n * number of retries (i.e. less than 0).\n */\nexport class InvalidRetryOnFailCallError extends BaseError {\n // eslint-disable-next-line custom-rules/require-single-object-param\n constructor(maxRetries: number) {\n super({\n cause: null,\n code: 'invalid_retry_on_fail_call_error',\n docsUrl: null,\n name: 'InvalidRetryOnFailCallError',\n shortMessage: `Invalid retries parameter for retryOnFail call: ${maxRetries}`,\n });\n }\n}\n","import { InvalidRetryOnFailCallError } from './InvalidRetryOnFailCallError';\n\nexport type RetryOnFailParams<T> = {\n /**\n * The delay between retries in milliseconds.\n */\n delay?: number;\n /**\n * The function to call.\n */\n fn: () => Promise<T>;\n /**\n * The maximum number of retries.\n *\n * When set to 0, the function will be called only once and is\n * therefore equivalent to calling the function directly.\n */\n maxRetries: number;\n};\n\n/** @notInstrumented */\nexport const retryOnFail = async <T>({\n delay = 0,\n fn,\n maxRetries,\n}: RetryOnFailParams<T>) => {\n for (let retry = 0; retry <= maxRetries; retry++) {\n try {\n return await fn();\n } catch (error) {\n if (retry >= maxRetries) {\n throw error;\n }\n\n if (delay > 0) {\n await new Promise((resolve) => setTimeout(resolve, delay));\n }\n }\n }\n\n /**\n * Reaching this point should never happen and this\n * error is thrown to help us debug the issue.\n */\n throw new InvalidRetryOnFailCallError(maxRetries);\n};\n","import { getDefaultClient } from '../../../client/defaultClient';\nimport { getWalletAccounts } from '../../wallets/getWalletAccounts';\n\n/**\n * Checks if the user is currently signed in to the Dynamic client.\n *\n * The client is considered to be in a signed in state if a user has\n * authenticated or if the client has at least one wallet connected.\n *\n * @deprecated What counts as \"signed in\" is your app's business logic, not the\n * SDK's. This helper bakes in one opinion (a user OR any connected wallet),\n * which rarely matches every app and forces a dependency on us for every\n * variation. Compose your own check from the underlying primitives instead —\n * e.g. `Boolean(client.user) || isAnyWalletAccountConnected(client)` — and\n * layer in whatever your app requires (device registration, completed\n * onboarding, satisfied MFA, a required embedded wallet, …). See the\n * \"Check if signed in\" guide:\n * https://www.dynamic.xyz/docs/javascript/user-session-management\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if the user is signed in, false otherwise.\n * @notInstrumented\n */\nexport const isSignedIn = (client = getDefaultClient()) =>\n Boolean(client.user || getWalletAccounts(client).length > 0);\n","import type * as z from 'zod/mini';\n\nimport type { StorageKeySchema, StorageKeySchemaConfig } from '../storage.types';\n\n/** @notInstrumented */\nexport const createStorageKeySchema = <T>(params: {\n config?: StorageKeySchemaConfig;\n key: string;\n schema: z.ZodMiniType<T>;\n}): StorageKeySchema<T> => {\n return params;\n};\n","import * as z from 'zod/mini';\n\nimport { createStorageKeySchema } from '../../../services/storage';\n\n/**\n * The schema to track the expiration time of the project settings.\n */\nexport const projectSettingsExpirationStorageKeySchema = createStorageKeySchema(\n {\n key: 'projectSettingsExpiration',\n schema: z.number(),\n }\n);\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { retryOnFail } from '../../../utils/retryOnFail';\nimport { createApiClient } from '../../apiClient';\nimport { CLIENT_SDK_NAME } from '../../apiClient/constants';\nimport { isSignedIn } from '../../auth/isSignedIn';\nimport { projectSettingsExpirationStorageKeySchema } from './projectSettingsExpirationScheme';\n\n/**\n * Expiration time of the project settings in milliseconds.\n */\nexport const PROJECT_SETTINGS_EXPIRATION_TIME = 1000 * 60 * 5; // 5 minutes\n\n/**\n * Fetches and updates the project settings from the API.\n *\n * This function retrieves the latest project configuration settings\n * from Dynamic's servers, including authentication options, enabled chains,\n * and security configurations. The settings are cached for performance.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the updated project settings.\n * @notInstrumented\n * @noHook Internal settings fetch that is not part of the public hook surface.\n */\nexport const fetchProjectSettings = async (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const currentExpiration = await core.storage.getItem(\n projectSettingsExpirationStorageKeySchema\n );\n\n const hasProjectSettings = Boolean(client.projectSettings);\n const isExpired = currentExpiration && currentExpiration < Date.now();\n\n // We want to cache the project settings if its valid and user is connected.\n // This avoids unnecessary API calls and speeds up the initial load.\n if (hasProjectSettings && !isExpired && isSignedIn(client)) {\n return client.projectSettings;\n }\n\n const apiClient = createApiClient({}, client);\n\n core.logger.debug('[fetchProjectSettings] Fetching project settings...');\n\n const doFetch = async () =>\n apiClient.getEnvironmentSettings(\n {\n environmentId: core.environmentId,\n sdkVersion: `${CLIENT_SDK_NAME}/${core.version}`,\n },\n {\n credentials: 'omit',\n }\n );\n\n const projectSettings = await retryOnFail({\n fn: doFetch,\n maxRetries: 2,\n });\n\n core.state.set({ projectSettings: projectSettings ?? null });\n\n await core.storage.setItem(\n projectSettingsExpirationStorageKeySchema,\n Date.now() + PROJECT_SETTINGS_EXPIRATION_TIME\n );\n\n return projectSettings;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport type { SessionKeys } from '../sessionKeys.types';\n\n/** @notInstrumented */\nexport const generateSessionKeys = async (\n client: DynamicClient\n): Promise<SessionKeys> => {\n const core = getCore(client);\n\n const currentState = core.state.get();\n\n const isRotation = Boolean(currentState.sessionKeys);\n\n const logContext = {\n environmentId: core.environmentId,\n operation: isRotation ? 'rotate' : 'create',\n userId: currentState.user?.id ?? null,\n };\n\n core.logger.info(\n isRotation\n ? '[generateSessionKeys] Rotating session key...'\n : '[generateSessionKeys] Creating session key...',\n logContext\n );\n\n await core.keychain.removeKey('session');\n\n const publicKey = await core.keychain.generateKey('session');\n\n assertDefined(publicKey, 'Public key not found');\n\n core.state.set({\n sessionKeys: publicKey,\n });\n\n core.logger.info(\n isRotation\n ? '[generateSessionKeys] Session key rotated'\n : '[generateSessionKeys] Session key created',\n logContext\n );\n\n return { publicKey };\n};\n","import { getCore } from '../../../../client/core/getCore';\nimport type { DynamicClient } from '../../../../client/types';\nimport { getWalletAccounts } from '../../getWalletAccounts';\nimport type { WalletProvider } from '../../walletProvider';\nimport { getWalletProviderFromWalletAccount } from '../getWalletProviderFromWalletAccount';\n\n/** @notInstrumented */\nexport const getAvailableWalletProvidersFromWalletAccounts = (\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n const walletProvidersMap: Map<string, WalletProvider> = new Map();\n\n const walletAccounts = getWalletAccounts(client);\n\n walletAccounts.forEach((walletAccount) => {\n if (walletProvidersMap.has(walletAccount.walletProviderKey)) {\n return;\n }\n\n try {\n const walletProvider = getWalletProviderFromWalletAccount(\n {\n walletAccount,\n },\n client\n );\n\n walletProvidersMap.set(walletAccount.walletProviderKey, walletProvider);\n } catch (error) {\n core.logger.debug('Wallet provider not found for wallet account', {\n error,\n walletAccount: walletAccount.address,\n });\n }\n });\n\n return Array.from(walletProvidersMap.values());\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types/DynamicClient';\nimport type { LogoutReason } from '../../auth/logoutReason';\nimport { getAvailableWalletProvidersFromWalletAccounts } from '../utils/getAvailableWalletProvidersFromWalletAccounts';\n\n/**\n * Tear down every wallet provider on the client.\n *\n * Each provider's `destroy` is responsible for its own local + remote\n * cleanup. We swallow errors so a failing destroy on one provider does not\n * block teardown of the others (e.g. during logout).\n *\n * @notInstrumented\n */\nexport const destroyWalletProviders = async (\n { reason }: { reason?: LogoutReason },\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n const walletProviders = getAvailableWalletProvidersFromWalletAccounts(client);\n\n await Promise.all(\n walletProviders.map(async (walletProvider) => {\n if (!walletProvider.destroy) return;\n try {\n await walletProvider.destroy({ reason });\n } catch (err) {\n core.logger.error(\n `Error destroying wallet provider ${walletProvider.key}`,\n err\n );\n }\n })\n );\n};\n","import type { DynamicClient } from '../../../client/types';\nimport { getCore } from '../../../client/core/getCore';\nimport { getSecureCookieAttribute } from '../../../utils/getSecureCookieAttribute';\nimport { setCookie } from '../../../utils/setCookie';\nimport { createApiClient } from '../../apiClient';\nimport { emitEvent } from '../../clientEvents';\nimport { fetchProjectSettings } from '../../projectSettings/fetchProjectSettings';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport { generateSessionKeys } from '../../sessionKeys/generateSessionKeys';\nimport { destroyWalletProviders } from '../../wallets/destroyWalletProviders';\nimport { DYNAMIC_AUTH_COOKIE_NAME } from '../consts';\nimport type { LogoutReason } from '../logoutReason';\n\n/**\n * Logs the user out with an explicit reason.\n *\n * Revokes the session, clears auth state, terminates wallet providers, and\n * emits the `logout` client event with the given reason. The reason is also\n * captured as an argument on the function-instrumentation event, which is\n * how Datadog distinguishes between different logout causes.\n *\n * Use this instead of the public `logout` when triggering a logout from\n * internal or extension code — the caller owns the reason string, so the\n * telemetry correctly attributes *why* the logout happened.\n *\n * @param params - The logout params.\n * @param params.reason - Why the logout is being triggered. Extension authors\n * needing a reason outside the SDK catalog can cast with `as LogoutReason`.\n * @param client - The Dynamic client instance.\n * @instrumented\n */\nexport const logoutWithReason = async (\n { reason }: { reason: LogoutReason },\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n core.logger.debug('[logoutWithReason] Logging out...', { reason });\n\n await destroyWalletProviders({ reason }, client);\n\n if (client.user !== null) {\n const apiClient = createApiClient({}, client);\n\n try {\n await apiClient.revokeSession({\n environmentId: core.environmentId,\n });\n } catch (error) {\n core.logger.error('Failed to revoke session', error);\n }\n\n /**\n * This deletes the auth cookie if it exists.\n * If the cookie doesn't exist, this sets a new cookie that expires immediately.\n */\n if (isCookieEnabled(client)) {\n // Match the Secure attribute used when the cookie was written so the\n // deletion cookie is accepted consistently in a secure context.\n const secureAttribute = getSecureCookieAttribute();\n\n setCookie(\n `${DYNAMIC_AUTH_COOKIE_NAME}=; Max-Age=-99999999; path=/; SameSite=Lax${secureAttribute}`\n );\n }\n }\n\n await core.keychain.removeKey('session');\n\n core.state.set({\n captchaToken: null,\n elevatedAccessTokens: [],\n legacyToken: null,\n mfaToken: null,\n sessionExpiresAt: null,\n sessionKeys: null,\n token: null,\n unverifiedWalletAccounts: [],\n user: null,\n });\n\n emitEvent({ args: { reason }, event: 'logout' }, client);\n\n // Refetch project settings\n void fetchProjectSettings(client);\n\n // Regenerate session keys\n void generateSessionKeys(client);\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Consumes and clears the current MFA token from the client state.\n *\n * This function retrieves the MFA token obtained from a successful MFA authentication,\n * and removes it from the client, to prevent it from being used again.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns The MFA token that was consumed.\n * @throws Error if no MFA token is found.\n * @instrumented\n */\nexport const consumeMfaToken = (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const mfaToken = core.state.get().mfaToken;\n\n assertDefined(mfaToken, 'No MFA token found');\n\n core.state.set({\n mfaToken: null,\n });\n\n return mfaToken;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\n\n/**\n * Retrieves the available MFA methods for the current user.\n *\n * This function fetches information about which multi-factor authentication\n * methods are available and configured for the user's account.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the user's MFA methods configuration.\n * @notInstrumented\n */\nexport const getMfaMethods = async (client = getDefaultClient()) => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const userMfaMethods = await apiClient.getUserMfaMethods({\n environmentId: core.environmentId,\n verifiedOnly: true,\n });\n\n return userMfaMethods;\n};\n","import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { getMfaMethods } from '../getMfaMethods';\n\ntype IsMfaRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/**\n * Checks if MFA is required for a specific action.\n *\n * This function determines whether multi-factor authentication is required\n * for the specified action based on project settings and user configuration.\n *\n * @param params.mfaAction - The action to check MFA requirements for.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to true if MFA is required for the action, false otherwise.\n * @notInstrumented\n */\nexport const isMfaRequiredForAction = async (\n { mfaAction }: IsMfaRequiredForActionParams,\n client = getDefaultClient()\n) => {\n const projectSettings = client.projectSettings;\n\n const isRequiredForAction = projectSettings?.security?.mfa?.actions?.some(\n (action) => action.action === mfaAction && action.required\n );\n\n // if mfa is not required for the action, return false\n // no matter if general mfa is set to required or not\n if (!isRequiredForAction) {\n return false;\n }\n\n const isMfaMethodRequired = projectSettings?.security?.mfa?.required;\n\n // if mfa is required for the action and also set as required in general, return true\n if (isMfaMethodRequired) {\n return true;\n }\n\n const mfaMethods = await getMfaMethods(client);\n // if general mfa is optional, but user has registered methods,\n // then it should be required for the action\n return mfaMethods.userHasVerifiedMfaMethods;\n};\n"],"mappings":";;;;;;;;AAMA,IAAa,8BAAb,cAAiD,UAAU;CAEzD,YAAY,YAAoB;AAC9B,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,mDAAmD;GAClE,CAAC;;;;;;;ACMN,MAAa,cAAc,OAAU,EACnC,QAAQ,GACR,IACA,iBAC0B;AAC1B,MAAK,IAAI,QAAQ,GAAG,SAAS,YAAY,QACvC,KAAI;AACF,SAAO,MAAM,IAAI;UACV,OAAO;AACd,MAAI,SAAS,WACX,OAAM;AAGR,MAAI,QAAQ,EACV,OAAM,IAAI,SAAS,YAAY,WAAW,SAAS,MAAM,CAAC;;;;;;AAShE,OAAM,I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M,UAAQ,cAAA,EACd,eAAiB,KAAE,eACrB,CAAA;;AAEE,QAAA,OAAA,MAAA,4BAAA,MAAA;;;;;;AAOF,MAAE,gBAAM,OAAkB,CAK1B,WACF,GAAA,yBAAA,4CAHS,0BAA6C;;AAQtD,OAAE,KAAA,SAAkB,UAAA,UAAA;AAEpB,MAAE,MAAA,IAAa;EACb,cAAc;EACd,sBAAsB,EAAA;EACtB,aAAa;EACb,UAAO;EACP,kBAAA;EACA,aAAU;EACV,OAAA;;EAEF,MAAA;;AAGA,WAAK;EAAA,MAAA,EAAA,QAAqB;EAAA,OAAO;EAAA,EAAA,OAAA;AAGjC,CAAK,qBAAoB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrElC,MAAE,mBAAsB,SAAU,kBAAU,KAAA;;;AAK1C,eAAY,UAAI,qBAAA;kBAGhB,UAAO,MACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACbD,MAAa,gBAAgB,OAAO,SAAS,kBAAkB,KAAK;CAClE,MAAM,OAAO,QAAQ,OAAO;AAQ5B,QALuB,MAFL,gBAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;;ACDJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAAS,kBAAkB,KACxB;CACH,MAAM,kBAAkB,OAAO;AAQ/B,KAAI,CANwB,iBAAiB,UAAU,KAAK,SAAS,MAClE,WAAW,OAAO,WAAW,aAAa,OAAO,SACnD,CAKC,QAAO;AAMT,KAH4B,iBAAiB,UAAU,KAAK,SAI1D,QAAO;AAMT,SAHmB,MAAM,cAAc,OAAO,EAG5B"}
@@ -1,10 +0,0 @@
1
- import type { WalletAccount } from '../../walletAccount';
2
- /**
3
- * Get the primary wallet account.
4
- * The primary wallet account is the one that was last selected by the user.
5
- * This information is stored in both unverified and verified wallet accounts.
6
- * This function consolidates this information to determine which wallet was most recently selected.
7
- * @notInstrumented
8
- */
9
- export declare const getPrimaryWalletAccount: (client?: import("../../../../exports").DynamicClient) => WalletAccount | null;
10
- //# sourceMappingURL=getPrimaryWalletAccount.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getPrimaryWalletAccount.d.ts","sourceRoot":"","sources":["../../../../../src/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,4DAEjC,aAAa,GAAG,IAmBlB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC"}
@@ -1,12 +0,0 @@
1
- import type { WalletAccount } from '../../walletAccount';
2
- type SelectPrimaryWalletAccountParams = {
3
- walletAccount: WalletAccount;
4
- };
5
- /**
6
- * Make the wallet account provided as the primary wallet account.
7
- * @instrumented
8
- * @noHook The primary-wallet concept is discouraged and not exposed as a hook.
9
- */
10
- export declare const selectPrimaryWalletAccount: ({ walletAccount }: SelectPrimaryWalletAccountParams, client?: import("../../../../exports").DynamicClient) => Promise<void>;
11
- export {};
12
- //# sourceMappingURL=selectPrimaryWalletAccount.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selectPrimaryWalletAccount.d.ts","sourceRoot":"","sources":["../../../../../src/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,KAAK,gCAAgC,GAAG;IACtC,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,sBAClB,gCAAgC,2DAElD,OAAO,CAAC,IAAI,CAiCd,CAAC"}