@dynamic-labs-sdk/client 1.31.0 → 1.31.2

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 (168) hide show
  1. package/dist/{apiClient-DpzKqY39.native.esm.js → apiClient-d2qJyIvx.native.esm.js} +2 -2
  2. package/dist/{apiClient-DpzKqY39.native.esm.js.map → apiClient-d2qJyIvx.native.esm.js.map} +1 -1
  3. package/dist/core.cjs +78 -5
  4. package/dist/core.cjs.map +1 -1
  5. package/dist/core.esm.js +78 -8
  6. package/dist/core.esm.js.map +1 -1
  7. package/dist/core.native.esm.js +78 -8
  8. package/dist/core.native.esm.js.map +1 -1
  9. package/dist/errors/AmbiguousWalletChainError.d.ts +32 -0
  10. package/dist/errors/AmbiguousWalletChainError.d.ts.map +1 -0
  11. package/dist/errors/ConnectionUriHandlerMissingError.d.ts +37 -0
  12. package/dist/errors/ConnectionUriHandlerMissingError.d.ts.map +1 -0
  13. package/dist/errors/NoConnectionOptionAvailableError.d.ts +39 -0
  14. package/dist/errors/NoConnectionOptionAvailableError.d.ts.map +1 -0
  15. package/dist/errors/WalletOptionNotFoundError.d.ts +30 -0
  16. package/dist/errors/WalletOptionNotFoundError.d.ts.map +1 -0
  17. package/dist/exports/core.d.ts +8 -0
  18. package/dist/exports/core.d.ts.map +1 -1
  19. package/dist/exports/index.d.ts +8 -1
  20. package/dist/exports/index.d.ts.map +1 -1
  21. package/dist/{getNetworkProviderFromNetworkId-BN2jUhHm.esm.js → getNetworkProviderFromNetworkId-D9nx6Od5.esm.js} +29 -25
  22. package/dist/getNetworkProviderFromNetworkId-D9nx6Od5.esm.js.map +1 -0
  23. package/dist/{getNetworkProviderFromNetworkId-DUym3Qq0.native.esm.js → getNetworkProviderFromNetworkId-DF9kPibD.native.esm.js} +30 -26
  24. package/dist/getNetworkProviderFromNetworkId-DF9kPibD.native.esm.js.map +1 -0
  25. package/dist/{getNetworkProviderFromNetworkId-BoNAPSjx.cjs → getNetworkProviderFromNetworkId-DueBnAl6.cjs} +23 -19
  26. package/dist/{getNetworkProviderFromNetworkId-BoNAPSjx.cjs.map → getNetworkProviderFromNetworkId-DueBnAl6.cjs.map} +1 -1
  27. package/dist/{getSignedSessionId-DxpqG4pv.esm.js → getSignedSessionId-5q4uyZsv.native.esm.js} +34 -4
  28. package/dist/getSignedSessionId-5q4uyZsv.native.esm.js.map +1 -0
  29. package/dist/{getSignedSessionId-9ADIJCl1.cjs → getSignedSessionId-B5oxmSTs.cjs} +39 -3
  30. package/dist/getSignedSessionId-B5oxmSTs.cjs.map +1 -0
  31. package/dist/{getSignedSessionId-Dr4Ic68X.native.esm.js → getSignedSessionId-BKfQycNo.esm.js} +34 -4
  32. package/dist/getSignedSessionId-BKfQycNo.esm.js.map +1 -0
  33. package/dist/{getVerifiedCredentialForWalletAccount-C2o5idph.cjs → getVerifiedCredentialForWalletAccount-Bx0HlvfW.cjs} +2 -2
  34. package/dist/{getVerifiedCredentialForWalletAccount-C2o5idph.cjs.map → getVerifiedCredentialForWalletAccount-Bx0HlvfW.cjs.map} +1 -1
  35. package/dist/{getVerifiedCredentialForWalletAccount-Cjwoeej7.esm.js → getVerifiedCredentialForWalletAccount-_3MExyld.esm.js} +2 -2
  36. package/dist/{getVerifiedCredentialForWalletAccount-Cjwoeej7.esm.js.map → getVerifiedCredentialForWalletAccount-_3MExyld.esm.js.map} +1 -1
  37. package/dist/index.cjs +536 -80
  38. package/dist/index.cjs.map +1 -1
  39. package/dist/index.esm.js +534 -83
  40. package/dist/index.esm.js.map +1 -1
  41. package/dist/index.native.esm.js +492 -83
  42. package/dist/index.native.esm.js.map +1 -1
  43. package/dist/{isMfaRequiredForAction-BIBmJbV9.esm.js → isMfaRequiredForAction-BDmY2_Sj.esm.js} +2 -2
  44. package/dist/{isMfaRequiredForAction-BIBmJbV9.esm.js.map → isMfaRequiredForAction-BDmY2_Sj.esm.js.map} +1 -1
  45. package/dist/{isMfaRequiredForAction-DuSU67yq.native.esm.js → isMfaRequiredForAction-BrRCSvEX.native.esm.js} +2 -2
  46. package/dist/{isMfaRequiredForAction-DuSU67yq.native.esm.js.map → isMfaRequiredForAction-BrRCSvEX.native.esm.js.map} +1 -1
  47. package/dist/{isMfaRequiredForAction-yM84r7l7.cjs → isMfaRequiredForAction-DnKzPDZk.cjs} +2 -2
  48. package/dist/{isMfaRequiredForAction-yM84r7l7.cjs.map → isMfaRequiredForAction-DnKzPDZk.cjs.map} +1 -1
  49. package/dist/{isUserOnboardingComplete-BRTOnK8V.cjs → isUserOnboardingComplete-7GzNYU2g.cjs} +3 -3
  50. package/dist/{isUserOnboardingComplete-BRTOnK8V.cjs.map → isUserOnboardingComplete-7GzNYU2g.cjs.map} +1 -1
  51. package/dist/{isUserOnboardingComplete-DCIlkCub.native.esm.js → isUserOnboardingComplete-BfMMBtkF.native.esm.js} +3 -3
  52. package/dist/{isUserOnboardingComplete-DCIlkCub.native.esm.js.map → isUserOnboardingComplete-BfMMBtkF.native.esm.js.map} +1 -1
  53. package/dist/{isUserOnboardingComplete-B2Ha2dkP.esm.js → isUserOnboardingComplete-D1-QluDm.esm.js} +3 -3
  54. package/dist/{isUserOnboardingComplete-B2Ha2dkP.esm.js.map → isUserOnboardingComplete-D1-QluDm.esm.js.map} +1 -1
  55. package/dist/{logoutWithReason-HqGlUccb.native.esm.js → logoutWithReason-3UICYir7.native.esm.js} +2 -2
  56. package/dist/{logoutWithReason-HqGlUccb.native.esm.js.map → logoutWithReason-3UICYir7.native.esm.js.map} +1 -1
  57. package/dist/{logoutWithReason-DV89zJmJ.esm.js → logoutWithReason-CHyuBHdx.esm.js} +2 -2
  58. package/dist/{logoutWithReason-DV89zJmJ.esm.js.map → logoutWithReason-CHyuBHdx.esm.js.map} +1 -1
  59. package/dist/{logoutWithReason-DlA15deT.cjs → logoutWithReason-C_T7KddM.cjs} +2 -2
  60. package/dist/{logoutWithReason-DlA15deT.cjs.map → logoutWithReason-C_T7KddM.cjs.map} +1 -1
  61. package/dist/{migrateFromFireblocks-CiOS4_Nq.esm.js → migrateFromFireblocks-BMO3u6rO.esm.js} +2 -2
  62. package/dist/{migrateFromFireblocks-CiOS4_Nq.esm.js.map → migrateFromFireblocks-BMO3u6rO.esm.js.map} +1 -1
  63. package/dist/{migrateFromFireblocks-CqIpxGRS.cjs → migrateFromFireblocks-C9Kuke5V.cjs} +2 -2
  64. package/dist/{migrateFromFireblocks-CqIpxGRS.cjs.map → migrateFromFireblocks-C9Kuke5V.cjs.map} +1 -1
  65. package/dist/{migrateFromFireblocks-DnQsGmIW.native.esm.js → migrateFromFireblocks-DJt9bktR.native.esm.js} +2 -2
  66. package/dist/{migrateFromFireblocks-DnQsGmIW.native.esm.js.map → migrateFromFireblocks-DJt9bktR.native.esm.js.map} +1 -1
  67. package/dist/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.d.ts +7 -1
  68. package/dist/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.d.ts.map +1 -1
  69. package/dist/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.types.d.ts +4 -0
  70. package/dist/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.types.d.ts.map +1 -0
  71. package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.d.ts +9 -0
  72. package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.d.ts.map +1 -1
  73. package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/buildInAppBrowserOptions.d.ts +9 -1
  74. package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/buildInAppBrowserOptions.d.ts.map +1 -1
  75. package/dist/modules/walletOptionsCatalogue/buildInstallationUrlsByWalletOptionKey/buildInstallationUrlsByWalletOptionKey.d.ts +7 -1
  76. package/dist/modules/walletOptionsCatalogue/buildInstallationUrlsByWalletOptionKey/buildInstallationUrlsByWalletOptionKey.d.ts.map +1 -1
  77. package/dist/modules/walletOptionsCatalogue/filterConnectionOptionsByEnabledChains/filterConnectionOptionsByEnabledChains.d.ts +30 -0
  78. package/dist/modules/walletOptionsCatalogue/filterConnectionOptionsByEnabledChains/filterConnectionOptionsByEnabledChains.d.ts.map +1 -0
  79. package/dist/modules/walletOptionsCatalogue/filterConnectionOptionsByEnabledChains/index.d.ts +2 -0
  80. package/dist/modules/walletOptionsCatalogue/filterConnectionOptionsByEnabledChains/index.d.ts.map +1 -0
  81. package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts +4 -0
  82. package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts.map +1 -1
  83. package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts +2 -1
  84. package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts.map +1 -1
  85. package/dist/modules/wallets/connectWallet.types.d.ts +35 -0
  86. package/dist/modules/wallets/connectWallet.types.d.ts.map +1 -0
  87. package/dist/modules/wallets/connectWithUriConnectionOption/connectWithUriConnectionOption.d.ts +52 -0
  88. package/dist/modules/wallets/connectWithUriConnectionOption/connectWithUriConnectionOption.d.ts.map +1 -0
  89. package/dist/modules/wallets/connectWithUriConnectionOption/getConnectionUriDeeplink/getConnectionUriDeeplink.d.ts +34 -0
  90. package/dist/modules/wallets/connectWithUriConnectionOption/getConnectionUriDeeplink/getConnectionUriDeeplink.d.ts.map +1 -0
  91. package/dist/modules/wallets/connectWithUriConnectionOption/getConnectionUriDeeplink/index.d.ts +2 -0
  92. package/dist/modules/wallets/connectWithUriConnectionOption/getConnectionUriDeeplink/index.d.ts.map +1 -0
  93. package/dist/modules/wallets/connectWithUriConnectionOption/index.d.ts +2 -0
  94. package/dist/modules/wallets/connectWithUriConnectionOption/index.d.ts.map +1 -0
  95. package/dist/modules/wallets/networks/getEnabledChains/getEnabledChains.d.ts +25 -0
  96. package/dist/modules/wallets/networks/getEnabledChains/getEnabledChains.d.ts.map +1 -0
  97. package/dist/modules/wallets/networks/getEnabledChains/index.d.ts +2 -0
  98. package/dist/modules/wallets/networks/getEnabledChains/index.d.ts.map +1 -0
  99. package/dist/modules/wallets/networks/networkProviderBuilderRegistry/createNetworkProviderBuilderRegistry/createNetworkProviderBuilderRegistry.d.ts +2 -1
  100. package/dist/modules/wallets/networks/networkProviderBuilderRegistry/createNetworkProviderBuilderRegistry/createNetworkProviderBuilderRegistry.d.ts.map +1 -1
  101. package/dist/modules/wallets/networks/networkProviderBuilderRegistry/events.d.ts +16 -0
  102. package/dist/modules/wallets/networks/networkProviderBuilderRegistry/events.d.ts.map +1 -0
  103. package/dist/modules/wallets/redirectToInAppBrowser/index.d.ts +2 -0
  104. package/dist/modules/wallets/redirectToInAppBrowser/index.d.ts.map +1 -0
  105. package/dist/modules/wallets/redirectToInAppBrowser/redirectToInAppBrowser.d.ts +60 -0
  106. package/dist/modules/wallets/redirectToInAppBrowser/redirectToInAppBrowser.d.ts.map +1 -0
  107. package/dist/modules/wallets/resolveWalletConnectionOption/index.d.ts +3 -0
  108. package/dist/modules/wallets/resolveWalletConnectionOption/index.d.ts.map +1 -0
  109. package/dist/modules/wallets/resolveWalletConnectionOption/resolveWalletConnectionOption.d.ts +36 -0
  110. package/dist/modules/wallets/resolveWalletConnectionOption/resolveWalletConnectionOption.d.ts.map +1 -0
  111. package/dist/modules/wallets/uriConnectionStarterRegistry/createUriConnectionStarterRegistry/createUriConnectionStarterRegistry.d.ts +22 -0
  112. package/dist/modules/wallets/uriConnectionStarterRegistry/createUriConnectionStarterRegistry/createUriConnectionStarterRegistry.d.ts.map +1 -0
  113. package/dist/modules/wallets/uriConnectionStarterRegistry/createUriConnectionStarterRegistry/index.d.ts +2 -0
  114. package/dist/modules/wallets/uriConnectionStarterRegistry/createUriConnectionStarterRegistry/index.d.ts.map +1 -0
  115. package/dist/modules/wallets/uriConnectionStarterRegistry/events.d.ts +18 -0
  116. package/dist/modules/wallets/uriConnectionStarterRegistry/events.d.ts.map +1 -0
  117. package/dist/modules/wallets/uriConnectionStarterRegistry/getUriConnectionStarterRegistry/getUriConnectionStarterRegistry.d.ts +22 -0
  118. package/dist/modules/wallets/uriConnectionStarterRegistry/getUriConnectionStarterRegistry/getUriConnectionStarterRegistry.d.ts.map +1 -0
  119. package/dist/modules/wallets/uriConnectionStarterRegistry/getUriConnectionStarterRegistry/index.d.ts +2 -0
  120. package/dist/modules/wallets/uriConnectionStarterRegistry/getUriConnectionStarterRegistry/index.d.ts.map +1 -0
  121. package/dist/modules/wallets/uriConnectionStarterRegistry/index.d.ts +3 -0
  122. package/dist/modules/wallets/uriConnectionStarterRegistry/index.d.ts.map +1 -0
  123. package/dist/modules/wallets/uriConnectionStarterRegistry/uriConnectionStarterRegistry.types.d.ts +32 -0
  124. package/dist/modules/wallets/uriConnectionStarterRegistry/uriConnectionStarterRegistry.types.d.ts.map +1 -0
  125. package/dist/modules/wallets/walletProviderUriConnection.types.d.ts +19 -0
  126. package/dist/modules/wallets/walletProviderUriConnection.types.d.ts.map +1 -1
  127. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  128. package/dist/utils/buildInAppBrowserUrl/buildInAppBrowserUrl.d.ts +32 -0
  129. package/dist/utils/buildInAppBrowserUrl/buildInAppBrowserUrl.d.ts.map +1 -0
  130. package/dist/utils/buildInAppBrowserUrl/index.d.ts +2 -0
  131. package/dist/utils/buildInAppBrowserUrl/index.d.ts.map +1 -0
  132. package/dist/utils/getPreferredWalletDeepLink/getPreferredWalletDeepLink.d.ts +33 -0
  133. package/dist/utils/getPreferredWalletDeepLink/getPreferredWalletDeepLink.d.ts.map +1 -0
  134. package/dist/utils/getPreferredWalletDeepLink/index.d.ts +2 -0
  135. package/dist/utils/getPreferredWalletDeepLink/index.d.ts.map +1 -0
  136. package/dist/utils/isAndroid/index.d.ts +2 -0
  137. package/dist/utils/isAndroid/index.d.ts.map +1 -0
  138. package/dist/utils/isAndroid/isAndroid.d.ts +20 -0
  139. package/dist/utils/isAndroid/isAndroid.d.ts.map +1 -0
  140. package/dist/utils/isIOS/index.d.ts +2 -0
  141. package/dist/utils/isIOS/index.d.ts.map +1 -0
  142. package/dist/utils/isIOS/isIOS.d.ts +23 -0
  143. package/dist/utils/isIOS/isIOS.d.ts.map +1 -0
  144. package/dist/utils/isMobile/isMobile.d.ts +17 -36
  145. package/dist/utils/isMobile/isMobile.d.ts.map +1 -1
  146. package/dist/utils/userAgentChecks/userAgentChecks.d.ts +35 -0
  147. package/dist/utils/userAgentChecks/userAgentChecks.d.ts.map +1 -0
  148. package/dist/{waas-CkQYVo6U.native.esm.js → waas-9QajYGeK.native.esm.js} +4 -4
  149. package/dist/{waas-CkQYVo6U.native.esm.js.map → waas-9QajYGeK.native.esm.js.map} +1 -1
  150. package/dist/{waas-BOKafCeH.cjs → waas-Bxsd0-HG.cjs} +4 -4
  151. package/dist/{waas-BOKafCeH.cjs.map → waas-Bxsd0-HG.cjs.map} +1 -1
  152. package/dist/{waas-CUDgU2pl.esm.js → waas-T_dHXyI9.esm.js} +4 -4
  153. package/dist/{waas-CUDgU2pl.esm.js.map → waas-T_dHXyI9.esm.js.map} +1 -1
  154. package/dist/waas.cjs +4 -4
  155. package/dist/waas.esm.js +4 -4
  156. package/dist/waas.native.esm.js +4 -4
  157. package/dist/waasCore.cjs +10 -40
  158. package/dist/waasCore.cjs.map +1 -1
  159. package/dist/waasCore.esm.js +5 -35
  160. package/dist/waasCore.esm.js.map +1 -1
  161. package/dist/waasCore.native.esm.js +5 -35
  162. package/dist/waasCore.native.esm.js.map +1 -1
  163. package/package.json +2 -2
  164. package/dist/getNetworkProviderFromNetworkId-BN2jUhHm.esm.js.map +0 -1
  165. package/dist/getNetworkProviderFromNetworkId-DUym3Qq0.native.esm.js.map +0 -1
  166. package/dist/getSignedSessionId-9ADIJCl1.cjs.map +0 -1
  167. package/dist/getSignedSessionId-Dr4Ic68X.native.esm.js.map +0 -1
  168. package/dist/getSignedSessionId-DxpqG4pv.esm.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { St as getCore, Z as getNonce, mt as assertDefined } from "./logoutWithReason-DV89zJmJ.esm.js";
