@dynamic-labs-sdk/client 1.2.0 → 1.2.1
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.
- package/dist/{InvalidParamError-Dhv4EhOy.native.esm.js → InvalidParamError-BYnLW_9s.native.esm.js} +2 -2
- package/dist/{InvalidParamError-Dhv4EhOy.native.esm.js.map → InvalidParamError-BYnLW_9s.native.esm.js.map} +1 -1
- package/dist/{InvalidParamError-CPzPxL0l.cjs → InvalidParamError-CEykJlaG.cjs} +3 -3
- package/dist/{InvalidParamError-CPzPxL0l.cjs.map → InvalidParamError-CEykJlaG.cjs.map} +1 -1
- package/dist/{InvalidParamError-BWWTxQ9d.esm.js → InvalidParamError-uluG140m.esm.js} +2 -2
- package/dist/{InvalidParamError-BWWTxQ9d.esm.js.map → InvalidParamError-uluG140m.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-D_mLDrYD.native.esm.js → NotWaasWalletAccountError-33QOxTKa.native.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-D_mLDrYD.native.esm.js.map → NotWaasWalletAccountError-33QOxTKa.native.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-BcIbGm0s.cjs → NotWaasWalletAccountError-BNdbbGX7.cjs} +3 -3
- package/dist/{NotWaasWalletAccountError-BcIbGm0s.cjs.map → NotWaasWalletAccountError-BNdbbGX7.cjs.map} +1 -1
- package/dist/{NotWaasWalletAccountError-D1EuiYyR.esm.js → NotWaasWalletAccountError-DmlwWvy0.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-D1EuiYyR.esm.js.map → NotWaasWalletAccountError-DmlwWvy0.esm.js.map} +1 -1
- package/dist/core.cjs +45 -5
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +45 -8
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +43 -6
- package/dist/core.native.esm.js.map +1 -1
- package/dist/errors/ArrayMustNotBeEmptyError.d.ts +5 -0
- package/dist/errors/ArrayMustNotBeEmptyError.d.ts.map +1 -0
- package/dist/exports/core.d.ts +8 -0
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/exports/index.d.ts +2 -0
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-D26TNjm4.cjs → getNetworkProviderFromNetworkId-BOCwNNMm.cjs} +30 -4
- package/dist/getNetworkProviderFromNetworkId-BOCwNNMm.cjs.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-C9QzgcLs.esm.js → getNetworkProviderFromNetworkId-CS1GXEp6.esm.js} +29 -9
- package/dist/getNetworkProviderFromNetworkId-CS1GXEp6.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-VkHaRqMa.native.esm.js → getNetworkProviderFromNetworkId-a0atbFHU.native.esm.js} +25 -5
- package/dist/getNetworkProviderFromNetworkId-a0atbFHU.native.esm.js.map +1 -0
- package/dist/{getSignedSessionId-D52QC0hh.cjs → getSignedSessionId-B42gT4xk.cjs} +3 -3
- package/dist/{getSignedSessionId-D52QC0hh.cjs.map → getSignedSessionId-B42gT4xk.cjs.map} +1 -1
- package/dist/{getSignedSessionId-DcJl2sy8.esm.js → getSignedSessionId-D1Oh4604.esm.js} +3 -3
- package/dist/{getSignedSessionId-DcJl2sy8.esm.js.map → getSignedSessionId-D1Oh4604.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-L0T26uTy.native.esm.js → getSignedSessionId-zHtJOVpY.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-L0T26uTy.native.esm.js.map → getSignedSessionId-zHtJOVpY.native.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-C94BZhqL.cjs → getVerifiedCredentialForWalletAccount-B-IhZJuM.cjs} +3 -3
- package/dist/{getVerifiedCredentialForWalletAccount-C94BZhqL.cjs.map → getVerifiedCredentialForWalletAccount-B-IhZJuM.cjs.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-Cm2e3Boz.esm.js → getVerifiedCredentialForWalletAccount-BkaECPL_.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-Cm2e3Boz.esm.js.map → getVerifiedCredentialForWalletAccount-BkaECPL_.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-CMEe9e1b.native.esm.js → getVerifiedCredentialForWalletAccount-CEvtJ3xW.native.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-CMEe9e1b.native.esm.js.map → getVerifiedCredentialForWalletAccount-CEvtJ3xW.native.esm.js.map} +1 -1
- package/dist/index.cjs +122 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +124 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +126 -14
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-B6kjcIA2.native.esm.js → isMfaRequiredForAction-BfabCDxI.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-B6kjcIA2.native.esm.js.map → isMfaRequiredForAction-BfabCDxI.native.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-kxGzZLB_.cjs → isMfaRequiredForAction-CJvFP4oN.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-kxGzZLB_.cjs.map → isMfaRequiredForAction-CJvFP4oN.cjs.map} +1 -1
- package/dist/{isMfaRequiredForAction-vbGFqLFc.esm.js → isMfaRequiredForAction-G7SXCZ5L.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-vbGFqLFc.esm.js.map → isMfaRequiredForAction-G7SXCZ5L.esm.js.map} +1 -1
- package/dist/modules/legacyWalletBook/excludeInstalledFromCatalog/collectInstalledGroupIds/collectInstalledGroupIds.d.ts +26 -0
- package/dist/modules/legacyWalletBook/excludeInstalledFromCatalog/collectInstalledGroupIds/collectInstalledGroupIds.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/excludeInstalledFromCatalog/collectInstalledGroupIds/index.d.ts +2 -0
- package/dist/modules/legacyWalletBook/excludeInstalledFromCatalog/collectInstalledGroupIds/index.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/excludeInstalledFromCatalog/excludeInstalledFromCatalog.d.ts +28 -0
- package/dist/modules/legacyWalletBook/excludeInstalledFromCatalog/excludeInstalledFromCatalog.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/excludeInstalledFromCatalog/index.d.ts +2 -0
- package/dist/modules/legacyWalletBook/excludeInstalledFromCatalog/index.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/matchWalletProvidersToCatalogGroup/index.d.ts +2 -0
- package/dist/modules/legacyWalletBook/matchWalletProvidersToCatalogGroup/index.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/matchWalletProvidersToCatalogGroup/matchWalletProvidersToCatalogGroup.d.ts +26 -0
- package/dist/modules/legacyWalletBook/matchWalletProvidersToCatalogGroup/matchWalletProvidersToCatalogGroup.d.ts.map +1 -0
- package/dist/modules/wallets/utils/getSignInMessage/createSignInMessageStatement/createSignInMessageStatement.d.ts.map +1 -1
- package/dist/modules/wallets/utils/getSignInMessage/getSignInMessage.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/assertNonEmptyArray/assertNonEmptyArray.d.ts +19 -0
- package/dist/utils/assertNonEmptyArray/assertNonEmptyArray.d.ts.map +1 -0
- package/dist/utils/assertNonEmptyArray/index.d.ts +2 -0
- package/dist/utils/assertNonEmptyArray/index.d.ts.map +1 -0
- package/dist/utils/getAppMetadata/getAppMetadata.d.ts +16 -0
- package/dist/utils/getAppMetadata/getAppMetadata.d.ts.map +1 -0
- package/dist/utils/getAppMetadata/index.d.ts +3 -0
- package/dist/utils/getAppMetadata/index.d.ts.map +1 -0
- package/dist/waas.cjs +4 -4
- package/dist/waas.esm.js +3 -3
- package/dist/waas.native.esm.js +3 -3
- package/dist/waasCore.cjs +4 -4
- package/dist/waasCore.esm.js +3 -3
- package/dist/waasCore.native.esm.js +3 -3
- package/package.json +3 -3
- package/dist/getNetworkProviderFromNetworkId-C9QzgcLs.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-D26TNjm4.cjs.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-VkHaRqMa.native.esm.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as instrumentFunction, F as getDefaultClient, u as createApiClient, w as assertDefined, z as getCore } from "./InvalidParamError-
|
|
1
|
+
import { D as instrumentFunction, F as getDefaultClient, u as createApiClient, w as assertDefined, z as getCore } from "./InvalidParamError-BYnLW_9s.native.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-
|
|
77
|
+
//# sourceMappingURL=isMfaRequiredForAction-BfabCDxI.native.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isMfaRequiredForAction-
|
|
1
|
+
{"version":3,"file":"isMfaRequiredForAction-BfabCDxI.native.esm.js","names":[],"sources":["../src/modules/mfa/consumeMfaToken/consumeMfaToken.ts","../src/modules/mfa/getMfaMethods/getMfaMethods.ts","../src/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.ts"],"sourcesContent":["import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Consumes and clears the current MFA token from the client state.\n *\n * This function retrieves the MFA token obtained from a successful MFA authentication,\n * and removes it from the client, to prevent it from being used again.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns The MFA token that was consumed.\n * @throws Error if no MFA token is found.\n * @instrumented\n */\nexport const consumeMfaToken = (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const mfaToken = core.state.get().mfaToken;\n\n assertDefined(mfaToken, 'No MFA token found');\n\n core.state.set({\n mfaToken: null,\n });\n\n return mfaToken;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\n\n/**\n * Retrieves the available MFA methods for the current user.\n *\n * This function fetches information about which multi-factor authentication\n * methods are available and configured for the user's account.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the user's MFA methods configuration.\n * @not-instrumented\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 * @not-instrumented\n */\nexport const isMfaRequiredForAction = async (\n { mfaAction }: IsMfaRequiredForActionParams,\n client = getDefaultClient()\n) => {\n const projectSettings = client.projectSettings;\n\n const isRequiredForAction = projectSettings?.security?.mfa?.actions?.some(\n (action) => action.action === mfaAction && action.required\n );\n\n // if mfa is not required for the action, return false\n // no matter if general mfa is set to required or not\n if (!isRequiredForAction) {\n return false;\n }\n\n const isMfaMethodRequired = projectSettings?.security?.mfa?.required;\n\n // if mfa is required for the action and also set as required in general, return true\n if (isMfaMethodRequired) {\n return true;\n }\n\n const mfaMethods = await getMfaMethods(client);\n // if general mfa is optional, but user has registered methods,\n // then it should be required for the action\n return mfaMethods.userHasVerifiedMfaMethods;\n};\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAE,mBAAsB,SAAU,kBAAU,KAAA;;;AAK1C,eAAY,UAAI,qBAAA;kBAGhB,UAAO,MACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACbD,MAAa,gBAAgB,OAAO,SAAS,kBAAkB,KAAK;CAClE,MAAM,OAAO,QAAQ,OAAO;AAQ5B,QALuB,MAFL,gBAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;;ACDJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAAS,kBAAkB,KACxB;CACH,MAAM,kBAAkB,OAAO;AAQ/B,KAAI,CANwB,iBAAiB,UAAU,KAAK,SAAS,MAClE,WAAW,OAAO,WAAW,aAAa,OAAO,SACnD,CAKC,QAAO;AAMT,KAH4B,iBAAiB,UAAU,KAAK,SAI1D,QAAO;AAMT,SAHmB,MAAM,cAAc,OAAO,EAG5B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_InvalidParamError = require('./InvalidParamError-
|
|
1
|
+
const require_InvalidParamError = require('./InvalidParamError-CEykJlaG.cjs');
|
|
2
2
|
|
|
3
3
|
//#region src/modules/mfa/consumeMfaToken/consumeMfaToken.ts
|
|
4
4
|
/**
|
|
@@ -91,4 +91,4 @@ Object.defineProperty(exports, 'isMfaRequiredForAction', {
|
|
|
91
91
|
return isMfaRequiredForAction;
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
|
-
//# sourceMappingURL=isMfaRequiredForAction-
|
|
94
|
+
//# sourceMappingURL=isMfaRequiredForAction-CJvFP4oN.cjs.map
|
package/dist/{isMfaRequiredForAction-kxGzZLB_.cjs.map → isMfaRequiredForAction-CJvFP4oN.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isMfaRequiredForAction-
|
|
1
|
+
{"version":3,"file":"isMfaRequiredForAction-CJvFP4oN.cjs","names":["getDefaultClient","getCore","createApiClient","getDefaultClient"],"sources":["../src/modules/mfa/consumeMfaToken/consumeMfaToken.ts","../src/modules/mfa/getMfaMethods/getMfaMethods.ts","../src/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.ts"],"sourcesContent":["import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Consumes and clears the current MFA token from the client state.\n *\n * This function retrieves the MFA token obtained from a successful MFA authentication,\n * and removes it from the client, to prevent it from being used again.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns The MFA token that was consumed.\n * @throws Error if no MFA token is found.\n * @instrumented\n */\nexport const consumeMfaToken = (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const mfaToken = core.state.get().mfaToken;\n\n assertDefined(mfaToken, 'No MFA token found');\n\n core.state.set({\n mfaToken: null,\n });\n\n return mfaToken;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\n\n/**\n * Retrieves the available MFA methods for the current user.\n *\n * This function fetches information about which multi-factor authentication\n * methods are available and configured for the user's account.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the user's MFA methods configuration.\n * @not-instrumented\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 * @not-instrumented\n */\nexport const isMfaRequiredForAction = async (\n { mfaAction }: IsMfaRequiredForActionParams,\n client = getDefaultClient()\n) => {\n const projectSettings = client.projectSettings;\n\n const isRequiredForAction = projectSettings?.security?.mfa?.actions?.some(\n (action) => action.action === mfaAction && action.required\n );\n\n // if mfa is not required for the action, return false\n // no matter if general mfa is set to required or not\n if (!isRequiredForAction) {\n return false;\n }\n\n const isMfaMethodRequired = projectSettings?.security?.mfa?.required;\n\n // if mfa is required for the action and also set as required in general, return true\n if (isMfaMethodRequired) {\n return true;\n }\n\n const mfaMethods = await getMfaMethods(client);\n // if general mfa is optional, but user has registered methods,\n // then it should be required for the action\n return mfaMethods.userHasVerifiedMfaMethods;\n};\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAE,mBAAsB,SAAU,4CAAU,KAAA;;;AAK1C,yCAAY,UAAI,qBAAA;kBAGhB,UAAO,MACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACbD,MAAa,gBAAgB,OAAO,SAASA,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"}
|
package/dist/{isMfaRequiredForAction-vbGFqLFc.esm.js → isMfaRequiredForAction-G7SXCZ5L.esm.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as instrumentFunction, F as getDefaultClient, u as createApiClient, w as assertDefined, z as getCore } from "./InvalidParamError-
|
|
1
|
+
import { D as instrumentFunction, F as getDefaultClient, u as createApiClient, w as assertDefined, z as getCore } from "./InvalidParamError-uluG140m.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-
|
|
77
|
+
//# sourceMappingURL=isMfaRequiredForAction-G7SXCZ5L.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isMfaRequiredForAction-
|
|
1
|
+
{"version":3,"file":"isMfaRequiredForAction-G7SXCZ5L.esm.js","names":[],"sources":["../src/modules/mfa/consumeMfaToken/consumeMfaToken.ts","../src/modules/mfa/getMfaMethods/getMfaMethods.ts","../src/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.ts"],"sourcesContent":["import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Consumes and clears the current MFA token from the client state.\n *\n * This function retrieves the MFA token obtained from a successful MFA authentication,\n * and removes it from the client, to prevent it from being used again.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns The MFA token that was consumed.\n * @throws Error if no MFA token is found.\n * @instrumented\n */\nexport const consumeMfaToken = (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const mfaToken = core.state.get().mfaToken;\n\n assertDefined(mfaToken, 'No MFA token found');\n\n core.state.set({\n mfaToken: null,\n });\n\n return mfaToken;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\n\n/**\n * Retrieves the available MFA methods for the current user.\n *\n * This function fetches information about which multi-factor authentication\n * methods are available and configured for the user's account.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the user's MFA methods configuration.\n * @not-instrumented\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 * @not-instrumented\n */\nexport const isMfaRequiredForAction = async (\n { mfaAction }: IsMfaRequiredForActionParams,\n client = getDefaultClient()\n) => {\n const projectSettings = client.projectSettings;\n\n const isRequiredForAction = projectSettings?.security?.mfa?.actions?.some(\n (action) => action.action === mfaAction && action.required\n );\n\n // if mfa is not required for the action, return false\n // no matter if general mfa is set to required or not\n if (!isRequiredForAction) {\n return false;\n }\n\n const isMfaMethodRequired = projectSettings?.security?.mfa?.required;\n\n // if mfa is required for the action and also set as required in general, return true\n if (isMfaMethodRequired) {\n return true;\n }\n\n const mfaMethods = await getMfaMethods(client);\n // if general mfa is optional, but user has registered methods,\n // then it should be required for the action\n return mfaMethods.userHasVerifiedMfaMethods;\n};\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAE,mBAAsB,SAAU,kBAAU,KAAA;;;AAK1C,eAAY,UAAI,qBAAA;kBAGhB,UAAO,MACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACbD,MAAa,gBAAgB,OAAO,SAAS,kBAAkB,KAAK;CAClE,MAAM,OAAO,QAAQ,OAAO;AAQ5B,QALuB,MAFL,gBAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;;ACDJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAAS,kBAAkB,KACxB;CACH,MAAM,kBAAkB,OAAO;AAQ/B,KAAI,CANwB,iBAAiB,UAAU,KAAK,SAAS,MAClE,WAAW,OAAO,WAAW,aAAa,OAAO,SACnD,CAKC,QAAO;AAMT,KAH4B,iBAAiB,UAAU,KAAK,SAI1D,QAAO;AAMT,SAHmB,MAAM,cAAc,OAAO,EAG5B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { WalletProviderData } from '../../../wallets/walletProvider/walletProvider.types';
|
|
2
|
+
import type { WalletConnectCatalog } from '../../getWalletConnectCatalog/getWalletConnectCatalog.types';
|
|
3
|
+
type CollectInstalledGroupIdsParams = {
|
|
4
|
+
catalog: WalletConnectCatalog;
|
|
5
|
+
walletProviders: WalletProviderData[];
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Scans the catalog and returns the set of group identifiers for which at
|
|
9
|
+
* least one installed wallet provider matches.
|
|
10
|
+
*
|
|
11
|
+
* Walks the catalog twice on purpose:
|
|
12
|
+
* - First through `wallets`, to cover wallets that point to a `groupId`
|
|
13
|
+
* with no matching entry in `groups` (we fall back to the wallet's own
|
|
14
|
+
* name for matching in that case).
|
|
15
|
+
* - Then through `groups`, to catch orphan group entries that have no
|
|
16
|
+
* wallet referencing them.
|
|
17
|
+
*
|
|
18
|
+
* The check is skipped for any group already known to be installed, so a
|
|
19
|
+
* multi-chain wallet (same `groupId` across EVM + SOL entries) only runs
|
|
20
|
+
* the match once.
|
|
21
|
+
*
|
|
22
|
+
* @not-instrumented
|
|
23
|
+
*/
|
|
24
|
+
export declare const collectInstalledGroupIds: ({ catalog, walletProviders, }: CollectInstalledGroupIdsParams) => Set<string>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=collectInstalledGroupIds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectInstalledGroupIds.d.ts","sourceRoot":"","sources":["../../../../../src/modules/legacyWalletBook/excludeInstalledFromCatalog/collectInstalledGroupIds/collectInstalledGroupIds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAC/F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AAGxG,KAAK,8BAA8B,GAAG;IACpC,OAAO,EAAE,oBAAoB,CAAC;IAC9B,eAAe,EAAE,kBAAkB,EAAE,CAAC;CACvC,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,wBAAwB,kCAGlC,8BAA8B,KAAG,GAAG,CAAC,MAAM,CAmC7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/legacyWalletBook/excludeInstalledFromCatalog/collectInstalledGroupIds/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/modules/legacyWalletBook/excludeInstalledFromCatalog/excludeInstalledFromCatalog.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { WalletProviderData } from '../../wallets/walletProvider/walletProvider.types';
|
|
2
|
+
import type { WalletConnectCatalog } from '../getWalletConnectCatalog/getWalletConnectCatalog.types';
|
|
3
|
+
type ExcludeInstalledFromCatalogParams = {
|
|
4
|
+
catalog: WalletConnectCatalog;
|
|
5
|
+
walletProviders: WalletProviderData[];
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Returns a new WalletConnect catalog with the wallets and groups that the
|
|
9
|
+
* user already has installed removed.
|
|
10
|
+
*
|
|
11
|
+
* Useful when rendering a combined wallet list (installed + WalletConnect
|
|
12
|
+
* catalog) where each wallet should appear exactly once: installed wallets
|
|
13
|
+
* win and the corresponding catalog entries get hidden.
|
|
14
|
+
*
|
|
15
|
+
* Matching is delegated to {@link collectInstalledGroupIds}, so a single
|
|
16
|
+
* installed provider removes every wallet that shares its group — e.g. an
|
|
17
|
+
* installed MetaMask hides both the EVM and SOL catalog entries.
|
|
18
|
+
*
|
|
19
|
+
* The original catalog object is not mutated.
|
|
20
|
+
*
|
|
21
|
+
* @param params.catalog - The full WalletConnect catalog (typically from `getWalletConnectCatalog`).
|
|
22
|
+
* @param params.walletProviders - Currently available wallet providers.
|
|
23
|
+
* @returns A new catalog with only the wallets and groups the user does not have installed.
|
|
24
|
+
* @not-instrumented
|
|
25
|
+
*/
|
|
26
|
+
export declare const excludeInstalledFromCatalog: ({ catalog, walletProviders, }: ExcludeInstalledFromCatalogParams) => WalletConnectCatalog;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=excludeInstalledFromCatalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excludeInstalledFromCatalog.d.ts","sourceRoot":"","sources":["../../../../src/modules/legacyWalletBook/excludeInstalledFromCatalog/excludeInstalledFromCatalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAC5F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAGrG,KAAK,iCAAiC,GAAG;IACvC,OAAO,EAAE,oBAAoB,CAAC;IAC9B,eAAe,EAAE,kBAAkB,EAAE,CAAC;CACvC,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,2BAA2B,kCAGrC,iCAAiC,KAAG,oBA6BtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/legacyWalletBook/excludeInstalledFromCatalog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/legacyWalletBook/matchWalletProvidersToCatalogGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { WalletProviderData } from '../../wallets/walletProvider/walletProvider.types';
|
|
2
|
+
type MatchWalletProvidersToCatalogGroupParams = {
|
|
3
|
+
catalogGroupKey: string;
|
|
4
|
+
catalogGroupName?: string;
|
|
5
|
+
walletProviders: WalletProviderData[];
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Returns the wallet providers that belong to the same wallet group as the
|
|
9
|
+
* given WalletConnect catalog entry. Useful for de-duplicating "installed"
|
|
10
|
+
* vs "available via WalletConnect" wallets when rendering a combined list.
|
|
11
|
+
*
|
|
12
|
+
* Matching is done on normalized identifiers — lowercased, whitespace removed,
|
|
13
|
+
* and the literal substring "wallet" stripped — so that variations like:
|
|
14
|
+
* - catalog key `"trust"` + catalog name `"Trust Wallet"`
|
|
15
|
+
* - provider `groupKey: "trustwallet"` + `displayName: "Trust Wallet"`
|
|
16
|
+
* collapse into a single match.
|
|
17
|
+
*
|
|
18
|
+
* @param params.catalogGroupKey - Key of the catalog group (e.g. `"metamask"`).
|
|
19
|
+
* @param [params.catalogGroupName] - Optional display name (e.g. `"Trust Wallet"`); matched as a fallback when the key is opaque.
|
|
20
|
+
* @param params.walletProviders - Currently available wallet providers (from `getAvailableWalletProvidersData`).
|
|
21
|
+
* @returns The subset of `walletProviders` that match the catalog group.
|
|
22
|
+
* @not-instrumented
|
|
23
|
+
*/
|
|
24
|
+
export declare const matchWalletProvidersToCatalogGroup: ({ catalogGroupKey, catalogGroupName, walletProviders, }: MatchWalletProvidersToCatalogGroupParams) => WalletProviderData[];
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=matchWalletProvidersToCatalogGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchWalletProvidersToCatalogGroup.d.ts","sourceRoot":"","sources":["../../../../src/modules/legacyWalletBook/matchWalletProvidersToCatalogGroup/matchWalletProvidersToCatalogGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAE5F,KAAK,wCAAwC,GAAG;IAC9C,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,kBAAkB,EAAE,CAAC;CACvC,CAAC;AAKF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,kCAAkC,4DAI5C,wCAAwC,KAAG,kBAAkB,EAW/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSignInMessageStatement.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/wallets/utils/getSignInMessage/createSignInMessageStatement/createSignInMessageStatement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createSignInMessageStatement.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/wallets/utils/getSignInMessage/createSignInMessageStatement/createSignInMessageStatement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAGjE,wBAAwB;AACxB,eAAO,MAAM,4BAA4B,WAAY,aAAa,WAIjE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSignInMessage.d.ts","sourceRoot":"","sources":["../../../../../src/modules/wallets/utils/getSignInMessage/getSignInMessage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"getSignInMessage.d.ts","sourceRoot":"","sources":["../../../../../src/modules/wallets/utils/getSignInMessage/getSignInMessage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAK9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAMzD,KAAK,sBAAsB,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF,wBAAwB;AACxB,eAAO,MAAM,gBAAgB,4CACc,sBAAsB,UACvD,aAAa,oBA+CtB,CAAC"}
|