@dynamic-labs-sdk/client 1.17.1 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) 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 +7 -5
  6. package/dist/core.cjs.map +1 -1
  7. package/dist/core.esm.js +6 -6
  8. package/dist/core.esm.js.map +1 -1
  9. package/dist/core.native.esm.js +6 -6
  10. package/dist/core.native.esm.js.map +1 -1
  11. package/dist/errors/APIError/APIError.d.ts +11 -1
  12. package/dist/errors/APIError/APIError.d.ts.map +1 -1
  13. package/dist/errors/DeviceRegistrationIdentityMismatchError.d.ts +26 -0
  14. package/dist/errors/DeviceRegistrationIdentityMismatchError.d.ts.map +1 -0
  15. package/dist/errors/MergeAccountsConfirmationError.d.ts +49 -0
  16. package/dist/errors/MergeAccountsConfirmationError.d.ts.map +1 -0
  17. package/dist/errors/UnsafeDeeplinkUrlError.d.ts +17 -0
  18. package/dist/errors/UnsafeDeeplinkUrlError.d.ts.map +1 -0
  19. package/dist/errors/UnsafeNavigationUrlError.d.ts +16 -0
  20. package/dist/errors/UnsafeNavigationUrlError.d.ts.map +1 -0
  21. package/dist/errors/WalletScreeningBlockedError.d.ts +27 -0
  22. package/dist/errors/WalletScreeningBlockedError.d.ts.map +1 -0
  23. package/dist/exports/core.d.ts +4 -0
  24. package/dist/exports/core.d.ts.map +1 -1
  25. package/dist/exports/index.d.ts +18 -3
  26. package/dist/exports/index.d.ts.map +1 -1
  27. package/dist/exports/waas.d.ts +2 -0
  28. package/dist/exports/waas.d.ts.map +1 -1
  29. package/dist/{getNetworkProviderFromNetworkId-CS4r9hi7.cjs → getNetworkProviderFromNetworkId-BJX2AMGR.cjs} +190 -19
  30. package/dist/getNetworkProviderFromNetworkId-BJX2AMGR.cjs.map +1 -0
  31. package/dist/{getNetworkProviderFromNetworkId-Bfg-NkNJ.native.esm.js → getNetworkProviderFromNetworkId-Bsv12Q6B.native.esm.js} +165 -10
  32. package/dist/getNetworkProviderFromNetworkId-Bsv12Q6B.native.esm.js.map +1 -0
  33. package/dist/{getNetworkProviderFromNetworkId-pknqqhk1.esm.js → getNetworkProviderFromNetworkId-D3uwhdMN.esm.js} +166 -19
  34. package/dist/getNetworkProviderFromNetworkId-D3uwhdMN.esm.js.map +1 -0
  35. package/dist/{getSignedSessionId-cMGkmojJ.cjs → getSignedSessionId-BIZJGg61.cjs} +3 -3
  36. package/dist/{getSignedSessionId-cMGkmojJ.cjs.map → getSignedSessionId-BIZJGg61.cjs.map} +1 -1
  37. package/dist/{getSignedSessionId-CUw7LJ35.esm.js → getSignedSessionId-CnSAMO3P.esm.js} +3 -3
  38. package/dist/{getSignedSessionId-CUw7LJ35.esm.js.map → getSignedSessionId-CnSAMO3P.esm.js.map} +1 -1
  39. package/dist/{getSignedSessionId-Cl3PEqa8.native.esm.js → getSignedSessionId-DXDi7NkE.native.esm.js} +3 -3
  40. package/dist/{getSignedSessionId-Cl3PEqa8.native.esm.js.map → getSignedSessionId-DXDi7NkE.native.esm.js.map} +1 -1
  41. package/dist/{getWalletProviderByKey-CP9Te5Sz.cjs → getWalletProviderByKey-C6aS7KgD.cjs} +2 -2
  42. package/dist/{getWalletProviderByKey-CP9Te5Sz.cjs.map → getWalletProviderByKey-C6aS7KgD.cjs.map} +1 -1
  43. package/dist/{getWalletProviderByKey-lQVfIGFi.esm.js → getWalletProviderByKey-Cr8m-Nax.esm.js} +2 -2
  44. package/dist/{getWalletProviderByKey-lQVfIGFi.esm.js.map → getWalletProviderByKey-Cr8m-Nax.esm.js.map} +1 -1
  45. package/dist/{getWalletProviderByKey-24co0tBE.native.esm.js → getWalletProviderByKey-DVk2t98D.native.esm.js} +2 -2
  46. package/dist/{getWalletProviderByKey-24co0tBE.native.esm.js.map → getWalletProviderByKey-DVk2t98D.native.esm.js.map} +1 -1
  47. package/dist/index.cjs +950 -111
  48. package/dist/index.cjs.map +1 -1
  49. package/dist/index.esm.js +940 -112
  50. package/dist/index.esm.js.map +1 -1
  51. package/dist/index.native.esm.js +867 -111
  52. package/dist/index.native.esm.js.map +1 -1
  53. package/dist/{isDynamicWaasEnabled-BwP1oowd.cjs → isDynamicWaasEnabled-BawttOeb.cjs} +21 -9
  54. package/dist/isDynamicWaasEnabled-BawttOeb.cjs.map +1 -0
  55. package/dist/{isDynamicWaasEnabled-BYaqAOml.esm.js → isDynamicWaasEnabled-DDrg89y1.esm.js} +20 -8
  56. package/dist/isDynamicWaasEnabled-DDrg89y1.esm.js.map +1 -0
  57. package/dist/{isDynamicWaasEnabled-BXe0VyI4.native.esm.js → isDynamicWaasEnabled-Dj_sLoBO.native.esm.js} +20 -8
  58. package/dist/isDynamicWaasEnabled-Dj_sLoBO.native.esm.js.map +1 -0
  59. package/dist/{isMfaRequiredForAction-Btejc5g3.cjs → isMfaRequiredForAction-BuvyBN_r.cjs} +21 -6
  60. package/dist/isMfaRequiredForAction-BuvyBN_r.cjs.map +1 -0
  61. package/dist/{isMfaRequiredForAction-CqEcCTIe.esm.js → isMfaRequiredForAction-DTp4CZBt.esm.js} +21 -6
  62. package/dist/isMfaRequiredForAction-DTp4CZBt.esm.js.map +1 -0
  63. package/dist/{isMfaRequiredForAction-Demz9zlH.native.esm.js → isMfaRequiredForAction-EY-OQORc.native.esm.js} +3 -5
  64. package/dist/isMfaRequiredForAction-EY-OQORc.native.esm.js.map +1 -0
  65. package/dist/{isUserOnboardingComplete-C86NDY7I.cjs → isUserOnboardingComplete-CkyzRYrg.cjs} +14 -4
  66. package/dist/isUserOnboardingComplete-CkyzRYrg.cjs.map +1 -0
  67. package/dist/{isUserOnboardingComplete-CBrAH0ZF.esm.js → isUserOnboardingComplete-D3HrBYje.native.esm.js} +13 -3
  68. package/dist/isUserOnboardingComplete-D3HrBYje.native.esm.js.map +1 -0
  69. package/dist/{isUserOnboardingComplete-Cr-YTpcU.native.esm.js → isUserOnboardingComplete-Dy2Ygp0u.esm.js} +13 -3
  70. package/dist/isUserOnboardingComplete-Dy2Ygp0u.esm.js.map +1 -0
  71. package/dist/{migrateFromFireblocks-D-J6-gRo.native.esm.js → migrateFromFireblocks-B5qWGLCM.native.esm.js} +3 -3
  72. package/dist/{migrateFromFireblocks-D-J6-gRo.native.esm.js.map → migrateFromFireblocks-B5qWGLCM.native.esm.js.map} +1 -1
  73. package/dist/{migrateFromFireblocks-B_q8Oawb.cjs → migrateFromFireblocks-Dp-QA9hi.cjs} +3 -3
  74. package/dist/{migrateFromFireblocks-B_q8Oawb.cjs.map → migrateFromFireblocks-Dp-QA9hi.cjs.map} +1 -1
  75. package/dist/{migrateFromFireblocks-Bbx2wHZD.esm.js → migrateFromFireblocks-MAatsk_w.esm.js} +3 -3
  76. package/dist/{migrateFromFireblocks-Bbx2wHZD.esm.js.map → migrateFromFireblocks-MAatsk_w.esm.js.map} +1 -1
  77. package/dist/modules/apiClient/constants.d.ts +8 -0
  78. package/dist/modules/apiClient/constants.d.ts.map +1 -1
  79. package/dist/modules/apiClient/createApiClient.d.ts.map +1 -1
  80. package/dist/modules/auth/externalAuth/requestExternalAuthElevatedToken/requestExternalAuthElevatedToken.d.ts +0 -1
  81. package/dist/modules/auth/externalAuth/requestExternalAuthElevatedToken/requestExternalAuthElevatedToken.d.ts.map +1 -1
  82. package/dist/modules/auth/externalAuth/signInWithExternalJwt/signInWithExternalJwt.d.ts +11 -2
  83. package/dist/modules/auth/externalAuth/signInWithExternalJwt/signInWithExternalJwt.d.ts.map +1 -1
  84. package/dist/modules/auth/isSignedIn/isSignedIn.d.ts +9 -0
  85. package/dist/modules/auth/isSignedIn/isSignedIn.d.ts.map +1 -1
  86. package/dist/modules/auth/logout/logout.d.ts +13 -0
  87. package/dist/modules/auth/logout/logout.d.ts.map +1 -1
  88. package/dist/modules/auth/logoutWithReason/logoutWithReason.d.ts.map +1 -1
  89. package/dist/modules/auth/mergeUserAccounts/index.d.ts +3 -0
  90. package/dist/modules/auth/mergeUserAccounts/index.d.ts.map +1 -0
  91. package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.d.ts +62 -0
  92. package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.d.ts.map +1 -0
  93. package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.types.d.ts +78 -0
  94. package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.types.d.ts.map +1 -0
  95. package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts +7 -1
  96. package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts.map +1 -1
  97. package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts +9 -1
  98. package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts.map +1 -1
  99. package/dist/modules/auth/social/oauth/authenticateWithSocial/authenticateWithSocial.d.ts +8 -0
  100. package/dist/modules/auth/social/oauth/authenticateWithSocial/authenticateWithSocial.d.ts.map +1 -1
  101. package/dist/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.d.ts +34 -0
  102. package/dist/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.d.ts.map +1 -0
  103. package/dist/modules/auth/social/oauth/clearSocialRedirectParams/index.d.ts +2 -0
  104. package/dist/modules/auth/social/oauth/clearSocialRedirectParams/index.d.ts.map +1 -0
  105. package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.d.ts +11 -0
  106. package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.d.ts.map +1 -1
  107. package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.d.ts +0 -1
  108. package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.d.ts.map +1 -1
  109. package/dist/modules/auth/social/oauth/signInWithSocialPopUp/signInWithSocialPopUp.d.ts +12 -0
  110. package/dist/modules/auth/social/oauth/signInWithSocialPopUp/signInWithSocialPopUp.d.ts.map +1 -1
  111. package/dist/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/getOAuthBaseUrl/getOAuthBaseUrl.d.ts.map +1 -1
  112. package/dist/modules/auth/social/oauth/signInWithSocialRedirect/signInWithSocialRedirect.d.ts +10 -0
  113. package/dist/modules/auth/social/oauth/signInWithSocialRedirect/signInWithSocialRedirect.d.ts.map +1 -1
  114. package/dist/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.d.ts +0 -1
  115. package/dist/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.d.ts.map +1 -1
  116. package/dist/modules/auth/updateAuthFromVerifyResponse/updateAuthFromVerifyResponse.d.ts.map +1 -1
  117. package/dist/modules/captcha/CaptchaProviderEnum/CaptchaProviderEnum.d.ts +37 -0
  118. package/dist/modules/captcha/CaptchaProviderEnum/CaptchaProviderEnum.d.ts.map +1 -0
  119. package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.d.ts +50 -0
  120. package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.d.ts.map +1 -0
  121. package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.types.d.ts +22 -0
  122. package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.types.d.ts.map +1 -0
  123. package/dist/modules/captcha/getCaptchaSettings/index.d.ts +3 -0
  124. package/dist/modules/captcha/getCaptchaSettings/index.d.ts.map +1 -0
  125. package/dist/modules/captcha/isCaptchaRequired/isCaptchaRequired.d.ts.map +1 -1
  126. package/dist/modules/captcha/setCaptchaToken/setCaptchaToken.d.ts +0 -1
  127. package/dist/modules/captcha/setCaptchaToken/setCaptchaToken.d.ts.map +1 -1
  128. package/dist/modules/clientEvents/clientEvents.d.ts +34 -0
  129. package/dist/modules/clientEvents/clientEvents.d.ts.map +1 -1
  130. package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/clearDeviceRegistrationRedirectParams.d.ts +35 -0
  131. package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/clearDeviceRegistrationRedirectParams.d.ts.map +1 -0
  132. package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/index.d.ts +2 -0
  133. package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/index.d.ts.map +1 -0
  134. package/dist/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.d.ts +8 -1
  135. package/dist/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.d.ts.map +1 -1
  136. package/dist/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.d.ts +1 -0
  137. package/dist/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.d.ts.map +1 -1
  138. package/dist/modules/flow/attachFlowSource/attachFlowSource.instrumentation.d.ts +9 -0
  139. package/dist/modules/flow/attachFlowSource/attachFlowSource.instrumentation.d.ts.map +1 -0
  140. package/dist/modules/flow/broadcastFlow/broadcastFlow.instrumentation.d.ts +9 -0
  141. package/dist/modules/flow/broadcastFlow/broadcastFlow.instrumentation.d.ts.map +1 -0
  142. package/dist/modules/flow/cancelFlow/cancelFlow.d.ts +10 -3
  143. package/dist/modules/flow/cancelFlow/cancelFlow.d.ts.map +1 -1
  144. package/dist/modules/flow/cancelFlow/cancelFlow.instrumentation.d.ts +8 -0
  145. package/dist/modules/flow/cancelFlow/cancelFlow.instrumentation.d.ts.map +1 -0
  146. package/dist/modules/flow/getFlow/getFlow.d.ts +11 -3
  147. package/dist/modules/flow/getFlow/getFlow.d.ts.map +1 -1
  148. package/dist/modules/flow/getFlowQuote/getFlowQuote.d.ts +16 -3
  149. package/dist/modules/flow/getFlowQuote/getFlowQuote.d.ts.map +1 -1
  150. package/dist/modules/flow/prepareFlowSigning/prepareFlowSigning.instrumentation.d.ts +9 -0
  151. package/dist/modules/flow/prepareFlowSigning/prepareFlowSigning.instrumentation.d.ts.map +1 -0
  152. package/dist/modules/flow/submitFlowTransaction/submitFlowTransaction.instrumentation.d.ts +9 -0
  153. package/dist/modules/flow/submitFlowTransaction/submitFlowTransaction.instrumentation.d.ts.map +1 -0
  154. package/dist/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.d.ts +0 -4
  155. package/dist/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.d.ts.map +1 -1
  156. package/dist/modules/initializeClient/initializeClient.d.ts +16 -0
  157. package/dist/modules/initializeClient/initializeClient.d.ts.map +1 -1
  158. package/dist/modules/initializeClient/waitForClientInitialized/waitForClientInitialized.d.ts +12 -2
  159. package/dist/modules/initializeClient/waitForClientInitialized/waitForClientInitialized.d.ts.map +1 -1
  160. package/dist/modules/mfa/consumeMfaToken/consumeMfaToken.d.ts +0 -1
  161. package/dist/modules/mfa/consumeMfaToken/consumeMfaToken.d.ts.map +1 -1
  162. package/dist/modules/mfa/createNewMfaRecoveryCodes/createNewMfaRecoveryCodes.d.ts +0 -1
  163. package/dist/modules/mfa/createNewMfaRecoveryCodes/createNewMfaRecoveryCodes.d.ts.map +1 -1
  164. package/dist/modules/mfa/isPendingRecoveryCodesAcknowledgment/isPendingRecoveryCodesAcknowledgment.d.ts +1 -0
  165. package/dist/modules/mfa/isPendingRecoveryCodesAcknowledgment/isPendingRecoveryCodesAcknowledgment.d.ts.map +1 -1
  166. package/dist/modules/mfa/isUserMissingMfaAuth/isUserMissingMfaAuth.d.ts +1 -0
  167. package/dist/modules/mfa/isUserMissingMfaAuth/isUserMissingMfaAuth.d.ts.map +1 -1
  168. package/dist/modules/mfa/registerTotpMfaDevice/registerTotpMfaDevice.d.ts +0 -3
  169. package/dist/modules/mfa/registerTotpMfaDevice/registerTotpMfaDevice.d.ts.map +1 -1
  170. package/dist/modules/otp/sendEmailOTP/sendEmailOTP.d.ts +14 -1
  171. package/dist/modules/otp/sendEmailOTP/sendEmailOTP.d.ts.map +1 -1
  172. package/dist/modules/otp/sendSmsOTP/sendSmsOTP.d.ts +12 -1
  173. package/dist/modules/otp/sendSmsOTP/sendSmsOTP.d.ts.map +1 -1
  174. package/dist/modules/otp/verifyOTP/verifyOTP.d.ts +33 -2
  175. package/dist/modules/otp/verifyOTP/verifyOTP.d.ts.map +1 -1
  176. package/dist/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.d.ts +1 -1
  177. package/dist/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.d.ts.map +1 -1
  178. package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts +8 -0
  179. package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts.map +1 -1
  180. package/dist/modules/user/checkUserScopes/checkUserScopes.d.ts +28 -0
  181. package/dist/modules/user/checkUserScopes/checkUserScopes.d.ts.map +1 -0
  182. package/dist/modules/user/checkUserScopes/index.d.ts +2 -0
  183. package/dist/modules/user/checkUserScopes/index.d.ts.map +1 -0
  184. package/dist/modules/user/deleteUser/deleteUser.d.ts +8 -0
  185. package/dist/modules/user/deleteUser/deleteUser.d.ts.map +1 -1
  186. package/dist/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.d.ts +9 -1
  187. package/dist/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.d.ts.map +1 -1
  188. package/dist/modules/user/refreshAuth/refreshAuth.d.ts +17 -4
  189. package/dist/modules/user/refreshAuth/refreshAuth.d.ts.map +1 -1
  190. package/dist/modules/user/refreshUser/refreshUser.d.ts +16 -3
  191. package/dist/modules/user/refreshUser/refreshUser.d.ts.map +1 -1
  192. package/dist/modules/user/updateUser/updateUser.d.ts +0 -1
  193. package/dist/modules/user/updateUser/updateUser.d.ts.map +1 -1
  194. package/dist/modules/user/user.types.d.ts +9 -1
  195. package/dist/modules/user/user.types.d.ts.map +1 -1
  196. package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/getEmbeddedWalletsRequiringUpgrade.d.ts +30 -0
  197. package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/getEmbeddedWalletsRequiringUpgrade.d.ts.map +1 -0
  198. package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/index.d.ts +2 -0
  199. package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/index.d.ts.map +1 -0
  200. package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/hasEmbeddedWalletsRequiringUpgrade.d.ts +23 -0
  201. package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/hasEmbeddedWalletsRequiringUpgrade.d.ts.map +1 -0
  202. package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/index.d.ts +2 -0
  203. package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/index.d.ts.map +1 -0
  204. package/dist/modules/wallets/connectAndVerifyWithWalletProvider/connectAndVerifyWithWalletProvider.d.ts +11 -1
  205. package/dist/modules/wallets/connectAndVerifyWithWalletProvider/connectAndVerifyWithWalletProvider.d.ts.map +1 -1
  206. package/dist/modules/wallets/connectWithWalletProvider/connectWithWalletProvider.d.ts +11 -3
  207. package/dist/modules/wallets/connectWithWalletProvider/connectWithWalletProvider.d.ts.map +1 -1
  208. package/dist/modules/wallets/disconnectWalletAccount/disconnectWalletAccount.d.ts +16 -3
  209. package/dist/modules/wallets/disconnectWalletAccount/disconnectWalletAccount.d.ts.map +1 -1
  210. package/dist/modules/wallets/getConnectedAddresses/getConnectedAddresses.d.ts +9 -1
  211. package/dist/modules/wallets/getConnectedAddresses/getConnectedAddresses.d.ts.map +1 -1
  212. package/dist/modules/wallets/getWalletAccounts/getWalletAccounts.d.ts +11 -1
  213. package/dist/modules/wallets/getWalletAccounts/getWalletAccounts.d.ts.map +1 -1
  214. package/dist/modules/wallets/getWalletProviderDataByKey/getWalletProviderDataByKey.d.ts +2 -1
  215. package/dist/modules/wallets/getWalletProviderDataByKey/getWalletProviderDataByKey.d.ts.map +1 -1
  216. package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts +9 -0
  217. package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts.map +1 -1
  218. package/dist/modules/wallets/isWalletAccountVerified/isWalletAccountVerified.d.ts +10 -2
  219. package/dist/modules/wallets/isWalletAccountVerified/isWalletAccountVerified.d.ts.map +1 -1
  220. package/dist/modules/wallets/networks/getBalance/getBalance.d.ts +8 -0
  221. package/dist/modules/wallets/networks/getBalance/getBalance.d.ts.map +1 -1
  222. package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts +8 -0
  223. package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts.map +1 -1
  224. package/dist/modules/wallets/networks/switchActiveNetwork/switchActiveNetwork.d.ts +11 -1
  225. package/dist/modules/wallets/networks/switchActiveNetwork/switchActiveNetwork.d.ts.map +1 -1
  226. package/dist/modules/wallets/proveWalletAccountOwnership/proveWalletAccountOwnership.d.ts +10 -0
  227. package/dist/modules/wallets/proveWalletAccountOwnership/proveWalletAccountOwnership.d.ts.map +1 -1
  228. package/dist/modules/wallets/removeWalletAccount/removeWalletAccount.d.ts +9 -1
  229. package/dist/modules/wallets/removeWalletAccount/removeWalletAccount.d.ts.map +1 -1
  230. package/dist/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts +24 -0
  231. package/dist/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts.map +1 -0
  232. package/dist/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/index.d.ts.map +1 -0
  233. package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/getSelectedWalletAccount.d.ts +30 -0
  234. package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/getSelectedWalletAccount.d.ts.map +1 -0
  235. package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/index.d.ts +2 -0
  236. package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/index.d.ts.map +1 -0
  237. package/dist/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/index.d.ts.map +1 -0
  238. package/dist/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts +28 -0
  239. package/dist/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts.map +1 -0
  240. package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/index.d.ts +2 -0
  241. package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/index.d.ts.map +1 -0
  242. package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/setSelectedWalletAccount.d.ts +34 -0
  243. package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/setSelectedWalletAccount.d.ts.map +1 -0
  244. package/dist/modules/wallets/signMessage/signMessage.d.ts +12 -1
  245. package/dist/modules/wallets/signMessage/signMessage.d.ts.map +1 -1
  246. package/dist/modules/wallets/transferAmount/transferAmount.d.ts +13 -2
  247. package/dist/modules/wallets/transferAmount/transferAmount.d.ts.map +1 -1
  248. package/dist/modules/wallets/transferWalletAccount/transferWalletAccount.d.ts +10 -1
  249. package/dist/modules/wallets/transferWalletAccount/transferWalletAccount.d.ts.map +1 -1
  250. package/dist/modules/wallets/utils/getWalletAccountFromAddress/getWalletAccountFromAddress.d.ts +11 -1
  251. package/dist/modules/wallets/utils/getWalletAccountFromAddress/getWalletAccountFromAddress.d.ts.map +1 -1
  252. package/dist/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.d.ts +3 -0
  253. package/dist/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.d.ts.map +1 -1
  254. package/dist/modules/wallets/verifyWalletAccount/verifyWalletAccount.d.ts +12 -1
  255. package/dist/modules/wallets/verifyWalletAccount/verifyWalletAccount.d.ts.map +1 -1
  256. package/dist/services/instrumentation/createInstrumentation/createInstrumentation.d.ts.map +1 -1
  257. package/dist/services/instrumentation/instrumentFunction/instrumentFunction.d.ts +40 -34
  258. package/dist/services/instrumentation/instrumentFunction/instrumentFunction.d.ts.map +1 -1
  259. package/dist/services/instrumentation/instrumentation.types.d.ts +50 -19
  260. package/dist/services/instrumentation/instrumentation.types.d.ts.map +1 -1
  261. package/dist/services/keychain/createKeychainService/createKeychainService.d.ts.map +1 -1
  262. package/dist/services/navigate/createNavigationHandler/createNavigationHandler.d.ts.map +1 -1
  263. package/dist/services/openDeeplink/createWebDeeplinkOpener/createWebDeeplinkOpener.d.ts.map +1 -1
  264. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  265. package/dist/{updateAuthFromVerifyResponse-D1w-Aw9P.native.esm.js → updateAuthFromVerifyResponse-DFjqCSu2.native.esm.js} +235 -159
  266. package/dist/updateAuthFromVerifyResponse-DFjqCSu2.native.esm.js.map +1 -0
  267. package/dist/{updateAuthFromVerifyResponse-azIi_3FB.esm.js → updateAuthFromVerifyResponse-_oYRLK_w.esm.js} +235 -159
  268. package/dist/updateAuthFromVerifyResponse-_oYRLK_w.esm.js.map +1 -0
  269. package/dist/{updateAuthFromVerifyResponse-CElYpi97.cjs → updateAuthFromVerifyResponse-pgYXvDvj.cjs} +241 -159
  270. package/dist/updateAuthFromVerifyResponse-pgYXvDvj.cjs.map +1 -0
  271. package/dist/utils/assertSafeDeeplinkUrl/assertSafeDeeplinkUrl.d.ts +12 -0
  272. package/dist/utils/assertSafeDeeplinkUrl/assertSafeDeeplinkUrl.d.ts.map +1 -0
  273. package/dist/utils/assertSafeDeeplinkUrl/index.d.ts +2 -0
  274. package/dist/utils/assertSafeDeeplinkUrl/index.d.ts.map +1 -0
  275. package/dist/utils/assertSafeNavigationUrl/assertSafeNavigationUrl.d.ts +12 -0
  276. package/dist/utils/assertSafeNavigationUrl/assertSafeNavigationUrl.d.ts.map +1 -0
  277. package/dist/utils/assertSafeNavigationUrl/index.d.ts +2 -0
  278. package/dist/utils/assertSafeNavigationUrl/index.d.ts.map +1 -0
  279. package/dist/utils/getSecureCookieAttribute/getSecureCookieAttribute.d.ts +18 -0
  280. package/dist/utils/getSecureCookieAttribute/getSecureCookieAttribute.d.ts.map +1 -0
  281. package/dist/utils/getSecureCookieAttribute/index.d.ts +2 -0
  282. package/dist/utils/getSecureCookieAttribute/index.d.ts.map +1 -0
  283. package/dist/waas.cjs +72 -5
  284. package/dist/waas.cjs.map +1 -1
  285. package/dist/waas.esm.js +70 -5
  286. package/dist/waas.esm.js.map +1 -1
  287. package/dist/waas.native.esm.js +70 -5
  288. package/dist/waas.native.esm.js.map +1 -1
  289. package/dist/waasCore.cjs +6 -6
  290. package/dist/waasCore.esm.js +6 -6
  291. package/dist/waasCore.native.esm.js +6 -6
  292. package/package.json +3 -3
  293. package/dist/getNetworkProviderFromNetworkId-Bfg-NkNJ.native.esm.js.map +0 -1
  294. package/dist/getNetworkProviderFromNetworkId-CS4r9hi7.cjs.map +0 -1
  295. package/dist/getNetworkProviderFromNetworkId-pknqqhk1.esm.js.map +0 -1
  296. package/dist/isDynamicWaasEnabled-BXe0VyI4.native.esm.js.map +0 -1
  297. package/dist/isDynamicWaasEnabled-BYaqAOml.esm.js.map +0 -1
  298. package/dist/isDynamicWaasEnabled-BwP1oowd.cjs.map +0 -1
  299. package/dist/isMfaRequiredForAction-Btejc5g3.cjs.map +0 -1
  300. package/dist/isMfaRequiredForAction-CqEcCTIe.esm.js.map +0 -1
  301. package/dist/isMfaRequiredForAction-Demz9zlH.native.esm.js.map +0 -1
  302. package/dist/isUserOnboardingComplete-C86NDY7I.cjs.map +0 -1
  303. package/dist/isUserOnboardingComplete-CBrAH0ZF.esm.js.map +0 -1
  304. package/dist/isUserOnboardingComplete-Cr-YTpcU.native.esm.js.map +0 -1
  305. package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts +0 -10
  306. package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts.map +0 -1
  307. package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/index.d.ts.map +0 -1
  308. package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/index.d.ts.map +0 -1
  309. package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts +0 -12
  310. package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts.map +0 -1
  311. package/dist/services/instrumentation/instrumentFunction/extractParams/extractParams.d.ts +0 -28
  312. package/dist/services/instrumentation/instrumentFunction/extractParams/extractParams.d.ts.map +0 -1
  313. package/dist/services/instrumentation/instrumentFunction/scrubResolvedValue/scrubResolvedValue.d.ts +0 -15
  314. package/dist/services/instrumentation/instrumentFunction/scrubResolvedValue/scrubResolvedValue.d.ts.map +0 -1
  315. package/dist/updateAuthFromVerifyResponse-CElYpi97.cjs.map +0 -1
  316. package/dist/updateAuthFromVerifyResponse-D1w-Aw9P.native.esm.js.map +0 -1
  317. package/dist/updateAuthFromVerifyResponse-azIi_3FB.esm.js.map +0 -1
  318. /package/dist/modules/wallets/{primaryWalletAccount → selectedWalletAccount}/getPrimaryWalletAccount/index.d.ts +0 -0
  319. /package/dist/modules/wallets/{primaryWalletAccount → selectedWalletAccount}/selectPrimaryWalletAccount/index.d.ts +0 -0
