import { K as createApiClient, _t as getCore, gt as BaseError, ot as assertDefined, pt as getDefaultClient, t as updateAuthFromVerifyResponse, v as instrumentFunction } from "./updateAuthFromVerifyResponse-azIi_3FB.esm.js";
import { EmbeddedWalletVersionEnum } from "@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 = getDefaultClient()) => {
	const core = getCore(client);
	const response = await createApiClient({}, client).refreshAuth({ environmentId: core.environmentId });
	updateAuthFromVerifyResponse({ response }, client);
	return response;
};
const __refreshAuth_impl = refreshAuth;
const __refreshAuth_wrapped = instrumentFunction({
	fn: __refreshAuth_impl,
	functionName: "refreshAuth",
	getCore: () => {
		try {
			return getCore(getDefaultClient());
		} catch {
			return;
		}
	},
	redactAll: true
});

//#endregion
//#region src/errors/NotWaasWalletAccountError.ts
var NotWaasWalletAccountError = class extends 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 = getDefaultClient()) => {
	const projectSettings = client.projectSettings;
	assertDefined(projectSettings, "Project settings are not available");
	return projectSettings.sdk.embeddedWallets?.defaultWalletVersion === EmbeddedWalletVersionEnum.V3;
};

//#endregion
export { NotWaasWalletAccountError as n, __refreshAuth_wrapped as r, isDynamicWaasEnabled as t };
//# sourceMappingURL=isDynamicWaasEnabled-BYaqAOml.esm.js.map