@dynamic-labs-sdk/client 1.4.0 → 1.5.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 (179) hide show
  1. package/dist/{InvalidParamError-DEmLKJKZ.cjs → InvalidParamError-DKJhDrK8.cjs} +1007 -116
  2. package/dist/InvalidParamError-DKJhDrK8.cjs.map +1 -0
  3. package/dist/{InvalidParamError-BPMi0iWC.esm.js → InvalidParamError-DWjMfOZ5.esm.js} +800 -92
  4. package/dist/InvalidParamError-DWjMfOZ5.esm.js.map +1 -0
  5. package/dist/{InvalidParamError-CDmVW2DS.native.esm.js → InvalidParamError-DkAMYJOW.native.esm.js} +833 -92
  6. package/dist/InvalidParamError-DkAMYJOW.native.esm.js.map +1 -0
  7. package/dist/{NotWaasWalletAccountError-Cntietge.esm.js → NotWaasWalletAccountError-BVrvQzLz.native.esm.js} +4 -4
  8. package/dist/NotWaasWalletAccountError-BVrvQzLz.native.esm.js.map +1 -0
  9. package/dist/{NotWaasWalletAccountError-Chpne8_Q.native.esm.js → NotWaasWalletAccountError-C7NUlvvM.esm.js} +4 -4
  10. package/dist/NotWaasWalletAccountError-C7NUlvvM.esm.js.map +1 -0
  11. package/dist/{NotWaasWalletAccountError-BZsBHRQe.cjs → NotWaasWalletAccountError-CHzpa9kk.cjs} +4 -4
  12. package/dist/NotWaasWalletAccountError-CHzpa9kk.cjs.map +1 -0
  13. package/dist/core.cjs +45 -23
  14. package/dist/core.cjs.map +1 -1
  15. package/dist/core.esm.js +29 -8
  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/exports/core.d.ts +4 -0
  20. package/dist/exports/core.d.ts.map +1 -1
  21. package/dist/exports/index.d.ts +12 -0
  22. package/dist/exports/index.d.ts.map +1 -1
  23. package/dist/{getNetworkProviderFromNetworkId-szJOsbQN.cjs → getNetworkProviderFromNetworkId-BJ27N-7S.cjs} +44 -341
  24. package/dist/getNetworkProviderFromNetworkId-BJ27N-7S.cjs.map +1 -0
  25. package/dist/{getNetworkProviderFromNetworkId-JGrKwBj7.native.esm.js → getNetworkProviderFromNetworkId-Bs1kQdWk.native.esm.js} +38 -299
  26. package/dist/getNetworkProviderFromNetworkId-Bs1kQdWk.native.esm.js.map +1 -0
  27. package/dist/{getNetworkProviderFromNetworkId-CEeFL-gV.esm.js → getNetworkProviderFromNetworkId-Cqp9eRSs.esm.js} +42 -270
  28. package/dist/getNetworkProviderFromNetworkId-Cqp9eRSs.esm.js.map +1 -0
  29. package/dist/{getSignedSessionId-BOx1nFt_.esm.js → getSignedSessionId-CDdKrnw6.esm.js} +3 -3
  30. package/dist/{getSignedSessionId-BOx1nFt_.esm.js.map → getSignedSessionId-CDdKrnw6.esm.js.map} +1 -1
  31. package/dist/{getSignedSessionId-BxOK-Tdo.cjs → getSignedSessionId-CHDHr-hY.cjs} +3 -3
  32. package/dist/{getSignedSessionId-BxOK-Tdo.cjs.map → getSignedSessionId-CHDHr-hY.cjs.map} +1 -1
  33. package/dist/{getSignedSessionId-B5DikCap.native.esm.js → getSignedSessionId-D3KQrN8W.native.esm.js} +3 -3
  34. package/dist/{getSignedSessionId-B5DikCap.native.esm.js.map → getSignedSessionId-D3KQrN8W.native.esm.js.map} +1 -1
  35. package/dist/getVerifiedCredentialForWalletAccount-BuUCX040.esm.js +269 -0
  36. package/dist/getVerifiedCredentialForWalletAccount-BuUCX040.esm.js.map +1 -0
  37. package/dist/getVerifiedCredentialForWalletAccount-Ciac5d5L.native.esm.js +269 -0
  38. package/dist/getVerifiedCredentialForWalletAccount-Ciac5d5L.native.esm.js.map +1 -0
  39. package/dist/getVerifiedCredentialForWalletAccount-gCx0smU8.cjs +346 -0
  40. package/dist/getVerifiedCredentialForWalletAccount-gCx0smU8.cjs.map +1 -0
  41. package/dist/index.cjs +580 -253
  42. package/dist/index.cjs.map +1 -1
  43. package/dist/index.esm.js +514 -194
  44. package/dist/index.esm.js.map +1 -1
  45. package/dist/index.native.esm.js +511 -191
  46. package/dist/index.native.esm.js.map +1 -1
  47. package/dist/{isMfaRequiredForAction-DUvZEpjA.native.esm.js → isMfaRequiredForAction-B0xNvBpU.native.esm.js} +2 -2
  48. package/dist/{isMfaRequiredForAction-DUvZEpjA.native.esm.js.map → isMfaRequiredForAction-B0xNvBpU.native.esm.js.map} +1 -1
  49. package/dist/{isMfaRequiredForAction-6N6JB7wa.cjs → isMfaRequiredForAction-CLMvTTwl.cjs} +2 -2
  50. package/dist/{isMfaRequiredForAction-6N6JB7wa.cjs.map → isMfaRequiredForAction-CLMvTTwl.cjs.map} +1 -1
  51. package/dist/{isMfaRequiredForAction-D9p_du8C.esm.js → isMfaRequiredForAction-C_QPI1LH.esm.js} +2 -2
  52. package/dist/{isMfaRequiredForAction-D9p_du8C.esm.js.map → isMfaRequiredForAction-C_QPI1LH.esm.js.map} +1 -1
  53. package/dist/modules/apiClient/apiClient.types.d.ts +12 -0
  54. package/dist/modules/apiClient/apiClient.types.d.ts.map +1 -1
  55. package/dist/modules/apiClient/createApiClient.d.ts.map +1 -1
  56. package/dist/modules/apiClient/utils/sessionExpiryLogoutMiddleware/createSessionExpiryLogoutMiddleware.d.ts +27 -0
  57. package/dist/modules/apiClient/utils/sessionExpiryLogoutMiddleware/createSessionExpiryLogoutMiddleware.d.ts.map +1 -0
  58. package/dist/modules/auth/isSignedIn/isSignedIn.d.ts +11 -1
  59. package/dist/modules/auth/isSignedIn/isSignedIn.d.ts.map +1 -1
  60. package/dist/modules/auth/logoutReason.d.ts +1 -1
  61. package/dist/modules/auth/logoutReason.d.ts.map +1 -1
  62. package/dist/modules/auth/logoutWithReason/logoutWithReason.d.ts.map +1 -1
  63. package/dist/modules/balances/getBalances/getBalances.d.ts +9 -45
  64. package/dist/modules/balances/getBalances/getBalances.d.ts.map +1 -1
  65. package/dist/modules/balances/getMultichainBalances/getMultichainBalances.d.ts +13 -20
  66. package/dist/modules/balances/getMultichainBalances/getMultichainBalances.d.ts.map +1 -1
  67. package/dist/modules/balances/getMultichainTokenBalances/getMultichainTokenBalances.d.ts +26 -0
  68. package/dist/modules/balances/getMultichainTokenBalances/getMultichainTokenBalances.d.ts.map +1 -0
  69. package/dist/modules/balances/getMultichainTokenBalances/index.d.ts +2 -0
  70. package/dist/modules/balances/getMultichainTokenBalances/index.d.ts.map +1 -0
  71. package/dist/modules/balances/getTokenBalances/getTokenBalances.d.ts +56 -0
  72. package/dist/modules/balances/getTokenBalances/getTokenBalances.d.ts.map +1 -0
  73. package/dist/modules/balances/getTokenBalances/index.d.ts +3 -0
  74. package/dist/modules/balances/getTokenBalances/index.d.ts.map +1 -0
  75. package/dist/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.d.ts.map +1 -1
  76. package/dist/modules/funding/moonpay/errors/MoonPayCurrenciesFetchError.d.ts +5 -0
  77. package/dist/modules/funding/moonpay/errors/MoonPayCurrenciesFetchError.d.ts.map +1 -0
  78. package/dist/modules/funding/moonpay/errors/MoonPayInvalidUrlError.d.ts +5 -0
  79. package/dist/modules/funding/moonpay/errors/MoonPayInvalidUrlError.d.ts.map +1 -0
  80. package/dist/modules/funding/moonpay/errors/MoonPayProviderNotAvailableError.d.ts +5 -0
  81. package/dist/modules/funding/moonpay/errors/MoonPayProviderNotAvailableError.d.ts.map +1 -0
  82. package/dist/modules/funding/moonpay/getMoonPayCurrencies/getMoonPayCurrencies.d.ts +14 -0
  83. package/dist/modules/funding/moonpay/getMoonPayCurrencies/getMoonPayCurrencies.d.ts.map +1 -0
  84. package/dist/modules/funding/moonpay/getMoonPayCurrencies/index.d.ts +2 -0
  85. package/dist/modules/funding/moonpay/getMoonPayCurrencies/index.d.ts.map +1 -0
  86. package/dist/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.d.ts +15 -0
  87. package/dist/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.d.ts.map +1 -0
  88. package/dist/modules/funding/moonpay/getMoonPayUrl/index.d.ts +2 -0
  89. package/dist/modules/funding/moonpay/getMoonPayUrl/index.d.ts.map +1 -0
  90. package/dist/modules/funding/moonpay/moonpay.types.d.ts +26 -0
  91. package/dist/modules/funding/moonpay/moonpay.types.d.ts.map +1 -0
  92. package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainFromWalletSchema/getChainFromWalletSchema.d.ts +12 -0
  93. package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainFromWalletSchema/getChainFromWalletSchema.d.ts.map +1 -1
  94. package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainsFromWalletSchema/getChainsFromWalletSchema.d.ts +26 -0
  95. package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainsFromWalletSchema/getChainsFromWalletSchema.d.ts.map +1 -0
  96. package/dist/modules/legacyWalletBook/hasUsableDeeplink/hasUsableDeeplink.d.ts +18 -0
  97. package/dist/modules/legacyWalletBook/hasUsableDeeplink/hasUsableDeeplink.d.ts.map +1 -0
  98. package/dist/modules/legacyWalletBook/legacyWalletBook.types.d.ts +2 -2
  99. package/dist/modules/legacyWalletBook/legacyWalletBook.types.d.ts.map +1 -1
  100. package/dist/modules/swap/executeSwapTransaction/executeSwapTransaction.d.ts +13 -1
  101. package/dist/modules/swap/executeSwapTransaction/executeSwapTransaction.d.ts.map +1 -1
  102. package/dist/modules/user/refreshAuth/refreshAuth.d.ts.map +1 -1
  103. package/dist/modules/walletOptionsCatalogue/buildMetaMaskSdkUriOptions/buildMetaMaskSdkUriOptions.d.ts +27 -0
  104. package/dist/modules/walletOptionsCatalogue/buildMetaMaskSdkUriOptions/buildMetaMaskSdkUriOptions.d.ts.map +1 -0
  105. package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts +26 -0
  106. package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts.map +1 -0
  107. package/dist/modules/walletOptionsCatalogue/buildWalletOption/buildWalletOption.d.ts +11 -4
  108. package/dist/modules/walletOptionsCatalogue/buildWalletOption/buildWalletOption.d.ts.map +1 -1
  109. package/dist/modules/walletOptionsCatalogue/buildWithWalletProviderOptions/buildWithWalletProviderOptions.d.ts.map +1 -1
  110. package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/getInstallationLinkForCurrentPlatform.d.ts +35 -0
  111. package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/getInstallationLinkForCurrentPlatform.d.ts.map +1 -0
  112. package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/index.d.ts +2 -0
  113. package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/index.d.ts.map +1 -0
  114. package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts +6 -1
  115. package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts.map +1 -1
  116. package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts +11 -0
  117. package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts.map +1 -1
  118. package/dist/modules/wallets/constants.d.ts +7 -0
  119. package/dist/modules/wallets/constants.d.ts.map +1 -1
  120. package/dist/modules/wallets/getAvailableWalletProvidersData/getAvailableWalletProvidersData.d.ts.map +1 -1
  121. package/dist/modules/wallets/hasWalletProviderConnectMethod/hasWalletProviderConnectMethod.d.ts +26 -0
  122. package/dist/modules/wallets/hasWalletProviderConnectMethod/hasWalletProviderConnectMethod.d.ts.map +1 -0
  123. package/dist/modules/wallets/hasWalletProviderConnectMethod/index.d.ts +2 -0
  124. package/dist/modules/wallets/hasWalletProviderConnectMethod/index.d.ts.map +1 -0
  125. package/dist/modules/wallets/isAnyWalletAccountConnected/index.d.ts +2 -0
  126. package/dist/modules/wallets/isAnyWalletAccountConnected/index.d.ts.map +1 -0
  127. package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts +14 -0
  128. package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts.map +1 -0
  129. package/dist/modules/wallets/networks/getBalance/getBalance.d.ts +6 -17
  130. package/dist/modules/wallets/networks/getBalance/getBalance.d.ts.map +1 -1
  131. package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts +24 -0
  132. package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts.map +1 -0
  133. package/dist/modules/wallets/networks/getNativeBalance/index.d.ts +2 -0
  134. package/dist/modules/wallets/networks/getNativeBalance/index.d.ts.map +1 -0
  135. package/dist/modules/wallets/walletProvider/walletProvider.types.d.ts +10 -0
  136. package/dist/modules/wallets/walletProvider/walletProvider.types.d.ts.map +1 -1
  137. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  138. package/dist/utils/getChainFromWalletBookIdentifier/getChainFromWalletBookIdentifier.d.ts +22 -0
  139. package/dist/utils/getChainFromWalletBookIdentifier/getChainFromWalletBookIdentifier.d.ts.map +1 -0
  140. package/dist/utils/getChainFromWalletBookIdentifier/index.d.ts +2 -0
  141. package/dist/utils/getChainFromWalletBookIdentifier/index.d.ts.map +1 -0
  142. package/dist/utils/getNativeLinkScheme/getNativeLinkScheme.d.ts +18 -0
  143. package/dist/utils/getNativeLinkScheme/getNativeLinkScheme.d.ts.map +1 -0
  144. package/dist/utils/getNativeLinkScheme/index.d.ts +3 -0
  145. package/dist/utils/getNativeLinkScheme/index.d.ts.map +1 -0
  146. package/dist/utils/isMobile/isMobile.d.ts +8 -0
  147. package/dist/utils/isMobile/isMobile.d.ts.map +1 -1
  148. package/dist/waas.cjs +8 -9
  149. package/dist/waas.cjs.map +1 -1
  150. package/dist/waas.esm.js +3 -3
  151. package/dist/waas.native.esm.js +3 -3
  152. package/dist/waasCore.cjs +3 -4
  153. package/dist/waasCore.cjs.map +1 -1
  154. package/dist/waasCore.esm.js +3 -3
  155. package/dist/waasCore.native.esm.js +3 -3
  156. package/package.json +4 -4
  157. package/dist/InvalidParamError-BPMi0iWC.esm.js.map +0 -1
  158. package/dist/InvalidParamError-CDmVW2DS.native.esm.js.map +0 -1
  159. package/dist/InvalidParamError-DEmLKJKZ.cjs.map +0 -1
  160. package/dist/NotWaasWalletAccountError-BZsBHRQe.cjs.map +0 -1
  161. package/dist/NotWaasWalletAccountError-Chpne8_Q.native.esm.js.map +0 -1
  162. package/dist/NotWaasWalletAccountError-Cntietge.esm.js.map +0 -1
  163. package/dist/getNetworkProviderFromNetworkId-CEeFL-gV.esm.js.map +0 -1
  164. package/dist/getNetworkProviderFromNetworkId-JGrKwBj7.native.esm.js.map +0 -1
  165. package/dist/getNetworkProviderFromNetworkId-szJOsbQN.cjs.map +0 -1
  166. package/dist/getVerifiedCredentialForWalletAccount-B46O0B48.cjs +0 -887
  167. package/dist/getVerifiedCredentialForWalletAccount-B46O0B48.cjs.map +0 -1
  168. package/dist/getVerifiedCredentialForWalletAccount-CyykSi-M.native.esm.js +0 -701
  169. package/dist/getVerifiedCredentialForWalletAccount-CyykSi-M.native.esm.js.map +0 -1
  170. package/dist/getVerifiedCredentialForWalletAccount-DzwIoeHm.esm.js +0 -701
  171. package/dist/getVerifiedCredentialForWalletAccount-DzwIoeHm.esm.js.map +0 -1
  172. package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/buildUriDeeplinkOptions.d.ts +0 -28
  173. package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/buildUriDeeplinkOptions.d.ts.map +0 -1
  174. package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/index.d.ts +0 -2
  175. package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/index.d.ts.map +0 -1
  176. package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/index.d.ts +0 -2
  177. package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/index.d.ts.map +0 -1
  178. package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/resolveUriConnectionType.d.ts +0 -17
  179. package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/resolveUriConnectionType.d.ts.map +0 -1
