@dynamic-labs-sdk/client 0.16.2 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/{InvalidParamError-BweYAZrY.cjs.js → InvalidParamError-BEdsjVbd.cjs.js} +8 -3
  2. package/dist/{InvalidParamError-BweYAZrY.cjs.js.map → InvalidParamError-BEdsjVbd.cjs.js.map} +1 -1
  3. package/dist/{InvalidParamError-DRf5Y5Aj.esm.js → InvalidParamError-BOaqPPZm.esm.js} +8 -3
  4. package/dist/{InvalidParamError-DRf5Y5Aj.esm.js.map → InvalidParamError-BOaqPPZm.esm.js.map} +1 -1
  5. package/dist/{NotWaasWalletAccountError-Cf966VSY.cjs.js → NotWaasWalletAccountError-BKKGLJ42.cjs.js} +3 -3
  6. package/dist/{NotWaasWalletAccountError-Cf966VSY.cjs.js.map → NotWaasWalletAccountError-BKKGLJ42.cjs.js.map} +1 -1
  7. package/dist/{NotWaasWalletAccountError-D_AuJFHM.esm.js → NotWaasWalletAccountError-ufVXCrE-.esm.js} +3 -3
  8. package/dist/{NotWaasWalletAccountError-D_AuJFHM.esm.js.map → NotWaasWalletAccountError-ufVXCrE-.esm.js.map} +1 -1
  9. package/dist/core.cjs.js +5 -5
  10. package/dist/core.esm.js +5 -5
  11. package/dist/errors/InvalidRealtimePublishError.d.ts +9 -0
  12. package/dist/errors/InvalidRealtimePublishError.d.ts.map +1 -0
  13. package/dist/errors/RealtimeNotConnectedError.d.ts +5 -0
  14. package/dist/errors/RealtimeNotConnectedError.d.ts.map +1 -0
  15. package/dist/exports/index.d.ts +3 -2
  16. package/dist/exports/index.d.ts.map +1 -1
  17. package/dist/{getNetworkProviderFromNetworkId-PYVbXW2g.esm.js → getNetworkProviderFromNetworkId-DVN5JSY7.esm.js} +3 -3
  18. package/dist/{getNetworkProviderFromNetworkId-PYVbXW2g.esm.js.map → getNetworkProviderFromNetworkId-DVN5JSY7.esm.js.map} +1 -1
  19. package/dist/{getNetworkProviderFromNetworkId-D1oubSr_.cjs.js → getNetworkProviderFromNetworkId-DrcEb1cG.cjs.js} +3 -3
  20. package/dist/{getNetworkProviderFromNetworkId-D1oubSr_.cjs.js.map → getNetworkProviderFromNetworkId-DrcEb1cG.cjs.js.map} +1 -1
  21. package/dist/{getSignedSessionId-CA2ARcr3.esm.js → getSignedSessionId-7rWCtIKo.esm.js} +3 -3
  22. package/dist/{getSignedSessionId-CA2ARcr3.esm.js.map → getSignedSessionId-7rWCtIKo.esm.js.map} +1 -1
  23. package/dist/{getSignedSessionId-DrTDCzhj.cjs.js → getSignedSessionId-Be6w7Iq4.cjs.js} +3 -3
  24. package/dist/{getSignedSessionId-DrTDCzhj.cjs.js.map → getSignedSessionId-Be6w7Iq4.cjs.js.map} +1 -1
  25. package/dist/{getVerifiedCredentialForWalletAccount-CnEQvQrG.cjs.js → getVerifiedCredentialForWalletAccount-COqb-7N_.cjs.js} +2 -2
  26. package/dist/{getVerifiedCredentialForWalletAccount-CnEQvQrG.cjs.js.map → getVerifiedCredentialForWalletAccount-COqb-7N_.cjs.js.map} +1 -1
  27. package/dist/{getVerifiedCredentialForWalletAccount-Cc7DjHds.esm.js → getVerifiedCredentialForWalletAccount-CwP354ZX.esm.js} +2 -2
  28. package/dist/{getVerifiedCredentialForWalletAccount-Cc7DjHds.esm.js.map → getVerifiedCredentialForWalletAccount-CwP354ZX.esm.js.map} +1 -1
  29. package/dist/index.cjs.js +42 -13
  30. package/dist/index.cjs.js.map +1 -1
  31. package/dist/index.esm.js +42 -14
  32. package/dist/index.esm.js.map +1 -1
  33. package/dist/{isMfaRequiredForAction-Buji2Pg6.esm.js → isMfaRequiredForAction-C0ZXRkHC.esm.js} +2 -2
  34. package/dist/{isMfaRequiredForAction-Buji2Pg6.esm.js.map → isMfaRequiredForAction-C0ZXRkHC.esm.js.map} +1 -1
  35. package/dist/{isMfaRequiredForAction-LvTNM74t.cjs.js → isMfaRequiredForAction-DNP71xZ7.cjs.js} +2 -2
  36. package/dist/{isMfaRequiredForAction-LvTNM74t.cjs.js.map → isMfaRequiredForAction-DNP71xZ7.cjs.js.map} +1 -1
  37. package/dist/modules/balances/getBalances/getBalances.d.ts +35 -0
  38. package/dist/modules/balances/getBalances/getBalances.d.ts.map +1 -0
  39. package/dist/modules/balances/getBalances/index.d.ts +3 -0
  40. package/dist/modules/balances/getBalances/index.d.ts.map +1 -0
  41. package/dist/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.d.ts +5 -3
  42. package/dist/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.d.ts.map +1 -1
  43. package/dist/modules/wallets/constants.d.ts.map +1 -1
  44. package/dist/services/realtime/createRealtimeChannelSchema/createRealtimeChannelSchema.d.ts +13 -0
  45. package/dist/services/realtime/createRealtimeChannelSchema/createRealtimeChannelSchema.d.ts.map +1 -0
  46. package/dist/services/realtime/createRealtimeChannelSchema/index.d.ts +2 -0
  47. package/dist/services/realtime/createRealtimeChannelSchema/index.d.ts.map +1 -0
  48. package/dist/services/realtime/index.d.ts +2 -0
  49. package/dist/services/realtime/index.d.ts.map +1 -0
  50. package/dist/services/realtime/realtime.types.d.ts +63 -0
  51. package/dist/services/realtime/realtime.types.d.ts.map +1 -0
  52. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  53. package/dist/waas.cjs.js +3 -3
  54. package/dist/waas.esm.js +3 -3
  55. package/dist/waasCore.cjs.js +3 -3
  56. package/dist/waasCore.esm.js +3 -3
  57. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import { O as assertDefined, P as getDefaultClient, R as getCore, u as createApiClient } from "./InvalidParamError-DRf5Y5Aj.esm.js";
