@dynamic-labs-sdk/client 1.30.1 → 1.30.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 (62) hide show
  1. package/dist/core.cjs +5 -5
  2. package/dist/core.esm.js +5 -5
  3. package/dist/core.native.esm.js +5 -5
  4. package/dist/{getNetworkProviderFromNetworkId-B9IPtXjv.native.esm.js → getNetworkProviderFromNetworkId--X0cb1ad.native.esm.js} +3 -3
  5. package/dist/{getNetworkProviderFromNetworkId-B9IPtXjv.native.esm.js.map → getNetworkProviderFromNetworkId--X0cb1ad.native.esm.js.map} +1 -1
  6. package/dist/{getNetworkProviderFromNetworkId-votBZ2Ox.esm.js → getNetworkProviderFromNetworkId-CamHn2s3.esm.js} +2 -2
  7. package/dist/{getNetworkProviderFromNetworkId-votBZ2Ox.esm.js.map → getNetworkProviderFromNetworkId-CamHn2s3.esm.js.map} +1 -1
  8. package/dist/{getNetworkProviderFromNetworkId-SIqshJGX.cjs → getNetworkProviderFromNetworkId-igDf2OPy.cjs} +2 -2
  9. package/dist/{getNetworkProviderFromNetworkId-SIqshJGX.cjs.map → getNetworkProviderFromNetworkId-igDf2OPy.cjs.map} +1 -1
  10. package/dist/{getSignedSessionId-IDY2yWS0.native.esm.js → getSignedSessionId--XNTxNFo.native.esm.js} +3 -3
  11. package/dist/{getSignedSessionId-IDY2yWS0.native.esm.js.map → getSignedSessionId--XNTxNFo.native.esm.js.map} +1 -1
  12. package/dist/{getSignedSessionId-ByhsXeBi.cjs → getSignedSessionId-DGa_pu-i.cjs} +3 -3
  13. package/dist/{getSignedSessionId-ByhsXeBi.cjs.map → getSignedSessionId-DGa_pu-i.cjs.map} +1 -1
  14. package/dist/{getSignedSessionId-Xv7o7Rd9.esm.js → getSignedSessionId-DY-ietfO.esm.js} +3 -3
  15. package/dist/{getSignedSessionId-Xv7o7Rd9.esm.js.map → getSignedSessionId-DY-ietfO.esm.js.map} +1 -1
  16. package/dist/{getWalletProviderByKey-W9j488kh.native.esm.js → getWalletProviderByKey-Cl6WDOoD.native.esm.js} +2 -2
  17. package/dist/{getWalletProviderByKey-W9j488kh.native.esm.js.map → getWalletProviderByKey-Cl6WDOoD.native.esm.js.map} +1 -1
  18. package/dist/{getWalletProviderByKey-OZfEvvFZ.cjs → getWalletProviderByKey-DzpmoNlv.cjs} +2 -2
  19. package/dist/{getWalletProviderByKey-OZfEvvFZ.cjs.map → getWalletProviderByKey-DzpmoNlv.cjs.map} +1 -1
  20. package/dist/{getWalletProviderByKey-CE54Uh8q.esm.js → getWalletProviderByKey-xqyD3ybv.esm.js} +2 -2
  21. package/dist/{getWalletProviderByKey-CE54Uh8q.esm.js.map → getWalletProviderByKey-xqyD3ybv.esm.js.map} +1 -1
  22. package/dist/index.cjs +6 -6
  23. package/dist/index.esm.js +6 -6
  24. package/dist/index.native.esm.js +6 -6
  25. package/dist/{isDynamicWaasEnabled-D9M2mzUG.cjs → isDynamicWaasEnabled-CMccs1-6.cjs} +2 -2
  26. package/dist/{isDynamicWaasEnabled-D9M2mzUG.cjs.map → isDynamicWaasEnabled-CMccs1-6.cjs.map} +1 -1
  27. package/dist/{isDynamicWaasEnabled-2tu-Lzb_.native.esm.js → isDynamicWaasEnabled-DSqgpEcX.native.esm.js} +2 -2
  28. package/dist/{isDynamicWaasEnabled-2tu-Lzb_.native.esm.js.map → isDynamicWaasEnabled-DSqgpEcX.native.esm.js.map} +1 -1
  29. package/dist/{isDynamicWaasEnabled-Cc53N1hb.esm.js → isDynamicWaasEnabled-DYORq7Jc.esm.js} +2 -2
  30. package/dist/{isDynamicWaasEnabled-Cc53N1hb.esm.js.map → isDynamicWaasEnabled-DYORq7Jc.esm.js.map} +1 -1
  31. package/dist/{isMfaRequiredForAction-CX_Wf5YW.native.esm.js → isMfaRequiredForAction-BcJvy7Gw.native.esm.js} +2 -2
  32. package/dist/{isMfaRequiredForAction-CX_Wf5YW.native.esm.js.map → isMfaRequiredForAction-BcJvy7Gw.native.esm.js.map} +1 -1
  33. package/dist/{isMfaRequiredForAction-D8RXBJ05.esm.js → isMfaRequiredForAction-CatS60F6.esm.js} +2 -2
  34. package/dist/{isMfaRequiredForAction-D8RXBJ05.esm.js.map → isMfaRequiredForAction-CatS60F6.esm.js.map} +1 -1
  35. package/dist/{isMfaRequiredForAction-Cnu2p0p8.cjs → isMfaRequiredForAction-DKfoMhEk.cjs} +2 -2
  36. package/dist/{isMfaRequiredForAction-Cnu2p0p8.cjs.map → isMfaRequiredForAction-DKfoMhEk.cjs.map} +1 -1
  37. package/dist/{isUserOnboardingComplete-BsX5t6s5.native.esm.js → isUserOnboardingComplete-BWVuE4Jg.native.esm.js} +3 -3
  38. package/dist/{isUserOnboardingComplete-BsX5t6s5.native.esm.js.map → isUserOnboardingComplete-BWVuE4Jg.native.esm.js.map} +1 -1
  39. package/dist/{isUserOnboardingComplete-kf-mOXcE.esm.js → isUserOnboardingComplete-jkAQQVdP.esm.js} +3 -3
  40. package/dist/{isUserOnboardingComplete-kf-mOXcE.esm.js.map → isUserOnboardingComplete-jkAQQVdP.esm.js.map} +1 -1
  41. package/dist/{isUserOnboardingComplete-Dw6OKlZJ.cjs → isUserOnboardingComplete-jv_idxWY.cjs} +3 -3
  42. package/dist/{isUserOnboardingComplete-Dw6OKlZJ.cjs.map → isUserOnboardingComplete-jv_idxWY.cjs.map} +1 -1
  43. package/dist/{migrateFromFireblocks-BdZVYEws.native.esm.js → migrateFromFireblocks-B-WUs34v.native.esm.js} +3 -3
  44. package/dist/{migrateFromFireblocks-BdZVYEws.native.esm.js.map → migrateFromFireblocks-B-WUs34v.native.esm.js.map} +1 -1
  45. package/dist/{migrateFromFireblocks-B0qaYu8U.esm.js → migrateFromFireblocks-D4E9bT2H.esm.js} +3 -3
  46. package/dist/{migrateFromFireblocks-B0qaYu8U.esm.js.map → migrateFromFireblocks-D4E9bT2H.esm.js.map} +1 -1
  47. package/dist/{migrateFromFireblocks-BN9YRbCl.cjs → migrateFromFireblocks-zp5Jbq2J.cjs} +3 -3
  48. package/dist/{migrateFromFireblocks-BN9YRbCl.cjs.map → migrateFromFireblocks-zp5Jbq2J.cjs.map} +1 -1
  49. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  50. package/dist/{updateAuthFromVerifyResponse-CjuwqNKr.esm.js → updateAuthFromVerifyResponse-BLgNMqwN.esm.js} +2 -2
  51. package/dist/{updateAuthFromVerifyResponse-CjuwqNKr.esm.js.map → updateAuthFromVerifyResponse-BLgNMqwN.esm.js.map} +1 -1
  52. package/dist/{updateAuthFromVerifyResponse-BS6kZrDc.native.esm.js → updateAuthFromVerifyResponse-CTvWpZLa.native.esm.js} +2 -2
  53. package/dist/{updateAuthFromVerifyResponse-BS6kZrDc.native.esm.js.map → updateAuthFromVerifyResponse-CTvWpZLa.native.esm.js.map} +1 -1
  54. package/dist/{updateAuthFromVerifyResponse-C9xos3Q_.cjs → updateAuthFromVerifyResponse-Dsw-eAro.cjs} +2 -2
  55. package/dist/{updateAuthFromVerifyResponse-C9xos3Q_.cjs.map → updateAuthFromVerifyResponse-Dsw-eAro.cjs.map} +1 -1
  56. package/dist/waas.cjs +4 -4
  57. package/dist/waas.esm.js +4 -4
  58. package/dist/waas.native.esm.js +4 -4
  59. package/dist/waasCore.cjs +6 -6
  60. package/dist/waasCore.esm.js +6 -6
  61. package/dist/waasCore.native.esm.js +6 -6
  62. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
- const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-C9xos3Q_.cjs');
2
- const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-Cnu2p0p8.cjs');
1
+ const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-Dsw-eAro.cjs');
2
+ const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-DKfoMhEk.cjs');
3
3
 
4
4
  //#region src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts
5
5
  /** @notInstrumented */
@@ -51,4 +51,4 @@ Object.defineProperty(exports, 'getSignedSessionId', {
51
51
  return getSignedSessionId;
52
52
  }
53
53
  });