2
- import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-BIBmJbV9.esm.js";
1
+ import { J as getNonce, ht as getElevatedAccessToken, pt as assertDefined, xt as getCore } from "./apiClient-d2qJyIvx.native.esm.js";
2
+ import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-BrRCSvEX.native.esm.js";
3
3
 
4
4
  //#region src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts
5
5
  /** @notInstrumented */
@@ -8,6 +8,36 @@ const consumeMfaTokenIfRequiredForAction = async ({ mfaAction }, client) => {
8
8
  return __consumeMfaToken_wrapped(client);
9
9
  };
10
10
 
11
+ //#endregion
12
+ //#region src/modules/auth/getActionAuthorizationTokens/getActionAuthorizationTokens.ts
13
+ /**
14
+ * Resolves the tokens that authorize a verification-gated wallet action.
15
+ *
16
+ * An elevated access token for `scope` is the current proof of verification, so
17
+ * it takes precedence: when one has been banked, the legacy per-action MFA token
18
+ * is left untouched. Demanding both would break every user who has a verified
19
+ * MFA method, because satisfying the challenge with `requestedScopes` mints an
20
+ * elevated access token and no MFA token -- leaving nothing for
21
+ * `consumeMfaTokenIfRequiredForAction` to consume, which then throws.
22
+ *
23
+ * @param params.mfaAction - The action whose legacy MFA requirement to evaluate.
24
+ * @param params.scope - The scope of the elevated access token that authorizes the action.
25
+ * @param client - The Dynamic client instance.
26
+ * @returns The elevated access token, or the legacy MFA token when no elevated token exists.
27
+ * @notInstrumented
28
+ */
29
+ const getActionAuthorizationTokens = async ({ mfaAction, scope }, client) => {
30
+ const elevatedAccessToken = getElevatedAccessToken({ scope }, client);
31
+ if (elevatedAccessToken) return {
32
+ elevatedAccessToken,
33
+ mfaToken: void 0
34
+ };
35
+ return {
36
+ elevatedAccessToken: void 0,
37
+ mfaToken: await consumeMfaTokenIfRequiredForAction({ mfaAction }, client)
38
+ };
39
+ };
40
+
11
41
  //#endregion
