@dynamic-labs-sdk/client 1.12.2 → 1.14.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 (538) hide show
  1. package/dist/{InvalidParamError-DbUJgYDE.native.esm.js → InvalidParamError-BKr8fFc1.native.esm.js} +1081 -1091
  2. package/dist/InvalidParamError-BKr8fFc1.native.esm.js.map +1 -0
  3. package/dist/{InvalidParamError-DDdAeFXE.cjs → InvalidParamError-Cs4ZMEj4.cjs} +823 -833
  4. package/dist/InvalidParamError-Cs4ZMEj4.cjs.map +1 -0
  5. package/dist/{InvalidParamError-B0nAZ6Ei.esm.js → InvalidParamError-DZjc7Tjc.esm.js} +912 -922
  6. package/dist/InvalidParamError-DZjc7Tjc.esm.js.map +1 -0
  7. package/dist/client/core/createCore/createCore.d.ts +1 -1
  8. package/dist/client/core/createCore/getInitialState.d.ts +1 -1
  9. package/dist/client/core/getCore/getCore.d.ts +1 -1
  10. package/dist/client/core/getCore/getCore.d.ts.map +1 -1
  11. package/dist/client/defaultClient/defaultClient.d.ts +2 -2
  12. package/dist/client/defaultClient/defaultClient.d.ts.map +1 -1
  13. package/dist/core.cjs +24 -24
  14. package/dist/core.cjs.map +1 -1
  15. package/dist/core.esm.js +26 -26
  16. package/dist/core.esm.js.map +1 -1
  17. package/dist/core.native.esm.js +25 -25
  18. package/dist/core.native.esm.js.map +1 -1
  19. package/dist/{getNetworkProviderFromNetworkId-1j3BPA22.cjs → getNetworkProviderFromNetworkId-CdCEFEgT.cjs} +45 -45
  20. package/dist/getNetworkProviderFromNetworkId-CdCEFEgT.cjs.map +1 -0
  21. package/dist/{getNetworkProviderFromNetworkId-DaMxnWPo.esm.js → getNetworkProviderFromNetworkId-ChFA088e.esm.js} +48 -48
  22. package/dist/getNetworkProviderFromNetworkId-ChFA088e.esm.js.map +1 -0
  23. package/dist/{getNetworkProviderFromNetworkId-CMBk4NzR.native.esm.js → getNetworkProviderFromNetworkId-DZkq74O7.native.esm.js} +51 -51
  24. package/dist/getNetworkProviderFromNetworkId-DZkq74O7.native.esm.js.map +1 -0
  25. package/dist/{getSignedSessionId-BU81jCyQ.cjs → getSignedSessionId-DceZVits.cjs} +7 -7
  26. package/dist/getSignedSessionId-DceZVits.cjs.map +1 -0
  27. package/dist/{getSignedSessionId-DPj38qtY.native.esm.js → getSignedSessionId-DmDcWkqB.native.esm.js} +7 -7
  28. package/dist/getSignedSessionId-DmDcWkqB.native.esm.js.map +1 -0
  29. package/dist/{getSignedSessionId-BRklPjP0.esm.js → getSignedSessionId-DrrvGNcG.esm.js} +7 -7
  30. package/dist/getSignedSessionId-DrrvGNcG.esm.js.map +1 -0
  31. package/dist/{getWaasWalletProviderFromWalletAccount-JN5ZC71J.esm.js → getWaasWalletProviderFromWalletAccount-B_8slAdm.esm.js} +4 -4
  32. package/dist/getWaasWalletProviderFromWalletAccount-B_8slAdm.esm.js.map +1 -0
  33. package/dist/{getWaasWalletProviderFromWalletAccount-BhgXIVZM.native.esm.js → getWaasWalletProviderFromWalletAccount-C2GdfqUr.native.esm.js} +4 -4
  34. package/dist/getWaasWalletProviderFromWalletAccount-C2GdfqUr.native.esm.js.map +1 -0
  35. package/dist/{getWaasWalletProviderFromWalletAccount-aRoo7mw8.cjs → getWaasWalletProviderFromWalletAccount-CKZIsFWL.cjs} +4 -4
  36. package/dist/getWaasWalletProviderFromWalletAccount-CKZIsFWL.cjs.map +1 -0
  37. package/dist/{getWalletProviderByKey-BKRul8sp.native.esm.js → getWalletProviderByKey-BhisAyZg.native.esm.js} +26 -26
  38. package/dist/getWalletProviderByKey-BhisAyZg.native.esm.js.map +1 -0
  39. package/dist/{getWalletProviderByKey-C-HHI7L8.esm.js → getWalletProviderByKey-DWYF9IxH.esm.js} +15 -15
  40. package/dist/getWalletProviderByKey-DWYF9IxH.esm.js.map +1 -0
  41. package/dist/{getWalletProviderByKey-z1nf15R8.cjs → getWalletProviderByKey-OD65GUWG.cjs} +16 -16
  42. package/dist/getWalletProviderByKey-OD65GUWG.cjs.map +1 -0
  43. package/dist/index.cjs +205 -192
  44. package/dist/index.cjs.map +1 -1
  45. package/dist/index.esm.js +208 -195
  46. package/dist/index.esm.js.map +1 -1
  47. package/dist/index.native.esm.js +203 -190
  48. package/dist/index.native.esm.js.map +1 -1
  49. package/dist/{isDynamicWaasEnabled-DDbRfcN3.cjs → isDynamicWaasEnabled-C90E53x1.cjs} +4 -4
  50. package/dist/{isDynamicWaasEnabled-DDbRfcN3.cjs.map → isDynamicWaasEnabled-C90E53x1.cjs.map} +1 -1
  51. package/dist/{isDynamicWaasEnabled-DvC45F05.esm.js → isDynamicWaasEnabled-C9gQ9M80.esm.js} +3 -3
  52. package/dist/{isDynamicWaasEnabled-DvC45F05.esm.js.map → isDynamicWaasEnabled-C9gQ9M80.esm.js.map} +1 -1
  53. package/dist/{isDynamicWaasEnabled-9I4iE0Ko.native.esm.js → isDynamicWaasEnabled-rRFvljev.native.esm.js} +3 -3
  54. package/dist/{isDynamicWaasEnabled-9I4iE0Ko.native.esm.js.map → isDynamicWaasEnabled-rRFvljev.native.esm.js.map} +1 -1
  55. package/dist/{isMfaRequiredForAction-B8d2MBRx.native.esm.js → isMfaRequiredForAction-C1KaU-XS.native.esm.js} +4 -4
  56. package/dist/{isMfaRequiredForAction-B8d2MBRx.native.esm.js.map → isMfaRequiredForAction-C1KaU-XS.native.esm.js.map} +1 -1
  57. package/dist/{isMfaRequiredForAction-BAqo9eBq.esm.js → isMfaRequiredForAction-CTQzzCMt.esm.js} +11 -11
  58. package/dist/isMfaRequiredForAction-CTQzzCMt.esm.js.map +1 -0
  59. package/dist/{isMfaRequiredForAction-YGaK8XRO.cjs → isMfaRequiredForAction-DFowphoV.cjs} +11 -11
  60. package/dist/isMfaRequiredForAction-DFowphoV.cjs.map +1 -0
  61. package/dist/{isUserOnboardingComplete-Bo9grSze.cjs → isUserOnboardingComplete-77jTT2BB.cjs} +8 -8
  62. package/dist/isUserOnboardingComplete-77jTT2BB.cjs.map +1 -0
  63. package/dist/{isUserOnboardingComplete-BT_SR4m_.esm.js → isUserOnboardingComplete-D1gGc77y.esm.js} +7 -7
  64. package/dist/isUserOnboardingComplete-D1gGc77y.esm.js.map +1 -0
  65. package/dist/{isUserOnboardingComplete-CVHzzTtG.native.esm.js → isUserOnboardingComplete-DfDNapVu.native.esm.js} +7 -7
  66. package/dist/isUserOnboardingComplete-DfDNapVu.native.esm.js.map +1 -0
  67. package/dist/modules/apiClient/createApiClient.d.ts +1 -1
  68. package/dist/modules/apiClient/utils/clientErrorMapper/clientErrorMapper.d.ts +1 -1
  69. package/dist/modules/apiClient/utils/convertToApiErrorMiddleware/convertToApiErrorMiddleware.d.ts +1 -1
  70. package/dist/modules/apiClient/utils/deviceSignatureHeadersMiddleware/createDeviceSignatureHeadersMiddleware.d.ts +1 -1
  71. package/dist/modules/apiClient/utils/deviceSignatureHeadersMiddleware/createDeviceSignatureHeadersMiddleware.d.ts.map +1 -1
  72. package/dist/modules/apiClient/utils/unauthorizedMiddleware/createUnauthorizedMiddleware.d.ts +1 -1
  73. package/dist/modules/apiClient/utils/unauthorizedMiddleware/createUnauthorizedMiddleware.d.ts.map +1 -1
  74. package/dist/modules/auth/createVisit/createVisit.d.ts +1 -1
  75. package/dist/modules/auth/createVisit/createVisit.d.ts.map +1 -1
  76. package/dist/modules/auth/decodeJwt/decodeJwt.d.ts +1 -1
  77. package/dist/modules/auth/extractSessionId/extractSessionId.d.ts +1 -1
  78. package/dist/modules/auth/getElevatedAccessToken/getElevatedAccessToken.d.ts +2 -3
  79. package/dist/modules/auth/getElevatedAccessToken/getElevatedAccessToken.d.ts.map +1 -1
  80. package/dist/modules/auth/initializeAuth/initializeAuth.d.ts +1 -1
  81. package/dist/modules/auth/initializeAuth/setLongTimeout/setLongTimeout.d.ts +1 -1
  82. package/dist/modules/auth/isSignedIn/isSignedIn.d.ts +1 -1
  83. package/dist/modules/auth/logout/logout.d.ts +1 -1
  84. package/dist/modules/auth/passkeys/getPasskeyAuthenticationOptions/getPasskeyAuthenticationOptions.d.ts +1 -1
  85. package/dist/modules/auth/passkeys/getPasskeyAuthenticationOptions/getPasskeyAuthenticationOptions.d.ts.map +1 -1
  86. package/dist/modules/auth/passkeys/getPasskeyAuthenticationSignInOptions/getPasskeyAuthenticationSignInOptions.d.ts +1 -1
  87. package/dist/modules/auth/passkeys/getPasskeyAuthenticationSignInOptions/getPasskeyAuthenticationSignInOptions.d.ts.map +1 -1
  88. package/dist/modules/auth/passkeys/getPasskeyRegistrationOptions/getPasskeyRegistrationOptions.d.ts +1 -1
  89. package/dist/modules/auth/passkeys/getPasskeyRegistrationOptions/getPasskeyRegistrationOptions.d.ts.map +1 -1
  90. package/dist/modules/auth/passkeys/getPasskeys/getPasskeys.d.ts +1 -1
  91. package/dist/modules/auth/passkeys/serverAuthenticatePasskey/serverAuthenticatePasskey.d.ts +1 -1
  92. package/dist/modules/auth/passkeys/serverAuthenticatePasskey/serverAuthenticatePasskey.d.ts.map +1 -1
  93. package/dist/modules/auth/passkeys/serverRegisterPasskey/serverRegisterPasskey.d.ts +1 -1
  94. package/dist/modules/auth/passkeys/serverRegisterPasskey/serverRegisterPasskey.d.ts.map +1 -1
  95. package/dist/modules/auth/passkeys/serverSigninPasskey/serverSigninPasskey.d.ts +1 -1
  96. package/dist/modules/auth/passkeys/serverSigninPasskey/serverSigninPasskey.d.ts.map +1 -1
  97. package/dist/modules/auth/social/getUserSocialAccounts/getUserSocialAccounts.d.ts +1 -1
  98. package/dist/modules/auth/social/oauth/detectOAuthRedirect/detectOAuthRedirect.d.ts +1 -1
  99. package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.d.ts +1 -1
  100. package/dist/modules/auth/social/oauth/processSocialCallback/processSocialCallback.d.ts +1 -1
  101. package/dist/modules/auth/social/oauth/processSocialCallback/processSocialCallback.d.ts.map +1 -1
  102. package/dist/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/addOAuthUrlParams/addOAuthUrlParams.d.ts +2 -2
  103. package/dist/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/buildOAuthUrl.d.ts +2 -2
  104. package/dist/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/getOAuthBaseUrl/getOAuthBaseUrl.d.ts +1 -1
  105. package/dist/modules/auth/social/removeDynamicOauthParamsFromUrl/removeDynamicOauthParamsFromUrl.d.ts +1 -1
  106. package/dist/modules/auth/social/removeDynamicOauthParamsFromUrl/removeDynamicOauthParamsFromUrl.d.ts.map +1 -1
  107. package/dist/modules/auth/updateAuthFromVerifyResponse/checkAndRaiseWalletAccountsChangedEvent/checkAndRaiseWalletAccountsChangedEvent.d.ts +1 -1
  108. package/dist/modules/auth/updateAuthFromVerifyResponse/checkAndRaiseWalletAccountsChangedEvent/checkAndRaiseWalletAccountsChangedEvent.d.ts.map +1 -1
  109. package/dist/modules/auth/updateAuthFromVerifyResponse/elevatedAccessTokens/normalizeScopes/normalizeScopes.d.ts +1 -1
  110. package/dist/modules/auth/updateAuthFromVerifyResponse/elevatedAccessTokens/parseElevatedAccessToken/parseElevatedAccessToken.d.ts +1 -1
  111. package/dist/modules/auth/updateAuthFromVerifyResponse/elevatedAccessTokens/upsertElevatedAccessToken/upsertElevatedAccessToken.d.ts +1 -1
  112. package/dist/modules/auth/updateAuthFromVerifyResponse/updateAuthFromVerifyResponse.d.ts +1 -1
  113. package/dist/modules/auth/updateAuthFromVerifyResponse/updateAuthFromVerifyResponse.d.ts.map +1 -1
  114. package/dist/modules/balances/getBalances/getBalances.d.ts +1 -1
  115. package/dist/modules/balances/getMultichainBalances/getMultichainBalances.d.ts +1 -1
  116. package/dist/modules/balances/getMultichainTokenBalances/getMultichainTokenBalances.d.ts +1 -1
  117. package/dist/modules/balances/getTokenBalances/getTokenBalances.d.ts +2 -2
  118. package/dist/modules/captcha/consumeCaptchaToken/consumeCaptchaToken.d.ts +1 -1
  119. package/dist/modules/captcha/isCaptchaRequired/isCaptchaRequired.d.ts +1 -1
  120. package/dist/modules/captcha/isCaptchaRequired/isCaptchaRequired.d.ts.map +1 -1
  121. package/dist/modules/checkout/getCheckoutTransaction/getCheckoutTransaction.d.ts +1 -1
  122. package/dist/modules/checkout/getCheckoutTransactionQuote/getCheckoutTransactionQuote.d.ts +1 -1
  123. package/dist/modules/checkout/getCheckouts/getCheckouts.d.ts +1 -1
  124. package/dist/modules/checkout/getCheckouts/getCheckouts.d.ts.map +1 -1
  125. package/dist/modules/checkout/trackCheckoutTransaction/trackCheckoutTransaction.d.ts +1 -1
  126. package/dist/modules/checkout/utils/clearCheckoutSessionToken/clearCheckoutSessionToken.d.ts +1 -1
  127. package/dist/modules/checkout/utils/createCheckoutApiClient/createCheckoutApiClient.d.ts +1 -1
  128. package/dist/modules/checkout/utils/createCheckoutApiClient/createCheckoutApiClient.d.ts.map +1 -1
  129. package/dist/modules/checkout/utils/createCheckoutSessionTokenStorageKey/createCheckoutSessionTokenStorageKey.d.ts +1 -1
  130. package/dist/modules/checkout/utils/createCheckoutSessionTokenStorageKey/createCheckoutSessionTokenStorageKey.d.ts.map +1 -1
  131. package/dist/modules/checkout/utils/createCheckoutTransactionChannelSchema/createCheckoutTransactionChannelSchema.d.ts +1 -1
  132. package/dist/modules/checkout/utils/requiresConversion/requiresConversion.d.ts +1 -1
  133. package/dist/modules/checkout/utils/subscribeToCheckoutTransaction/subscribeToCheckoutTransaction.d.ts +1 -1
  134. package/dist/modules/checkout/utils/withCheckoutSessionTokenCleanupOn401/withCheckoutSessionTokenCleanupOn401.d.ts +1 -1
  135. package/dist/modules/clientEvents/clientEvents.d.ts +4 -4
  136. package/dist/modules/crossTabEventSync/setupCrossTabEventSync/setupCrossTabEventSync.d.ts +1 -1
  137. package/dist/modules/deviceRegistration/detectDeviceRegistrationRedirect/detectDeviceRegistrationRedirect.d.ts +1 -1
  138. package/dist/modules/deviceRegistration/getDeviceRegistrationTokenFromUrl/getDeviceRegistrationTokenFromUrl.d.ts +1 -1
  139. package/dist/modules/deviceRegistration/getDeviceSigner/getDeviceSigner.d.ts +1 -1
  140. package/dist/modules/deviceRegistration/getDeviceSigner/getDeviceSigner.d.ts.map +1 -1
  141. package/dist/modules/deviceRegistration/getDeviceSigner/getOrCreateEnvironmentDeviceSigningKeys/getOrCreateEnvironmentDeviceSigningKeys.d.ts +1 -1
  142. package/dist/modules/deviceRegistration/getHeadersForNonceSignedByDeviceSigners/getHeadersForNonceSignedByDeviceSigners.d.ts +1 -1
  143. package/dist/modules/deviceRegistration/getHeadersForNonceSignedByDeviceSigners/getHeadersForNonceSignedByDeviceSigners.d.ts.map +1 -1
  144. package/dist/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.d.ts +1 -1
  145. package/dist/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.d.ts.map +1 -1
  146. package/dist/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.d.ts +1 -1
  147. package/dist/modules/extension/hasExtension/hasExtension.d.ts +1 -1
  148. package/dist/modules/extension/registerExtension/registerExtension.d.ts +1 -1
  149. package/dist/modules/flow/attachFlowSource/attachFlowSource.d.ts +12 -1
  150. package/dist/modules/flow/attachFlowSource/attachFlowSource.d.ts.map +1 -1
  151. package/dist/modules/flow/getFlow/getFlow.d.ts +1 -1
  152. package/dist/modules/flow/getFlowQuote/getFlowQuote.d.ts +1 -1
  153. package/dist/modules/flow/utils/clearFlowSessionToken/clearFlowSessionToken.d.ts +1 -1
  154. package/dist/modules/flow/utils/createFlowApiClient/createFlowApiClient.d.ts +1 -1
  155. package/dist/modules/flow/utils/createFlowApiClient/createFlowApiClient.d.ts.map +1 -1
  156. package/dist/modules/flow/utils/createFlowSessionTokenStorageKey/createFlowSessionTokenStorageKey.d.ts +1 -1
  157. package/dist/modules/flow/utils/createFlowSessionTokenStorageKey/createFlowSessionTokenStorageKey.d.ts.map +1 -1
  158. package/dist/modules/flow/utils/withFlowSessionTokenCleanupOn401/withFlowSessionTokenCleanupOn401.d.ts +1 -1
  159. package/dist/modules/funding/coinbase/addCoinbaseOnrampOrderEventListener/addCoinbaseOnrampOrderEventListener.d.ts +1 -1
  160. package/dist/modules/funding/coinbase/getCoinbaseBuyUrl/getCoinbaseBuyUrl.d.ts +1 -1
  161. package/dist/modules/funding/coinbase/getMissingVerificationForCoinbaseOnrampOrder/getMissingVerificationForCoinbaseOnrampOrder.d.ts +1 -1
  162. package/dist/modules/funding/coinbase/utils/validateUserCredentialsForCoinbaseOnrampOrder/validateUserCredentialsForCoinbaseOnrampOrder.d.ts +1 -1
  163. package/dist/modules/funding/coinbase/utils/validateUserCredentialsForCoinbaseOnrampOrder/validateUserCredentialsForCoinbaseOnrampOrder.d.ts.map +1 -1
  164. package/dist/modules/funding/kraken/createKrakenExchangeTransfer/createKrakenExchangeTransfer.d.ts +1 -1
  165. package/dist/modules/funding/kraken/getKrakenAccounts/getKrakenAccounts.d.ts +2 -2
  166. package/dist/modules/funding/kraken/getKrakenWhitelistedAddresses/getKrakenWhitelistedAddresses.d.ts +1 -1
  167. package/dist/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.d.ts +4 -0
  168. package/dist/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.d.ts.map +1 -1
  169. package/dist/modules/initializeClient/waitForClientInitialized/waitForClientInitialized.d.ts +1 -1
  170. package/dist/modules/initializeClient/waitForProjectSettings/waitForProjectSettings.d.ts +1 -1
  171. package/dist/modules/initializeClient/waitForProjectSettings/waitForProjectSettings.d.ts.map +1 -1
  172. package/dist/modules/keychainMigration/migrateSessionKeyToKeychain/migrateSessionKeyToKeychain.d.ts +1 -1
  173. package/dist/modules/legacyWalletBook/excludeInstalledFromCatalog/collectInstalledGroupIds/collectInstalledGroupIds.d.ts +1 -1
  174. package/dist/modules/legacyWalletBook/excludeInstalledFromCatalog/excludeInstalledFromCatalog.d.ts +1 -1
  175. package/dist/modules/legacyWalletBook/fetchLegacyWalletBook/fetchLegacyWalletBook.d.ts +1 -1
  176. package/dist/modules/legacyWalletBook/fetchLegacyWalletBook/fetchWithTimeout/fetchWithTimeout.d.ts +1 -1
  177. package/dist/modules/legacyWalletBook/getSpriteUrl/getSpriteUrl.d.ts +1 -1
  178. package/dist/modules/legacyWalletBook/getWalletBookCdnUrl/getWalletBookCdnUrl.d.ts +1 -1
  179. package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainFromWalletSchema/getChainFromWalletSchema.d.ts +2 -2
  180. package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainsFromWalletSchema/getChainsFromWalletSchema.d.ts +1 -1
  181. package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getWalletConnectCatalog.d.ts +1 -1
  182. package/dist/modules/legacyWalletBook/getWalletConnectCatalog/shouldFilterWalletForWalletConnect/shouldFilterWalletForWalletConnect.d.ts +1 -1
  183. package/dist/modules/legacyWalletBook/getWalletConnectCatalog/transformGroup/transformGroup.d.ts +1 -1
  184. package/dist/modules/legacyWalletBook/getWalletConnectCatalog/transformWallet/transformWallet.d.ts +1 -1
  185. package/dist/modules/legacyWalletBook/getWalletConnectCatalog/transformWalletBook/transformWalletBook.d.ts +1 -1
  186. package/dist/modules/legacyWalletBook/getWalletConnectCatalogWalletByWalletProviderKey/getWalletConnectCatalogWalletByWalletProviderKey.d.ts +1 -1
  187. package/dist/modules/legacyWalletBook/hasUsableDeeplink/hasUsableDeeplink.d.ts +1 -1
  188. package/dist/modules/legacyWalletBook/matchWalletProvidersToCatalogGroup/matchWalletProvidersToCatalogGroup.d.ts +1 -1
  189. package/dist/modules/legacyWalletBook/shouldFilterWallet/shouldFilterWallet.d.ts +2 -2
  190. package/dist/modules/mfa/authenticateMfaRecoveryCode/authenticateMfaRecoveryCode.d.ts +1 -1
  191. package/dist/modules/mfa/authenticatePasskeyMFA/authenticatePasskeyMFA.d.ts +1 -1
  192. package/dist/modules/mfa/authenticateTotpMfaDevice/authenticateTotpMfaDevice.d.ts +1 -1
  193. package/dist/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.d.ts +1 -1
  194. package/dist/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.d.ts.map +1 -1
  195. package/dist/modules/mfa/getMfaDevices/getMfaDevices.d.ts +1 -1
  196. package/dist/modules/mfa/getMfaMethods/getMfaMethods.d.ts +1 -1
  197. package/dist/modules/mfa/getMfaRecoveryCodes/getMfaRecoveryCodes.d.ts +1 -1
  198. package/dist/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.d.ts +1 -1
  199. package/dist/modules/mfa/isPendingRecoveryCodesAcknowledgment/isPendingRecoveryCodesAcknowledgment.d.ts +1 -1
  200. package/dist/modules/mfa/isUserMissingMfaAuth/isUserMissingMfaAuth.d.ts +1 -1
  201. package/dist/modules/mfa/registerTotpMfaDevice/registerTotpMfaDevice.d.ts +4 -1
  202. package/dist/modules/mfa/registerTotpMfaDevice/registerTotpMfaDevice.d.ts.map +1 -1
  203. package/dist/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.d.ts +1 -1
  204. package/dist/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.d.ts.map +1 -1
  205. package/dist/modules/otp/verifyOTP/verifyOTPForUserUpdate/verifyOTPForUserUpdate.d.ts +1 -1
  206. package/dist/modules/otp/verifyOTP/verifyOTPForUserUpdate/verifyOTPForUserUpdate.d.ts.map +1 -1
  207. package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts +1 -1
  208. package/dist/modules/projectSettings/isCookieEnabled/isCookieEnabled.d.ts +1 -1
  209. package/dist/modules/screenshotProtection/setScreenshotProtection/setScreenshotProtection.d.ts +1 -1
  210. package/dist/modules/sessionKeys/generateNonceSignature/generateNonceSignature.d.ts +1 -1
  211. package/dist/modules/sessionKeys/generateNonceSignature/generateNonceSignature.d.ts.map +1 -1
  212. package/dist/modules/sessionKeys/generateSessionKeys/generateSessionKeys.d.ts +1 -1
  213. package/dist/modules/sessionKeys/generateSessionKeys/generateSessionKeys.d.ts.map +1 -1
  214. package/dist/modules/sessionKeys/generateSessionSignature/generateSessionSignature.d.ts +1 -1
  215. package/dist/modules/sessionKeys/generateSessionSignature/generateSessionSignature.d.ts.map +1 -1
  216. package/dist/modules/sessionKeys/getSessionKeys/getSessionKeys.d.ts +1 -1
  217. package/dist/modules/sessionKeys/getSessionKeys/getSessionKeys.d.ts.map +1 -1
  218. package/dist/modules/sessionKeys/getSignedSessionId/getSignedSessionId.d.ts +1 -1
  219. package/dist/modules/sessionKeys/getSignedSessionId/getSignedSessionId.d.ts.map +1 -1
  220. package/dist/modules/state/raiseStateEvents/raiseStateEvents.d.ts +1 -1
  221. package/dist/modules/state/raiseStateEvents/raiseStateEvents.d.ts.map +1 -1
  222. package/dist/modules/storageSync/hydrateStateWithStorage/hydrateStateWithStorage.d.ts +1 -1
  223. package/dist/modules/storageSync/hydrateStateWithStorage/hydrateStateWithStorage.d.ts.map +1 -1
  224. package/dist/modules/storageSync/initializeStorageSync.d.ts +1 -1
  225. package/dist/modules/storageSync/initializeStorageSync.d.ts.map +1 -1
  226. package/dist/modules/storageSync/syncStateWithStorage/syncStateWithStorage.d.ts +1 -1
  227. package/dist/modules/storageSync/syncStateWithStorage/syncStateWithStorage.d.ts.map +1 -1
  228. package/dist/modules/swap/getSwapQuote/getSwapQuote.d.ts +1 -1
  229. package/dist/modules/swap/getSwapStatus/getSwapStatus.d.ts +1 -1
  230. package/dist/modules/swap/utils/ensureCorrectActiveNetwork/ensureCorrectActiveNetwork.d.ts +1 -1
  231. package/dist/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.d.ts +1 -1
  232. package/dist/modules/waas/backupWaasKeySharesToGoogleDrive/backupWaasKeySharesToGoogleDrive.d.ts +1 -1
  233. package/dist/modules/waas/createWaasClient/createNativeWaasSDKContainer.d.ts +1 -1
  234. package/dist/modules/waas/createWaasClient/createWaasClient.d.ts +1 -1
  235. package/dist/modules/waas/createWaasClient/createWaasClient.d.ts.map +1 -1
  236. package/dist/modules/waas/createWaasClient/createWaasSDKContainer.d.ts +1 -1
  237. package/dist/modules/waas/createWaasClient/translateNativeOpenError.d.ts +1 -1
  238. package/dist/modules/waas/createWaasProvider/createWaasProvider.d.ts +1 -1
  239. package/dist/modules/waas/createWaasProvider/createWaasProvider.d.ts.map +1 -1
  240. package/dist/modules/waas/createWaasWalletAccounts/createWaasWalletAccounts.d.ts +2 -2
  241. package/dist/modules/waas/delegateWaasKeyShares/delegateWaasKeyShares.d.ts +1 -1
  242. package/dist/modules/waas/exportWaasClientKeyshares/exportWaasClientKeyshares.d.ts +1 -1
  243. package/dist/modules/waas/exportWaasPrivateKey/exportWaasPrivateKey.d.ts +1 -1
  244. package/dist/modules/waas/exportWaasPrivateKeyToContainer/exportWaasPrivateKeyToContainer.d.ts +1 -1
  245. package/dist/modules/waas/findWaasWalletProviderByChain/findWaasWalletProviderByChain.d.ts +1 -1
  246. package/dist/modules/waas/findWaasWalletProviderByChain/findWaasWalletProviderByChain.d.ts.map +1 -1
  247. package/dist/modules/waas/getAllUserWaasAddressesForChain/getAllUserWaasAddressesForChain.d.ts +1 -1
  248. package/dist/modules/waas/getAllUserWaasAddressesForChain/getAllUserWaasAddressesForChain.d.ts.map +1 -1
  249. package/dist/modules/waas/getChainsMissingWaasWalletAccounts/getChainsMissingWaasWalletAccounts.d.ts +1 -1
  250. package/dist/modules/waas/getWaasChainNameFromChain/getWaasChainNameFromChain.d.ts +1 -1
  251. package/dist/modules/waas/getWaasChainNameFromChain/getWaasChainNameFromChain.d.ts.map +1 -1
  252. package/dist/modules/waas/getWaasWalletProviderByChain/getWaasWalletProviderByChain.d.ts +1 -1
  253. package/dist/modules/waas/getWaasWalletProviderByChain/getWaasWalletProviderByChain.d.ts.map +1 -1
  254. package/dist/modules/waas/getWaasWalletProviderFromWalletAccount/getWaasWalletProviderFromWalletAccount.d.ts +1 -1
  255. package/dist/modules/waas/getWaasWalletProviderFromWalletAccount/getWaasWalletProviderFromWalletAccount.d.ts.map +1 -1
  256. package/dist/modules/waas/getWalletRecoveryState/getWalletRecoveryState.d.ts +1 -1
  257. package/dist/modules/waas/hasDelegatedAccess/hasDelegatedAccess.d.ts +1 -1
  258. package/dist/modules/waas/importWaasPrivateKey/importWaasPrivateKey.d.ts +1 -1
  259. package/dist/modules/waas/initializeWaasClientsForEagerRecovery/initializeWaasClientsForEagerRecovery.d.ts +1 -1
  260. package/dist/modules/waas/isDynamicWaasEnabled/isDynamicWaasEnabled.d.ts +1 -1
  261. package/dist/modules/waas/isPasswordRequiredForWaasWallets/isPasswordRequiredForWaasWallets.d.ts +1 -1
  262. package/dist/modules/waas/isWaasWalletAccount/isWaasWalletAccount.d.ts +1 -1
  263. package/dist/modules/waas/isWaasWalletProvider/isWaasWalletProvider.d.ts +1 -1
  264. package/dist/modules/waas/isWaasWalletProvider/isWaasWalletProvider.d.ts.map +1 -1
  265. package/dist/modules/waas/isWalletCreationRequirement/isWalletCreationRequirement.d.ts +1 -1
  266. package/dist/modules/waas/normalizeWalletRequirements/normalizeWalletRequirements.d.ts +1 -1
  267. package/dist/modules/waas/preconnectWaasIframe/preconnectWaasIframe.d.ts +1 -1
  268. package/dist/modules/waas/refreshWaasWalletAccountShares/refreshWaasWalletAccountShares.d.ts +1 -1
  269. package/dist/modules/waas/revokeWaasDelegation/revokeWaasDelegation.d.ts +1 -1
  270. package/dist/modules/waas/setWaasWalletAccountPassword/setWaasWalletAccountPassword.d.ts +1 -1
  271. package/dist/modules/waas/shouldAutoCreateWalletForChain/shouldAutoCreateWalletForChain.d.ts +1 -1
  272. package/dist/modules/waas/unlockWallet/unlockWallet.d.ts +1 -1
  273. package/dist/modules/waas/updateWaasPassword/updateWaasPassword.d.ts +1 -1
  274. package/dist/modules/walletBackup/googleDrive/findMissingGoogleDriveBackupScopes/findMissingGoogleDriveBackupScopes.d.ts +1 -1
  275. package/dist/modules/walletBackup/googleDrive/hasAllGoogleDriveBackupScopes/hasAllGoogleDriveBackupScopes.d.ts +1 -1
  276. package/dist/modules/walletBackup/googleDrive/isInsufficientGoogleDriveScopesError/isInsufficientGoogleDriveScopesError.d.ts +1 -1
  277. package/dist/modules/walletBackup/googleDrive/utils/fetchGoogleDriveOauthAccess/fetchGoogleDriveOauthAccess.d.ts +1 -1
  278. package/dist/modules/walletBackup/googleDrive/utils/findGoogleOauthAccountId/findGoogleOauthAccountId.d.ts +1 -1
  279. package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/buildInAppBrowserOptions.d.ts +1 -1
  280. package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/getInAppBrowserUrl/getInAppBrowserUrl.d.ts +1 -1
  281. package/dist/modules/walletOptionsCatalogue/buildInstallationUrls/buildInstallationUrls.d.ts +1 -1
  282. package/dist/modules/walletOptionsCatalogue/buildInstallationUrlsByWalletOptionKey/buildInstallationUrlsByWalletOptionKey.d.ts +1 -1
  283. package/dist/modules/walletOptionsCatalogue/buildMetaMaskSdkUriOptions/buildMetaMaskSdkUriOptions.d.ts +1 -1
  284. package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts +1 -1
  285. package/dist/modules/walletOptionsCatalogue/buildWalletOption/buildWalletOption.d.ts +1 -1
  286. package/dist/modules/walletOptionsCatalogue/buildWithWalletProviderOptions/buildWithWalletProviderOptions.d.ts +1 -1
  287. package/dist/modules/walletOptionsCatalogue/classifyWithWalletProviderSource/classifyWithWalletProviderSource.d.ts +1 -1
  288. package/dist/modules/walletOptionsCatalogue/compareByRelevance/compareByRelevance.d.ts +1 -1
  289. package/dist/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/findByNameMatch/findByNameMatch.d.ts +1 -1
  290. package/dist/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/findWalletOptionKeyForProviderKey.d.ts +1 -1
  291. package/dist/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/resolveWalletOptionKey/resolveWalletOptionKey.d.ts +1 -1
  292. package/dist/modules/walletOptionsCatalogue/getConnectionOptionPriority/getConnectionOptionPriority.d.ts +1 -1
  293. package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/getInstallationLinkForCurrentPlatform.d.ts +1 -1
  294. package/dist/modules/walletOptionsCatalogue/getPriorityIndex/getPriorityIndex.d.ts +1 -1
  295. package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts +1 -1
  296. package/dist/modules/walletOptionsCatalogue/groupOptionsByWalletOption/groupOptionsByWalletOption.d.ts +1 -1
  297. package/dist/modules/walletOptionsCatalogue/hasAnyConnectionOption/hasAnyConnectionOption.d.ts +1 -1
  298. package/dist/modules/walletOptionsCatalogue/hasInstalledProvider/hasInstalledProvider.d.ts +1 -1
  299. package/dist/modules/walletOptionsCatalogue/normalizeWalletDisplayName/normalizeWalletDisplayName.d.ts +1 -1
  300. package/dist/modules/walletOptionsCatalogue/resolveWalletBookWalletOptionKey/resolveWalletBookWalletOptionKey.d.ts +1 -1
  301. package/dist/modules/walletOptionsCatalogue/sortConnectionOptions/sortConnectionOptions.d.ts +1 -1
  302. package/dist/modules/walletOptionsCatalogue/sortWalletOptions/sortWalletOptions.d.ts +1 -1
  303. package/dist/modules/wallets/assertWalletAccountSigningAvailability/assertWalletAccountSigningAvailability.d.ts +1 -1
  304. package/dist/modules/wallets/destroyWalletProviders/destroyWalletProviders.d.ts +1 -1
  305. package/dist/modules/wallets/disconnectWalletAccount/disconnectWalletAccount.d.ts +1 -1
  306. package/dist/modules/wallets/emitWalletAccountsChangedEvent/emitWalletAccountsChangedEvent.d.ts +1 -1
  307. package/dist/modules/wallets/getAvailableWalletProvidersData/getAvailableWalletProvidersData.d.ts +1 -1
  308. package/dist/modules/wallets/getConnectedAddresses/getConnectedAddresses.d.ts +1 -1
  309. package/dist/modules/wallets/getOwnerWalletAccountForSmartWalletAccount/getOwnerWalletAccountForSmartWalletAccount.d.ts +1 -1
  310. package/dist/modules/wallets/getOwnerWalletAccountForSmartWalletAccount/getOwnerWalletAccountForSmartWalletAccount.d.ts.map +1 -1
  311. package/dist/modules/wallets/getWalletAccountAddressByType/getWalletAccountAddressByType.d.ts +1 -1
  312. package/dist/modules/wallets/getWalletAccountAddressByType/getWalletAccountAddressByType.d.ts.map +1 -1
  313. package/dist/modules/wallets/getWalletAccounts/getWalletAccounts.d.ts +1 -1
  314. package/dist/modules/wallets/getWalletAccounts/getWalletAccountsFromState/getWalletAccountsFromState.d.ts +1 -1
  315. package/dist/modules/wallets/getWalletAccounts/getWalletAccountsFromState/getWalletAccountsFromState.d.ts.map +1 -1
  316. package/dist/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.d.ts +1 -1
  317. package/dist/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.d.ts.map +1 -1
  318. package/dist/modules/wallets/getWalletProviderDataByKey/getWalletProviderDataByKey.d.ts +1 -1
  319. package/dist/modules/wallets/getWalletProviders/getWalletProviders.d.ts +1 -1
  320. package/dist/modules/wallets/hardwareWallet/canConnectWithHardwareWallet/canConnectWithHardwareWallet.d.ts +1 -1
  321. package/dist/modules/wallets/hardwareWallet/formatSignatureForHardwareWallet/formatSignatureForHardwareWallet.d.ts +1 -1
  322. package/dist/modules/wallets/hardwareWallet/isHardwareWalletAccount/isHardwareWalletAccount.d.ts +1 -1
  323. package/dist/modules/wallets/hasWalletProviderConnectMethod/hasWalletProviderConnectMethod.d.ts +1 -1
  324. package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts +1 -1
  325. package/dist/modules/wallets/isWalletAccountVerified/isWalletAccountVerified.d.ts +1 -1
  326. package/dist/modules/wallets/networks/createBaseNetworkProvider/createBaseNetworkProvider.d.ts +1 -1
  327. package/dist/modules/wallets/networks/createBaseNetworkProvider/createBaseNetworkProvider.d.ts.map +1 -1
  328. package/dist/modules/wallets/networks/getActiveNetworkData/getActiveNetworkData.d.ts +1 -1
  329. package/dist/modules/wallets/networks/getActiveNetworkId/getActiveNetworkId.d.ts +1 -1
  330. package/dist/modules/wallets/networks/getBalance/getBalance.d.ts +1 -1
  331. package/dist/modules/wallets/networks/getBalanceForAddress/getBalanceForAddress.d.ts +1 -1
  332. package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts +1 -1
  333. package/dist/modules/wallets/networks/getNetworkDataForNetworkId/getNetworkDataForNetworkId.d.ts +1 -1
  334. package/dist/modules/wallets/networks/getNetworkDataForNetworkId/getNetworkDataForNetworkId.d.ts.map +1 -1
  335. package/dist/modules/wallets/networks/getNetworkProviderFromNetworkId/getNetworkProviderFromNetworkId.d.ts +1 -1
  336. package/dist/modules/wallets/networks/getNetworkProviderFromNetworkId/getNetworkProviderFromNetworkId.d.ts.map +1 -1
  337. package/dist/modules/wallets/networks/getNetworkProviders/getNetworkProviders.d.ts +1 -1
  338. package/dist/modules/wallets/networks/getNetworksData/getNetworksData.d.ts +1 -1
  339. package/dist/modules/wallets/networks/getSdkChainFromApiChainName/getSdkChainFromApiChainName.d.ts +1 -1
  340. package/dist/modules/wallets/networks/getTransactionHistory/getTransactionHistory.d.ts +1 -1
  341. package/dist/modules/wallets/networks/isProgrammaticNetworkSwitchAvailable/isProgrammaticNetworkSwitchAvailable.d.ts +1 -1
  342. package/dist/modules/wallets/networks/lastKnownNetworkRegistry/createLastKnownNetworkRegistry/createLastKnownNetworkRegistry.d.ts +1 -1
  343. package/dist/modules/wallets/networks/networkProviderBuilderRegistry/createNetworkProviderBuilderRegistry/createNetworkProviderBuilderRegistry.d.ts +1 -1
  344. package/dist/modules/wallets/networks/networkProviderBuilderRegistry/createNetworkProviderBuilderRegistry/createNetworkProviderBuilderRegistry.d.ts.map +1 -1
  345. package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts +1 -1
  346. package/dist/modules/wallets/reconcileWalletAccountsAgainstClient/reconcileWalletAccountsAgainstClient.d.ts +1 -1
  347. package/dist/modules/wallets/unverifiedWalletAccounts/removeUnverifiedWalletAccount/removeUnverifiedWalletAccount.d.ts +1 -1
  348. package/dist/modules/wallets/unverifiedWalletAccounts/setUnverifiedWalletAccounts/setUnverifiedWalletAccounts.d.ts +1 -1
  349. package/dist/modules/wallets/userHasEmbeddedWalletForChain/userHasEmbeddedWalletForChain.d.ts +1 -1
  350. package/dist/modules/wallets/userHasEmbeddedWalletForChain/userHasEmbeddedWalletForChain.d.ts.map +1 -1
  351. package/dist/modules/wallets/userHasExternalWallet/userHasExternalWallet.d.ts +1 -1
  352. package/dist/modules/wallets/userHasExternalWallet/userHasExternalWallet.d.ts.map +1 -1
  353. package/dist/modules/wallets/utils/convertUnverifiedWalletAccountToWalletAccount/convertUnverifiedWalletAccountToWalletAccount.d.ts +1 -1
  354. package/dist/modules/wallets/utils/convertUnverifiedWalletAccountToWalletAccount/convertUnverifiedWalletAccountToWalletAccount.d.ts.map +1 -1
  355. package/dist/modules/wallets/utils/convertVerifiedCredentialToWalletAccount/convertVerifiedCredentialToWalletAccount.d.ts +1 -1
  356. package/dist/modules/wallets/utils/convertVerifiedCredentialToWalletAccount/convertVerifiedCredentialToWalletAccount.d.ts.map +1 -1
  357. package/dist/modules/wallets/utils/formatSignInMessage/formatSignInMessage.d.ts +1 -1
  358. package/dist/modules/wallets/utils/formatWalletAccountId/formatWalletAccountId.d.ts +1 -1
  359. package/dist/modules/wallets/utils/formatWalletAccountId/formatWalletAccountId.d.ts.map +1 -1
  360. package/dist/modules/wallets/utils/formatWalletProviderGroupKey/formatWalletProviderGroupKey.d.ts +1 -1
  361. package/dist/modules/wallets/utils/formatWalletProviderGroupKey/formatWalletProviderGroupKey.d.ts.map +1 -1
  362. package/dist/modules/wallets/utils/formatWalletProviderKey/formatWalletProviderKey.d.ts +1 -1
  363. package/dist/modules/wallets/utils/getAddressesWithTypesFromConnectionResult/getAddressesWithTypesFromConnectionResult.d.ts +1 -1
  364. package/dist/modules/wallets/utils/getAddressesWithTypesFromConnectionResult/getAddressesWithTypesFromConnectionResult.d.ts.map +1 -1
  365. package/dist/modules/wallets/utils/getAllProvidersFromWindow/getAllProvidersFromWindow.d.ts +1 -1
  366. package/dist/modules/wallets/utils/getAvailableWalletProvidersFromWalletAccounts/getAvailableWalletProvidersFromWalletAccounts.d.ts +1 -1
  367. package/dist/modules/wallets/utils/getAvailableWalletProvidersFromWalletAccounts/getAvailableWalletProvidersFromWalletAccounts.d.ts.map +1 -1
  368. package/dist/modules/wallets/utils/getChainIdForAccountVerification/getChainIdForAccountVerification.d.ts +1 -1
  369. package/dist/modules/wallets/utils/getChainIdForAccountVerification/getChainIdForAccountVerification.d.ts.map +1 -1
  370. package/dist/modules/wallets/utils/getInjectedProviderFromWindow/getInjectedProviderFromWindow.d.ts +1 -1
  371. package/dist/modules/wallets/utils/getInjectedProviderFromWindow/getInjectedProviderFromWindow.d.ts.map +1 -1
  372. package/dist/modules/wallets/utils/getSignInMessage/createSignInMessageStatement/createSignInMessageStatement.d.ts +1 -1
  373. package/dist/modules/wallets/utils/getSignInMessage/createSignInMessageStatement/createSignInMessageStatement.d.ts.map +1 -1
  374. package/dist/modules/wallets/utils/getSignInMessage/getSignInMessage.d.ts +1 -1
  375. package/dist/modules/wallets/utils/getSignInMessage/getSignInMessage.d.ts.map +1 -1
  376. package/dist/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.d.ts +1 -1
  377. package/dist/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.d.ts.map +1 -1
  378. package/dist/modules/wallets/utils/getWalletAccountFromAddress/getWalletAccountFromAddress.d.ts +1 -1
  379. package/dist/modules/wallets/utils/getWalletProviderFromWalletAccount/getWalletProviderFromWalletAccount.d.ts +1 -1
  380. package/dist/modules/wallets/utils/getWalletProviderFromWalletAccount/getWalletProviderFromWalletAccount.d.ts.map +1 -1
  381. package/dist/modules/wallets/utils/isSameAddress/isSameAddress.d.ts +1 -1
  382. package/dist/modules/wallets/utils/isSameAddress/isSameAddress.d.ts.map +1 -1
  383. package/dist/modules/wallets/utils/normalizeAddress/normalizeAddress.d.ts +1 -1
  384. package/dist/modules/wallets/utils/normalizeAddress/normalizeAddress.d.ts.map +1 -1
  385. package/dist/modules/wallets/utils/normalizeWalletNameWithChain/normalizeWalletNameWithChain.d.ts +1 -1
  386. package/dist/modules/wallets/utils/stripChainSuffix/stripChainSuffix.d.ts +1 -1
  387. package/dist/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.d.ts +1 -1
  388. package/dist/modules/wallets/verifyWalletAccountForSignInOrTransfer/verifyWalletAccountForSignInOrTransfer.d.ts +1 -1
  389. package/dist/modules/wallets/verifyWalletAccountForSignInOrTransfer/verifyWalletAccountForSignInOrTransfer.d.ts.map +1 -1
  390. package/dist/modules/wallets/walletProvider/defaultImplementations/getActiveNetworkIdFromLastKnownRegistry/getActiveNetworkIdFromLastKnownRegistry.d.ts +1 -1
  391. package/dist/modules/wallets/walletProvider/defaultImplementations/getActiveNetworkIdFromLastKnownRegistry/getActiveNetworkIdFromLastKnownRegistry.d.ts.map +1 -1
  392. package/dist/modules/wallets/walletProvider/defaultImplementations/switchActiveNetworkInLastKnownRegistry/switchActiveNetworkInLastKnownRegistry.d.ts +1 -1
  393. package/dist/modules/wallets/walletProvider/defaultImplementations/switchActiveNetworkInLastKnownRegistry/switchActiveNetworkInLastKnownRegistry.d.ts.map +1 -1
  394. package/dist/modules/wallets/walletProvider/events/createWalletProviderEventEmitter/createWalletProviderEventEmitter.d.ts +2 -2
  395. package/dist/modules/wallets/walletProvider/events/offWalletProviderEvent/offWalletProviderEvent.d.ts +1 -1
  396. package/dist/modules/wallets/walletProvider/events/onWalletProviderEvent/onWalletProviderEvent.d.ts +1 -1
  397. package/dist/modules/wallets/walletProvider/extractChainFromNormalizedName/extractChainFromNormalizedName.d.ts +1 -1
  398. package/dist/modules/wallets/walletProvider/isDeeplinkWalletProvider/isDeeplinkWalletProvider.d.ts +1 -1
  399. package/dist/modules/wallets/walletProvider/splitWalletProviderKey/splitWalletProviderKey.d.ts +1 -1
  400. package/dist/modules/wallets/walletProvider/splitWalletProviderKey/splitWalletProviderKey.d.ts.map +1 -1
  401. package/dist/modules/wallets/walletProvider/walletProviderKeyMap/getWalletProviderKeyFromVerifiedCredential/getWalletProviderKeyFromVerifiedCredential.d.ts +1 -1
  402. package/dist/modules/wallets/walletProvider/walletProviderKeyMap/getWalletProviderKeyFromVerifiedCredential/getWalletProviderKeyFromVerifiedCredential.d.ts.map +1 -1
  403. package/dist/modules/wallets/walletProvider/walletProviderKeyMap/updateWalletProviderKeysForVerifiedCredentials/updateWalletProviderKeysForVerifiedCredentials.d.ts +1 -1
  404. package/dist/modules/wallets/walletProvider/walletProviderKeyMap/updateWalletProviderKeysForVerifiedCredentials/updateWalletProviderKeysForVerifiedCredentials.d.ts.map +1 -1
  405. package/dist/modules/wallets/walletProviderRegistry/createWalletProviderRegistry/createWalletProviderRegistry.d.ts +1 -1
  406. package/dist/{refreshAuth-C0kN3RBN.cjs → refreshAuth-B3XSU6GT.cjs} +3 -3
  407. package/dist/{refreshAuth-C0kN3RBN.cjs.map → refreshAuth-B3XSU6GT.cjs.map} +1 -1
  408. package/dist/{refreshAuth-CfpOd4qg.esm.js → refreshAuth-CAPTC0sg.esm.js} +3 -3
  409. package/dist/{refreshAuth-CfpOd4qg.esm.js.map → refreshAuth-CAPTC0sg.esm.js.map} +1 -1
  410. package/dist/{refreshAuth-Ck5OyzzC.native.esm.js → refreshAuth-aTqsU1uq.native.esm.js} +3 -3
  411. package/dist/{refreshAuth-Ck5OyzzC.native.esm.js.map → refreshAuth-aTqsU1uq.native.esm.js.map} +1 -1
  412. package/dist/services/asyncTrack/createAsyncTrack.d.ts +1 -1
  413. package/dist/services/crossTabBroadcast/createCrossTabBroadcast/createCrossTabBroadcast.d.ts +1 -1
  414. package/dist/services/eventEmitter/createEventEmitter.d.ts +1 -1
  415. package/dist/services/eventEmitter/createEventEmitter.d.ts.map +1 -1
  416. package/dist/services/fetch/createWebFetch.d.ts +1 -1
  417. package/dist/services/instrumentation/connectLoggerToInstrumentation/connectLoggerToInstrumentation.d.ts +1 -1
  418. package/dist/services/instrumentation/constants.d.ts.map +1 -1
  419. package/dist/services/instrumentation/createInstrumentation/createInstrumentation.d.ts +1 -1
  420. package/dist/services/instrumentation/instrumentFunction/extractParams/extractParams.d.ts +1 -1
  421. package/dist/services/instrumentation/instrumentFunction/instrumentFunction.d.ts +1 -1
  422. package/dist/services/instrumentation/instrumentFunction/scrubResolvedValue/scrubResolvedValue.d.ts +1 -1
  423. package/dist/services/instrumentation/scrubParameters/scrubParameters.d.ts +1 -1
  424. package/dist/services/instrumentation/scrubParameters/scrubParameters.d.ts.map +1 -1
  425. package/dist/services/instrumentation/transports/createDynamicTransport/createDynamicTransport.d.ts +1 -1
  426. package/dist/services/keychain/createKeychainService/createKeychainService.d.ts +1 -1
  427. package/dist/services/keychain/createKeychainService/createKeychainService.d.ts.map +1 -1
  428. package/dist/services/keychain/createKeychainService/utils/deleteIndexedDBItem.d.ts +1 -1
  429. package/dist/services/keychain/createKeychainService/utils/deleteIndexedDBItem.d.ts.map +1 -1
  430. package/dist/services/keychain/createKeychainService/utils/getIndexedDBItem.d.ts +1 -1
  431. package/dist/services/keychain/createKeychainService/utils/getIndexedDBItem.d.ts.map +1 -1
  432. package/dist/services/keychain/createKeychainService/utils/openDatabase.d.ts +1 -1
  433. package/dist/services/keychain/createKeychainService/utils/openDatabase.d.ts.map +1 -1
  434. package/dist/services/keychain/createKeychainService/utils/setIndexedDBItem.d.ts +1 -1
  435. package/dist/services/keychain/createKeychainService/utils/setIndexedDBItem.d.ts.map +1 -1
  436. package/dist/services/keychain/createKeychainService/utils/withDatabase/withDatabase.d.ts +1 -1
  437. package/dist/services/logger/createLogger/createLogger.d.ts +2 -2
  438. package/dist/services/nativeManifest/getReactNativeManifest/getReactNativeManifest.d.ts +1 -1
  439. package/dist/services/navigate/createNavigationHandler/createNavigationHandler.d.ts +1 -1
  440. package/dist/services/openDeeplink/createWebDeeplinkOpener/createWebDeeplinkOpener.d.ts +1 -1
  441. package/dist/services/passkey/createPasskeyService/createPasskeyService.d.ts +1 -1
  442. package/dist/services/realtime/createRealtimeChannelSchema/createRealtimeChannelSchema.d.ts +1 -1
  443. package/dist/services/realtime/createRealtimeService/createRealtimeService.d.ts +1 -1
  444. package/dist/services/runtimeServices/createRuntimeServiceAccessKey/createRuntimeServiceAccessKey.d.ts +1 -1
  445. package/dist/services/runtimeServices/createRuntimeServices/createRuntimeServices.d.ts +1 -1
  446. package/dist/services/storage/createLocalStorageAdapter/createLocalStorageAdapter.d.ts +1 -1
  447. package/dist/services/storage/createStorage/createStorage.d.ts +1 -1
  448. package/dist/services/storage/createStorage/formatForStorage/isValidDateISOString/isValidDateISOString.d.ts +1 -1
  449. package/dist/services/storage/createStorage/formatForStorage/storageFormat.d.ts +2 -2
  450. package/dist/services/storage/createStorage/formatForStorage/storageFormat.d.ts.map +1 -1
  451. package/dist/services/storage/createStorageKeySchema/createStorageKeySchema.d.ts +1 -1
  452. package/dist/services/storage/createStorageKeySchema/createStorageKeySchema.d.ts.map +1 -1
  453. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  454. package/dist/utils/appendConnectionUriToDeeplink/appendConnectionUriToDeeplink.d.ts +1 -1
  455. package/dist/utils/base64UrlDecode/base64UrlDecode.d.ts +1 -1
  456. package/dist/utils/base64urlFromBytes/base64urlFromBytes.d.ts +1 -1
  457. package/dist/utils/bufferToBase64/bufferToBase64.d.ts +1 -1
  458. package/dist/utils/bufferToBase64/bufferToBase64.d.ts.map +1 -1
  459. package/dist/utils/bufferToHex/bufferToHex.d.ts +1 -1
  460. package/dist/utils/bytesFromBase64url/bytesFromBase64url.d.ts +1 -1
  461. package/dist/utils/compressRawPublicKey/compressRawPublicKey.d.ts +1 -1
  462. package/dist/utils/debouncedMutex/createDebouncedMutex/createDebouncedMutex.d.ts +1 -1
  463. package/dist/utils/debouncedMutex/createDebouncedMutex/createDebouncedMutex.d.ts.map +1 -1
  464. package/dist/utils/deferredPromise/createDeferredPromise.d.ts +1 -1
  465. package/dist/utils/deferredPromise/createDeferredPromise.d.ts.map +1 -1
  466. package/dist/utils/derToP1363/derToP1363.d.ts +1 -1
  467. package/dist/utils/digestSHA256/digestSHA256.d.ts +1 -1
  468. package/dist/utils/digestSHA256/digestSHA256.d.ts.map +1 -1
  469. package/dist/utils/encodeBase64Url/encodeBase64Url.d.ts +1 -1
  470. package/dist/utils/filterDuplicates/filterDuplicates.d.ts +1 -1
  471. package/dist/utils/getAppMetadata/getAppMetadata.d.ts +1 -1
  472. package/dist/utils/getBuffer/getBuffer.d.ts +1 -1
  473. package/dist/utils/getBuffer/getBuffer.d.ts.map +1 -1
  474. package/dist/utils/getChainFromVerifiedCredentialChain/getChainFromVerifiedCredentialChain.d.ts +1 -1
  475. package/dist/utils/getChainFromVerifiedCredentialChain/getChainFromVerifiedCredentialChain.d.ts.map +1 -1
  476. package/dist/utils/getChainFromWalletBookIdentifier/getChainFromWalletBookIdentifier.d.ts +1 -1
  477. package/dist/utils/getKeychainIndexedDBName/getKeychainIndexedDBName.d.ts +1 -1
  478. package/dist/utils/getNativeLinkScheme/getNativeLinkScheme.d.ts +1 -1
  479. package/dist/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.d.ts +1 -1
  480. package/dist/utils/getNonce/getNonce.d.ts +1 -1
  481. package/dist/utils/getNonce/prefetchNoncesIfNeeded/prefetchNoncesIfNeeded.d.ts +1 -1
  482. package/dist/utils/getNonce/prefetchNoncesIfNeeded/prefetchNoncesIfNeeded.d.ts.map +1 -1
  483. package/dist/utils/getOperatingSystem/getOperatingSystem.d.ts +1 -1
  484. package/dist/utils/getPlatform/getPlatform.d.ts +1 -1
  485. package/dist/utils/getUserAgent/getUserAgent.d.ts +1 -1
  486. package/dist/utils/isEqualShallow/isEqualShallow.d.ts +1 -1
  487. package/dist/utils/isError/isError.d.ts +1 -1
  488. package/dist/utils/isErrorWithCode/isErrorWithCode.d.ts +1 -1
  489. package/dist/utils/isMobile/isMobile.d.ts +16 -16
  490. package/dist/utils/isMobile/isMobile.d.ts.map +1 -1
  491. package/dist/utils/isServerSideRendering/isServerSideRendering.d.ts +1 -1
  492. package/dist/utils/observable/createObservableState/createObservableState.d.ts +1 -1
  493. package/dist/utils/observable/subscribeWithSelector/subscribeWithSelector.d.ts +1 -1
  494. package/dist/utils/p256Keygen/p256Keygen.d.ts +1 -1
  495. package/dist/utils/p256Keygen/p256Keygen.d.ts.map +1 -1
  496. package/dist/utils/p256Sign/p256Sign.d.ts +1 -1
  497. package/dist/utils/p256Sign/p256Sign.d.ts.map +1 -1
  498. package/dist/utils/parseAmountToSmallestUnit/parseAmountToSmallestUnit.d.ts +1 -1
  499. package/dist/utils/parseUserAgent/parseUserAgent.d.ts +1 -1
  500. package/dist/utils/parseUserAgent/parseUserAgent.d.ts.map +1 -1
  501. package/dist/utils/randomString/randomString.d.ts +1 -1
  502. package/dist/utils/randomString/randomString.d.ts.map +1 -1
  503. package/dist/utils/retryOnFail/retryOnFail.d.ts +1 -1
  504. package/dist/utils/retryOnFail/retryOnFail.d.ts.map +1 -1
  505. package/dist/utils/setCookie/setCookie.d.ts +1 -1
  506. package/dist/waas.cjs +27 -27
  507. package/dist/waas.cjs.map +1 -1
  508. package/dist/waas.esm.js +26 -26
  509. package/dist/waas.esm.js.map +1 -1
  510. package/dist/waas.native.esm.js +26 -26
  511. package/dist/waas.native.esm.js.map +1 -1
  512. package/dist/waasCore.cjs +19 -15
  513. package/dist/waasCore.cjs.map +1 -1
  514. package/dist/waasCore.esm.js +19 -15
  515. package/dist/waasCore.esm.js.map +1 -1
  516. package/dist/waasCore.native.esm.js +23 -19
  517. package/dist/waasCore.native.esm.js.map +1 -1
  518. package/package.json +2 -2
  519. package/dist/InvalidParamError-B0nAZ6Ei.esm.js.map +0 -1
  520. package/dist/InvalidParamError-DDdAeFXE.cjs.map +0 -1
  521. package/dist/InvalidParamError-DbUJgYDE.native.esm.js.map +0 -1
  522. package/dist/getNetworkProviderFromNetworkId-1j3BPA22.cjs.map +0 -1
  523. package/dist/getNetworkProviderFromNetworkId-CMBk4NzR.native.esm.js.map +0 -1
  524. package/dist/getNetworkProviderFromNetworkId-DaMxnWPo.esm.js.map +0 -1
  525. package/dist/getSignedSessionId-BRklPjP0.esm.js.map +0 -1
  526. package/dist/getSignedSessionId-BU81jCyQ.cjs.map +0 -1
  527. package/dist/getSignedSessionId-DPj38qtY.native.esm.js.map +0 -1
  528. package/dist/getWaasWalletProviderFromWalletAccount-BhgXIVZM.native.esm.js.map +0 -1
  529. package/dist/getWaasWalletProviderFromWalletAccount-JN5ZC71J.esm.js.map +0 -1
  530. package/dist/getWaasWalletProviderFromWalletAccount-aRoo7mw8.cjs.map +0 -1
  531. package/dist/getWalletProviderByKey-BKRul8sp.native.esm.js.map +0 -1
  532. package/dist/getWalletProviderByKey-C-HHI7L8.esm.js.map +0 -1
  533. package/dist/getWalletProviderByKey-z1nf15R8.cjs.map +0 -1
  534. package/dist/isMfaRequiredForAction-BAqo9eBq.esm.js.map +0 -1
  535. package/dist/isMfaRequiredForAction-YGaK8XRO.cjs.map +0 -1
  536. package/dist/isUserOnboardingComplete-BT_SR4m_.esm.js.map +0 -1
  537. package/dist/isUserOnboardingComplete-Bo9grSze.cjs.map +0 -1
  538. package/dist/isUserOnboardingComplete-CVHzzTtG.native.esm.js.map +0 -1
