@dynamic-labs-sdk/client 1.19.1 → 1.21.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 (190) hide show
  1. package/dist/{updateAuthFromVerifyResponse-D4au3jUv.native.esm.js → NativeModuleNotLinkedError-Ds_t3AZQ.native.esm.js} +158 -27
  2. package/dist/NativeModuleNotLinkedError-Ds_t3AZQ.native.esm.js.map +1 -0
  3. package/dist/client/core/createCore/getInitialState.d.ts.map +1 -1
  4. package/dist/client/createDynamicClient/assertClientProps/assertClientProps.d.ts +16 -0
  5. package/dist/client/createDynamicClient/assertClientProps/assertClientProps.d.ts.map +1 -0
  6. package/dist/client/createDynamicClient/assertClientProps/index.d.ts +2 -0
  7. package/dist/client/createDynamicClient/assertClientProps/index.d.ts.map +1 -0
  8. package/dist/client/createDynamicClient/createDynamicClient.d.ts.map +1 -1
  9. package/dist/client/types/DynamicClientConfig.d.ts +88 -6
  10. package/dist/client/types/DynamicClientConfig.d.ts.map +1 -1
  11. package/dist/consumeMfaTokenIfRequiredForAction-CWVbmQ2A.cjs +17 -0
  12. package/dist/consumeMfaTokenIfRequiredForAction-CWVbmQ2A.cjs.map +1 -0
  13. package/dist/consumeMfaTokenIfRequiredForAction-C_IvLTH6.esm.js +12 -0
  14. package/dist/consumeMfaTokenIfRequiredForAction-C_IvLTH6.esm.js.map +1 -0
  15. package/dist/core.cjs +13 -12
  16. package/dist/core.cjs.map +1 -1
  17. package/dist/core.esm.js +6 -5
  18. package/dist/core.esm.js.map +1 -1
  19. package/dist/core.native.esm.js +5 -5
  20. package/dist/errors/WaasLoadFailedError.d.ts +45 -0
  21. package/dist/errors/WaasLoadFailedError.d.ts.map +1 -0
  22. package/dist/exports/index.d.ts +1 -0
  23. package/dist/exports/index.d.ts.map +1 -1
  24. package/dist/exports/waas.d.ts +10 -0
  25. package/dist/exports/waas.d.ts.map +1 -1
  26. package/dist/{getNetworkProviderFromNetworkId-DmH039jx.cjs → getNetworkProviderFromNetworkId-5V4Cf8A_.cjs} +150 -70
  27. package/dist/getNetworkProviderFromNetworkId-5V4Cf8A_.cjs.map +1 -0
  28. package/dist/{getNetworkProviderFromNetworkId-Ct6nH2tC.esm.js → getNetworkProviderFromNetworkId-DhS1snCk.esm.js} +149 -68
  29. package/dist/getNetworkProviderFromNetworkId-DhS1snCk.esm.js.map +1 -0
  30. package/dist/{getNetworkProviderFromNetworkId-DL6OXPUn.native.esm.js → getNetworkProviderFromNetworkId-DudGvTmd.native.esm.js} +151 -146
  31. package/dist/getNetworkProviderFromNetworkId-DudGvTmd.native.esm.js.map +1 -0
  32. package/dist/{getSignedSessionId-Dz4U61DG.cjs → getSignedSessionId-E6FIx5aj.cjs} +2 -17
  33. package/dist/getSignedSessionId-E6FIx5aj.cjs.map +1 -0
  34. package/dist/{getSignedSessionId-CPautem1.native.esm.js → getSignedSessionId-ekp3lswQ.esm.js} +3 -12
  35. package/dist/getSignedSessionId-ekp3lswQ.esm.js.map +1 -0
  36. package/dist/{getSignedSessionId-CAQwZYYk.esm.js → getSignedSessionId-xZGFa4nS.native.esm.js} +3 -3
  37. package/dist/{getSignedSessionId-CPautem1.native.esm.js.map → getSignedSessionId-xZGFa4nS.native.esm.js.map} +1 -1
  38. package/dist/{getWalletProviderByKey-CSVSMios.cjs → getWalletProviderByKey-BwivhTYu.cjs} +2 -2
  39. package/dist/{getWalletProviderByKey-CSVSMios.cjs.map → getWalletProviderByKey-BwivhTYu.cjs.map} +1 -1
  40. package/dist/{getWalletProviderByKey-DTBGx_qd.esm.js → getWalletProviderByKey-CS299i1V.esm.js} +2 -2
  41. package/dist/{getWalletProviderByKey-DTBGx_qd.esm.js.map → getWalletProviderByKey-CS299i1V.esm.js.map} +1 -1
  42. package/dist/{getWalletProviderByKey-BKveb5Rh.native.esm.js → getWalletProviderByKey-CYGDw6-5.native.esm.js} +2 -2
  43. package/dist/{getWalletProviderByKey-BKveb5Rh.native.esm.js.map → getWalletProviderByKey-CYGDw6-5.native.esm.js.map} +1 -1
  44. package/dist/index.cjs +58 -39
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.esm.js +36 -18
  47. package/dist/index.esm.js.map +1 -1
  48. package/dist/index.native.esm.js +36 -18
  49. package/dist/index.native.esm.js.map +1 -1
  50. package/dist/{isDynamicWaasEnabled-Dmbdiybh.cjs → isDynamicWaasEnabled-BEVAshnS.cjs} +2 -3
  51. package/dist/{isDynamicWaasEnabled-Dmbdiybh.cjs.map → isDynamicWaasEnabled-BEVAshnS.cjs.map} +1 -1
  52. package/dist/{isDynamicWaasEnabled-gu-9QF8-.native.esm.js → isDynamicWaasEnabled-C8Fb1xHn.native.esm.js} +2 -2
  53. package/dist/{isDynamicWaasEnabled-gu-9QF8-.native.esm.js.map → isDynamicWaasEnabled-C8Fb1xHn.native.esm.js.map} +1 -1
  54. package/dist/{isDynamicWaasEnabled-Bb9e8w3u.esm.js → isDynamicWaasEnabled-D5e2K02u.esm.js} +2 -2
  55. package/dist/{isDynamicWaasEnabled-Bb9e8w3u.esm.js.map → isDynamicWaasEnabled-D5e2K02u.esm.js.map} +1 -1
  56. package/dist/{isMfaRequiredForAction-BkrwKqo1.native.esm.js → isMfaRequiredForAction-A02NFVt8.esm.js} +3 -32
  57. package/dist/isMfaRequiredForAction-A02NFVt8.esm.js.map +1 -0
  58. package/dist/isMfaRequiredForAction-D4TSMQ4m.native.esm.js +77 -0
  59. package/dist/isMfaRequiredForAction-D4TSMQ4m.native.esm.js.map +1 -0
  60. package/dist/isMfaRequiredForAction-odpvykkm.cjs +94 -0
  61. package/dist/isMfaRequiredForAction-odpvykkm.cjs.map +1 -0
  62. package/dist/{isUserOnboardingComplete-CruwjMvs.cjs → isUserOnboardingComplete-CEVSIxJC.cjs} +49 -4
  63. package/dist/isUserOnboardingComplete-CEVSIxJC.cjs.map +1 -0
  64. package/dist/{isUserOnboardingComplete-DAesufca.esm.js → isUserOnboardingComplete-Cgkw21XZ.esm.js} +44 -4
  65. package/dist/isUserOnboardingComplete-Cgkw21XZ.esm.js.map +1 -0
  66. package/dist/{isUserOnboardingComplete-BLm0JQ_z.native.esm.js → isUserOnboardingComplete-CvQShE05.native.esm.js} +44 -4
  67. package/dist/{isUserOnboardingComplete-CruwjMvs.cjs.map → isUserOnboardingComplete-CvQShE05.native.esm.js.map} +1 -1
  68. package/dist/migrateFromFireblocks-BMtelH1a.native.esm.js +321 -0
  69. package/dist/migrateFromFireblocks-BMtelH1a.native.esm.js.map +1 -0
  70. package/dist/{migrateFromFireblocks-DrHwloUB.cjs → migrateFromFireblocks-CLUkVcFT.cjs} +54 -3
  71. package/dist/migrateFromFireblocks-CLUkVcFT.cjs.map +1 -0
  72. package/dist/{migrateFromFireblocks-Do4mQTl7.native.esm.js → migrateFromFireblocks-DcKrquTE.esm.js} +43 -4
  73. package/dist/migrateFromFireblocks-DcKrquTE.esm.js.map +1 -0
  74. package/dist/modules/storageSync/hydrateStateWithStorage/hydrateStateWithStorage.d.ts.map +1 -1
  75. package/dist/modules/storageSync/schema.d.ts +0 -2
  76. package/dist/modules/storageSync/schema.d.ts.map +1 -1
  77. package/dist/modules/storageSync/syncStateWithStorage/syncStateWithStorage.d.ts.map +1 -1
  78. package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts +25 -0
  79. package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts.map +1 -0
  80. package/dist/modules/waas/businessAccounts/addBusinessAccountMember/index.d.ts +2 -0
  81. package/dist/modules/waas/businessAccounts/addBusinessAccountMember/index.d.ts.map +1 -0
  82. package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts +35 -0
  83. package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts.map +1 -0
  84. package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/index.d.ts +2 -0
  85. package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/index.d.ts.map +1 -0
  86. package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts +19 -0
  87. package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts.map +1 -0
  88. package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/index.d.ts +2 -0
  89. package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/index.d.ts.map +1 -0
  90. package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts +184 -0
  91. package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts.map +1 -0
  92. package/dist/modules/waas/businessAccounts/createBusinessAccount/createBusinessAccount.d.ts +16 -0
  93. package/dist/modules/waas/businessAccounts/createBusinessAccount/createBusinessAccount.d.ts.map +1 -0
  94. package/dist/modules/waas/businessAccounts/createBusinessAccount/index.d.ts +2 -0
  95. package/dist/modules/waas/businessAccounts/createBusinessAccount/index.d.ts.map +1 -0
  96. package/dist/modules/waas/businessAccounts/createWalletForBusinessAccount/createWalletForBusinessAccount.d.ts +36 -0
  97. package/dist/modules/waas/businessAccounts/createWalletForBusinessAccount/createWalletForBusinessAccount.d.ts.map +1 -0
  98. package/dist/modules/waas/businessAccounts/createWalletForBusinessAccount/index.d.ts +2 -0
  99. package/dist/modules/waas/businessAccounts/createWalletForBusinessAccount/index.d.ts.map +1 -0
  100. package/dist/modules/waas/businessAccounts/getBusinessAccount/getBusinessAccount.d.ts +15 -0
  101. package/dist/modules/waas/businessAccounts/getBusinessAccount/getBusinessAccount.d.ts.map +1 -0
  102. package/dist/modules/waas/businessAccounts/getBusinessAccount/index.d.ts +2 -0
  103. package/dist/modules/waas/businessAccounts/getBusinessAccount/index.d.ts.map +1 -0
  104. package/dist/modules/waas/businessAccounts/getBusinessAccountsClient/getBusinessAccountsClient.d.ts +12 -0
  105. package/dist/modules/waas/businessAccounts/getBusinessAccountsClient/getBusinessAccountsClient.d.ts.map +1 -0
  106. package/dist/modules/waas/businessAccounts/getBusinessAccountsClient/index.d.ts +2 -0
  107. package/dist/modules/waas/businessAccounts/getBusinessAccountsClient/index.d.ts.map +1 -0
  108. package/dist/modules/waas/businessAccounts/listBusinessAccounts/index.d.ts +2 -0
  109. package/dist/modules/waas/businessAccounts/listBusinessAccounts/index.d.ts.map +1 -0
  110. package/dist/modules/waas/businessAccounts/listBusinessAccounts/listBusinessAccounts.d.ts +10 -0
  111. package/dist/modules/waas/businessAccounts/listBusinessAccounts/listBusinessAccounts.d.ts.map +1 -0
  112. package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/index.d.ts +2 -0
  113. package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/index.d.ts.map +1 -0
  114. package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.d.ts +33 -0
  115. package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.d.ts.map +1 -0
  116. package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/index.d.ts +2 -0
  117. package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/index.d.ts.map +1 -0
  118. package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.d.ts +37 -0
  119. package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.d.ts.map +1 -0
  120. package/dist/modules/waas/createWaasClient/createWaasClient.d.ts.map +1 -1
  121. package/dist/modules/waas/createWaasProvider/createWaasProvider.d.ts.map +1 -1
  122. package/dist/modules/waas/createWaasProvider/isWaasLoadExhaustionError.d.ts +11 -0
  123. package/dist/modules/waas/createWaasProvider/isWaasLoadExhaustionError.d.ts.map +1 -0
  124. package/dist/modules/waas/waas.types.d.ts +11 -0
  125. package/dist/modules/waas/waas.types.d.ts.map +1 -1
  126. package/dist/modules/wallets/networks/getNetworksData/getNetworksData.d.ts +4 -0
  127. package/dist/modules/wallets/networks/getNetworksData/getNetworksData.d.ts.map +1 -1
  128. package/dist/modules/wallets/networks/networkDataSchema/index.d.ts +2 -0
  129. package/dist/modules/wallets/networks/networkDataSchema/index.d.ts.map +1 -0
  130. package/dist/modules/wallets/networks/networkDataSchema/networkDataSchema.d.ts +23 -0
  131. package/dist/modules/wallets/networks/networkDataSchema/networkDataSchema.d.ts.map +1 -0
  132. package/dist/modules/wallets/walletAccount/walletAccount.types.d.ts +2 -0
  133. package/dist/modules/wallets/walletAccount/walletAccount.types.d.ts.map +1 -1
  134. package/dist/services/keychain/createKeychainService/utils/openDatabase.d.ts +9 -1
  135. package/dist/services/keychain/createKeychainService/utils/openDatabase.d.ts.map +1 -1
  136. package/dist/services/keychain/createKeychainService/utils/withDatabase/withDatabase.d.ts +2 -1
  137. package/dist/services/keychain/createKeychainService/utils/withDatabase/withDatabase.d.ts.map +1 -1
  138. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  139. package/dist/{updateAuthFromVerifyResponse-CY0xTIXF.cjs → updateAuthFromVerifyResponse-CSqnGlh3.cjs} +427 -43
  140. package/dist/updateAuthFromVerifyResponse-CSqnGlh3.cjs.map +1 -0
  141. package/dist/{updateAuthFromVerifyResponse-inxvMWJB.esm.js → updateAuthFromVerifyResponse-C_YKKAIX.esm.js} +354 -27
  142. package/dist/updateAuthFromVerifyResponse-C_YKKAIX.esm.js.map +1 -0
  143. package/dist/utils/createTranslateRejection/createTranslateRejection.d.ts +29 -0
  144. package/dist/utils/createTranslateRejection/createTranslateRejection.d.ts.map +1 -0
  145. package/dist/utils/createTranslateRejection/index.d.ts +3 -0
  146. package/dist/utils/createTranslateRejection/index.d.ts.map +1 -0
  147. package/dist/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.d.ts +7 -5
  148. package/dist/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.d.ts.map +1 -1
  149. package/dist/utils/getNonce/getNonce.d.ts +10 -4
  150. package/dist/utils/getNonce/getNonce.d.ts.map +1 -1
  151. package/dist/utils/getNonce/noncePoolStorage/schema.d.ts +19 -0
  152. package/dist/utils/getNonce/noncePoolStorage/schema.d.ts.map +1 -0
  153. package/dist/utils/getNonce/noncePoolStorage/updateNoncePoolStorage/updateNoncePoolStorage.d.ts +18 -0
  154. package/dist/utils/getNonce/noncePoolStorage/updateNoncePoolStorage/updateNoncePoolStorage.d.ts.map +1 -0
  155. package/dist/utils/getNonce/prefetchNoncesIfNeeded/prefetchNoncesIfNeeded.d.ts.map +1 -1
  156. package/dist/utils/getNonce/state.d.ts +5 -9
  157. package/dist/utils/getNonce/state.d.ts.map +1 -1
  158. package/dist/waas.cjs +281 -18
  159. package/dist/waas.cjs.map +1 -1
  160. package/dist/waas.esm.js +273 -18
  161. package/dist/waas.esm.js.map +1 -1
  162. package/dist/waas.native.esm.js +272 -18
  163. package/dist/waas.native.esm.js.map +1 -1
  164. package/dist/waasCore.cjs +291 -170
  165. package/dist/waasCore.cjs.map +1 -1
  166. package/dist/waasCore.esm.js +285 -164
  167. package/dist/waasCore.esm.js.map +1 -1
  168. package/dist/waasCore.native.esm.js +273 -371
  169. package/dist/waasCore.native.esm.js.map +1 -1
  170. package/ios/DynamicClientScreenshotProtection.mm +70 -32
  171. package/package.json +5 -5
  172. package/dist/getNetworkProviderFromNetworkId-Ct6nH2tC.esm.js.map +0 -1
  173. package/dist/getNetworkProviderFromNetworkId-DL6OXPUn.native.esm.js.map +0 -1
  174. package/dist/getNetworkProviderFromNetworkId-DmH039jx.cjs.map +0 -1
  175. package/dist/getSignedSessionId-CAQwZYYk.esm.js.map +0 -1
  176. package/dist/getSignedSessionId-Dz4U61DG.cjs.map +0 -1
  177. package/dist/isMfaRequiredForAction-BkrwKqo1.native.esm.js.map +0 -1
  178. package/dist/isMfaRequiredForAction-CHeYEkjj.cjs +0 -430
  179. package/dist/isMfaRequiredForAction-CHeYEkjj.cjs.map +0 -1
  180. package/dist/isMfaRequiredForAction-DxJQm48x.esm.js +0 -343
  181. package/dist/isMfaRequiredForAction-DxJQm48x.esm.js.map +0 -1
  182. package/dist/isUserOnboardingComplete-BLm0JQ_z.native.esm.js.map +0 -1
  183. package/dist/isUserOnboardingComplete-DAesufca.esm.js.map +0 -1
  184. package/dist/migrateFromFireblocks-C-lXWvvo.esm.js +0 -65
  185. package/dist/migrateFromFireblocks-C-lXWvvo.esm.js.map +0 -1
  186. package/dist/migrateFromFireblocks-Do4mQTl7.native.esm.js.map +0 -1
  187. package/dist/migrateFromFireblocks-DrHwloUB.cjs.map +0 -1
  188. package/dist/updateAuthFromVerifyResponse-CY0xTIXF.cjs.map +0 -1
  189. package/dist/updateAuthFromVerifyResponse-D4au3jUv.native.esm.js.map +0 -1
  190. package/dist/updateAuthFromVerifyResponse-inxvMWJB.esm.js.map +0 -1