12
42
  //#region src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts
13
43
  /** @notInstrumented */
@@ -39,5 +69,5 @@ const getSignedSessionId = async (client) => {
39
69
  };
40
70
 
41
71
  //#endregion
42
- export { consumeMfaTokenIfRequiredForAction as n, getSignedSessionId as t };
43
- //# sourceMappingURL=getSignedSessionId-DxpqG4pv.esm.js.map
72
+ export { getActionAuthorizationTokens as n, consumeMfaTokenIfRequiredForAction as r, getSignedSessionId as t };
73
+ //# sourceMappingURL=getSignedSessionId-5q4uyZsv.native.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSignedSessionId-5q4uyZsv.native.esm.js","names":["consumeMfaToken"],"sources":["../src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts","../src/modules/auth/getActionAuthorizationTokens/getActionAuthorizationTokens.ts","../src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts","../src/modules/sessionKeys/generateSessionSignature/generateSessionSignature.ts","../src/modules/sessionKeys/getSignedSessionId/getSignedSessionId.ts"],"sourcesContent":["import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { consumeMfaToken } from '../consumeMfaToken';\nimport { isMfaRequiredForAction } from '../isMfaRequiredForAction';\n\ntype ConsumeMfaTokenIfRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/** @notInstrumented */\nexport const consumeMfaTokenIfRequiredForAction = async (\n { mfaAction }: ConsumeMfaTokenIfRequiredForActionParams,\n client: DynamicClient\n): Promise<string | undefined> => {\n const isRequiredForAction = await isMfaRequiredForAction(\n { mfaAction },\n client\n );\n\n if (!isRequiredForAction) {\n return;\n }\n\n return consumeMfaToken(client);\n};\n","import type { DynamicClient } from '../../../client/types/DynamicClient';\nimport type { TokenScope } from '../consts';\nimport type { MFAAction } from '../../mfa/mfa.consts';\nimport { consumeMfaTokenIfRequiredForAction } from '../../mfa/consumeMfaTokenIfRequiredForAction';\nimport { getElevatedAccessToken } from '../getElevatedAccessToken';\n\ntype GetActionAuthorizationTokensParams = {\n mfaAction: MFAAction;\n scope: TokenScope;\n};\n\ntype ActionAuthorizationTokens = {\n elevatedAccessToken: string | undefined;\n mfaToken: string | undefined;\n};\n\n/**\n * Resolves the tokens that authorize a verification-gated wallet action.\n *\n * An elevated access token for `scope` is the current proof of verification, so\n * it takes precedence: when one has been banked, the legacy per-action MFA token\n * is left untouched. Demanding both would break every user who has a verified\n * MFA method, because satisfying the challenge with `requestedScopes` mints an\n * elevated access token and no MFA token -- leaving nothing for\n * `consumeMfaTokenIfRequiredForAction` to consume, which then throws.\n *\n * @param params.mfaAction - The action whose legacy MFA requirement to evaluate.\n * @param params.scope - The scope of the elevated access token that authorizes the action.\n * @param client - The Dynamic client instance.\n * @returns The elevated access token, or the legacy MFA token when no elevated token exists.\n * @notInstrumented\n */\nexport const getActionAuthorizationTokens = async (\n { mfaAction, scope }: GetActionAuthorizationTokensParams,\n client: DynamicClient\n): Promise<ActionAuthorizationTokens> => {\n const elevatedAccessToken = getElevatedAccessToken({ scope }, client);\n\n if (elevatedAccessToken) {\n return { elevatedAccessToken, mfaToken: undefined };\n }\n\n const mfaToken = await consumeMfaTokenIfRequiredForAction(\n { mfaAction },\n client\n );\n\n return { elevatedAccessToken: undefined, mfaToken };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\n\ntype GenerateNonceSignatureParams = {\n nonce: string;\n};\n\ntype GenerateNonceSignatureResult = { signature: string };\n\n/** @notInstrumented */\nexport const generateNonceSignature = async (\n { nonce }: GenerateNonceSignatureParams,\n client: DynamicClient\n): Promise<GenerateNonceSignatureResult> => {\n const core = getCore(client);\n\n assertDefined(core.keychain, 'Keychain service not available');\n\n const signature = await core.keychain.sign('session', nonce);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\n\ntype GenerateSessionSignatureParams = {\n sessionId: string;\n};\n\ntype GenerateSessionSignatureResult = { signature: string };\n\n/** @notInstrumented */\nexport const generateSessionSignature = async (\n { sessionId }: GenerateSessionSignatureParams,\n client: DynamicClient\n): Promise<GenerateSessionSignatureResult> => {\n const core = getCore(client);\n\n const signature = await core.keychain.sign('session', sessionId);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport { getNonce } from '../../../utils/getNonce';\nimport { generateNonceSignature } from '../generateNonceSignature';\nimport { generateSessionSignature } from '../generateSessionSignature';\n\ntype GetSignedSessionIdResult = { signature: string };\n\n/** @notInstrumented */\nexport const getSignedSessionId = async (\n client: DynamicClient\n): Promise<GetSignedSessionIdResult> => {\n const core = getCore(client);\n\n const sessionId = core.state.get().user?.sessionId;\n assertDefined(sessionId, 'Session ID is required');\n\n const { signature: signedSessionId } = await generateSessionSignature(\n {\n sessionId,\n },\n client\n );\n\n assertDefined(signedSessionId, 'Signed session ID is required');\n\n const nonce = await getNonce(client);\n\n const { signature: nonceSignature } = await generateNonceSignature(\n {\n nonce,\n },\n client\n );\n\n assertDefined(nonceSignature, 'Nonce signature is required');\n\n const signature = `${signedSessionId}/${nonceSignature}/${nonce}`;\n\n return { signature };\n};\n"],"mappings":";;;;;AAWA,MAAa,qCAAqC,OAChD,EAAE,aACF,WACgC;AAMhC,KAAI,CALwB,MAAM,uBAChC,EAAE,WAAW,EACb,OACD,CAGC;AAGF,QAAOA,0BAAgB,OAAO;;;;;;;;;;;;;;;;;;;;;ACQhC,MAAa,+BAA+B,OAC1C,EAAE,WAAW,SACb,WACuC;CACvC,MAAM,sBAAsB,uBAAuB,EAAE,OAAO,EAAE,OAAO;AAErE,KAAI,oBACF,QAAO;EAAE;EAAqB,UAAU;EAAW;AAQrD,QAAO;EAAE,qBAAqB;EAAW,UALxB,MAAM,mCACrB,EAAE,WAAW,EACb,OACD;EAEkD;;;;;;ACpCrD,MAAa,yBAAyB,OACpC,EAAE,SACF,WAC0C;CAC1C,MAAM,OAAO,QAAQ,OAAO;AAE5B,eAAc,KAAK,UAAU,iCAAiC;AAI9D,QAAO,EAAE,WAFS,MAAM,KAAK,SAAS,KAAK,WAAW,MAAM,EAExC;;;;;;ACXtB,MAAa,2BAA2B,OACtC,EAAE,aACF,WAC4C;AAK5C,QAAO,EAAE,WAFS,MAFL,QAAQ,OAAO,CAEC,SAAS,KAAK,WAAW,UAAU,EAE5C;;;;;;ACRtB,MAAa,qBAAqB,OAChC,WACsC;CAGtC,MAAM,YAFO,QAAQ,OAAO,CAEL,MAAM,KAAK,CAAC,MAAM;AACzC,eAAc,WAAW,yBAAyB;CAElD,MAAM,EAAE,WAAW,oBAAoB,MAAM,yBAC3C,EACE,WACD,EACD,OACD;AAED,eAAc,iBAAiB,gCAAgC;CAE/D,MAAM,QAAQ,MAAM,SAAS,OAAO;CAEpC,MAAM,EAAE,WAAW,mBAAmB,MAAM,uBAC1C,EACE,OACD,EACD,OACD;AAED,eAAc,gBAAgB,8BAA8B;AAI5D,QAAO,EAAE,WAFS,GAAG,gBAAgB,GAAG,eAAe,GAAG,SAEtC"}
@@ -1,5 +1,5 @@
1
- const require_logoutWithReason = require('./logoutWithReason-DlA15deT.cjs');
2
- const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-yM84r7l7.cjs');
1
+ const require_logoutWithReason = require('./logoutWithReason-C_T7KddM.cjs');
2
+ const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-DnKzPDZk.cjs');
3
3
 