@@ -1,9 +1,9 @@
1
- const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-YGaK8XRO.cjs');
1
+ const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-DFowphoV.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.12.2";
6
+ var version = "1.14.0";
7
7
  var dependencies = {
8
8
  "@dynamic-labs-sdk/assert-package-version": "workspace:*",
9
9
  "@dynamic-labs-wallet/browser-wallet-client": "1.0.39",
@@ -18,7 +18,7 @@ var dependencies = {
18
18
 
19
19
  //#endregion
20
20
  //#region src/client/core/getCore/getCore.ts
21
- /** @not-instrumented */
21
+ /** @notInstrumented */
22
22
  const getCore = (client) => {
23
23
  return client.__core;
24
24
  };
@@ -109,14 +109,14 @@ 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
- * @not-instrumented
112
+ * @notInstrumented
113
113
  */
114
114
  const getDefaultClient = () => {
115
115
  if (!defaultClient) throw new ClientNotFoundError();
116
116
  if (numOfInitializedClients > 1) getCore(defaultClient).logger.debug("Multiple instances of DynamicClient found. If you are only using one client (recommended), make sure you are not calling \"createDynamicClient\" multiple times. If you are using multiple clients, make sure you are passing which client to use as the last param of all Dynamic functions.");
117
117
  return defaultClient;
118
118
  };
119
- /** @not-instrumented */
119
+ /** @notInstrumented */
120
120
  const setDefaultClient = (client) => {
121
121
  defaultClient = client;
122
122
  numOfInitializedClients++;
@@ -142,7 +142,7 @@ const CLIENT_SDK_NAME = "ClientSDK";
142
142
  //#endregion
143
143
  //#region src/utils/randomString/randomString.ts
144
144
  const DEFAULT_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
145
- /** @not-instrumented */
145
+ /** @notInstrumented */
146
146
  const randomString = ({ chars = DEFAULT_CHARS, length }) => {
147
147
  const bytes = new Uint8Array(length);
148
148
  crypto.getRandomValues(bytes);
@@ -152,679 +152,226 @@ const randomString = ({ chars = DEFAULT_CHARS, length }) => {
152
152
  };
153
153
 
154
154
  //#endregion
155
- //#region src/modules/auth/extractSessionId/extractSessionId.ts
155
+ //#region src/modules/auth/getElevatedAccessToken/getElevatedAccessToken.ts
156
156
  /**
157
- * Extracts the session ID (`sid` claim) from a JWT token string.
157
+ * Gets an elevated access token by scope.
158
158
  *
159
- * Decodes the base64url-encoded payload segment of the token and reads the
160
- * `sid` field. This is used to correlate instrumentation events with the
161
- * authenticated session, without ever forwarding the full token.
159
+ * This function retrieves an elevated access token that contains the specified scope.
160
+ * Expired tokens are automatically filtered out.
162
161
  *
163
- * Returns `null` when no token is present, when the token is malformed, or
164
- * when the payload does not contain a `sid` claim.
165
- * @not-instrumented
162
+ * By default, if the token has `singleUse: true`, it will be automatically
163
+ * consumed (removed from state) after retrieval. Pass `consume: false` to
164
+ * check for token existence without consuming it.
165
+ *
166
+ * @param params - The parameters object.
167
+ * @param params.scope - The scope to match (e.g., 'wallet:export').
168
+ * @param params.consume - Whether to consume single-use tokens (default: true).
169
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
170
+ * @returns The elevated access token if found and not expired, or undefined if not found or expired.
171
+ *
172
+ * @example
173
+ * ```typescript
174
+ * // Retrieve and consume (default)
175
+ * const token = getElevatedAccessToken({ scope: 'wallet:export' });
176
+ *
177
+ * // Check existence without consuming
178
+ * const token = getElevatedAccessToken({ scope: 'credential:unlink', consume: false });
179
+ * ```
180
+ * @notInstrumented
166
181
  */
167
- const extractSessionId = (token) => {
168
- try {
169
- const payload = token.split(".")[1];
170
- return JSON.parse(atob(payload)).sid ?? null;
171
- } catch {
172
- return null;
182
+ const getElevatedAccessToken = ({ consume = true, scope }, client = getDefaultClient()) => {
183
+ const core = getCore(client);
184
+ const now = /* @__PURE__ */ new Date();
185
+ const elevatedAccessTokens = core.state.get().elevatedAccessTokens || [];
186
+ const validTokens = elevatedAccessTokens.filter((token$1) => !token$1.expiresAt || token$1.expiresAt > now);
187
+ if (validTokens.length !== elevatedAccessTokens.length) core.state.set({ elevatedAccessTokens: validTokens });
188
+ const token = validTokens.find((token$1) => token$1.scopes.includes(scope));
189
+ if (!token) return;
190
+ if (consume && token.singleUse) {
191
+ const updatedTokens = validTokens.filter((t) => t !== token);
192
+ core.state.set({ elevatedAccessTokens: updatedTokens });
173
193
  }
194
+ return token.token;
174
195
  };
175
196
 
176
197
  //#endregion
177
- //#region src/utils/getOperatingSystem/getOperatingSystem.ts
178
- /**
179
- * Detects the operating system from `navigator.userAgent` for web environments.
180
- *
181
- * The React Native bundler (Metro) resolves `getOperatingSystem.native.ts`
182
- * instead when building for React Native, which uses `Platform.OS` directly.
183
- *
184
- * Falls back to `'unknown'` when `navigator` is unavailable (SSR, service
185
- * workers) or when the user-agent string doesn't match a known OS pattern.
186
- * @not-instrumented
187
- */
188
- const getOperatingSystem = () => {
189
- try {
190
- const ua = navigator.userAgent;
191
- if (/iPhone|iPad|iPod/.test(ua)) return "ios";
192
- if (/Android/.test(ua)) return "android";
193
- if (/Windows/.test(ua)) return "windows";
194
- if (/Macintosh|Mac OS X/.test(ua)) return "macos";
195
- if (/Linux/.test(ua)) return "linux";
196
- return "unknown";
197
- } catch {
198
- return "unknown";
198
+ //#region src/errors/ValueMustBeDefinedError.ts
199
+ var ValueMustBeDefinedError = class extends BaseError {
200
+ constructor(message) {
201
+ super({
202
+ cause: null,
203
+ code: "value_must_be_defined_error",
204
+ docsUrl: null,
205
+ name: "ValueMustBeDefined",
206
+ shortMessage: message
207
+ });
199
208
  }
200
209
  };
201
210
 
202
211
  //#endregion
203
- //#region src/utils/getPlatform/getPlatform.ts
212
+ //#region src/utils/assertDefined/assertDefined.ts
204
213
  /**
205
- * Returns the platform the SDK is running on.
214
+ * Asserts that a value is not null or undefined, throwing an error if it is.
215
+ * This function acts as a type guard, narrowing the type to exclude null and undefined.
206
216
  *
207
- * This is the web implementation the React Native bundler resolves
208
- * `getPlatform.native.ts` instead when building for React Native, which
209
- * returns `'react-native'`.
210
- * @not-instrumented
217
+ * @template T - The type of the value being checked
218
+ * @param value - The value to check for null or undefined
219
+ * @param message - The error message to throw if the value is null or undefined
220
+ * @throws Throws an error with the provided message if value is null or undefined
221
+ * @example
222
+ * ```typescript
223
+ * const maybeString: string | null = getValue();
224
+ * assertDefined(maybeString, 'String value is required');
225
+ * // maybeString is now typed as string (null is excluded)
226
+ * ```
211
227
  */
212
- const getPlatform = () => "web";
228
+ function assertDefined(value, message) {
229
+ if (value === null || value === void 0) throw new ValueMustBeDefinedError(message);
230
+ }
213
231
 
214
232
  //#endregion
215
- //#region src/utils/getUserAgent/getUserAgent.ts
233
+ //#region src/modules/projectSettings/isCookieEnabled/isCookieEnabled.ts
216
234
  /**
217
- * Returns the browser's `navigator.userAgent` string for inclusion in
218
- * instrumentation events.
219
- *
220
- * Falls back to an empty string in environments where `navigator` is not
221
- * available (e.g., Node.js SSR, service workers) so that callers never need
222
- * to guard against undefined.
223
- * @not-instrumented
235
+ * Returns true if the client is using Dynamic cookies or a BYO JWT cookie.
236
+ * @notInstrumented
224
237
  */
225
- const getUserAgent = () => {
226
- try {
227
- return navigator.userAgent;
228
- } catch {
229
- return "";
238
+ const isCookieEnabled = (client) => {
239
+ assertDefined(client.projectSettings, "Project settings are not defined");
240
+ const securitySettings = client.projectSettings.security;
241
+ if (!securitySettings) return false;
242
+ const dynamicCookiesEnabled = (securitySettings.auth?.storage || []).includes(_dynamic_labs_sdk_api_core.AuthStorageEnum.Cookie);
243
+ const byoJwtCookieEnabled = Boolean(securitySettings.externalAuth?.cookieName);
244
+ return dynamicCookiesEnabled || byoJwtCookieEnabled;
245
+ };
246
+
247
+ //#endregion
248
+ //#region src/modules/sessionKeys/getSessionKeys/getSessionKeys.ts
249
+ /** @notInstrumented */
250
+ const getSessionKeys = (client) => {
251
+ const publicKey = getCore(client).state.get().sessionKeys;
252
+ if (!publicKey) return;
253
+ return { publicKey };
254
+ };
255
+
256
+ //#endregion
257
+ //#region src/errors/APIError/APIError.ts
258
+ var APIError = class APIError extends BaseError {
259
+ status;
260
+ constructor(message, code, status) {
261
+ super({
262
+ cause: null,
263
+ code,
264
+ docsUrl: null,
265
+ name: "APIError",
266
+ shortMessage: message
267
+ });
268
+ this.status = status;
269
+ }
270
+ static async fromResponse(response) {
271
+ try {
272
+ const errorBody = await response.clone().json();
273
+ if (errorBody && "error" in errorBody && typeof errorBody.error === "string") {
274
+ const errorCode = "code" in errorBody && typeof errorBody.code === "string" ? errorBody.code : "unknown_error";
275
+ return new APIError(errorBody.error, errorCode, response.status);
276
+ }
277
+ return null;
278
+ } catch {
279
+ return null;
280
+ }
230
281
  }
231
282
  };
232
283
 
233
284
  //#endregion
234
- //#region src/services/instrumentation/constants.ts
285
+ //#region src/errors/InvalidExternalAuthError.ts
286
+ var InvalidExternalAuthError = class extends BaseError {
287
+ constructor({ cause }) {
288
+ super({
289
+ cause,
290
+ code: "invalid_external_auth_error",
291
+ docsUrl: "https://www.dynamic.xyz/docs/external-auth/third-party-auth-overview",
292
+ name: "InvalidExternalAuthError",
293
+ shortMessage: "Error authenticating with external JWT"
294
+ });
295
+ }
296
+ };
297
+
298
+ //#endregion
299
+ //#region src/errors/LinkCredentialError.ts
300
+ var LinkCredentialError = class extends BaseError {
301
+ constructor({ cause }) {
302
+ super({
303
+ cause,
304
+ code: "link_credential_error",
305
+ docsUrl: null,
306
+ name: "LinkCredentialError",
307
+ shortMessage: "The credential you are trying to link is associated with another account and cannot be reassigned."
308
+ });
309
+ }
310
+ };
311
+
312
+ //#endregion
313
+ //#region src/errors/MfaInvalidOtpError.ts
314
+ var MfaInvalidOtpError = class extends BaseError {
315
+ constructor({ cause }) {
316
+ super({
317
+ cause,
318
+ code: "mfa_invalid_otp_error",
319
+ docsUrl: null,
320
+ name: "MfaInvalidOtpError",
321
+ shortMessage: "Invalid OTP"
322
+ });
323
+ }
324
+ };
325
+
326
+ //#endregion
327
+ //#region src/errors/MfaRateLimitedError.ts
328
+ var MfaRateLimitedError = class extends BaseError {
329
+ constructor({ cause }) {
330
+ super({
331
+ cause,
332
+ code: "mfa_rate_limited_error",
333
+ docsUrl: null,
334
+ name: "MfaRateLimitedError",
335
+ shortMessage: "Rate limited"
336
+ });
337
+ }
338
+ };
339
+
340
+ //#endregion
341
+ //#region src/errors/SandboxMaximumThresholdReachedError.ts
342
+ var SandboxMaximumThresholdReachedError = class extends BaseError {
343
+ constructor({ cause }) {
344
+ super({
345
+ cause,
346
+ code: "sandbox_maximum_threshold_reached_error",
347
+ docsUrl: "https://www.dynamic.xyz/docs/developer-dashboard/sandbox-vs-live#sandbox-vs-live",
348
+ name: "SandboxMaximumThresholdReachedError",
349
+ shortMessage: "Your sandbox environment has reached the maximum MAU. Please use a live environment for production traffic."
350
+ });
351
+ }
352
+ };
353
+
354
+ //#endregion
355
+ //#region src/modules/apiClient/utils/clientErrorMapper/clientErrorMapper.ts
235
356
  /**
236
- * Default key-based PII scrubber list, lowercased and matched against the
237
- * lowercased object key.
357
+ * Default error mapper for the client that handles common API error codes.
238
358
  *
239
- * Two complementary mechanisms cover credential leakage:
359
+ * This mapper transforms specific API error codes into more specific error types:
360
+ * - `mfa_invalid_code` → `MfaInvalidOtpError`
361
+ * - `mfa_rate_limited` → `MfaRateLimitedError`
240
362
  *
241
- * 1. Explicit keys listed here matched exactly (case-insensitive). Use this
242
- * for keys that don't end in a generic credential suffix (e.g. `mnemonic`,
243
- * `seed`, `verificationCode`, `keyShare`).
244
- * 2. Suffix matching in {@link scrubParameters} for the credential suffixes
245
- * enumerated by {@link PII_KEY_SUFFIXES} — catches any field whose name
246
- * ends in `token` or `jwt` (e.g. `mfaToken`, `minifiedJwt`, `accessToken`,
247
- * `idToken`, `captchaToken`, …) without needing to enumerate them here.
248
- */
249
- const DEFAULT_PII_FIELDS = [
250
- "password",
251
- "token",
252
- "secret",
253
- "privateKey",
254
- "privateJwk",
255
- "mnemonic",
256
- "seed",
257
- "keyShare",
258
- "keyShares",
259
- "email",
260
- "phone",
261
- "ssn",
262
- "address",
263
- "authorization",
264
- "verificationCode",
265
- "recoveryCodes",
266
- "codeVerifier",
267
- "pkce",
268
- "bearer",
269
- "apiKey"
270
- ];
271
- /**
272
- * Lowercased suffixes used by {@link scrubParameters} to match credential-like
273
- * keys without enumerating every variant (e.g. `mfaToken`, `accessToken`,
274
- * `refreshToken`, `legacyToken`, `minifiedJwt`). Only suffixes that are
275
- * unambiguously credentials belong here — `key` (matches `publicKey`) and
276
- * `code` (matches `countryCode`) are too broad and must not be added.
277
- */
278
- const PII_KEY_SUFFIXES = ["token", "jwt"];
279
- const REDACTED_VALUE = "[REDACTED]";
280
- const MAX_STRING_LENGTH = 500;
281
- const TRUNCATED_SUFFIX = "...[truncated]";
282
- /**
283
- * Label prefix for binary data placeholders. The full placeholder includes the
284
- * byte length, e.g. `[Binary:16 bytes]`, so consumers can gauge data size
285
- * without the actual bytes appearing in logs.
286
- */
287
- const BINARY_LABEL = "Binary";
288
- /**
289
- * Placeholder emitted when a circular reference is detected in the value tree.
290
- * Using a named constant makes it easy to search for or filter in downstream
291
- * log tooling.
292
- */
293
- const CIRCULAR_VALUE = "[Circular]";
294
-
295
- //#endregion
296
- //#region src/services/instrumentation/scrubParameters/scrubParameters.ts
297
- /**
298
- * Returns true when `key` should be redacted based on the configured PII
299
- * field list. A key matches when its lowercased form either equals one of
300
- * `piiFieldsLower` exactly, or ends in one of the curated credential
301
- * suffixes in {@link PII_KEY_SUFFIXES} (currently `token` and `jwt`). The
302
- * suffix check is what catches `mfaToken`, `minifiedJwt`, `accessToken`,
303
- * etc. without needing every variant enumerated explicitly.
304
- */
305
- const keyMatchesPiiField = ({ keyLower, piiFieldsLower }) => {
306
- if (piiFieldsLower.includes(keyLower)) return true;
307
- return PII_KEY_SUFFIXES.some((suffix) => keyLower.endsWith(suffix));
308
- };
309
- const scrubString = ({ key, piiFieldsLower, redactAll, value }) => {
310
- if (keyMatchesPiiField({
311
- keyLower: key.toLowerCase(),
312
- piiFieldsLower
313
- })) return REDACTED_VALUE;
314
- if (redactAll) return REDACTED_VALUE;
315
- if (value.length > MAX_STRING_LENGTH) return value.slice(0, MAX_STRING_LENGTH) + TRUNCATED_SUFFIX;
316
- return value;
317
- };
318
- const scrubArray = ({ context, value }) => {
319
- if (context.visited.has(value)) return [CIRCULAR_VALUE];
320
- context.visited.add(value);
321
- const result = value.map((item, index) => scrubValue({
322
- context,
323
- key: String(index),
324
- value: item
325
- }));
326
- context.visited.delete(value);
327
- return result;
328
- };
329
- const scrubObject = ({ context, value }) => {
330
- if (context.visited.has(value)) return { [CIRCULAR_VALUE]: true };
331
- context.visited.add(value);
332
- const result = Object.create(null);
333
- for (const key of Object.keys(value)) result[key] = scrubValue({
334
- context,
335
- key,
336
- value: value[key]
337
- });
338
- context.visited.delete(value);
339
- return result;
340
- };
341
- const scrubValue = ({ context, key, value }) => {
342
- if (value === null || value === void 0) return value;
343
- if (value instanceof Uint8Array) return `[${BINARY_LABEL}:${value.byteLength} bytes]`;
344
- if (keyMatchesPiiField({
345
- keyLower: key.toLowerCase(),
346
- piiFieldsLower: context.piiFieldsLower
347
- })) return REDACTED_VALUE;
348
- if (typeof value === "string") return scrubString({
349
- key,
350
- piiFieldsLower: context.piiFieldsLower,
351
- redactAll: context.redactAll,
352
- value
353
- });
354
- if (Array.isArray(value)) return scrubArray({
355
- context,
356
- value
357
- });
358
- if (value instanceof Set) {
359
- if (context.visited.has(value)) return [CIRCULAR_VALUE];
360
- context.visited.add(value);
361
- const setResult = scrubArray({
362
- context,
363
- value: [...value]
364
- });
365
- context.visited.delete(value);
366
- return setResult;
367
- }
368
- if (value instanceof Map) {
369
- if (context.visited.has(value)) return { [CIRCULAR_VALUE]: true };
370
- context.visited.add(value);
371
- const asObject = Object.create(null);
372
- for (const [k, v] of value.entries()) asObject[String(k)] = v;
373
- const mapResult = scrubObject({
374
- context,
375
- value: asObject
376
- });
377
- context.visited.delete(value);
378
- return mapResult;
379
- }
380
- if (value instanceof WeakMap) return "[WeakMap]";
381
- if (value instanceof WeakSet) return "[WeakSet]";
382
- if (value instanceof Date) return value.toISOString();
383
- if (value instanceof Error) return `[Error: ${value.message}]`;
384
- if (typeof value === "object") return scrubObject({
385
- context,
386
- value
387
- });
388
- return value;
389
- };
390
- /** @not-instrumented */
391
- const scrubParameters = ({ piiFields, redactAll, value }) => {
392
- return scrubObject({
393
- context: {
394
- piiFieldsLower: piiFields.map((field) => field.toLowerCase()),
395
- redactAll,
396
- visited: /* @__PURE__ */ new WeakSet()
397
- },
398
- value
399
- });
400
- };
401
-
402
- //#endregion
403
- //#region src/services/instrumentation/instrumentFunction/extractParams/extractParams.ts
404
- /**
405
- * Normalises the raw positional arguments of an instrumented function call
406
- * into a flat `Record<string, unknown>` suitable for structured logging.
407
- *
408
- * ## Why this is needed
409
- *
410
- * Instrumented functions are wrapped with `(...args: unknown[])`, so their
411
- * parameters arrive as an array. Logging a raw array loses the semantic names
412
- * of each argument. This function recovers a named representation:
413
- *
414
- * - **No arguments** → `{}`
415
- * - **Single plain-object argument** → that object is returned as-is, because
416
- * SDK functions follow the single-object-parameter convention, so the object
417
- * already carries named keys (`{ amount, to }`, etc.).
418
- * - **Everything else** (multiple args, a single primitive, a single array) →
419
- * each value is indexed as `arg0`, `arg1`, …
420
- *
421
- * ## Why arrays are NOT treated as plain objects
422
- *
423
- * `typeof [] === 'object'` and `[] !== null`, so without the `Array.isArray`
424
- * guard a single-array argument would be returned as-is. That would produce
425
- * an object with numeric string keys (`{ '0': ..., '1': ... }`), which is
426
- * misleading and inconsistent with how multi-arg calls are handled. Instead,
427
- * arrays fall through to the indexed `arg0` path.
428
- * @not-instrumented
429
- */
430
- const extractParams = (args) => {
431
- if (args.length === 0) return {};
432
- if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && !Array.isArray(args[0])) return args[0];
433
- const result = {};
434
- for (let i = 0; i < args.length; i++) result[`arg${i}`] = args[i];
435
- return result;
436
- };
437
-
438
- //#endregion
439
- //#region src/services/instrumentation/instrumentFunction/scrubResolvedValue/scrubResolvedValue.ts
440
- /**
441
- * Scrubs a resolved return value of any type before logging it.
442
- * Routes through `scrubParameters` by wrapping the value so that strings,
443
- * arrays, Dates, Errors, and all other types are handled identically to
444
- * nested object fields.
445
- * @not-instrumented
446
- */
447
- const scrubResolvedValue = ({ piiFields, redactAll, value }) => scrubParameters({
448
- piiFields,
449
- redactAll,
450
- value: { result: value }
451
- }).result;
452
-
453
- //#endregion
454
- //#region src/services/instrumentation/instrumentFunction/instrumentFunction.ts
455
- const serializeError = (error) => {
456
- if (error instanceof Error) return {
457
- message: error.message,
458
- name: error.name,
459
- stack: error.stack
460
- };
461
- return {
462
- message: String(error),
463
- name: "UnknownError"
464
- };
465
- };
466
- /**
467
- * Wraps a function so that each invocation emits a structured
468
- * `FunctionInstrumentationEvent` at three lifecycle points:
469
- *
470
- * - **started** — immediately before the function body executes, with the
471
- * PII-scrubbed call parameters.
472
- * - **resolved** — after the function (or its returned Promise) settles
473
- * successfully, with the PII-scrubbed return value.
474
- * - **rejected** — if the function throws synchronously or its returned
475
- * Promise rejects.
476
- *
477
- * The original return value (or thrown error) is always forwarded to the
478
- * caller unchanged — instrumentation is purely observational.
479
- *
480
- * ## Usage
481
- *
482
- * ```ts
483
- * const transfer = instrumentFunction({
484
- * fn: rawTransfer,
485
- * functionName: 'transfer',
486
- * getCore: () => core,
487
- * });
488
- *
489
- * // When called, three events are emitted automatically:
490
- * await transfer({ amount: 1, to: '0xabc' });
491
- * ```
492
- *
493
- * ## How functions are wrapped
494
- *
495
- * `instrumentFunction` is not called manually in application code. Instead,
496
- * the esbuild instrumentation plugin (`tools/instrumentation-plugin`) injects
497
- * it at build time: any exported function annotated with `@instrumented` in its
498
- * JSDoc is automatically wrapped by the plugin during the build step.
499
- * The plugin strips the original `export`, renames the function, and re-exports
500
- * it under the original name via `instrumentFunction(...)` — so the public API
501
- * is unchanged and no call sites need to be updated.
502
- *
503
- * ## Opting out
504
- *
505
- * Instrumentation is skipped entirely when:
506
- * - `getCore()` returns `undefined` (SDK not initialised), or
507
- * - `core.instrumentation.config.enabled` is `false`.
508
- *
509
- * In both cases the original function is called directly with no overhead.
510
- *
511
- * ## PII scrubbing
512
- *
513
- * All string values whose key appears in `piiFields` are replaced with
514
- * `"[redacted]"` before events are emitted. Pass `redactAll: true` to redact
515
- * every field, regardless of key name.
516
- * @not-instrumented
517
- */
518
- const instrumentFunction = ({ fn, functionName, getCore: getCore$1, redactAll }) => {
519
- const wrapped = (...args) => {
520
- const core = getCore$1();
521
- if (!core) return fn(...args);
522
- if (!core.instrumentation.config.enabled) return fn(...args);
523
- const instrumentation = core.instrumentation;
524
- const state = core.state.get();
525
- const baseEvent = {
526
- environmentId: core.environmentId,
527
- functionName,
528
- operatingSystem: getOperatingSystem(),
529
- parameters: scrubParameters({
530
- piiFields: instrumentation.config.piiFields,
531
- redactAll,
532
- value: extractParams(args)
533
- }),
534
- platform: getPlatform(),
535
- registeredExtensionKeys: Array.from(core.extensions),
536
- sdkSessionId: core.sdkSessionId,
537
- sdkVersion: core.version,
538
- status: "info",
539
- tokenSessionId: state.token ? extractSessionId(state.token) : null,
540
- userAgent: getUserAgent(),
541
- userId: state.user?.id ?? null
542
- };
543
- instrumentation.logFunction({
544
- ...baseEvent,
545
- phase: "started",
546
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
547
- });
548
- try {
549
- const result = fn(...args);
550
- if (result instanceof Promise) return result.then((value) => {
551
- instrumentation.logFunction({
552
- ...baseEvent,
553
- phase: "resolved",
554
- resolvedValue: scrubResolvedValue({
555
- piiFields: instrumentation.config.piiFields,
556
- redactAll,
557
- value
558
- }),
559
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
560
- });
561
- return value;
562
- }).catch((error) => {
563
- instrumentation.logFunction({
564
- ...baseEvent,
565
- phase: "rejected",
566
- rejectedError: serializeError(error),
567
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
568
- });
569
- throw error;
570
- });
571
- instrumentation.logFunction({
572
- ...baseEvent,
573
- phase: "resolved",
574
- resolvedValue: scrubResolvedValue({
575
- piiFields: instrumentation.config.piiFields,
576
- redactAll,
577
- value: result
578
- }),
579
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
580
- });
581
- return result;
582
- } catch (error) {
583
- instrumentation.logFunction({
584
- ...baseEvent,
585
- phase: "rejected",
586
- rejectedError: serializeError(error),
587
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
588
- });
589
- throw error;
590
- }
591
- };
592
- return wrapped;
593
- };
594
-
595
- //#endregion
596
- //#region src/modules/auth/getElevatedAccessToken/getElevatedAccessToken.ts
597
- /**
598
- * Gets an elevated access token by scope.
599
- *
600
- * This function retrieves an elevated access token that contains the specified scope.
601
- * Expired tokens are automatically filtered out.
602
- *
603
- * By default, if the token has `singleUse: true`, it will be automatically
604
- * consumed (removed from state) after retrieval. Pass `consume: false` to
605
- * check for token existence without consuming it.
606
- *
607
- * @param params - The parameters object.
608
- * @param params.scope - The scope to match (e.g., 'wallet:export').
609
- * @param params.consume - Whether to consume single-use tokens (default: true).
610
- * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
611
- * @returns The elevated access token if found and not expired, or undefined if not found or expired.
612
- *
613
- * @example
614
- * ```typescript
615
- * // Retrieve and consume (default)
616
- * const token = getElevatedAccessToken({ scope: 'wallet:export' });
617
- *
618
- * // Check existence without consuming
619
- * const token = getElevatedAccessToken({ scope: 'credential:unlink', consume: false });
620
- * ```
621
- * @not-instrumented
622
- */
623
- const getElevatedAccessToken = ({ consume = true, scope }, client = getDefaultClient()) => {
624
- const core = getCore(client);
625
- const now = /* @__PURE__ */ new Date();
626
- const elevatedAccessTokens = core.state.get().elevatedAccessTokens || [];
627
- const validTokens = elevatedAccessTokens.filter((token$1) => !token$1.expiresAt || token$1.expiresAt > now);
628
- if (validTokens.length !== elevatedAccessTokens.length) core.state.set({ elevatedAccessTokens: validTokens });
629
- const token = validTokens.find((token$1) => token$1.scopes.includes(scope));
630
- if (!token) return;
631
- if (consume && token.singleUse) {
632
- const updatedTokens = validTokens.filter((t) => t !== token);
633
- core.state.set({ elevatedAccessTokens: updatedTokens });
634
- }
635
- return token.token;
636
- };
637
- const __getElevatedAccessToken_impl = getElevatedAccessToken;
638
- const __getElevatedAccessToken_wrapped = instrumentFunction({
639
- fn: __getElevatedAccessToken_impl,
640
- functionName: "getElevatedAccessToken",
641
- getCore: () => {
642
- try {
643
- return getCore(getDefaultClient());
644
- } catch {
645
- return;
646
- }
647
- }
648
- });
649
-
650
- //#endregion
651
- //#region src/errors/ValueMustBeDefinedError.ts
652
- var ValueMustBeDefinedError = class extends BaseError {
653
- constructor(message) {
654
- super({
655
- cause: null,
656
- code: "value_must_be_defined_error",
657
- docsUrl: null,
658
- name: "ValueMustBeDefined",
659
- shortMessage: message
660
- });
661
- }
662
- };
663
-
664
- //#endregion
665
- //#region src/utils/assertDefined/assertDefined.ts
666
- /**
667
- * Asserts that a value is not null or undefined, throwing an error if it is.
668
- * This function acts as a type guard, narrowing the type to exclude null and undefined.
669
- *
670
- * @template T - The type of the value being checked
671
- * @param value - The value to check for null or undefined
672
- * @param message - The error message to throw if the value is null or undefined
673
- * @throws Throws an error with the provided message if value is null or undefined
674
- * @example
675
- * ```typescript
676
- * const maybeString: string | null = getValue();
677
- * assertDefined(maybeString, 'String value is required');
678
- * // maybeString is now typed as string (null is excluded)
679
- * ```
680
- */
681
- function assertDefined(value, message) {
682
- if (value === null || value === void 0) throw new ValueMustBeDefinedError(message);
683
- }
684
-
685
- //#endregion
686
- //#region src/modules/projectSettings/isCookieEnabled/isCookieEnabled.ts
687
- /**
688
- * Returns true if the client is using Dynamic cookies or a BYO JWT cookie.
689
- * @not-instrumented
690
- */
691
- const isCookieEnabled = (client) => {
692
- assertDefined(client.projectSettings, "Project settings are not defined");
693
- const securitySettings = client.projectSettings.security;
694
- if (!securitySettings) return false;
695
- const dynamicCookiesEnabled = (securitySettings.auth?.storage || []).includes(_dynamic_labs_sdk_api_core.AuthStorageEnum.Cookie);
696
- const byoJwtCookieEnabled = Boolean(securitySettings.externalAuth?.cookieName);
697
- return dynamicCookiesEnabled || byoJwtCookieEnabled;
698
- };
699
-
700
- //#endregion
701
- //#region src/modules/sessionKeys/getSessionKeys/getSessionKeys.ts
702
- /** @not-instrumented */
703
- const getSessionKeys = (client) => {
704
- const publicKey = getCore(client).state.get().sessionKeys;
705
- if (!publicKey) return;
706
- return { publicKey };
707
- };
708
-
709
- //#endregion
710
- //#region src/errors/APIError/APIError.ts
711
- var APIError = class APIError extends BaseError {
712
- status;
713
- constructor(message, code, status) {
714
- super({
715
- cause: null,
716
- code,
717
- docsUrl: null,
718
- name: "APIError",
719
- shortMessage: message
720
- });
721
- this.status = status;
722
- }
723
- static async fromResponse(response) {
724
- try {
725
- const errorBody = await response.clone().json();
726
- if (errorBody && "error" in errorBody && typeof errorBody.error === "string") {
727
- const errorCode = "code" in errorBody && typeof errorBody.code === "string" ? errorBody.code : "unknown_error";
728
- return new APIError(errorBody.error, errorCode, response.status);
729
- }
730
- return null;
731
- } catch {
732
- return null;
733
- }
734
- }
735
- };
736
-
737
- //#endregion
738
- //#region src/errors/InvalidExternalAuthError.ts
739
- var InvalidExternalAuthError = class extends BaseError {
740
- constructor({ cause }) {
741
- super({
742
- cause,
743
- code: "invalid_external_auth_error",
744
- docsUrl: "https://www.dynamic.xyz/docs/external-auth/third-party-auth-overview",
745
- name: "InvalidExternalAuthError",
746
- shortMessage: "Error authenticating with external JWT"
747
- });
748
- }
749
- };
750
-
751
- //#endregion
752
- //#region src/errors/LinkCredentialError.ts
753
- var LinkCredentialError = class extends BaseError {
754
- constructor({ cause }) {
755
- super({
756
- cause,
757
- code: "link_credential_error",
758
- docsUrl: null,
759
- name: "LinkCredentialError",
760
- shortMessage: "The credential you are trying to link is associated with another account and cannot be reassigned."
761
- });
762
- }
763
- };
764
-
765
- //#endregion
766
- //#region src/errors/MfaInvalidOtpError.ts
767
- var MfaInvalidOtpError = class extends BaseError {
768
- constructor({ cause }) {
769
- super({
770
- cause,
771
- code: "mfa_invalid_otp_error",
772
- docsUrl: null,
773
- name: "MfaInvalidOtpError",
774
- shortMessage: "Invalid OTP"
775
- });
776
- }
777
- };
778
-
779
- //#endregion
780
- //#region src/errors/MfaRateLimitedError.ts
781
- var MfaRateLimitedError = class extends BaseError {
782
- constructor({ cause }) {
783
- super({
784
- cause,
785
- code: "mfa_rate_limited_error",
786
- docsUrl: null,
787
- name: "MfaRateLimitedError",
788
- shortMessage: "Rate limited"
789
- });
790
- }
791
- };
792
-
793
- //#endregion
794
- //#region src/errors/SandboxMaximumThresholdReachedError.ts
795
- var SandboxMaximumThresholdReachedError = class extends BaseError {
796
- constructor({ cause }) {
797
- super({
798
- cause,
799
- code: "sandbox_maximum_threshold_reached_error",
800
- docsUrl: "https://www.dynamic.xyz/docs/developer-dashboard/sandbox-vs-live#sandbox-vs-live",
801
- name: "SandboxMaximumThresholdReachedError",
802
- shortMessage: "Your sandbox environment has reached the maximum MAU. Please use a live environment for production traffic."
803
- });
804
- }
805
- };
806
-
807
- //#endregion
808
- //#region src/modules/apiClient/utils/clientErrorMapper/clientErrorMapper.ts
809
- /**
810
- * Default error mapper for the client that handles common API error codes.
811
- *
812
- * This mapper transforms specific API error codes into more specific error types:
813
- * - `mfa_invalid_code` → `MfaInvalidOtpError`
814
- * - `mfa_rate_limited` → `MfaRateLimitedError`
815
- *
816
- * @param error - The error to be mapped
817
- * @returns A transformed error if the error code matches a known pattern, or null if no transformation is needed
818
- *
819
- * @example
820
- * ```typescript
821
- * // This will be automatically applied to all API errors
822
- * const apiClient = createApiClient({}, client);
823
- *
824
- * // The clientErrorMapper will automatically convert mfa_invalid_code errors
825
- * // to MfaInvalidOtpError instances
826
- * ```
827
- * @not-instrumented
363
+ * @param error - The error to be mapped
364
+ * @returns A transformed error if the error code matches a known pattern, or null if no transformation is needed
365
+ *
366
+ * @example
367
+ * ```typescript
368
+ * // This will be automatically applied to all API errors
369
+ * const apiClient = createApiClient({}, client);
370
+ *
371
+ * // The clientErrorMapper will automatically convert mfa_invalid_code errors
372
+ * // to MfaInvalidOtpError instances
373
+ * ```
374
+ * @notInstrumented
828
375
  */
829
376
  const clientErrorMapper = (error) => {
830
377
  if (error instanceof APIError) {
@@ -845,7 +392,7 @@ const clientErrorMapper = (error) => {
845
392
  *
846
393
  * @param options.errorMappers - Array of error mappers to apply to API errors
847
394
  * @returns A middleware function that handles error conversion and mapping
848
- * @not-instrumented
395
+ * @notInstrumented
849
396
  */
850
397
  const createConvertToApiErrorMiddleware = ({ errorMappers = [] }) => ({ post: async (context) => {
851
398
  if (context.response.status >= 400) {
@@ -873,7 +420,7 @@ const createConvertToApiErrorMiddleware = ({ errorMappers = [] }) => ({ post: as
873
420
  * Pops the first nonce from the prefetched pool. When the pool is running low
874
421
  * (≤1 remaining after pop) a background refetch is triggered. If the pool is
875
422
  * empty, nonces are fetched on-demand before returning.
876
- * @not-instrumented
423
+ * @notInstrumented
877
424
  */
878
425
  const getNonce = async (client) => {
879
426
  const core = getCore(client);
@@ -890,7 +437,7 @@ const getNonce = async (client) => {
890
437
 
891
438
  //#endregion
892
439
  //#region src/modules/deviceRegistration/getDeviceSigner/getDeviceSigner.ts
893
- /** @not-instrumented */
440
+ /** @notInstrumented */
894
441
  const getDeviceSigner = async (client) => {
895
442
  const { deviceSigner, keychain } = getCore(client);
896
443
  /**
@@ -908,7 +455,7 @@ const getDeviceSigner = async (client) => {
908
455
 
909
456
  //#endregion
910
457
  //#region src/modules/deviceRegistration/getHeadersForNonceSignedByDeviceSigners/getHeadersForNonceSignedByDeviceSigners.ts
911
- /** @not-instrumented */
458
+ /** @notInstrumented */
912
459
  const getHeadersForNonceSignedByDeviceSigners = async (client) => {
913
460
  const { projectSettings } = client;
914
461
  assertDefined(projectSettings, "Project settings not found");
@@ -931,7 +478,7 @@ const getHeadersForNonceSignedByDeviceSigners = async (client) => {
931
478
 
932
479
  //#endregion
933
480
  //#region src/modules/apiClient/utils/deviceSignatureHeadersMiddleware/createDeviceSignatureHeadersMiddleware.ts
934
- /** @not-instrumented */
481
+ /** @notInstrumented */
935
482
  const createDeviceSignatureHeadersMiddleware = (client) => {
936
483
  return { pre: async (context) => {
937
484
  /**
@@ -969,7 +516,7 @@ var UnauthorizedError = class extends BaseError {
969
516
 
970
517
  //#endregion
971
518
  //#region src/modules/apiClient/utils/unauthorizedMiddleware/createUnauthorizedMiddleware.ts
972
- /** @not-instrumented */
519
+ /** @notInstrumented */
973
520
  const createUnauthorizedMiddleware = () => ({ post: async (context) => {
974
521
  if (context.response.status === 401) {
975
522
  let cause = null;
@@ -988,7 +535,7 @@ const createUnauthorizedMiddleware = () => ({ post: async (context) => {
988
535
  * Returns a new instance of the SDK API client.
989
536
  *
990
537
  * This is not meant for storing, as it is very light we can create it whenever needed.
991
- * @not-instrumented
538
+ * @notInstrumented
992
539
  */
993
540
  const createApiClient = (options = {}, client) => {
994
541
  const core = getCore(client);
@@ -1010,7 +557,7 @@ const createApiClient = (options = {}, client) => {
1010
557
  if (client.projectSettings && isCookieEnabled(client)) settings.credentials = "include";
1011
558
  if (options.includeMfaToken && coreState.mfaToken) settings.headers[MFA_TOKEN_HEADER] = coreState.mfaToken;
1012
559
  if (options.elevatedAccessTokenScope) {
1013
- const elevatedToken = __getElevatedAccessToken_wrapped({ scope: options.elevatedAccessTokenScope }, client);
560
+ const elevatedToken = getElevatedAccessToken({ scope: options.elevatedAccessTokenScope }, client);
1014
561
  if (elevatedToken) settings.headers[ELEVATED_ACCESS_TOKEN_HEADER] = elevatedToken;
1015
562
  }
1016
563
  const sessionPublicKey = getSessionKeys(client)?.publicKey;
@@ -1045,7 +592,7 @@ const createApiClient = (options = {}, client) => {
1045
592
  * Concurrent refills are coalesced behind a single in-flight promise so that
1046
593
  * simultaneous callers share one `GET /nonces` round-trip instead of each
1047
594
  * issuing their own (which would inflate the pool and hammer the backend).
1048
- * @not-instrumented
595
+ * @notInstrumented
1049
596
  */
1050
597
  const fetchAndStoreNonces = async (client) => {
1051
598
  const core = getCore(client);
@@ -1074,7 +621,7 @@ const fetchAndStoreNonces = async (client) => {
1074
621
  //#region src/utils/setCookie/setCookie.ts
1075
622
  /**
1076
623
  * Sefelly sets the cookie in the browser.
1077
- * @not-instrumented
624
+ * @notInstrumented
1078
625
  */
1079
626
  const setCookie = (cookie) => {
1080
627
  document.cookie = cookie;
@@ -1092,7 +639,7 @@ const setCookie = (cookie) => {
1092
639
  * @param params.listener - The callback function to execute when the event is fired.
1093
640
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1094
641
  * @returns A function that can be called to remove the listener.
1095
- * @not-instrumented
642
+ * @notInstrumented
1096
643
  * @hook Event listeners are error-prone to wire up by hand with useEffect.
1097
644
  */
1098
645
  const onEvent = ({ event, listener }, client = getDefaultClient()) => {
@@ -1111,7 +658,7 @@ const onEvent = ({ event, listener }, client = getDefaultClient()) => {
1111
658
  * @param params.event - The event name to remove the listener from.
1112
659
  * @param params.listener - The callback function to remove.
1113
660
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1114
- * @not-instrumented
661
+ * @notInstrumented
1115
662
  */
1116
663
  const offEvent = ({ event, listener }, client = getDefaultClient()) => {
1117
664
  const { eventEmitter } = getCore(client);
@@ -1127,7 +674,7 @@ const offEvent = ({ event, listener }, client = getDefaultClient()) => {
1127
674
  * @param params.listener - The callback function to execute when the event is fired.
1128
675
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1129
676
  * @returns A function that can be called to remove the listener before it fires.
1130
- * @not-instrumented
677
+ * @notInstrumented
1131
678
  * @hook Event listeners are error-prone to wire up by hand with useEffect.
1132
679
  */
1133
680
  const onceEvent = ({ event, listener }, client = getDefaultClient()) => {
@@ -1146,7 +693,7 @@ const onceEvent = ({ event, listener }, client = getDefaultClient()) => {
1146
693
  * @param params.event - The event name to emit.
1147
694
  * @param params.args - The arguments to pass to event listeners.
1148
695
  * @param client - The Dynamic client instance.
1149
- * @not-instrumented
696
+ * @notInstrumented
1150
697
  */
1151
698
  const emitEvent = ({ event, args }, client) => {
1152
699
  const { eventEmitter } = getCore(client);
@@ -1169,7 +716,7 @@ var InvalidWalletProviderKeyError = class extends BaseError {
1169
716
 
1170
717
  //#endregion
1171
718
  //#region src/modules/wallets/walletProvider/splitWalletProviderKey/splitWalletProviderKey.ts
1172
- /** @not-instrumented */
719
+ /** @notInstrumented */
1173
720
  const splitWalletProviderKey = (walletProviderKey) => {
1174
721
  const [normalizedWalletNameWithChain, walletProviderType, suffix, ...rest] = walletProviderKey.split(":");
1175
722
  if (!normalizedWalletNameWithChain || !Object.values(_dynamic_labs_sdk_api_core.WalletProviderEnum).includes(walletProviderType) || rest.length > 0) throw new InvalidWalletProviderKeyError(walletProviderKey);
@@ -1182,7 +729,7 @@ const splitWalletProviderKey = (walletProviderKey) => {
1182
729
 
1183
730
  //#endregion
1184
731
  //#region src/modules/wallets/utils/normalizeAddress/normalizeAddress.ts
1185
- /** @not-instrumented */
732
+ /** @notInstrumented */
1186
733
  const normalizeAddress = ({ address, chain }) => {
1187
734
  let normalizedAddress = address;
1188
735
  if (normalizedAddress?.startsWith("0x")) normalizedAddress = normalizedAddress.slice(2);
@@ -1192,7 +739,7 @@ const normalizeAddress = ({ address, chain }) => {
1192
739
 
1193
740
  //#endregion
1194
741
  //#region src/modules/wallets/utils/formatWalletAccountId/formatWalletAccountId.ts
1195
- /** @not-instrumented */
742
+ /** @notInstrumented */
1196
743
  const formatWalletAccountId = ({ address, chain, walletProviderKey }) => {
1197
744
  const { normalizedWalletNameWithChain } = splitWalletProviderKey(walletProviderKey);
1198
745
  return `${normalizedWalletNameWithChain}:${normalizeAddress({
@@ -1203,7 +750,7 @@ const formatWalletAccountId = ({ address, chain, walletProviderKey }) => {
1203
750
 
1204
751
  //#endregion
1205
752
  //#region src/modules/wallets/utils/convertUnverifiedWalletAccountToWalletAccount/convertUnverifiedWalletAccountToWalletAccount.ts
1206
- /** @not-instrumented */
753
+ /** @notInstrumented */
1207
754
  const convertUnverifiedWalletAccountToWalletAccount = ({ unverifiedWalletAccount }) => ({
1208
755
  address: unverifiedWalletAccount.address,
1209
756
  addressesWithTypes: unverifiedWalletAccount.addressesWithTypes,
@@ -1314,7 +861,7 @@ const CHAINS_INFO_MAP = {
1314
861
 
1315
862
  //#endregion
1316
863
  //#region src/utils/getChainFromVerifiedCredentialChain/getChainFromVerifiedCredentialChain.ts
1317
- /** @not-instrumented */
864
+ /** @notInstrumented */
1318
865
  const getChainFromVerifiedCredentialChain = (verifiedCredentialChain) => {
1319
866
  const chain = Object.keys(CHAINS_INFO_MAP).find((chain$1) => CHAINS_INFO_MAP[chain$1].verifiedCredentialChainName === verifiedCredentialChain);
1320
867
  assertDefined(chain, `Unknown chain: ${verifiedCredentialChain}`);
@@ -1326,7 +873,7 @@ const getChainFromVerifiedCredentialChain = (verifiedCredentialChain) => {
1326
873
  /**
1327
874
  * Format the raw wallet name and chain to get the value we can use for
1328
875
  * verified credentials' `walletName` field.
1329
- * @not-instrumented
876
+ * @notInstrumented
1330
877
  */
1331
878
  const normalizeWalletNameWithChain = ({ displayName, chain }) => {
1332
879
  const sanitizedWalletName = displayName.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
@@ -1346,7 +893,7 @@ const normalizeWalletNameWithChain = ({ displayName, chain }) => {
1346
893
  * IMPORTANT: Do NOT add a suffix unless absolutely necessary, as it will cause the wallet account
1347
894
  * to not be able to find its wallet provider when connecting to a new device (it won't be possible
1348
895
  * to determine the full key just from the Verified Credential data).
1349
- * @not-instrumented
896
+ * @notInstrumented
1350
897
  */
1351
898
  const formatWalletProviderKey = ({ suffix, chain, displayName, walletProviderType }) => {
1352
899
  return `${normalizeWalletNameWithChain({
@@ -1357,7 +904,7 @@ const formatWalletProviderKey = ({ suffix, chain, displayName, walletProviderTyp
1357
904
 
1358
905
  //#endregion
1359
906
  //#region src/modules/wallets/walletProvider/walletProviderKeyMap/getWalletProviderKeyFromVerifiedCredential/getWalletProviderKeyFromVerifiedCredential.ts
1360
- /** @not-instrumented */
907
+ /** @notInstrumented */
1361
908
  const getWalletProviderKeyFromVerifiedCredential = ({ verifiedCredential }, client) => {
1362
909
  const { walletProviderKeyMap } = getCore(client).state.get();
1363
910
  const storedWalletProviderKey = walletProviderKeyMap[verifiedCredential.id];
@@ -1383,7 +930,7 @@ const getWalletProviderKeyFromVerifiedCredential = ({ verifiedCredential }, clie
1383
930
 
1384
931
  //#endregion
1385
932
  //#region src/modules/wallets/utils/convertVerifiedCredentialToWalletAccount/convertVerifiedCredentialToWalletAccount.ts
1386
- /** @not-instrumented */
933
+ /** @notInstrumented */
1387
934
  const convertVerifiedCredentialToWalletAccount = ({ verifiedCredential }, client) => {
1388
935
  assertDefined(verifiedCredential.address, "Missing address in verified credential");
1389
936
  assertDefined(verifiedCredential.chain, "Missing chain in verified credential");
@@ -1408,7 +955,7 @@ const convertVerifiedCredentialToWalletAccount = ({ verifiedCredential }, client
1408
955
 
1409
956
  //#endregion
1410
957
  //#region src/modules/wallets/getWalletAccounts/getWalletAccountsFromState/getWalletAccountsFromState.ts
1411
- /** @not-instrumented */
958
+ /** @notInstrumented */
1412
959
  const getWalletAccountsFromState = ({ unverifiedWalletAccounts, user }, client) => {
1413
960
  const walletAccountsMap = /* @__PURE__ */ new Map();
1414
961
  /**
@@ -1439,187 +986,630 @@ const getWalletAccountsFromState = ({ unverifiedWalletAccounts, user }, client)
1439
986
  };
1440
987
 
1441
988
  //#endregion
1442
- //#region src/modules/wallets/getWalletAccounts/getWalletAccounts.ts
989
+ //#region src/modules/wallets/getWalletAccounts/getWalletAccounts.ts
990
+ /**
991
+ * Retrieves all wallet accounts associated with the current session.
992
+ *
993
+ * This function returns both verified and unverified wallet accounts,
994
+ * combining data from user credentials and local unverified accounts.
995
+ * You can differentiate between verified and unverified wallet accounts by
996
+ * checking the `verifiedCredentialId` property.
997
+ *
998
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
999
+ * @returns An array of wallet accounts associated with the session.
1000
+ * @notInstrumented
1001
+ * @hook Exposed as a hook so consumers get the reactive list of wallet accounts.
1002
+ */
1003
+ const getWalletAccounts = (client = getDefaultClient()) => {
1004
+ const { unverifiedWalletAccounts, user } = getCore(client).state.get();
1005
+ return getWalletAccountsFromState({
1006
+ unverifiedWalletAccounts,
1007
+ user
1008
+ }, client);
1009
+ };
1010
+
1011
+ //#endregion
1012
+ //#region src/errors/NoWalletProviderFoundError.ts
1013
+ var NoWalletProviderFoundError = class extends BaseError {
1014
+ constructor({ walletProviderKey }) {
1015
+ super({
1016
+ cause: null,
1017
+ code: "no_wallet_provider_found_error",
1018
+ docsUrl: null,
1019
+ name: "NoWalletProviderFoundError",
1020
+ shortMessage: `No wallet provider found with key: ${walletProviderKey}`
1021
+ });
1022
+ }
1023
+ };
1024
+
1025
+ //#endregion
1026
+ //#region src/services/runtimeServices/createRuntimeServiceAccessKey/createRuntimeServiceAccessKey.ts
1027
+ /**
1028
+ * Creates a service accessor function that manages service instantiation and caching.
1029
+ * The returned function will either retrieve an existing service from the registry or
1030
+ * create a new one using the provided builder function.
1031
+ *
1032
+ * @template - The type of service to be created/accessed
1033
+ * @param key - Unique identifier for the service in the registry
1034
+ * @param builder - Function that creates the service instance when called with a DynamicClient
1035
+ * @notInstrumented
1036
+ */
1037
+ const createRuntimeServiceAccessKey = (key, builder) => (client) => {
1038
+ const { runtimeServices } = getCore(client);
1039
+ const currentService = runtimeServices.getByKey(key);
1040
+ if (currentService) return currentService;
1041
+ const service = builder(client);
1042
+ runtimeServices.register(key, service);
1043
+ return service;
1044
+ };
1045
+
1046
+ //#endregion
1047
+ //#region src/modules/wallets/walletProviderRegistry/createWalletProviderRegistry/createWalletProviderRegistry.ts
1048
+ /**
1049
+ * Creates a new wallet provider registry that manages wallet providers with priority-based registration.
1050
+ *
1051
+ * @returns The wallet provider registry instance
1052
+ *
1053
+ * @example
1054
+ * ```typescript
1055
+ * const registry = createWalletProviderRegistry();
1056
+ *
1057
+ * registry.register({
1058
+ * priority: WalletProviderPriority.WALLET_SDK,
1059
+ * walletProvider: myWalletProvider
1060
+ * });
1061
+ *
1062
+ * const provider = registry.getByKey('my-wallet-key');
1063
+ * const providers = registry.listProviders();
1064
+ * ```
1065
+ * @notInstrumented
1066
+ */
1067
+ const createWalletProviderRegistry = (client) => {
1068
+ const registry = /* @__PURE__ */ new Map();
1069
+ return {
1070
+ getByKey: (key) => registry.get(key)?.walletProvider,
1071
+ listProviderEntries: () => Array.from(registry.values()),
1072
+ listProviders: () => Array.from(registry.values()).map((v) => v.walletProvider),
1073
+ register: (args) => {
1074
+ const existingEntry = registry.get(args.walletProvider.key);
1075
+ if (existingEntry) {
1076
+ if (existingEntry.priority < args.priority) {
1077
+ registry.set(args.walletProvider.key, args);
1078
+ emitEvent({
1079
+ args: { walletProviderKey: args.walletProvider.key },
1080
+ event: "walletProviderChanged"
1081
+ }, client);
1082
+ }
1083
+ } else {
1084
+ registry.set(args.walletProvider.key, args);
1085
+ emitEvent({
1086
+ args: { walletProvider: args.walletProvider },
1087
+ event: "walletProviderRegistered"
1088
+ }, client);
1089
+ emitEvent({
1090
+ args: { walletProviderKey: args.walletProvider.key },
1091
+ event: "walletProviderChanged"
1092
+ }, client);
1093
+ }
1094
+ },
1095
+ unregister: (key) => {
1096
+ registry.delete(key);
1097
+ emitEvent({
1098
+ args: { walletProviderKey: key },
1099
+ event: "walletProviderUnregistered"
1100
+ }, client);
1101
+ }
1102
+ };
1103
+ };
1104
+
1105
+ //#endregion
1106
+ //#region src/modules/wallets/walletProviderRegistry/getWalletProviderRegistry/getWalletProviderRegistry.ts
1107
+ /**
1108
+ * This function provides access to a shared instance of the wallet provider registry.
1109
+ *
1110
+ * It ensures that the same registry instance is used throughout the client to maintaining
1111
+ * consistency of registered wallet providers across different parts of the codebase.
1112
+ *
1113
+ * @returns The wallet provider registry instance
1114
+ *
1115
+ * @example
1116
+ * ```typescript
1117
+ * // Get the registry instance
1118
+ * const registry = getWalletProviderRegistry();
1119
+ *
1120
+ * // Register a wallet provider
1121
+ * registry.register({
1122
+ * priority: WalletProviderPriority.WALLET_SDK,
1123
+ * walletProvider: myWalletProvider
1124
+ * });
1125
+ *
1126
+ * // Retrieve a specific provider
1127
+ * const provider = registry.getByKey('metamaskevm');
1128
+ * ```
1129
+ */
1130
+ const getWalletProviderRegistry = createRuntimeServiceAccessKey("walletProviderRegistry", (client) => createWalletProviderRegistry(client));
1131
+
1132
+ //#endregion
1133
+ //#region src/modules/wallets/walletProviderRegistry/walletProviderRegistry.types.ts
1134
+ let WalletProviderPriority = /* @__PURE__ */ function(WalletProviderPriority$1) {
1135
+ /**
1136
+ * Highest priority should be used by wallet providers that implement
1137
+ * the most reliable wallet integration.
1138
+ * example: The SDK provided by the wallet provider.
1139
+ */
1140
+ WalletProviderPriority$1[WalletProviderPriority$1["WALLET_SDK"] = 100] = "WALLET_SDK";
1141
+ /**
1142
+ * Medium priority should be used by wallet providers that implement
1143
+ * a wallet integration via some reliable standard.
1144
+ * example: A wallet provider that uses EIP6963 announcement.
1145
+ */
1146
+ WalletProviderPriority$1[WalletProviderPriority$1["WALLET_SELF_ANNOUNCEMENT_STANDARD"] = 50] = "WALLET_SELF_ANNOUNCEMENT_STANDARD";
1147
+ /**
1148
+ * Low priority should be used by wallet providers that implement
1149
+ * a wallet integration on a less reliable standard.
1150
+ * example: A wallet provider that uses window.ethereum, where the
1151
+ * window key can be overridden by other extensions.
1152
+ */
1153
+ WalletProviderPriority$1[WalletProviderPriority$1["WINDOW_INJECT"] = 20] = "WINDOW_INJECT";
1154
+ return WalletProviderPriority$1;
1155
+ }({});
1156
+
1157
+ //#endregion
1158
+ //#region src/modules/wallets/utils/getWalletProviderFromWalletAccount/getWalletProviderFromWalletAccount.ts
1159
+ /** @notInstrumented */
1160
+ const getWalletProviderFromWalletAccount = ({ walletAccount }, client) => {
1161
+ const walletProvider = getWalletProviderRegistry(client).getByKey(walletAccount.walletProviderKey);
1162
+ if (!walletProvider) throw new NoWalletProviderFoundError({ walletProviderKey: walletAccount.walletProviderKey });
1163
+ return walletProvider;
1164
+ };
1165
+
1166
+ //#endregion
1167
+ //#region src/modules/auth/consts.ts
1168
+ const DYNAMIC_AUTH_COOKIE_NAME = "DYNAMIC_JWT_TOKEN";
1169
+
1170
+ //#endregion
1171
+ //#region src/modules/auth/extractSessionId/extractSessionId.ts
1172
+ /**
1173
+ * Extracts the session ID (`sid` claim) from a JWT token string.
1174
+ *
1175
+ * Decodes the base64url-encoded payload segment of the token and reads the
1176
+ * `sid` field. This is used to correlate instrumentation events with the
1177
+ * authenticated session, without ever forwarding the full token.
1178
+ *
1179
+ * Returns `null` when no token is present, when the token is malformed, or
1180
+ * when the payload does not contain a `sid` claim.
1181
+ * @notInstrumented
1182
+ */
1183
+ const extractSessionId = (token) => {
1184
+ try {
1185
+ const payload = token.split(".")[1];
1186
+ return JSON.parse(atob(payload)).sid ?? null;
1187
+ } catch {
1188
+ return null;
1189
+ }
1190
+ };
1191
+
1192
+ //#endregion
1193
+ //#region src/utils/getOperatingSystem/getOperatingSystem.ts
1194
+ /**
1195
+ * Detects the operating system from `navigator.userAgent` for web environments.
1196
+ *
1197
+ * The React Native bundler (Metro) resolves `getOperatingSystem.native.ts`
1198
+ * instead when building for React Native, which uses `Platform.OS` directly.
1199
+ *
1200
+ * Falls back to `'unknown'` when `navigator` is unavailable (SSR, service
1201
+ * workers) or when the user-agent string doesn't match a known OS pattern.
1202
+ * @notInstrumented
1203
+ */
1204
+ const getOperatingSystem = () => {
1205
+ try {
1206
+ const ua = navigator.userAgent;
1207
+ if (/iPhone|iPad|iPod/.test(ua)) return "ios";
1208
+ if (/Android/.test(ua)) return "android";
1209
+ if (/Windows/.test(ua)) return "windows";
1210
+ if (/Macintosh|Mac OS X/.test(ua)) return "macos";
1211
+ if (/Linux/.test(ua)) return "linux";
1212
+ return "unknown";
1213
+ } catch {
1214
+ return "unknown";
1215
+ }
1216
+ };
1217
+
1218
+ //#endregion
1219
+ //#region src/utils/getPlatform/getPlatform.ts
1443
1220
  /**
1444
- * Retrieves all wallet accounts associated with the current session.
1221
+ * Returns the platform the SDK is running on.
1445
1222
  *
1446
- * This function returns both verified and unverified wallet accounts,
1447
- * combining data from user credentials and local unverified accounts.
1448
- * You can differentiate between verified and unverified wallet accounts by
1449
- * checking the `verifiedCredentialId` property.
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
+ //#endregion
1231
+ //#region src/utils/getUserAgent/getUserAgent.ts
1232
+ /**
1233
+ * Returns the browser's `navigator.userAgent` string for inclusion in
1234
+ * instrumentation events.
1450
1235
  *
1451
- * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1452
- * @returns An array of wallet accounts associated with the session.
1453
- * @not-instrumented
1454
- * @hook Exposed as a hook so consumers get the reactive list of wallet accounts.
1236
+ * Falls back to an empty string in environments where `navigator` is not
1237
+ * available (e.g., Node.js SSR, service workers) so that callers never need
1238
+ * to guard against undefined.
1239
+ * @notInstrumented
1455
1240
  */
1456
- const getWalletAccounts = (client = getDefaultClient()) => {
1457
- const { unverifiedWalletAccounts, user } = getCore(client).state.get();
1458
- return getWalletAccountsFromState({
1459
- unverifiedWalletAccounts,
1460
- user
1461
- }, client);
1241
+ const getUserAgent = () => {
1242
+ try {
1243
+ return navigator.userAgent;
1244
+ } catch {
1245
+ return "";
1246
+ }
1462
1247
  };
1463
1248
 
1464
1249
  //#endregion
1465
- //#region src/errors/NoWalletProviderFoundError.ts
1466
- var NoWalletProviderFoundError = class extends BaseError {
1467
- constructor({ walletProviderKey }) {
1468
- super({
1469
- cause: null,
1470
- code: "no_wallet_provider_found_error",
1471
- docsUrl: null,
1472
- name: "NoWalletProviderFoundError",
1473
- shortMessage: `No wallet provider found with key: ${walletProviderKey}`
1250
+ //#region src/services/instrumentation/constants.ts
1251
+ /**
1252
+ * Default key-based PII scrubber list, lowercased and matched against the
1253
+ * lowercased object key.
1254
+ *
1255
+ * Two complementary mechanisms cover credential leakage:
1256
+ *
1257
+ * 1. Explicit keys listed here — matched exactly (case-insensitive). Use this
1258
+ * for keys that don't end in a generic credential suffix (e.g. `mnemonic`,
1259
+ * `seed`, `verificationCode`, `keyShare`).
1260
+ * 2. Suffix matching in {@link scrubParameters} for the credential suffixes
1261
+ * enumerated by {@link PII_KEY_SUFFIXES} — catches any field whose name
1262
+ * ends in `token` or `jwt` (e.g. `mfaToken`, `minifiedJwt`, `accessToken`,
1263
+ * `idToken`, `captchaToken`, …) without needing to enumerate them here.
1264
+ */
1265
+ const DEFAULT_PII_FIELDS = [
1266
+ "password",
1267
+ "token",
1268
+ "secret",
1269
+ "privateKey",
1270
+ "privateJwk",
1271
+ "mnemonic",
1272
+ "seed",
1273
+ "keyShare",
1274
+ "keyShares",
1275
+ "email",
1276
+ "phone",
1277
+ "ssn",
1278
+ "address",
1279
+ "authorization",
1280
+ "verificationCode",
1281
+ "recoveryCodes",
1282
+ "codeVerifier",
1283
+ "pkce",
1284
+ "bearer",
1285
+ "apiKey",
1286
+ "alias",
1287
+ "publicIdentifier"
1288
+ ];
1289
+ /**
1290
+ * Lowercased suffixes used by {@link scrubParameters} to match credential-like
1291
+ * keys without enumerating every variant (e.g. `mfaToken`, `accessToken`,
1292
+ * `refreshToken`, `legacyToken`, `minifiedJwt`). Only suffixes that are
1293
+ * unambiguously credentials belong here — `key` (matches `publicKey`) and
1294
+ * `code` (matches `countryCode`) are too broad and must not be added.
1295
+ */
1296
+ const PII_KEY_SUFFIXES = ["token", "jwt"];
1297
+ const REDACTED_VALUE = "[REDACTED]";
1298
+ const MAX_STRING_LENGTH = 500;
1299
+ const TRUNCATED_SUFFIX = "...[truncated]";
1300
+ /**
1301
+ * Label prefix for binary data placeholders. The full placeholder includes the
1302
+ * byte length, e.g. `[Binary:16 bytes]`, so consumers can gauge data size
1303
+ * without the actual bytes appearing in logs.
1304
+ */
1305
+ const BINARY_LABEL = "Binary";
1306
+ /**
1307
+ * Placeholder emitted when a circular reference is detected in the value tree.
1308
+ * Using a named constant makes it easy to search for or filter in downstream
1309
+ * log tooling.
1310
+ */
1311
+ const CIRCULAR_VALUE = "[Circular]";
1312
+
1313
+ //#endregion
1314
+ //#region src/services/instrumentation/scrubParameters/scrubParameters.ts
1315
+ /**
1316
+ * Returns true when `key` should be redacted based on the configured PII
1317
+ * field list. A key matches when its lowercased form either equals one of
1318
+ * `piiFieldsLower` exactly, or ends in one of the curated credential
1319
+ * suffixes in {@link PII_KEY_SUFFIXES} (currently `token` and `jwt`). The
1320
+ * suffix check is what catches `mfaToken`, `minifiedJwt`, `accessToken`,
1321
+ * etc. without needing every variant enumerated explicitly.
1322
+ */
1323
+ const keyMatchesPiiField = ({ keyLower, piiFieldsLower }) => {
1324
+ if (piiFieldsLower.includes(keyLower)) return true;
1325
+ return PII_KEY_SUFFIXES.some((suffix) => keyLower.endsWith(suffix));
1326
+ };
1327
+ const scrubString = ({ key, piiFieldsLower, redactAll, value }) => {
1328
+ if (keyMatchesPiiField({
1329
+ keyLower: key.toLowerCase(),
1330
+ piiFieldsLower
1331
+ })) return REDACTED_VALUE;
1332
+ if (redactAll) return REDACTED_VALUE;
1333
+ if (value.length > MAX_STRING_LENGTH) return value.slice(0, MAX_STRING_LENGTH) + TRUNCATED_SUFFIX;
1334
+ return value;
1335
+ };
1336
+ const scrubArray = ({ context, value }) => {
1337
+ if (context.visited.has(value)) return [CIRCULAR_VALUE];
1338
+ context.visited.add(value);
1339
+ const result = value.map((item, index) => scrubValue({
1340
+ context,
1341
+ key: String(index),
1342
+ value: item
1343
+ }));
1344
+ context.visited.delete(value);
1345
+ return result;
1346
+ };
1347
+ const scrubObject = ({ context, value }) => {
1348
+ if (context.visited.has(value)) return { [CIRCULAR_VALUE]: true };
1349
+ context.visited.add(value);
1350
+ const result = Object.create(null);
1351
+ for (const key of Object.keys(value)) result[key] = scrubValue({
1352
+ context,
1353
+ key,
1354
+ value: value[key]
1355
+ });
1356
+ context.visited.delete(value);
1357
+ return result;
1358
+ };
1359
+ const scrubValue = ({ context, key, value }) => {
1360
+ if (value === null || value === void 0) return value;
1361
+ if (value instanceof Uint8Array) return `[${BINARY_LABEL}:${value.byteLength} bytes]`;
1362
+ if (keyMatchesPiiField({
1363
+ keyLower: key.toLowerCase(),
1364
+ piiFieldsLower: context.piiFieldsLower
1365
+ })) return REDACTED_VALUE;
1366
+ if (typeof value === "string") return scrubString({
1367
+ key,
1368
+ piiFieldsLower: context.piiFieldsLower,
1369
+ redactAll: context.redactAll,
1370
+ value
1371
+ });
1372
+ if (Array.isArray(value)) return scrubArray({
1373
+ context,
1374
+ value
1375
+ });
1376
+ if (value instanceof Set) {
1377
+ if (context.visited.has(value)) return [CIRCULAR_VALUE];
1378
+ context.visited.add(value);
1379
+ const setResult = scrubArray({
1380
+ context,
1381
+ value: [...value]
1382
+ });
1383
+ context.visited.delete(value);
1384
+ return setResult;
1385
+ }
1386
+ if (value instanceof Map) {
1387
+ if (context.visited.has(value)) return { [CIRCULAR_VALUE]: true };
1388
+ context.visited.add(value);
1389
+ const asObject = Object.create(null);
1390
+ for (const [k, v] of value.entries()) asObject[String(k)] = v;
1391
+ const mapResult = scrubObject({
1392
+ context,
1393
+ value: asObject
1474
1394
  });
1395
+ context.visited.delete(value);
1396
+ return mapResult;
1475
1397
  }
1398
+ if (value instanceof WeakMap) return "[WeakMap]";
1399
+ if (value instanceof WeakSet) return "[WeakSet]";
1400
+ if (value instanceof Date) return value.toISOString();
1401
+ if (value instanceof Error) return `[Error: ${value.message}]`;
1402
+ if (typeof value === "object") return scrubObject({
1403
+ context,
1404
+ value
1405
+ });
1406
+ return value;
1407
+ };
1408
+ /** @notInstrumented */
1409
+ const scrubParameters = ({ piiFields, redactAll, value }) => {
1410
+ return scrubObject({
1411
+ context: {
1412
+ piiFieldsLower: piiFields.map((field) => field.toLowerCase()),
1413
+ redactAll,
1414
+ visited: /* @__PURE__ */ new WeakSet()
1415
+ },
1416
+ value
1417
+ });
1476
1418
  };
1477
1419
 
1478
1420
  //#endregion
1479
- //#region src/services/runtimeServices/createRuntimeServiceAccessKey/createRuntimeServiceAccessKey.ts
1421
+ //#region src/services/instrumentation/instrumentFunction/extractParams/extractParams.ts
1480
1422
  /**
1481
- * Creates a service accessor function that manages service instantiation and caching.
1482
- * The returned function will either retrieve an existing service from the registry or
1483
- * create a new one using the provided builder function.
1423
+ * Normalises the raw positional arguments of an instrumented function call
1424
+ * into a flat `Record<string, unknown>` suitable for structured logging.
1484
1425
  *
1485
- * @template - The type of service to be created/accessed
1486
- * @param key - Unique identifier for the service in the registry
1487
- * @param builder - Function that creates the service instance when called with a DynamicClient
1488
- * @not-instrumented
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
1489
1447
  */
1490
- const createRuntimeServiceAccessKey = (key, builder) => (client) => {
1491
- const { runtimeServices } = getCore(client);
1492
- const currentService = runtimeServices.getByKey(key);
1493
- if (currentService) return currentService;
1494
- const service = builder(client);
1495
- runtimeServices.register(key, service);
1496
- return service;
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;
1497
1454
  };
1498
1455
 
1499
1456
  //#endregion
1500
- //#region src/modules/wallets/walletProviderRegistry/createWalletProviderRegistry/createWalletProviderRegistry.ts
1457
+ //#region src/services/instrumentation/instrumentFunction/scrubResolvedValue/scrubResolvedValue.ts
1501
1458
  /**
1502
- * Creates a new wallet provider registry that manages wallet providers with priority-based registration.
1503
- *
1504
- * @returns The wallet provider registry instance
1505
- *
1506
- * @example
1507
- * ```typescript
1508
- * const registry = createWalletProviderRegistry();
1509
- *
1510
- * registry.register({
1511
- * priority: WalletProviderPriority.WALLET_SDK,
1512
- * walletProvider: myWalletProvider
1513
- * });
1514
- *
1515
- * const provider = registry.getByKey('my-wallet-key');
1516
- * const providers = registry.listProviders();
1517
- * ```
1518
- * @not-instrumented
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
1519
1464
  */
1520
- const createWalletProviderRegistry = (client) => {
1521
- const registry = /* @__PURE__ */ new Map();
1465
+ const scrubResolvedValue = ({ piiFields, redactAll, value }) => scrubParameters({
1466
+ piiFields,
1467
+ redactAll,
1468
+ value: { result: value }
1469
+ }).result;
1470
+
1471
+ //#endregion
1472
+ //#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
1478
+ };
1522
1479
  return {
1523
- getByKey: (key) => registry.get(key)?.walletProvider,
1524
- listProviderEntries: () => Array.from(registry.values()),
1525
- listProviders: () => Array.from(registry.values()).map((v) => v.walletProvider),
1526
- register: (args) => {
1527
- const existingEntry = registry.get(args.walletProvider.key);
1528
- if (existingEntry) {
1529
- if (existingEntry.priority < args.priority) {
1530
- registry.set(args.walletProvider.key, args);
1531
- emitEvent({
1532
- args: { walletProviderKey: args.walletProvider.key },
1533
- event: "walletProviderChanged"
1534
- }, client);
1535
- }
1536
- } else {
1537
- registry.set(args.walletProvider.key, args);
1538
- emitEvent({
1539
- args: { walletProvider: args.walletProvider },
1540
- event: "walletProviderRegistered"
1541
- }, client);
1542
- emitEvent({
1543
- args: { walletProviderKey: args.walletProvider.key },
1544
- event: "walletProviderChanged"
1545
- }, client);
1546
- }
1547
- },
1548
- unregister: (key) => {
1549
- registry.delete(key);
1550
- emitEvent({
1551
- args: { walletProviderKey: key },
1552
- event: "walletProviderUnregistered"
1553
- }, client);
1554
- }
1480
+ message: String(error),
1481
+ name: "UnknownError"
1555
1482
  };
1556
1483
  };
1557
-
1558
- //#endregion
1559
- //#region src/modules/wallets/walletProviderRegistry/getWalletProviderRegistry/getWalletProviderRegistry.ts
1560
1484
  /**
1561
- * This function provides access to a shared instance of the wallet provider registry.
1485
+ * Wraps a function so that each invocation emits a structured
1486
+ * `FunctionInstrumentationEvent` at three lifecycle points:
1562
1487
  *
1563
- * It ensures that the same registry instance is used throughout the client to maintaining
1564
- * consistency of registered wallet providers across different parts of the codebase.
1488
+ * - **started** immediately before the function body executes, with the
1489
+ * PII-scrubbed call parameters.
1490
+ * - **resolved** — after the function (or its returned Promise) settles
1491
+ * successfully, with the PII-scrubbed return value.
1492
+ * - **rejected** — if the function throws synchronously or its returned
1493
+ * Promise rejects.
1565
1494
  *
1566
- * @returns The wallet provider registry instance
1495
+ * The original return value (or thrown error) is always forwarded to the
1496
+ * caller unchanged — instrumentation is purely observational.
1567
1497
  *
1568
- * @example
1569
- * ```typescript
1570
- * // Get the registry instance
1571
- * const registry = getWalletProviderRegistry();
1498
+ * ## Usage
1572
1499
  *
1573
- * // Register a wallet provider
1574
- * registry.register({
1575
- * priority: WalletProviderPriority.WALLET_SDK,
1576
- * walletProvider: myWalletProvider
1500
+ * ```ts
1501
+ * const transfer = instrumentFunction({
1502
+ * fn: rawTransfer,
1503
+ * functionName: 'transfer',
1504
+ * getCore: () => core,
1577
1505
  * });
1578
1506
  *
1579
- * // Retrieve a specific provider
1580
- * const provider = registry.getByKey('metamaskevm');
1507
+ * // When called, three events are emitted automatically:
1508
+ * await transfer({ amount: 1, to: '0xabc' });
1581
1509
  * ```
1510
+ *
1511
+ * ## How functions are wrapped
1512
+ *
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.
1520
+ *
1521
+ * ## Opting out
1522
+ *
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.
1534
+ * @notInstrumented
1582
1535
  */
1583
- const getWalletProviderRegistry = createRuntimeServiceAccessKey("walletProviderRegistry", (client) => createWalletProviderRegistry(client));
1584
-
1585
- //#endregion
1586
- //#region src/modules/wallets/walletProviderRegistry/walletProviderRegistry.types.ts
1587
- let WalletProviderPriority = /* @__PURE__ */ function(WalletProviderPriority$1) {
1588
- /**
1589
- * Highest priority should be used by wallet providers that implement
1590
- * the most reliable wallet integration.
1591
- * example: The SDK provided by the wallet provider.
1592
- */
1593
- WalletProviderPriority$1[WalletProviderPriority$1["WALLET_SDK"] = 100] = "WALLET_SDK";
1594
- /**
1595
- * Medium priority should be used by wallet providers that implement
1596
- * a wallet integration via some reliable standard.
1597
- * example: A wallet provider that uses EIP6963 announcement.
1598
- */
1599
- WalletProviderPriority$1[WalletProviderPriority$1["WALLET_SELF_ANNOUNCEMENT_STANDARD"] = 50] = "WALLET_SELF_ANNOUNCEMENT_STANDARD";
1600
- /**
1601
- * Low priority should be used by wallet providers that implement
1602
- * a wallet integration on a less reliable standard.
1603
- * example: A wallet provider that uses window.ethereum, where the
1604
- * window key can be overridden by other extensions.
1605
- */
1606
- WalletProviderPriority$1[WalletProviderPriority$1["WINDOW_INJECT"] = 20] = "WINDOW_INJECT";
1607
- return WalletProviderPriority$1;
1608
- }({});
1609
-
1610
- //#endregion
1611
- //#region src/modules/wallets/utils/getWalletProviderFromWalletAccount/getWalletProviderFromWalletAccount.ts
1612
- /** @not-instrumented */
1613
- const getWalletProviderFromWalletAccount = ({ walletAccount }, client) => {
1614
- const walletProvider = getWalletProviderRegistry(client).getByKey(walletAccount.walletProviderKey);
1615
- if (!walletProvider) throw new NoWalletProviderFoundError({ walletProviderKey: walletAccount.walletProviderKey });
1616
- return walletProvider;
1536
+ const instrumentFunction = ({ fn, functionName, getCore: getCore$1, redactAll }) => {
1537
+ const wrapped = (...args) => {
1538
+ 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
1560
+ };
1561
+ instrumentation.logFunction({
1562
+ ...baseEvent,
1563
+ phase: "started",
1564
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1565
+ });
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
+ });
1589
+ instrumentation.logFunction({
1590
+ ...baseEvent,
1591
+ phase: "resolved",
1592
+ resolvedValue: scrubResolvedValue({
1593
+ piiFields: instrumentation.config.piiFields,
1594
+ redactAll,
1595
+ value: result
1596
+ }),
1597
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1598
+ });
1599
+ return result;
1600
+ } catch (error) {
1601
+ instrumentation.logFunction({
1602
+ ...baseEvent,
1603
+ phase: "rejected",
1604
+ rejectedError: serializeError(error),
1605
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1606
+ });
1607
+ throw error;
1608
+ }
1609
+ };
1610
+ return wrapped;
1617
1611
  };
1618
1612
 
1619
- //#endregion
1620
- //#region src/modules/auth/consts.ts
1621
- const DYNAMIC_AUTH_COOKIE_NAME = "DYNAMIC_JWT_TOKEN";
1622
-
1623
1613
  //#endregion
1624
1614
  //#region src/constants.ts
1625
1615
  const SDK_API_CORE_VERSION = dependencies["@dynamic-labs/sdk-api-core"];
@@ -1635,7 +1625,7 @@ const DYNAMIC_ICONIC_SPRITE_URL = "https://iconic.dynamic-static-assets.com/icon
1635
1625
  *
1636
1626
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1637
1627
  * @returns True if the user needs additional MFA authentication, false otherwise.
1638
- * @not-instrumented
1628
+ * @notInstrumented
1639
1629
  */
1640
1630
  const isUserMissingMfaAuth = (client = getDefaultClient()) => {
1641
1631
  const user = client.user;
@@ -1655,7 +1645,7 @@ const DYNAMIC_WAAS_METADATA = {
1655
1645
 
1656
1646
  //#endregion
1657
1647
  //#region src/modules/waas/isWaasWalletProvider/isWaasWalletProvider.ts
1658
- /** @not-instrumented */
1648
+ /** @notInstrumented */
1659
1649
  const isWaasWalletProvider = (walletProvider) => {
1660
1650
  return walletProvider.key.includes(DYNAMIC_WAAS_METADATA.normalizedWalletName);
1661
1651
  };
@@ -1825,12 +1815,6 @@ Object.defineProperty(exports, 'WalletProviderPriority', {
1825
1815
  return WalletProviderPriority;
1826
1816
  }
1827
1817
  });
1828
- Object.defineProperty(exports, '__getElevatedAccessToken_wrapped', {
1829
- enumerable: true,
1830
- get: function () {
1831
- return __getElevatedAccessToken_wrapped;
1832
- }
1833
- });
1834
1818
  Object.defineProperty(exports, 'assertDefined', {
1835
1819
  enumerable: true,
1836
1820
  get: function () {
@@ -1909,6 +1893,12 @@ Object.defineProperty(exports, 'getDeviceSigner', {
1909
1893
  return getDeviceSigner;
1910
1894
  }
1911
1895
  });
1896
+ Object.defineProperty(exports, 'getElevatedAccessToken', {
1897
+ enumerable: true,
1898
+ get: function () {
1899
+ return getElevatedAccessToken;
1900
+ }
1901
+ });
1912
1902
  Object.defineProperty(exports, 'getHeadersForNonceSignedByDeviceSigners', {
1913
1903
  enumerable: true,
1914
1904
  get: function () {
@@ -2065,4 +2055,4 @@ Object.defineProperty(exports, 'version', {
2065
2055
  return version;
2066
2056
  }
2067
2057
  });
2068
- //# sourceMappingURL=InvalidParamError-DDdAeFXE.cjs.map
2058
+ //# sourceMappingURL=InvalidParamError-Cs4ZMEj4.cjs.map