import { St as getCore, n as updateAuthFromVerifyResponse, q as createApiClient, ut as assertDefined, vt as getDefaultClient, xt as BaseError, y as instrumentFunction } from "./NativeModuleNotLinkedError-DsfdAti9.native.esm.js";
import { EmbeddedWalletVersionEnum } from "@dynamic-labs/sdk-api-core";

//#region src/modules/user/refreshAuth/refreshAuth.ts
/**
* Refreshes the current session's authentication from the server.
*
* This rotates the auth token via a full verify call and updates both the
* token and the user state from the response, returning the raw
* `VerifyResponse` (which includes the new token). Reach for this when you
* need a fresh JWT — e.g. before a call that requires a non-expired token.
*
* Prefer `refreshUser` when you only need the latest user profile and do not
* care about rotating the token: it hits the authenticated-user endpoint,
* touches only the user state, and returns the `SdkUser` directly.
*
* @example
* ```ts
* const response = await refreshAuth();
* console.log('Token refreshed:', response.token);
* ```
*
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
* @returns A promise that resolves to the verify response.
* @see logout
* @see refreshUser
* @instrumented
*/
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;
		}
	}
});

//#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-CsNM4kzO.native.esm.js.map