@@ -1,5 +1,4 @@
1
- const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-CHeYEkjj.cjs');
2
- const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-CY0xTIXF.cjs');
1
+ const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-CSqnGlh3.cjs');
3
2
  let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
4
3
 
5
4
  //#region src/modules/user/refreshAuth/refreshAuth.ts
@@ -97,4 +96,4 @@ Object.defineProperty(exports, 'isDynamicWaasEnabled', {
97
96
  return isDynamicWaasEnabled;
98
97
  }
99
98
  });
100
- //# sourceMappingURL=isDynamicWaasEnabled-Dmbdiybh.cjs.map
99
+ //# sourceMappingURL=isDynamicWaasEnabled-BEVAshnS.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"isDynamicWaasEnabled-Dmbdiybh.cjs","names":["BaseError","getDefaultClient","EmbeddedWalletVersionEnum"],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts","../src/errors/NotWaasWalletAccountError.ts","../src/modules/waas/isDynamicWaasEnabled/isDynamicWaasEnabled.ts"],"sourcesContent":["import type { VerifyResponse } from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\nimport { updateAuthFromVerifyResponse } from '../../auth/updateAuthFromVerifyResponse';\n\n/**\n * Refreshes the current session's authentication from the server.\n *\n * This rotates the auth token via a full verify call and updates both the\n * token and the user state from the response, returning the raw\n * `VerifyResponse` (which includes the new token). Reach for this when you\n * need a fresh JWT — e.g. before a call that requires a non-expired token.\n *\n * Prefer `refreshUser` when you only need the latest user profile and do not\n * care about rotating the token: it hits the authenticated-user endpoint,\n * touches only the user state, and returns the `SdkUser` directly.\n *\n * @example\n * ```ts\n * const response = await refreshAuth();\n * console.log('Token refreshed:', response.token);\n * ```\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the verify response.\n * @see logout\n * @see refreshUser\n * @instrumented\n */\nexport const refreshAuth = async (\n client = getDefaultClient()\n): Promise<VerifyResponse> => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const response = await apiClient.refreshAuth({\n environmentId: core.environmentId,\n });\n\n updateAuthFromVerifyResponse({ response }, client);\n\n return response;\n};\n","import { BaseError } from './base';\n\ntype NotWaasWalletAccountErrorParams = {\n walletAddress: string;\n};\n\nexport class NotWaasWalletAccountError extends BaseError {\n constructor({ walletAddress }: NotWaasWalletAccountErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_account_error',\n docsUrl: null,\n name: 'NotWaasWalletAccountError',\n shortMessage: `Wallet account ${walletAddress} is not a Dynamic WaaS wallet account`,\n });\n }\n}\n","import { EmbeddedWalletVersionEnum } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Checks if Dynamic WaaS (Wallet as a Service) is enabled for the current project.\n *\n * This function examines the project settings to determine if Dynamic WaaS is\n * enabled in the Dynamic Dashboard or not.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if Dynamic WaaS is enabled, false otherwise.\n * @notInstrumented\n */\nexport const isDynamicWaasEnabled = (client = getDefaultClient()) => {\n const projectSettings = client.projectSettings;\n\n assertDefined(projectSettings, 'Project settings are not available');\n\n const embeddedWalletSettings = projectSettings.sdk.embeddedWallets;\n\n const dynamicWaasIsEnabled =\n embeddedWalletSettings?.defaultWalletVersion ===\n EmbeddedWalletVersionEnum.V3;\n\n return dynamicWaasIsEnabled;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAE,cAAa,OACb,SAAM,uDAAY;CAElB,MAAM,OAAA,6CAAW,OAAM;wBACN,qDAAK,EAAa,EAAA,OAAA,eAGnC,eAAA,KAAA;AAGD,mEAAA,EAAA,UAAA,EAAA,OAAA;;;;;;;;;;;;;;;;;;ACtCD,IAAa,4BAAb,cAA+CA,+CAAU;CACvD,YAAY,EAAE,iBAAkD;AAC9D,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,kBAAkB,cAAc;GAC/C,CAAC;;;;;;;;;;;;;;;;ACCN,MAAa,wBAAwB,SAASC,uDAAkB,KAAK;CACnE,MAAM,kBAAkB,OAAO;AAE/B,oDAAc,iBAAiB,qCAAqC;AAQpE,QAN+B,gBAAgB,IAAI,iBAGzB,yBACxBC,qDAA0B"}
1
+ {"version":3,"file":"isDynamicWaasEnabled-BEVAshnS.cjs","names":["BaseError","getDefaultClient","EmbeddedWalletVersionEnum"],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts","../src/errors/NotWaasWalletAccountError.ts","../src/modules/waas/isDynamicWaasEnabled/isDynamicWaasEnabled.ts"],"sourcesContent":["import type { VerifyResponse } from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\nimport { updateAuthFromVerifyResponse } from '../../auth/updateAuthFromVerifyResponse';\n\n/**\n * Refreshes the current session's authentication from the server.\n *\n * This rotates the auth token via a full verify call and updates both the\n * token and the user state from the response, returning the raw\n * `VerifyResponse` (which includes the new token). Reach for this when you\n * need a fresh JWT — e.g. before a call that requires a non-expired token.\n *\n * Prefer `refreshUser` when you only need the latest user profile and do not\n * care about rotating the token: it hits the authenticated-user endpoint,\n * touches only the user state, and returns the `SdkUser` directly.\n *\n * @example\n * ```ts\n * const response = await refreshAuth();\n * console.log('Token refreshed:', response.token);\n * ```\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the verify response.\n * @see logout\n * @see refreshUser\n * @instrumented\n */\nexport const refreshAuth = async (\n client = getDefaultClient()\n): Promise<VerifyResponse> => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const response = await apiClient.refreshAuth({\n environmentId: core.environmentId,\n });\n\n updateAuthFromVerifyResponse({ response }, client);\n\n return response;\n};\n","import { BaseError } from './base';\n\ntype NotWaasWalletAccountErrorParams = {\n walletAddress: string;\n};\n\nexport class NotWaasWalletAccountError extends BaseError {\n constructor({ walletAddress }: NotWaasWalletAccountErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_account_error',\n docsUrl: null,\n name: 'NotWaasWalletAccountError',\n shortMessage: `Wallet account ${walletAddress} is not a Dynamic WaaS wallet account`,\n });\n }\n}\n","import { EmbeddedWalletVersionEnum } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Checks if Dynamic WaaS (Wallet as a Service) is enabled for the current project.\n *\n * This function examines the project settings to determine if Dynamic WaaS is\n * enabled in the Dynamic Dashboard or not.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if Dynamic WaaS is enabled, false otherwise.\n * @notInstrumented\n */\nexport const isDynamicWaasEnabled = (client = getDefaultClient()) => {\n const projectSettings = client.projectSettings;\n\n assertDefined(projectSettings, 'Project settings are not available');\n\n const embeddedWalletSettings = projectSettings.sdk.embeddedWallets;\n\n const dynamicWaasIsEnabled =\n embeddedWalletSettings?.defaultWalletVersion ===\n EmbeddedWalletVersionEnum.V3;\n\n return dynamicWaasIsEnabled;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAE,cAAa,OACb,SAAM,uDAAY;CAElB,MAAM,OAAA,6CAAW,OAAM;wBACN,qDAAK,EAAa,EAAA,OAAA,eAGnC,eAAA,KAAA;AAGD,mEAAA,EAAA,UAAA,EAAA,OAAA;;;;;;;;;;;;;;;;;;ACtCD,IAAa,4BAAb,cAA+CA,+CAAU;CACvD,YAAY,EAAE,iBAAkD;AAC9D,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,kBAAkB,cAAc;GAC/C,CAAC;;;;;;;;;;;;;;;;ACCN,MAAa,wBAAwB,SAASC,uDAAkB,KAAK;CACnE,MAAM,kBAAkB,OAAO;AAE/B,oDAAc,iBAAiB,qCAAqC;AAQpE,QAN+B,gBAAgB,IAAI,iBAGzB,yBACxBC,qDAA0B"}
@@ -1,4 +1,4 @@
1
- import { K as createApiClient, _t as BaseError, mt as getDefaultClient, ot as assertDefined, t as updateAuthFromVerifyResponse, v as instrumentFunction, vt as getCore } from "./updateAuthFromVerifyResponse-D4au3jUv.native.esm.js";
1
+ import { St as getCore, n as updateAuthFromVerifyResponse, q as createApiClient, ut as assertDefined, vt as getDefaultClient, xt as BaseError, y as instrumentFunction } from "./NativeModuleNotLinkedError-Ds_t3AZQ.native.esm.js";
2
2
  import { EmbeddedWalletVersionEnum } from "@dynamic-labs/sdk-api-core";
3
3
 
4
4
  //#region src/modules/user/refreshAuth/refreshAuth.ts
@@ -79,4 +79,4 @@ const isDynamicWaasEnabled = (client = getDefaultClient()) => {
79
79
 
80
80
  //#endregion
81
81
  export { NotWaasWalletAccountError as n, __refreshAuth_wrapped as r, isDynamicWaasEnabled as t };
82
- //# sourceMappingURL=isDynamicWaasEnabled-gu-9QF8-.native.esm.js.map
82
+ //# sourceMappingURL=isDynamicWaasEnabled-C8Fb1xHn.native.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isDynamicWaasEnabled-gu-9QF8-.native.esm.js","names":[],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts","../src/errors/NotWaasWalletAccountError.ts","../src/modules/waas/isDynamicWaasEnabled/isDynamicWaasEnabled.ts"],"sourcesContent":["import type { VerifyResponse } from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\nimport { updateAuthFromVerifyResponse } from '../../auth/updateAuthFromVerifyResponse';\n\n/**\n * Refreshes the current session's authentication from the server.\n *\n * This rotates the auth token via a full verify call and updates both the\n * token and the user state from the response, returning the raw\n * `VerifyResponse` (which includes the new token). Reach for this when you\n * need a fresh JWT — e.g. before a call that requires a non-expired token.\n *\n * Prefer `refreshUser` when you only need the latest user profile and do not\n * care about rotating the token: it hits the authenticated-user endpoint,\n * touches only the user state, and returns the `SdkUser` directly.\n *\n * @example\n * ```ts\n * const response = await refreshAuth();\n * console.log('Token refreshed:', response.token);\n * ```\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the verify response.\n * @see logout\n * @see refreshUser\n * @instrumented\n */\nexport const refreshAuth = async (\n client = getDefaultClient()\n): Promise<VerifyResponse> => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const response = await apiClient.refreshAuth({\n environmentId: core.environmentId,\n });\n\n updateAuthFromVerifyResponse({ response }, client);\n\n return response;\n};\n","import { BaseError } from './base';\n\ntype NotWaasWalletAccountErrorParams = {\n walletAddress: string;\n};\n\nexport class NotWaasWalletAccountError extends BaseError {\n constructor({ walletAddress }: NotWaasWalletAccountErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_account_error',\n docsUrl: null,\n name: 'NotWaasWalletAccountError',\n shortMessage: `Wallet account ${walletAddress} is not a Dynamic WaaS wallet account`,\n });\n }\n}\n","import { EmbeddedWalletVersionEnum } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Checks if Dynamic WaaS (Wallet as a Service) is enabled for the current project.\n *\n * This function examines the project settings to determine if Dynamic WaaS is\n * enabled in the Dynamic Dashboard or not.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if Dynamic WaaS is enabled, false otherwise.\n * @notInstrumented\n */\nexport const isDynamicWaasEnabled = (client = getDefaultClient()) => {\n const projectSettings = client.projectSettings;\n\n assertDefined(projectSettings, 'Project settings are not available');\n\n const embeddedWalletSettings = projectSettings.sdk.embeddedWallets;\n\n const dynamicWaasIsEnabled =\n embeddedWalletSettings?.defaultWalletVersion ===\n EmbeddedWalletVersionEnum.V3;\n\n return dynamicWaasIsEnabled;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAE,cAAa,OACb,SAAM,kBAAY;CAElB,MAAM,OAAA,QAAW,OAAM;wBACN,gBAAK,EAAa,EAAA,OAAA,eAGnC,eAAA,KAAA;AAGD,8BAAA,EAAA,UAAA,EAAA,OAAA;;;;;;;;;;;;;;;;;;ACtCD,IAAa,4BAAb,cAA+C,UAAU;CACvD,YAAY,EAAE,iBAAkD;AAC9D,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,kBAAkB,cAAc;GAC/C,CAAC;;;;;;;;;;;;;;;;ACCN,MAAa,wBAAwB,SAAS,kBAAkB,KAAK;CACnE,MAAM,kBAAkB,OAAO;AAE/B,eAAc,iBAAiB,qCAAqC;AAQpE,QAN+B,gBAAgB,IAAI,iBAGzB,yBACxB,0BAA0B"}
1
+ {"version":3,"file":"isDynamicWaasEnabled-C8Fb1xHn.native.esm.js","names":[],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts","../src/errors/NotWaasWalletAccountError.ts","../src/modules/waas/isDynamicWaasEnabled/isDynamicWaasEnabled.ts"],"sourcesContent":["import type { VerifyResponse } from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\nimport { updateAuthFromVerifyResponse } from '../../auth/updateAuthFromVerifyResponse';\n\n/**\n * Refreshes the current session's authentication from the server.\n *\n * This rotates the auth token via a full verify call and updates both the\n * token and the user state from the response, returning the raw\n * `VerifyResponse` (which includes the new token). Reach for this when you\n * need a fresh JWT — e.g. before a call that requires a non-expired token.\n *\n * Prefer `refreshUser` when you only need the latest user profile and do not\n * care about rotating the token: it hits the authenticated-user endpoint,\n * touches only the user state, and returns the `SdkUser` directly.\n *\n * @example\n * ```ts\n * const response = await refreshAuth();\n * console.log('Token refreshed:', response.token);\n * ```\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the verify response.\n * @see logout\n * @see refreshUser\n * @instrumented\n */\nexport const refreshAuth = async (\n client = getDefaultClient()\n): Promise<VerifyResponse> => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const response = await apiClient.refreshAuth({\n environmentId: core.environmentId,\n });\n\n updateAuthFromVerifyResponse({ response }, client);\n\n return response;\n};\n","import { BaseError } from './base';\n\ntype NotWaasWalletAccountErrorParams = {\n walletAddress: string;\n};\n\nexport class NotWaasWalletAccountError extends BaseError {\n constructor({ walletAddress }: NotWaasWalletAccountErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_account_error',\n docsUrl: null,\n name: 'NotWaasWalletAccountError',\n shortMessage: `Wallet account ${walletAddress} is not a Dynamic WaaS wallet account`,\n });\n }\n}\n","import { EmbeddedWalletVersionEnum } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Checks if Dynamic WaaS (Wallet as a Service) is enabled for the current project.\n *\n * This function examines the project settings to determine if Dynamic WaaS is\n * enabled in the Dynamic Dashboard or not.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if Dynamic WaaS is enabled, false otherwise.\n * @notInstrumented\n */\nexport const isDynamicWaasEnabled = (client = getDefaultClient()) => {\n const projectSettings = client.projectSettings;\n\n assertDefined(projectSettings, 'Project settings are not available');\n\n const embeddedWalletSettings = projectSettings.sdk.embeddedWallets;\n\n const dynamicWaasIsEnabled =\n embeddedWalletSettings?.defaultWalletVersion ===\n EmbeddedWalletVersionEnum.V3;\n\n return dynamicWaasIsEnabled;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAE,cAAa,OACb,SAAM,kBAAY;CAElB,MAAM,OAAA,QAAW,OAAM;wBACN,gBAAK,EAAa,EAAA,OAAA,eAGnC,eAAA,KAAA;AAGD,8BAAA,EAAA,UAAA,EAAA,OAAA;;;;;;;;;;;;;;;;;;ACtCD,IAAa,4BAAb,cAA+C,UAAU;CACvD,YAAY,EAAE,iBAAkD;AAC9D,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,kBAAkB,cAAc;GAC/C,CAAC;;;;;;;;;;;;;;;;ACCN,MAAa,wBAAwB,SAAS,kBAAkB,KAAK;CACnE,MAAM,kBAAkB,OAAO;AAE/B,eAAc,iBAAiB,qCAAqC;AAQpE,QAN+B,gBAAgB,IAAI,iBAGzB,yBACxB,0BAA0B"}
@@ -1,4 +1,4 @@
1
- import { K as createApiClient, _t as BaseError, mt as getDefaultClient, ot as assertDefined, t as updateAuthFromVerifyResponse, v as instrumentFunction, vt as getCore } from "./updateAuthFromVerifyResponse-inxvMWJB.esm.js";
1
+ import { J as createApiClient, St as getCore, t as updateAuthFromVerifyResponse, ut as assertDefined, vt as getDefaultClient, xt as BaseError, y as instrumentFunction } from "./updateAuthFromVerifyResponse-C_YKKAIX.esm.js";
2
2
  import { EmbeddedWalletVersionEnum } from "@dynamic-labs/sdk-api-core";
3
3
 
4
4
  //#region src/modules/user/refreshAuth/refreshAuth.ts
@@ -79,4 +79,4 @@ const isDynamicWaasEnabled = (client = getDefaultClient()) => {
79
79
 
80
80
  //#endregion
81
81
  export { NotWaasWalletAccountError as n, __refreshAuth_wrapped as r, isDynamicWaasEnabled as t };
82
- //# sourceMappingURL=isDynamicWaasEnabled-Bb9e8w3u.esm.js.map
82
+ //# sourceMappingURL=isDynamicWaasEnabled-D5e2K02u.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isDynamicWaasEnabled-Bb9e8w3u.esm.js","names":[],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts","../src/errors/NotWaasWalletAccountError.ts","../src/modules/waas/isDynamicWaasEnabled/isDynamicWaasEnabled.ts"],"sourcesContent":["import type { VerifyResponse } from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\nimport { updateAuthFromVerifyResponse } from '../../auth/updateAuthFromVerifyResponse';\n\n/**\n * Refreshes the current session's authentication from the server.\n *\n * This rotates the auth token via a full verify call and updates both the\n * token and the user state from the response, returning the raw\n * `VerifyResponse` (which includes the new token). Reach for this when you\n * need a fresh JWT — e.g. before a call that requires a non-expired token.\n *\n * Prefer `refreshUser` when you only need the latest user profile and do not\n * care about rotating the token: it hits the authenticated-user endpoint,\n * touches only the user state, and returns the `SdkUser` directly.\n *\n * @example\n * ```ts\n * const response = await refreshAuth();\n * console.log('Token refreshed:', response.token);\n * ```\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the verify response.\n * @see logout\n * @see refreshUser\n * @instrumented\n */\nexport const refreshAuth = async (\n client = getDefaultClient()\n): Promise<VerifyResponse> => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const response = await apiClient.refreshAuth({\n environmentId: core.environmentId,\n });\n\n updateAuthFromVerifyResponse({ response }, client);\n\n return response;\n};\n","import { BaseError } from './base';\n\ntype NotWaasWalletAccountErrorParams = {\n walletAddress: string;\n};\n\nexport class NotWaasWalletAccountError extends BaseError {\n constructor({ walletAddress }: NotWaasWalletAccountErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_account_error',\n docsUrl: null,\n name: 'NotWaasWalletAccountError',\n shortMessage: `Wallet account ${walletAddress} is not a Dynamic WaaS wallet account`,\n });\n }\n}\n","import { EmbeddedWalletVersionEnum } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Checks if Dynamic WaaS (Wallet as a Service) is enabled for the current project.\n *\n * This function examines the project settings to determine if Dynamic WaaS is\n * enabled in the Dynamic Dashboard or not.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if Dynamic WaaS is enabled, false otherwise.\n * @notInstrumented\n */\nexport const isDynamicWaasEnabled = (client = getDefaultClient()) => {\n const projectSettings = client.projectSettings;\n\n assertDefined(projectSettings, 'Project settings are not available');\n\n const embeddedWalletSettings = projectSettings.sdk.embeddedWallets;\n\n const dynamicWaasIsEnabled =\n embeddedWalletSettings?.defaultWalletVersion ===\n EmbeddedWalletVersionEnum.V3;\n\n return dynamicWaasIsEnabled;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAE,cAAa,OACb,SAAM,kBAAY;CAElB,MAAM,OAAA,QAAW,OAAM;wBACN,gBAAK,EAAa,EAAA,OAAA,eAGnC,eAAA,KAAA;AAGD,8BAAA,EAAA,UAAA,EAAA,OAAA;;;;;;;;;;;;;;;;;;ACtCD,IAAa,4BAAb,cAA+C,UAAU;CACvD,YAAY,EAAE,iBAAkD;AAC9D,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,kBAAkB,cAAc;GAC/C,CAAC;;;;;;;;;;;;;;;;ACCN,MAAa,wBAAwB,SAAS,kBAAkB,KAAK;CACnE,MAAM,kBAAkB,OAAO;AAE/B,eAAc,iBAAiB,qCAAqC;AAQpE,QAN+B,gBAAgB,IAAI,iBAGzB,yBACxB,0BAA0B"}
1
+ {"version":3,"file":"isDynamicWaasEnabled-D5e2K02u.esm.js","names":[],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts","../src/errors/NotWaasWalletAccountError.ts","../src/modules/waas/isDynamicWaasEnabled/isDynamicWaasEnabled.ts"],"sourcesContent":["import type { VerifyResponse } from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\nimport { updateAuthFromVerifyResponse } from '../../auth/updateAuthFromVerifyResponse';\n\n/**\n * Refreshes the current session's authentication from the server.\n *\n * This rotates the auth token via a full verify call and updates both the\n * token and the user state from the response, returning the raw\n * `VerifyResponse` (which includes the new token). Reach for this when you\n * need a fresh JWT — e.g. before a call that requires a non-expired token.\n *\n * Prefer `refreshUser` when you only need the latest user profile and do not\n * care about rotating the token: it hits the authenticated-user endpoint,\n * touches only the user state, and returns the `SdkUser` directly.\n *\n * @example\n * ```ts\n * const response = await refreshAuth();\n * console.log('Token refreshed:', response.token);\n * ```\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the verify response.\n * @see logout\n * @see refreshUser\n * @instrumented\n */\nexport const refreshAuth = async (\n client = getDefaultClient()\n): Promise<VerifyResponse> => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const response = await apiClient.refreshAuth({\n environmentId: core.environmentId,\n });\n\n updateAuthFromVerifyResponse({ response }, client);\n\n return response;\n};\n","import { BaseError } from './base';\n\ntype NotWaasWalletAccountErrorParams = {\n walletAddress: string;\n};\n\nexport class NotWaasWalletAccountError extends BaseError {\n constructor({ walletAddress }: NotWaasWalletAccountErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_account_error',\n docsUrl: null,\n name: 'NotWaasWalletAccountError',\n shortMessage: `Wallet account ${walletAddress} is not a Dynamic WaaS wallet account`,\n });\n }\n}\n","import { EmbeddedWalletVersionEnum } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Checks if Dynamic WaaS (Wallet as a Service) is enabled for the current project.\n *\n * This function examines the project settings to determine if Dynamic WaaS is\n * enabled in the Dynamic Dashboard or not.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if Dynamic WaaS is enabled, false otherwise.\n * @notInstrumented\n */\nexport const isDynamicWaasEnabled = (client = getDefaultClient()) => {\n const projectSettings = client.projectSettings;\n\n assertDefined(projectSettings, 'Project settings are not available');\n\n const embeddedWalletSettings = projectSettings.sdk.embeddedWallets;\n\n const dynamicWaasIsEnabled =\n embeddedWalletSettings?.defaultWalletVersion ===\n EmbeddedWalletVersionEnum.V3;\n\n return dynamicWaasIsEnabled;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAE,cAAa,OACb,SAAM,kBAAY;CAElB,MAAM,OAAA,QAAW,OAAM;wBACN,gBAAK,EAAa,EAAA,OAAA,eAGnC,eAAA,KAAA;AAGD,8BAAA,EAAA,UAAA,EAAA,OAAA;;;;;;;;;;;;;;;;;;ACtCD,IAAa,4BAAb,cAA+C,UAAU;CACvD,YAAY,EAAE,iBAAkD;AAC9D,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,kBAAkB,cAAc;GAC/C,CAAC;;;;;;;;;;;;;;;;ACCN,MAAa,wBAAwB,SAAS,kBAAkB,KAAK;CACnE,MAAM,kBAAkB,OAAO;AAE/B,eAAc,iBAAiB,qCAAqC;AAQpE,QAN+B,gBAAgB,IAAI,iBAGzB,yBACxB,0BAA0B"}
@@ -1,34 +1,5 @@
1
- import { K as createApiClient, _t as BaseError, mt as getDefaultClient, ot as assertDefined, v as instrumentFunction, vt as getCore } from "./updateAuthFromVerifyResponse-D4au3jUv.native.esm.js";
1
+ import { J as createApiClient, St as getCore, ut as assertDefined, vt as getDefaultClient, y as instrumentFunction } from "./updateAuthFromVerifyResponse-C_YKKAIX.esm.js";
2
2
 
3
- //#region src/errors/NativeModuleNotLinkedError.ts
4
- var NativeModuleNotLinkedError = class extends BaseError {
5
- constructor({ moduleName }) {
6
- super({
7
- cause: null,
8
- code: "native_module_not_linked_error",
9
- details: [
10
- `The "${moduleName}" TurboModule is not registered with React Native.`,
11
- "This usually means the native module was not autolinked into the host app,",
12
- "or the app binary was not rebuilt after installing the SDK.",
13
- "",
14
- "To resolve:",
15
- " 1. Ensure \"@dynamic-labs-sdk/client\" is a direct dependency of the app",
16
- " and reinstall (e.g. `pnpm install`).",
17
- " 2. Rebuild the native app:",
18
- " iOS: `cd ios && pod install && cd .. && npx react-native run-ios`",
19
- " Android: `npx react-native run-android`",
20
- " Expo: `npx expo prebuild --clean` then run the app.",
21
- " 3. Confirm autolinking sees the package:",
22
- " `npx expo-modules-autolinking react-native-config --json`"
23
- ].join("\n"),
24
- docsUrl: null,
25
- name: "NativeModuleNotLinkedError",
26
- shortMessage: `Native TurboModule "${moduleName}" is not linked.`
27
- });
28
- }
29
- };
30
-
31
- //#endregion
32
3
  //#region src/modules/mfa/consumeMfaToken/consumeMfaToken.ts
33
4
  /**
34
5
  * Consumes and clears the current MFA token from the client state.
@@ -102,5 +73,5 @@ const isMfaRequiredForAction = async ({ mfaAction }, client = getDefaultClient()
102
73
  };
103
74
 
104
75
  //#endregion
105
- export { NativeModuleNotLinkedError as i, getMfaMethods as n, __consumeMfaToken_wrapped as r, isMfaRequiredForAction as t };
106
- //# sourceMappingURL=isMfaRequiredForAction-BkrwKqo1.native.esm.js.map
76
+ export { getMfaMethods as n, __consumeMfaToken_wrapped as r, isMfaRequiredForAction as t };
77
+ //# sourceMappingURL=isMfaRequiredForAction-A02NFVt8.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isMfaRequiredForAction-A02NFVt8.esm.js","names":[],"sources":["../src/modules/mfa/consumeMfaToken/consumeMfaToken.ts","../src/modules/mfa/getMfaMethods/getMfaMethods.ts","../src/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.ts"],"sourcesContent":["import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Consumes and clears the current MFA token from the client state.\n *\n * This function retrieves the MFA token obtained from a successful MFA authentication,\n * and removes it from the client, to prevent it from being used again.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns The MFA token that was consumed.\n * @throws Error if no MFA token is found.\n * @instrumented\n */\nexport const consumeMfaToken = (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const mfaToken = core.state.get().mfaToken;\n\n assertDefined(mfaToken, 'No MFA token found');\n\n core.state.set({\n mfaToken: null,\n });\n\n return mfaToken;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\n\n/**\n * Retrieves the available MFA methods for the current user.\n *\n * This function fetches information about which multi-factor authentication\n * methods are available and configured for the user's account.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the user's MFA methods configuration.\n * @notInstrumented\n */\nexport const getMfaMethods = async (client = getDefaultClient()) => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const userMfaMethods = await apiClient.getUserMfaMethods({\n environmentId: core.environmentId,\n verifiedOnly: true,\n });\n\n return userMfaMethods;\n};\n","import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { getMfaMethods } from '../getMfaMethods';\n\ntype IsMfaRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/**\n * Checks if MFA is required for a specific action.\n *\n * This function determines whether multi-factor authentication is required\n * for the specified action based on project settings and user configuration.\n *\n * @param params.mfaAction - The action to check MFA requirements for.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to true if MFA is required for the action, false otherwise.\n * @notInstrumented\n */\nexport const isMfaRequiredForAction = async (\n { mfaAction }: IsMfaRequiredForActionParams,\n client = getDefaultClient()\n) => {\n const projectSettings = client.projectSettings;\n\n const isRequiredForAction = projectSettings?.security?.mfa?.actions?.some(\n (action) => action.action === mfaAction && action.required\n );\n\n // if mfa is not required for the action, return false\n // no matter if general mfa is set to required or not\n if (!isRequiredForAction) {\n return false;\n }\n\n const isMfaMethodRequired = projectSettings?.security?.mfa?.required;\n\n // if mfa is required for the action and also set as required in general, return true\n if (isMfaMethodRequired) {\n return true;\n }\n\n const mfaMethods = await getMfaMethods(client);\n // if general mfa is optional, but user has registered methods,\n // then it should be required for the action\n return mfaMethods.userHasVerifiedMfaMethods;\n};\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAE,mBAAsB,SAAU,kBAAU,KAAA;;;AAK1C,eAAY,UAAI,qBAAA;kBAGhB,UAAO,MACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACbD,MAAa,gBAAgB,OAAO,SAAS,kBAAkB,KAAK;CAClE,MAAM,OAAO,QAAQ,OAAO;AAQ5B,QALuB,MAFL,gBAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;;ACDJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAAS,kBAAkB,KACxB;CACH,MAAM,kBAAkB,OAAO;AAQ/B,KAAI,CANwB,iBAAiB,UAAU,KAAK,SAAS,MAClE,WAAW,OAAO,WAAW,aAAa,OAAO,SACnD,CAKC,QAAO;AAMT,KAH4B,iBAAiB,UAAU,KAAK,SAI1D,QAAO;AAMT,SAHmB,MAAM,cAAc,OAAO,EAG5B"}
@@ -0,0 +1,77 @@
1
+ import { St as getCore, q as createApiClient, ut as assertDefined, vt as getDefaultClient, y as instrumentFunction } from "./NativeModuleNotLinkedError-Ds_t3AZQ.native.esm.js";
2
+
3
+ //#region src/modules/mfa/consumeMfaToken/consumeMfaToken.ts
4
+ /**
5
+ * Consumes and clears the current MFA token from the client state.
6
+ *
7
+ * This function retrieves the MFA token obtained from a successful MFA authentication,
8
+ * and removes it from the client, to prevent it from being used again.
9
+ *
10
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
11
+ * @returns The MFA token that was consumed.
12
+ * @throws Error if no MFA token is found.
13
+ * @instrumented
14
+ */
15
+ const consumeMfaToken = (client = getDefaultClient()) => {
16
+ const core = getCore(client);
17
+ const mfaToken = core.state.get().mfaToken;
18
+ assertDefined(mfaToken, "No MFA token found");
19
+ core.state.set({ mfaToken: null });
20
+ return mfaToken;
21
+ };
22
+ const __consumeMfaToken_impl = consumeMfaToken;
23
+ const __consumeMfaToken_wrapped = instrumentFunction({
24
+ fn: __consumeMfaToken_impl,
25
+ functionName: "consumeMfaToken",
26
+ getCore: () => {
27
+ try {
28
+ return getCore(getDefaultClient());
29
+ } catch {
30
+ return;
31
+ }
32
+ }
33
+ });
34
+
35
+ //#endregion
36
+ //#region src/modules/mfa/getMfaMethods/getMfaMethods.ts
37
+ /**
38
+ * Retrieves the available MFA methods for the current user.
39
+ *
40
+ * This function fetches information about which multi-factor authentication
41
+ * methods are available and configured for the user's account.
42
+ *
43
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
44
+ * @returns A promise that resolves to the user's MFA methods configuration.
45
+ * @notInstrumented
46
+ */
47
+ const getMfaMethods = async (client = getDefaultClient()) => {
48
+ const core = getCore(client);
49
+ return await createApiClient({}, client).getUserMfaMethods({
50
+ environmentId: core.environmentId,
51
+ verifiedOnly: true
52
+ });
53
+ };
54
+
55
+ //#endregion
56
+ //#region src/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.ts
57
+ /**
58
+ * Checks if MFA is required for a specific action.
59
+ *
60
+ * This function determines whether multi-factor authentication is required
61
+ * for the specified action based on project settings and user configuration.
62
+ *
63
+ * @param params.mfaAction - The action to check MFA requirements for.
64
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
65
+ * @returns A promise that resolves to true if MFA is required for the action, false otherwise.
66
+ * @notInstrumented
67
+ */
68
+ const isMfaRequiredForAction = async ({ mfaAction }, client = getDefaultClient()) => {
69
+ const projectSettings = client.projectSettings;
70
+ if (!projectSettings?.security?.mfa?.actions?.some((action) => action.action === mfaAction && action.required)) return false;
71
+ if (projectSettings?.security?.mfa?.required) return true;
72
+ return (await getMfaMethods(client)).userHasVerifiedMfaMethods;
73
+ };
74
+
75
+ //#endregion
76
+ export { getMfaMethods as n, __consumeMfaToken_wrapped as r, isMfaRequiredForAction as t };
77
+ //# sourceMappingURL=isMfaRequiredForAction-D4TSMQ4m.native.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isMfaRequiredForAction-D4TSMQ4m.native.esm.js","names":[],"sources":["../src/modules/mfa/consumeMfaToken/consumeMfaToken.ts","../src/modules/mfa/getMfaMethods/getMfaMethods.ts","../src/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.ts"],"sourcesContent":["import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Consumes and clears the current MFA token from the client state.\n *\n * This function retrieves the MFA token obtained from a successful MFA authentication,\n * and removes it from the client, to prevent it from being used again.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns The MFA token that was consumed.\n * @throws Error if no MFA token is found.\n * @instrumented\n */\nexport const consumeMfaToken = (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const mfaToken = core.state.get().mfaToken;\n\n assertDefined(mfaToken, 'No MFA token found');\n\n core.state.set({\n mfaToken: null,\n });\n\n return mfaToken;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\n\n/**\n * Retrieves the available MFA methods for the current user.\n *\n * This function fetches information about which multi-factor authentication\n * methods are available and configured for the user's account.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the user's MFA methods configuration.\n * @notInstrumented\n */\nexport const getMfaMethods = async (client = getDefaultClient()) => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const userMfaMethods = await apiClient.getUserMfaMethods({\n environmentId: core.environmentId,\n verifiedOnly: true,\n });\n\n return userMfaMethods;\n};\n","import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { getMfaMethods } from '../getMfaMethods';\n\ntype IsMfaRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/**\n * Checks if MFA is required for a specific action.\n *\n * This function determines whether multi-factor authentication is required\n * for the specified action based on project settings and user configuration.\n *\n * @param params.mfaAction - The action to check MFA requirements for.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to true if MFA is required for the action, false otherwise.\n * @notInstrumented\n */\nexport const isMfaRequiredForAction = async (\n { mfaAction }: IsMfaRequiredForActionParams,\n client = getDefaultClient()\n) => {\n const projectSettings = client.projectSettings;\n\n const isRequiredForAction = projectSettings?.security?.mfa?.actions?.some(\n (action) => action.action === mfaAction && action.required\n );\n\n // if mfa is not required for the action, return false\n // no matter if general mfa is set to required or not\n if (!isRequiredForAction) {\n return false;\n }\n\n const isMfaMethodRequired = projectSettings?.security?.mfa?.required;\n\n // if mfa is required for the action and also set as required in general, return true\n if (isMfaMethodRequired) {\n return true;\n }\n\n const mfaMethods = await getMfaMethods(client);\n // if general mfa is optional, but user has registered methods,\n // then it should be required for the action\n return mfaMethods.userHasVerifiedMfaMethods;\n};\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAE,mBAAsB,SAAU,kBAAU,KAAA;;;AAK1C,eAAY,UAAI,qBAAA;kBAGhB,UAAO,MACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACbD,MAAa,gBAAgB,OAAO,SAAS,kBAAkB,KAAK;CAClE,MAAM,OAAO,QAAQ,OAAO;AAQ5B,QALuB,MAFL,gBAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;;ACDJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAAS,kBAAkB,KACxB;CACH,MAAM,kBAAkB,OAAO;AAQ/B,KAAI,CANwB,iBAAiB,UAAU,KAAK,SAAS,MAClE,WAAW,OAAO,WAAW,aAAa,OAAO,SACnD,CAKC,QAAO;AAMT,KAH4B,iBAAiB,UAAU,KAAK,SAI1D,QAAO;AAMT,SAHmB,MAAM,cAAc,OAAO,EAG5B"}
@@ -0,0 +1,94 @@
1
+ const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-CSqnGlh3.cjs');
2
+
3
+ //#region src/modules/mfa/consumeMfaToken/consumeMfaToken.ts
4
+ /**
5
+ * Consumes and clears the current MFA token from the client state.
6
+ *
7
+ * This function retrieves the MFA token obtained from a successful MFA authentication,
8
+ * and removes it from the client, to prevent it from being used again.
9
+ *
10
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
11
+ * @returns The MFA token that was consumed.
12
+ * @throws Error if no MFA token is found.
13
+ * @instrumented
14
+ */
15
+ const consumeMfaToken = (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
16
+ const core = require_updateAuthFromVerifyResponse.getCore(client);
17
+ const mfaToken = core.state.get().mfaToken;
18
+ require_updateAuthFromVerifyResponse.assertDefined(mfaToken, "No MFA token found");
19
+ core.state.set({ mfaToken: null });
20
+ return mfaToken;
21
+ };
22
+ const __consumeMfaToken_impl = consumeMfaToken;
23
+ const __consumeMfaToken_wrapped = require_updateAuthFromVerifyResponse.instrumentFunction({
24
+ fn: __consumeMfaToken_impl,
25
+ functionName: "consumeMfaToken",
26
+ getCore: () => {
27
+ try {
28
+ return require_updateAuthFromVerifyResponse.getCore(require_updateAuthFromVerifyResponse.getDefaultClient());
29
+ } catch {
30
+ return;
31
+ }
32
+ }
33
+ });
34
+
35
+ //#endregion
36
+ //#region src/modules/mfa/getMfaMethods/getMfaMethods.ts
37
+ /**
38
+ * Retrieves the available MFA methods for the current user.
39
+ *
40
+ * This function fetches information about which multi-factor authentication
41
+ * methods are available and configured for the user's account.
42
+ *
43
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
44
+ * @returns A promise that resolves to the user's MFA methods configuration.
45
+ * @notInstrumented
46
+ */
47
+ const getMfaMethods = async (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
48
+ const core = require_updateAuthFromVerifyResponse.getCore(client);
49
+ return await require_updateAuthFromVerifyResponse.createApiClient({}, client).getUserMfaMethods({
50
+ environmentId: core.environmentId,
51
+ verifiedOnly: true
52
+ });
53
+ };
54
+
55
+ //#endregion
56
+ //#region src/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.ts
57
+ /**
58
+ * Checks if MFA is required for a specific action.
59
+ *
60
+ * This function determines whether multi-factor authentication is required
61
+ * for the specified action based on project settings and user configuration.
62
+ *
63
+ * @param params.mfaAction - The action to check MFA requirements for.
64
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
65
+ * @returns A promise that resolves to true if MFA is required for the action, false otherwise.
66
+ * @notInstrumented
67
+ */
68
+ const isMfaRequiredForAction = async ({ mfaAction }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
69
+ const projectSettings = client.projectSettings;
70
+ if (!projectSettings?.security?.mfa?.actions?.some((action) => action.action === mfaAction && action.required)) return false;
71
+ if (projectSettings?.security?.mfa?.required) return true;
72
+ return (await getMfaMethods(client)).userHasVerifiedMfaMethods;
73
+ };
74
+
75
+ //#endregion
76
+ Object.defineProperty(exports, '__consumeMfaToken_wrapped', {
77
+ enumerable: true,
78
+ get: function () {
79
+ return __consumeMfaToken_wrapped;
80
+ }
81
+ });
82
+ Object.defineProperty(exports, 'getMfaMethods', {
83
+ enumerable: true,
84
+ get: function () {
85
+ return getMfaMethods;
86
+ }
87
+ });
88
+ Object.defineProperty(exports, 'isMfaRequiredForAction', {
89
+ enumerable: true,
90
+ get: function () {
91
+ return isMfaRequiredForAction;
92
+ }
93
+ });
94
+ //# sourceMappingURL=isMfaRequiredForAction-odpvykkm.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isMfaRequiredForAction-odpvykkm.cjs","names":["getDefaultClient","getCore","createApiClient","getDefaultClient"],"sources":["../src/modules/mfa/consumeMfaToken/consumeMfaToken.ts","../src/modules/mfa/getMfaMethods/getMfaMethods.ts","../src/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.ts"],"sourcesContent":["import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Consumes and clears the current MFA token from the client state.\n *\n * This function retrieves the MFA token obtained from a successful MFA authentication,\n * and removes it from the client, to prevent it from being used again.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns The MFA token that was consumed.\n * @throws Error if no MFA token is found.\n * @instrumented\n */\nexport const consumeMfaToken = (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const mfaToken = core.state.get().mfaToken;\n\n assertDefined(mfaToken, 'No MFA token found');\n\n core.state.set({\n mfaToken: null,\n });\n\n return mfaToken;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\n\n/**\n * Retrieves the available MFA methods for the current user.\n *\n * This function fetches information about which multi-factor authentication\n * methods are available and configured for the user's account.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the user's MFA methods configuration.\n * @notInstrumented\n */\nexport const getMfaMethods = async (client = getDefaultClient()) => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const userMfaMethods = await apiClient.getUserMfaMethods({\n environmentId: core.environmentId,\n verifiedOnly: true,\n });\n\n return userMfaMethods;\n};\n","import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { getMfaMethods } from '../getMfaMethods';\n\ntype IsMfaRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/**\n * Checks if MFA is required for a specific action.\n *\n * This function determines whether multi-factor authentication is required\n * for the specified action based on project settings and user configuration.\n *\n * @param params.mfaAction - The action to check MFA requirements for.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to true if MFA is required for the action, false otherwise.\n * @notInstrumented\n */\nexport const isMfaRequiredForAction = async (\n { mfaAction }: IsMfaRequiredForActionParams,\n client = getDefaultClient()\n) => {\n const projectSettings = client.projectSettings;\n\n const isRequiredForAction = projectSettings?.security?.mfa?.actions?.some(\n (action) => action.action === mfaAction && action.required\n );\n\n // if mfa is not required for the action, return false\n // no matter if general mfa is set to required or not\n if (!isRequiredForAction) {\n return false;\n }\n\n const isMfaMethodRequired = projectSettings?.security?.mfa?.required;\n\n // if mfa is required for the action and also set as required in general, return true\n if (isMfaMethodRequired) {\n return true;\n }\n\n const mfaMethods = await getMfaMethods(client);\n // if general mfa is optional, but user has registered methods,\n // then it should be required for the action\n return mfaMethods.userHasVerifiedMfaMethods;\n};\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAE,mBAAsB,SAAU,uDAAU,KAAA;;;AAK1C,oDAAY,UAAI,qBAAA;kBAGhB,UAAO,MACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACbD,MAAa,gBAAgB,OAAO,SAASA,uDAAkB,KAAK;CAClE,MAAM,OAAOC,6CAAQ,OAAO;AAQ5B,QALuB,MAFLC,qDAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;;ACDJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAASC,uDAAkB,KACxB;CACH,MAAM,kBAAkB,OAAO;AAQ/B,KAAI,CANwB,iBAAiB,UAAU,KAAK,SAAS,MAClE,WAAW,OAAO,WAAW,aAAa,OAAO,SACnD,CAKC,QAAO;AAMT,KAH4B,iBAAiB,UAAU,KAAK,SAI1D,QAAO;AAMT,SAHmB,MAAM,cAAc,OAAO,EAG5B"}
@@ -1,9 +1,48 @@
1
- const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-CHeYEkjj.cjs');
2
- const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-CY0xTIXF.cjs');
3
- const require_isDynamicWaasEnabled = require('./isDynamicWaasEnabled-Dmbdiybh.cjs');
1
+ const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-CSqnGlh3.cjs');
2
+ const require_isDynamicWaasEnabled = require('./isDynamicWaasEnabled-BEVAshnS.cjs');
4
3
  let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
5
4
  let _dynamic_labs_wallet_browser_wallet_client = require("@dynamic-labs-wallet/browser-wallet-client");
6
5
 
6
+ //#region src/errors/WaasLoadFailedError.ts
7
+ /**
8
+ * Thrown when the embedded (WaaS) wallet's secure container failed to load
9
+ * after exhausting all of its internal retry attempts.
10
+ *
11
+ * This failure is transient: the next wallet operation triggers a fresh load
12
+ * cycle, so hosts can catch this error and re-attempt the operation at their
13
+ * own cadence (for example, when connectivity returns or the app is
14
+ * foregrounded). Other load failures (for example, a CSP block) are not
15
+ * wrapped by this error and their shape is not guaranteed.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * try {
20
+ * await signMessage({ message, walletAccount });
21
+ * } catch (error) {
22
+ * if (error instanceof WaasLoadFailedError) {
23
+ * // transient — retry the operation at your own cadence
24
+ * await signMessage({ message, walletAccount });
25
+ * }
26
+ * }
27
+ * ```
28
+ * @see WaasLoadFailedErrorReason
29
+ * @see signMessage
30
+ */
31
+ var WaasLoadFailedError = class extends require_updateAuthFromVerifyResponse.BaseError {
32
+ reason;
33
+ constructor({ cause }) {
34
+ super({
35
+ cause,
36
+ code: "waas_load_failed",
37
+ docsUrl: null,
38
+ name: "WaasLoadFailedError",
39
+ shortMessage: "The embedded wallet failed to load after exhausting its retry attempts. Retrying the wallet operation triggers a fresh load."
40
+ });
41
+ this.reason = "load_attempts_exhausted";
42
+ }
43
+ };
44
+
45
+ //#endregion
7
46
  //#region src/errors/WaasOnboardingIncompleteError.ts
8
47
  /**
9
48
  * Thrown when the embedded (WaaS) wallet client is requested before the user
@@ -128,6 +167,12 @@ const isUserOnboardingComplete = (client = require_updateAuthFromVerifyResponse.
128
167
  };
129
168
 
130
169
  //#endregion
170
+ Object.defineProperty(exports, 'WaasLoadFailedError', {
171
+ enumerable: true,
172
+ get: function () {
173
+ return WaasLoadFailedError;
174
+ }
175
+ });
131
176
  Object.defineProperty(exports, 'WaasOnboardingIncompleteError', {
132
177
  enumerable: true,
133
178
  get: function () {
@@ -158,4 +203,4 @@ Object.defineProperty(exports, 'preconnectWaasIframe', {
158
203
  return preconnectWaasIframe;
159
204
  }
160
205
  });
161
- //# sourceMappingURL=isUserOnboardingComplete-CruwjMvs.cjs.map
206
+ //# sourceMappingURL=isUserOnboardingComplete-CEVSIxJC.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isUserOnboardingComplete-CEVSIxJC.cjs","names":["BaseError","BaseError","getCore","isDynamicWaasEnabled","isCookieEnabled","DEFAULT_WAAS_BASE_API_URL","getDefaultClient","MfaBackupCodeAcknowledgement","getDefaultClient","isUserMissingMfaAuth"],"sources":["../src/errors/WaasLoadFailedError.ts","../src/errors/WaasOnboardingIncompleteError.ts","../src/modules/waas/preconnectWaasIframe/preconnectWaasIframe.ts","../src/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.ts","../src/modules/mfa/isPendingRecoveryCodesAcknowledgment/isPendingRecoveryCodesAcknowledgment.ts","../src/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.ts"],"sourcesContent":["import { BaseError } from './base';\n\n/**\n * Why the embedded wallet load failed. Currently only retry exhaustion is\n * reported; the union exists so new reasons can be added without a breaking\n * change to consumer `instanceof` handling.\n *\n * @example\n * ```ts\n * const reason: WaasLoadFailedErrorReason = 'load_attempts_exhausted';\n * ```\n * @see WaasLoadFailedError\n * @see signMessage\n */\nexport type WaasLoadFailedErrorReason = 'load_attempts_exhausted';\n\n/**\n * Thrown when the embedded (WaaS) wallet's secure container failed to load\n * after exhausting all of its internal retry attempts.\n *\n * This failure is transient: the next wallet operation triggers a fresh load\n * cycle, so hosts can catch this error and re-attempt the operation at their\n * own cadence (for example, when connectivity returns or the app is\n * foregrounded). Other load failures (for example, a CSP block) are not\n * wrapped by this error and their shape is not guaranteed.\n *\n * @example\n * ```ts\n * try {\n * await signMessage({ message, walletAccount });\n * } catch (error) {\n * if (error instanceof WaasLoadFailedError) {\n * // transient — retry the operation at your own cadence\n * await signMessage({ message, walletAccount });\n * }\n * }\n * ```\n * @see WaasLoadFailedErrorReason\n * @see signMessage\n */\nexport class WaasLoadFailedError extends BaseError {\n readonly reason: WaasLoadFailedErrorReason;\n\n constructor({ cause }: { cause: Error }) {\n super({\n cause,\n code: 'waas_load_failed',\n docsUrl: null,\n name: 'WaasLoadFailedError',\n shortMessage:\n 'The embedded wallet failed to load after exhausting its retry attempts. Retrying the wallet operation triggers a fresh load.',\n });\n this.reason = 'load_attempts_exhausted';\n }\n}\n","import { BaseError } from './base';\n\n/**\n * Thrown when the embedded (WaaS) wallet client is requested before the user\n * has completed onboarding — i.e. the JWT has not upgraded to `user:basic`\n * because MFA, KYC, recovery-codes acknowledgment, or device registration is\n * still pending.\n *\n * The WaaS iframe's init-time room-cache pre-warm fires `createRooms` using the\n * token captured at client construction (before any per-operation token\n * resync). Building the client during this window lets that pre-warm fire with\n * a pre-`user:basic` token, get a 401, and the iframe's unauthorized handler\n * force-logs-out the user. Throwing here surfaces a clear, recoverable reason\n * instead — wait for onboarding to complete and retry.\n */\nexport class WaasOnboardingIncompleteError extends BaseError {\n constructor() {\n super({\n cause: null,\n code: 'waas_onboarding_incomplete',\n docsUrl: null,\n name: 'WaasOnboardingIncompleteError',\n shortMessage:\n 'Cannot create or access the embedded wallet until onboarding is complete (pending MFA, KYC, recovery-codes acknowledgment, or device registration).',\n });\n }\n}\n","import type { AuthMode } from '@dynamic-labs-wallet/browser-wallet-client';\nimport { preconnectWaasIframe as preconnectWaasIframeOrigin } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport { DEFAULT_WAAS_BASE_API_URL } from '../constants';\nimport { isDynamicWaasEnabled } from '../isDynamicWaasEnabled';\n\n/**\n * Warms the browser's connection (DNS + TCP + TLS) to the embedded-wallet\n * iframe origin so the iframe mounted after authentication completes loads on\n * a hot connection. Called when an auth flow starts (OTP send/verify, social\n * callback). Safe to call repeatedly; no-op on React Native / SSR and when\n * Dynamic WaaS is not enabled.\n *\n * @param client - The Dynamic client instance.\n * @notInstrumented\n */\nexport const preconnectWaasIframe = (client: DynamicClient): void => {\n const core = getCore(client);\n try {\n if (!isDynamicWaasEnabled(client)) return;\n\n preconnectWaasIframeOrigin({\n authMode: (isCookieEnabled(client) ? 'cookie' : 'header') as AuthMode,\n baseApiUrl: (core.apiBaseUrl || DEFAULT_WAAS_BASE_API_URL).replace(\n '/api/v0',\n ''\n ),\n });\n } catch (error) {\n // Best-effort: never break the auth flow (also swallows the assertion\n // from isDynamicWaasEnabled when project settings are not loaded yet).\n core.logger.warn('[preconnectWaasIframe] skipped', error);\n }\n};\n","import type { User } from '../../user/user.types';\n\n/**\n * Checks if device registration is required for the given user.\n *\n * This function determines if the user has the deviceRegistration\n * scope, indicating that device registration is required.\n *\n * @param user - The user to check.\n * @returns True if device registration is required, false otherwise.\n * @notInstrumented\n * @hook Exposed as a hook so consumers reactively know when this device must be registered, updated when the user changes.\n */\nexport const isDeviceRegistrationRequired = (user: User) =>\n Boolean(user.scope?.includes('device:register'));\n","import { MfaBackupCodeAcknowledgement } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Checks if the user is still pending acknowledgment of their MFA recovery codes.\n *\n * This function determines whether the user has been presented with recovery\n * codes that they have not yet acknowledged as saved or backed up.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if recovery codes are pending acknowledgment, false otherwise.\n * @notInstrumented\n * @hook Exposed as a hook so consumers reactively know when recovery codes await acknowledgment, updated when the user changes.\n */\nexport const isPendingRecoveryCodesAcknowledgment = (\n client = getDefaultClient()\n) => {\n const user = client.user;\n\n assertDefined(user, 'User not logged in');\n\n return (\n user.mfaBackupCodeAcknowledgement === MfaBackupCodeAcknowledgement.Pending\n );\n};\n","import { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport { isDeviceRegistrationRequired } from '../../deviceRegistration/isDeviceRegistrationRequired';\nimport { isPendingRecoveryCodesAcknowledgment } from '../../mfa/isPendingRecoveryCodesAcknowledgment';\nimport { isUserMissingMfaAuth } from '../../mfa/isUserMissingMfaAuth';\n\n/**\n * Checks if the user has completed all onboarding requirements.\n *\n * This function verifies whether a user has fulfilled all necessary requirements\n * including KYC fields (Know Your Customer information), MFA setup\n * (Multi-Factor Authentication including recovery codes acknowledgment), and\n * device registration.\n *\n * A `false` result means the user still has an outstanding onboarding step, so\n * any feature that requires a fully onboarded (`user:basic`) user should hold\n * off until it returns `true`. Creating or accessing an embedded (WaaS) wallet\n * is one such feature — its backend calls reject a pre-`user:basic` token — but\n * this predicate is general and not specific to embedded wallets.\n *\n * @deprecated Use {@link checkUserScopes} instead. This function conflates\n * Dynamic-controlled requirements (MFA, device registration, required fields)\n * with the concept of \"onboarding complete\", which is app-specific. Replace\n * with `checkUserScopes({ user, scopes: ['user:basic'] })` to check whether\n * Dynamic's requirements are satisfied, and compose your own logic on top for\n * any app-specific onboarding steps.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if onboarding is complete (no pending requirements), false if there are pending requirements.\n * @notInstrumented\n * @hook Exposed as a hook so consumers reactively know when onboarding is complete, updated when the user changes.\n */\nexport const isUserOnboardingComplete = (client = getDefaultClient()) => {\n const user = client.user;\n\n assertDefined(user, 'User not logged in');\n\n const hasMissingKycFields = Boolean(user.missingFields?.length);\n const hasPendingMfaAuth = isUserMissingMfaAuth(client);\n const hasPendingRecoveryCodes = isPendingRecoveryCodesAcknowledgment(client);\n const hasPendingDeviceRegistration = isDeviceRegistrationRequired(user);\n\n const userOnboardingComplete =\n !hasMissingKycFields &&\n !hasPendingMfaAuth &&\n !hasPendingRecoveryCodes &&\n !hasPendingDeviceRegistration;\n\n return userOnboardingComplete;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,IAAa,sBAAb,cAAyCA,+CAAU;CACjD,AAAS;CAET,YAAY,EAAE,SAA2B;AACvC,QAAM;GACJ;GACA,MAAM;GACN,SAAS;GACT,MAAM;GACN,cACE;GACH,CAAC;AACF,OAAK,SAAS;;;;;;;;;;;;;;;;;;;ACrClB,IAAa,gCAAb,cAAmDC,+CAAU;CAC3D,cAAc;AACZ,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cACE;GACH,CAAC;;;;;;;;;;;;;;;;ACLN,MAAa,wBAAwB,WAAgC;CACnE,MAAM,OAAOC,6CAAQ,OAAO;AAC5B,KAAI;AACF,MAAI,CAACC,kDAAqB,OAAO,CAAE;AAEnC,uEAA2B;GACzB,UAAWC,qDAAgB,OAAO,GAAG,WAAW;GAChD,aAAa,KAAK,cAAcC,gEAA2B,QACzD,WACA,GACD;GACF,CAAC;UACK,OAAO;AAGd,OAAK,OAAO,KAAK,kCAAkC,MAAM;;;;;;;;;;;;;;;;;ACrB7D,MAAa,gCAAgC,SAC3C,QAAQ,KAAK,OAAO,SAAS,kBAAkB,CAAC;;;;;;;;;;;;;;;ACElD,MAAa,wCACX,SAASC,uDAAkB,KACxB;CACH,MAAM,OAAO,OAAO;AAEpB,oDAAc,MAAM,qBAAqB;AAEzC,QACE,KAAK,iCAAiCC,wDAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACQvE,MAAa,4BAA4B,SAASC,uDAAkB,KAAK;CACvE,MAAM,OAAO,OAAO;AAEpB,oDAAc,MAAM,qBAAqB;CAEzC,MAAM,sBAAsB,QAAQ,KAAK,eAAe,OAAO;CAC/D,MAAM,oBAAoBC,0DAAqB,OAAO;CACtD,MAAM,0BAA0B,qCAAqC,OAAO;CAC5E,MAAM,+BAA+B,6BAA6B,KAAK;AAQvE,QALE,CAAC,uBACD,CAAC,qBACD,CAAC,2BACD,CAAC"}
@@ -1,8 +1,48 @@
1
- import { _t as BaseError, at as isCookieEnabled, l as DEFAULT_WAAS_BASE_API_URL, mt as getDefaultClient, ot as assertDefined, p as isUserMissingMfaAuth, vt as getCore } from "./updateAuthFromVerifyResponse-inxvMWJB.esm.js";
2
- import { t as isDynamicWaasEnabled } from "./isDynamicWaasEnabled-Bb9e8w3u.esm.js";
1
+ import { St as getCore, l as DEFAULT_WAAS_BASE_API_URL, lt as isCookieEnabled, p as isUserMissingMfaAuth, ut as assertDefined, vt as getDefaultClient, xt as BaseError } from "./updateAuthFromVerifyResponse-C_YKKAIX.esm.js";
2
+ import { t as isDynamicWaasEnabled } from "./isDynamicWaasEnabled-D5e2K02u.esm.js";
3
3
  import { MfaBackupCodeAcknowledgement } from "@dynamic-labs/sdk-api-core";
4
4
  import { preconnectWaasIframe } from "@dynamic-labs-wallet/browser-wallet-client";
5
5
 
6
+ //#region src/errors/WaasLoadFailedError.ts
7
+ /**
8
+ * Thrown when the embedded (WaaS) wallet's secure container failed to load
9
+ * after exhausting all of its internal retry attempts.
10
+ *
11
+ * This failure is transient: the next wallet operation triggers a fresh load
12
+ * cycle, so hosts can catch this error and re-attempt the operation at their
13
+ * own cadence (for example, when connectivity returns or the app is
14
+ * foregrounded). Other load failures (for example, a CSP block) are not
15
+ * wrapped by this error and their shape is not guaranteed.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * try {
20
+ * await signMessage({ message, walletAccount });
21
+ * } catch (error) {
22
+ * if (error instanceof WaasLoadFailedError) {
23
+ * // transient — retry the operation at your own cadence
24
+ * await signMessage({ message, walletAccount });
25
+ * }
26
+ * }
27
+ * ```
28
+ * @see WaasLoadFailedErrorReason
29
+ * @see signMessage
30
+ */
31
+ var WaasLoadFailedError = class extends BaseError {
32
+ reason;
33
+ constructor({ cause }) {
34
+ super({
35
+ cause,
36
+ code: "waas_load_failed",
37
+ docsUrl: null,
38
+ name: "WaasLoadFailedError",
39
+ shortMessage: "The embedded wallet failed to load after exhausting its retry attempts. Retrying the wallet operation triggers a fresh load."
40
+ });
41
+ this.reason = "load_attempts_exhausted";
42
+ }
43
+ };
44
+
45
+ //#endregion
6
46
  //#region src/errors/WaasOnboardingIncompleteError.ts
7
47
  /**
8
48
  * Thrown when the embedded (WaaS) wallet client is requested before the user
@@ -127,5 +167,5 @@ const isUserOnboardingComplete = (client = getDefaultClient()) => {
127
167
  };
128
168
 
129
169
  //#endregion
130
- export { WaasOnboardingIncompleteError as a, preconnectWaasIframe$1 as i, isPendingRecoveryCodesAcknowledgment as n, isDeviceRegistrationRequired as r, isUserOnboardingComplete as t };
131
- //# sourceMappingURL=isUserOnboardingComplete-DAesufca.esm.js.map
170
+ export { WaasOnboardingIncompleteError as a, preconnectWaasIframe$1 as i, isPendingRecoveryCodesAcknowledgment as n, WaasLoadFailedError as o, isDeviceRegistrationRequired as r, isUserOnboardingComplete as t };
171
+ //# sourceMappingURL=isUserOnboardingComplete-Cgkw21XZ.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isUserOnboardingComplete-Cgkw21XZ.esm.js","names":["preconnectWaasIframe"],"sources":["../src/errors/WaasLoadFailedError.ts","../src/errors/WaasOnboardingIncompleteError.ts","../src/modules/waas/preconnectWaasIframe/preconnectWaasIframe.ts","../src/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.ts","../src/modules/mfa/isPendingRecoveryCodesAcknowledgment/isPendingRecoveryCodesAcknowledgment.ts","../src/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.ts"],"sourcesContent":["import { BaseError } from './base';\n\n/**\n * Why the embedded wallet load failed. Currently only retry exhaustion is\n * reported; the union exists so new reasons can be added without a breaking\n * change to consumer `instanceof` handling.\n *\n * @example\n * ```ts\n * const reason: WaasLoadFailedErrorReason = 'load_attempts_exhausted';\n * ```\n * @see WaasLoadFailedError\n * @see signMessage\n */\nexport type WaasLoadFailedErrorReason = 'load_attempts_exhausted';\n\n/**\n * Thrown when the embedded (WaaS) wallet's secure container failed to load\n * after exhausting all of its internal retry attempts.\n *\n * This failure is transient: the next wallet operation triggers a fresh load\n * cycle, so hosts can catch this error and re-attempt the operation at their\n * own cadence (for example, when connectivity returns or the app is\n * foregrounded). Other load failures (for example, a CSP block) are not\n * wrapped by this error and their shape is not guaranteed.\n *\n * @example\n * ```ts\n * try {\n * await signMessage({ message, walletAccount });\n * } catch (error) {\n * if (error instanceof WaasLoadFailedError) {\n * // transient — retry the operation at your own cadence\n * await signMessage({ message, walletAccount });\n * }\n * }\n * ```\n * @see WaasLoadFailedErrorReason\n * @see signMessage\n */\nexport class WaasLoadFailedError extends BaseError {\n readonly reason: WaasLoadFailedErrorReason;\n\n constructor({ cause }: { cause: Error }) {\n super({\n cause,\n code: 'waas_load_failed',\n docsUrl: null,\n name: 'WaasLoadFailedError',\n shortMessage:\n 'The embedded wallet failed to load after exhausting its retry attempts. Retrying the wallet operation triggers a fresh load.',\n });\n this.reason = 'load_attempts_exhausted';\n }\n}\n","import { BaseError } from './base';\n\n/**\n * Thrown when the embedded (WaaS) wallet client is requested before the user\n * has completed onboarding — i.e. the JWT has not upgraded to `user:basic`\n * because MFA, KYC, recovery-codes acknowledgment, or device registration is\n * still pending.\n *\n * The WaaS iframe's init-time room-cache pre-warm fires `createRooms` using the\n * token captured at client construction (before any per-operation token\n * resync). Building the client during this window lets that pre-warm fire with\n * a pre-`user:basic` token, get a 401, and the iframe's unauthorized handler\n * force-logs-out the user. Throwing here surfaces a clear, recoverable reason\n * instead — wait for onboarding to complete and retry.\n */\nexport class WaasOnboardingIncompleteError extends BaseError {\n constructor() {\n super({\n cause: null,\n code: 'waas_onboarding_incomplete',\n docsUrl: null,\n name: 'WaasOnboardingIncompleteError',\n shortMessage:\n 'Cannot create or access the embedded wallet until onboarding is complete (pending MFA, KYC, recovery-codes acknowledgment, or device registration).',\n });\n }\n}\n","import type { AuthMode } from '@dynamic-labs-wallet/browser-wallet-client';\nimport { preconnectWaasIframe as preconnectWaasIframeOrigin } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport { DEFAULT_WAAS_BASE_API_URL } from '../constants';\nimport { isDynamicWaasEnabled } from '../isDynamicWaasEnabled';\n\n/**\n * Warms the browser's connection (DNS + TCP + TLS) to the embedded-wallet\n * iframe origin so the iframe mounted after authentication completes loads on\n * a hot connection. Called when an auth flow starts (OTP send/verify, social\n * callback). Safe to call repeatedly; no-op on React Native / SSR and when\n * Dynamic WaaS is not enabled.\n *\n * @param client - The Dynamic client instance.\n * @notInstrumented\n */\nexport const preconnectWaasIframe = (client: DynamicClient): void => {\n const core = getCore(client);\n try {\n if (!isDynamicWaasEnabled(client)) return;\n\n preconnectWaasIframeOrigin({\n authMode: (isCookieEnabled(client) ? 'cookie' : 'header') as AuthMode,\n baseApiUrl: (core.apiBaseUrl || DEFAULT_WAAS_BASE_API_URL).replace(\n '/api/v0',\n ''\n ),\n });\n } catch (error) {\n // Best-effort: never break the auth flow (also swallows the assertion\n // from isDynamicWaasEnabled when project settings are not loaded yet).\n core.logger.warn('[preconnectWaasIframe] skipped', error);\n }\n};\n","import type { User } from '../../user/user.types';\n\n/**\n * Checks if device registration is required for the given user.\n *\n * This function determines if the user has the deviceRegistration\n * scope, indicating that device registration is required.\n *\n * @param user - The user to check.\n * @returns True if device registration is required, false otherwise.\n * @notInstrumented\n * @hook Exposed as a hook so consumers reactively know when this device must be registered, updated when the user changes.\n */\nexport const isDeviceRegistrationRequired = (user: User) =>\n Boolean(user.scope?.includes('device:register'));\n","import { MfaBackupCodeAcknowledgement } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Checks if the user is still pending acknowledgment of their MFA recovery codes.\n *\n * This function determines whether the user has been presented with recovery\n * codes that they have not yet acknowledged as saved or backed up.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if recovery codes are pending acknowledgment, false otherwise.\n * @notInstrumented\n * @hook Exposed as a hook so consumers reactively know when recovery codes await acknowledgment, updated when the user changes.\n */\nexport const isPendingRecoveryCodesAcknowledgment = (\n client = getDefaultClient()\n) => {\n const user = client.user;\n\n assertDefined(user, 'User not logged in');\n\n return (\n user.mfaBackupCodeAcknowledgement === MfaBackupCodeAcknowledgement.Pending\n );\n};\n","import { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport { isDeviceRegistrationRequired } from '../../deviceRegistration/isDeviceRegistrationRequired';\nimport { isPendingRecoveryCodesAcknowledgment } from '../../mfa/isPendingRecoveryCodesAcknowledgment';\nimport { isUserMissingMfaAuth } from '../../mfa/isUserMissingMfaAuth';\n\n/**\n * Checks if the user has completed all onboarding requirements.\n *\n * This function verifies whether a user has fulfilled all necessary requirements\n * including KYC fields (Know Your Customer information), MFA setup\n * (Multi-Factor Authentication including recovery codes acknowledgment), and\n * device registration.\n *\n * A `false` result means the user still has an outstanding onboarding step, so\n * any feature that requires a fully onboarded (`user:basic`) user should hold\n * off until it returns `true`. Creating or accessing an embedded (WaaS) wallet\n * is one such feature — its backend calls reject a pre-`user:basic` token — but\n * this predicate is general and not specific to embedded wallets.\n *\n * @deprecated Use {@link checkUserScopes} instead. This function conflates\n * Dynamic-controlled requirements (MFA, device registration, required fields)\n * with the concept of \"onboarding complete\", which is app-specific. Replace\n * with `checkUserScopes({ user, scopes: ['user:basic'] })` to check whether\n * Dynamic's requirements are satisfied, and compose your own logic on top for\n * any app-specific onboarding steps.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if onboarding is complete (no pending requirements), false if there are pending requirements.\n * @notInstrumented\n * @hook Exposed as a hook so consumers reactively know when onboarding is complete, updated when the user changes.\n */\nexport const isUserOnboardingComplete = (client = getDefaultClient()) => {\n const user = client.user;\n\n assertDefined(user, 'User not logged in');\n\n const hasMissingKycFields = Boolean(user.missingFields?.length);\n const hasPendingMfaAuth = isUserMissingMfaAuth(client);\n const hasPendingRecoveryCodes = isPendingRecoveryCodesAcknowledgment(client);\n const hasPendingDeviceRegistration = isDeviceRegistrationRequired(user);\n\n const userOnboardingComplete =\n !hasMissingKycFields &&\n !hasPendingMfaAuth &&\n !hasPendingRecoveryCodes &&\n !hasPendingDeviceRegistration;\n\n return userOnboardingComplete;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,IAAa,sBAAb,cAAyC,UAAU;CACjD,AAAS;CAET,YAAY,EAAE,SAA2B;AACvC,QAAM;GACJ;GACA,MAAM;GACN,SAAS;GACT,MAAM;GACN,cACE;GACH,CAAC;AACF,OAAK,SAAS;;;;;;;;;;;;;;;;;;;ACrClB,IAAa,gCAAb,cAAmD,UAAU;CAC3D,cAAc;AACZ,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cACE;GACH,CAAC;;;;;;;;;;;;;;;;ACLN,MAAaA,0BAAwB,WAAgC;CACnE,MAAM,OAAO,QAAQ,OAAO;AAC5B,KAAI;AACF,MAAI,CAAC,qBAAqB,OAAO,CAAE;AAEnC,uBAA2B;GACzB,UAAW,gBAAgB,OAAO,GAAG,WAAW;GAChD,aAAa,KAAK,cAAc,2BAA2B,QACzD,WACA,GACD;GACF,CAAC;UACK,OAAO;AAGd,OAAK,OAAO,KAAK,kCAAkC,MAAM;;;;;;;;;;;;;;;;;ACrB7D,MAAa,gCAAgC,SAC3C,QAAQ,KAAK,OAAO,SAAS,kBAAkB,CAAC;;;;;;;;;;;;;;;ACElD,MAAa,wCACX,SAAS,kBAAkB,KACxB;CACH,MAAM,OAAO,OAAO;AAEpB,eAAc,MAAM,qBAAqB;AAEzC,QACE,KAAK,iCAAiC,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACQvE,MAAa,4BAA4B,SAAS,kBAAkB,KAAK;CACvE,MAAM,OAAO,OAAO;AAEpB,eAAc,MAAM,qBAAqB;CAEzC,MAAM,sBAAsB,QAAQ,KAAK,eAAe,OAAO;CAC/D,MAAM,oBAAoB,qBAAqB,OAAO;CACtD,MAAM,0BAA0B,qCAAqC,OAAO;CAC5E,MAAM,+BAA+B,6BAA6B,KAAK;AAQvE,QALE,CAAC,uBACD,CAAC,qBACD,CAAC,2BACD,CAAC"}
@@ -1,8 +1,48 @@
1
- import { _t as BaseError, at as isCookieEnabled, l as DEFAULT_WAAS_BASE_API_URL, mt as getDefaultClient, ot as assertDefined, p as isUserMissingMfaAuth, vt as getCore } from "./updateAuthFromVerifyResponse-D4au3jUv.native.esm.js";
2
- import { t as isDynamicWaasEnabled } from "./isDynamicWaasEnabled-gu-9QF8-.native.esm.js";
1
+ import { St as getCore, lt as isCookieEnabled, m as isUserMissingMfaAuth, u as DEFAULT_WAAS_BASE_API_URL, ut as assertDefined, vt as getDefaultClient, xt as BaseError } from "./NativeModuleNotLinkedError-Ds_t3AZQ.native.esm.js";
2
+ import { t as isDynamicWaasEnabled } from "./isDynamicWaasEnabled-C8Fb1xHn.native.esm.js";
3
3
  import { MfaBackupCodeAcknowledgement } from "@dynamic-labs/sdk-api-core";
4
4
  import { preconnectWaasIframe } from "@dynamic-labs-wallet/browser-wallet-client";
5
5
 
6
+ //#region src/errors/WaasLoadFailedError.ts
7
+ /**
8
+ * Thrown when the embedded (WaaS) wallet's secure container failed to load
9
+ * after exhausting all of its internal retry attempts.
10
+ *
11
+ * This failure is transient: the next wallet operation triggers a fresh load
12
+ * cycle, so hosts can catch this error and re-attempt the operation at their
13
+ * own cadence (for example, when connectivity returns or the app is
14
+ * foregrounded). Other load failures (for example, a CSP block) are not
15
+ * wrapped by this error and their shape is not guaranteed.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * try {
20
+ * await signMessage({ message, walletAccount });
21
+ * } catch (error) {
22
+ * if (error instanceof WaasLoadFailedError) {
23
+ * // transient — retry the operation at your own cadence
24
+ * await signMessage({ message, walletAccount });
25
+ * }
26
+ * }
27
+ * ```
28
+ * @see WaasLoadFailedErrorReason
29
+ * @see signMessage
30
+ */
31
+ var WaasLoadFailedError = class extends BaseError {
32
+ reason;
33
+ constructor({ cause }) {
34
+ super({
35
+ cause,
36
+ code: "waas_load_failed",
37
+ docsUrl: null,
38
+ name: "WaasLoadFailedError",
39
+ shortMessage: "The embedded wallet failed to load after exhausting its retry attempts. Retrying the wallet operation triggers a fresh load."
40
+ });
41
+ this.reason = "load_attempts_exhausted";
42
+ }
43
+ };
44
+
45
+ //#endregion
6
46
  //#region src/errors/WaasOnboardingIncompleteError.ts
7
47
  /**
8
48
  * Thrown when the embedded (WaaS) wallet client is requested before the user
@@ -127,5 +167,5 @@ const isUserOnboardingComplete = (client = getDefaultClient()) => {
127
167
  };
128
168
 
129
169
  //#endregion
130
- export { WaasOnboardingIncompleteError as a, preconnectWaasIframe$1 as i, isPendingRecoveryCodesAcknowledgment as n, isDeviceRegistrationRequired as r, isUserOnboardingComplete as t };
131
- //# sourceMappingURL=isUserOnboardingComplete-BLm0JQ_z.native.esm.js.map
170
+ export { WaasOnboardingIncompleteError as a, preconnectWaasIframe$1 as i, isPendingRecoveryCodesAcknowledgment as n, WaasLoadFailedError as o, isDeviceRegistrationRequired as r, isUserOnboardingComplete as t };
171
+ //# sourceMappingURL=isUserOnboardingComplete-CvQShE05.native.esm.js.map