@@ -1,9 +1,9 @@
1
- const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-Btejc5g3.cjs');
1
+ const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-BuvyBN_r.cjs');
2
2
  let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
3
3
 
4
4
  //#region package.json
5
5
  var name = "@dynamic-labs-sdk/client";
6
- var version = "1.17.1";
6
+ var version = "1.19.0";
7
7
  var dependencies = {
8
8
  "@dynamic-labs-sdk/assert-package-version": "workspace:*",
9
9
  "@dynamic-labs-wallet/browser-wallet-client": "1.0.46",
@@ -109,6 +109,17 @@ let numOfInitializedClients = 0;
109
109
  *
110
110
  * If more than one instance of DynamicClient was initialized, you should not use this function.
111
111
  * Instead, you should pass the client instance you stored to the function that needs it.
112
+ *
113
+ * @example
114
+ * ```ts
115
+ * const client = getDefaultClient();
116
+ * console.log('User:', client.user);
117
+ * ```
118
+ *
119
+ * @returns The default DynamicClient instance.
120
+ * @throws ClientNotFoundError If no client has been initialized yet.
121
+ * @see createDynamicClient
122
+ * @see initializeClient
112
123
  * @notInstrumented
113
124
  */
114
125
  const getDefaultClient = () => {
@@ -137,8 +148,28 @@ const MFA_TOKEN_HEADER = "x-mfa-auth-token";
137
148
  const SESSION_PUBLIC_KEY_HEADER = "x-dyn-session-public-key";
138
149
  const DYNAMIC_SDK_API_VERSION = dependencies["@dynamic-labs/sdk-api-core"];
139
150
  const DYNAMIC_SDK_SESSION_ID_HEADER = "x-dyn-session-id";
151
+ /**
152
+ * Reports the runtime platform (`web` or `react-native`) to the Dynamic API.
153
+ *
154
+ * Named `x-dynamic-platform` (not `x-dyn-*`) to match the header the legacy
155
+ * webview-controller already sends, so the backend receives a consistent
156
+ * platform signal across SDK generations.
157
+ */
158
+ const DYNAMIC_PLATFORM_HEADER = "x-dynamic-platform";
140
159
  const CLIENT_SDK_NAME = "ClientSDK";
141
160
 
161
+ //#endregion
162
+ //#region src/utils/getPlatform/getPlatform.ts
163
+ /**
164
+ * Returns the platform the SDK is running on.
165
+ *
166
+ * This is the web implementation — the React Native bundler resolves
167
+ * `getPlatform.native.ts` instead when building for React Native, which
168
+ * returns `'react-native'`.
169
+ * @notInstrumented
170
+ */
171
+ const getPlatform = () => "web";
172
+
142
173
  //#endregion
143
174
  //#region src/utils/randomString/randomString.ts
144
175
  const DEFAULT_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
@@ -257,7 +288,17 @@ const getSessionKeys = (client) => {
257
288
  //#region src/errors/APIError/APIError.ts
258
289
  var APIError = class APIError extends BaseError {
259
290
  status;
260
- constructor(message, code, status) {
291
+ /**
292
+ * The `payload` object from the API error response body, when present.
293
+ *
294
+ * Some error responses carry structured context beyond the `error`/`code`
295
+ * pair (e.g. `merge_accounts_confirmation` returns the field-level merge
296
+ * conflicts under `payload.mergeConflicts`). It is preserved here so that
297
+ * downstream error mappers can surface that context as typed errors instead
298
+ * of discarding it.
299
+ */
300
+ payload;
301
+ constructor(message, code, status, payload) {
261
302
  super({
262
303
  cause: null,
263
304
  code,
@@ -266,13 +307,15 @@ var APIError = class APIError extends BaseError {
266
307
  shortMessage: message
267
308
  });
268
309
  this.status = status;
310
+ this.payload = payload;
269
311
  }
270
312
  static async fromResponse(response) {
271
313
  try {
272
314
  const errorBody = await response.clone().json();
273
315
  if (errorBody && "error" in errorBody && typeof errorBody.error === "string") {
274
316
  const errorCode = "code" in errorBody && typeof errorBody.code === "string" ? errorBody.code : "unknown_error";
275
- return new APIError(errorBody.error, errorCode, response.status);
317
+ const payload = "payload" in errorBody && typeof errorBody.payload === "object" && errorBody.payload !== null ? errorBody.payload : void 0;
318
+ return new APIError(errorBody.error, errorCode, response.status, payload);
276
319
  }
277
320
  return null;
278
321
  } catch {
@@ -545,6 +588,7 @@ const createApiClient = (options = {}, client) => {
545
588
  headers: {
546
589
  "Content-Type": "application/json",
547
590
  [DYNAMIC_API_VERSION_HEADER]: `API/${DYNAMIC_SDK_API_VERSION}`,
591
+ [DYNAMIC_PLATFORM_HEADER]: getPlatform(),
548
592
  [DYNAMIC_REQUEST_ID_HEADER]: randomString({ length: 50 }),
549
593
  [DYNAMIC_SDK_SESSION_ID_HEADER]: core.sdkSessionId,
550
594
  [DYNAMIC_SDK_VERSION_HEADER]: `${CLIENT_SDK_NAME}/${version}`,
@@ -617,6 +661,28 @@ const fetchAndStoreNonces = async (client) => {
617
661
  return fetchPromise;
618
662
  };
619
663
 
664
+ //#endregion
665
+ //#region src/utils/getSecureCookieAttribute/getSecureCookieAttribute.ts
666
+ /**
667
+ * Returns the cookie `Secure` attribute suffix (`'; Secure'`) when the current
668
+ * document is running in a secure context, or an empty string otherwise.
669
+ *
670
+ * The `Secure` attribute prevents the browser from ever transmitting the cookie
671
+ * over an unencrypted `http://` connection, which mitigates cleartext token
672
+ * capture (CWE-614). It is intentionally omitted on insecure/localhost dev,
673
+ * because browsers reject `Secure` cookies set over `http://` and that would
674
+ * silently break local testing.
675
+ *
676
+ * Used when building the Dynamic auth JWT cookie string so the attribute is
677
+ * applied consistently on both the write (sign-in/refresh) and clear (logout)
678
+ * paths.
679
+ *
680
+ * @notInstrumented
681
+ */
682
+ const getSecureCookieAttribute = () => {
683
+ return Boolean(globalThis.window?.isSecureContext) || globalThis.location?.protocol === "https:" ? "; Secure" : "";
684
+ };
685
+
620
686
  //#endregion
621
687
  //#region src/utils/setCookie/setCookie.ts
622
688
  /**
@@ -635,10 +701,25 @@ const setCookie = (cookie) => {
635
701
  * This function allows you to listen for various events emitted by the Dynamic client,
636
702
  * such as authentication state changes, wallet connections, and more.
637
703
  *
704
+ * @example
705
+ * ```ts
706
+ * const unsubscribe = onEvent({
707
+ * event: 'walletAdded',
708
+ * listener: ({ walletAccount }) => {
709
+ * console.log('Wallet added:', walletAccount.address);
710
+ * },
711
+ * });
712
+ *
713
+ * // Later: clean up
714
+ * unsubscribe();
715
+ * ```
716
+ *
638
717
  * @param params.event - The event name to listen for.
639
718
  * @param params.listener - The callback function to execute when the event is fired.
640
719
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
641
720
  * @returns A function that can be called to remove the listener.
721
+ * @see offEvent
722
+ * @see onceEvent
642
723
  * @notInstrumented
643
724
  * @hook Event listeners are error-prone to wire up by hand with useEffect.
644
725
  */
@@ -655,9 +736,16 @@ const onEvent = ({ event, listener }, client = getDefaultClient()) => {
655
736
  * This function unsubscribes a previously registered event listener
656
737
  * from the specified Dynamic client event.
657
738
  *
739
+ * @example
740
+ * ```ts
741
+ * offEvent({ event: 'walletAdded', listener: myListener });
742
+ * ```
743
+ *
658
744
  * @param params.event - The event name to remove the listener from.
659
745
  * @param params.listener - The callback function to remove.
660
746
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
747
+ * @see onEvent
748
+ * @see onceEvent
661
749
  * @notInstrumented
662
750
  */
663
751
  const offEvent = ({ event, listener }, client = getDefaultClient()) => {
@@ -670,10 +758,22 @@ const offEvent = ({ event, listener }, client = getDefaultClient()) => {
670
758
  * This function listens for an event that will automatically remove itself
671
759
  * after being triggered once.
672
760
  *
761
+ * @example
762
+ * ```ts
763
+ * onceEvent({
764
+ * event: 'logout',
765
+ * listener: () => {
766
+ * console.log('User logged out');
767
+ * },
768
+ * });
769
+ * ```
770
+ *
673
771
  * @param params.event - The event name to listen for.
674
772
  * @param params.listener - The callback function to execute when the event is fired.
675
773
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
676
774
  * @returns A function that can be called to remove the listener before it fires.
775
+ * @see onEvent
776
+ * @see offEvent
677
777
  * @notInstrumented
678
778
  * @hook Event listeners are error-prone to wire up by hand with useEffect.
679
779
  */
@@ -995,8 +1095,18 @@ const getWalletAccountsFromState = ({ unverifiedWalletAccounts, user }, client)
995
1095
  * You can differentiate between verified and unverified wallet accounts by
996
1096
  * checking the `verifiedCredentialId` property.
997
1097
  *
1098
+ * @example
1099
+ * ```ts
1100
+ * const wallets = getWalletAccounts();
1101
+ * const verified = wallets.filter((walletAccount) =>
1102
+ * isWalletAccountVerified({ walletAccount }),
1103
+ * );
1104
+ * ```
1105
+ *
998
1106
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
999
1107
  * @returns An array of wallet accounts associated with the session.
1108
+ * @see isWalletAccountVerified
1109
+ * @see verifyWalletAccount
1000
1110
  * @notInstrumented
1001
1111
  * @hook Exposed as a hook so consumers get the reactive list of wallet accounts.
1002
1112
  */
@@ -1215,18 +1325,6 @@ const getOperatingSystem = () => {
1215
1325
  }
1216
1326
  };
1217
1327
 
1218
- //#endregion
1219
- //#region src/utils/getPlatform/getPlatform.ts
1220
- /**
1221
- * Returns the platform the SDK is running on.
1222
- *
1223
- * This is the web implementation — the React Native bundler resolves
1224
- * `getPlatform.native.ts` instead when building for React Native, which
1225
- * returns `'react-native'`.
1226
- * @notInstrumented
1227
- */
1228
- const getPlatform = () => "web";
1229
-
1230
1328
  //#endregion
1231
1329
  //#region src/utils/getUserAgent/getUserAgent.ts
1232
1330
  /**
@@ -1417,193 +1515,170 @@ const scrubParameters = ({ piiFields, redactAll, value }) => {
1417
1515
  });
1418
1516
  };
1419
1517
 
1420
- //#endregion
1421
- //#region src/services/instrumentation/instrumentFunction/extractParams/extractParams.ts
1422
- /**
1423
- * Normalises the raw positional arguments of an instrumented function call
1424
- * into a flat `Record<string, unknown>` suitable for structured logging.
1425
- *
1426
- * ## Why this is needed
1427
- *
1428
- * Instrumented functions are wrapped with `(...args: unknown[])`, so their
1429
- * parameters arrive as an array. Logging a raw array loses the semantic names
1430
- * of each argument. This function recovers a named representation:
1431
- *
1432
- * - **No arguments** → `{}`
1433
- * - **Single plain-object argument** → that object is returned as-is, because
1434
- * SDK functions follow the single-object-parameter convention, so the object
1435
- * already carries named keys (`{ amount, to }`, etc.).
1436
- * - **Everything else** (multiple args, a single primitive, a single array) →
1437
- * each value is indexed as `arg0`, `arg1`, …
1438
- *
1439
- * ## Why arrays are NOT treated as plain objects
1440
- *
1441
- * `typeof [] === 'object'` and `[] !== null`, so without the `Array.isArray`
1442
- * guard a single-array argument would be returned as-is. That would produce
1443
- * an object with numeric string keys (`{ '0': ..., '1': ... }`), which is
1444
- * misleading and inconsistent with how multi-arg calls are handled. Instead,
1445
- * arrays fall through to the indexed `arg0` path.
1446
- * @notInstrumented
1447
- */
1448
- const extractParams = (args) => {
1449
- if (args.length === 0) return {};
1450
- if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && !Array.isArray(args[0])) return args[0];
1451
- const result = {};
1452
- for (let i = 0; i < args.length; i++) result[`arg${i}`] = args[i];
1453
- return result;
1454
- };
1455
-
1456
- //#endregion
1457
- //#region src/services/instrumentation/instrumentFunction/scrubResolvedValue/scrubResolvedValue.ts
1458
- /**
1459
- * Scrubs a resolved return value of any type before logging it.
1460
- * Routes through `scrubParameters` by wrapping the value so that strings,
1461
- * arrays, Dates, Errors, and all other types are handled identically to
1462
- * nested object fields.
1463
- * @notInstrumented
1464
- */
1465
- const scrubResolvedValue = ({ piiFields, redactAll, value }) => scrubParameters({
1466
- piiFields,
1467
- redactAll,
1468
- value: { result: value }
1469
- }).result;
1470
-
1471
1518
  //#endregion
1472
1519
  //#region src/services/instrumentation/instrumentFunction/instrumentFunction.ts
1473
- const serializeError = (error) => {
1474
- if (error instanceof Error) return {
1475
- message: error.message,
1476
- name: error.name,
1477
- stack: error.stack
1520
+ const toErrorFields = (error) => {
1521
+ if (error instanceof BaseError) return {
1522
+ errorCode: error.code,
1523
+ errorName: error.name
1478
1524
  };
1525
+ if (error instanceof Error) return { errorName: error.name };
1526
+ return { errorName: "UnknownError" };
1527
+ };
1528
+ const buildContext = (core) => {
1529
+ const state = core.state.get();
1479
1530
  return {
1480
- message: String(error),
1481
- name: "UnknownError"
1531
+ environmentId: core.environmentId,
1532
+ operatingSystem: getOperatingSystem(),
1533
+ platform: getPlatform(),
1534
+ registeredExtensionKeys: Array.from(core.extensions),
1535
+ sdkSessionId: core.sdkSessionId,
1536
+ sdkVersion: core.version,
1537
+ tokenSessionId: state.token ? extractSessionId(state.token) : null,
1538
+ userAgent: getUserAgent(),
1539
+ userId: state.user?.id ?? null
1482
1540
  };
1483
1541
  };
1484
1542
  /**
1543
+ * Runs an explicit payload selector and scrubs its output. Returns `undefined`
1544
+ * when there is no selector. Selector (and scrub) errors are swallowed so a
1545
+ * faulty selector can never break the wrapped function or fabricate a
1546
+ * 'rejected' event — instrumentation stays purely observational. The swallowed
1547
+ * error is surfaced on the `debug` logger so internal devs can still spot a
1548
+ * broken selector without it ever reaching a transport.
1549
+ */
1550
+ const safeSelect = ({ functionName, logger, piiFields, selector, value }) => {
1551
+ if (!selector) return;
1552
+ try {
1553
+ return scrubParameters({
1554
+ piiFields,
1555
+ value: selector(value)
1556
+ });
1557
+ } catch (error) {
1558
+ logger.debug(`[instrumentFunction] payload selector for "${functionName}" threw; emitting event without payload`, error);
1559
+ return;
1560
+ }
1561
+ };
1562
+ /**
1485
1563
  * Wraps a function so that each invocation emits a structured
1486
1564
  * `FunctionInstrumentationEvent` at three lifecycle points:
1487
1565
  *
1488
- * - **started** — immediately before the function body executes, with the
1489
- * PII-scrubbed call parameters.
1566
+ * - **started** — immediately before the function body executes.
1490
1567
  * - **resolved** — after the function (or its returned Promise) settles
1491
- * successfully, with the PII-scrubbed return value.
1568
+ * successfully, with the call duration.
1492
1569
  * - **rejected** — if the function throws synchronously or its returned
1493
- * Promise rejects.
1570
+ * Promise rejects, with the duration and the error's class name/code.
1571
+ *
1572
+ * Events carry only the safe envelope (function name, phase, timing, error
1573
+ * class, SDK/runtime metadata, identifiers). **Raw arguments and return values
1574
+ * are never captured.** A function that needs additional fields supplies
1575
+ * `selectors` that build an explicit, primitive-only {@link SafePayload} — the
1576
+ * only path from arguments/return value into a log.
1494
1577
  *
1495
1578
  * The original return value (or thrown error) is always forwarded to the
1496
- * caller unchanged — instrumentation is purely observational.
1579
+ * caller unchanged — instrumentation is purely observational, and a throwing
1580
+ * selector cannot change that.
1581
+ *
1582
+ * ## Providing selectors
1497
1583
  *
1498
- * ## Usage
1584
+ * A function opts into a payload by supplying selectors that map its arguments
1585
+ * (`started`) and/or its awaited return value (`resolved`) to a primitive-only
1586
+ * {@link SafePayload}. Pick individual known-safe fields — never spread a whole
1587
+ * object, which is exactly what the model prevents.
1499
1588
  *
1500
1589
  * ```ts
1501
1590
  * const transfer = instrumentFunction({
1502
1591
  * fn: rawTransfer,
1503
1592
  * functionName: 'transfer',
1504
1593
  * getCore: () => core,
1594
+ * selectors: {
1595
+ * // `args` is the argument tuple the wrapped function was called with.
1596
+ * started: ([{ chainId, amount }]) => ({ amount, chainId }),
1597
+ * // `result` is the awaited return value (never the Promise).
1598
+ * resolved: ({ txHash }) => ({ txHash }),
1599
+ * },
1505
1600
  * });
1506
- *
1507
- * // When called, three events are emitted automatically:
1508
- * await transfer({ amount: 1, to: '0xabc' });
1509
1601
  * ```
1510
1602
  *
1603
+ * A selector that throws (or whose output fails scrubbing) is swallowed: the
1604
+ * event is still emitted without a payload, and the error is logged at `debug`.
1605
+ *
1511
1606
  * ## How functions are wrapped
1512
1607
  *
1513
- * `instrumentFunction` is not called manually in application code. Instead,
1514
- * the esbuild instrumentation plugin (`tools/instrumentation-plugin`) injects
1515
- * it at build time: any exported function annotated with `@instrumented` in its
1516
- * JSDoc is automatically wrapped by the plugin during the build step.
1517
- * The plugin strips the original `export`, renames the function, and re-exports
1518
- * it under the original name via `instrumentFunction(...)` — so the public API
1519
- * is unchanged and no call sites need to be updated.
1608
+ * `instrumentFunction` is not called manually in application code. The esbuild
1609
+ * instrumentation plugin (`tools/instrumentation-plugin`) injects it at build
1610
+ * time for any exported function annotated with `@instrumented` in its JSDoc.
1520
1611
  *
1521
1612
  * ## Opting out
1522
1613
  *
1523
- * Instrumentation is skipped entirely when:
1524
- * - `getCore()` returns `undefined` (SDK not initialised), or
1525
- * - `core.instrumentation.config.enabled` is `false`.
1526
- *
1527
- * In both cases the original function is called directly with no overhead.
1528
- *
1529
- * ## PII scrubbing
1530
- *
1531
- * All string values whose key appears in `piiFields` are replaced with
1532
- * `"[redacted]"` before events are emitted. Pass `redactAll: true` to redact
1533
- * every field, regardless of key name.
1614
+ * Instrumentation is skipped entirely when `getCore()` returns `undefined`
1615
+ * (SDK not initialised) or when `core.instrumentation.config.enabled` is
1616
+ * `false`; in both cases the original function is called directly.
1534
1617
  * @notInstrumented
1535
1618
  */
1536
- const instrumentFunction = ({ fn, functionName, getCore: getCore$1, redactAll }) => {
1619
+ const instrumentFunction = ({ fn, functionName, getCore: getCore$1, selectors }) => {
1537
1620
  const wrapped = (...args) => {
1538
1621
  const core = getCore$1();
1539
- if (!core) return fn(...args);
1540
- if (!core.instrumentation.config.enabled) return fn(...args);
1541
- const instrumentation = core.instrumentation;
1542
- const state = core.state.get();
1543
- const baseEvent = {
1544
- environmentId: core.environmentId,
1545
- functionName,
1546
- operatingSystem: getOperatingSystem(),
1547
- parameters: scrubParameters({
1548
- piiFields: instrumentation.config.piiFields,
1549
- redactAll,
1550
- value: extractParams(args)
1551
- }),
1552
- platform: getPlatform(),
1553
- registeredExtensionKeys: Array.from(core.extensions),
1554
- sdkSessionId: core.sdkSessionId,
1555
- sdkVersion: core.version,
1556
- status: "info",
1557
- tokenSessionId: state.token ? extractSessionId(state.token) : null,
1558
- userAgent: getUserAgent(),
1559
- userId: state.user?.id ?? null
1622
+ if (!core?.instrumentation.config.enabled) return fn(...args);
1623
+ const { instrumentation, logger } = core;
1624
+ const { piiFields } = instrumentation.config;
1625
+ const base = {
1626
+ ...buildContext(core),
1627
+ functionName
1560
1628
  };
1629
+ const startedAt = Date.now();
1561
1630
  instrumentation.logFunction({
1562
- ...baseEvent,
1631
+ ...base,
1632
+ payload: safeSelect({
1633
+ functionName,
1634
+ logger,
1635
+ piiFields,
1636
+ selector: selectors?.started,
1637
+ value: args
1638
+ }),
1563
1639
  phase: "started",
1640
+ status: "info",
1564
1641
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
1565
1642
  });
1566
- try {
1567
- const result = fn(...args);
1568
- if (result instanceof Promise) return result.then((value) => {
1569
- instrumentation.logFunction({
1570
- ...baseEvent,
1571
- phase: "resolved",
1572
- resolvedValue: scrubResolvedValue({
1573
- piiFields: instrumentation.config.piiFields,
1574
- redactAll,
1575
- value
1576
- }),
1577
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
1578
- });
1579
- return value;
1580
- }).catch((error) => {
1581
- instrumentation.logFunction({
1582
- ...baseEvent,
1583
- phase: "rejected",
1584
- rejectedError: serializeError(error),
1585
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
1586
- });
1587
- throw error;
1588
- });
1643
+ const emitResolved = (value) => {
1589
1644
  instrumentation.logFunction({
1590
- ...baseEvent,
1591
- phase: "resolved",
1592
- resolvedValue: scrubResolvedValue({
1593
- piiFields: instrumentation.config.piiFields,
1594
- redactAll,
1595
- value: result
1645
+ ...base,
1646
+ durationMs: Date.now() - startedAt,
1647
+ payload: safeSelect({
1648
+ functionName,
1649
+ logger,
1650
+ piiFields,
1651
+ selector: selectors?.resolved,
1652
+ value
1596
1653
  }),
1654
+ phase: "resolved",
1655
+ status: "info",
1597
1656
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
1598
1657
  });
1599
- return result;
1600
- } catch (error) {
1658
+ };
1659
+ const emitRejected = (error) => {
1601
1660
  instrumentation.logFunction({
1602
- ...baseEvent,
1661
+ ...base,
1662
+ ...toErrorFields(error),
1663
+ durationMs: Date.now() - startedAt,
1603
1664
  phase: "rejected",
1604
- rejectedError: serializeError(error),
1665
+ status: "error",
1605
1666
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
1606
1667
  });
1668
+ };
1669
+ try {
1670
+ const result = fn(...args);
1671
+ if (result instanceof Promise) return result.then((value) => {
1672
+ emitResolved(value);
1673
+ return value;
1674
+ }, (error) => {
1675
+ emitRejected(error);
1676
+ throw error;
1677
+ });
1678
+ emitResolved(result);
1679
+ return result;
1680
+ } catch (error) {
1681
+ emitRejected(error);
1607
1682
  throw error;
1608
1683
  }
1609
1684
  };
@@ -1648,6 +1723,7 @@ const getWalletAccountsHash = (state, client) => getWalletAccountsFromState(stat
1648
1723
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1649
1724
  * @returns True if the user needs additional MFA authentication, false otherwise.
1650
1725
  * @notInstrumented
1726
+ * @hook Exposed as a hook so consumers reactively know when MFA is still required, updated when the user changes.
1651
1727
  */
1652
1728
  const isUserMissingMfaAuth = (client = getDefaultClient()) => {
1653
1729
  const user = client.user;
@@ -1893,7 +1969,7 @@ const updateAuthFromVerifyResponse = ({ response }, client) => {
1893
1969
  * programmatically because Redcoast won't set the cookie via headers. We set the cookie programmatically
1894
1970
  * so customers can access the cookie from document.cookie consistently between sandbox and live environments.
1895
1971
  */
1896
- if (minifiedJwt && isCookieEnabled(client)) setCookie(`${DYNAMIC_AUTH_COOKIE_NAME}=${minifiedJwt}; expires=${sessionExpiresAt.toUTCString()}; path=/; SameSite=Lax`);
1972
+ if (minifiedJwt && isCookieEnabled(client)) setCookie(`${DYNAMIC_AUTH_COOKIE_NAME}=${minifiedJwt}; expires=${sessionExpiresAt.toUTCString()}; path=/; SameSite=Lax${getSecureCookieAttribute()}`);
1897
1973
  checkAndRaiseWalletAccountsChangedEvent({ previousState }, client);
1898
1974
  if (!previousState.user && Boolean(newState.user)) initializeWaasClientsForEagerRecovery(client);
1899
1975
  };
@@ -2175,6 +2251,12 @@ Object.defineProperty(exports, 'getPlatform', {
2175
2251
  return getPlatform;
2176
2252
  }
2177
2253
  });
2254
+ Object.defineProperty(exports, 'getSecureCookieAttribute', {
2255
+ enumerable: true,
2256
+ get: function () {
2257
+ return getSecureCookieAttribute;
2258
+ }
2259
+ });
2178
2260
  Object.defineProperty(exports, 'getSessionKeys', {
2179
2261
  enumerable: true,
2180
2262
  get: function () {
@@ -2337,4 +2419,4 @@ Object.defineProperty(exports, 'version', {
2337
2419
  return version;
2338
2420
  }
2339
2421
  });
2340
- //# sourceMappingURL=updateAuthFromVerifyResponse-CElYpi97.cjs.map
2422
+ //# sourceMappingURL=updateAuthFromVerifyResponse-pgYXvDvj.cjs.map