1
+ import { O as assertDefined, P as getDefaultClient, R as getCore, u as createApiClient } from "./InvalidParamError-BOaqPPZm.esm.js";
2
2
 
3
3
  //#region src/modules/mfa/consumeMfaToken/consumeMfaToken.ts
4
4
  /**
@@ -59,4 +59,4 @@ const isMfaRequiredForAction = async ({ mfaAction }, client = getDefaultClient()
59
59
 
60
60
  //#endregion
61
61
  export { getMfaMethods as n, consumeMfaToken as r, isMfaRequiredForAction as t };
62
- //# sourceMappingURL=isMfaRequiredForAction-Buji2Pg6.esm.js.map
62
+ //# sourceMappingURL=isMfaRequiredForAction-C0ZXRkHC.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isMfaRequiredForAction-Buji2Pg6.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 */\nexport const consumeMfaToken = (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const mfaToken = core.state.get().mfaToken;\n\n assertDefined(mfaToken, 'No MFA token found');\n\n core.state.set({\n mfaToken: null,\n });\n\n return mfaToken;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\n\n/**\n * Retrieves the available MFA methods for the current user.\n *\n * This function fetches information about which multi-factor authentication\n * methods are available and configured for the user's account.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the user's MFA methods configuration.\n */\nexport const getMfaMethods = async (client = getDefaultClient()) => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const userMfaMethods = await apiClient.getUserMfaMethods({\n environmentId: core.environmentId,\n verifiedOnly: true,\n });\n\n return userMfaMethods;\n};\n","import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { getMfaMethods } from '../getMfaMethods';\n\ntype IsMfaRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/**\n * Checks if MFA is required for a specific action.\n *\n * This function determines whether multi-factor authentication is required\n * for the specified action based on project settings and user configuration.\n *\n * @param params.mfaAction - The action to check MFA requirements for.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to true if MFA is required for the action, false otherwise.\n */\nexport const isMfaRequiredForAction = async (\n { mfaAction }: IsMfaRequiredForActionParams,\n client = getDefaultClient()\n) => {\n const projectSettings = client.projectSettings;\n\n const isRequiredForAction = projectSettings?.security?.mfa?.actions?.some(\n (action) => action.action === mfaAction && action.required\n );\n\n // if mfa is not required for the action, return false\n // no matter if general mfa is set to required or not\n if (!isRequiredForAction) {\n return false;\n }\n\n const isMfaMethodRequired = projectSettings?.security?.mfa?.required;\n\n // if mfa is required for the action and also set as required in general, return true\n if (isMfaMethodRequired) {\n return true;\n }\n\n const mfaMethods = await getMfaMethods(client);\n // if general mfa is optional, but user has registered methods,\n // then it should be required for the action\n return mfaMethods.userHasVerifiedMfaMethods;\n};\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,mBAAmB,SAAS,kBAAkB,KAAK;CAC9D,MAAM,OAAO,QAAQ,OAAO;CAE5B,MAAM,WAAW,KAAK,MAAM,KAAK,CAAC;AAElC,eAAc,UAAU,qBAAqB;AAE7C,MAAK,MAAM,IAAI,EACb,UAAU,MACX,CAAC;AAEF,QAAO;;;;;;;;;;;;;;ACZT,MAAa,gBAAgB,OAAO,SAAS,kBAAkB,KAAK;CAClE,MAAM,OAAO,QAAQ,OAAO;AAQ5B,QALuB,MAFL,gBAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;ACDJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAAS,kBAAkB,KACxB;CACH,MAAM,kBAAkB,OAAO;AAQ/B,KAAI,CANwB,iBAAiB,UAAU,KAAK,SAAS,MAClE,WAAW,OAAO,WAAW,aAAa,OAAO,SACnD,CAKC,QAAO;AAMT,KAH4B,iBAAiB,UAAU,KAAK,SAI1D,QAAO;AAMT,SAHmB,MAAM,cAAc,OAAO,EAG5B"}
1
+ {"version":3,"file":"isMfaRequiredForAction-C0ZXRkHC.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 */\nexport const consumeMfaToken = (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const mfaToken = core.state.get().mfaToken;\n\n assertDefined(mfaToken, 'No MFA token found');\n\n core.state.set({\n mfaToken: null,\n });\n\n return mfaToken;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\n\n/**\n * Retrieves the available MFA methods for the current user.\n *\n * This function fetches information about which multi-factor authentication\n * methods are available and configured for the user's account.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the user's MFA methods configuration.\n */\nexport const getMfaMethods = async (client = getDefaultClient()) => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const userMfaMethods = await apiClient.getUserMfaMethods({\n environmentId: core.environmentId,\n verifiedOnly: true,\n });\n\n return userMfaMethods;\n};\n","import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { getMfaMethods } from '../getMfaMethods';\n\ntype IsMfaRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/**\n * Checks if MFA is required for a specific action.\n *\n * This function determines whether multi-factor authentication is required\n * for the specified action based on project settings and user configuration.\n *\n * @param params.mfaAction - The action to check MFA requirements for.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to true if MFA is required for the action, false otherwise.\n */\nexport const isMfaRequiredForAction = async (\n { mfaAction }: IsMfaRequiredForActionParams,\n client = getDefaultClient()\n) => {\n const projectSettings = client.projectSettings;\n\n const isRequiredForAction = projectSettings?.security?.mfa?.actions?.some(\n (action) => action.action === mfaAction && action.required\n );\n\n // if mfa is not required for the action, return false\n // no matter if general mfa is set to required or not\n if (!isRequiredForAction) {\n return false;\n }\n\n const isMfaMethodRequired = projectSettings?.security?.mfa?.required;\n\n // if mfa is required for the action and also set as required in general, return true\n if (isMfaMethodRequired) {\n return true;\n }\n\n const mfaMethods = await getMfaMethods(client);\n // if general mfa is optional, but user has registered methods,\n // then it should be required for the action\n return mfaMethods.userHasVerifiedMfaMethods;\n};\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,mBAAmB,SAAS,kBAAkB,KAAK;CAC9D,MAAM,OAAO,QAAQ,OAAO;CAE5B,MAAM,WAAW,KAAK,MAAM,KAAK,CAAC;AAElC,eAAc,UAAU,qBAAqB;AAE7C,MAAK,MAAM,IAAI,EACb,UAAU,MACX,CAAC;AAEF,QAAO;;;;;;;;;;;;;;ACZT,MAAa,gBAAgB,OAAO,SAAS,kBAAkB,KAAK;CAClE,MAAM,OAAO,QAAQ,OAAO;AAQ5B,QALuB,MAFL,gBAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;ACDJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAAS,kBAAkB,KACxB;CACH,MAAM,kBAAkB,OAAO;AAQ/B,KAAI,CANwB,iBAAiB,UAAU,KAAK,SAAS,MAClE,WAAW,OAAO,WAAW,aAAa,OAAO,SACnD,CAKC,QAAO;AAMT,KAH4B,iBAAiB,UAAU,KAAK,SAI1D,QAAO;AAMT,SAHmB,MAAM,cAAc,OAAO,EAG5B"}
@@ -1,4 +1,4 @@
1
- const require_InvalidParamError = require('./InvalidParamError-BweYAZrY.cjs.js');
1
+ const require_InvalidParamError = require('./InvalidParamError-BEdsjVbd.cjs.js');
2
2
 
3
3
  //#region src/modules/mfa/consumeMfaToken/consumeMfaToken.ts
4
4
  /**
@@ -76,4 +76,4 @@ Object.defineProperty(exports, 'isMfaRequiredForAction', {
76
76
  return isMfaRequiredForAction;
77
77
  }
78
78
  });
79
- //# sourceMappingURL=isMfaRequiredForAction-LvTNM74t.cjs.js.map
79
+ //# sourceMappingURL=isMfaRequiredForAction-DNP71xZ7.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isMfaRequiredForAction-LvTNM74t.cjs.js","names":["getDefaultClient","getCore","getDefaultClient","getCore","createApiClient","getDefaultClient"],"sources":["../src/modules/mfa/consumeMfaToken/consumeMfaToken.ts","../src/modules/mfa/getMfaMethods/getMfaMethods.ts","../src/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.ts"],"sourcesContent":["import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Consumes and clears the current MFA token from the client state.\n *\n * This function retrieves the MFA token obtained from a successful MFA authentication,\n * and removes it from the client, to prevent it from being used again.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns The MFA token that was consumed.\n * @throws Error if no MFA token is found.\n */\nexport const consumeMfaToken = (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const mfaToken = core.state.get().mfaToken;\n\n assertDefined(mfaToken, 'No MFA token found');\n\n core.state.set({\n mfaToken: null,\n });\n\n return mfaToken;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\n\n/**\n * Retrieves the available MFA methods for the current user.\n *\n * This function fetches information about which multi-factor authentication\n * methods are available and configured for the user's account.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the user's MFA methods configuration.\n */\nexport const getMfaMethods = async (client = getDefaultClient()) => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const userMfaMethods = await apiClient.getUserMfaMethods({\n environmentId: core.environmentId,\n verifiedOnly: true,\n });\n\n return userMfaMethods;\n};\n","import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { getMfaMethods } from '../getMfaMethods';\n\ntype IsMfaRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/**\n * Checks if MFA is required for a specific action.\n *\n * This function determines whether multi-factor authentication is required\n * for the specified action based on project settings and user configuration.\n *\n * @param params.mfaAction - The action to check MFA requirements for.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to true if MFA is required for the action, false otherwise.\n */\nexport const isMfaRequiredForAction = async (\n { mfaAction }: IsMfaRequiredForActionParams,\n client = getDefaultClient()\n) => {\n const projectSettings = client.projectSettings;\n\n const isRequiredForAction = projectSettings?.security?.mfa?.actions?.some(\n (action) => action.action === mfaAction && action.required\n );\n\n // if mfa is not required for the action, return false\n // no matter if general mfa is set to required or not\n if (!isRequiredForAction) {\n return false;\n }\n\n const isMfaMethodRequired = projectSettings?.security?.mfa?.required;\n\n // if mfa is required for the action and also set as required in general, return true\n if (isMfaMethodRequired) {\n return true;\n }\n\n const mfaMethods = await getMfaMethods(client);\n // if general mfa is optional, but user has registered methods,\n // then it should be required for the action\n return mfaMethods.userHasVerifiedMfaMethods;\n};\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,mBAAmB,SAASA,4CAAkB,KAAK;CAC9D,MAAM,OAAOC,kCAAQ,OAAO;CAE5B,MAAM,WAAW,KAAK,MAAM,KAAK,CAAC;AAElC,yCAAc,UAAU,qBAAqB;AAE7C,MAAK,MAAM,IAAI,EACb,UAAU,MACX,CAAC;AAEF,QAAO;;;;;;;;;;;;;;ACZT,MAAa,gBAAgB,OAAO,SAASC,4CAAkB,KAAK;CAClE,MAAM,OAAOC,kCAAQ,OAAO;AAQ5B,QALuB,MAFLC,0CAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;ACDJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAASC,4CAAkB,KACxB;CACH,MAAM,kBAAkB,OAAO;AAQ/B,KAAI,CANwB,iBAAiB,UAAU,KAAK,SAAS,MAClE,WAAW,OAAO,WAAW,aAAa,OAAO,SACnD,CAKC,QAAO;AAMT,KAH4B,iBAAiB,UAAU,KAAK,SAI1D,QAAO;AAMT,SAHmB,MAAM,cAAc,OAAO,EAG5B"}
1
+ {"version":3,"file":"isMfaRequiredForAction-DNP71xZ7.cjs.js","names":["getDefaultClient","getCore","getDefaultClient","getCore","createApiClient","getDefaultClient"],"sources":["../src/modules/mfa/consumeMfaToken/consumeMfaToken.ts","../src/modules/mfa/getMfaMethods/getMfaMethods.ts","../src/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.ts"],"sourcesContent":["import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Consumes and clears the current MFA token from the client state.\n *\n * This function retrieves the MFA token obtained from a successful MFA authentication,\n * and removes it from the client, to prevent it from being used again.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns The MFA token that was consumed.\n * @throws Error if no MFA token is found.\n */\nexport const consumeMfaToken = (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const mfaToken = core.state.get().mfaToken;\n\n assertDefined(mfaToken, 'No MFA token found');\n\n core.state.set({\n mfaToken: null,\n });\n\n return mfaToken;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\n\n/**\n * Retrieves the available MFA methods for the current user.\n *\n * This function fetches information about which multi-factor authentication\n * methods are available and configured for the user's account.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the user's MFA methods configuration.\n */\nexport const getMfaMethods = async (client = getDefaultClient()) => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const userMfaMethods = await apiClient.getUserMfaMethods({\n environmentId: core.environmentId,\n verifiedOnly: true,\n });\n\n return userMfaMethods;\n};\n","import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { getMfaMethods } from '../getMfaMethods';\n\ntype IsMfaRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/**\n * Checks if MFA is required for a specific action.\n *\n * This function determines whether multi-factor authentication is required\n * for the specified action based on project settings and user configuration.\n *\n * @param params.mfaAction - The action to check MFA requirements for.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to true if MFA is required for the action, false otherwise.\n */\nexport const isMfaRequiredForAction = async (\n { mfaAction }: IsMfaRequiredForActionParams,\n client = getDefaultClient()\n) => {\n const projectSettings = client.projectSettings;\n\n const isRequiredForAction = projectSettings?.security?.mfa?.actions?.some(\n (action) => action.action === mfaAction && action.required\n );\n\n // if mfa is not required for the action, return false\n // no matter if general mfa is set to required or not\n if (!isRequiredForAction) {\n return false;\n }\n\n const isMfaMethodRequired = projectSettings?.security?.mfa?.required;\n\n // if mfa is required for the action and also set as required in general, return true\n if (isMfaMethodRequired) {\n return true;\n }\n\n const mfaMethods = await getMfaMethods(client);\n // if general mfa is optional, but user has registered methods,\n // then it should be required for the action\n return mfaMethods.userHasVerifiedMfaMethods;\n};\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,mBAAmB,SAASA,4CAAkB,KAAK;CAC9D,MAAM,OAAOC,kCAAQ,OAAO;CAE5B,MAAM,WAAW,KAAK,MAAM,KAAK,CAAC;AAElC,yCAAc,UAAU,qBAAqB;AAE7C,MAAK,MAAM,IAAI,EACb,UAAU,MACX,CAAC;AAEF,QAAO;;;;;;;;;;;;;;ACZT,MAAa,gBAAgB,OAAO,SAASC,4CAAkB,KAAK;CAClE,MAAM,OAAOC,kCAAQ,OAAO;AAQ5B,QALuB,MAFLC,0CAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;ACDJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAASC,4CAAkB,KACxB;CACH,MAAM,kBAAkB,OAAO;AAQ/B,KAAI,CANwB,iBAAiB,UAAU,KAAK,SAAS,MAClE,WAAW,OAAO,WAAW,aAAa,OAAO,SACnD,CAKC,QAAO;AAMT,KAH4B,iBAAiB,UAAU,KAAK,SAI1D,QAAO;AAMT,SAHmB,MAAM,cAAc,OAAO,EAG5B"}
@@ -0,0 +1,35 @@
1
+ import type { TokenBalance } from '@dynamic-labs/sdk-api-core';
2
+ import type { WalletAccount } from '../../wallets/walletAccount';
3
+ export type GetBalancesParams = {
4
+ /**
5
+ * Whether to filter out spam tokens.
6
+ * Defaults to true.
7
+ */
8
+ filterSpamTokens?: boolean;
9
+ /** Whether to force a refresh of the balances instead of using the api cached value. */
10
+ forceRefresh?: boolean;
11
+ /** Whether to include the native token balance. */
12
+ includeNative?: boolean;
13
+ /** Whether to include the prices of the tokens. */
14
+ includePrices?: boolean;
15
+ /**
16
+ * The network ID to get the balances for.
17
+ * If not provided, the active network ID will be used.
18
+ */
19
+ networkId?: number;
20
+ /** The wallet account to get the balances for. */
21
+ walletAccount: WalletAccount;
22
+ /** If provided, only return balances for the specified contracts. */
23
+ whitelistedContracts?: Array<string>;
24
+ };
25
+ /**
26
+ * Retrieves the token balances for a wallet account.
27
+ *
28
+ * This function fetches the balances of the tokens for the specified wallet account.
29
+ *
30
+ * @param params.walletAccount - The wallet account to get the balances for.
31
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
32
+ * @returns A promise that resolves to an array of token balances.
33
+ */
34
+ export declare const getBalances: ({ walletAccount, networkId, includePrices, includeNative, filterSpamTokens, whitelistedContracts, forceRefresh, }: GetBalancesParams, client?: import("../../../exports").DynamicClient) => Promise<TokenBalance[]>;
35
+ //# sourceMappingURL=getBalances.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBalances.d.ts","sourceRoot":"","sources":["../../../../src/modules/balances/getBalances/getBalances.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAM1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,wFAAwF;IACxF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mDAAmD;IACnD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mDAAmD;IACnD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,aAAa,EAAE,aAAa,CAAC;IAC7B,qEAAqE;IACrE,oBAAoB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACtC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,sHASnB,iBAAiB,wDAEnB,OAAO,CAAC,YAAY,EAAE,CA6BxB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { getBalances } from './getBalances';
2
+ export type { GetBalancesParams } from './getBalances';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/balances/getBalances/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
@@ -1,10 +1,12 @@
1
+ import type { User } from '../../user/user.types';
1
2
  /**
2
- * Checks if device registration is required for the current user.
3
+ * Checks if device registration is required for the given user.
3
4
  *
4
- * This function determines if the current user has the deviceRegistration
5
+ * This function determines if the user has the deviceRegistration
5
6
  * scope, indicating that device registration is required.
6
7
  *
8
+ * @param user - The user to check.
7
9
  * @returns True if device registration is required, false otherwise.
8
10
  */
9
- export declare const isDeviceRegistrationRequired: (client?: import("../../../exports").DynamicClient) => boolean;
11
+ export declare const isDeviceRegistrationRequired: (user: User) => boolean;
10
12
  //# sourceMappingURL=isDeviceRegistrationRequired.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isDeviceRegistrationRequired.d.ts","sourceRoot":"","sources":["../../../../src/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,gEAMxC,CAAC"}
1
+ {"version":3,"file":"isDeviceRegistrationRequired.d.ts","sourceRoot":"","sources":["../../../../src/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,SAAU,IAAI,YACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/modules/wallets/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,KAAK,SAAS,GAAG;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,2BAA2B,EAAE,MAAM,CAAC;IACpC,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,CA8EpD,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/modules/wallets/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,KAAK,SAAS,GAAG;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,2BAA2B,EAAE,MAAM,CAAC;IACpC,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,CAmFpD,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type * as z from 'zod/mini';
2
+ import type { RealtimeChannelSchema } from '../realtime.types';
3
+ /**
4
+ * Defines a typed schema for a realtime channel — analogous to `createStorageKeySchema`
5
+ * for storage. Pairs a channel name with a Zod schema that validates the shape of
6
+ * messages sent and received on that channel. Pass the result to the realtime service's
7
+ * `subscribe` / `unsubscribe` / `publish` methods to get end-to-end type safety.
8
+ */
9
+ export declare const createRealtimeChannelSchema: <T>(params: {
10
+ channel: string;
11
+ schema: z.ZodMiniType<T>;
12
+ }) => RealtimeChannelSchema<T>;
13
+ //# sourceMappingURL=createRealtimeChannelSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRealtimeChannelSchema.d.ts","sourceRoot":"","sources":["../../../../src/services/realtime/createRealtimeChannelSchema/createRealtimeChannelSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,CAAC,MAAM,UAAU,CAAC;AAEnC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,GAAI,CAAC,UAAU;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CAC1B,KAAG,qBAAqB,CAAC,CAAC,CAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { createRealtimeChannelSchema } from './createRealtimeChannelSchema';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/realtime/createRealtimeChannelSchema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export type { RealtimeChannelSchema, RealtimeConnectionState, RealtimeEventMap, RealtimeService, } from './realtime.types';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/realtime/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,GAChB,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,63 @@
1
+ import type * as z from 'zod/mini';
2
+ import type { DynamicClient } from '../../client/types';
3
+ /**
4
+ * Connection states for the realtime service.
5
+ *
6
+ * - `idle`: Created but `connect()` not yet called.
7
+ * - `connecting`: Establishing connection.
8
+ * - `connected`: Connection active and ready.
9
+ * - `disconnected`: Temporary disconnection; the service auto-retries.
10
+ * - `suspended`: 2+ min offline; retries at a slower rate.
11
+ * - `closing`: Connection is being closed.
12
+ * - `closed`: Connection closed intentionally.
13
+ * - `failed`: Unrecoverable error (e.g. bad auth).
14
+ */
15
+ export type RealtimeConnectionState = 'idle' | 'connecting' | 'connected' | 'disconnected' | 'suspended' | 'closing' | 'closed' | 'failed';
16
+ export type RealtimeEventMap = {
17
+ connectionStateChange: (state: RealtimeConnectionState) => void;
18
+ };
19
+ /**
20
+ * Defines a realtime channel with its name and a Zod schema
21
+ * for validating published/received message data.
22
+ *
23
+ * Mirrors StorageKeySchema from the storage service.
24
+ */
25
+ export type RealtimeChannelSchema<T> = {
26
+ channel: string;
27
+ schema: z.ZodMiniType<T>;
28
+ };
29
+ /**
30
+ * Service for real-time pub/sub messaging.
31
+ *
32
+ * Note: The underlying transport supports an optional `name` field for
33
+ * event-type routing within a channel (e.g. subscribe to only "created" events).
34
+ * This is intentionally omitted for now to keep the API simple.
35
+ * If needed in the future, `publish` can accept an optional `name`
36
+ * and `subscribe` can accept an optional `eventName` filter.
37
+ */
38
+ export type RealtimeService = {
39
+ connect: (params: {
40
+ client: DynamicClient;
41
+ }) => Promise<void>;
42
+ disconnect: () => void;
43
+ getConnectionState: () => RealtimeConnectionState;
44
+ off: <E extends keyof RealtimeEventMap>(event: E, callback: RealtimeEventMap[E]) => void;
45
+ on: <E extends keyof RealtimeEventMap>(event: E, callback: RealtimeEventMap[E]) => void;
46
+ publish: <T>(params: {
47
+ channelSchema: RealtimeChannelSchema<T>;
48
+ data: T;
49
+ }) => Promise<void>;
50
+ subscribe: <T>(params: {
51
+ callback: (message: {
52
+ data: T;
53
+ }) => void;
54
+ channelSchema: RealtimeChannelSchema<T>;
55
+ }) => Promise<void>;
56
+ unsubscribe: <T>(params: {
57
+ callback: (message: {
58
+ data: T;
59
+ }) => void;
60
+ channelSchema: RealtimeChannelSchema<T>;
61
+ }) => void;
62
+ };
63
+ //# sourceMappingURL=realtime.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtime.types.d.ts","sourceRoot":"","sources":["../../../src/services/realtime/realtime.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,CAAC,MAAM,UAAU,CAAC;AAEnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,uBAAuB,GAC/B,MAAM,GACN,YAAY,GACZ,WAAW,GACX,cAAc,GACd,WAAW,GACX,SAAS,GACT,QAAQ,GACR,QAAQ,CAAC;AAEb,MAAM,MAAM,gBAAgB,GAAG;IAC7B,qBAAqB,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;CACjE,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CAC1B,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,aAAa,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;IAClD,GAAG,EAAE,CAAC,CAAC,SAAS,MAAM,gBAAgB,EACpC,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAC1B,IAAI,CAAC;IACV,EAAE,EAAE,CAAC,CAAC,SAAS,MAAM,gBAAgB,EACnC,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAC1B,IAAI,CAAC;IACV,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE;QACnB,aAAa,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACxC,IAAI,EAAE,CAAC,CAAC;KACT,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE;QACrB,QAAQ,EAAE,CAAC,OAAO,EAAE;YAAE,IAAI,EAAE,CAAC,CAAA;SAAE,KAAK,IAAI,CAAC;QACzC,aAAa,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;KACzC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE;QACvB,QAAQ,EAAE,CAAC,OAAO,EAAE;YAAE,IAAI,EAAE,CAAC,CAAA;SAAE,KAAK,IAAI,CAAC;QACzC,aAAa,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;KACzC,KAAK,IAAI,CAAC;CACZ,CAAC"}