@dynamic-labs-sdk/client 1.4.0 → 1.6.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 (195) hide show
  1. package/dist/{InvalidParamError-CDmVW2DS.native.esm.js → InvalidParamError-BIptAjbC.native.esm.js} +839 -93
  2. package/dist/InvalidParamError-BIptAjbC.native.esm.js.map +1 -0
  3. package/dist/{InvalidParamError-BPMi0iWC.esm.js → InvalidParamError-BZ0LHaml.esm.js} +806 -93
  4. package/dist/InvalidParamError-BZ0LHaml.esm.js.map +1 -0
  5. package/dist/{InvalidParamError-DEmLKJKZ.cjs → InvalidParamError-DyXEKMWn.cjs} +1012 -116
  6. package/dist/InvalidParamError-DyXEKMWn.cjs.map +1 -0
  7. package/dist/{NotWaasWalletAccountError-Cntietge.esm.js → NotWaasWalletAccountError-BbOA5rPd.native.esm.js} +4 -4
  8. package/dist/NotWaasWalletAccountError-BbOA5rPd.native.esm.js.map +1 -0
  9. package/dist/{NotWaasWalletAccountError-BZsBHRQe.cjs → NotWaasWalletAccountError-CElqwdQO.cjs} +4 -4
  10. package/dist/NotWaasWalletAccountError-CElqwdQO.cjs.map +1 -0
  11. package/dist/{NotWaasWalletAccountError-Chpne8_Q.native.esm.js → NotWaasWalletAccountError-nT4jrLbp.esm.js} +4 -4
  12. package/dist/NotWaasWalletAccountError-nT4jrLbp.esm.js.map +1 -0
  13. package/dist/core.cjs +45 -23
  14. package/dist/core.cjs.map +1 -1
  15. package/dist/core.esm.js +27 -6
  16. package/dist/core.esm.js.map +1 -1
  17. package/dist/core.native.esm.js +27 -6
  18. package/dist/core.native.esm.js.map +1 -1
  19. package/dist/errors/CorruptedKeyShareError.d.ts +19 -0
  20. package/dist/errors/CorruptedKeyShareError.d.ts.map +1 -0
  21. package/dist/errors/WebViewLoadFailedError.d.ts +32 -0
  22. package/dist/errors/WebViewLoadFailedError.d.ts.map +1 -0
  23. package/dist/errors/base/BaseError.d.ts.map +1 -1
  24. package/dist/exports/core.d.ts +4 -0
  25. package/dist/exports/core.d.ts.map +1 -1
  26. package/dist/exports/index.d.ts +12 -0
  27. package/dist/exports/index.d.ts.map +1 -1
  28. package/dist/{getNetworkProviderFromNetworkId-JGrKwBj7.native.esm.js → getNetworkProviderFromNetworkId-B7DIqT2T.native.esm.js} +39 -328
  29. package/dist/getNetworkProviderFromNetworkId-B7DIqT2T.native.esm.js.map +1 -0
  30. package/dist/{getNetworkProviderFromNetworkId-CEeFL-gV.esm.js → getNetworkProviderFromNetworkId-BkAPIdRC.esm.js} +38 -266
  31. package/dist/getNetworkProviderFromNetworkId-BkAPIdRC.esm.js.map +1 -0
  32. package/dist/{getNetworkProviderFromNetworkId-szJOsbQN.cjs → getNetworkProviderFromNetworkId-DbI5MZhq.cjs} +44 -341
  33. package/dist/getNetworkProviderFromNetworkId-DbI5MZhq.cjs.map +1 -0
  34. package/dist/{getSignedSessionId-B5DikCap.native.esm.js → getSignedSessionId-1TV-x__C.native.esm.js} +3 -3
  35. package/dist/{getSignedSessionId-B5DikCap.native.esm.js.map → getSignedSessionId-1TV-x__C.native.esm.js.map} +1 -1
  36. package/dist/{getSignedSessionId-BxOK-Tdo.cjs → getSignedSessionId-BF6n8gve.cjs} +3 -3
  37. package/dist/{getSignedSessionId-BxOK-Tdo.cjs.map → getSignedSessionId-BF6n8gve.cjs.map} +1 -1
  38. package/dist/{getSignedSessionId-BOx1nFt_.esm.js → getSignedSessionId-y3YtxFHZ.esm.js} +3 -3
  39. package/dist/{getSignedSessionId-BOx1nFt_.esm.js.map → getSignedSessionId-y3YtxFHZ.esm.js.map} +1 -1
  40. package/dist/getVerifiedCredentialForWalletAccount-BfJ29erz.cjs +346 -0
  41. package/dist/getVerifiedCredentialForWalletAccount-BfJ29erz.cjs.map +1 -0
  42. package/dist/getVerifiedCredentialForWalletAccount-CLyC2nOl.native.esm.js +269 -0
  43. package/dist/getVerifiedCredentialForWalletAccount-CLyC2nOl.native.esm.js.map +1 -0
  44. package/dist/getVerifiedCredentialForWalletAccount-etV50QRH.esm.js +269 -0
  45. package/dist/getVerifiedCredentialForWalletAccount-etV50QRH.esm.js.map +1 -0
  46. package/dist/index.cjs +580 -253
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.esm.js +511 -191
  49. package/dist/index.esm.js.map +1 -1
  50. package/dist/index.native.esm.js +511 -191
  51. package/dist/index.native.esm.js.map +1 -1
  52. package/dist/{isMfaRequiredForAction-DUvZEpjA.native.esm.js → isMfaRequiredForAction-B2vKX31S.native.esm.js} +32 -3
  53. package/dist/isMfaRequiredForAction-B2vKX31S.native.esm.js.map +1 -0
  54. package/dist/{isMfaRequiredForAction-D9p_du8C.esm.js → isMfaRequiredForAction-Dy4-S3mr.esm.js} +2 -2
  55. package/dist/{isMfaRequiredForAction-D9p_du8C.esm.js.map → isMfaRequiredForAction-Dy4-S3mr.esm.js.map} +1 -1
  56. package/dist/{isMfaRequiredForAction-6N6JB7wa.cjs → isMfaRequiredForAction-K2Jh-3-j.cjs} +2 -2
  57. package/dist/{isMfaRequiredForAction-6N6JB7wa.cjs.map → isMfaRequiredForAction-K2Jh-3-j.cjs.map} +1 -1
  58. package/dist/modules/apiClient/apiClient.types.d.ts +12 -0
  59. package/dist/modules/apiClient/apiClient.types.d.ts.map +1 -1
  60. package/dist/modules/apiClient/createApiClient.d.ts.map +1 -1
  61. package/dist/modules/apiClient/utils/sessionExpiryLogoutMiddleware/createSessionExpiryLogoutMiddleware.d.ts +27 -0
  62. package/dist/modules/apiClient/utils/sessionExpiryLogoutMiddleware/createSessionExpiryLogoutMiddleware.d.ts.map +1 -0
  63. package/dist/modules/auth/isSignedIn/isSignedIn.d.ts +11 -1
  64. package/dist/modules/auth/isSignedIn/isSignedIn.d.ts.map +1 -1
  65. package/dist/modules/auth/logoutReason.d.ts +1 -1
  66. package/dist/modules/auth/logoutReason.d.ts.map +1 -1
  67. package/dist/modules/auth/logoutWithReason/logoutWithReason.d.ts.map +1 -1
  68. package/dist/modules/balances/getBalances/getBalances.d.ts +9 -45
  69. package/dist/modules/balances/getBalances/getBalances.d.ts.map +1 -1
  70. package/dist/modules/balances/getMultichainBalances/getMultichainBalances.d.ts +13 -20
  71. package/dist/modules/balances/getMultichainBalances/getMultichainBalances.d.ts.map +1 -1
  72. package/dist/modules/balances/getMultichainTokenBalances/getMultichainTokenBalances.d.ts +26 -0
  73. package/dist/modules/balances/getMultichainTokenBalances/getMultichainTokenBalances.d.ts.map +1 -0
  74. package/dist/modules/balances/getMultichainTokenBalances/index.d.ts +2 -0
  75. package/dist/modules/balances/getMultichainTokenBalances/index.d.ts.map +1 -0
  76. package/dist/modules/balances/getTokenBalances/getTokenBalances.d.ts +56 -0
  77. package/dist/modules/balances/getTokenBalances/getTokenBalances.d.ts.map +1 -0
  78. package/dist/modules/balances/getTokenBalances/index.d.ts +3 -0
  79. package/dist/modules/balances/getTokenBalances/index.d.ts.map +1 -0
  80. package/dist/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.d.ts.map +1 -1
  81. package/dist/modules/funding/moonpay/errors/MoonPayCurrenciesFetchError.d.ts +5 -0
  82. package/dist/modules/funding/moonpay/errors/MoonPayCurrenciesFetchError.d.ts.map +1 -0
  83. package/dist/modules/funding/moonpay/errors/MoonPayInvalidUrlError.d.ts +5 -0
  84. package/dist/modules/funding/moonpay/errors/MoonPayInvalidUrlError.d.ts.map +1 -0
  85. package/dist/modules/funding/moonpay/errors/MoonPayProviderNotAvailableError.d.ts +5 -0
  86. package/dist/modules/funding/moonpay/errors/MoonPayProviderNotAvailableError.d.ts.map +1 -0
  87. package/dist/modules/funding/moonpay/getMoonPayCurrencies/getMoonPayCurrencies.d.ts +14 -0
  88. package/dist/modules/funding/moonpay/getMoonPayCurrencies/getMoonPayCurrencies.d.ts.map +1 -0
  89. package/dist/modules/funding/moonpay/getMoonPayCurrencies/index.d.ts +2 -0
  90. package/dist/modules/funding/moonpay/getMoonPayCurrencies/index.d.ts.map +1 -0
  91. package/dist/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.d.ts +15 -0
  92. package/dist/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.d.ts.map +1 -0
  93. package/dist/modules/funding/moonpay/getMoonPayUrl/index.d.ts +2 -0
  94. package/dist/modules/funding/moonpay/getMoonPayUrl/index.d.ts.map +1 -0
  95. package/dist/modules/funding/moonpay/moonpay.types.d.ts +26 -0
  96. package/dist/modules/funding/moonpay/moonpay.types.d.ts.map +1 -0
  97. package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainFromWalletSchema/getChainFromWalletSchema.d.ts +12 -0
  98. package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainFromWalletSchema/getChainFromWalletSchema.d.ts.map +1 -1
  99. package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainsFromWalletSchema/getChainsFromWalletSchema.d.ts +26 -0
  100. package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainsFromWalletSchema/getChainsFromWalletSchema.d.ts.map +1 -0
  101. package/dist/modules/legacyWalletBook/hasUsableDeeplink/hasUsableDeeplink.d.ts +18 -0
  102. package/dist/modules/legacyWalletBook/hasUsableDeeplink/hasUsableDeeplink.d.ts.map +1 -0
  103. package/dist/modules/legacyWalletBook/legacyWalletBook.types.d.ts +2 -2
  104. package/dist/modules/legacyWalletBook/legacyWalletBook.types.d.ts.map +1 -1
  105. package/dist/modules/swap/executeSwapTransaction/executeSwapTransaction.d.ts +13 -1
  106. package/dist/modules/swap/executeSwapTransaction/executeSwapTransaction.d.ts.map +1 -1
  107. package/dist/modules/user/refreshAuth/refreshAuth.d.ts.map +1 -1
  108. package/dist/modules/waas/createWaasClient/createWaasClient.d.ts +2 -7
  109. package/dist/modules/waas/createWaasClient/createWaasClient.d.ts.map +1 -1
  110. package/dist/modules/waas/createWaasClient/createWaasClient.types.d.ts +8 -0
  111. package/dist/modules/waas/createWaasClient/createWaasClient.types.d.ts.map +1 -0
  112. package/dist/modules/waas/createWaasClient/createWaasSDKContainer.d.ts +15 -0
  113. package/dist/modules/waas/createWaasClient/createWaasSDKContainer.d.ts.map +1 -0
  114. package/dist/modules/waas/createWaasClient/translateNativeOpenError.d.ts +18 -0
  115. package/dist/modules/waas/createWaasClient/translateNativeOpenError.d.ts.map +1 -0
  116. package/dist/modules/walletOptionsCatalogue/buildMetaMaskSdkUriOptions/buildMetaMaskSdkUriOptions.d.ts +27 -0
  117. package/dist/modules/walletOptionsCatalogue/buildMetaMaskSdkUriOptions/buildMetaMaskSdkUriOptions.d.ts.map +1 -0
  118. package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts +26 -0
  119. package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts.map +1 -0
  120. package/dist/modules/walletOptionsCatalogue/buildWalletOption/buildWalletOption.d.ts +11 -4
  121. package/dist/modules/walletOptionsCatalogue/buildWalletOption/buildWalletOption.d.ts.map +1 -1
  122. package/dist/modules/walletOptionsCatalogue/buildWithWalletProviderOptions/buildWithWalletProviderOptions.d.ts.map +1 -1
  123. package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/getInstallationLinkForCurrentPlatform.d.ts +35 -0
  124. package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/getInstallationLinkForCurrentPlatform.d.ts.map +1 -0
  125. package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/index.d.ts +2 -0
  126. package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/index.d.ts.map +1 -0
  127. package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts +6 -1
  128. package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts.map +1 -1
  129. package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts +11 -0
  130. package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts.map +1 -1
  131. package/dist/modules/wallets/constants.d.ts +7 -0
  132. package/dist/modules/wallets/constants.d.ts.map +1 -1
  133. package/dist/modules/wallets/getAvailableWalletProvidersData/getAvailableWalletProvidersData.d.ts.map +1 -1
  134. package/dist/modules/wallets/hasWalletProviderConnectMethod/hasWalletProviderConnectMethod.d.ts +26 -0
  135. package/dist/modules/wallets/hasWalletProviderConnectMethod/hasWalletProviderConnectMethod.d.ts.map +1 -0
  136. package/dist/modules/wallets/hasWalletProviderConnectMethod/index.d.ts +2 -0
  137. package/dist/modules/wallets/hasWalletProviderConnectMethod/index.d.ts.map +1 -0
  138. package/dist/modules/wallets/isAnyWalletAccountConnected/index.d.ts +2 -0
  139. package/dist/modules/wallets/isAnyWalletAccountConnected/index.d.ts.map +1 -0
  140. package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts +14 -0
  141. package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts.map +1 -0
  142. package/dist/modules/wallets/networks/getBalance/getBalance.d.ts +6 -17
  143. package/dist/modules/wallets/networks/getBalance/getBalance.d.ts.map +1 -1
  144. package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts +24 -0
  145. package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts.map +1 -0
  146. package/dist/modules/wallets/networks/getNativeBalance/index.d.ts +2 -0
  147. package/dist/modules/wallets/networks/getNativeBalance/index.d.ts.map +1 -0
  148. package/dist/modules/wallets/walletProvider/walletProvider.types.d.ts +10 -0
  149. package/dist/modules/wallets/walletProvider/walletProvider.types.d.ts.map +1 -1
  150. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  151. package/dist/utils/getChainFromWalletBookIdentifier/getChainFromWalletBookIdentifier.d.ts +22 -0
  152. package/dist/utils/getChainFromWalletBookIdentifier/getChainFromWalletBookIdentifier.d.ts.map +1 -0
  153. package/dist/utils/getChainFromWalletBookIdentifier/index.d.ts +2 -0
  154. package/dist/utils/getChainFromWalletBookIdentifier/index.d.ts.map +1 -0
  155. package/dist/utils/getNativeLinkScheme/getNativeLinkScheme.d.ts +18 -0
  156. package/dist/utils/getNativeLinkScheme/getNativeLinkScheme.d.ts.map +1 -0
  157. package/dist/utils/getNativeLinkScheme/index.d.ts +3 -0
  158. package/dist/utils/getNativeLinkScheme/index.d.ts.map +1 -0
  159. package/dist/utils/isMobile/isMobile.d.ts +8 -0
  160. package/dist/utils/isMobile/isMobile.d.ts.map +1 -1
  161. package/dist/waas.cjs +8 -9
  162. package/dist/waas.cjs.map +1 -1
  163. package/dist/waas.esm.js +3 -3
  164. package/dist/waas.native.esm.js +3 -3
  165. package/dist/waasCore.cjs +3 -4
  166. package/dist/waasCore.cjs.map +1 -1
  167. package/dist/waasCore.esm.js +3 -3
  168. package/dist/waasCore.esm.js.map +1 -1
  169. package/dist/waasCore.native.esm.js +208 -7
  170. package/dist/waasCore.native.esm.js.map +1 -1
  171. package/package.json +5 -5
  172. package/dist/InvalidParamError-BPMi0iWC.esm.js.map +0 -1
  173. package/dist/InvalidParamError-CDmVW2DS.native.esm.js.map +0 -1
  174. package/dist/InvalidParamError-DEmLKJKZ.cjs.map +0 -1
  175. package/dist/NotWaasWalletAccountError-BZsBHRQe.cjs.map +0 -1
  176. package/dist/NotWaasWalletAccountError-Chpne8_Q.native.esm.js.map +0 -1
  177. package/dist/NotWaasWalletAccountError-Cntietge.esm.js.map +0 -1
  178. package/dist/getNetworkProviderFromNetworkId-CEeFL-gV.esm.js.map +0 -1
  179. package/dist/getNetworkProviderFromNetworkId-JGrKwBj7.native.esm.js.map +0 -1
  180. package/dist/getNetworkProviderFromNetworkId-szJOsbQN.cjs.map +0 -1
  181. package/dist/getVerifiedCredentialForWalletAccount-B46O0B48.cjs +0 -887
  182. package/dist/getVerifiedCredentialForWalletAccount-B46O0B48.cjs.map +0 -1
  183. package/dist/getVerifiedCredentialForWalletAccount-CyykSi-M.native.esm.js +0 -701
  184. package/dist/getVerifiedCredentialForWalletAccount-CyykSi-M.native.esm.js.map +0 -1
  185. package/dist/getVerifiedCredentialForWalletAccount-DzwIoeHm.esm.js +0 -701
  186. package/dist/getVerifiedCredentialForWalletAccount-DzwIoeHm.esm.js.map +0 -1
  187. package/dist/isMfaRequiredForAction-DUvZEpjA.native.esm.js.map +0 -1
  188. package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/buildUriDeeplinkOptions.d.ts +0 -28
  189. package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/buildUriDeeplinkOptions.d.ts.map +0 -1
  190. package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/index.d.ts +0 -2
  191. package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/index.d.ts.map +0 -1
  192. package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/index.d.ts +0 -2
  193. package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/index.d.ts.map +0 -1
  194. package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/resolveUriConnectionType.d.ts +0 -17
  195. package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/resolveUriConnectionType.d.ts.map +0 -1