4
4
  //#region src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts
5
5
  /** @notInstrumented */
@@ -8,6 +8,36 @@ const consumeMfaTokenIfRequiredForAction = async ({ mfaAction }, client) => {
8
8
  return require_isMfaRequiredForAction.__consumeMfaToken_wrapped(client);
9
9
  };
10
10
 
11
+ //#endregion
12
+ //#region src/modules/auth/getActionAuthorizationTokens/getActionAuthorizationTokens.ts
13
+ /**
14
+ * Resolves the tokens that authorize a verification-gated wallet action.
15
+ *
16
+ * An elevated access token for `scope` is the current proof of verification, so
17
+ * it takes precedence: when one has been banked, the legacy per-action MFA token
18
+ * is left untouched. Demanding both would break every user who has a verified
19
+ * MFA method, because satisfying the challenge with `requestedScopes` mints an
20
+ * elevated access token and no MFA token -- leaving nothing for
21
+ * `consumeMfaTokenIfRequiredForAction` to consume, which then throws.
22
+ *
23
+ * @param params.mfaAction - The action whose legacy MFA requirement to evaluate.
24
+ * @param params.scope - The scope of the elevated access token that authorizes the action.
25
+ * @param client - The Dynamic client instance.
26
+ * @returns The elevated access token, or the legacy MFA token when no elevated token exists.
27
+ * @notInstrumented
28
+ */
29
+ const getActionAuthorizationTokens = async ({ mfaAction, scope }, client) => {
30
+ const elevatedAccessToken = require_logoutWithReason.getElevatedAccessToken({ scope }, client);
31
+ if (elevatedAccessToken) return {
32
+ elevatedAccessToken,
33
+ mfaToken: void 0
34
+ };
35
+ return {
36
+ elevatedAccessToken: void 0,
37
+ mfaToken: await consumeMfaTokenIfRequiredForAction({ mfaAction }, client)
38
+ };
39
+ };
40
+
11
41
  //#endregion