@@ -1,138 +1,12 @@
1
- //#region rolldown:runtime
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) {
13
- __defProp(to, key, {
14
- get: ((k) => from[k]).bind(null, key),
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- }
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
- value: mod,
24
- enumerable: true
25
- }) : target, mod));
26
-
27
- //#endregion
28
- const require_InvalidParamError = require('./InvalidParamError-DEmLKJKZ.cjs');
29
- const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-B46O0B48.cjs');
1
+ const require_InvalidParamError = require('./InvalidParamError-DKJhDrK8.cjs');
2
+ const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-gCx0smU8.cjs');
30
3
  let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
31
4
  let zod_mini = require("zod/mini");
32
- zod_mini = __toESM(zod_mini);
5
+ zod_mini = require_InvalidParamError.__toESM(zod_mini);
33
6
  let buffer = require("buffer");
34
7
  let eventemitter3 = require("eventemitter3");
35
- eventemitter3 = __toESM(eventemitter3);
36
-
37
- //#region src/utils/isEqualShallow/isEqualShallow.ts
38
- /**
39
- * Shallow compare two objects.
40
- *
41
- * Source: https://github.com/pmndrs/zustand/blob/main/src/vanilla/shallow.ts
42
- * @not-instrumented
43
- */
44
- const isEqualShallow = (objA, objB) => {
45
- if (Object.is(objA, objB)) return true;
46
- if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) return objA === objB;
47
- if (objA instanceof Map && objB instanceof Map) {
48
- if (objA.size !== objB.size) return false;
49
- for (const [key, value] of objA) if (!Object.is(value, objB.get(key))) return false;
50
- return true;
51
- }
52
- if (objA instanceof Set && objB instanceof Set) {
53
- if (objA.size !== objB.size) return false;
54
- for (const value of objA) if (!objB.has(value)) return false;
55
- return true;
56
- }
57
- const keysA = Object.keys(objA);
58
- if (keysA.length !== Object.keys(objB).length) return false;
59
- for (const keyA of keysA) if (!Object.prototype.hasOwnProperty.call(objB, keyA) || !Object.is(objA[keyA], objB[keyA])) return false;
60
- if (objA.constructor !== objB.constructor) return false;
61
- return true;
62
- };
8
+ eventemitter3 = require_InvalidParamError.__toESM(eventemitter3);
63
9
 