@@ -1,12 +1,15 @@
1
- import { AuthStorageEnum, Configuration, SDKApi, isDeviceNonceSignatureRequiredForUrl } from "@dynamic-labs/sdk-api-core";
1
+ import { AuthStorageEnum, Configuration, JwtVerifiedCredentialFormatEnum, SDKApi, WalletProviderEnum, isDeviceNonceSignatureRequiredForUrl } from "@dynamic-labs/sdk-api-core";
2
+ import * as z from "zod/mini";
3
+ import AsyncStorage from "@react-native-async-storage/async-storage";
4
+ import { getGenericPassword, resetGenericPassword, setGenericPassword } from "react-native-keychain";
2
5
 
3
6
  //#region package.json
4
7
  var name = "@dynamic-labs-sdk/client";
5
- var version = "1.4.0";
8
+ var version = "1.6.0";
6
9
  var dependencies = {
7
10
  "@dynamic-labs-sdk/assert-package-version": "workspace:*",
8
- "@dynamic-labs-wallet/browser-wallet-client": "0.0.351",
9
- "@dynamic-labs-wallet/forward-mpc-client": "0.9.0",
11
+ "@dynamic-labs-wallet/browser-wallet-client": "1.0.7",
12
+ "@dynamic-labs-wallet/forward-mpc-client": "0.10.1",
10
13
  "@dynamic-labs/sdk-api-core": "catalog:",
11
14
  "@simplewebauthn/browser": "13.1.0",
12
15
  "ably": "2.17.1",
@@ -61,7 +64,12 @@ var BaseError = class BaseError extends Error {
61
64
  details
62
65
  });