54
- //# sourceMappingURL=getSignedSessionId-ByhsXeBi.cjs.map
54
+ //# sourceMappingURL=getSignedSessionId-DGa_pu-i.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSignedSessionId-ByhsXeBi.cjs","names":["isMfaRequiredForAction","consumeMfaToken","getCore","getCore","getCore","getNonce"],"sources":["../src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.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 { 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;;;;;;ACbhC,MAAa,yBAAyB,OACpC,EAAE,SACF,WAC0C;CAC1C,MAAM,OAAOC,6CAAQ,OAAO;AAE5B,oDAAc,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,6CAAQ,OAAO,CAEC,SAAS,KAAK,WAAW,UAAU,EAE5C;;;;;;ACRtB,MAAa,qBAAqB,OAChC,WACsC;CAGtC,MAAM,YAFOC,6CAAQ,OAAO,CAEL,MAAM,KAAK,CAAC,MAAM;AACzC,oDAAc,WAAW,yBAAyB;CAElD,MAAM,EAAE,WAAW,oBAAoB,MAAM,yBAC3C,EACE,WACD,EACD,OACD;AAED,oDAAc,iBAAiB,gCAAgC;CAE/D,MAAM,QAAQ,MAAMC,8CAAS,OAAO;CAEpC,MAAM,EAAE,WAAW,mBAAmB,MAAM,uBAC1C,EACE,OACD,EACD,OACD;AAED,oDAAc,gBAAgB,8BAA8B;AAI5D,QAAO,EAAE,WAFS,GAAG,gBAAgB,GAAG,eAAe,GAAG,SAEtC"}
1
+ {"version":3,"file":"getSignedSessionId-DGa_pu-i.cjs","names":["isMfaRequiredForAction","consumeMfaToken","getCore","getCore","getCore","getNonce"],"sources":["../src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.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 { 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;;;;;;ACbhC,MAAa,yBAAyB,OACpC,EAAE,SACF,WAC0C;CAC1C,MAAM,OAAOC,6CAAQ,OAAO;AAE5B,oDAAc,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,6CAAQ,OAAO,CAEC,SAAS,KAAK,WAAW,UAAU,EAE5C;;;;;;ACRtB,MAAa,qBAAqB,OAChC,WACsC;CAGtC,MAAM,YAFOC,6CAAQ,OAAO,CAEL,MAAM,KAAK,CAAC,MAAM;AACzC,oDAAc,WAAW,yBAAyB;CAElD,MAAM,EAAE,WAAW,oBAAoB,MAAM,yBAC3C,EACE,WACD,EACD,OACD;AAED,oDAAc,iBAAiB,gCAAgC;CAE/D,MAAM,QAAQ,MAAMC,8CAAS,OAAO;CAEpC,MAAM,EAAE,WAAW,mBAAmB,MAAM,uBAC1C,EACE,OACD,EACD,OACD;AAED,oDAAc,gBAAgB,8BAA8B;AAI5D,QAAO,EAAE,WAFS,GAAG,gBAAgB,GAAG,eAAe,GAAG,SAEtC"}
@@ -1,5 +1,5 @@
1
- import { St as getCore, X as getNonce, ft as assertDefined } from "./updateAuthFromVerifyResponse-CjuwqNKr.esm.js";
2
- import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-D8RXBJ05.esm.js";
1
+ import { St as getCore, X as getNonce, ft as assertDefined } from "./updateAuthFromVerifyResponse-BLgNMqwN.esm.js";
2
+ import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-CatS60F6.esm.js";
3
3
 
4
4
  //#region src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts
5
5
  /** @notInstrumented */
@@ -40,4 +40,4 @@ const getSignedSessionId = async (client) => {
40
40
 
41
41
  //#endregion
42
42
  export { consumeMfaTokenIfRequiredForAction as n, getSignedSessionId as t };
43
- //# sourceMappingURL=getSignedSessionId-Xv7o7Rd9.esm.js.map
43
+ //# sourceMappingURL=getSignedSessionId-DY-ietfO.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSignedSessionId-Xv7o7Rd9.esm.js","names":["consumeMfaToken"],"sources":["../src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.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 { 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;;;;;;ACbhC,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
+ {"version":3,"file":"getSignedSessionId-DY-ietfO.esm.js","names":["consumeMfaToken"],"sources":["../src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.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 { 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;;;;;;ACbhC,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
- import { C as DYNAMIC_AUTH_COOKIE_NAME, H as createApiClient, J as getSecureCookieAttribute, O as NoWalletProviderFoundError, R as emitEvent, St as getCore, Z as createStorageKeySchema, dt as isCookieEnabled, ft as assertDefined, h as instrumentFunction, k as getWalletAccounts, ot as CLIENT_SDK_NAME, p as getWalletProviders, q as setCookie, st as DYNAMIC_LOGOUT_REASON_HEADER, vt as getDefaultClient, w as getWalletProviderFromWalletAccount, x as checkAndRaiseWalletAccountsChangedEvent, xt as BaseError } from "./updateAuthFromVerifyResponse-BS6kZrDc.native.esm.js";
1
+ import { C as DYNAMIC_AUTH_COOKIE_NAME, H as createApiClient, J as getSecureCookieAttribute, O as NoWalletProviderFoundError, R as emitEvent, St as getCore, Z as createStorageKeySchema, dt as isCookieEnabled, ft as assertDefined, h as instrumentFunction, k as getWalletAccounts, ot as CLIENT_SDK_NAME, p as getWalletProviders, q as setCookie, st as DYNAMIC_LOGOUT_REASON_HEADER, vt as getDefaultClient, w as getWalletProviderFromWalletAccount, x as checkAndRaiseWalletAccountsChangedEvent, xt as BaseError } from "./updateAuthFromVerifyResponse-CTvWpZLa.native.esm.js";
2
2
  import * as z from "zod/mini";
3
3
 
4
4
  //#region src/utils/retryOnFail/InvalidRetryOnFailCallError.ts
@@ -278,4 +278,4 @@ const getWalletProviderByKey = ({ walletProviderKey }, client) => {
278
278
 
279
279
  //#endregion
280
280
  export { fetchProjectSettings as a, generateSessionKeys as i, getVerifiedCredentialForWalletAccount as n, isSignedIn as o, __logoutWithReason_wrapped as r, retryOnFail as s, getWalletProviderByKey as t };
281
- //# sourceMappingURL=getWalletProviderByKey-W9j488kh.native.esm.js.map
281
+ //# sourceMappingURL=getWalletProviderByKey-Cl6WDOoD.native.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getWalletProviderByKey-W9j488kh.native.esm.js","names":["walletProvidersMap: Map<string, WalletProvider>","walletProvider"],"sources":["../src/utils/retryOnFail/InvalidRetryOnFailCallError.ts","../src/utils/retryOnFail/retryOnFail.ts","../src/modules/auth/isSignedIn/isSignedIn.ts","../src/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.ts","../src/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.ts","../src/modules/sessionKeys/generateSessionKeys/generateSessionKeys.ts","../src/modules/wallets/utils/getAvailableWalletProvidersFromWalletAccounts/getAvailableWalletProvidersFromWalletAccounts.ts","../src/modules/wallets/destroyWalletProviders/destroyWalletProviders.ts","../src/modules/auth/logoutWithReason/logoutWithReason.ts","../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts","../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts"],"sourcesContent":["import { BaseError } from '../../errors/base';\n\n/**\n * This error is thrown when the `retryOnFail` function is called with an invalid\n * number of retries (i.e. less than 0).\n */\nexport class InvalidRetryOnFailCallError extends BaseError {\n // eslint-disable-next-line custom-rules/require-single-object-param\n constructor(maxRetries: number) {\n super({\n cause: null,\n code: 'invalid_retry_on_fail_call_error',\n docsUrl: null,\n name: 'InvalidRetryOnFailCallError',\n shortMessage: `Invalid retries parameter for retryOnFail call: ${maxRetries}`,\n });\n }\n}\n","import { InvalidRetryOnFailCallError } from './InvalidRetryOnFailCallError';\n\nexport type RetryOnFailParams<T> = {\n /**\n * The delay between retries in milliseconds.\n */\n delay?: number;\n /**\n * The function to call.\n */\n fn: () => Promise<T>;\n /**\n * The maximum number of retries.\n *\n * When set to 0, the function will be called only once and is\n * therefore equivalent to calling the function directly.\n */\n maxRetries: number;\n};\n\n/** @notInstrumented */\nexport const retryOnFail = async <T>({\n delay = 0,\n fn,\n maxRetries,\n}: RetryOnFailParams<T>): Promise<T> => {\n for (let retry = 0; retry <= maxRetries; retry++) {\n try {\n return await fn();\n } catch (error) {\n if (retry >= maxRetries) {\n throw error;\n }\n\n if (delay > 0) {\n await new Promise((resolve) => setTimeout(resolve, delay));\n }\n }\n }\n\n /**\n * Reaching this point should never happen and this\n * error is thrown to help us debug the issue.\n */\n throw new InvalidRetryOnFailCallError(maxRetries);\n};\n","import { getDefaultClient } from '../../../client/defaultClient';\nimport { getWalletAccounts } from '../../wallets/getWalletAccounts';\n\n/**\n * Checks if the user is currently signed in to the Dynamic client.\n *\n * The client is considered to be in a signed in state if a user has\n * authenticated or if the client has at least one wallet connected.\n *\n * @deprecated What counts as \"signed in\" is your app's business logic, not the\n * SDK's. This helper bakes in one opinion (a user OR any connected wallet),\n * which rarely matches every app and forces a dependency on us for every\n * variation. Compose your own check from the underlying primitives instead —\n * e.g. `Boolean(client.user) || isAnyWalletAccountConnected(client)` — and\n * layer in whatever your app requires (device registration, completed\n * onboarding, satisfied MFA, a required embedded wallet, …). See the\n * \"Check if signed in\" guide:\n * https://www.dynamic.xyz/docs/javascript/user-session-management\n *\n * @example\n * ```ts\n * if (isSignedIn()) {\n * console.log('User is authenticated or has a wallet connected');\n * }\n * ```\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if the user is signed in, false otherwise.\n * @see logout\n * @see isAnyWalletAccountConnected\n * @notInstrumented\n */\nexport const isSignedIn = (client = getDefaultClient()): boolean =>\n Boolean(client.user || getWalletAccounts(client).length > 0);\n","import * as z from 'zod/mini';\n\nimport { createStorageKeySchema } from '../../../services/storage';\n\n/**\n * The schema to track the expiration time of the project settings.\n */\nexport const projectSettingsExpirationStorageKeySchema = createStorageKeySchema(\n {\n key: 'projectSettingsExpiration',\n schema: z.number(),\n }\n);\n","import type { ProjectSettings } from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { retryOnFail } from '../../../utils/retryOnFail';\nimport { createApiClient } from '../../apiClient';\nimport { CLIENT_SDK_NAME } from '../../apiClient/constants';\nimport { isSignedIn } from '../../auth/isSignedIn';\nimport { projectSettingsExpirationStorageKeySchema } from './projectSettingsExpirationScheme';\n\n/**\n * Expiration time of the project settings in milliseconds.\n */\nexport const PROJECT_SETTINGS_EXPIRATION_TIME = 1000 * 60 * 5; // 5 minutes\n\n/**\n * Fetches and updates the project settings from the API.\n *\n * This function retrieves the latest project configuration settings\n * from Dynamic's servers, including authentication options, enabled chains,\n * and security configurations. The settings are cached for performance.\n *\n * @example\n * ```ts\n * const settings = await fetchProjectSettings();\n * console.log('Enabled chains:', settings.chains);\n * ```\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the updated project settings.\n * @see createDynamicClient\n * @see initializeClient\n * @notInstrumented\n * @noHook Internal settings fetch that is not part of the public hook surface.\n */\nexport const fetchProjectSettings = async (\n client = getDefaultClient()\n): Promise<ProjectSettings | null> => {\n const core = getCore(client);\n\n const currentExpiration = await core.storage.getItem(\n projectSettingsExpirationStorageKeySchema\n );\n\n const hasProjectSettings = Boolean(client.projectSettings);\n const isExpired = currentExpiration && currentExpiration < Date.now();\n\n // We want to cache the project settings if its valid and user is connected.\n // This avoids unnecessary API calls and speeds up the initial load.\n if (hasProjectSettings && !isExpired && isSignedIn(client)) {\n return client.projectSettings;\n }\n\n const apiClient = createApiClient({}, client);\n\n core.logger.debug('[fetchProjectSettings] Fetching project settings...');\n\n const doFetch = async () =>\n apiClient.getEnvironmentSettings(\n {\n environmentId: core.environmentId,\n sdkVersion: `${CLIENT_SDK_NAME}/${core.version}`,\n },\n {\n credentials: 'omit',\n }\n );\n\n const projectSettings = await retryOnFail({\n fn: doFetch,\n maxRetries: 2,\n });\n\n core.state.set({ projectSettings: projectSettings ?? null });\n\n await core.storage.setItem(\n projectSettingsExpirationStorageKeySchema,\n Date.now() + PROJECT_SETTINGS_EXPIRATION_TIME\n );\n\n return projectSettings;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport type { SessionKeys } from '../sessionKeys.types';\n\n/** @notInstrumented */\nexport const generateSessionKeys = async (\n client: DynamicClient\n): Promise<SessionKeys> => {\n const core = getCore(client);\n\n const currentState = core.state.get();\n\n const isRotation = Boolean(currentState.sessionKeys);\n\n const logContext = {\n environmentId: core.environmentId,\n operation: isRotation ? 'rotate' : 'create',\n userId: currentState.user?.id ?? null,\n };\n\n core.logger.info(\n isRotation\n ? '[generateSessionKeys] Rotating session key...'\n : '[generateSessionKeys] Creating session key...',\n logContext\n );\n\n await core.keychain.removeKey('session');\n\n const publicKey = await core.keychain.generateKey('session');\n\n assertDefined(publicKey, 'Public key not found');\n\n core.state.set({\n sessionKeys: publicKey,\n });\n\n core.logger.info(\n isRotation\n ? '[generateSessionKeys] Session key rotated'\n : '[generateSessionKeys] Session key created',\n logContext\n );\n\n return { publicKey };\n};\n","import { getCore } from '../../../../client/core/getCore';\nimport type { DynamicClient } from '../../../../client/types';\nimport { getWalletAccounts } from '../../getWalletAccounts';\nimport type { WalletProvider } from '../../walletProvider';\nimport { getWalletProviderFromWalletAccount } from '../getWalletProviderFromWalletAccount';\n\n/** @notInstrumented */\nexport const getAvailableWalletProvidersFromWalletAccounts = (\n client: DynamicClient\n): WalletProvider[] => {\n const core = getCore(client);\n\n const walletProvidersMap: Map<string, WalletProvider> = new Map();\n\n const walletAccounts = getWalletAccounts(client);\n\n walletAccounts.forEach((walletAccount) => {\n if (walletProvidersMap.has(walletAccount.walletProviderKey)) {\n return;\n }\n\n try {\n const walletProvider = getWalletProviderFromWalletAccount(\n {\n walletAccount,\n },\n client\n );\n\n walletProvidersMap.set(walletAccount.walletProviderKey, walletProvider);\n } catch (error) {\n core.logger.debug('Wallet provider not found for wallet account', {\n error,\n walletAccount: walletAccount.address,\n });\n }\n });\n\n return Array.from(walletProvidersMap.values());\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types/DynamicClient';\nimport type { LogoutReason } from '../../auth/logoutReason';\nimport { getAvailableWalletProvidersFromWalletAccounts } from '../utils/getAvailableWalletProvidersFromWalletAccounts';\n\n/**\n * Tear down every wallet provider on the client.\n *\n * Each provider's `destroy` is responsible for its own local + remote\n * cleanup. We swallow errors so a failing destroy on one provider does not\n * block teardown of the others (e.g. during logout).\n *\n * @notInstrumented\n */\nexport const destroyWalletProviders = async (\n { reason }: { reason?: LogoutReason },\n client: DynamicClient\n): Promise<void> => {\n const core = getCore(client);\n\n const walletProviders = getAvailableWalletProvidersFromWalletAccounts(client);\n\n await Promise.all(\n walletProviders.map(async (walletProvider) => {\n if (!walletProvider.destroy) return;\n try {\n await walletProvider.destroy({ reason });\n } catch (err) {\n core.logger.error(\n `Error destroying wallet provider ${walletProvider.key}`,\n err\n );\n }\n })\n );\n};\n","import type { DynamicClient } from '../../../client/types';\nimport { getCore } from '../../../client/core/getCore';\nimport { getSecureCookieAttribute } from '../../../utils/getSecureCookieAttribute';\nimport { setCookie } from '../../../utils/setCookie';\nimport { createApiClient } from '../../apiClient';\nimport { DYNAMIC_LOGOUT_REASON_HEADER } from '../../apiClient/constants';\nimport { emitEvent } from '../../clientEvents';\nimport { fetchProjectSettings } from '../../projectSettings/fetchProjectSettings';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport { generateSessionKeys } from '../../sessionKeys/generateSessionKeys';\nimport { destroyWalletProviders } from '../../wallets/destroyWalletProviders';\nimport { DYNAMIC_AUTH_COOKIE_NAME } from '../consts';\nimport type { LogoutReason } from '../logoutReason';\nimport { checkAndRaiseWalletAccountsChangedEvent } from '../updateAuthFromVerifyResponse/checkAndRaiseWalletAccountsChangedEvent';\n\n/**\n * Logs the user out with an explicit reason.\n *\n * Revokes the session, clears auth state, terminates wallet providers, and\n * emits the `logout` client event with the given reason. The reason is also\n * captured as an argument on the function-instrumentation event, which is\n * how Datadog distinguishes between different logout causes.\n *\n * Use this instead of the public `logout` when triggering a logout from\n * internal or extension code — the caller owns the reason string, so the\n * telemetry correctly attributes *why* the logout happened.\n *\n * @param params - The logout params.\n * @param params.reason - Why the logout is being triggered. Extension authors\n * needing a reason outside the SDK catalog can cast with `as LogoutReason`.\n * @param client - The Dynamic client instance.\n * @instrumented\n */\nexport const logoutWithReason = async (\n { reason }: { reason: LogoutReason },\n client: DynamicClient\n): Promise<void> => {\n const core = getCore(client);\n\n core.logger.debug('[logoutWithReason] Logging out...', { reason });\n\n await destroyWalletProviders({ reason }, client);\n\n if (client.user !== null) {\n // Forward the logout reason so the backend can attribute the revocation in\n // Datadog instead of it being inferred from downstream 401s.\n const apiClient = createApiClient(\n { headers: { [DYNAMIC_LOGOUT_REASON_HEADER]: reason } },\n client\n );\n\n try {\n await apiClient.revokeSession({\n environmentId: core.environmentId,\n });\n } catch (error) {\n core.logger.error('Failed to revoke session', error);\n }\n\n /**\n * This deletes the auth cookie if it exists.\n * If the cookie doesn't exist, this sets a new cookie that expires immediately.\n */\n if (isCookieEnabled(client)) {\n // Match the Secure attribute used when the cookie was written so the\n // deletion cookie is accepted consistently in a secure context.\n const secureAttribute = getSecureCookieAttribute();\n\n setCookie(\n `${DYNAMIC_AUTH_COOKIE_NAME}=; Max-Age=-99999999; path=/; SameSite=Lax${secureAttribute}`\n );\n }\n }\n\n await core.keychain.removeKey('session');\n\n const previousState = core.state.get();\n\n core.state.set({\n captchaToken: null,\n elevatedAccessTokens: [],\n legacyToken: null,\n mfaToken: null,\n sessionExpiresAt: null,\n sessionKeys: null,\n token: null,\n unverifiedWalletAccounts: [],\n user: null,\n });\n\n emitEvent({ args: { reason }, event: 'logout' }, client);\n // core.state.set above has no subscribers of its own, so this is the only\n // way listeners relying on getWalletAccounts() (e.g. chain extensions\n // reconciling a wallet provider's registration) learn the accounts are\n // gone. We diff against the pre-logout snapshot so this only fires when\n // there actually were wallet accounts to lose.\n checkAndRaiseWalletAccountsChangedEvent({ previousState }, client);\n\n // Refetch project settings\n void fetchProjectSettings(client);\n\n // Regenerate session keys\n void generateSessionKeys(client);\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","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"],"mappings":";;;;;;;;AAMA,IAAa,8BAAb,cAAiD,UAAU;CAEzD,YAAY,YAAoB;AAC9B,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,mDAAmD;GAClE,CAAC;;;;;;;ACMN,MAAa,cAAc,OAAU,EACnC,QAAQ,GACR,IACA,iBACsC;AACtC,MAAK,IAAI,QAAQ,GAAG,SAAS,YAAY,QACvC,KAAI;AACF,SAAO,MAAM,IAAI;UACV,OAAO;AACd,MAAI,SAAS,WACX,OAAM;AAGR,MAAI,QAAQ,EACV,OAAM,IAAI,SAAS,YAAY,WAAW,SAAS,MAAM,CAAC;;;;;;AAShE,OAAM,IAAI,4BAA4B,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACZnD,MAAa,cAAc,SAAS,kBAAkB,KACpD,QAAQ,OAAO,QAAQ,kBAAkB,OAAO,CAAC,SAAS,EAAE;;;;;;;AC1B9D,MAAa,4CAA4C,uBACvD;CACE,KAAK;CACL,QAAQ,EAAE,QAAQ;CACnB,CACF;;;;;;;ACCD,MAAa,mCAAmC,MAAO,KAAK;;;;;;;;;;;;;;;;;;;;;AAsB5D,MAAa,uBAAuB,OAClC,SAAS,kBAAkB,KACS;CACpC,MAAM,OAAO,QAAQ,OAAO;CAE5B,MAAM,oBAAoB,MAAM,KAAK,QAAQ,QAC3C,0CACD;AAOD,KAL2B,QAAQ,OAAO,gBAAgB,IAKhC,EAJR,qBAAqB,oBAAoB,KAAK,KAAK,KAI7B,WAAW,OAAO,CACxD,QAAO,OAAO;CAGhB,MAAM,YAAY,gBAAgB,EAAE,EAAE,OAAO;AAE7C,MAAK,OAAO,MAAM,sDAAsD;CAExE,MAAM,UAAU,YACd,UAAU,uBACR;EACE,eAAe,KAAK;EACpB,YAAY,GAAG,gBAAgB,GAAG,KAAK;EACxC,EACD,EACE,aAAa,QACd,CACF;CAEH,MAAM,kBAAkB,MAAM,YAAY;EACxC,IAAI;EACJ,YAAY;EACb,CAAC;AAEF,MAAK,MAAM,IAAI,EAAE,iBAAiB,mBAAmB,MAAM,CAAC;AAE5D,OAAM,KAAK,QAAQ,QACjB,2CACA,KAAK,KAAK,GAAG,iCACd;AAED,QAAO;;;;;;AC1ET,MAAa,sBAAsB,OACjC,WACyB;CACzB,MAAM,OAAO,QAAQ,OAAO;CAE5B,MAAM,eAAe,KAAK,MAAM,KAAK;CAErC,MAAM,aAAa,QAAQ,aAAa,YAAY;CAEpD,MAAM,aAAa;EACjB,eAAe,KAAK;EACpB,WAAW,aAAa,WAAW;EACnC,QAAQ,aAAa,MAAM,MAAM;EAClC;AAED,MAAK,OAAO,KACV,aACI,kDACA,iDACJ,WACD;AAED,OAAM,KAAK,SAAS,UAAU,UAAU;CAExC,MAAM,YAAY,MAAM,KAAK,SAAS,YAAY,UAAU;AAE5D,eAAc,WAAW,uBAAuB;AAEhD,MAAK,MAAM,IAAI,EACb,aAAa,WACd,CAAC;AAEF,MAAK,OAAO,KACV,aACI,8CACA,6CACJ,WACD;AAED,QAAO,EAAE,WAAW;;;;;;ACtCtB,MAAa,iDACX,WACqB;CACrB,MAAM,OAAO,QAAQ,OAAO;CAE5B,MAAMA,qCAAkD,IAAI,KAAK;AAIjE,CAFuB,kBAAkB,OAAO,CAEjC,SAAS,kBAAkB;AACxC,MAAI,mBAAmB,IAAI,cAAc,kBAAkB,CACzD;AAGF,MAAI;GACF,MAAM,iBAAiB,mCACrB,EACE,eACD,EACD,OACD;AAED,sBAAmB,IAAI,cAAc,mBAAmB,eAAe;WAChE,OAAO;AACd,QAAK,OAAO,MAAM,gDAAgD;IAChE;IACA,eAAe,cAAc;IAC9B,CAAC;;GAEJ;AAEF,QAAO,MAAM,KAAK,mBAAmB,QAAQ,CAAC;;;;;;;;;;;;;;ACxBhD,MAAa,yBAAyB,OACpC,EAAE,UACF,WACkB;CAClB,MAAM,OAAO,QAAQ,OAAO;CAE5B,MAAM,kBAAkB,8CAA8C,OAAO;AAE7E,OAAM,QAAQ,IACZ,gBAAgB,IAAI,OAAO,mBAAmB;AAC5C,MAAI,CAAC,eAAe,QAAS;AAC7B,MAAI;AACF,SAAM,eAAe,QAAQ,EAAE,QAAQ,CAAC;WACjC,KAAK;AACZ,QAAK,OAAO,MACV,oCAAoC,eAAe,OACnD,IACD;;GAEH,CACH;;;;;;;;;;;;;;;;;;;;;;;ACEH,MAAG,mBAAiB,OAClB,EAAA,qBAEkB;;;AAKlB,OAAK,uBAAmB,EAAO,QAAO,EAAA,OAAQ;AAE9C,KAAE,OAAM,SAAY,MAAA;EAGlB,MAAC,YAAA,yEAED,OACC;AAED,MAAI;AACF,SAAM,UAAQ,cAAA,EACd,eAAiB,KAAE,eACrB,CAAA;;AAEE,QAAA,OAAA,MAAA,4BAAA,MAAA;;;;;;AAOF,MAAE,gBAAM,OAAkB,CAK1B,WACF,GAAA,yBAAA,4CAHS,0BAA6C;;;CAUtD,MAAE,gBAAkB,KAAA,MAAA,KAAA;AAEpB,MAAE,MAAA,IAAa;EACb,cAAc;EACd,sBAAsB,EAAA;EACtB,aAAa;EACb,UAAO;EACP,kBAAA;EACA,aAAU;EACV,OAAA;;EAEF,MAAA;EACC,CAAC;AAEF,WAAG;EAAA,MAAc,EAAA,QAAO;EAAA,OAAW;EAAY,EAAE,OAAM;AAMvD,yCAAiC,EAAA,eAAA,EAAA,OAAA;AAGjC,CAAK,qBAAoB,OAAO;;;;;;;;;;;;;;;;;;;AC5FlC,MAAa,yCACX,EAAE,iBACF,WACsC;AACtC,QAAO,OAAO,MAAM,oBAAoB,MACrC,OAAO,GAAG,OAAO,cAAc,qBACjC;;;;;;ACNH,MAAa,0BACX,EAAE,qBACF,WACmB;CAGnB,MAAM,iBAFkB,mBAAmB,OAAO,CAEX,MACpC,qBAAmBC,iBAAe,QAAQ,kBAC5C;AAED,KAAI,CAAC,eACH,OAAM,IAAI,2BAA2B,EAAE,mBAAmB,CAAC;AAG7D,QAAO"}
1
+ {"version":3,"file":"getWalletProviderByKey-Cl6WDOoD.native.esm.js","names":["walletProvidersMap: Map<string, WalletProvider>","walletProvider"],"sources":["../src/utils/retryOnFail/InvalidRetryOnFailCallError.ts","../src/utils/retryOnFail/retryOnFail.ts","../src/modules/auth/isSignedIn/isSignedIn.ts","../src/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.ts","../src/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.ts","../src/modules/sessionKeys/generateSessionKeys/generateSessionKeys.ts","../src/modules/wallets/utils/getAvailableWalletProvidersFromWalletAccounts/getAvailableWalletProvidersFromWalletAccounts.ts","../src/modules/wallets/destroyWalletProviders/destroyWalletProviders.ts","../src/modules/auth/logoutWithReason/logoutWithReason.ts","../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts","../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts"],"sourcesContent":["import { BaseError } from '../../errors/base';\n\n/**\n * This error is thrown when the `retryOnFail` function is called with an invalid\n * number of retries (i.e. less than 0).\n */\nexport class InvalidRetryOnFailCallError extends BaseError {\n // eslint-disable-next-line custom-rules/require-single-object-param\n constructor(maxRetries: number) {\n super({\n cause: null,\n code: 'invalid_retry_on_fail_call_error',\n docsUrl: null,\n name: 'InvalidRetryOnFailCallError',\n shortMessage: `Invalid retries parameter for retryOnFail call: ${maxRetries}`,\n });\n }\n}\n","import { InvalidRetryOnFailCallError } from './InvalidRetryOnFailCallError';\n\nexport type RetryOnFailParams<T> = {\n /**\n * The delay between retries in milliseconds.\n */\n delay?: number;\n /**\n * The function to call.\n */\n fn: () => Promise<T>;\n /**\n * The maximum number of retries.\n *\n * When set to 0, the function will be called only once and is\n * therefore equivalent to calling the function directly.\n */\n maxRetries: number;\n};\n\n/** @notInstrumented */\nexport const retryOnFail = async <T>({\n delay = 0,\n fn,\n maxRetries,\n}: RetryOnFailParams<T>): Promise<T> => {\n for (let retry = 0; retry <= maxRetries; retry++) {\n try {\n return await fn();\n } catch (error) {\n if (retry >= maxRetries) {\n throw error;\n }\n\n if (delay > 0) {\n await new Promise((resolve) => setTimeout(resolve, delay));\n }\n }\n }\n\n /**\n * Reaching this point should never happen and this\n * error is thrown to help us debug the issue.\n */\n throw new InvalidRetryOnFailCallError(maxRetries);\n};\n","import { getDefaultClient } from '../../../client/defaultClient';\nimport { getWalletAccounts } from '../../wallets/getWalletAccounts';\n\n/**\n * Checks if the user is currently signed in to the Dynamic client.\n *\n * The client is considered to be in a signed in state if a user has\n * authenticated or if the client has at least one wallet connected.\n *\n * @deprecated What counts as \"signed in\" is your app's business logic, not the\n * SDK's. This helper bakes in one opinion (a user OR any connected wallet),\n * which rarely matches every app and forces a dependency on us for every\n * variation. Compose your own check from the underlying primitives instead —\n * e.g. `Boolean(client.user) || isAnyWalletAccountConnected(client)` — and\n * layer in whatever your app requires (device registration, completed\n * onboarding, satisfied MFA, a required embedded wallet, …). See the\n * \"Check if signed in\" guide:\n * https://www.dynamic.xyz/docs/javascript/user-session-management\n *\n * @example\n * ```ts\n * if (isSignedIn()) {\n * console.log('User is authenticated or has a wallet connected');\n * }\n * ```\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if the user is signed in, false otherwise.\n * @see logout\n * @see isAnyWalletAccountConnected\n * @notInstrumented\n */\nexport const isSignedIn = (client = getDefaultClient()): boolean =>\n Boolean(client.user || getWalletAccounts(client).length > 0);\n","import * as z from 'zod/mini';\n\nimport { createStorageKeySchema } from '../../../services/storage';\n\n/**\n * The schema to track the expiration time of the project settings.\n */\nexport const projectSettingsExpirationStorageKeySchema = createStorageKeySchema(\n {\n key: 'projectSettingsExpiration',\n schema: z.number(),\n }\n);\n","import type { ProjectSettings } from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { retryOnFail } from '../../../utils/retryOnFail';\nimport { createApiClient } from '../../apiClient';\nimport { CLIENT_SDK_NAME } from '../../apiClient/constants';\nimport { isSignedIn } from '../../auth/isSignedIn';\nimport { projectSettingsExpirationStorageKeySchema } from './projectSettingsExpirationScheme';\n\n/**\n * Expiration time of the project settings in milliseconds.\n */\nexport const PROJECT_SETTINGS_EXPIRATION_TIME = 1000 * 60 * 5; // 5 minutes\n\n/**\n * Fetches and updates the project settings from the API.\n *\n * This function retrieves the latest project configuration settings\n * from Dynamic's servers, including authentication options, enabled chains,\n * and security configurations. The settings are cached for performance.\n *\n * @example\n * ```ts\n * const settings = await fetchProjectSettings();\n * console.log('Enabled chains:', settings.chains);\n * ```\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the updated project settings.\n * @see createDynamicClient\n * @see initializeClient\n * @notInstrumented\n * @noHook Internal settings fetch that is not part of the public hook surface.\n */\nexport const fetchProjectSettings = async (\n client = getDefaultClient()\n): Promise<ProjectSettings | null> => {\n const core = getCore(client);\n\n const currentExpiration = await core.storage.getItem(\n projectSettingsExpirationStorageKeySchema\n );\n\n const hasProjectSettings = Boolean(client.projectSettings);\n const isExpired = currentExpiration && currentExpiration < Date.now();\n\n // We want to cache the project settings if its valid and user is connected.\n // This avoids unnecessary API calls and speeds up the initial load.\n if (hasProjectSettings && !isExpired && isSignedIn(client)) {\n return client.projectSettings;\n }\n\n const apiClient = createApiClient({}, client);\n\n core.logger.debug('[fetchProjectSettings] Fetching project settings...');\n\n const doFetch = async () =>\n apiClient.getEnvironmentSettings(\n {\n environmentId: core.environmentId,\n sdkVersion: `${CLIENT_SDK_NAME}/${core.version}`,\n },\n {\n credentials: 'omit',\n }\n );\n\n const projectSettings = await retryOnFail({\n fn: doFetch,\n maxRetries: 2,\n });\n\n core.state.set({ projectSettings: projectSettings ?? null });\n\n await core.storage.setItem(\n projectSettingsExpirationStorageKeySchema,\n Date.now() + PROJECT_SETTINGS_EXPIRATION_TIME\n );\n\n return projectSettings;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport type { SessionKeys } from '../sessionKeys.types';\n\n/** @notInstrumented */\nexport const generateSessionKeys = async (\n client: DynamicClient\n): Promise<SessionKeys> => {\n const core = getCore(client);\n\n const currentState = core.state.get();\n\n const isRotation = Boolean(currentState.sessionKeys);\n\n const logContext = {\n environmentId: core.environmentId,\n operation: isRotation ? 'rotate' : 'create',\n userId: currentState.user?.id ?? null,\n };\n\n core.logger.info(\n isRotation\n ? '[generateSessionKeys] Rotating session key...'\n : '[generateSessionKeys] Creating session key...',\n logContext\n );\n\n await core.keychain.removeKey('session');\n\n const publicKey = await core.keychain.generateKey('session');\n\n assertDefined(publicKey, 'Public key not found');\n\n core.state.set({\n sessionKeys: publicKey,\n });\n\n core.logger.info(\n isRotation\n ? '[generateSessionKeys] Session key rotated'\n : '[generateSessionKeys] Session key created',\n logContext\n );\n\n return { publicKey };\n};\n","import { getCore } from '../../../../client/core/getCore';\nimport type { DynamicClient } from '../../../../client/types';\nimport { getWalletAccounts } from '../../getWalletAccounts';\nimport type { WalletProvider } from '../../walletProvider';\nimport { getWalletProviderFromWalletAccount } from '../getWalletProviderFromWalletAccount';\n\n/** @notInstrumented */\nexport const getAvailableWalletProvidersFromWalletAccounts = (\n client: DynamicClient\n): WalletProvider[] => {\n const core = getCore(client);\n\n const walletProvidersMap: Map<string, WalletProvider> = new Map();\n\n const walletAccounts = getWalletAccounts(client);\n\n walletAccounts.forEach((walletAccount) => {\n if (walletProvidersMap.has(walletAccount.walletProviderKey)) {\n return;\n }\n\n try {\n const walletProvider = getWalletProviderFromWalletAccount(\n {\n walletAccount,\n },\n client\n );\n\n walletProvidersMap.set(walletAccount.walletProviderKey, walletProvider);\n } catch (error) {\n core.logger.debug('Wallet provider not found for wallet account', {\n error,\n walletAccount: walletAccount.address,\n });\n }\n });\n\n return Array.from(walletProvidersMap.values());\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types/DynamicClient';\nimport type { LogoutReason } from '../../auth/logoutReason';\nimport { getAvailableWalletProvidersFromWalletAccounts } from '../utils/getAvailableWalletProvidersFromWalletAccounts';\n\n/**\n * Tear down every wallet provider on the client.\n *\n * Each provider's `destroy` is responsible for its own local + remote\n * cleanup. We swallow errors so a failing destroy on one provider does not\n * block teardown of the others (e.g. during logout).\n *\n * @notInstrumented\n */\nexport const destroyWalletProviders = async (\n { reason }: { reason?: LogoutReason },\n client: DynamicClient\n): Promise<void> => {\n const core = getCore(client);\n\n const walletProviders = getAvailableWalletProvidersFromWalletAccounts(client);\n\n await Promise.all(\n walletProviders.map(async (walletProvider) => {\n if (!walletProvider.destroy) return;\n try {\n await walletProvider.destroy({ reason });\n } catch (err) {\n core.logger.error(\n `Error destroying wallet provider ${walletProvider.key}`,\n err\n );\n }\n })\n );\n};\n","import type { DynamicClient } from '../../../client/types';\nimport { getCore } from '../../../client/core/getCore';\nimport { getSecureCookieAttribute } from '../../../utils/getSecureCookieAttribute';\nimport { setCookie } from '../../../utils/setCookie';\nimport { createApiClient } from '../../apiClient';\nimport { DYNAMIC_LOGOUT_REASON_HEADER } from '../../apiClient/constants';\nimport { emitEvent } from '../../clientEvents';\nimport { fetchProjectSettings } from '../../projectSettings/fetchProjectSettings';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport { generateSessionKeys } from '../../sessionKeys/generateSessionKeys';\nimport { destroyWalletProviders } from '../../wallets/destroyWalletProviders';\nimport { DYNAMIC_AUTH_COOKIE_NAME } from '../consts';\nimport type { LogoutReason } from '../logoutReason';\nimport { checkAndRaiseWalletAccountsChangedEvent } from '../updateAuthFromVerifyResponse/checkAndRaiseWalletAccountsChangedEvent';\n\n/**\n * Logs the user out with an explicit reason.\n *\n * Revokes the session, clears auth state, terminates wallet providers, and\n * emits the `logout` client event with the given reason. The reason is also\n * captured as an argument on the function-instrumentation event, which is\n * how Datadog distinguishes between different logout causes.\n *\n * Use this instead of the public `logout` when triggering a logout from\n * internal or extension code — the caller owns the reason string, so the\n * telemetry correctly attributes *why* the logout happened.\n *\n * @param params - The logout params.\n * @param params.reason - Why the logout is being triggered. Extension authors\n * needing a reason outside the SDK catalog can cast with `as LogoutReason`.\n * @param client - The Dynamic client instance.\n * @instrumented\n */\nexport const logoutWithReason = async (\n { reason }: { reason: LogoutReason },\n client: DynamicClient\n): Promise<void> => {\n const core = getCore(client);\n\n core.logger.debug('[logoutWithReason] Logging out...', { reason });\n\n await destroyWalletProviders({ reason }, client);\n\n if (client.user !== null) {\n // Forward the logout reason so the backend can attribute the revocation in\n // Datadog instead of it being inferred from downstream 401s.\n const apiClient = createApiClient(\n { headers: { [DYNAMIC_LOGOUT_REASON_HEADER]: reason } },\n client\n );\n\n try {\n await apiClient.revokeSession({\n environmentId: core.environmentId,\n });\n } catch (error) {\n core.logger.error('Failed to revoke session', error);\n }\n\n /**\n * This deletes the auth cookie if it exists.\n * If the cookie doesn't exist, this sets a new cookie that expires immediately.\n */\n if (isCookieEnabled(client)) {\n // Match the Secure attribute used when the cookie was written so the\n // deletion cookie is accepted consistently in a secure context.\n const secureAttribute = getSecureCookieAttribute();\n\n setCookie(\n `${DYNAMIC_AUTH_COOKIE_NAME}=; Max-Age=-99999999; path=/; SameSite=Lax${secureAttribute}`\n );\n }\n }\n\n await core.keychain.removeKey('session');\n\n const previousState = core.state.get();\n\n core.state.set({\n captchaToken: null,\n elevatedAccessTokens: [],\n legacyToken: null,\n mfaToken: null,\n sessionExpiresAt: null,\n sessionKeys: null,\n token: null,\n unverifiedWalletAccounts: [],\n user: null,\n });\n\n emitEvent({ args: { reason }, event: 'logout' }, client);\n // core.state.set above has no subscribers of its own, so this is the only\n // way listeners relying on getWalletAccounts() (e.g. chain extensions\n // reconciling a wallet provider's registration) learn the accounts are\n // gone. We diff against the pre-logout snapshot so this only fires when\n // there actually were wallet accounts to lose.\n checkAndRaiseWalletAccountsChangedEvent({ previousState }, client);\n\n // Refetch project settings\n void fetchProjectSettings(client);\n\n // Regenerate session keys\n void generateSessionKeys(client);\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","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"],"mappings":";;;;;;;;AAMA,IAAa,8BAAb,cAAiD,UAAU;CAEzD,YAAY,YAAoB;AAC9B,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,mDAAmD;GAClE,CAAC;;;;;;;ACMN,MAAa,cAAc,OAAU,EACnC,QAAQ,GACR,IACA,iBACsC;AACtC,MAAK,IAAI,QAAQ,GAAG,SAAS,YAAY,QACvC,KAAI;AACF,SAAO,MAAM,IAAI;UACV,OAAO;AACd,MAAI,SAAS,WACX,OAAM;AAGR,MAAI,QAAQ,EACV,OAAM,IAAI,SAAS,YAAY,WAAW,SAAS,MAAM,CAAC;;;;;;AAShE,OAAM,IAAI,4BAA4B,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACZnD,MAAa,cAAc,SAAS,kBAAkB,KACpD,QAAQ,OAAO,QAAQ,kBAAkB,OAAO,CAAC,SAAS,EAAE;;;;;;;AC1B9D,MAAa,4CAA4C,uBACvD;CACE,KAAK;CACL,QAAQ,EAAE,QAAQ;CACnB,CACF;;;;;;;ACCD,MAAa,mCAAmC,MAAO,KAAK;;;;;;;;;;;;;;;;;;;;;AAsB5D,MAAa,uBAAuB,OAClC,SAAS,kBAAkB,KACS;CACpC,MAAM,OAAO,QAAQ,OAAO;CAE5B,MAAM,oBAAoB,MAAM,KAAK,QAAQ,QAC3C,0CACD;AAOD,KAL2B,QAAQ,OAAO,gBAAgB,IAKhC,EAJR,qBAAqB,oBAAoB,KAAK,KAAK,KAI7B,WAAW,OAAO,CACxD,QAAO,OAAO;CAGhB,MAAM,YAAY,gBAAgB,EAAE,EAAE,OAAO;AAE7C,MAAK,OAAO,MAAM,sDAAsD;CAExE,MAAM,UAAU,YACd,UAAU,uBACR;EACE,eAAe,KAAK;EACpB,YAAY,GAAG,gBAAgB,GAAG,KAAK;EACxC,EACD,EACE,aAAa,QACd,CACF;CAEH,MAAM,kBAAkB,MAAM,YAAY;EACxC,IAAI;EACJ,YAAY;EACb,CAAC;AAEF,MAAK,MAAM,IAAI,EAAE,iBAAiB,mBAAmB,MAAM,CAAC;AAE5D,OAAM,KAAK,QAAQ,QACjB,2CACA,KAAK,KAAK,GAAG,iCACd;AAED,QAAO;;;;;;AC1ET,MAAa,sBAAsB,OACjC,WACyB;CACzB,MAAM,OAAO,QAAQ,OAAO;CAE5B,MAAM,eAAe,KAAK,MAAM,KAAK;CAErC,MAAM,aAAa,QAAQ,aAAa,YAAY;CAEpD,MAAM,aAAa;EACjB,eAAe,KAAK;EACpB,WAAW,aAAa,WAAW;EACnC,QAAQ,aAAa,MAAM,MAAM;EAClC;AAED,MAAK,OAAO,KACV,aACI,kDACA,iDACJ,WACD;AAED,OAAM,KAAK,SAAS,UAAU,UAAU;CAExC,MAAM,YAAY,MAAM,KAAK,SAAS,YAAY,UAAU;AAE5D,eAAc,WAAW,uBAAuB;AAEhD,MAAK,MAAM,IAAI,EACb,aAAa,WACd,CAAC;AAEF,MAAK,OAAO,KACV,aACI,8CACA,6CACJ,WACD;AAED,QAAO,EAAE,WAAW;;;;;;ACtCtB,MAAa,iDACX,WACqB;CACrB,MAAM,OAAO,QAAQ,OAAO;CAE5B,MAAMA,qCAAkD,IAAI,KAAK;AAIjE,CAFuB,kBAAkB,OAAO,CAEjC,SAAS,kBAAkB;AACxC,MAAI,mBAAmB,IAAI,cAAc,kBAAkB,CACzD;AAGF,MAAI;GACF,MAAM,iBAAiB,mCACrB,EACE,eACD,EACD,OACD;AAED,sBAAmB,IAAI,cAAc,mBAAmB,eAAe;WAChE,OAAO;AACd,QAAK,OAAO,MAAM,gDAAgD;IAChE;IACA,eAAe,cAAc;IAC9B,CAAC;;GAEJ;AAEF,QAAO,MAAM,KAAK,mBAAmB,QAAQ,CAAC;;;;;;;;;;;;;;ACxBhD,MAAa,yBAAyB,OACpC,EAAE,UACF,WACkB;CAClB,MAAM,OAAO,QAAQ,OAAO;CAE5B,MAAM,kBAAkB,8CAA8C,OAAO;AAE7E,OAAM,QAAQ,IACZ,gBAAgB,IAAI,OAAO,mBAAmB;AAC5C,MAAI,CAAC,eAAe,QAAS;AAC7B,MAAI;AACF,SAAM,eAAe,QAAQ,EAAE,QAAQ,CAAC;WACjC,KAAK;AACZ,QAAK,OAAO,MACV,oCAAoC,eAAe,OACnD,IACD;;GAEH,CACH;;;;;;;;;;;;;;;;;;;;;;;ACEH,MAAG,mBAAiB,OAClB,EAAA,qBAEkB;;;AAKlB,OAAK,uBAAmB,EAAO,QAAO,EAAA,OAAQ;AAE9C,KAAE,OAAM,SAAY,MAAA;EAGlB,MAAC,YAAA,yEAED,OACC;AAED,MAAI;AACF,SAAM,UAAQ,cAAA,EACd,eAAiB,KAAE,eACrB,CAAA;;AAEE,QAAA,OAAA,MAAA,4BAAA,MAAA;;;;;;AAOF,MAAE,gBAAM,OAAkB,CAK1B,WACF,GAAA,yBAAA,4CAHS,0BAA6C;;;CAUtD,MAAE,gBAAkB,KAAA,MAAA,KAAA;AAEpB,MAAE,MAAA,IAAa;EACb,cAAc;EACd,sBAAsB,EAAA;EACtB,aAAa;EACb,UAAO;EACP,kBAAA;EACA,aAAU;EACV,OAAA;;EAEF,MAAA;EACC,CAAC;AAEF,WAAG;EAAA,MAAc,EAAA,QAAO;EAAA,OAAW;EAAY,EAAE,OAAM;AAMvD,yCAAiC,EAAA,eAAA,EAAA,OAAA;AAGjC,CAAK,qBAAoB,OAAO;;;;;;;;;;;;;;;;;;;AC5FlC,MAAa,yCACX,EAAE,iBACF,WACsC;AACtC,QAAO,OAAO,MAAM,oBAAoB,MACrC,OAAO,GAAG,OAAO,cAAc,qBACjC;;;;;;ACNH,MAAa,0BACX,EAAE,qBACF,WACmB;CAGnB,MAAM,iBAFkB,mBAAmB,OAAO,CAEX,MACpC,qBAAmBC,iBAAe,QAAQ,kBAC5C;AAED,KAAI,CAAC,eACH,OAAM,IAAI,2BAA2B,EAAE,mBAAmB,CAAC;AAG7D,QAAO"}
@@ -1,4 +1,4 @@
1
- const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-C9xos3Q_.cjs');
1
+ const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-Dsw-eAro.cjs');
2
2
 
3
3
  //#region src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts
4
4
  /** @notInstrumented */
@@ -28,4 +28,4 @@ Object.defineProperty(exports, 'getWalletProviderByKey', {
28
28
  return getWalletProviderByKey;
29
29
  }
30
30
  });
31
- //# sourceMappingURL=getWalletProviderByKey-OZfEvvFZ.cjs.map
31
+ //# sourceMappingURL=getWalletProviderByKey-DzpmoNlv.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getWalletProviderByKey-OZfEvvFZ.cjs","names":["getWalletProviders","walletProvider","NoWalletProviderFoundError"],"sources":["../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts","../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts"],"sourcesContent":["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","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"],"mappings":";;;;AAUA,MAAa,yCACX,EAAE,iBACF,WACsC;AACtC,QAAO,OAAO,MAAM,oBAAoB,MACrC,OAAO,GAAG,OAAO,cAAc,qBACjC;;;;;;ACNH,MAAa,0BACX,EAAE,qBACF,WACmB;CAGnB,MAAM,iBAFkBA,wDAAmB,OAAO,CAEX,MACpC,qBAAmBC,iBAAe,QAAQ,kBAC5C;AAED,KAAI,CAAC,eACH,OAAM,IAAIC,gEAA2B,EAAE,mBAAmB,CAAC;AAG7D,QAAO"}
1
+ {"version":3,"file":"getWalletProviderByKey-DzpmoNlv.cjs","names":["getWalletProviders","walletProvider","NoWalletProviderFoundError"],"sources":["../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts","../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts"],"sourcesContent":["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","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"],"mappings":";;;;AAUA,MAAa,yCACX,EAAE,iBACF,WACsC;AACtC,QAAO,OAAO,MAAM,oBAAoB,MACrC,OAAO,GAAG,OAAO,cAAc,qBACjC;;;;;;ACNH,MAAa,0BACX,EAAE,qBACF,WACmB;CAGnB,MAAM,iBAFkBA,wDAAmB,OAAO,CAEX,MACpC,qBAAmBC,iBAAe,QAAQ,kBAC5C;AAED,KAAI,CAAC,eACH,OAAM,IAAIC,gEAA2B,EAAE,mBAAmB,CAAC;AAG7D,QAAO"}
@@ -1,4 +1,4 @@
1
- import { O as NoWalletProviderFoundError, p as getWalletProviders } from "./updateAuthFromVerifyResponse-CjuwqNKr.esm.js";
1
+ import { O as NoWalletProviderFoundError, p as getWalletProviders } from "./updateAuthFromVerifyResponse-BLgNMqwN.esm.js";
2
2
 
3
3
  //#region src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts
4
4
  /** @notInstrumented */
@@ -17,4 +17,4 @@ const getWalletProviderByKey = ({ walletProviderKey }, client) => {
17
17
 
18
18
  //#endregion
19
19
  export { getVerifiedCredentialForWalletAccount as n, getWalletProviderByKey as t };
20
- //# sourceMappingURL=getWalletProviderByKey-CE54Uh8q.esm.js.map
20
+ //# sourceMappingURL=getWalletProviderByKey-xqyD3ybv.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getWalletProviderByKey-CE54Uh8q.esm.js","names":["walletProvider"],"sources":["../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts","../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts"],"sourcesContent":["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","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"],"mappings":";;;;AAUA,MAAa,yCACX,EAAE,iBACF,WACsC;AACtC,QAAO,OAAO,MAAM,oBAAoB,MACrC,OAAO,GAAG,OAAO,cAAc,qBACjC;;;;;;ACNH,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"}
1
+ {"version":3,"file":"getWalletProviderByKey-xqyD3ybv.esm.js","names":["walletProvider"],"sources":["../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts","../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts"],"sourcesContent":["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","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"],"mappings":";;;;AAUA,MAAa,yCACX,EAAE,iBACF,WACsC;AACtC,QAAO,OAAO,MAAM,oBAAoB,MACrC,OAAO,GAAG,OAAO,cAAc,qBACjC;;;;;;ACNH,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"}
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
- const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-C9xos3Q_.cjs');
2
- const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-SIqshJGX.cjs');
3
- const require_isDynamicWaasEnabled = require('./isDynamicWaasEnabled-D9M2mzUG.cjs');
4
- const require_isUserOnboardingComplete = require('./isUserOnboardingComplete-Dw6OKlZJ.cjs');
5
- const require_getWalletProviderByKey = require('./getWalletProviderByKey-OZfEvvFZ.cjs');
6
- const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-Cnu2p0p8.cjs');
1
+ const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-Dsw-eAro.cjs');
2
+ const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-igDf2OPy.cjs');
3
+ const require_isDynamicWaasEnabled = require('./isDynamicWaasEnabled-CMccs1-6.cjs');
4
+ const require_isUserOnboardingComplete = require('./isUserOnboardingComplete-jv_idxWY.cjs');
5
+ const require_getWalletProviderByKey = require('./getWalletProviderByKey-DzpmoNlv.cjs');
6
+ const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-DKfoMhEk.cjs');
7
7
  let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
8
8
  let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
9
9
  let zod_mini = require("zod/mini");
package/dist/index.esm.js CHANGED
@@ -1,9 +1,9 @@
1
- import { $ as createStorageKeySchema, A as fetchProjectSettings, Ct as name, E as getWalletProviderRegistry, F as getChainFromVerifiedCredentialChain, G as onceEvent, H as emitEvent, I as CHAINS_INFO_MAP, K as createApiClient, L as formatWalletAccountId, M as getWalletAccounts, O as NoWalletProviderFoundError, Q as updateNoncePoolStorage, R as normalizeAddress, S as checkAndRaiseWalletAccountsChangedEvent, St as getCore, T as WalletProviderPriority, U as offEvent, V as retryOnFail, W as onEvent, X as getNonce, Z as fetchAndStoreNonces, _ as scrubParameters, _t as NONCE_POOL_SIZE, a as InvalidParamError, at as InvalidExternalAuthError, b as getOperatingSystem, ct as DYNAMIC_ICONIC_SPRITE_URL, dt as isCookieEnabled, et as UnauthorizedError, ft as assertDefined, g as instrumentFunction, gt as getPlatform, h as __logoutWithReason_wrapped, ht as randomString, i as decodeJwt, it as LinkCredentialError, j as isSignedIn, k as generateSessionKeys, lt as SDK_API_CORE_VERSION, m as isUserMissingMfaAuth, mt as getElevatedAccessToken, n as upsertElevatedAccessToken, nt as MfaRateLimitedError, o as initializeWaasClientsForEagerRecovery, ot as APIError, p as getWalletProviders, pt as ValueMustBeDefinedError, r as parseElevatedAccessToken, rt as MfaInvalidOtpError, t as updateAuthFromVerifyResponse, tt as SandboxMaximumThresholdReachedError, v as DEFAULT_PII_FIELDS, vt as getDefaultClient, w as getWalletProviderFromWalletAccount, wt as version, x as extractSessionId, xt as BaseError, y as getUserAgent, yt as setDefaultClient, z as splitWalletProviderKey } from "./updateAuthFromVerifyResponse-CjuwqNKr.esm.js";
2
- import { A as createCrossTabBroadcast, B as getBuffer, C as getKeychainIndexedDBName, D as assertSafeNavigationUrl, E as createKeychainService, F as FETCH_PROJECT_SETTINGS_TRACKER_KEY, G as createLocalStorageAdapter, H as isEqualShallow, I as GENERATE_SESSION_KEYS_TRACKER_KEY, K as isServerSideRendering, L as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, M as CannotTrackError, N as createDeferredPromise, P as createAppForegroundSubscriber, R as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, S as MergeAccountsConfirmationError, T as assertSafeDeeplinkUrl, U as createStorage, V as subscribeWithSelector, _ as consumeCaptchaToken, a as verifyMessageSignatureOwnership, b as WalletAlreadyLinkedToAnotherUserError, c as formatSignInMessage, d as updateWalletProviderKeysForVerifiedCredentials, f as setUnverifiedWalletAccounts, g as MethodNotImplementedError, h as __setCaptchaToken_wrapped, i as getNetworksData, k as createLogger, l as getAppMetadata, m as hasExtension, o as removeUnverifiedWalletAccount, p as createVisit, q as UnavailableInServerSideError, s as createSignInMessageStatement, t as getNetworkProviderFromNetworkId, u as reconcileWalletAccountsAgainstClient, v as isCaptchaRequired, w as createRealtimeService, x as NoNetworkProvidersError, y as WalletScreeningBlockedError, z as REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY } from "./getNetworkProviderFromNetworkId-votBZ2Ox.esm.js";
3
- import { i as __refreshAuth_wrapped, n as TransactionBroadcastError, r as NotWaasWalletAccountError } from "./isDynamicWaasEnabled-Cc53N1hb.esm.js";
4
- import { a as WaasOnboardingIncompleteError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, o as WaasLoadFailedError, r as isDeviceRegistrationRequired, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-kf-mOXcE.esm.js";
5
- import { n as getVerifiedCredentialForWalletAccount, t as getWalletProviderByKey } from "./getWalletProviderByKey-CE54Uh8q.esm.js";
6
- import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-D8RXBJ05.esm.js";
1
+ import { $ as createStorageKeySchema, A as fetchProjectSettings, Ct as name, E as getWalletProviderRegistry, F as getChainFromVerifiedCredentialChain, G as onceEvent, H as emitEvent, I as CHAINS_INFO_MAP, K as createApiClient, L as formatWalletAccountId, M as getWalletAccounts, O as NoWalletProviderFoundError, Q as updateNoncePoolStorage, R as normalizeAddress, S as checkAndRaiseWalletAccountsChangedEvent, St as getCore, T as WalletProviderPriority, U as offEvent, V as retryOnFail, W as onEvent, X as getNonce, Z as fetchAndStoreNonces, _ as scrubParameters, _t as NONCE_POOL_SIZE, a as InvalidParamError, at as InvalidExternalAuthError, b as getOperatingSystem, ct as DYNAMIC_ICONIC_SPRITE_URL, dt as isCookieEnabled, et as UnauthorizedError, ft as assertDefined, g as instrumentFunction, gt as getPlatform, h as __logoutWithReason_wrapped, ht as randomString, i as decodeJwt, it as LinkCredentialError, j as isSignedIn, k as generateSessionKeys, lt as SDK_API_CORE_VERSION, m as isUserMissingMfaAuth, mt as getElevatedAccessToken, n as upsertElevatedAccessToken, nt as MfaRateLimitedError, o as initializeWaasClientsForEagerRecovery, ot as APIError, p as getWalletProviders, pt as ValueMustBeDefinedError, r as parseElevatedAccessToken, rt as MfaInvalidOtpError, t as updateAuthFromVerifyResponse, tt as SandboxMaximumThresholdReachedError, v as DEFAULT_PII_FIELDS, vt as getDefaultClient, w as getWalletProviderFromWalletAccount, wt as version, x as extractSessionId, xt as BaseError, y as getUserAgent, yt as setDefaultClient, z as splitWalletProviderKey } from "./updateAuthFromVerifyResponse-BLgNMqwN.esm.js";
2
+ import { A as createCrossTabBroadcast, B as getBuffer, C as getKeychainIndexedDBName, D as assertSafeNavigationUrl, E as createKeychainService, F as FETCH_PROJECT_SETTINGS_TRACKER_KEY, G as createLocalStorageAdapter, H as isEqualShallow, I as GENERATE_SESSION_KEYS_TRACKER_KEY, K as isServerSideRendering, L as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, M as CannotTrackError, N as createDeferredPromise, P as createAppForegroundSubscriber, R as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, S as MergeAccountsConfirmationError, T as assertSafeDeeplinkUrl, U as createStorage, V as subscribeWithSelector, _ as consumeCaptchaToken, a as verifyMessageSignatureOwnership, b as WalletAlreadyLinkedToAnotherUserError, c as formatSignInMessage, d as updateWalletProviderKeysForVerifiedCredentials, f as setUnverifiedWalletAccounts, g as MethodNotImplementedError, h as __setCaptchaToken_wrapped, i as getNetworksData, k as createLogger, l as getAppMetadata, m as hasExtension, o as removeUnverifiedWalletAccount, p as createVisit, q as UnavailableInServerSideError, s as createSignInMessageStatement, t as getNetworkProviderFromNetworkId, u as reconcileWalletAccountsAgainstClient, v as isCaptchaRequired, w as createRealtimeService, x as NoNetworkProvidersError, y as WalletScreeningBlockedError, z as REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY } from "./getNetworkProviderFromNetworkId-CamHn2s3.esm.js";
3
+ import { i as __refreshAuth_wrapped, n as TransactionBroadcastError, r as NotWaasWalletAccountError } from "./isDynamicWaasEnabled-DYORq7Jc.esm.js";
4
+ import { a as WaasOnboardingIncompleteError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, o as WaasLoadFailedError, r as isDeviceRegistrationRequired, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-jkAQQVdP.esm.js";
5
+ import { n as getVerifiedCredentialForWalletAccount, t as getWalletProviderByKey } from "./getWalletProviderByKey-xqyD3ybv.esm.js";
6
+ import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-CatS60F6.esm.js";
7
7
  import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
8
8
  import { AuthModeEnum, CaptchaProviderEnum as CaptchaProviderEnum$1, ChainEnum, ExchangeKeyEnum, JwtVerifiedCredentialFormatEnum, JwtVerifiedCredentialFormatEnum as JwtVerifiedCredentialFormatEnum$1, MFAAction, MfaBackupCodeAcknowledgement, ProviderEnum, ProviderEnum as ProviderEnum$1, TokenScope, TokenScope as TokenScope$1, WaasBackupOptionsEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
9
9
  import * as z from "zod/mini";
@@ -1,9 +1,9 @@
1
- import { $ as UnauthorizedError, B as onEvent, Ct as name, E as getWalletProviderRegistry, F as normalizeAddress, H as createApiClient, I as splitWalletProviderKey, K as getNonce, M as getChainFromVerifiedCredentialChain, N as CHAINS_INFO_MAP, O as NoWalletProviderFoundError, P as formatWalletAccountId, Q as createLocalStorageAdapter, R as emitEvent, St as getCore, T as WalletProviderPriority, V as onceEvent, X as updateNoncePoolStorage, Y as fetchAndStoreNonces, Z as createStorageKeySchema, _ as DEFAULT_PII_FIELDS, _t as NONCE_POOL_SIZE, a as InvalidParamError, at as APIError, b as extractSessionId, ct as DYNAMIC_ICONIC_SPRITE_URL, dt as isCookieEnabled, et as SandboxMaximumThresholdReachedError, ft as assertDefined, g as scrubParameters, gt as getPlatform, h as instrumentFunction, ht as randomString, i as decodeJwt, it as InvalidExternalAuthError, k as getWalletAccounts, lt as SDK_API_CORE_VERSION, m as isUserMissingMfaAuth, mt as getElevatedAccessToken, n as upsertElevatedAccessToken, nt as MfaInvalidOtpError, o as initializeWaasClientsForEagerRecovery, p as getWalletProviders, pt as ValueMustBeDefinedError, r as parseElevatedAccessToken, rt as LinkCredentialError, t as updateAuthFromVerifyResponse, tt as MfaRateLimitedError, v as getUserAgent, vt as getDefaultClient, w as getWalletProviderFromWalletAccount, wt as version, x as checkAndRaiseWalletAccountsChangedEvent, xt as BaseError, y as getOperatingSystem, yt as setDefaultClient, z as offEvent } from "./updateAuthFromVerifyResponse-BS6kZrDc.native.esm.js";
2
- import { A as createCrossTabBroadcast, B as isServerSideRendering, C as getKeychainIndexedDBName, D as assertSafeNavigationUrl, E as createKeychainService, F as FETCH_PROJECT_SETTINGS_TRACKER_KEY, H as subscribeWithSelector, I as GENERATE_SESSION_KEYS_TRACKER_KEY, L as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, M as CannotTrackError, N as createDeferredPromise, P as createAppForegroundSubscriber, R as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, S as MergeAccountsConfirmationError, T as assertSafeDeeplinkUrl, U as isEqualShallow, V as getBuffer, W as createStorage, _ as getAppMetadata, a as verifyMessageSignatureOwnership, b as WalletAlreadyLinkedToAnotherUserError, c as formatSignInMessage, d as setUnverifiedWalletAccounts, f as createVisit, g as isCaptchaRequired, h as consumeCaptchaToken, i as getNetworksData, k as createLogger, l as reconcileWalletAccountsAgainstClient, m as __setCaptchaToken_wrapped, o as removeUnverifiedWalletAccount, p as hasExtension, s as createSignInMessageStatement, t as getNetworkProviderFromNetworkId, u as updateWalletProviderKeysForVerifiedCredentials, v as MethodNotImplementedError, w as createRealtimeService, x as NoNetworkProvidersError, y as WalletScreeningBlockedError, z as REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY } from "./getNetworkProviderFromNetworkId-B9IPtXjv.native.esm.js";
3
- import { a as fetchProjectSettings, i as generateSessionKeys, n as getVerifiedCredentialForWalletAccount, o as isSignedIn, r as __logoutWithReason_wrapped, s as retryOnFail, t as getWalletProviderByKey } from "./getWalletProviderByKey-W9j488kh.native.esm.js";
4
- import { i as __refreshAuth_wrapped, n as TransactionBroadcastError, r as NotWaasWalletAccountError } from "./isDynamicWaasEnabled-2tu-Lzb_.native.esm.js";
5
- import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-CX_Wf5YW.native.esm.js";
6
- import { a as WaasOnboardingIncompleteError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, o as WaasLoadFailedError, r as isDeviceRegistrationRequired, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-BsX5t6s5.native.esm.js";
1
+ import { $ as UnauthorizedError, B as onEvent, Ct as name, E as getWalletProviderRegistry, F as normalizeAddress, H as createApiClient, I as splitWalletProviderKey, K as getNonce, M as getChainFromVerifiedCredentialChain, N as CHAINS_INFO_MAP, O as NoWalletProviderFoundError, P as formatWalletAccountId, Q as createLocalStorageAdapter, R as emitEvent, St as getCore, T as WalletProviderPriority, V as onceEvent, X as updateNoncePoolStorage, Y as fetchAndStoreNonces, Z as createStorageKeySchema, _ as DEFAULT_PII_FIELDS, _t as NONCE_POOL_SIZE, a as InvalidParamError, at as APIError, b as extractSessionId, ct as DYNAMIC_ICONIC_SPRITE_URL, dt as isCookieEnabled, et as SandboxMaximumThresholdReachedError, ft as assertDefined, g as scrubParameters, gt as getPlatform, h as instrumentFunction, ht as randomString, i as decodeJwt, it as InvalidExternalAuthError, k as getWalletAccounts, lt as SDK_API_CORE_VERSION, m as isUserMissingMfaAuth, mt as getElevatedAccessToken, n as upsertElevatedAccessToken, nt as MfaInvalidOtpError, o as initializeWaasClientsForEagerRecovery, p as getWalletProviders, pt as ValueMustBeDefinedError, r as parseElevatedAccessToken, rt as LinkCredentialError, t as updateAuthFromVerifyResponse, tt as MfaRateLimitedError, v as getUserAgent, vt as getDefaultClient, w as getWalletProviderFromWalletAccount, wt as version, x as checkAndRaiseWalletAccountsChangedEvent, xt as BaseError, y as getOperatingSystem, yt as setDefaultClient, z as offEvent } from "./updateAuthFromVerifyResponse-CTvWpZLa.native.esm.js";
2
+ import { A as createCrossTabBroadcast, B as isServerSideRendering, C as getKeychainIndexedDBName, D as assertSafeNavigationUrl, E as createKeychainService, F as FETCH_PROJECT_SETTINGS_TRACKER_KEY, H as subscribeWithSelector, I as GENERATE_SESSION_KEYS_TRACKER_KEY, L as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, M as CannotTrackError, N as createDeferredPromise, P as createAppForegroundSubscriber, R as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, S as MergeAccountsConfirmationError, T as assertSafeDeeplinkUrl, U as isEqualShallow, V as getBuffer, W as createStorage, _ as getAppMetadata, a as verifyMessageSignatureOwnership, b as WalletAlreadyLinkedToAnotherUserError, c as formatSignInMessage, d as setUnverifiedWalletAccounts, f as createVisit, g as isCaptchaRequired, h as consumeCaptchaToken, i as getNetworksData, k as createLogger, l as reconcileWalletAccountsAgainstClient, m as __setCaptchaToken_wrapped, o as removeUnverifiedWalletAccount, p as hasExtension, s as createSignInMessageStatement, t as getNetworkProviderFromNetworkId, u as updateWalletProviderKeysForVerifiedCredentials, v as MethodNotImplementedError, w as createRealtimeService, x as NoNetworkProvidersError, y as WalletScreeningBlockedError, z as REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY } from "./getNetworkProviderFromNetworkId--X0cb1ad.native.esm.js";
3
+ import { a as fetchProjectSettings, i as generateSessionKeys, n as getVerifiedCredentialForWalletAccount, o as isSignedIn, r as __logoutWithReason_wrapped, s as retryOnFail, t as getWalletProviderByKey } from "./getWalletProviderByKey-Cl6WDOoD.native.esm.js";
4
+ import { i as __refreshAuth_wrapped, n as TransactionBroadcastError, r as NotWaasWalletAccountError } from "./isDynamicWaasEnabled-DSqgpEcX.native.esm.js";
5
+ import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-BcJvy7Gw.native.esm.js";
6
+ import { a as WaasOnboardingIncompleteError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, o as WaasLoadFailedError, r as isDeviceRegistrationRequired, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-BWVuE4Jg.native.esm.js";
7
7
  import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
8
8
  import { AuthModeEnum, CaptchaProviderEnum as CaptchaProviderEnum$1, ChainEnum, ExchangeKeyEnum, JwtVerifiedCredentialFormatEnum, JwtVerifiedCredentialFormatEnum as JwtVerifiedCredentialFormatEnum$1, MFAAction, MfaBackupCodeAcknowledgement, ProviderEnum, ProviderEnum as ProviderEnum$1, TokenScope, TokenScope as TokenScope$1, WaasBackupOptionsEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
9
9
  import * as z from "zod/mini";
@@ -1,4 +1,4 @@
1
- const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-C9xos3Q_.cjs');
1
+ const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-Dsw-eAro.cjs');
2
2
  let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
3
3
 
4
4
  //#region src/modules/user/refreshAuth/refreshAuth.ts
@@ -133,4 +133,4 @@ Object.defineProperty(exports, 'isDynamicWaasEnabled', {
133
133
  return isDynamicWaasEnabled;
134
134
  }
135
135
  });
136
- //# sourceMappingURL=isDynamicWaasEnabled-D9M2mzUG.cjs.map
136
+ //# sourceMappingURL=isDynamicWaasEnabled-CMccs1-6.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"isDynamicWaasEnabled-D9M2mzUG.cjs","names":["BaseError","BaseError","getDefaultClient","EmbeddedWalletVersionEnum"],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts","../src/errors/NotWaasWalletAccountError.ts","../src/errors/TransactionBroadcastError.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 { BaseError } from './base';\n\n/**\n * Error codes that identify why a v3 WaaS transaction broadcast was rejected.\n *\n * @example 'BROADCAST_REJECTED'\n * @see transactionBroadcastErrorMapper\n * @see broadcastWaasTransaction\n */\nexport type TransactionBroadcastErrorCode =\n | 'BROADCAST_IDEMPOTENCY_CONFLICT'\n | 'BROADCAST_OUTCOME_UNKNOWN'\n | 'BROADCAST_RATE_LIMITED'\n | 'BROADCAST_REJECTED'\n | 'BROADCAST_REQUIRES_RESIGN'\n | 'BROADCAST_WALLET_INELIGIBLE'\n | 'INVALID_SIGNED_TRANSACTION'\n | 'NETWORK_NOT_ENABLED'\n | 'SIGNED_TRANSACTION_WALLET_MISMATCH'\n | 'UNSUPPORTED_WAAS_CHAIN';\n\n/**\n * States describing whether the signed transaction reached the chain.\n *\n * @example 'not_submitted'\n * @see TransactionBroadcastError\n * @see broadcastWaasTransaction\n */\nexport type TransactionBroadcastSubmissionState =\n | 'not_submitted'\n | 'requires_resign'\n | 'unknown';\n\ntype TransactionBroadcastErrorParams = {\n attempts: number;\n broadcastId: string;\n cause: Error;\n code: TransactionBroadcastErrorCode;\n message: string;\n retryable: boolean;\n submissionState: TransactionBroadcastSubmissionState;\n transactionId?: string;\n};\n\n/**\n * Error raised when Redcoast fails to submit a v3 WaaS transaction after the SDK signed it.\n *\n * @example new TransactionBroadcastError({ attempts: 1, broadcastId: 'broadcast-id', cause, code: 'BROADCAST_REJECTED', message: 'rejected', retryable: false, submissionState: 'not_submitted', transactionId: undefined })\n * @see transactionBroadcastErrorMapper\n * @see broadcastWaasTransaction\n */\nexport class TransactionBroadcastError extends BaseError {\n attempts: number;\n broadcastId: string;\n retryable: boolean;\n submissionState: TransactionBroadcastSubmissionState;\n transactionId: string | undefined;\n\n constructor({\n attempts,\n broadcastId,\n cause,\n code,\n message,\n retryable,\n submissionState,\n transactionId,\n }: TransactionBroadcastErrorParams) {\n super({\n cause,\n code,\n docsUrl: null,\n name: 'TransactionBroadcastError',\n shortMessage: message,\n });\n\n this.attempts = attempts;\n this.broadcastId = broadcastId;\n this.retryable = retryable;\n this.submissionState = submissionState;\n this.transactionId = transactionId;\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()): boolean => {\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;;;;;;;;;;;;;ACqCN,IAAa,4BAAb,cAA+CC,+CAAU;CACvD;CACA;CACA;CACA;CACA;CAEA,YAAY,EACV,UACA,aACA,OACA,MACA,SACA,WACA,iBACA,iBACkC;AAClC,QAAM;GACJ;GACA;GACA,SAAS;GACT,MAAM;GACN,cAAc;GACf,CAAC;AAEF,OAAK,WAAW;AAChB,OAAK,cAAc;AACnB,OAAK,YAAY;AACjB,OAAK,kBAAkB;AACvB,OAAK,gBAAgB;;;;;;;;;;;;;;;;ACjEzB,MAAa,wBAAwB,SAASC,uDAAkB,KAAc;CAC5E,MAAM,kBAAkB,OAAO;AAE/B,oDAAc,iBAAiB,qCAAqC;AAQpE,QAN+B,gBAAgB,IAAI,iBAGzB,yBACxBC,qDAA0B"}
1
+ {"version":3,"file":"isDynamicWaasEnabled-CMccs1-6.cjs","names":["BaseError","BaseError","getDefaultClient","EmbeddedWalletVersionEnum"],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts","../src/errors/NotWaasWalletAccountError.ts","../src/errors/TransactionBroadcastError.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 { BaseError } from './base';\n\n/**\n * Error codes that identify why a v3 WaaS transaction broadcast was rejected.\n *\n * @example 'BROADCAST_REJECTED'\n * @see transactionBroadcastErrorMapper\n * @see broadcastWaasTransaction\n */\nexport type TransactionBroadcastErrorCode =\n | 'BROADCAST_IDEMPOTENCY_CONFLICT'\n | 'BROADCAST_OUTCOME_UNKNOWN'\n | 'BROADCAST_RATE_LIMITED'\n | 'BROADCAST_REJECTED'\n | 'BROADCAST_REQUIRES_RESIGN'\n | 'BROADCAST_WALLET_INELIGIBLE'\n | 'INVALID_SIGNED_TRANSACTION'\n | 'NETWORK_NOT_ENABLED'\n | 'SIGNED_TRANSACTION_WALLET_MISMATCH'\n | 'UNSUPPORTED_WAAS_CHAIN';\n\n/**\n * States describing whether the signed transaction reached the chain.\n *\n * @example 'not_submitted'\n * @see TransactionBroadcastError\n * @see broadcastWaasTransaction\n */\nexport type TransactionBroadcastSubmissionState =\n | 'not_submitted'\n | 'requires_resign'\n | 'unknown';\n\ntype TransactionBroadcastErrorParams = {\n attempts: number;\n broadcastId: string;\n cause: Error;\n code: TransactionBroadcastErrorCode;\n message: string;\n retryable: boolean;\n submissionState: TransactionBroadcastSubmissionState;\n transactionId?: string;\n};\n\n/**\n * Error raised when Redcoast fails to submit a v3 WaaS transaction after the SDK signed it.\n *\n * @example new TransactionBroadcastError({ attempts: 1, broadcastId: 'broadcast-id', cause, code: 'BROADCAST_REJECTED', message: 'rejected', retryable: false, submissionState: 'not_submitted', transactionId: undefined })\n * @see transactionBroadcastErrorMapper\n * @see broadcastWaasTransaction\n */\nexport class TransactionBroadcastError extends BaseError {\n attempts: number;\n broadcastId: string;\n retryable: boolean;\n submissionState: TransactionBroadcastSubmissionState;\n transactionId: string | undefined;\n\n constructor({\n attempts,\n broadcastId,\n cause,\n code,\n message,\n retryable,\n submissionState,\n transactionId,\n }: TransactionBroadcastErrorParams) {\n super({\n cause,\n code,\n docsUrl: null,\n name: 'TransactionBroadcastError',\n shortMessage: message,\n });\n\n this.attempts = attempts;\n this.broadcastId = broadcastId;\n this.retryable = retryable;\n this.submissionState = submissionState;\n this.transactionId = transactionId;\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()): boolean => {\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;;;;;;;;;;;;;ACqCN,IAAa,4BAAb,cAA+CC,+CAAU;CACvD;CACA;CACA;CACA;CACA;CAEA,YAAY,EACV,UACA,aACA,OACA,MACA,SACA,WACA,iBACA,iBACkC;AAClC,QAAM;GACJ;GACA;GACA,SAAS;GACT,MAAM;GACN,cAAc;GACf,CAAC;AAEF,OAAK,WAAW;AAChB,OAAK,cAAc;AACnB,OAAK,YAAY;AACjB,OAAK,kBAAkB;AACvB,OAAK,gBAAgB;;;;;;;;;;;;;;;;ACjEzB,MAAa,wBAAwB,SAASC,uDAAkB,KAAc;CAC5E,MAAM,kBAAkB,OAAO;AAE/B,oDAAc,iBAAiB,qCAAqC;AAQpE,QAN+B,gBAAgB,IAAI,iBAGzB,yBACxBC,qDAA0B"}
@@ -1,4 +1,4 @@
1
- import { H as createApiClient, St as getCore, ft as assertDefined, h as instrumentFunction, t as updateAuthFromVerifyResponse, vt as getDefaultClient, xt as BaseError } from "./updateAuthFromVerifyResponse-BS6kZrDc.native.esm.js";
1
+ import { H as createApiClient, St as getCore, ft as assertDefined, h as instrumentFunction, t as updateAuthFromVerifyResponse, vt as getDefaultClient, xt as BaseError } from "./updateAuthFromVerifyResponse-CTvWpZLa.native.esm.js";
2
2
  import { EmbeddedWalletVersionEnum } from "@dynamic-labs/sdk-api-core";
3
3
 
4
4
  //#region src/modules/user/refreshAuth/refreshAuth.ts
@@ -110,4 +110,4 @@ const isDynamicWaasEnabled = (client = getDefaultClient()) => {
110
110
 
111
111
  //#endregion
112
112
  export { __refreshAuth_wrapped as i, TransactionBroadcastError as n, NotWaasWalletAccountError as r, isDynamicWaasEnabled as t };
113
- //# sourceMappingURL=isDynamicWaasEnabled-2tu-Lzb_.native.esm.js.map
113
+ //# sourceMappingURL=isDynamicWaasEnabled-DSqgpEcX.native.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isDynamicWaasEnabled-2tu-Lzb_.native.esm.js","names":[],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts","../src/errors/NotWaasWalletAccountError.ts","../src/errors/TransactionBroadcastError.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 { BaseError } from './base';\n\n/**\n * Error codes that identify why a v3 WaaS transaction broadcast was rejected.\n *\n * @example 'BROADCAST_REJECTED'\n * @see transactionBroadcastErrorMapper\n * @see broadcastWaasTransaction\n */\nexport type TransactionBroadcastErrorCode =\n | 'BROADCAST_IDEMPOTENCY_CONFLICT'\n | 'BROADCAST_OUTCOME_UNKNOWN'\n | 'BROADCAST_RATE_LIMITED'\n | 'BROADCAST_REJECTED'\n | 'BROADCAST_REQUIRES_RESIGN'\n | 'BROADCAST_WALLET_INELIGIBLE'\n | 'INVALID_SIGNED_TRANSACTION'\n | 'NETWORK_NOT_ENABLED'\n | 'SIGNED_TRANSACTION_WALLET_MISMATCH'\n | 'UNSUPPORTED_WAAS_CHAIN';\n\n/**\n * States describing whether the signed transaction reached the chain.\n *\n * @example 'not_submitted'\n * @see TransactionBroadcastError\n * @see broadcastWaasTransaction\n */\nexport type TransactionBroadcastSubmissionState =\n | 'not_submitted'\n | 'requires_resign'\n | 'unknown';\n\ntype TransactionBroadcastErrorParams = {\n attempts: number;\n broadcastId: string;\n cause: Error;\n code: TransactionBroadcastErrorCode;\n message: string;\n retryable: boolean;\n submissionState: TransactionBroadcastSubmissionState;\n transactionId?: string;\n};\n\n/**\n * Error raised when Redcoast fails to submit a v3 WaaS transaction after the SDK signed it.\n *\n * @example new TransactionBroadcastError({ attempts: 1, broadcastId: 'broadcast-id', cause, code: 'BROADCAST_REJECTED', message: 'rejected', retryable: false, submissionState: 'not_submitted', transactionId: undefined })\n * @see transactionBroadcastErrorMapper\n * @see broadcastWaasTransaction\n */\nexport class TransactionBroadcastError extends BaseError {\n attempts: number;\n broadcastId: string;\n retryable: boolean;\n submissionState: TransactionBroadcastSubmissionState;\n transactionId: string | undefined;\n\n constructor({\n attempts,\n broadcastId,\n cause,\n code,\n message,\n retryable,\n submissionState,\n transactionId,\n }: TransactionBroadcastErrorParams) {\n super({\n cause,\n code,\n docsUrl: null,\n name: 'TransactionBroadcastError',\n shortMessage: message,\n });\n\n this.attempts = attempts;\n this.broadcastId = broadcastId;\n this.retryable = retryable;\n this.submissionState = submissionState;\n this.transactionId = transactionId;\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()): boolean => {\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;;;;;;;;;;;;;ACqCN,IAAa,4BAAb,cAA+C,UAAU;CACvD;CACA;CACA;CACA;CACA;CAEA,YAAY,EACV,UACA,aACA,OACA,MACA,SACA,WACA,iBACA,iBACkC;AAClC,QAAM;GACJ;GACA;GACA,SAAS;GACT,MAAM;GACN,cAAc;GACf,CAAC;AAEF,OAAK,WAAW;AAChB,OAAK,cAAc;AACnB,OAAK,YAAY;AACjB,OAAK,kBAAkB;AACvB,OAAK,gBAAgB;;;;;;;;;;;;;;;;ACjEzB,MAAa,wBAAwB,SAAS,kBAAkB,KAAc;CAC5E,MAAM,kBAAkB,OAAO;AAE/B,eAAc,iBAAiB,qCAAqC;AAQpE,QAN+B,gBAAgB,IAAI,iBAGzB,yBACxB,0BAA0B"}
1
+ {"version":3,"file":"isDynamicWaasEnabled-DSqgpEcX.native.esm.js","names":[],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts","../src/errors/NotWaasWalletAccountError.ts","../src/errors/TransactionBroadcastError.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 { BaseError } from './base';\n\n/**\n * Error codes that identify why a v3 WaaS transaction broadcast was rejected.\n *\n * @example 'BROADCAST_REJECTED'\n * @see transactionBroadcastErrorMapper\n * @see broadcastWaasTransaction\n */\nexport type TransactionBroadcastErrorCode =\n | 'BROADCAST_IDEMPOTENCY_CONFLICT'\n | 'BROADCAST_OUTCOME_UNKNOWN'\n | 'BROADCAST_RATE_LIMITED'\n | 'BROADCAST_REJECTED'\n | 'BROADCAST_REQUIRES_RESIGN'\n | 'BROADCAST_WALLET_INELIGIBLE'\n | 'INVALID_SIGNED_TRANSACTION'\n | 'NETWORK_NOT_ENABLED'\n | 'SIGNED_TRANSACTION_WALLET_MISMATCH'\n | 'UNSUPPORTED_WAAS_CHAIN';\n\n/**\n * States describing whether the signed transaction reached the chain.\n *\n * @example 'not_submitted'\n * @see TransactionBroadcastError\n * @see broadcastWaasTransaction\n */\nexport type TransactionBroadcastSubmissionState =\n | 'not_submitted'\n | 'requires_resign'\n | 'unknown';\n\ntype TransactionBroadcastErrorParams = {\n attempts: number;\n broadcastId: string;\n cause: Error;\n code: TransactionBroadcastErrorCode;\n message: string;\n retryable: boolean;\n submissionState: TransactionBroadcastSubmissionState;\n transactionId?: string;\n};\n\n/**\n * Error raised when Redcoast fails to submit a v3 WaaS transaction after the SDK signed it.\n *\n * @example new TransactionBroadcastError({ attempts: 1, broadcastId: 'broadcast-id', cause, code: 'BROADCAST_REJECTED', message: 'rejected', retryable: false, submissionState: 'not_submitted', transactionId: undefined })\n * @see transactionBroadcastErrorMapper\n * @see broadcastWaasTransaction\n */\nexport class TransactionBroadcastError extends BaseError {\n attempts: number;\n broadcastId: string;\n retryable: boolean;\n submissionState: TransactionBroadcastSubmissionState;\n transactionId: string | undefined;\n\n constructor({\n attempts,\n broadcastId,\n cause,\n code,\n message,\n retryable,\n submissionState,\n transactionId,\n }: TransactionBroadcastErrorParams) {\n super({\n cause,\n code,\n docsUrl: null,\n name: 'TransactionBroadcastError',\n shortMessage: message,\n });\n\n this.attempts = attempts;\n this.broadcastId = broadcastId;\n this.retryable = retryable;\n this.submissionState = submissionState;\n this.transactionId = transactionId;\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()): boolean => {\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;;;;;;;;;;;;;ACqCN,IAAa,4BAAb,cAA+C,UAAU;CACvD;CACA;CACA;CACA;CACA;CAEA,YAAY,EACV,UACA,aACA,OACA,MACA,SACA,WACA,iBACA,iBACkC;AAClC,QAAM;GACJ;GACA;GACA,SAAS;GACT,MAAM;GACN,cAAc;GACf,CAAC;AAEF,OAAK,WAAW;AAChB,OAAK,cAAc;AACnB,OAAK,YAAY;AACjB,OAAK,kBAAkB;AACvB,OAAK,gBAAgB;;;;;;;;;;;;;;;;ACjEzB,MAAa,wBAAwB,SAAS,kBAAkB,KAAc;CAC5E,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, St as getCore, ft as assertDefined, g as instrumentFunction, t as updateAuthFromVerifyResponse, vt as getDefaultClient, xt as BaseError } from "./updateAuthFromVerifyResponse-CjuwqNKr.esm.js";
1
+ import { K as createApiClient, St as getCore, ft as assertDefined, g as instrumentFunction, t as updateAuthFromVerifyResponse, vt as getDefaultClient, xt as BaseError } from "./updateAuthFromVerifyResponse-BLgNMqwN.esm.js";
2
2
  import { EmbeddedWalletVersionEnum } from "@dynamic-labs/sdk-api-core";
3
3
 
4
4
  //#region src/modules/user/refreshAuth/refreshAuth.ts
@@ -110,4 +110,4 @@ const isDynamicWaasEnabled = (client = getDefaultClient()) => {
110
110
 
111
111
  //#endregion
112
112
  export { __refreshAuth_wrapped as i, TransactionBroadcastError as n, NotWaasWalletAccountError as r, isDynamicWaasEnabled as t };
113
- //# sourceMappingURL=isDynamicWaasEnabled-Cc53N1hb.esm.js.map
113
+ //# sourceMappingURL=isDynamicWaasEnabled-DYORq7Jc.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isDynamicWaasEnabled-Cc53N1hb.esm.js","names":[],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts","../src/errors/NotWaasWalletAccountError.ts","../src/errors/TransactionBroadcastError.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 { BaseError } from './base';\n\n/**\n * Error codes that identify why a v3 WaaS transaction broadcast was rejected.\n *\n * @example 'BROADCAST_REJECTED'\n * @see transactionBroadcastErrorMapper\n * @see broadcastWaasTransaction\n */\nexport type TransactionBroadcastErrorCode =\n | 'BROADCAST_IDEMPOTENCY_CONFLICT'\n | 'BROADCAST_OUTCOME_UNKNOWN'\n | 'BROADCAST_RATE_LIMITED'\n | 'BROADCAST_REJECTED'\n | 'BROADCAST_REQUIRES_RESIGN'\n | 'BROADCAST_WALLET_INELIGIBLE'\n | 'INVALID_SIGNED_TRANSACTION'\n | 'NETWORK_NOT_ENABLED'\n | 'SIGNED_TRANSACTION_WALLET_MISMATCH'\n | 'UNSUPPORTED_WAAS_CHAIN';\n\n/**\n * States describing whether the signed transaction reached the chain.\n *\n * @example 'not_submitted'\n * @see TransactionBroadcastError\n * @see broadcastWaasTransaction\n */\nexport type TransactionBroadcastSubmissionState =\n | 'not_submitted'\n | 'requires_resign'\n | 'unknown';\n\ntype TransactionBroadcastErrorParams = {\n attempts: number;\n broadcastId: string;\n cause: Error;\n code: TransactionBroadcastErrorCode;\n message: string;\n retryable: boolean;\n submissionState: TransactionBroadcastSubmissionState;\n transactionId?: string;\n};\n\n/**\n * Error raised when Redcoast fails to submit a v3 WaaS transaction after the SDK signed it.\n *\n * @example new TransactionBroadcastError({ attempts: 1, broadcastId: 'broadcast-id', cause, code: 'BROADCAST_REJECTED', message: 'rejected', retryable: false, submissionState: 'not_submitted', transactionId: undefined })\n * @see transactionBroadcastErrorMapper\n * @see broadcastWaasTransaction\n */\nexport class TransactionBroadcastError extends BaseError {\n attempts: number;\n broadcastId: string;\n retryable: boolean;\n submissionState: TransactionBroadcastSubmissionState;\n transactionId: string | undefined;\n\n constructor({\n attempts,\n broadcastId,\n cause,\n code,\n message,\n retryable,\n submissionState,\n transactionId,\n }: TransactionBroadcastErrorParams) {\n super({\n cause,\n code,\n docsUrl: null,\n name: 'TransactionBroadcastError',\n shortMessage: message,\n });\n\n this.attempts = attempts;\n this.broadcastId = broadcastId;\n this.retryable = retryable;\n this.submissionState = submissionState;\n this.transactionId = transactionId;\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()): boolean => {\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;;;;;;;;;;;;;ACqCN,IAAa,4BAAb,cAA+C,UAAU;CACvD;CACA;CACA;CACA;CACA;CAEA,YAAY,EACV,UACA,aACA,OACA,MACA,SACA,WACA,iBACA,iBACkC;AAClC,QAAM;GACJ;GACA;GACA,SAAS;GACT,MAAM;GACN,cAAc;GACf,CAAC;AAEF,OAAK,WAAW;AAChB,OAAK,cAAc;AACnB,OAAK,YAAY;AACjB,OAAK,kBAAkB;AACvB,OAAK,gBAAgB;;;;;;;;;;;;;;;;ACjEzB,MAAa,wBAAwB,SAAS,kBAAkB,KAAc;CAC5E,MAAM,kBAAkB,OAAO;AAE/B,eAAc,iBAAiB,qCAAqC;AAQpE,QAN+B,gBAAgB,IAAI,iBAGzB,yBACxB,0BAA0B"}
1
+ {"version":3,"file":"isDynamicWaasEnabled-DYORq7Jc.esm.js","names":[],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts","../src/errors/NotWaasWalletAccountError.ts","../src/errors/TransactionBroadcastError.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 { BaseError } from './base';\n\n/**\n * Error codes that identify why a v3 WaaS transaction broadcast was rejected.\n *\n * @example 'BROADCAST_REJECTED'\n * @see transactionBroadcastErrorMapper\n * @see broadcastWaasTransaction\n */\nexport type TransactionBroadcastErrorCode =\n | 'BROADCAST_IDEMPOTENCY_CONFLICT'\n | 'BROADCAST_OUTCOME_UNKNOWN'\n | 'BROADCAST_RATE_LIMITED'\n | 'BROADCAST_REJECTED'\n | 'BROADCAST_REQUIRES_RESIGN'\n | 'BROADCAST_WALLET_INELIGIBLE'\n | 'INVALID_SIGNED_TRANSACTION'\n | 'NETWORK_NOT_ENABLED'\n | 'SIGNED_TRANSACTION_WALLET_MISMATCH'\n | 'UNSUPPORTED_WAAS_CHAIN';\n\n/**\n * States describing whether the signed transaction reached the chain.\n *\n * @example 'not_submitted'\n * @see TransactionBroadcastError\n * @see broadcastWaasTransaction\n */\nexport type TransactionBroadcastSubmissionState =\n | 'not_submitted'\n | 'requires_resign'\n | 'unknown';\n\ntype TransactionBroadcastErrorParams = {\n attempts: number;\n broadcastId: string;\n cause: Error;\n code: TransactionBroadcastErrorCode;\n message: string;\n retryable: boolean;\n submissionState: TransactionBroadcastSubmissionState;\n transactionId?: string;\n};\n\n/**\n * Error raised when Redcoast fails to submit a v3 WaaS transaction after the SDK signed it.\n *\n * @example new TransactionBroadcastError({ attempts: 1, broadcastId: 'broadcast-id', cause, code: 'BROADCAST_REJECTED', message: 'rejected', retryable: false, submissionState: 'not_submitted', transactionId: undefined })\n * @see transactionBroadcastErrorMapper\n * @see broadcastWaasTransaction\n */\nexport class TransactionBroadcastError extends BaseError {\n attempts: number;\n broadcastId: string;\n retryable: boolean;\n submissionState: TransactionBroadcastSubmissionState;\n transactionId: string | undefined;\n\n constructor({\n attempts,\n broadcastId,\n cause,\n code,\n message,\n retryable,\n submissionState,\n transactionId,\n }: TransactionBroadcastErrorParams) {\n super({\n cause,\n code,\n docsUrl: null,\n name: 'TransactionBroadcastError',\n shortMessage: message,\n });\n\n this.attempts = attempts;\n this.broadcastId = broadcastId;\n this.retryable = retryable;\n this.submissionState = submissionState;\n this.transactionId = transactionId;\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()): boolean => {\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;;;;;;;;;;;;;ACqCN,IAAa,4BAAb,cAA+C,UAAU;CACvD;CACA;CACA;CACA;CACA;CAEA,YAAY,EACV,UACA,aACA,OACA,MACA,SACA,WACA,iBACA,iBACkC;AAClC,QAAM;GACJ;GACA;GACA,SAAS;GACT,MAAM;GACN,cAAc;GACf,CAAC;AAEF,OAAK,WAAW;AAChB,OAAK,cAAc;AACnB,OAAK,YAAY;AACjB,OAAK,kBAAkB;AACvB,OAAK,gBAAgB;;;;;;;;;;;;;;;;ACjEzB,MAAa,wBAAwB,SAAS,kBAAkB,KAAc;CAC5E,MAAM,kBAAkB,OAAO;AAE/B,eAAc,iBAAiB,qCAAqC;AAQpE,QAN+B,gBAAgB,IAAI,iBAGzB,yBACxB,0BAA0B"}
@@ -1,4 +1,4 @@
1
- import { H as createApiClient, St as getCore, ft as assertDefined, h as instrumentFunction, vt as getDefaultClient, xt as BaseError } from "./updateAuthFromVerifyResponse-BS6kZrDc.native.esm.js";
1
+ import { H as createApiClient, St as getCore, ft as assertDefined, h as instrumentFunction, vt as getDefaultClient, xt as BaseError } from "./updateAuthFromVerifyResponse-CTvWpZLa.native.esm.js";
2
2
 
3
3
  //#region src/errors/NativeModuleNotLinkedError.ts
4
4
  var NativeModuleNotLinkedError = class extends BaseError {
@@ -103,4 +103,4 @@ const isMfaRequiredForAction = async ({ mfaAction }, client = getDefaultClient()
103
103
 
104
104
  //#endregion
105
105
  export { NativeModuleNotLinkedError as i, getMfaMethods as n, __consumeMfaToken_wrapped as r, isMfaRequiredForAction as t };
106
- //# sourceMappingURL=isMfaRequiredForAction-CX_Wf5YW.native.esm.js.map
106
+ //# sourceMappingURL=isMfaRequiredForAction-BcJvy7Gw.native.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isMfaRequiredForAction-CX_Wf5YW.native.esm.js","names":[],"sources":["../src/errors/NativeModuleNotLinkedError.ts","../src/modules/mfa/consumeMfaToken/consumeMfaToken.ts","../src/modules/mfa/getMfaMethods/getMfaMethods.ts","../src/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.ts"],"sourcesContent":["import { BaseError } from './base';\n\ntype NativeModuleNotLinkedErrorParams = {\n moduleName: string;\n};\n\nexport class NativeModuleNotLinkedError extends BaseError {\n constructor({ moduleName }: NativeModuleNotLinkedErrorParams) {\n super({\n cause: null,\n code: 'native_module_not_linked_error',\n details: [\n `The \"${moduleName}\" TurboModule is not registered with React Native.`,\n 'This usually means the native module was not autolinked into the host app,',\n 'or the app binary was not rebuilt after installing the SDK.',\n '',\n 'To resolve:',\n ' 1. Ensure \"@dynamic-labs-sdk/client\" is a direct dependency of the app',\n ' and reinstall (e.g. `pnpm install`).',\n ' 2. Rebuild the native app:',\n ' iOS: `cd ios && pod install && cd .. && npx react-native run-ios`',\n ' Android: `npx react-native run-android`',\n ' Expo: `npx expo prebuild --clean` then run the app.',\n ' 3. Confirm autolinking sees the package:',\n ' `npx expo-modules-autolinking react-native-config --json`',\n ].join('\\n'),\n docsUrl: null,\n name: 'NativeModuleNotLinkedError',\n shortMessage: `Native TurboModule \"${moduleName}\" is not linked.`,\n });\n }\n}\n","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()): string => {\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 type { MFAMethodsResponse } from '@dynamic-labs/sdk-api-core';\n\nimport { 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 (\n client = getDefaultClient()\n): Promise<MFAMethodsResponse> => {\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): Promise<boolean> => {\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":";;;AAMA,IAAa,6BAAb,cAAgD,UAAU;CACxD,YAAY,EAAE,cAAgD;AAC5D,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;IACP,QAAQ,WAAW;IACnB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD,CAAC,KAAK,KAAK;GACZ,SAAS;GACT,MAAM;GACN,cAAc,uBAAuB,WAAW;GACjD,CAAC;;;;;;;;;;;;;;;;;ACXN,MAAE,mBAAsB,SAAU,kBAAU,KAAA;;;AAK1C,eAAY,UAAI,qBAAA;kBAGhB,UAAO,MACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACXD,MAAa,gBAAgB,OAC3B,SAAS,kBAAkB,KACK;CAChC,MAAM,OAAO,QAAQ,OAAO;AAQ5B,QALuB,MAFL,gBAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;;ACLJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAAS,kBAAkB,KACN;CACrB,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
+ {"version":3,"file":"isMfaRequiredForAction-BcJvy7Gw.native.esm.js","names":[],"sources":["../src/errors/NativeModuleNotLinkedError.ts","../src/modules/mfa/consumeMfaToken/consumeMfaToken.ts","../src/modules/mfa/getMfaMethods/getMfaMethods.ts","../src/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.ts"],"sourcesContent":["import { BaseError } from './base';\n\ntype NativeModuleNotLinkedErrorParams = {\n moduleName: string;\n};\n\nexport class NativeModuleNotLinkedError extends BaseError {\n constructor({ moduleName }: NativeModuleNotLinkedErrorParams) {\n super({\n cause: null,\n code: 'native_module_not_linked_error',\n details: [\n `The \"${moduleName}\" TurboModule is not registered with React Native.`,\n 'This usually means the native module was not autolinked into the host app,',\n 'or the app binary was not rebuilt after installing the SDK.',\n '',\n 'To resolve:',\n ' 1. Ensure \"@dynamic-labs-sdk/client\" is a direct dependency of the app',\n ' and reinstall (e.g. `pnpm install`).',\n ' 2. Rebuild the native app:',\n ' iOS: `cd ios && pod install && cd .. && npx react-native run-ios`',\n ' Android: `npx react-native run-android`',\n ' Expo: `npx expo prebuild --clean` then run the app.',\n ' 3. Confirm autolinking sees the package:',\n ' `npx expo-modules-autolinking react-native-config --json`',\n ].join('\\n'),\n docsUrl: null,\n name: 'NativeModuleNotLinkedError',\n shortMessage: `Native TurboModule \"${moduleName}\" is not linked.`,\n });\n }\n}\n","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()): string => {\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 type { MFAMethodsResponse } from '@dynamic-labs/sdk-api-core';\n\nimport { 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 (\n client = getDefaultClient()\n): Promise<MFAMethodsResponse> => {\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): Promise<boolean> => {\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":";;;AAMA,IAAa,6BAAb,cAAgD,UAAU;CACxD,YAAY,EAAE,cAAgD;AAC5D,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;IACP,QAAQ,WAAW;IACnB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD,CAAC,KAAK,KAAK;GACZ,SAAS;GACT,MAAM;GACN,cAAc,uBAAuB,WAAW;GACjD,CAAC;;;;;;;;;;;;;;;;;ACXN,MAAE,mBAAsB,SAAU,kBAAU,KAAA;;;AAK1C,eAAY,UAAI,qBAAA;kBAGhB,UAAO,MACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACXD,MAAa,gBAAgB,OAC3B,SAAS,kBAAkB,KACK;CAChC,MAAM,OAAO,QAAQ,OAAO;AAQ5B,QALuB,MAFL,gBAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;;ACLJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAAS,kBAAkB,KACN;CACrB,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,4 +1,4 @@
1
- import { K as createApiClient, St as getCore, ft as assertDefined, g as instrumentFunction, vt as getDefaultClient } from "./updateAuthFromVerifyResponse-CjuwqNKr.esm.js";
1
+ import { K as createApiClient, St as getCore, ft as assertDefined, g as instrumentFunction, vt as getDefaultClient } from "./updateAuthFromVerifyResponse-BLgNMqwN.esm.js";
2
2
 
3
3
  //#region src/modules/mfa/consumeMfaToken/consumeMfaToken.ts
4
4
  /**
@@ -74,4 +74,4 @@ const isMfaRequiredForAction = async ({ mfaAction }, client = getDefaultClient()
74
74
 
75
75
  //#endregion
76
76
  export { getMfaMethods as n, __consumeMfaToken_wrapped as r, isMfaRequiredForAction as t };
77
- //# sourceMappingURL=isMfaRequiredForAction-D8RXBJ05.esm.js.map
77
+ //# sourceMappingURL=isMfaRequiredForAction-CatS60F6.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isMfaRequiredForAction-D8RXBJ05.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()): string => {\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 type { MFAMethodsResponse } from '@dynamic-labs/sdk-api-core';\n\nimport { 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 (\n client = getDefaultClient()\n): Promise<MFAMethodsResponse> => {\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): Promise<boolean> => {\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;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACXD,MAAa,gBAAgB,OAC3B,SAAS,kBAAkB,KACK;CAChC,MAAM,OAAO,QAAQ,OAAO;AAQ5B,QALuB,MAFL,gBAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;;ACLJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAAS,kBAAkB,KACN;CACrB,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
+ {"version":3,"file":"isMfaRequiredForAction-CatS60F6.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()): string => {\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 type { MFAMethodsResponse } from '@dynamic-labs/sdk-api-core';\n\nimport { 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 (\n client = getDefaultClient()\n): Promise<MFAMethodsResponse> => {\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): Promise<boolean> => {\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;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACXD,MAAa,gBAAgB,OAC3B,SAAS,kBAAkB,KACK;CAChC,MAAM,OAAO,QAAQ,OAAO;AAQ5B,QALuB,MAFL,gBAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;;ACLJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAAS,kBAAkB,KACN;CACrB,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"}