12
42
  //#region src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts
13
43
  /** @notInstrumented */
@@ -45,10 +75,16 @@ Object.defineProperty(exports, 'consumeMfaTokenIfRequiredForAction', {
45
75
  return consumeMfaTokenIfRequiredForAction;
46
76
  }
47
77
  });
78
+ Object.defineProperty(exports, 'getActionAuthorizationTokens', {
79
+ enumerable: true,
80
+ get: function () {
81
+ return getActionAuthorizationTokens;
82
+ }
83
+ });
48
84
  Object.defineProperty(exports, 'getSignedSessionId', {
49
85
  enumerable: true,
50
86
  get: function () {
51
87
  return getSignedSessionId;
52
88
  }
53
89
  });
54
- //# sourceMappingURL=getSignedSessionId-9ADIJCl1.cjs.map
90
+ //# sourceMappingURL=getSignedSessionId-B5oxmSTs.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSignedSessionId-B5oxmSTs.cjs","names":["isMfaRequiredForAction","consumeMfaToken","getElevatedAccessToken","getCore","getCore","getCore","getNonce"],"sources":["../src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts","../src/modules/auth/getActionAuthorizationTokens/getActionAuthorizationTokens.ts","../src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts","../src/modules/sessionKeys/generateSessionSignature/generateSessionSignature.ts","../src/modules/sessionKeys/getSignedSessionId/getSignedSessionId.ts"],"sourcesContent":["import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { consumeMfaToken } from '../consumeMfaToken';\nimport { isMfaRequiredForAction } from '../isMfaRequiredForAction';\n\ntype ConsumeMfaTokenIfRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/** @notInstrumented */\nexport const consumeMfaTokenIfRequiredForAction = async (\n { mfaAction }: ConsumeMfaTokenIfRequiredForActionParams,\n client: DynamicClient\n): Promise<string | undefined> => {\n const isRequiredForAction = await isMfaRequiredForAction(\n { mfaAction },\n client\n );\n\n if (!isRequiredForAction) {\n return;\n }\n\n return consumeMfaToken(client);\n};\n","import type { DynamicClient } from '../../../client/types/DynamicClient';\nimport type { TokenScope } from '../consts';\nimport type { MFAAction } from '../../mfa/mfa.consts';\nimport { consumeMfaTokenIfRequiredForAction } from '../../mfa/consumeMfaTokenIfRequiredForAction';\nimport { getElevatedAccessToken } from '../getElevatedAccessToken';\n\ntype GetActionAuthorizationTokensParams = {\n mfaAction: MFAAction;\n scope: TokenScope;\n};\n\ntype ActionAuthorizationTokens = {\n elevatedAccessToken: string | undefined;\n mfaToken: string | undefined;\n};\n\n/**\n * Resolves the tokens that authorize a verification-gated wallet action.\n *\n * An elevated access token for `scope` is the current proof of verification, so\n * it takes precedence: when one has been banked, the legacy per-action MFA token\n * is left untouched. Demanding both would break every user who has a verified\n * MFA method, because satisfying the challenge with `requestedScopes` mints an\n * elevated access token and no MFA token -- leaving nothing for\n * `consumeMfaTokenIfRequiredForAction` to consume, which then throws.\n *\n * @param params.mfaAction - The action whose legacy MFA requirement to evaluate.\n * @param params.scope - The scope of the elevated access token that authorizes the action.\n * @param client - The Dynamic client instance.\n * @returns The elevated access token, or the legacy MFA token when no elevated token exists.\n * @notInstrumented\n */\nexport const getActionAuthorizationTokens = async (\n { mfaAction, scope }: GetActionAuthorizationTokensParams,\n client: DynamicClient\n): Promise<ActionAuthorizationTokens> => {\n const elevatedAccessToken = getElevatedAccessToken({ scope }, client);\n\n if (elevatedAccessToken) {\n return { elevatedAccessToken, mfaToken: undefined };\n }\n\n const mfaToken = await consumeMfaTokenIfRequiredForAction(\n { mfaAction },\n client\n );\n\n return { elevatedAccessToken: undefined, mfaToken };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\n\ntype GenerateNonceSignatureParams = {\n nonce: string;\n};\n\ntype GenerateNonceSignatureResult = { signature: string };\n\n/** @notInstrumented */\nexport const generateNonceSignature = async (\n { nonce }: GenerateNonceSignatureParams,\n client: DynamicClient\n): Promise<GenerateNonceSignatureResult> => {\n const core = getCore(client);\n\n assertDefined(core.keychain, 'Keychain service not available');\n\n const signature = await core.keychain.sign('session', nonce);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\n\ntype GenerateSessionSignatureParams = {\n sessionId: string;\n};\n\ntype GenerateSessionSignatureResult = { signature: string };\n\n/** @notInstrumented */\nexport const generateSessionSignature = async (\n { sessionId }: GenerateSessionSignatureParams,\n client: DynamicClient\n): Promise<GenerateSessionSignatureResult> => {\n const core = getCore(client);\n\n const signature = await core.keychain.sign('session', sessionId);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport { getNonce } from '../../../utils/getNonce';\nimport { generateNonceSignature } from '../generateNonceSignature';\nimport { generateSessionSignature } from '../generateSessionSignature';\n\ntype GetSignedSessionIdResult = { signature: string };\n\n/** @notInstrumented */\nexport const getSignedSessionId = async (\n client: DynamicClient\n): Promise<GetSignedSessionIdResult> => {\n const core = getCore(client);\n\n const sessionId = core.state.get().user?.sessionId;\n assertDefined(sessionId, 'Session ID is required');\n\n const { signature: signedSessionId } = await generateSessionSignature(\n {\n sessionId,\n },\n client\n );\n\n assertDefined(signedSessionId, 'Signed session ID is required');\n\n const nonce = await getNonce(client);\n\n const { signature: nonceSignature } = await generateNonceSignature(\n {\n nonce,\n },\n client\n );\n\n assertDefined(nonceSignature, 'Nonce signature is required');\n\n const signature = `${signedSessionId}/${nonceSignature}/${nonce}`;\n\n return { signature };\n};\n"],"mappings":";;;;;AAWA,MAAa,qCAAqC,OAChD,EAAE,aACF,WACgC;AAMhC,KAAI,CALwB,MAAMA,sDAChC,EAAE,WAAW,EACb,OACD,CAGC;AAGF,QAAOC,yDAAgB,OAAO;;;;;;;;;;;;;;;;;;;;;ACQhC,MAAa,+BAA+B,OAC1C,EAAE,WAAW,SACb,WACuC;CACvC,MAAM,sBAAsBC,gDAAuB,EAAE,OAAO,EAAE,OAAO;AAErE,KAAI,oBACF,QAAO;EAAE;EAAqB,UAAU;EAAW;AAQrD,QAAO;EAAE,qBAAqB;EAAW,UALxB,MAAM,mCACrB,EAAE,WAAW,EACb,OACD;EAEkD;;;;;;ACpCrD,MAAa,yBAAyB,OACpC,EAAE,SACF,WAC0C;CAC1C,MAAM,OAAOC,iCAAQ,OAAO;AAE5B,wCAAc,KAAK,UAAU,iCAAiC;AAI9D,QAAO,EAAE,WAFS,MAAM,KAAK,SAAS,KAAK,WAAW,MAAM,EAExC;;;;;;ACXtB,MAAa,2BAA2B,OACtC,EAAE,aACF,WAC4C;AAK5C,QAAO,EAAE,WAFS,MAFLC,iCAAQ,OAAO,CAEC,SAAS,KAAK,WAAW,UAAU,EAE5C;;;;;;ACRtB,MAAa,qBAAqB,OAChC,WACsC;CAGtC,MAAM,YAFOC,iCAAQ,OAAO,CAEL,MAAM,KAAK,CAAC,MAAM;AACzC,wCAAc,WAAW,yBAAyB;CAElD,MAAM,EAAE,WAAW,oBAAoB,MAAM,yBAC3C,EACE,WACD,EACD,OACD;AAED,wCAAc,iBAAiB,gCAAgC;CAE/D,MAAM,QAAQ,MAAMC,kCAAS,OAAO;CAEpC,MAAM,EAAE,WAAW,mBAAmB,MAAM,uBAC1C,EACE,OACD,EACD,OACD;AAED,wCAAc,gBAAgB,8BAA8B;AAI5D,QAAO,EAAE,WAFS,GAAG,gBAAgB,GAAG,eAAe,GAAG,SAEtC"}
@@ -1,5 +1,5 @@
1
- import { J as getNonce, pt as assertDefined, xt as getCore } from "./apiClient-DpzKqY39.native.esm.js";
2
- import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-DuSU67yq.native.esm.js";
1
+ import { St as getCore, Z as getNonce, gt as getElevatedAccessToken, mt as assertDefined } from "./logoutWithReason-CHyuBHdx.esm.js";
2
+ import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-BDmY2_Sj.esm.js";
3
3
 