63
66
  super(args.shortMessage ?? formattedMessage, args.cause ? { cause: args.cause } : void 0);
64
- this.formattedMessage = formattedMessage;
67
+ Object.defineProperty(this, "formattedMessage", {
68
+ configurable: true,
69
+ enumerable: false,
70
+ value: formattedMessage,
71
+ writable: true
72
+ });
65
73
  this.details = details;
66
74
  this.name = args.name ?? this.name;
67
75
  this.cause = args.cause ?? this.cause;
@@ -909,109 +917,186 @@ const createDeviceSignatureHeadersMiddleware = (client) => {
909
917
  };
910
918
 
911
919
  //#endregion
912
- //#region src/errors/UnauthorizedError.ts
913
- var UnauthorizedError = class extends BaseError {
914
- constructor({ cause }) {
920
+ //#region src/utils/setCookie/setCookie.ts
921
+ /**
922
+ * Sefelly sets the cookie in the browser.
923
+ * @not-instrumented
924
+ */
925
+ const setCookie = (cookie) => {
926
+ document.cookie = cookie;
927
+ };
928
+
929
+ //#endregion
930
+ //#region src/modules/clientEvents/clientEvents.ts
931
+ /**
932
+ * Adds an event listener for Dynamic client events.
933
+ *
934
+ * This function allows you to listen for various events emitted by the Dynamic client,
935
+ * such as authentication state changes, wallet connections, and more.
936
+ *
937
+ * @param params.event - The event name to listen for.
938
+ * @param params.listener - The callback function to execute when the event is fired.
939
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
940
+ * @returns A function that can be called to remove the listener.
941
+ * @not-instrumented
942
+ */
943
+ const onEvent = ({ event, listener }, client = getDefaultClient()) => {
944
+ const { eventEmitter } = getCore(client);
945
+ eventEmitter.on(event, listener);
946
+ return () => {
947
+ eventEmitter.off(event, listener);
948
+ };
949
+ };
950
+ /**
951
+ * Removes an event listener from Dynamic client events.
952
+ *
953
+ * This function unsubscribes a previously registered event listener
954
+ * from the specified Dynamic client event.
955
+ *
956
+ * @param params.event - The event name to remove the listener from.
957
+ * @param params.listener - The callback function to remove.
958
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
959
+ * @not-instrumented
960
+ */
961
+ const offEvent = ({ event, listener }, client = getDefaultClient()) => {
962
+ const { eventEmitter } = getCore(client);
963
+ eventEmitter.off(event, listener);
964
+ };
965
+ /**
966
+ * Adds a one-time event listener for Dynamic client events.
967
+ *
968
+ * This function listens for an event that will automatically remove itself
969
+ * after being triggered once.
970
+ *
971
+ * @param params.event - The event name to listen for.
972
+ * @param params.listener - The callback function to execute when the event is fired.
973
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
974
+ * @returns A function that can be called to remove the listener before it fires.
975
+ * @not-instrumented
976
+ */
977
+ const onceEvent = ({ event, listener }, client = getDefaultClient()) => {
978
+ const { eventEmitter } = getCore(client);
979
+ eventEmitter.once(event, listener);
980
+ return () => {
981
+ eventEmitter.off(event, listener);
982
+ };
983
+ };
984
+ /**
985
+ * Emits a Dynamic client event.
986
+ *
987
+ * This function triggers an event that will be received by all registered
988
+ * listeners for the specified event type.
989
+ *
990
+ * @param params.event - The event name to emit.
991
+ * @param params.args - The arguments to pass to event listeners.
992
+ * @param client - The Dynamic client instance.
993
+ * @not-instrumented
994
+ */
995
+ const emitEvent = ({ event, args }, client) => {
996
+ const { eventEmitter } = getCore(client);
997
+ eventEmitter.emit(event, args);
998
+ };
999
+
1000
+ //#endregion
1001
+ //#region src/utils/retryOnFail/InvalidRetryOnFailCallError.ts
1002
+ /**
1003
+ * This error is thrown when the `retryOnFail` function is called with an invalid
1004
+ * number of retries (i.e. less than 0).
1005
+ */
1006
+ var InvalidRetryOnFailCallError = class extends BaseError {
1007
+ constructor(maxRetries) {
915
1008
  super({
916
- cause,
917
- code: "unauthorized_error",
1009
+ cause: null,
1010
+ code: "invalid_retry_on_fail_call_error",
918
1011
  docsUrl: null,
919
- name: "UnauthorizedError",
920
- shortMessage: "Unauthorized"
1012
+ name: "InvalidRetryOnFailCallError",
1013
+ shortMessage: `Invalid retries parameter for retryOnFail call: ${maxRetries}`
921
1014
  });
922
1015
  }
923
1016
  };
924
1017
 
925
1018
  //#endregion
926
- //#region src/modules/apiClient/utils/unauthorizedMiddleware/createUnauthorizedMiddleware.ts
1019
+ //#region src/utils/retryOnFail/retryOnFail.ts
927
1020
  /** @not-instrumented */
928
- const createUnauthorizedMiddleware = () => ({ post: async (context) => {
929
- if (context.response.status === 401) {
930
- let cause = null;
931
- try {
932
- const errorBody = await context.response.clone().json();
933
- if (errorBody && "error" in errorBody && typeof errorBody.error === "string") cause = new Error(errorBody.error);
934
- } catch {}
935
- throw new UnauthorizedError({ cause });
1021
+ const retryOnFail = async ({ delay = 0, fn, maxRetries }) => {
1022
+ for (let retry = 0; retry <= maxRetries; retry++) try {
1023
+ return await fn();
1024
+ } catch (error) {
1025
+ if (retry >= maxRetries) throw error;
1026
+ if (delay > 0) await new Promise((resolve) => setTimeout(resolve, delay));
936
1027
  }
937
- return context.response;
938
- } });
1028
+ /**
1029
+ * Reaching this point should never happen and this
1030
+ * error is thrown to help us debug the issue.
1031
+ */
1032
+ throw new InvalidRetryOnFailCallError(maxRetries);
1033
+ };
939
1034
 
940
1035
  //#endregion
941
- //#region src/modules/apiClient/createApiClient.ts
942
- /**
943
- * Returns a new instance of the SDK API client.
944
- *
945
- * This is not meant for storing, as it is very light we can create it whenever needed.
946
- * @not-instrumented
947
- */
948
- const createApiClient = (options = {}, client) => {
949
- const core = getCore(client);
950
- const coreState = core.state.get();
951
- const settings = {
952
- basePath: core.apiBaseUrl,
953
- headers: {
954
- "Content-Type": "application/json",
955
- [DYNAMIC_API_VERSION_HEADER]: `API/${DYNAMIC_SDK_API_VERSION}`,
956
- [DYNAMIC_REQUEST_ID_HEADER]: randomString({ length: 50 }),
957
- [DYNAMIC_SDK_SESSION_ID_HEADER]: core.sdkSessionId,
958
- [DYNAMIC_SDK_VERSION_HEADER]: `${CLIENT_SDK_NAME}/${version}`,
959
- ...core.getApiHeaders(),
960
- ...options.headers
961
- }
962
- };
963
- if (core.metadata?.universalLink) settings.headers["Origin"] = core.metadata.universalLink;
964
- if (client.token) settings.headers.Authorization = `Bearer ${client.token}`;
965
- if (client.projectSettings && isCookieEnabled(client)) settings.credentials = "include";
966
- if (options.includeMfaToken && coreState.mfaToken) settings.headers[MFA_TOKEN_HEADER] = coreState.mfaToken;
967
- if (options.elevatedAccessTokenScope) {
968
- const elevatedToken = __getElevatedAccessToken_wrapped({ scope: options.elevatedAccessTokenScope }, client);
969
- if (elevatedToken) settings.headers[ELEVATED_ACCESS_TOKEN_HEADER] = elevatedToken;
1036
+ //#region src/errors/InvalidWalletProviderKeyError.ts
1037
+ var InvalidWalletProviderKeyError = class extends BaseError {
1038
+ constructor(value) {
1039
+ super({
1040
+ cause: null,
1041
+ code: "invalid_wallet_provider_key",
1042
+ docsUrl: null,
1043
+ name: "InvalidWalletProviderKeyError",
1044
+ shortMessage: `Invalid wallet provider key: ${value}. Key must be in the format of <normalizedWalletNameWithChain>:<walletProviderType>[:<suffix>]`
1045
+ });
970
1046
  }
971
- const sessionPublicKey = getSessionKeys(client)?.publicKey;
972
- const isSessionPublicKeyHeaderPresent = settings.headers[SESSION_PUBLIC_KEY_HEADER] !== void 0;
973
- if (sessionPublicKey && !isSessionPublicKeyHeaderPresent) settings.headers[SESSION_PUBLIC_KEY_HEADER] = sessionPublicKey;
974
- return new SDKApi(new Configuration({
975
- ...settings,
976
- fetchApi: core.fetch,
977
- middleware: [
978
- createDeviceSignatureHeadersMiddleware(client),
979
- createConvertToApiErrorMiddleware({ errorMappers: [...options.errorMappers || [], clientErrorMapper] }),
980
- createUnauthorizedMiddleware()
981
- ]
982
- }));
983
1047
  };
984
1048
 
985
1049
  //#endregion
986
- //#region src/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.ts
987
- /**
988
- * Fetches a batch of nonces from the API.
989
- *
990
- * Prefetching is critical for iOS deep link wallet providers (e.g. Phantom
991
- * redirect). On iOS, a network request (like fetching a nonce) between a user
992
- * action and a deeplink call will break the gesture chain, causing iOS to
993
- * silently ignore the deeplink. By prefetching nonces ahead of time,
994
- * `getNonce` can return synchronously from cache and the deeplink fires
995
- * without an interrupting network round-trip.
996
- *
997
- * New nonces are **appended** to the existing pool so that unconsumed entries
998
- * are not discarded by a background refetch.
999
- * @not-instrumented
1000
- */
1001
- const fetchAndStoreNonces = async (client) => {
1002
- const core = getCore(client);
1003
- const { environmentId } = core;
1004
- const { nonces } = await createApiClient({}, client).getNonces({
1005
- count: NONCE_POOL_SIZE,
1006
- environmentId
1007
- });
1008
- const existing = core.state.get().prefetchedNonces;
1009
- core.state.set({
1010
- prefetchedNonces: [...existing, ...nonces],
1011
- prefetchedNoncesExpiration: Date.now() + NONCE_POOL_EXPIRATION_TIME
1012
- });
1050
+ //#region src/modules/wallets/walletProvider/splitWalletProviderKey/splitWalletProviderKey.ts
1051
+ /** @not-instrumented */
1052
+ const splitWalletProviderKey = (walletProviderKey) => {
1053
+ const [normalizedWalletNameWithChain, walletProviderType, suffix, ...rest] = walletProviderKey.split(":");
1054
+ if (!normalizedWalletNameWithChain || !Object.values(WalletProviderEnum).includes(walletProviderType) || rest.length > 0) throw new InvalidWalletProviderKeyError(walletProviderKey);
1055
+ return {
1056
+ normalizedWalletNameWithChain,
1057
+ suffix,
1058
+ walletProviderType
1059
+ };
1060
+ };
1061
+
1062
+ //#endregion
1063
+ //#region src/modules/wallets/utils/normalizeAddress/normalizeAddress.ts
1064
+ /** @not-instrumented */
1065
+ const normalizeAddress = ({ address, chain }) => {
1066
+ let normalizedAddress = address;
1067
+ if (normalizedAddress?.startsWith("0x")) normalizedAddress = normalizedAddress.slice(2);
1068
+ normalizedAddress = ["EVM", "FLOW"].includes(chain) ? normalizedAddress?.toLowerCase() : normalizedAddress;
1069
+ return normalizedAddress;
1013
1070
  };
1014
1071
 
1072
+ //#endregion
1073
+ //#region src/modules/wallets/utils/formatWalletAccountId/formatWalletAccountId.ts
1074
+ /** @not-instrumented */
1075
+ const formatWalletAccountId = ({ address, chain, walletProviderKey }) => {
1076
+ const { normalizedWalletNameWithChain } = splitWalletProviderKey(walletProviderKey);
1077
+ return `${normalizedWalletNameWithChain}:${normalizeAddress({
1078
+ address,
1079
+ chain
1080
+ })}`;
1081
+ };
1082
+
1083
+ //#endregion
1084
+ //#region src/modules/wallets/utils/convertUnverifiedWalletAccountToWalletAccount/convertUnverifiedWalletAccountToWalletAccount.ts
1085
+ /** @not-instrumented */
1086
+ const convertUnverifiedWalletAccountToWalletAccount = ({ unverifiedWalletAccount }) => ({
1087
+ address: unverifiedWalletAccount.address,
1088
+ addressesWithTypes: unverifiedWalletAccount.addressesWithTypes,
1089
+ chain: unverifiedWalletAccount.chain,
1090
+ id: formatWalletAccountId({
1091
+ address: unverifiedWalletAccount.address,
1092
+ chain: unverifiedWalletAccount.chain,
1093
+ walletProviderKey: unverifiedWalletAccount.walletProviderKey
1094
+ }),
1095
+ lastSelectedAt: unverifiedWalletAccount.lastSelectedAt,
1096
+ verifiedCredentialId: null,
1097
+ walletProviderKey: unverifiedWalletAccount.walletProviderKey
1098
+ });
1099
+
1015
1100
  //#endregion
1016
1101
  //#region src/modules/wallets/constants.ts
1017
1102
  const CHAINS_INFO_MAP = {
@@ -1033,6 +1118,7 @@ const CHAINS_INFO_MAP = {
1033
1118
  BTC: {
1034
1119
  apiChainName: "bitcoin",
1035
1120
  blockchainName: "Bitcoin",
1121
+ legacyWalletBookAliases: ["btc"],
1036
1122
  verifiedCredentialChainName: "bip122"
1037
1123
  },
1038
1124
  COSMOS: {
@@ -1063,6 +1149,7 @@ const CHAINS_INFO_MAP = {
1063
1149
  SOL: {
1064
1150
  apiChainName: "solana",
1065
1151
  blockchainName: "Solana",
1152
+ legacyWalletBookAliases: ["sol"],
1066
1153
  verifiedCredentialChainName: "solana",
1067
1154
  waasChainNameOverride: "SVM"
1068
1155
  },
@@ -1074,6 +1161,7 @@ const CHAINS_INFO_MAP = {
1074
1161
  STARK: {
1075
1162
  apiChainName: "starknet",
1076
1163
  blockchainName: "Starknet",
1164
+ legacyWalletBookAliases: ["stark"],
1077
1165
  verifiedCredentialChainName: "starknet"
1078
1166
  },
1079
1167
  STELLAR: {
@@ -1112,6 +1200,664 @@ const getChainFromVerifiedCredentialChain = (verifiedCredentialChain) => {
1112
1200
  return chain;
1113
1201
  };
1114
1202
 
1203
+ //#endregion
1204
+ //#region src/modules/wallets/utils/normalizeWalletNameWithChain/normalizeWalletNameWithChain.ts
1205
+ /**
1206
+ * Format the raw wallet name and chain to get the value we can use for
1207
+ * verified credentials' `walletName` field.
1208
+ * @not-instrumented
1209
+ */
1210
+ const normalizeWalletNameWithChain = ({ displayName, chain }) => {
1211
+ const sanitizedWalletName = displayName.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
1212
+ const chainLowered = chain.toLocaleLowerCase();
1213
+ if (sanitizedWalletName.endsWith(chainLowered)) return sanitizedWalletName;
1214
+ return `${sanitizedWalletName}${chainLowered}`;
1215
+ };
1216
+
1217
+ //#endregion
1218
+ //#region src/modules/wallets/utils/formatWalletProviderKey/formatWalletProviderKey.ts
1219
+ /**
1220
+ * Assembles the wallet provider key from the wallet name, chain, and wallet provider type.
1221
+ *
1222
+ * The suffix is optional and can be used to add a uniquely identifying string to the key, which
1223
+ * might be necessary for some wallet providers (like Wallet Connect).
1224
+ *
1225
+ * IMPORTANT: Do NOT add a suffix unless absolutely necessary, as it will cause the wallet account
1226
+ * to not be able to find its wallet provider when connecting to a new device (it won't be possible
1227
+ * to determine the full key just from the Verified Credential data).
1228
+ * @not-instrumented
1229
+ */
1230
+ const formatWalletProviderKey = ({ suffix, chain, displayName, walletProviderType }) => {
1231
+ return `${normalizeWalletNameWithChain({
1232
+ chain,
1233
+ displayName
1234
+ })}:${walletProviderType}${suffix ? `:${suffix}` : ""}`;
1235
+ };
1236
+
1237
+ //#endregion
1238
+ //#region src/modules/wallets/walletProvider/walletProviderKeyMap/getWalletProviderKeyFromVerifiedCredential/getWalletProviderKeyFromVerifiedCredential.ts
1239
+ /** @not-instrumented */
1240
+ const getWalletProviderKeyFromVerifiedCredential = ({ verifiedCredential }, client) => {
1241
+ const { walletProviderKeyMap } = getCore(client).state.get();
1242
+ const storedWalletProviderKey = walletProviderKeyMap[verifiedCredential.id];
1243
+ if (storedWalletProviderKey) return { walletProviderKey: storedWalletProviderKey };
1244
+ /**
1245
+ * We fallback to comprising the wallet provider key from walletName and walletProvider.
1246
+ *
1247
+ * Some wallet provider types (like Wallet Connect) also use a special suffix for their wallet provider
1248
+ * keys, so this won't be enough for them.
1249
+ * Therefore, for those specific wallet providers, the wallet account will remain without a wallet provider
1250
+ * and will require reconnection.
1251
+ * Read walletProvider.types.ts for more info.
1252
+ */
1253
+ assertDefined(verifiedCredential.walletName, `Failed to get wallet provider for verified credential with ID ${verifiedCredential.id}: missing walletName`);
1254
+ assertDefined(verifiedCredential.walletProvider, `Failed to get wallet provider for verified credential with ID ${verifiedCredential.id}: missing walletProvider`);
1255
+ assertDefined(verifiedCredential.chain, `Failed to get wallet provider for verified credential with ID ${verifiedCredential.id}: missing chain`);
1256
+ return { walletProviderKey: formatWalletProviderKey({
1257
+ chain: getChainFromVerifiedCredentialChain(verifiedCredential.chain),
1258
+ displayName: verifiedCredential.walletName,
1259
+ walletProviderType: verifiedCredential.walletProvider
1260
+ }) };
1261
+ };
1262
+
1263
+ //#endregion
1264
+ //#region src/modules/wallets/utils/convertVerifiedCredentialToWalletAccount/convertVerifiedCredentialToWalletAccount.ts
1265
+ /** @not-instrumented */
1266
+ const convertVerifiedCredentialToWalletAccount = ({ verifiedCredential }, client) => {
1267
+ assertDefined(verifiedCredential.address, "Missing address in verified credential");
1268
+ assertDefined(verifiedCredential.chain, "Missing chain in verified credential");
1269
+ const chain = getChainFromVerifiedCredentialChain(verifiedCredential.chain);
1270
+ const { walletProviderKey } = getWalletProviderKeyFromVerifiedCredential({ verifiedCredential }, client);
1271
+ const walletAccountId = formatWalletAccountId({
1272
+ address: verifiedCredential.address,
1273
+ chain,
1274
+ walletProviderKey
1275
+ });
1276
+ return {
1277
+ address: verifiedCredential.address,
1278
+ addressesWithTypes: verifiedCredential.walletAdditionalAddresses,
1279
+ chain,
1280
+ hardwareWalletVendor: verifiedCredential.walletProperties?.hardwareWallet,
1281
+ id: walletAccountId,
1282
+ lastSelectedAt: verifiedCredential.lastSelectedAt ?? null,
1283
+ verifiedCredentialId: verifiedCredential.id,
1284
+ walletProviderKey
1285
+ };
1286
+ };
1287
+
1288
+ //#endregion
1289
+ //#region src/modules/wallets/getWalletAccounts/getWalletAccountsFromState/getWalletAccountsFromState.ts
1290
+ /** @not-instrumented */
1291
+ const getWalletAccountsFromState = ({ unverifiedWalletAccounts, user }, client) => {
1292
+ const walletAccountsMap = /* @__PURE__ */ new Map();
1293
+ /**
1294
+ * Handle the unverified wallet accounts before the user verified credentials
1295
+ * so the later verified wallet accounts can override the unverified wallet accounts
1296
+ */
1297
+ unverifiedWalletAccounts.forEach((unverifiedWalletAccount) => {
1298
+ const walletAccount = convertUnverifiedWalletAccountToWalletAccount({ unverifiedWalletAccount });
1299
+ walletAccountsMap.set(walletAccount.id, walletAccount);
1300
+ });
1301
+ (user?.verifiedCredentials ?? []).filter((verified) => verified.format === JwtVerifiedCredentialFormatEnum.Blockchain).forEach((verifiedWalletAccount) => {
1302
+ const walletAccount = convertVerifiedCredentialToWalletAccount({ verifiedCredential: verifiedWalletAccount }, client);
1303
+ walletAccountsMap.set(walletAccount.id, walletAccount);
1304
+ });
1305
+ return Array.from(walletAccountsMap.values());
1306
+ };
1307
+
1308
+ //#endregion
1309
+ //#region src/modules/wallets/getWalletAccounts/getWalletAccounts.ts
1310
+ /**
1311
+ * Retrieves all wallet accounts associated with the current session.
1312
+ *
1313
+ * This function returns both verified and unverified wallet accounts,
1314
+ * combining data from user credentials and local unverified accounts.
1315
+ * You can differentiate between verified and unverified wallet accounts by
1316
+ * checking the `verifiedCredentialId` property.
1317
+ *
1318
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1319
+ * @returns An array of wallet accounts associated with the session.
1320
+ * @not-instrumented
1321
+ */
1322
+ const getWalletAccounts = (client = getDefaultClient()) => {
1323
+ const { unverifiedWalletAccounts, user } = getCore(client).state.get();
1324
+ return getWalletAccountsFromState({
1325
+ unverifiedWalletAccounts,
1326
+ user
1327
+ }, client);
1328
+ };
1329
+
1330
+ //#endregion
1331
+ //#region src/modules/auth/isSignedIn/isSignedIn.ts
1332
+ /**
1333
+ * Checks if the user is currently signed in to the Dynamic client.
1334
+ *
1335
+ * The client is considered to be in a signed in state if a user has
1336
+ * authenticated or if the client has at least one wallet connected.
1337
+ *
1338
+ * @deprecated What counts as "signed in" is your app's business logic, not the
1339
+ * SDK's. This helper bakes in one opinion (a user OR any connected wallet),
1340
+ * which rarely matches every app and forces a dependency on us for every
1341
+ * variation. Compose your own check from the underlying primitives instead —
1342
+ * e.g. `Boolean(client.user) || isAnyWalletAccountConnected(client)` — and
1343
+ * layer in whatever your app requires (device registration, completed
1344
+ * onboarding, satisfied MFA, a required embedded wallet, …). See the
1345
+ * "Check if signed in" guide:
1346
+ * https://www.dynamic.xyz/docs/javascript/user-session-management
1347
+ *
1348
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1349
+ * @returns True if the user is signed in, false otherwise.
1350
+ * @not-instrumented
1351
+ */
1352
+ const isSignedIn = (client = getDefaultClient()) => Boolean(client.user || getWalletAccounts(client).length > 0);
1353
+
1354
+ //#endregion
1355
+ //#region src/services/storage/createLocalStorageAdapter/createLocalStorageAdapter.native.ts
1356
+ const NAMESPACE = "dynamic";
1357
+ const namespaceKey = (key) => `${NAMESPACE}:${key}`;
1358
+ /**
1359
+ * Creates a localStorage adapter for React Native.
1360
+ * Routes operations based on the `storageTier` option:
1361
+ * - `'default'`: uses AsyncStorage
1362
+ * - `'secure'`: uses react-native-keychain
1363
+ * @not-instrumented
1364
+ */
1365
+ const createLocalStorageAdapter = () => {
1366
+ return {
1367
+ getItem: async (key, options) => {
1368
+ if (options.storageTier === "secure") {
1369
+ const result = await getGenericPassword({ service: key });
1370
+ if (!result) return null;
1371
+ return result.password;
1372
+ } else return AsyncStorage.getItem(namespaceKey(key));
1373
+ },
1374
+ removeItem: async (key, options) => {
1375
+ if (options.storageTier === "secure") await resetGenericPassword({ service: key });
1376
+ else await AsyncStorage.removeItem(namespaceKey(key));
1377
+ },
1378
+ setItem: async (key, value, options) => {
1379
+ if (options.storageTier === "secure") await setGenericPassword(key, value, { service: key });
1380
+ else await AsyncStorage.setItem(namespaceKey(key), value);
1381
+ }
1382
+ };
1383
+ };
1384
+
1385
+ //#endregion
1386
+ //#region src/services/storage/createStorageKeySchema/createStorageKeySchema.ts
1387
+ /** @not-instrumented */
1388
+ const createStorageKeySchema = (params) => {
1389
+ return params;
1390
+ };
1391
+
1392
+ //#endregion
1393
+ //#region src/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.ts
1394
+ /**
1395
+ * The schema to track the expiration time of the project settings.
1396
+ */
1397
+ const projectSettingsExpirationStorageKeySchema = createStorageKeySchema({
1398
+ key: "projectSettingsExpiration",
1399
+ schema: z.number()
1400
+ });
1401
+
1402
+ //#endregion
1403
+ //#region src/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.ts
1404
+ /**
1405
+ * Expiration time of the project settings in milliseconds.
1406
+ */
1407
+ const PROJECT_SETTINGS_EXPIRATION_TIME = 1e3 * 60 * 5;
1408
+ /**
1409
+ * Fetches and updates the project settings from the API.
1410
+ *
1411
+ * This function retrieves the latest project configuration settings
1412
+ * from Dynamic's servers, including authentication options, enabled chains,
1413
+ * and security configurations. The settings are cached for performance.
1414
+ *
1415
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1416
+ * @returns A promise that resolves to the updated project settings.
1417
+ * @not-instrumented
1418
+ */
1419
+ const fetchProjectSettings = async (client = getDefaultClient()) => {
1420
+ const core = getCore(client);
1421
+ const currentExpiration = await core.storage.getItem(projectSettingsExpirationStorageKeySchema);
1422
+ if (Boolean(client.projectSettings) && !(currentExpiration && currentExpiration < Date.now()) && isSignedIn(client)) return client.projectSettings;
1423
+ const apiClient = createApiClient({}, client);
1424
+ core.logger.debug("[fetchProjectSettings] Fetching project settings...");
1425
+ const doFetch = async () => apiClient.getEnvironmentSettings({
1426
+ environmentId: core.environmentId,
1427
+ sdkVersion: `${CLIENT_SDK_NAME}/${core.version}`
1428
+ }, { credentials: "omit" });
1429
+ const projectSettings = await retryOnFail({
1430
+ fn: doFetch,
1431
+ maxRetries: 2
1432
+ });
1433
+ core.state.set({ projectSettings: projectSettings ?? null });
1434
+ await core.storage.setItem(projectSettingsExpirationStorageKeySchema, Date.now() + PROJECT_SETTINGS_EXPIRATION_TIME);
1435
+ return projectSettings;
1436
+ };
1437
+
1438
+ //#endregion
1439
+ //#region src/modules/sessionKeys/generateSessionKeys/generateSessionKeys.ts
1440
+ /** @not-instrumented */
1441
+ const generateSessionKeys = async (client) => {
1442
+ const core = getCore(client);
1443
+ await core.keychain.removeKey("session");
1444
+ const publicKey = await core.keychain.generateKey("session");
1445
+ assertDefined(publicKey, "Public key not found");
1446
+ core.state.set({ sessionKeys: publicKey });
1447
+ return { publicKey };
1448
+ };
1449
+
1450
+ //#endregion
1451
+ //#region src/errors/NoWalletProviderFoundError.ts
1452
+ var NoWalletProviderFoundError = class extends BaseError {
1453
+ constructor({ walletProviderKey }) {
1454
+ super({
1455
+ cause: null,
1456
+ code: "no_wallet_provider_found_error",
1457
+ docsUrl: null,
1458
+ name: "NoWalletProviderFoundError",
1459
+ shortMessage: `No wallet provider found with key: ${walletProviderKey}`
1460
+ });
1461
+ }
1462
+ };
1463
+
1464
+ //#endregion
1465
+ //#region src/services/runtimeServices/createRuntimeServiceAccessKey/createRuntimeServiceAccessKey.ts
1466
+ /**
1467
+ * Creates a service accessor function that manages service instantiation and caching.
1468
+ * The returned function will either retrieve an existing service from the registry or
1469
+ * create a new one using the provided builder function.
1470
+ *
1471
+ * @template - The type of service to be created/accessed
1472
+ * @param key - Unique identifier for the service in the registry
1473
+ * @param builder - Function that creates the service instance when called with a DynamicClient
1474
+ * @not-instrumented
1475
+ */
1476
+ const createRuntimeServiceAccessKey = (key, builder) => (client) => {
1477
+ const { runtimeServices } = getCore(client);
1478
+ const currentService = runtimeServices.getByKey(key);
1479
+ if (currentService) return currentService;
1480
+ const service = builder(client);
1481
+ runtimeServices.register(key, service);
1482
+ return service;
1483
+ };
1484
+
1485
+ //#endregion
1486
+ //#region src/modules/wallets/walletProviderRegistry/createWalletProviderRegistry/createWalletProviderRegistry.ts
1487
+ /**
1488
+ * Creates a new wallet provider registry that manages wallet providers with priority-based registration.
1489
+ *
1490
+ * @returns The wallet provider registry instance
1491
+ *
1492
+ * @example
1493
+ * ```typescript
1494
+ * const registry = createWalletProviderRegistry();
1495
+ *
1496
+ * registry.register({
1497
+ * priority: WalletProviderPriority.WALLET_SDK,
1498
+ * walletProvider: myWalletProvider
1499
+ * });
1500
+ *
1501
+ * const provider = registry.getByKey('my-wallet-key');
1502
+ * const providers = registry.listProviders();
1503
+ * ```
1504
+ * @not-instrumented
1505
+ */
1506
+ const createWalletProviderRegistry = (client) => {
1507
+ const registry = /* @__PURE__ */ new Map();
1508
+ return {
1509
+ getByKey: (key) => registry.get(key)?.walletProvider,
1510
+ listProviderEntries: () => Array.from(registry.values()),
1511
+ listProviders: () => Array.from(registry.values()).map((v) => v.walletProvider),
1512
+ register: (args) => {
1513
+ const existingEntry = registry.get(args.walletProvider.key);
1514
+ if (existingEntry) {
1515
+ if (existingEntry.priority < args.priority) {
1516
+ registry.set(args.walletProvider.key, args);
1517
+ emitEvent({
1518
+ args: { walletProviderKey: args.walletProvider.key },
1519
+ event: "walletProviderChanged"
1520
+ }, client);
1521
+ }
1522
+ } else {
1523
+ registry.set(args.walletProvider.key, args);
1524
+ emitEvent({
1525
+ args: { walletProvider: args.walletProvider },
1526
+ event: "walletProviderRegistered"
1527
+ }, client);
1528
+ emitEvent({
1529
+ args: { walletProviderKey: args.walletProvider.key },
1530
+ event: "walletProviderChanged"
1531
+ }, client);
1532
+ }
1533
+ },
1534
+ unregister: (key) => {
1535
+ registry.delete(key);
1536
+ emitEvent({
1537
+ args: { walletProviderKey: key },
1538
+ event: "walletProviderUnregistered"
1539
+ }, client);
1540
+ }
1541
+ };
1542
+ };
1543
+
1544
+ //#endregion
1545
+ //#region src/modules/wallets/walletProviderRegistry/getWalletProviderRegistry/getWalletProviderRegistry.ts
1546
+ /**
1547
+ * This function provides access to a shared instance of the wallet provider registry.
1548
+ *
1549
+ * It ensures that the same registry instance is used throughout the client to maintaining
1550
+ * consistency of registered wallet providers across different parts of the codebase.
1551
+ *
1552
+ * @returns The wallet provider registry instance
1553
+ *
1554
+ * @example
1555
+ * ```typescript
1556
+ * // Get the registry instance
1557
+ * const registry = getWalletProviderRegistry();
1558
+ *
1559
+ * // Register a wallet provider
1560
+ * registry.register({
1561
+ * priority: WalletProviderPriority.WALLET_SDK,
1562
+ * walletProvider: myWalletProvider
1563
+ * });
1564
+ *
1565
+ * // Retrieve a specific provider
1566
+ * const provider = registry.getByKey('metamaskevm');
1567
+ * ```
1568
+ */
1569
+ const getWalletProviderRegistry = createRuntimeServiceAccessKey("walletProviderRegistry", (client) => createWalletProviderRegistry(client));
1570
+
1571
+ //#endregion
1572
+ //#region src/modules/wallets/walletProviderRegistry/walletProviderRegistry.types.ts
1573
+ let WalletProviderPriority = /* @__PURE__ */ function(WalletProviderPriority$1) {
1574
+ /**
1575
+ * Highest priority should be used by wallet providers that implement
1576
+ * the most reliable wallet integration.
1577
+ * example: The SDK provided by the wallet provider.
1578
+ */
1579
+ WalletProviderPriority$1[WalletProviderPriority$1["WALLET_SDK"] = 100] = "WALLET_SDK";
1580
+ /**
1581
+ * Medium priority should be used by wallet providers that implement
1582
+ * a wallet integration via some reliable standard.
1583
+ * example: A wallet provider that uses EIP6963 announcement.
1584
+ */
1585
+ WalletProviderPriority$1[WalletProviderPriority$1["WALLET_SELF_ANNOUNCEMENT_STANDARD"] = 50] = "WALLET_SELF_ANNOUNCEMENT_STANDARD";
1586
+ /**
1587
+ * Low priority should be used by wallet providers that implement
1588
+ * a wallet integration on a less reliable standard.
1589
+ * example: A wallet provider that uses window.ethereum, where the
1590
+ * window key can be overridden by other extensions.
1591
+ */
1592
+ WalletProviderPriority$1[WalletProviderPriority$1["WINDOW_INJECT"] = 20] = "WINDOW_INJECT";
1593
+ return WalletProviderPriority$1;
1594
+ }({});
1595
+
1596
+ //#endregion
1597
+ //#region src/modules/wallets/utils/getWalletProviderFromWalletAccount/getWalletProviderFromWalletAccount.ts
1598
+ /** @not-instrumented */
1599
+ const getWalletProviderFromWalletAccount = ({ walletAccount }, client) => {
1600
+ const walletProvider = getWalletProviderRegistry(client).getByKey(walletAccount.walletProviderKey);
1601
+ if (!walletProvider) throw new NoWalletProviderFoundError({ walletProviderKey: walletAccount.walletProviderKey });
1602
+ return walletProvider;
1603
+ };
1604
+
1605
+ //#endregion
1606
+ //#region src/modules/wallets/utils/getAvailableWalletProvidersFromWalletAccounts/getAvailableWalletProvidersFromWalletAccounts.ts
1607
+ /** @not-instrumented */
1608
+ const getAvailableWalletProvidersFromWalletAccounts = (client) => {
1609
+ const core = getCore(client);
1610
+ const walletProvidersMap = /* @__PURE__ */ new Map();
1611
+ getWalletAccounts(client).forEach((walletAccount) => {
1612
+ if (walletProvidersMap.has(walletAccount.walletProviderKey)) return;
1613
+ try {
1614
+ const walletProvider = getWalletProviderFromWalletAccount({ walletAccount }, client);
1615
+ walletProvidersMap.set(walletAccount.walletProviderKey, walletProvider);
1616
+ } catch (error) {
1617
+ core.logger.debug("Wallet provider not found for wallet account", {
1618
+ error,
1619
+ walletAccount: walletAccount.address
1620
+ });
1621
+ }
1622
+ });
1623
+ return Array.from(walletProvidersMap.values());
1624
+ };
1625
+
1626
+ //#endregion
1627
+ //#region src/modules/wallets/destroyWalletProviders/destroyWalletProviders.ts
1628
+ /**
1629
+ * Tear down every wallet provider on the client.
1630
+ *
1631
+ * Each provider's `destroy` is responsible for its own local + remote
1632
+ * cleanup. We swallow errors so a failing destroy on one provider does not
1633
+ * block teardown of the others (e.g. during logout).
1634
+ *
1635
+ * @not-instrumented
1636
+ */
1637
+ const destroyWalletProviders = async ({ reason }, client) => {
1638
+ const core = getCore(client);
1639
+ const walletProviders = getAvailableWalletProvidersFromWalletAccounts(client);
1640
+ await Promise.all(walletProviders.map(async (walletProvider) => {
1641
+ if (!walletProvider.destroy) return;
1642
+ try {
1643
+ await walletProvider.destroy({ reason });
1644
+ } catch (err) {
1645
+ core.logger.error(`Error destroying wallet provider ${walletProvider.key}`, err);
1646
+ }
1647
+ }));
1648
+ };
1649
+
1650
+ //#endregion
1651
+ //#region src/modules/auth/consts.ts
1652
+ const DYNAMIC_AUTH_COOKIE_NAME = "DYNAMIC_JWT_TOKEN";
1653
+
1654
+ //#endregion
1655
+ //#region src/modules/auth/logoutWithReason/logoutWithReason.ts
1656
+ /**
1657
+ * Logs the user out with an explicit reason.
1658
+ *
1659
+ * Revokes the session, clears auth state, terminates wallet providers, and
1660
+ * emits the `logout` client event with the given reason. The reason is also
1661
+ * captured as an argument on the function-instrumentation event, which is
1662
+ * how Datadog distinguishes between different logout causes.
1663
+ *
1664
+ * Use this instead of the public `logout` when triggering a logout from
1665
+ * internal or extension code — the caller owns the reason string, so the
1666
+ * telemetry correctly attributes *why* the logout happened.
1667
+ *
1668
+ * @param params - The logout params.
1669
+ * @param params.reason - Why the logout is being triggered. Extension authors
1670
+ * needing a reason outside the SDK catalog can cast with `as LogoutReason`.
1671
+ * @param client - The Dynamic client instance.
1672
+ * @instrumented
1673
+ */
1674
+ const logoutWithReason = async ({ reason }, client) => {
1675
+ const core = getCore(client);
1676
+ core.logger.debug("[logoutWithReason] Logging out...", { reason });
1677
+ await destroyWalletProviders({ reason }, client);
1678
+ if (client.user !== null) {
1679
+ const apiClient = createApiClient({ skipSessionExpiryLogout: true }, client);
1680
+ try {
1681
+ await apiClient.revokeSession({ environmentId: core.environmentId });
1682
+ } catch (error) {
1683
+ core.logger.error("Failed to revoke session", error);
1684
+ }
1685
+ /**
1686
+ * This deletes the auth cookie if it exists.
1687
+ * If the cookie doesn't exist, this sets a new cookie that expires immediately.
1688
+ */
1689
+ if (isCookieEnabled(client)) setCookie(`${DYNAMIC_AUTH_COOKIE_NAME}=; Max-Age=-99999999; path=/; SameSite=Lax`);
1690
+ }
1691
+ await core.keychain.removeKey("session");
1692
+ core.state.set({
1693
+ captchaToken: null,
1694
+ elevatedAccessTokens: [],
1695
+ legacyToken: null,
1696
+ mfaToken: null,
1697
+ sessionExpiresAt: null,
1698
+ sessionKeys: null,
1699
+ token: null,
1700
+ unverifiedWalletAccounts: [],
1701
+ user: null
1702
+ });
1703
+ emitEvent({
1704
+ args: { reason },
1705
+ event: "logout"
1706
+ }, client);
1707
+ fetchProjectSettings(client);
1708
+ generateSessionKeys(client);
1709
+ };
1710
+ const __logoutWithReason_impl = logoutWithReason;
1711
+ const __logoutWithReason_wrapped = instrumentFunction({
1712
+ fn: __logoutWithReason_impl,
1713
+ functionName: "logoutWithReason",
1714
+ getCore: () => {
1715
+ try {
1716
+ return getCore(getDefaultClient());
1717
+ } catch {
1718
+ return;
1719
+ }
1720
+ }
1721
+ });
1722
+
1723
+ //#endregion
1724
+ //#region src/modules/apiClient/utils/sessionExpiryLogoutMiddleware/createSessionExpiryLogoutMiddleware.ts
1725
+ const UNAUTHORIZED_STATUS = 401;
1726
+ /**
1727
+ * Creates middleware that ends the local session when an *authenticated*
1728
+ * request is rejected with a 401.
1729
+ *
1730
+ * A 401 on a request that carried an authenticated session means the backend
1731
+ * rejected our credentials, so the local session is stale and must be cleared.
1732
+ * The check is purely local (`client.user`) — we deliberately do not
1733
+ * re-validate over the network, because the 401 itself is the rejection signal
1734
+ * and re-validating would route back through this same middleware.
1735
+ *
1736
+ * Requests made without an authenticated session (e.g. pre-auth probes) are
1737
+ * ignored — there is no session to invalidate. Endpoints that legitimately
1738
+ * return 401 for non-session reasons opt out of this behavior by omitting the
1739
+ * middleware (see `skipSessionExpiryLogout` on `createApiClient`).
1740
+ *
1741
+ * This middleware runs before the error-conversion middleware so it observes
1742
+ * every 401 regardless of response body. The logout is fired as a side effect
1743
+ * and the response is returned unchanged, so the downstream error middleware
1744
+ * still throws the typed error to the caller.
1745
+ *
1746
+ * @param client - The Dynamic client instance.
1747
+ * @not-instrumented
1748
+ */
1749
+ const createSessionExpiryLogoutMiddleware = (client) => ({ post: async (context) => {
1750
+ if (context.response.status === UNAUTHORIZED_STATUS && client.user !== null) __logoutWithReason_wrapped({ reason: "session-revoked" }, client).catch((error) => {
1751
+ getCore(client).logger.error("Failed to log out after unauthorized response", error);
1752
+ });
1753
+ return context.response;
1754
+ } });
1755
+
1756
+ //#endregion
1757
+ //#region src/errors/UnauthorizedError.ts
1758
+ var UnauthorizedError = class extends BaseError {
1759
+ constructor({ cause }) {
1760
+ super({
1761
+ cause,
1762
+ code: "unauthorized_error",
1763
+ docsUrl: null,
1764
+ name: "UnauthorizedError",
1765
+ shortMessage: "Unauthorized"
1766
+ });
1767
+ }
1768
+ };
1769
+
1770
+ //#endregion
1771
+ //#region src/modules/apiClient/utils/unauthorizedMiddleware/createUnauthorizedMiddleware.ts
1772
+ /** @not-instrumented */
1773
+ const createUnauthorizedMiddleware = () => ({ post: async (context) => {
1774
+ if (context.response.status === 401) {
1775
+ let cause = null;
1776
+ try {
1777
+ const errorBody = await context.response.clone().json();
1778
+ if (errorBody && "error" in errorBody && typeof errorBody.error === "string") cause = new Error(errorBody.error);
1779
+ } catch {}
1780
+ throw new UnauthorizedError({ cause });
1781
+ }
1782
+ return context.response;
1783
+ } });
1784
+
1785
+ //#endregion
1786
+ //#region src/modules/apiClient/createApiClient.ts
1787
+ /**
1788
+ * Returns a new instance of the SDK API client.
1789
+ *
1790
+ * This is not meant for storing, as it is very light we can create it whenever needed.
1791
+ * @not-instrumented
1792
+ */
1793
+ const createApiClient = (options = {}, client) => {
1794
+ const core = getCore(client);
1795
+ const coreState = core.state.get();
1796
+ const settings = {
1797
+ basePath: core.apiBaseUrl,
1798
+ headers: {
1799
+ "Content-Type": "application/json",
1800
+ [DYNAMIC_API_VERSION_HEADER]: `API/${DYNAMIC_SDK_API_VERSION}`,
1801
+ [DYNAMIC_REQUEST_ID_HEADER]: randomString({ length: 50 }),
1802
+ [DYNAMIC_SDK_SESSION_ID_HEADER]: core.sdkSessionId,
1803
+ [DYNAMIC_SDK_VERSION_HEADER]: `${CLIENT_SDK_NAME}/${version}`,
1804
+ ...core.getApiHeaders(),
1805
+ ...options.headers
1806
+ }
1807
+ };
1808
+ if (core.metadata?.universalLink) settings.headers["Origin"] = core.metadata.universalLink;
1809
+ if (client.token) settings.headers.Authorization = `Bearer ${client.token}`;
1810
+ if (client.projectSettings && isCookieEnabled(client)) settings.credentials = "include";
1811
+ if (options.includeMfaToken && coreState.mfaToken) settings.headers[MFA_TOKEN_HEADER] = coreState.mfaToken;
1812
+ if (options.elevatedAccessTokenScope) {
1813
+ const elevatedToken = __getElevatedAccessToken_wrapped({ scope: options.elevatedAccessTokenScope }, client);
1814
+ if (elevatedToken) settings.headers[ELEVATED_ACCESS_TOKEN_HEADER] = elevatedToken;
1815
+ }
1816
+ const sessionPublicKey = getSessionKeys(client)?.publicKey;
1817
+ const isSessionPublicKeyHeaderPresent = settings.headers[SESSION_PUBLIC_KEY_HEADER] !== void 0;
1818
+ if (sessionPublicKey && !isSessionPublicKeyHeaderPresent) settings.headers[SESSION_PUBLIC_KEY_HEADER] = sessionPublicKey;
1819
+ return new SDKApi(new Configuration({
1820
+ ...settings,
1821
+ fetchApi: core.fetch,
1822
+ middleware: [
1823
+ createDeviceSignatureHeadersMiddleware(client),
1824
+ ...options.skipSessionExpiryLogout ? [] : [createSessionExpiryLogoutMiddleware(client)],
1825
+ createConvertToApiErrorMiddleware({ errorMappers: [...options.errorMappers || [], clientErrorMapper] }),
1826
+ createUnauthorizedMiddleware()
1827
+ ]
1828
+ }));
1829
+ };
1830
+
1831
+ //#endregion
1832
+ //#region src/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.ts
1833
+ /**
1834
+ * Fetches a batch of nonces from the API.
1835
+ *
1836
+ * Prefetching is critical for iOS deep link wallet providers (e.g. Phantom
1837
+ * redirect). On iOS, a network request (like fetching a nonce) between a user
1838
+ * action and a deeplink call will break the gesture chain, causing iOS to
1839
+ * silently ignore the deeplink. By prefetching nonces ahead of time,
1840
+ * `getNonce` can return synchronously from cache and the deeplink fires
1841
+ * without an interrupting network round-trip.
1842
+ *
1843
+ * New nonces are **appended** to the existing pool so that unconsumed entries
1844
+ * are not discarded by a background refetch.
1845
+ * @not-instrumented
1846
+ */
1847
+ const fetchAndStoreNonces = async (client) => {
1848
+ const core = getCore(client);
1849
+ const { environmentId } = core;
1850
+ const { nonces } = await createApiClient({}, client).getNonces({
1851
+ count: NONCE_POOL_SIZE,
1852
+ environmentId
1853
+ });
1854
+ const existing = core.state.get().prefetchedNonces;
1855
+ core.state.set({
1856
+ prefetchedNonces: [...existing, ...nonces],
1857
+ prefetchedNoncesExpiration: Date.now() + NONCE_POOL_EXPIRATION_TIME
1858
+ });
1859
+ };
1860
+
1115
1861
  //#endregion
1116
1862
  //#region src/constants.ts
1117
1863
  const SDK_API_CORE_VERSION = dependencies["@dynamic-labs/sdk-api-core"];
@@ -1142,5 +1888,5 @@ var InvalidParamError = class extends BaseError {
1142
1888
  };
1143
1889
 
1144
1890
  //#endregion
1145
- export { getUserAgent as A, getCore as B, isCookieEnabled as C, instrumentFunction as D, __getElevatedAccessToken_wrapped as E, NONCE_POOL_SIZE as F, version as H, getDefaultClient as I, setDefaultClient as L, randomString as M, CLIENT_SDK_NAME as N, scrubParameters as O, DYNAMIC_SDK_API_VERSION as P, ClientNotFoundError as R, getSessionKeys as S, ValueMustBeDefinedError as T, name as V, MfaRateLimitedError as _, DYNAMIC_ICONIC_SPRITE_URL as a, InvalidExternalAuthError as b, CHAINS_INFO_MAP as c, UnauthorizedError as d, createDeviceSignatureHeadersMiddleware as f, SandboxMaximumThresholdReachedError as g, getNonce as h, DYNAMIC_WAAS_METADATA as i, extractSessionId as j, DEFAULT_PII_FIELDS as k, fetchAndStoreNonces as l, getDeviceSigner as m, DEFAULT_WAAS_BASE_API_URL as n, SDK_API_CORE_VERSION as o, getHeadersForNonceSignedByDeviceSigners as p, DEFAULT_WAAS_BASE_MPC_RELAY_API_URL as r, getChainFromVerifiedCredentialChain as s, InvalidParamError as t, createApiClient as u, MfaInvalidOtpError as v, assertDefined as w, APIError as x, LinkCredentialError as y, BaseError as z };
1146
- //# sourceMappingURL=InvalidParamError-CDmVW2DS.native.esm.js.map
1891
+ export { instrumentFunction as $, splitWalletProviderKey as A, getDeviceSigner as B, getWalletAccountsFromState as C, CHAINS_INFO_MAP as D, getChainFromVerifiedCredentialChain as E, onEvent as F, LinkCredentialError as G, SandboxMaximumThresholdReachedError as H, onceEvent as I, getSessionKeys as J, InvalidExternalAuthError as K, setCookie as L, retryOnFail as M, emitEvent as N, formatWalletAccountId as O, offEvent as P, __getElevatedAccessToken_wrapped as Q, createDeviceSignatureHeadersMiddleware as R, getWalletAccounts as S, normalizeWalletNameWithChain as T, MfaRateLimitedError as U, getNonce as V, MfaInvalidOtpError as W, assertDefined as X, isCookieEnabled as Y, ValueMustBeDefinedError as Z, generateSessionKeys as _, DYNAMIC_ICONIC_SPRITE_URL as a, CLIENT_SDK_NAME as at, createLocalStorageAdapter as b, createApiClient as c, getDefaultClient as ct, DYNAMIC_AUTH_COOKIE_NAME as d, BaseError as dt, scrubParameters as et, getWalletProviderFromWalletAccount as f, getCore as ft, NoWalletProviderFoundError as g, createRuntimeServiceAccessKey as h, DYNAMIC_WAAS_METADATA as i, randomString as it, InvalidWalletProviderKeyError as j, normalizeAddress as k, UnauthorizedError as l, setDefaultClient as lt, getWalletProviderRegistry as m, version as mt, DEFAULT_WAAS_BASE_API_URL as n, getUserAgent as nt, SDK_API_CORE_VERSION as o, DYNAMIC_SDK_API_VERSION as ot, WalletProviderPriority as p, name as pt, APIError as q, DEFAULT_WAAS_BASE_MPC_RELAY_API_URL as r, extractSessionId as rt, fetchAndStoreNonces as s, NONCE_POOL_SIZE as st, InvalidParamError as t, DEFAULT_PII_FIELDS as tt, __logoutWithReason_wrapped as u, ClientNotFoundError as ut, fetchProjectSettings as v, formatWalletProviderKey as w, isSignedIn as x, createStorageKeySchema as y, getHeadersForNonceSignedByDeviceSigners as z };
1892
+ //# sourceMappingURL=InvalidParamError-BIptAjbC.native.esm.js.map