@dynamic-labs-sdk/client 1.4.0 → 1.5.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.
- package/dist/{InvalidParamError-DEmLKJKZ.cjs → InvalidParamError-DKJhDrK8.cjs} +1007 -116
- package/dist/InvalidParamError-DKJhDrK8.cjs.map +1 -0
- package/dist/{InvalidParamError-BPMi0iWC.esm.js → InvalidParamError-DWjMfOZ5.esm.js} +800 -92
- package/dist/InvalidParamError-DWjMfOZ5.esm.js.map +1 -0
- package/dist/{InvalidParamError-CDmVW2DS.native.esm.js → InvalidParamError-DkAMYJOW.native.esm.js} +833 -92
- package/dist/InvalidParamError-DkAMYJOW.native.esm.js.map +1 -0
- package/dist/{NotWaasWalletAccountError-Cntietge.esm.js → NotWaasWalletAccountError-BVrvQzLz.native.esm.js} +4 -4
- package/dist/NotWaasWalletAccountError-BVrvQzLz.native.esm.js.map +1 -0
- package/dist/{NotWaasWalletAccountError-Chpne8_Q.native.esm.js → NotWaasWalletAccountError-C7NUlvvM.esm.js} +4 -4
- package/dist/NotWaasWalletAccountError-C7NUlvvM.esm.js.map +1 -0
- package/dist/{NotWaasWalletAccountError-BZsBHRQe.cjs → NotWaasWalletAccountError-CHzpa9kk.cjs} +4 -4
- package/dist/NotWaasWalletAccountError-CHzpa9kk.cjs.map +1 -0
- package/dist/core.cjs +45 -23
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +29 -8
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +27 -6
- package/dist/core.native.esm.js.map +1 -1
- package/dist/exports/core.d.ts +4 -0
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/exports/index.d.ts +12 -0
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-szJOsbQN.cjs → getNetworkProviderFromNetworkId-BJ27N-7S.cjs} +44 -341
- package/dist/getNetworkProviderFromNetworkId-BJ27N-7S.cjs.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-JGrKwBj7.native.esm.js → getNetworkProviderFromNetworkId-Bs1kQdWk.native.esm.js} +38 -299
- package/dist/getNetworkProviderFromNetworkId-Bs1kQdWk.native.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-CEeFL-gV.esm.js → getNetworkProviderFromNetworkId-Cqp9eRSs.esm.js} +42 -270
- package/dist/getNetworkProviderFromNetworkId-Cqp9eRSs.esm.js.map +1 -0
- package/dist/{getSignedSessionId-BOx1nFt_.esm.js → getSignedSessionId-CDdKrnw6.esm.js} +3 -3
- package/dist/{getSignedSessionId-BOx1nFt_.esm.js.map → getSignedSessionId-CDdKrnw6.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-BxOK-Tdo.cjs → getSignedSessionId-CHDHr-hY.cjs} +3 -3
- package/dist/{getSignedSessionId-BxOK-Tdo.cjs.map → getSignedSessionId-CHDHr-hY.cjs.map} +1 -1
- package/dist/{getSignedSessionId-B5DikCap.native.esm.js → getSignedSessionId-D3KQrN8W.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-B5DikCap.native.esm.js.map → getSignedSessionId-D3KQrN8W.native.esm.js.map} +1 -1
- package/dist/getVerifiedCredentialForWalletAccount-BuUCX040.esm.js +269 -0
- package/dist/getVerifiedCredentialForWalletAccount-BuUCX040.esm.js.map +1 -0
- package/dist/getVerifiedCredentialForWalletAccount-Ciac5d5L.native.esm.js +269 -0
- package/dist/getVerifiedCredentialForWalletAccount-Ciac5d5L.native.esm.js.map +1 -0
- package/dist/getVerifiedCredentialForWalletAccount-gCx0smU8.cjs +346 -0
- package/dist/getVerifiedCredentialForWalletAccount-gCx0smU8.cjs.map +1 -0
- package/dist/index.cjs +580 -253
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +514 -194
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +511 -191
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-DUvZEpjA.native.esm.js → isMfaRequiredForAction-B0xNvBpU.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-DUvZEpjA.native.esm.js.map → isMfaRequiredForAction-B0xNvBpU.native.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-6N6JB7wa.cjs → isMfaRequiredForAction-CLMvTTwl.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-6N6JB7wa.cjs.map → isMfaRequiredForAction-CLMvTTwl.cjs.map} +1 -1
- package/dist/{isMfaRequiredForAction-D9p_du8C.esm.js → isMfaRequiredForAction-C_QPI1LH.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-D9p_du8C.esm.js.map → isMfaRequiredForAction-C_QPI1LH.esm.js.map} +1 -1
- package/dist/modules/apiClient/apiClient.types.d.ts +12 -0
- package/dist/modules/apiClient/apiClient.types.d.ts.map +1 -1
- package/dist/modules/apiClient/createApiClient.d.ts.map +1 -1
- package/dist/modules/apiClient/utils/sessionExpiryLogoutMiddleware/createSessionExpiryLogoutMiddleware.d.ts +27 -0
- package/dist/modules/apiClient/utils/sessionExpiryLogoutMiddleware/createSessionExpiryLogoutMiddleware.d.ts.map +1 -0
- package/dist/modules/auth/isSignedIn/isSignedIn.d.ts +11 -1
- package/dist/modules/auth/isSignedIn/isSignedIn.d.ts.map +1 -1
- package/dist/modules/auth/logoutReason.d.ts +1 -1
- package/dist/modules/auth/logoutReason.d.ts.map +1 -1
- package/dist/modules/auth/logoutWithReason/logoutWithReason.d.ts.map +1 -1
- package/dist/modules/balances/getBalances/getBalances.d.ts +9 -45
- package/dist/modules/balances/getBalances/getBalances.d.ts.map +1 -1
- package/dist/modules/balances/getMultichainBalances/getMultichainBalances.d.ts +13 -20
- package/dist/modules/balances/getMultichainBalances/getMultichainBalances.d.ts.map +1 -1
- package/dist/modules/balances/getMultichainTokenBalances/getMultichainTokenBalances.d.ts +26 -0
- package/dist/modules/balances/getMultichainTokenBalances/getMultichainTokenBalances.d.ts.map +1 -0
- package/dist/modules/balances/getMultichainTokenBalances/index.d.ts +2 -0
- package/dist/modules/balances/getMultichainTokenBalances/index.d.ts.map +1 -0
- package/dist/modules/balances/getTokenBalances/getTokenBalances.d.ts +56 -0
- package/dist/modules/balances/getTokenBalances/getTokenBalances.d.ts.map +1 -0
- package/dist/modules/balances/getTokenBalances/index.d.ts +3 -0
- package/dist/modules/balances/getTokenBalances/index.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.d.ts.map +1 -1
- package/dist/modules/funding/moonpay/errors/MoonPayCurrenciesFetchError.d.ts +5 -0
- package/dist/modules/funding/moonpay/errors/MoonPayCurrenciesFetchError.d.ts.map +1 -0
- package/dist/modules/funding/moonpay/errors/MoonPayInvalidUrlError.d.ts +5 -0
- package/dist/modules/funding/moonpay/errors/MoonPayInvalidUrlError.d.ts.map +1 -0
- package/dist/modules/funding/moonpay/errors/MoonPayProviderNotAvailableError.d.ts +5 -0
- package/dist/modules/funding/moonpay/errors/MoonPayProviderNotAvailableError.d.ts.map +1 -0
- package/dist/modules/funding/moonpay/getMoonPayCurrencies/getMoonPayCurrencies.d.ts +14 -0
- package/dist/modules/funding/moonpay/getMoonPayCurrencies/getMoonPayCurrencies.d.ts.map +1 -0
- package/dist/modules/funding/moonpay/getMoonPayCurrencies/index.d.ts +2 -0
- package/dist/modules/funding/moonpay/getMoonPayCurrencies/index.d.ts.map +1 -0
- package/dist/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.d.ts +15 -0
- package/dist/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.d.ts.map +1 -0
- package/dist/modules/funding/moonpay/getMoonPayUrl/index.d.ts +2 -0
- package/dist/modules/funding/moonpay/getMoonPayUrl/index.d.ts.map +1 -0
- package/dist/modules/funding/moonpay/moonpay.types.d.ts +26 -0
- package/dist/modules/funding/moonpay/moonpay.types.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainFromWalletSchema/getChainFromWalletSchema.d.ts +12 -0
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainFromWalletSchema/getChainFromWalletSchema.d.ts.map +1 -1
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainsFromWalletSchema/getChainsFromWalletSchema.d.ts +26 -0
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainsFromWalletSchema/getChainsFromWalletSchema.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/hasUsableDeeplink/hasUsableDeeplink.d.ts +18 -0
- package/dist/modules/legacyWalletBook/hasUsableDeeplink/hasUsableDeeplink.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/legacyWalletBook.types.d.ts +2 -2
- package/dist/modules/legacyWalletBook/legacyWalletBook.types.d.ts.map +1 -1
- package/dist/modules/swap/executeSwapTransaction/executeSwapTransaction.d.ts +13 -1
- package/dist/modules/swap/executeSwapTransaction/executeSwapTransaction.d.ts.map +1 -1
- package/dist/modules/user/refreshAuth/refreshAuth.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/buildMetaMaskSdkUriOptions/buildMetaMaskSdkUriOptions.d.ts +27 -0
- package/dist/modules/walletOptionsCatalogue/buildMetaMaskSdkUriOptions/buildMetaMaskSdkUriOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts +26 -0
- package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildWalletOption/buildWalletOption.d.ts +11 -4
- package/dist/modules/walletOptionsCatalogue/buildWalletOption/buildWalletOption.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/buildWithWalletProviderOptions/buildWithWalletProviderOptions.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/getInstallationLinkForCurrentPlatform.d.ts +35 -0
- package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/getInstallationLinkForCurrentPlatform.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/index.d.ts +2 -0
- package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/index.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts +6 -1
- package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts +11 -0
- package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts.map +1 -1
- package/dist/modules/wallets/constants.d.ts +7 -0
- package/dist/modules/wallets/constants.d.ts.map +1 -1
- package/dist/modules/wallets/getAvailableWalletProvidersData/getAvailableWalletProvidersData.d.ts.map +1 -1
- package/dist/modules/wallets/hasWalletProviderConnectMethod/hasWalletProviderConnectMethod.d.ts +26 -0
- package/dist/modules/wallets/hasWalletProviderConnectMethod/hasWalletProviderConnectMethod.d.ts.map +1 -0
- package/dist/modules/wallets/hasWalletProviderConnectMethod/index.d.ts +2 -0
- package/dist/modules/wallets/hasWalletProviderConnectMethod/index.d.ts.map +1 -0
- package/dist/modules/wallets/isAnyWalletAccountConnected/index.d.ts +2 -0
- package/dist/modules/wallets/isAnyWalletAccountConnected/index.d.ts.map +1 -0
- package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts +14 -0
- package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts.map +1 -0
- package/dist/modules/wallets/networks/getBalance/getBalance.d.ts +6 -17
- package/dist/modules/wallets/networks/getBalance/getBalance.d.ts.map +1 -1
- package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts +24 -0
- package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts.map +1 -0
- package/dist/modules/wallets/networks/getNativeBalance/index.d.ts +2 -0
- package/dist/modules/wallets/networks/getNativeBalance/index.d.ts.map +1 -0
- package/dist/modules/wallets/walletProvider/walletProvider.types.d.ts +10 -0
- package/dist/modules/wallets/walletProvider/walletProvider.types.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/getChainFromWalletBookIdentifier/getChainFromWalletBookIdentifier.d.ts +22 -0
- package/dist/utils/getChainFromWalletBookIdentifier/getChainFromWalletBookIdentifier.d.ts.map +1 -0
- package/dist/utils/getChainFromWalletBookIdentifier/index.d.ts +2 -0
- package/dist/utils/getChainFromWalletBookIdentifier/index.d.ts.map +1 -0
- package/dist/utils/getNativeLinkScheme/getNativeLinkScheme.d.ts +18 -0
- package/dist/utils/getNativeLinkScheme/getNativeLinkScheme.d.ts.map +1 -0
- package/dist/utils/getNativeLinkScheme/index.d.ts +3 -0
- package/dist/utils/getNativeLinkScheme/index.d.ts.map +1 -0
- package/dist/utils/isMobile/isMobile.d.ts +8 -0
- package/dist/utils/isMobile/isMobile.d.ts.map +1 -1
- package/dist/waas.cjs +8 -9
- package/dist/waas.cjs.map +1 -1
- package/dist/waas.esm.js +3 -3
- package/dist/waas.native.esm.js +3 -3
- package/dist/waasCore.cjs +3 -4
- package/dist/waasCore.cjs.map +1 -1
- package/dist/waasCore.esm.js +3 -3
- package/dist/waasCore.native.esm.js +3 -3
- package/package.json +4 -4
- package/dist/InvalidParamError-BPMi0iWC.esm.js.map +0 -1
- package/dist/InvalidParamError-CDmVW2DS.native.esm.js.map +0 -1
- package/dist/InvalidParamError-DEmLKJKZ.cjs.map +0 -1
- package/dist/NotWaasWalletAccountError-BZsBHRQe.cjs.map +0 -1
- package/dist/NotWaasWalletAccountError-Chpne8_Q.native.esm.js.map +0 -1
- package/dist/NotWaasWalletAccountError-Cntietge.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-CEeFL-gV.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-JGrKwBj7.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-szJOsbQN.cjs.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-B46O0B48.cjs +0 -887
- package/dist/getVerifiedCredentialForWalletAccount-B46O0B48.cjs.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-CyykSi-M.native.esm.js +0 -701
- package/dist/getVerifiedCredentialForWalletAccount-CyykSi-M.native.esm.js.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-DzwIoeHm.esm.js +0 -701
- package/dist/getVerifiedCredentialForWalletAccount-DzwIoeHm.esm.js.map +0 -1
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/buildUriDeeplinkOptions.d.ts +0 -28
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/buildUriDeeplinkOptions.d.ts.map +0 -1
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/index.d.ts +0 -2
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/index.d.ts.map +0 -1
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/index.d.ts +0 -2
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/index.d.ts.map +0 -1
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/resolveUriConnectionType.d.ts +0 -17
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/resolveUriConnectionType.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as instrumentFunction, X as assertDefined, c as createApiClient, ct as getDefaultClient, ft as getCore } from "./InvalidParamError-DkAMYJOW.native.esm.js";
|
|
2
2
|
|
|
3
3
|
//#region src/modules/mfa/consumeMfaToken/consumeMfaToken.ts
|
|
4
4
|
/**
|
|
@@ -76,4 +76,4 @@ const isMfaRequiredForAction = async ({ mfaAction }, client = getDefaultClient()
|
|
|
76
76
|
|
|
77
77
|
//#endregion
|
|
78
78
|
export { getMfaMethods as n, __consumeMfaToken_wrapped as r, isMfaRequiredForAction as t };
|
|
79
|
-
//# sourceMappingURL=isMfaRequiredForAction-
|
|
79
|
+
//# sourceMappingURL=isMfaRequiredForAction-B0xNvBpU.native.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isMfaRequiredForAction-
|
|
1
|
+
{"version":3,"file":"isMfaRequiredForAction-B0xNvBpU.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 * @redact-params\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":";;;;;;;;;;;;;;;AAmBA,MAAE,mBAAsB,SAAU,kBAAU,KAAA;;;AAK1C,eAAY,UAAI,qBAAA;kBAGhB,UAAO,MACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACdD,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-DKJhDrK8.cjs');
|
|
2
2
|
|
|
3
3
|
//#region src/modules/mfa/consumeMfaToken/consumeMfaToken.ts
|
|
4
4
|
/**
|
|
@@ -93,4 +93,4 @@ Object.defineProperty(exports, 'isMfaRequiredForAction', {
|
|
|
93
93
|
return isMfaRequiredForAction;
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
|
-
//# sourceMappingURL=isMfaRequiredForAction-
|
|
96
|
+
//# sourceMappingURL=isMfaRequiredForAction-CLMvTTwl.cjs.map
|
package/dist/{isMfaRequiredForAction-6N6JB7wa.cjs.map → isMfaRequiredForAction-CLMvTTwl.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isMfaRequiredForAction-
|
|
1
|
+
{"version":3,"file":"isMfaRequiredForAction-CLMvTTwl.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 * @redact-params\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":";;;;;;;;;;;;;;;AAmBA,MAAE,mBAAsB,SAAU,4CAAU,KAAA;;;AAK1C,yCAAY,UAAI,qBAAA;kBAGhB,UAAO,MACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACdD,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-D9p_du8C.esm.js → isMfaRequiredForAction-C_QPI1LH.esm.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Q as instrumentFunction, Y as assertDefined, c as createApiClient, dt as getCore, st as getDefaultClient } from "./InvalidParamError-DWjMfOZ5.esm.js";
|
|
2
2
|
|
|
3
3
|
//#region src/modules/mfa/consumeMfaToken/consumeMfaToken.ts
|
|
4
4
|
/**
|
|
@@ -76,4 +76,4 @@ const isMfaRequiredForAction = async ({ mfaAction }, client = getDefaultClient()
|
|
|
76
76
|
|
|
77
77
|
//#endregion
|
|
78
78
|
export { getMfaMethods as n, __consumeMfaToken_wrapped as r, isMfaRequiredForAction as t };
|
|
79
|
-
//# sourceMappingURL=isMfaRequiredForAction-
|
|
79
|
+
//# sourceMappingURL=isMfaRequiredForAction-C_QPI1LH.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isMfaRequiredForAction-
|
|
1
|
+
{"version":3,"file":"isMfaRequiredForAction-C_QPI1LH.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 * @redact-params\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":";;;;;;;;;;;;;;;AAmBA,MAAE,mBAAsB,SAAU,kBAAU,KAAA;;;AAK1C,eAAY,UAAI,qBAAA;kBAGhB,UAAO,MACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACdD,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"}
|
|
@@ -48,5 +48,17 @@ export type CreateApiClientOptions = {
|
|
|
48
48
|
* @default false
|
|
49
49
|
*/
|
|
50
50
|
includeMfaToken?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* When `true`, omits the session-expiry middleware so a 401 on this request
|
|
53
|
+
* does not trigger an automatic logout.
|
|
54
|
+
*
|
|
55
|
+
* Set this for endpoints that legitimately return 401 for non-session
|
|
56
|
+
* reasons (e.g. probing whether devices are registered), and for the
|
|
57
|
+
* session-revocation call made during logout itself, to avoid re-entering
|
|
58
|
+
* logout.
|
|
59
|
+
*
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
skipSessionExpiryLogout?: boolean;
|
|
51
63
|
};
|
|
52
64
|
//# sourceMappingURL=apiClient.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiClient.types.d.ts","sourceRoot":"","sources":["../../../src/modules/apiClient/apiClient.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,KAAK,GAAG,IAAI,CAAC;AAEzD,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,UAAU,CAAC;IAEtC;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAE7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"apiClient.types.d.ts","sourceRoot":"","sources":["../../../src/modules/apiClient/apiClient.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,KAAK,GAAG,IAAI,CAAC;AAEzD,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,UAAU,CAAC;IAEtC;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAE7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;;;;;;;;OAUG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createApiClient.d.ts","sourceRoot":"","sources":["../../../src/modules/apiClient/createApiClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAInE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"createApiClient.d.ts","sourceRoot":"","sources":["../../../src/modules/apiClient/createApiClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAInE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAkChE;;;;;GAKG;AACH,eAAO,MAAM,eAAe,YACjB,sBAAsB,sBACvB,aAAa,WA0EtB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Middleware } from '@dynamic-labs/sdk-api-core';
|
|
2
|
+
import type { DynamicClient } from '../../../../client/types';
|
|
3
|
+
/**
|
|
4
|
+
* Creates middleware that ends the local session when an *authenticated*
|
|
5
|
+
* request is rejected with a 401.
|
|
6
|
+
*
|
|
7
|
+
* A 401 on a request that carried an authenticated session means the backend
|
|
8
|
+
* rejected our credentials, so the local session is stale and must be cleared.
|
|
9
|
+
* The check is purely local (`client.user`) — we deliberately do not
|
|
10
|
+
* re-validate over the network, because the 401 itself is the rejection signal
|
|
11
|
+
* and re-validating would route back through this same middleware.
|
|
12
|
+
*
|
|
13
|
+
* Requests made without an authenticated session (e.g. pre-auth probes) are
|
|
14
|
+
* ignored — there is no session to invalidate. Endpoints that legitimately
|
|
15
|
+
* return 401 for non-session reasons opt out of this behavior by omitting the
|
|
16
|
+
* middleware (see `skipSessionExpiryLogout` on `createApiClient`).
|
|
17
|
+
*
|
|
18
|
+
* This middleware runs before the error-conversion middleware so it observes
|
|
19
|
+
* every 401 regardless of response body. The logout is fired as a side effect
|
|
20
|
+
* and the response is returned unchanged, so the downstream error middleware
|
|
21
|
+
* still throws the typed error to the caller.
|
|
22
|
+
*
|
|
23
|
+
* @param client - The Dynamic client instance.
|
|
24
|
+
* @not-instrumented
|
|
25
|
+
*/
|
|
26
|
+
export declare const createSessionExpiryLogoutMiddleware: (client: DynamicClient) => Middleware;
|
|
27
|
+
//# sourceMappingURL=createSessionExpiryLogoutMiddleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSessionExpiryLogoutMiddleware.d.ts","sourceRoot":"","sources":["../../../../../src/modules/apiClient/utils/sessionExpiryLogoutMiddleware/createSessionExpiryLogoutMiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAmB,MAAM,4BAA4B,CAAC;AAG9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAK9D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,mCAAmC,WACtC,aAAa,KACpB,UAsBD,CAAC"}
|
|
@@ -4,9 +4,19 @@
|
|
|
4
4
|
* The client is considered to be in a signed in state if a user has
|
|
5
5
|
* authenticated or if the client has at least one wallet connected.
|
|
6
6
|
*
|
|
7
|
+
* @deprecated What counts as "signed in" is your app's business logic, not the
|
|
8
|
+
* SDK's. This helper bakes in one opinion (a user OR any connected wallet),
|
|
9
|
+
* which rarely matches every app and forces a dependency on us for every
|
|
10
|
+
* variation. Compose your own check from the underlying primitives instead —
|
|
11
|
+
* e.g. `Boolean(client.user) || isAnyWalletAccountConnected(client)` — and
|
|
12
|
+
* layer in whatever your app requires (device registration, completed
|
|
13
|
+
* onboarding, satisfied MFA, a required embedded wallet, …). See the
|
|
14
|
+
* "Check if signed in" guide:
|
|
15
|
+
* https://www.dynamic.xyz/docs/javascript/user-session-management
|
|
16
|
+
*
|
|
7
17
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8
18
|
* @returns True if the user is signed in, false otherwise.
|
|
9
|
-
|
|
19
|
+
* @not-instrumented
|
|
10
20
|
*/
|
|
11
21
|
export declare const isSignedIn: (client?: import("../../../exports").DynamicClient) => boolean;
|
|
12
22
|
//# sourceMappingURL=isSignedIn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isSignedIn.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/isSignedIn/isSignedIn.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"isSignedIn.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/isSignedIn/isSignedIn.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,UAAU,gEACuC,CAAC"}
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* Surfaced in Datadog logout events so we can understand why users are being
|
|
5
5
|
* signed out.
|
|
6
6
|
*/
|
|
7
|
-
export type LogoutReason = 'user-intent' | 'token-expired' | 'keychain-migration-failed' | 'keychain-key-missing' | 'session-refresh-unauthorized' | 'user-refresh-failed' | 'user-deleted' | 'device-revoked' | 'all-devices-revoked';
|
|
7
|
+
export type LogoutReason = 'user-intent' | 'token-expired' | 'keychain-migration-failed' | 'keychain-key-missing' | 'session-refresh-unauthorized' | 'session-revoked' | 'user-refresh-failed' | 'user-deleted' | 'device-revoked' | 'all-devices-revoked';
|
|
8
8
|
//# sourceMappingURL=logoutReason.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logoutReason.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/logoutReason.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GACpB,aAAa,GACb,eAAe,GACf,2BAA2B,GAC3B,sBAAsB,GACtB,8BAA8B,GAC9B,qBAAqB,GACrB,cAAc,GACd,gBAAgB,GAChB,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"logoutReason.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/logoutReason.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GACpB,aAAa,GACb,eAAe,GACf,2BAA2B,GAC3B,sBAAsB,GACtB,8BAA8B,GAC9B,iBAAiB,GACjB,qBAAqB,GACrB,cAAc,GACd,gBAAgB,GAChB,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logoutWithReason.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/logoutWithReason/logoutWithReason.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAU3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,eACf;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,UAC5B,aAAa,
|
|
1
|
+
{"version":3,"file":"logoutWithReason.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/logoutWithReason/logoutWithReason.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAU3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,eACf;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,UAC5B,aAAa,kBAqDtB,CAAC"}
|
|
@@ -1,49 +1,13 @@
|
|
|
1
|
-
import type { TokenBalance } from '@dynamic-labs/sdk-api-core';
|
|
2
|
-
import type { WalletAccount } from '../../wallets/walletAccount';
|
|
3
|
-
type GetBalancesBaseParams = {
|
|
4
|
-
/**
|
|
5
|
-
* Whether to filter out spam tokens.
|
|
6
|
-
* Defaults to true.
|
|
7
|
-
* @not-instrumented
|
|
8
|
-
*/
|
|
9
|
-
filterSpamTokens?: boolean;
|
|
10
|
-
/** Whether to force a refresh of the balances instead of using the api cached value. */
|
|
11
|
-
forceRefresh?: boolean;
|
|
12
|
-
/** Whether to include the native token balance. */
|
|
13
|
-
includeNative?: boolean;
|
|
14
|
-
/** Whether to include the prices of the tokens. */
|
|
15
|
-
includePrices?: boolean;
|
|
16
|
-
/** The wallet account to get the balances for. */
|
|
17
|
-
walletAccount: WalletAccount;
|
|
18
|
-
/** If provided, only return balances for the specified contracts. */
|
|
19
|
-
whitelistedContracts?: Array<string>;
|
|
20
|
-
};
|
|
21
|
-
export type GetBalancesParams = GetBalancesBaseParams & ({
|
|
22
|
-
/**
|
|
23
|
-
* The network ID to get the balances for.
|
|
24
|
-
* If neither `networkId` nor `networkIds` is provided, the active network ID will be used.
|
|
25
|
-
* Mutually exclusive with `networkIds`.
|
|
26
|
-
*/
|
|
27
|
-
networkId?: number;
|
|
28
|
-
networkIds?: never;
|
|
29
|
-
} | {
|
|
30
|
-
networkId?: never;
|
|
31
|
-
/**
|
|
32
|
-
* The network IDs to get the balances for.
|
|
33
|
-
* Mutually exclusive with `networkId`.
|
|
34
|
-
*/
|
|
35
|
-
networkIds?: string[];
|
|
36
|
-
});
|
|
37
1
|
/**
|
|
38
|
-
*
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
* @
|
|
43
|
-
*
|
|
44
|
-
*
|
|
2
|
+
* @deprecated Use {@link GetTokenBalancesParams} instead. Renamed for clarity.
|
|
3
|
+
*/
|
|
4
|
+
export type { GetTokenBalancesParams as GetBalancesParams } from '../getTokenBalances/getTokenBalances';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use {@link getTokenBalances} instead. Renamed so its name
|
|
7
|
+
* states what it returns (a wallet account's token balances) and is no
|
|
8
|
+
* longer confusable with the native-only `getBalance` or the
|
|
9
|
+
* multi-chain `getMultichainTokenBalances`.
|
|
45
10
|
* @not-instrumented
|
|
46
11
|
*/
|
|
47
|
-
export
|
|
48
|
-
export {};
|
|
12
|
+
export { getTokenBalances as getBalances } from '../getTokenBalances/getTokenBalances';
|
|
49
13
|
//# sourceMappingURL=getBalances.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBalances.d.ts","sourceRoot":"","sources":["../../../../src/modules/balances/getBalances/getBalances.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"getBalances.d.ts","sourceRoot":"","sources":["../../../../src/modules/balances/getBalances/getBalances.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,YAAY,EAAE,sBAAsB,IAAI,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAExG;;;;;;GAMG;AACH,OAAO,EAAE,gBAAgB,IAAI,WAAW,EAAE,MAAM,sCAAsC,CAAC"}
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
import type { MultichainAccountBalanceResponse, MultichainAccountBalancesRequest, MultichainAccountBalancesRequestBalanceRequests } from '@dynamic-labs/sdk-api-core';
|
|
2
|
-
import type { Chain } from '../../chain/chain.types';
|
|
3
|
-
export type GetMultichainBalancesBalanceRequest = Omit<MultichainAccountBalancesRequest, 'balanceRequests'> & {
|
|
4
|
-
balanceRequests: Array<Omit<MultichainAccountBalancesRequestBalanceRequests, 'chain'> & {
|
|
5
|
-
chain: Chain;
|
|
6
|
-
}>;
|
|
7
|
-
};
|
|
8
|
-
export type GetMultichainBalancesParams = {
|
|
9
|
-
balanceRequest: GetMultichainBalancesBalanceRequest;
|
|
10
|
-
};
|
|
11
1
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* This function fetches cryptocurrency and token balances for the user's
|
|
15
|
-
* wallet addresses across different chains, networks and addresses specified in the request.
|
|
16
|
-
*
|
|
17
|
-
* @param params.balanceRequest - The balance request configuration specifying which chains, networks and addresses to query.
|
|
18
|
-
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
19
|
-
* @returns A promise that resolves to the chain balances across multiple networks.
|
|
20
|
-
* @not-instrumented
|
|
2
|
+
* @deprecated Use {@link GetMultichainTokenBalancesBalanceRequest} instead. Renamed for clarity.
|
|
21
3
|
*/
|
|
22
|
-
export
|
|
4
|
+
export type { GetMultichainTokenBalancesBalanceRequest as GetMultichainBalancesBalanceRequest } from '../getMultichainTokenBalances/getMultichainTokenBalances';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use {@link GetMultichainTokenBalancesParams} instead. Renamed for clarity.
|
|
7
|
+
*/
|
|
8
|
+
export type { GetMultichainTokenBalancesParams as GetMultichainBalancesParams } from '../getMultichainTokenBalances/getMultichainTokenBalances';
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use {@link getMultichainTokenBalances} instead. Renamed so
|
|
11
|
+
* the name aligns with `getTokenBalances` and signals that this fetches
|
|
12
|
+
* token balances (not native-only) across multiple chains.
|
|
13
|
+
* @not-instrumented
|
|
14
|
+
*/
|
|
15
|
+
export { getMultichainTokenBalances as getMultichainBalances } from '../getMultichainTokenBalances/getMultichainTokenBalances';
|
|
23
16
|
//# sourceMappingURL=getMultichainBalances.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMultichainBalances.d.ts","sourceRoot":"","sources":["../../../../src/modules/balances/getMultichainBalances/getMultichainBalances.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"getMultichainBalances.d.ts","sourceRoot":"","sources":["../../../../src/modules/balances/getMultichainBalances/getMultichainBalances.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,YAAY,EAAE,wCAAwC,IAAI,mCAAmC,EAAE,MAAM,0DAA0D,CAAC;AAEhK;;GAEG;AACH,YAAY,EAAE,gCAAgC,IAAI,2BAA2B,EAAE,MAAM,0DAA0D,CAAC;AAEhJ;;;;;GAKG;AACH,OAAO,EAAE,0BAA0B,IAAI,qBAAqB,EAAE,MAAM,0DAA0D,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { MultichainAccountBalanceResponse, MultichainAccountBalancesRequest, MultichainAccountBalancesRequestBalanceRequests } from '@dynamic-labs/sdk-api-core';
|
|
2
|
+
import type { Chain } from '../../chain/chain.types';
|
|
3
|
+
export type GetMultichainTokenBalancesBalanceRequest = Omit<MultichainAccountBalancesRequest, 'balanceRequests'> & {
|
|
4
|
+
balanceRequests: Array<Omit<MultichainAccountBalancesRequestBalanceRequests, 'chain'> & {
|
|
5
|
+
chain: Chain;
|
|
6
|
+
}>;
|
|
7
|
+
};
|
|
8
|
+
export type GetMultichainTokenBalancesParams = {
|
|
9
|
+
balanceRequest: GetMultichainTokenBalancesBalanceRequest;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves token balances across multiple chains, networks, and addresses
|
|
13
|
+
* in a single batched API request.
|
|
14
|
+
*
|
|
15
|
+
* Use this for portfolio-style views that need to render a user's holdings
|
|
16
|
+
* across their entire multi-chain wallet set. For a single account on one
|
|
17
|
+
* chain, use {@link getTokenBalances}; for native-only balance, use
|
|
18
|
+
* {@link getNativeBalance}.
|
|
19
|
+
*
|
|
20
|
+
* @param params.balanceRequest - The balance request configuration specifying which chains, networks and addresses to query.
|
|
21
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
22
|
+
* @returns A promise that resolves to the chain balances across multiple networks.
|
|
23
|
+
* @not-instrumented
|
|
24
|
+
*/
|
|
25
|
+
export declare const getMultichainTokenBalances: ({ balanceRequest }: GetMultichainTokenBalancesParams, client?: import("../../../exports").DynamicClient) => Promise<MultichainAccountBalanceResponse["chainBalances"]>;
|
|
26
|
+
//# sourceMappingURL=getMultichainTokenBalances.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMultichainTokenBalances.d.ts","sourceRoot":"","sources":["../../../../src/modules/balances/getMultichainTokenBalances/getMultichainTokenBalances.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gCAAgC,EAChC,gCAAgC,EAChC,+CAA+C,EAChD,MAAM,4BAA4B,CAAC;AAKpC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD,MAAM,MAAM,wCAAwC,GAClD,IAAI,CAAC,gCAAgC,EAAE,iBAAiB,CAAC,GAAG;IAC1D,eAAe,EAAE,KAAK,CACpB,IAAI,CAAC,+CAA+C,EAAE,OAAO,CAAC,GAAG;QAC/D,KAAK,EAAE,KAAK,CAAC;KACd,CACF,CAAC;CACH,CAAC;AAEJ,MAAM,MAAM,gCAAgC,GAAG;IAC7C,cAAc,EAAE,wCAAwC,CAAC;CAC1D,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,0BAA0B,uBACjB,gCAAgC,wDAEnD,OAAO,CAAC,gCAAgC,CAAC,eAAe,CAAC,CAW3D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/balances/getMultichainTokenBalances/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,KAAK,gCAAgC,GACtC,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { TokenBalance } from '@dynamic-labs/sdk-api-core';
|
|
2
|
+
import type { WalletAccount } from '../../wallets/walletAccount';
|
|
3
|
+
type GetTokenBalancesBaseParams = {
|
|
4
|
+
/**
|
|
5
|
+
* Whether to filter out spam tokens.
|
|
6
|
+
* Defaults to true.
|
|
7
|
+
* @not-instrumented
|
|
8
|
+
*/
|
|
9
|
+
filterSpamTokens?: boolean;
|
|
10
|
+
/** Whether to force a refresh of the balances instead of using the api cached value. */
|
|
11
|
+
forceRefresh?: boolean;
|
|
12
|
+
/** Whether to include the native token balance. */
|
|
13
|
+
includeNative?: boolean;
|
|
14
|
+
/** Whether to include the prices of the tokens. */
|
|
15
|
+
includePrices?: boolean;
|
|
16
|
+
/** The wallet account to get the balances for. */
|
|
17
|
+
walletAccount: WalletAccount;
|
|
18
|
+
/** If provided, only return balances for the specified contracts. */
|
|
19
|
+
whitelistedContracts?: Array<string>;
|
|
20
|
+
};
|
|
21
|
+
export type GetTokenBalancesParams = GetTokenBalancesBaseParams & ({
|
|
22
|
+
/**
|
|
23
|
+
* The network ID to get the balances for.
|
|
24
|
+
* If neither `networkId` nor `networkIds` is provided, the active network ID will be used.
|
|
25
|
+
* Mutually exclusive with `networkIds`.
|
|
26
|
+
*/
|
|
27
|
+
networkId?: number;
|
|
28
|
+
networkIds?: never;
|
|
29
|
+
} | {
|
|
30
|
+
networkId?: never;
|
|
31
|
+
/**
|
|
32
|
+
* The network IDs to get the balances for.
|
|
33
|
+
* Mutually exclusive with `networkId`.
|
|
34
|
+
*/
|
|
35
|
+
networkIds?: string[];
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* Retrieves the token balances for a wallet account on one chain. Fetched
|
|
39
|
+
* from the Dynamic API.
|
|
40
|
+
*
|
|
41
|
+
* Use this for ERC-20-style token balances scoped to a single wallet
|
|
42
|
+
* account. Supports optional spam filtering, price inclusion, native-token
|
|
43
|
+
* inclusion, and one-or-many networks within the wallet's chain.
|
|
44
|
+
*
|
|
45
|
+
* For native-only balance, use {@link getNativeBalance}. For a
|
|
46
|
+
* multi-chain portfolio across many addresses, use
|
|
47
|
+
* {@link getMultichainTokenBalances}.
|
|
48
|
+
*
|
|
49
|
+
* @param params.walletAccount - The wallet account to get the balances for.
|
|
50
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
51
|
+
* @returns A promise that resolves to an array of token balances.
|
|
52
|
+
* @not-instrumented
|
|
53
|
+
*/
|
|
54
|
+
export declare const getTokenBalances: ({ walletAccount, networkId, networkIds, includePrices, includeNative, filterSpamTokens, whitelistedContracts, forceRefresh, }: GetTokenBalancesParams, client?: import("../../../exports").DynamicClient) => Promise<TokenBalance[]>;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=getTokenBalances.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTokenBalances.d.ts","sourceRoot":"","sources":["../../../../src/modules/balances/getTokenBalances/getTokenBalances.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAM1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,KAAK,0BAA0B,GAAG;IAChC;;;;OAIG;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,kDAAkD;IAClD,aAAa,EAAE,aAAa,CAAC;IAC7B,qEAAqE;IACrE,oBAAoB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,0BAA0B,GAC7D,CACI;IACE;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,KAAK,CAAC;CACpB,GACD;IACE,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,CACJ,CAAC;AAEJ;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,kIAUxB,sBAAsB,wDAExB,OAAO,CAAC,YAAY,EAAE,CA8BxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/balances/getTokenBalances/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRegisteredDevices.d.ts","sourceRoot":"","sources":["../../../../src/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAO7E,wBAAwB;AACxB,eAAO,MAAM,oBAAoB,yDAE9B,OAAO,CAAC,0BAA0B,EAAE,
|
|
1
|
+
{"version":3,"file":"getRegisteredDevices.d.ts","sourceRoot":"","sources":["../../../../src/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAO7E,wBAAwB;AACxB,eAAO,MAAM,oBAAoB,yDAE9B,OAAO,CAAC,0BAA0B,EAAE,CAuBtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoonPayCurrenciesFetchError.d.ts","sourceRoot":"","sources":["../../../../../src/modules/funding/moonpay/errors/MoonPayCurrenciesFetchError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,qBAAa,2BAA4B,SAAQ,SAAS;;CAUzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoonPayInvalidUrlError.d.ts","sourceRoot":"","sources":["../../../../../src/modules/funding/moonpay/errors/MoonPayInvalidUrlError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,qBAAa,sBAAuB,SAAQ,SAAS;;CAWpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoonPayProviderNotAvailableError.d.ts","sourceRoot":"","sources":["../../../../../src/modules/funding/moonpay/errors/MoonPayProviderNotAvailableError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,qBAAa,gCAAiC,SAAQ,SAAS;;CAW9D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DynamicClient } from '../../../../client/types';
|
|
2
|
+
import type { GetMoonPayCurrenciesParams, MoonPayCurrency } from '../moonpay.types';
|
|
3
|
+
/**
|
|
4
|
+
* Fetches the list of crypto currencies supported by MoonPay for the given chain
|
|
5
|
+
* and network, filtered to active currencies only. Requires a MoonPay publishable
|
|
6
|
+
* API key to be configured for the environment.
|
|
7
|
+
*
|
|
8
|
+
* @param params - The chain and optional network ID to filter currencies by.
|
|
9
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
10
|
+
* @returns An array of supported MoonPay currencies.
|
|
11
|
+
* @instrumented
|
|
12
|
+
*/
|
|
13
|
+
export declare const getMoonPayCurrencies: (params: GetMoonPayCurrenciesParams, client?: DynamicClient) => Promise<MoonPayCurrency[]>;
|
|
14
|
+
//# sourceMappingURL=getMoonPayCurrencies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMoonPayCurrencies.d.ts","sourceRoot":"","sources":["../../../../../src/modules/funding/moonpay/getMoonPayCurrencies/getMoonPayCurrencies.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEpF;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,WACvB,0BAA0B,WAC1B,aAAa,KACpB,OAAO,CAAC,eAAe,EAAE,CAa3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/funding/moonpay/getMoonPayCurrencies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DynamicClient } from '../../../../client/types';
|
|
2
|
+
import type { GetMoonPayUrlParams } from '../moonpay.types';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the signed MoonPay URL for the given wallet and token.
|
|
5
|
+
*
|
|
6
|
+
* Uses the Dynamic onramp API to retrieve the pre-signed URL that can be
|
|
7
|
+
* opened in a browser tab to allow the user to purchase crypto via MoonPay.
|
|
8
|
+
*
|
|
9
|
+
* @param params - Parameters including chain, wallet address, and optional token/currency filters.
|
|
10
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
11
|
+
* @returns The signed MoonPay URL.
|
|
12
|
+
* @instrumented
|
|
13
|
+
*/
|
|
14
|
+
export declare const getMoonPayUrl: (params: GetMoonPayUrlParams, client?: DynamicClient) => Promise<string>;
|
|
15
|
+
//# sourceMappingURL=getMoonPayUrl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMoonPayUrl.d.ts","sourceRoot":"","sources":["../../../../../src/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,WAChB,mBAAmB,WACnB,aAAa,KACpB,OAAO,CAAC,MAAM,CAsChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/funding/moonpay/getMoonPayUrl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Chain } from '../../chain';
|
|
2
|
+
export type MoonPayCurrency = {
|
|
3
|
+
code: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
export type GetMoonPayCurrenciesParams = {
|
|
8
|
+
chain: Chain;
|
|
9
|
+
networkId?: string;
|
|
10
|
+
};
|
|
11
|
+
export type GetMoonPayUrlParams = {
|
|
12
|
+
chain: Chain;
|
|
13
|
+
/** ISO 4217 fiat currency code (e.g. 'USD') used as the quote currency. */
|
|
14
|
+
currency?: string;
|
|
15
|
+
merchantName?: string;
|
|
16
|
+
networkId?: string;
|
|
17
|
+
/** Token symbol or MoonPay currency code to lock in the widget (e.g. 'USDC', 'usdc_polygon'). */
|
|
18
|
+
token?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Pre-filled fiat amount in the quote currency — maps to MoonPay's `quoteCurrencyAmount`.
|
|
21
|
+
* This is the amount the user will spend in fiat, not the crypto amount they receive.
|
|
22
|
+
*/
|
|
23
|
+
tokenAmount?: number;
|
|
24
|
+
walletAddress: string;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=moonpay.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moonpay.types.d.ts","sourceRoot":"","sources":["../../../../src/modules/funding/moonpay/moonpay.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iGAAiG;IACjG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC"}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import type { Chain } from '../../../chain';
|
|
2
2
|
import type { WalletSchema } from '../../legacyWalletBook.types';
|
|
3
|
+
type ExtractChainPrefixParams = {
|
|
4
|
+
chainIdentifier: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Extracts the chain prefix from a chain identifier string.
|
|
8
|
+
* For example, "eip155:1" -> "eip155", "solana:..." -> "solana"
|
|
9
|
+
*
|
|
10
|
+
* Exported so {@link getChainsFromWalletSchema} can apply the same
|
|
11
|
+
* parsing to its multi-chain pass without duplicating the logic.
|
|
12
|
+
* @not-instrumented
|
|
13
|
+
*/
|
|
14
|
+
export declare const extractChainPrefix: ({ chainIdentifier, }: ExtractChainPrefixParams) => string;
|
|
3
15
|
type GetChainFromWalletSchemaParams = {
|
|
4
16
|
wallet: WalletSchema;
|
|
5
17
|
walletKey?: string;
|