64
- //#endregion
65
- //#region src/utils/observable/subscribeWithSelector/subscribeWithSelector.ts
66
- /**
67
- * Allows subscribing to a slice of the state.
68
- * The slice is a computation of the states.
69
- *
70
- * The callback will only be called when the slice has changed.
71
- * Change is determined by shallow comparison.
72
- *
73
- * Returns a function to unsubscribe the callback.
74
- * @not-instrumented
75
- */
76
- const subscribeWithSelector = (observable, selector) => (callback) => {
77
- let lastSlice = selector(observable.get());
78
- return observable.subscribe((value) => {
79
- const nextSlice = selector(value);
80
- if (isEqualShallow(nextSlice, lastSlice)) return;
81
- lastSlice = nextSlice;
82
- callback(nextSlice);
83
- });
84
- };
85
-
86
- //#endregion
87
- //#region src/utils/retryOnFail/InvalidRetryOnFailCallError.ts
88
- /**
89
- * This error is thrown when the `retryOnFail` function is called with an invalid
90
- * number of retries (i.e. less than 0).
91
- */
92
- var InvalidRetryOnFailCallError = class extends require_InvalidParamError.BaseError {
93
- constructor(maxRetries) {
94
- super({
95
- cause: null,
96
- code: "invalid_retry_on_fail_call_error",
97
- docsUrl: null,
98
- name: "InvalidRetryOnFailCallError",
99
- shortMessage: `Invalid retries parameter for retryOnFail call: ${maxRetries}`
100
- });
101
- }
102
- };
103
-
104
- //#endregion
105
- //#region src/utils/retryOnFail/retryOnFail.ts
106
- /** @not-instrumented */
107
- const retryOnFail = async ({ delay = 0, fn, maxRetries }) => {
108
- for (let retry = 0; retry <= maxRetries; retry++) try {
109
- return await fn();
110
- } catch (error) {
111
- if (retry >= maxRetries) throw error;
112
- if (delay > 0) await new Promise((resolve) => setTimeout(resolve, delay));
113
- }
114
- /**
115
- * Reaching this point should never happen and this
116
- * error is thrown to help us debug the issue.
117
- */
118
- throw new InvalidRetryOnFailCallError(maxRetries);
119
- };
120
-
121
- //#endregion
122
- //#region src/modules/auth/isSignedIn/isSignedIn.ts
123
- /**
124
- * Checks if the user is currently signed in to the Dynamic client.
125
- *
126
- * The client is considered to be in a signed in state if a user has
127
- * authenticated or if the client has at least one wallet connected.
128
- *
129
- * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
130
- * @returns True if the user is signed in, false otherwise.
131
- * @not-instrumented
132
- */
133
- const isSignedIn = (client = require_InvalidParamError.getDefaultClient()) => Boolean(client.user || require_getVerifiedCredentialForWalletAccount.getWalletAccounts(client).length > 0);
134
-
135
- //#endregion
136
10
  //#region src/services/storage/createLocalStorageAdapter/createLocalStorageAdapter.ts
