import { D as instrumentFunction, F as getDefaultClient, R as BaseError, u as __createApiClient_wrapped, z as getCore } from "./InvalidParamError-0lP4zZBe.esm.js";
import { r as __updateAuthFromVerifyResponse_wrapped } from "./getVerifiedCredentialForWalletAccount-DEkVcH8j.esm.js";

//#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
*/
const refreshAuth = async (client = getDefaultClient()) => {
	const core = getCore(client);
	const response = await __createApiClient_wrapped({}, client).refreshAuth({ environmentId: core.environmentId });
	__updateAuthFromVerifyResponse_wrapped({ 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
export { __refreshAuth_wrapped as n, NotWaasWalletAccountError as t };
//# sourceMappingURL=NotWaasWalletAccountError-BAD01hkG.esm.js.map