4
4
  //#region src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts
5
5
  /** @notInstrumented */
@@ -8,6 +8,36 @@ const consumeMfaTokenIfRequiredForAction = async ({ mfaAction }, client) => {
8
8
  return __consumeMfaToken_wrapped(client);
9
9
  };
10
10
 
11
+ //#endregion
12
+ //#region src/modules/auth/getActionAuthorizationTokens/getActionAuthorizationTokens.ts
13
+ /**
14
+ * Resolves the tokens that authorize a verification-gated wallet action.
15
+ *
16
+ * An elevated access token for `scope` is the current proof of verification, so
17
+ * it takes precedence: when one has been banked, the legacy per-action MFA token
18
+ * is left untouched. Demanding both would break every user who has a verified
19
+ * MFA method, because satisfying the challenge with `requestedScopes` mints an
20
+ * elevated access token and no MFA token -- leaving nothing for
21
+ * `consumeMfaTokenIfRequiredForAction` to consume, which then throws.
22
+ *
23
+ * @param params.mfaAction - The action whose legacy MFA requirement to evaluate.
24
+ * @param params.scope - The scope of the elevated access token that authorizes the action.
25
+ * @param client - The Dynamic client instance.
26
+ * @returns The elevated access token, or the legacy MFA token when no elevated token exists.
27
+ * @notInstrumented
28
+ */
29
+ const getActionAuthorizationTokens = async ({ mfaAction, scope }, client) => {
30
+ const elevatedAccessToken = getElevatedAccessToken({ scope }, client);
31
+ if (elevatedAccessToken) return {
32
+ elevatedAccessToken,
33
+ mfaToken: void 0
34
+ };
35
+ return {
36
+ elevatedAccessToken: void 0,
37
+ mfaToken: await consumeMfaTokenIfRequiredForAction({ mfaAction }, client)
38
+ };
39
+ };
40
+
11
41
  //#endregion
12
42
  //#region src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts
13
43
  /** @notInstrumented */
@@ -39,5 +69,5 @@ const getSignedSessionId = async (client) => {
39
69
  };
40
70
 
41
71
  //#endregion