137
11
  /**
138
12
  * Creates a localStorage adapter.
@@ -243,183 +117,54 @@ const createStorage = ({ prefix = "", storageAdapter }) => {
243
117
  };
244
118
 
245
119
  //#endregion
246
- //#region src/services/storage/createStorageKeySchema/createStorageKeySchema.ts
247
- /** @not-instrumented */
248
- const createStorageKeySchema = (params) => {
249
- return params;
250
- };
251
-
252
- //#endregion
253
- //#region src/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.ts
254
- /**
255
- * The schema to track the expiration time of the project settings.
256
- */
257
- const projectSettingsExpirationStorageKeySchema = createStorageKeySchema({
258
- key: "projectSettingsExpiration",
259
- schema: zod_mini.number()
260
- });
261
-
262
- //#endregion
263
- //#region src/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.ts
264
- /**
265
- * Expiration time of the project settings in milliseconds.
266
- */
267
- const PROJECT_SETTINGS_EXPIRATION_TIME = 1e3 * 60 * 5;
120
+ //#region src/utils/isEqualShallow/isEqualShallow.ts
268
121
  /**
269
- * Fetches and updates the project settings from the API.
270
- *
271
- * This function retrieves the latest project configuration settings
272
- * from Dynamic's servers, including authentication options, enabled chains,
273
- * and security configurations. The settings are cached for performance.
122
+ * Shallow compare two objects.
274
123
  *
275
- * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
276
- * @returns A promise that resolves to the updated project settings.
124
+ * Source: https://github.com/pmndrs/zustand/blob/main/src/vanilla/shallow.ts
277
125
  * @not-instrumented
278
126
  */
