const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-Btejc5g3.cjs');
const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-CElYpi97.cjs');
let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");

//#region src/modules/user/refreshAuth/refreshAuth.ts
/**
* Refreshes the current user's data from the server.
*
* This function fetches the latest user information and token from the backend
* updating the local user and token states with any changes.
*
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
* @returns A promise that resolves to the verify response.
* @instrumented
* @redact-params
*/
const refreshAuth = async (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
	const core = require_updateAuthFromVerifyResponse.getCore(client);
	const response = await require_updateAuthFromVerifyResponse.createApiClient({}, client).refreshAuth({ environmentId: core.environmentId });
	require_updateAuthFromVerifyResponse.updateAuthFromVerifyResponse({ response }, client);
	return response;
};
const __refreshAuth_impl = refreshAuth;
const __refreshAuth_wrapped = require_updateAuthFromVerifyResponse.instrumentFunction({
	fn: __refreshAuth_impl,
	functionName: "refreshAuth",
	getCore: () => {
		try {
			return require_updateAuthFromVerifyResponse.getCore(require_updateAuthFromVerifyResponse.getDefaultClient());
		} catch {
			return;
		}
	},
	redactAll: true
});

//#endregion
//#region src/errors/NotWaasWalletAccountError.ts
var NotWaasWalletAccountError = class extends require_updateAuthFromVerifyResponse.BaseError {
	constructor({ walletAddress }) {
		super({
			cause: null,
			code: "not_waas_wallet_account_error",
			docsUrl: null,
			name: "NotWaasWalletAccountError",
			shortMessage: `Wallet account ${walletAddress} is not a Dynamic WaaS wallet account`
		});
	}
};

//#endregion
//#region src/modules/waas/isDynamicWaasEnabled/isDynamicWaasEnabled.ts
/**
* Checks if Dynamic WaaS (Wallet as a Service) is enabled for the current project.
*
* This function examines the project settings to determine if Dynamic WaaS is
* enabled in the Dynamic Dashboard or not.
*
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
* @returns True if Dynamic WaaS is enabled, false otherwise.
* @notInstrumented
*/
const isDynamicWaasEnabled = (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
	const projectSettings = client.projectSettings;
	require_updateAuthFromVerifyResponse.assertDefined(projectSettings, "Project settings are not available");
	return projectSettings.sdk.embeddedWallets?.defaultWalletVersion === _dynamic_labs_sdk_api_core.EmbeddedWalletVersionEnum.V3;
};

//#endregion
Object.defineProperty(exports, 'NotWaasWalletAccountError', {
  enumerable: true,
  get: function () {
    return NotWaasWalletAccountError;
  }
});
Object.defineProperty(exports, '__refreshAuth_wrapped', {
  enumerable: true,
  get: function () {
    return __refreshAuth_wrapped;
  }
});
Object.defineProperty(exports, 'isDynamicWaasEnabled', {
  enumerable: true,
  get: function () {
    return isDynamicWaasEnabled;
  }
});
//# sourceMappingURL=isDynamicWaasEnabled-BwP1oowd.cjs.map