42
- export { consumeMfaTokenIfRequiredForAction as n, getSignedSessionId as t };
43
- //# sourceMappingURL=getSignedSessionId-Dr4Ic68X.native.esm.js.map
72
+ export { getActionAuthorizationTokens as n, consumeMfaTokenIfRequiredForAction as r, getSignedSessionId as t };
73
+ //# sourceMappingURL=getSignedSessionId-BKfQycNo.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSignedSessionId-BKfQycNo.esm.js","names":["consumeMfaToken"],"sources":["../src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts","../src/modules/auth/getActionAuthorizationTokens/getActionAuthorizationTokens.ts","../src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts","../src/modules/sessionKeys/generateSessionSignature/generateSessionSignature.ts","../src/modules/sessionKeys/getSignedSessionId/getSignedSessionId.ts"],"sourcesContent":["import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { consumeMfaToken } from '../consumeMfaToken';\nimport { isMfaRequiredForAction } from '../isMfaRequiredForAction';\n\ntype ConsumeMfaTokenIfRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/** @notInstrumented */\nexport const consumeMfaTokenIfRequiredForAction = async (\n { mfaAction }: ConsumeMfaTokenIfRequiredForActionParams,\n client: DynamicClient\n): Promise<string | undefined> => {\n const isRequiredForAction = await isMfaRequiredForAction(\n { mfaAction },\n client\n );\n\n if (!isRequiredForAction) {\n return;\n }\n\n return consumeMfaToken(client);\n};\n","import type { DynamicClient } from '../../../client/types/DynamicClient';\nimport type { TokenScope } from '../consts';\nimport type { MFAAction } from '../../mfa/mfa.consts';\nimport { consumeMfaTokenIfRequiredForAction } from '../../mfa/consumeMfaTokenIfRequiredForAction';\nimport { getElevatedAccessToken } from '../getElevatedAccessToken';\n\ntype GetActionAuthorizationTokensParams = {\n mfaAction: MFAAction;\n scope: TokenScope;\n};\n\ntype ActionAuthorizationTokens = {\n elevatedAccessToken: string | undefined;\n mfaToken: string | undefined;\n};\n\n/**\n * Resolves the tokens that authorize a verification-gated wallet action.\n *\n * An elevated access token for `scope` is the current proof of verification, so\n * it takes precedence: when one has been banked, the legacy per-action MFA token\n * is left untouched. Demanding both would break every user who has a verified\n * MFA method, because satisfying the challenge with `requestedScopes` mints an\n * elevated access token and no MFA token -- leaving nothing for\n * `consumeMfaTokenIfRequiredForAction` to consume, which then throws.\n *\n * @param params.mfaAction - The action whose legacy MFA requirement to evaluate.\n * @param params.scope - The scope of the elevated access token that authorizes the action.\n * @param client - The Dynamic client instance.\n * @returns The elevated access token, or the legacy MFA token when no elevated token exists.\n * @notInstrumented\n */\nexport const getActionAuthorizationTokens = async (\n { mfaAction, scope }: GetActionAuthorizationTokensParams,\n client: DynamicClient\n): Promise<ActionAuthorizationTokens> => {\n const elevatedAccessToken = getElevatedAccessToken({ scope }, client);\n\n if (elevatedAccessToken) {\n return { elevatedAccessToken, mfaToken: undefined };\n }\n\n const mfaToken = await consumeMfaTokenIfRequiredForAction(\n { mfaAction },\n client\n );\n\n return { elevatedAccessToken: undefined, mfaToken };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\n\ntype GenerateNonceSignatureParams = {\n nonce: string;\n};\n\ntype GenerateNonceSignatureResult = { signature: string };\n\n/** @notInstrumented */\nexport const generateNonceSignature = async (\n { nonce }: GenerateNonceSignatureParams,\n client: DynamicClient\n): Promise<GenerateNonceSignatureResult> => {\n const core = getCore(client);\n\n assertDefined(core.keychain, 'Keychain service not available');\n\n const signature = await core.keychain.sign('session', nonce);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\n\ntype GenerateSessionSignatureParams = {\n sessionId: string;\n};\n\ntype GenerateSessionSignatureResult = { signature: string };\n\n/** @notInstrumented */\nexport const generateSessionSignature = async (\n { sessionId }: GenerateSessionSignatureParams,\n client: DynamicClient\n): Promise<GenerateSessionSignatureResult> => {\n const core = getCore(client);\n\n const signature = await core.keychain.sign('session', sessionId);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport { getNonce } from '../../../utils/getNonce';\nimport { generateNonceSignature } from '../generateNonceSignature';\nimport { generateSessionSignature } from '../generateSessionSignature';\n\ntype GetSignedSessionIdResult = { signature: string };\n\n/** @notInstrumented */\nexport const getSignedSessionId = async (\n client: DynamicClient\n): Promise<GetSignedSessionIdResult> => {\n const core = getCore(client);\n\n const sessionId = core.state.get().user?.sessionId;\n assertDefined(sessionId, 'Session ID is required');\n\n const { signature: signedSessionId } = await generateSessionSignature(\n {\n sessionId,\n },\n client\n );\n\n assertDefined(signedSessionId, 'Signed session ID is required');\n\n const nonce = await getNonce(client);\n\n const { signature: nonceSignature } = await generateNonceSignature(\n {\n nonce,\n },\n client\n );\n\n assertDefined(nonceSignature, 'Nonce signature is required');\n\n const signature = `${signedSessionId}/${nonceSignature}/${nonce}`;\n\n return { signature };\n};\n"],"mappings":";;;;;AAWA,MAAa,qCAAqC,OAChD,EAAE,aACF,WACgC;AAMhC,KAAI,CALwB,MAAM,uBAChC,EAAE,WAAW,EACb,OACD,CAGC;AAGF,QAAOA,0BAAgB,OAAO;;;;;;;;;;;;;;;;;;;;;ACQhC,MAAa,+BAA+B,OAC1C,EAAE,WAAW,SACb,WACuC;CACvC,MAAM,sBAAsB,uBAAuB,EAAE,OAAO,EAAE,OAAO;AAErE,KAAI,oBACF,QAAO;EAAE;EAAqB,UAAU;EAAW;AAQrD,QAAO;EAAE,qBAAqB;EAAW,UALxB,MAAM,mCACrB,EAAE,WAAW,EACb,OACD;EAEkD;;;;;;ACpCrD,MAAa,yBAAyB,OACpC,EAAE,SACF,WAC0C;CAC1C,MAAM,OAAO,QAAQ,OAAO;AAE5B,eAAc,KAAK,UAAU,iCAAiC;AAI9D,QAAO,EAAE,WAFS,MAAM,KAAK,SAAS,KAAK,WAAW,MAAM,EAExC;;;;;;ACXtB,MAAa,2BAA2B,OACtC,EAAE,aACF,WAC4C;AAK5C,QAAO,EAAE,WAFS,MAFL,QAAQ,OAAO,CAEC,SAAS,KAAK,WAAW,UAAU,EAE5C;;;;;;ACRtB,MAAa,qBAAqB,OAChC,WACsC;CAGtC,MAAM,YAFO,QAAQ,OAAO,CAEL,MAAM,KAAK,CAAC,MAAM;AACzC,eAAc,WAAW,yBAAyB;CAElD,MAAM,EAAE,WAAW,oBAAoB,MAAM,yBAC3C,EACE,WACD,EACD,OACD;AAED,eAAc,iBAAiB,gCAAgC;CAE/D,MAAM,QAAQ,MAAM,SAAS,OAAO;CAEpC,MAAM,EAAE,WAAW,mBAAmB,MAAM,uBAC1C,EACE,OACD,EACD,OACD;AAED,eAAc,gBAAgB,8BAA8B;AAI5D,QAAO,EAAE,WAFS,GAAG,gBAAgB,GAAG,eAAe,GAAG,SAEtC"}
@@ -1,4 +1,4 @@
1
- const require_logoutWithReason = require('./logoutWithReason-DlA15deT.cjs');
1
+ const require_logoutWithReason = require('./logoutWithReason-C_T7KddM.cjs');
2
2
 
3
3
  //#region src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts
4
4
  /** @notInstrumented */
@@ -28,4 +28,4 @@ Object.defineProperty(exports, 'getWalletProviderByKey', {
28
28
  return getWalletProviderByKey;
29
29
  }
30
30
  });
31
- //# sourceMappingURL=getVerifiedCredentialForWalletAccount-C2o5idph.cjs.map
31
+ //# sourceMappingURL=getVerifiedCredentialForWalletAccount-Bx0HlvfW.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getVerifiedCredentialForWalletAccount-C2o5idph.cjs","names":["getWalletProviders","walletProvider","NoWalletProviderFoundError"],"sources":["../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts","../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts"],"sourcesContent":["import type { DynamicClient } from '../../../client/types';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { getWalletProviders } from '../getWalletProviders';\nimport type { WalletProvider } from '../walletProvider';\n\ntype GetWalletProviderByKeyParams = {\n walletProviderKey: string;\n};\n\n/** @notInstrumented */\nexport const getWalletProviderByKey = (\n { walletProviderKey }: GetWalletProviderByKeyParams,\n client: DynamicClient\n): WalletProvider => {\n const walletProviders = getWalletProviders(client);\n\n const walletProvider = walletProviders.find(\n (walletProvider) => walletProvider.key === walletProviderKey\n );\n\n if (!walletProvider) {\n throw new NoWalletProviderFoundError({ walletProviderKey });\n }\n\n return walletProvider;\n};\n","import type { JwtVerifiedCredential } from '@dynamic-labs/sdk-api-core';\n\nimport type { DynamicClient } from '../../../../client/types/DynamicClient';\nimport type { WalletAccount } from '../../walletAccount';\n\ntype GetVerifiedCredentialForWalletAccountParams = {\n walletAccount: WalletAccount;\n};\n\n/** @notInstrumented */\nexport const getVerifiedCredentialForWalletAccount = (\n { walletAccount }: GetVerifiedCredentialForWalletAccountParams,\n client: DynamicClient\n): JwtVerifiedCredential | undefined => {\n return client.user?.verifiedCredentials.find(\n (vc) => vc.id === walletAccount.verifiedCredentialId\n );\n};\n"],"mappings":";;;;AAUA,MAAa,0BACX,EAAE,qBACF,WACmB;CAGnB,MAAM,iBAFkBA,4CAAmB,OAAO,CAEX,MACpC,qBAAmBC,iBAAe,QAAQ,kBAC5C;AAED,KAAI,CAAC,eACH,OAAM,IAAIC,oDAA2B,EAAE,mBAAmB,CAAC;AAG7D,QAAO;;;;;;ACdT,MAAa,yCACX,EAAE,iBACF,WACsC;AACtC,QAAO,OAAO,MAAM,oBAAoB,MACrC,OAAO,GAAG,OAAO,cAAc,qBACjC"}
1
+ {"version":3,"file":"getVerifiedCredentialForWalletAccount-Bx0HlvfW.cjs","names":["getWalletProviders","walletProvider","NoWalletProviderFoundError"],"sources":["../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts","../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts"],"sourcesContent":["import type { DynamicClient } from '../../../client/types';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { getWalletProviders } from '../getWalletProviders';\nimport type { WalletProvider } from '../walletProvider';\n\ntype GetWalletProviderByKeyParams = {\n walletProviderKey: string;\n};\n\n/** @notInstrumented */\nexport const getWalletProviderByKey = (\n { walletProviderKey }: GetWalletProviderByKeyParams,\n client: DynamicClient\n): WalletProvider => {\n const walletProviders = getWalletProviders(client);\n\n const walletProvider = walletProviders.find(\n (walletProvider) => walletProvider.key === walletProviderKey\n );\n\n if (!walletProvider) {\n throw new NoWalletProviderFoundError({ walletProviderKey });\n }\n\n return walletProvider;\n};\n","import type { JwtVerifiedCredential } from '@dynamic-labs/sdk-api-core';\n\nimport type { DynamicClient } from '../../../../client/types/DynamicClient';\nimport type { WalletAccount } from '../../walletAccount';\n\ntype GetVerifiedCredentialForWalletAccountParams = {\n walletAccount: WalletAccount;\n};\n\n/** @notInstrumented */\nexport const getVerifiedCredentialForWalletAccount = (\n { walletAccount }: GetVerifiedCredentialForWalletAccountParams,\n client: DynamicClient\n): JwtVerifiedCredential | undefined => {\n return client.user?.verifiedCredentials.find(\n (vc) => vc.id === walletAccount.verifiedCredentialId\n );\n};\n"],"mappings":";;;;AAUA,MAAa,0BACX,EAAE,qBACF,WACmB;CAGnB,MAAM,iBAFkBA,4CAAmB,OAAO,CAEX,MACpC,qBAAmBC,iBAAe,QAAQ,kBAC5C;AAED,KAAI,CAAC,eACH,OAAM,IAAIC,oDAA2B,EAAE,mBAAmB,CAAC;AAG7D,QAAO;;;;;;ACdT,MAAa,yCACX,EAAE,iBACF,WACsC;AACtC,QAAO,OAAO,MAAM,oBAAoB,MACrC,OAAO,GAAG,OAAO,cAAc,qBACjC"}
@@ -1,4 +1,4 @@
1
- import { A as getWalletProviders, s as NoWalletProviderFoundError } from "./logoutWithReason-DV89zJmJ.esm.js";
1
+ import { A as getWalletProviders, s as NoWalletProviderFoundError } from "./logoutWithReason-CHyuBHdx.esm.js";
2
2
 