279
- const fetchProjectSettings = async (client = require_InvalidParamError.getDefaultClient()) => {
280
- const core = require_InvalidParamError.getCore(client);
281
- const currentExpiration = await core.storage.getItem(projectSettingsExpirationStorageKeySchema);
282
- if (Boolean(client.projectSettings) && !(currentExpiration && currentExpiration < Date.now()) && isSignedIn(client)) return client.projectSettings;
283
- const apiClient = require_InvalidParamError.createApiClient({}, client);
284
- core.logger.debug("[fetchProjectSettings] Fetching project settings...");
285
- const doFetch = async () => apiClient.getEnvironmentSettings({
286
- environmentId: core.environmentId,
287
- sdkVersion: `${require_InvalidParamError.CLIENT_SDK_NAME}/${core.version}`
288
- }, { credentials: "omit" });
289
- const projectSettings = await retryOnFail({
290
- fn: doFetch,
291
- maxRetries: 2
292
- });
293
- core.state.set({ projectSettings: projectSettings ?? null });
294
- await core.storage.setItem(projectSettingsExpirationStorageKeySchema, Date.now() + PROJECT_SETTINGS_EXPIRATION_TIME);
295
- return projectSettings;
296
- };
297
-
298
- //#endregion
299
- //#region src/modules/sessionKeys/generateSessionKeys/generateSessionKeys.ts
300
- /** @not-instrumented */
301
- const generateSessionKeys = async (client) => {
302
- const core = require_InvalidParamError.getCore(client);
303
- await core.keychain.removeKey("session");
304
- const publicKey = await core.keychain.generateKey("session");
305
- require_InvalidParamError.assertDefined(publicKey, "Public key not found");
306
- core.state.set({ sessionKeys: publicKey });
307
- return { publicKey };
308
- };
309
-
310
- //#endregion
311
- //#region src/modules/wallets/utils/getAvailableWalletProvidersFromWalletAccounts/getAvailableWalletProvidersFromWalletAccounts.ts
312
- /** @not-instrumented */
313
- const getAvailableWalletProvidersFromWalletAccounts = (client) => {
314
- const core = require_InvalidParamError.getCore(client);
315
- const walletProvidersMap = /* @__PURE__ */ new Map();
316
- require_getVerifiedCredentialForWalletAccount.getWalletAccounts(client).forEach((walletAccount) => {
317
- if (walletProvidersMap.has(walletAccount.walletProviderKey)) return;
318
- try {
319
- const walletProvider = require_getVerifiedCredentialForWalletAccount.getWalletProviderFromWalletAccount({ walletAccount }, client);
320
- walletProvidersMap.set(walletAccount.walletProviderKey, walletProvider);
321
- } catch (error) {
322
- core.logger.debug("Wallet provider not found for wallet account", {
323
- error,
324
- walletAccount: walletAccount.address
325
- });
326
- }
327
- });
328
- return Array.from(walletProvidersMap.values());
127
+ const isEqualShallow = (objA, objB) => {
128
+ if (Object.is(objA, objB)) return true;
129
+ if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) return objA === objB;
130
+ if (objA instanceof Map && objB instanceof Map) {
131
+ if (objA.size !== objB.size) return false;
132
+ for (const [key, value] of objA) if (!Object.is(value, objB.get(key))) return false;
133
+ return true;
134
+ }
135
+ if (objA instanceof Set && objB instanceof Set) {
136
+ if (objA.size !== objB.size) return false;
137
+ for (const value of objA) if (!objB.has(value)) return false;
138
+ return true;
139
+ }
140
+ const keysA = Object.keys(objA);
141
+ if (keysA.length !== Object.keys(objB).length) return false;
142
+ for (const keyA of keysA) if (!Object.prototype.hasOwnProperty.call(objB, keyA) || !Object.is(objA[keyA], objB[keyA])) return false;
143
+ if (objA.constructor !== objB.constructor) return false;
144
+ return true;
329
145
  };