3
3
  //#region src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts
4
4
  /** @notInstrumented */
@@ -17,4 +17,4 @@ const getVerifiedCredentialForWalletAccount = ({ walletAccount }, client) => {
17
17
 
18
18
  //#endregion
19
19
  export { getWalletProviderByKey as n, getVerifiedCredentialForWalletAccount as t };
20
- //# sourceMappingURL=getVerifiedCredentialForWalletAccount-Cjwoeej7.esm.js.map
20
+ //# sourceMappingURL=getVerifiedCredentialForWalletAccount-_3MExyld.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getVerifiedCredentialForWalletAccount-Cjwoeej7.esm.js","names":["walletProvider"],"sources":["../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts","../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts"],"sourcesContent":["import type { DynamicClient } from '../../../client/types';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { getWalletProviders } from '../getWalletProviders';\nimport type { WalletProvider } from '../walletProvider';\n\ntype GetWalletProviderByKeyParams = {\n walletProviderKey: string;\n};\n\n/** @notInstrumented */\nexport const getWalletProviderByKey = (\n { walletProviderKey }: GetWalletProviderByKeyParams,\n client: DynamicClient\n): WalletProvider => {\n const walletProviders = getWalletProviders(client);\n\n const walletProvider = walletProviders.find(\n (walletProvider) => walletProvider.key === walletProviderKey\n );\n\n if (!walletProvider) {\n throw new NoWalletProviderFoundError({ walletProviderKey });\n }\n\n return walletProvider;\n};\n","import type { JwtVerifiedCredential } from '@dynamic-labs/sdk-api-core';\n\nimport type { DynamicClient } from '../../../../client/types/DynamicClient';\nimport type { WalletAccount } from '../../walletAccount';\n\ntype GetVerifiedCredentialForWalletAccountParams = {\n walletAccount: WalletAccount;\n};\n\n/** @notInstrumented */\nexport const getVerifiedCredentialForWalletAccount = (\n { walletAccount }: GetVerifiedCredentialForWalletAccountParams,\n client: DynamicClient\n): JwtVerifiedCredential | undefined => {\n return client.user?.verifiedCredentials.find(\n (vc) => vc.id === walletAccount.verifiedCredentialId\n );\n};\n"],"mappings":";;;;AAUA,MAAa,0BACX,EAAE,qBACF,WACmB;CAGnB,MAAM,iBAFkB,mBAAmB,OAAO,CAEX,MACpC,qBAAmBA,iBAAe,QAAQ,kBAC5C;AAED,KAAI,CAAC,eACH,OAAM,IAAI,2BAA2B,EAAE,mBAAmB,CAAC;AAG7D,QAAO;;;;;;ACdT,MAAa,yCACX,EAAE,iBACF,WACsC;AACtC,QAAO,OAAO,MAAM,oBAAoB,MACrC,OAAO,GAAG,OAAO,cAAc,qBACjC"}
1
+ {"version":3,"file":"getVerifiedCredentialForWalletAccount-_3MExyld.esm.js","names":["walletProvider"],"sources":["../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts","../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts"],"sourcesContent":["import type { DynamicClient } from '../../../client/types';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { getWalletProviders } from '../getWalletProviders';\nimport type { WalletProvider } from '../walletProvider';\n\ntype GetWalletProviderByKeyParams = {\n walletProviderKey: string;\n};\n\n/** @notInstrumented */\nexport const getWalletProviderByKey = (\n { walletProviderKey }: GetWalletProviderByKeyParams,\n client: DynamicClient\n): WalletProvider => {\n const walletProviders = getWalletProviders(client);\n\n const walletProvider = walletProviders.find(\n (walletProvider) => walletProvider.key === walletProviderKey\n );\n\n if (!walletProvider) {\n throw new NoWalletProviderFoundError({ walletProviderKey });\n }\n\n return walletProvider;\n};\n","import type { JwtVerifiedCredential } from '@dynamic-labs/sdk-api-core';\n\nimport type { DynamicClient } from '../../../../client/types/DynamicClient';\nimport type { WalletAccount } from '../../walletAccount';\n\ntype GetVerifiedCredentialForWalletAccountParams = {\n walletAccount: WalletAccount;\n};\n\n/** @notInstrumented */\nexport const getVerifiedCredentialForWalletAccount = (\n { walletAccount }: GetVerifiedCredentialForWalletAccountParams,\n client: DynamicClient\n): JwtVerifiedCredential | undefined => {\n return client.user?.verifiedCredentials.find(\n (vc) => vc.id === walletAccount.verifiedCredentialId\n );\n};\n"],"mappings":";;;;AAUA,MAAa,0BACX,EAAE,qBACF,WACmB;CAGnB,MAAM,iBAFkB,mBAAmB,OAAO,CAEX,MACpC,qBAAmBA,iBAAe,QAAQ,kBAC5C;AAED,KAAI,CAAC,eACH,OAAM,IAAI,2BAA2B,EAAE,mBAAmB,CAAC;AAG7D,QAAO;;;;;;ACdT,MAAa,yCACX,EAAE,iBACF,WACsC;AACtC,QAAO,OAAO,MAAM,oBAAoB,MACrC,OAAO,GAAG,OAAO,cAAc,qBACjC"}