330
146
 
331
147
  //#endregion
332
- //#region src/modules/wallets/destroyWalletProviders/destroyWalletProviders.ts
148
+ //#region src/utils/observable/subscribeWithSelector/subscribeWithSelector.ts
333
149
  /**
334
- * Tear down every wallet provider on the client.
150
+ * Allows subscribing to a slice of the state.
151
+ * The slice is a computation of the states.
335
152
  *
336
- * Each provider's `destroy` is responsible for its own local + remote
337
- * cleanup. We swallow errors so a failing destroy on one provider does not
338
- * block teardown of the others (e.g. during logout).
153
+ * The callback will only be called when the slice has changed.
154
+ * Change is determined by shallow comparison.
339
155
  *
156
+ * Returns a function to unsubscribe the callback.
340
157
  * @not-instrumented
341
158
  */
342
- const destroyWalletProviders = async ({ reason }, client) => {
343
- const core = require_InvalidParamError.getCore(client);
344
- const walletProviders = getAvailableWalletProvidersFromWalletAccounts(client);
345
- await Promise.all(walletProviders.map(async (walletProvider) => {
346
- if (!walletProvider.destroy) return;
347
- try {
348
- await walletProvider.destroy({ reason });
349
- } catch (err) {
350
- core.logger.error(`Error destroying wallet provider ${walletProvider.key}`, err);
351
- }
352
- }));
353
- };
354
-
355
- //#endregion
356
- //#region src/modules/auth/logoutWithReason/logoutWithReason.ts
357
- /**
358
- * Logs the user out with an explicit reason.
359
- *
360
- * Revokes the session, clears auth state, terminates wallet providers, and
361
- * emits the `logout` client event with the given reason. The reason is also
362
- * captured as an argument on the function-instrumentation event, which is
363
- * how Datadog distinguishes between different logout causes.
364
- *
365
- * Use this instead of the public `logout` when triggering a logout from
366
- * internal or extension code — the caller owns the reason string, so the
367
- * telemetry correctly attributes *why* the logout happened.
368
- *
369
- * @param params - The logout params.
370
- * @param params.reason - Why the logout is being triggered. Extension authors
371
- * needing a reason outside the SDK catalog can cast with `as LogoutReason`.
372
- * @param client - The Dynamic client instance.
373
- * @instrumented
374
- */
375
- const logoutWithReason = async ({ reason }, client) => {
376
- const core = require_InvalidParamError.getCore(client);
377
- core.logger.debug("[logoutWithReason] Logging out...", { reason });
378
- await destroyWalletProviders({ reason }, client);
379
- if (client.user !== null) {
380
- const apiClient = require_InvalidParamError.createApiClient({}, client);
381
- try {
382
- await apiClient.revokeSession({ environmentId: core.environmentId });
383
- } catch (error) {
384
- core.logger.error("Failed to revoke session", error);
385
- }
386
- /**
387
- * This deletes the auth cookie if it exists.
388
- * If the cookie doesn't exist, this sets a new cookie that expires immediately.
389
- */
390
- if (require_InvalidParamError.isCookieEnabled(client)) require_getVerifiedCredentialForWalletAccount.setCookie(`${require_getVerifiedCredentialForWalletAccount.DYNAMIC_AUTH_COOKIE_NAME}=; Max-Age=-99999999; path=/; SameSite=Lax`);
391
- }
392
- await core.keychain.removeKey("session");
393
- core.state.set({
394
- captchaToken: null,
395
- elevatedAccessTokens: [],
396
- legacyToken: null,
397
- mfaToken: null,
398
- sessionExpiresAt: null,
399
- sessionKeys: null,
400
- token: null,
401
- unverifiedWalletAccounts: [],
402
- user: null
159
+ const subscribeWithSelector = (observable, selector) => (callback) => {
160
+ let lastSlice = selector(observable.get());
161
+ return observable.subscribe((value) => {
162
+ const nextSlice = selector(value);
163
+ if (isEqualShallow(nextSlice, lastSlice)) return;
164
+ lastSlice = nextSlice;
165
+ callback(nextSlice);
403
166
  });
404
- require_getVerifiedCredentialForWalletAccount.emitEvent({
405
- args: { reason },
406
- event: "logout"
407
- }, client);
408
- fetchProjectSettings(client);
409
- generateSessionKeys(client);
410
167
  };
411
- const __logoutWithReason_impl = logoutWithReason;
412
- const __logoutWithReason_wrapped = require_InvalidParamError.instrumentFunction({
413
- fn: __logoutWithReason_impl,
414
- functionName: "logoutWithReason",
415
- getCore: () => {
416
- try {
417
- return require_InvalidParamError.getCore(require_InvalidParamError.getDefaultClient());
418
- } catch {
419
- return;
420
- }
421
- }
422
- });
423
168
 
424
169
  //#endregion
425
170
  //#region src/utils/getBuffer/getBuffer.ts
@@ -1059,9 +804,9 @@ const hasExtension = ({ extensionKey }, client = require_InvalidParamError.getDe
1059
804
  const createVisit = async ({ walletAccount, authMode = _dynamic_labs_sdk_api_core.AuthModeEnum.Only }, client) => {
1060
805
  const core = require_InvalidParamError.getCore(client);
1061
806
  const apiClient = require_InvalidParamError.createApiClient({}, client);
1062
- const walletProvider = require_getVerifiedCredentialForWalletAccount.getWalletProviderFromWalletAccount({ walletAccount }, client);
807
+ const walletProvider = require_InvalidParamError.getWalletProviderFromWalletAccount({ walletAccount }, client);
1063
808
  try {
1064
- const walletName = require_getVerifiedCredentialForWalletAccount.normalizeWalletNameWithChain({
809
+ const walletName = require_InvalidParamError.normalizeWalletNameWithChain({
1065
810
  chain: walletProvider.chain,
1066
811
  displayName: walletProvider.metadata.displayName
1067
812
  });
@@ -1124,7 +869,7 @@ const updateWalletProviderKeysForVerifiedCredentials = ({ keysToUpdate }, client
1124
869
  */
1125
870
  const reconcileWalletAccountsAgainstClient = ({ addToDynamicWalletAccounts = true, walletAccounts, walletProviderKey }, client) => {
1126
871
  if (walletAccounts.length === 0) return [];
1127
- const existingWalletAccounts = require_getVerifiedCredentialForWalletAccount.getWalletAccounts(client);
872
+ const existingWalletAccounts = require_InvalidParamError.getWalletAccounts(client);
1128
873
  const newWalletAccounts = [];
1129
874
  const unverifiedWalletAccountsToUpdate = [];
1130
875
  const verifiedCredentialIdToWalletProviderKeyMap = {};
@@ -1261,7 +1006,7 @@ const isErrorWithCode = (error, code) => {
1261
1006
  const verifyMessageSignatureOwnership = async ({ messageToSign, walletAddress, addressesWithTypes, signature, chain, isTransfer = false, walletDisplayName, walletProviderType, networkId, requestedScopes }, client) => {
1262
1007
  const core = require_InvalidParamError.getCore(client);
1263
1008
  const apiClient = require_InvalidParamError.createApiClient({}, client);
1264
- const walletName = require_getVerifiedCredentialForWalletAccount.normalizeWalletNameWithChain({
1009
+ const walletName = require_InvalidParamError.normalizeWalletNameWithChain({
1265
1010
  chain,
1266
1011
  displayName: walletDisplayName
1267
1012
  });
@@ -1372,7 +1117,7 @@ const createNetworkProviderBuilderRegistry = () => {
1372
1117
 
1373
1118
  //#endregion
1374
1119
  //#region src/modules/wallets/networks/networkProviderBuilderRegistry/getNetworkProviderBuilderRegistry/getNetworkProviderBuilderRegistry.ts
1375
- const getNetworkProviderBuilderRegistry = require_getVerifiedCredentialForWalletAccount.createRuntimeServiceAccessKey("networkProviderBuilderRegistry", createNetworkProviderBuilderRegistry);
1120
+ const getNetworkProviderBuilderRegistry = require_InvalidParamError.createRuntimeServiceAccessKey("networkProviderBuilderRegistry", createNetworkProviderBuilderRegistry);
1376
1121
 
1377
1122
  //#endregion
1378
1123
  //#region src/modules/wallets/networks/getNetworkProviders/getNetworkProviders.ts
@@ -1467,24 +1212,12 @@ Object.defineProperty(exports, 'WalletAlreadyLinkedToAnotherUserError', {
1467
1212
  return WalletAlreadyLinkedToAnotherUserError;
1468
1213
  }
1469
1214
  });
1470
- Object.defineProperty(exports, '__logoutWithReason_wrapped', {
1471
- enumerable: true,
1472
- get: function () {
1473
- return __logoutWithReason_wrapped;
1474
- }
1475
- });
1476
1215
  Object.defineProperty(exports, '__setCaptchaToken_wrapped', {
1477
1216
  enumerable: true,
1478
1217
  get: function () {
1479
1218
  return __setCaptchaToken_wrapped;
1480
1219
  }
1481
1220
  });
1482
- Object.defineProperty(exports, '__toESM', {
1483
- enumerable: true,
1484
- get: function () {
1485
- return __toESM;
1486
- }
1487
- });
1488
1221
  Object.defineProperty(exports, 'consumeCaptchaToken', {
1489
1222
  enumerable: true,
1490
1223
  get: function () {
@@ -1539,36 +1272,18 @@ Object.defineProperty(exports, 'createStorage', {
1539
1272
  return createStorage;
1540
1273
  }
1541
1274
  });
1542
- Object.defineProperty(exports, 'createStorageKeySchema', {
1543
- enumerable: true,
1544
- get: function () {
1545
- return createStorageKeySchema;
1546
- }
1547
- });
1548
1275
  Object.defineProperty(exports, 'createVisit', {
1549
1276
  enumerable: true,
1550
1277
  get: function () {
1551
1278
  return createVisit;
1552
1279
  }
1553
1280
  });
1554
- Object.defineProperty(exports, 'fetchProjectSettings', {
1555
- enumerable: true,
1556
- get: function () {
1557
- return fetchProjectSettings;
1558
- }
1559
- });
1560
1281
  Object.defineProperty(exports, 'formatSignInMessage', {
1561
1282
  enumerable: true,
1562
1283
  get: function () {
1563
1284
  return formatSignInMessage;
1564
1285
  }
1565
1286
  });
1566
- Object.defineProperty(exports, 'generateSessionKeys', {
1567
- enumerable: true,
1568
- get: function () {
1569
- return generateSessionKeys;
1570
- }
1571
- });
1572
1287
  Object.defineProperty(exports, 'getAppMetadata', {
1573
1288
  enumerable: true,
1574
1289
  get: function () {
@@ -1635,12 +1350,6 @@ Object.defineProperty(exports, 'isServerSideRendering', {
1635
1350
  return isServerSideRendering;
1636
1351
  }
1637
1352
  });
1638
- Object.defineProperty(exports, 'isSignedIn', {
1639
- enumerable: true,
1640
- get: function () {
1641
- return isSignedIn;
1642
- }
1643
- });
1644
1353
  Object.defineProperty(exports, 'reconcileWalletAccountsAgainstClient', {
1645
1354
  enumerable: true,
1646
1355
  get: function () {
@@ -1653,12 +1362,6 @@ Object.defineProperty(exports, 'removeUnverifiedWalletAccount', {
1653
1362
  return removeUnverifiedWalletAccount;
1654
1363
  }
1655
1364
  });
1656
- Object.defineProperty(exports, 'retryOnFail', {
1657
- enumerable: true,
1658
- get: function () {
1659
- return retryOnFail;
1660
- }
1661
- });
1662
1365
  Object.defineProperty(exports, 'setUnverifiedWalletAccounts', {
1663
1366
  enumerable: true,
1664
1367
  get: function () {
@@ -1683,4 +1386,4 @@ Object.defineProperty(exports, 'verifyMessageSignatureOwnership', {
1683
1386
  return verifyMessageSignatureOwnership;
1684
1387
  }
1685
1388
  });
1686
- //# sourceMappingURL=getNetworkProviderFromNetworkId-szJOsbQN.cjs.map
1389
+ //# sourceMappingURL=getNetworkProviderFromNetworkId-BJ27N-7S.cjs.map