import { n as __exportAll } from "./chunk-BEJ448es.mjs";
//#region extensions/crypto/src/services/bankr-types.ts
var bankr_types_exports = /* @__PURE__ */ __exportAll({
	BankrAccessError: () => BankrAccessError,
	BankrAuthError: () => BankrAuthError,
	BankrRateLimitError: () => BankrRateLimitError,
	BankrReadOnlyError: () => BankrReadOnlyError,
	BankrServerError: () => BankrServerError,
	CHAIN_MAP: () => CHAIN_MAP,
	isBankrClubActive: () => isBankrClubActive
});
/** Map from our chain names to Bankr chain names */
const CHAIN_MAP = {
	base: "base",
	ethereum: "mainnet",
	mainnet: "mainnet",
	eth: "mainnet",
	polygon: "polygon",
	unichain: "unichain",
	solana: "solana",
	sol: "solana"
};
/** Normalize bankrClub to a boolean regardless of API shape */
function isBankrClubActive(info) {
	if (typeof info.bankrClub === "boolean") return info.bankrClub;
	return info.bankrClub?.active ?? false;
}
var BankrAuthError = class extends Error {
	constructor(message = "Invalid or expired BANKR_API_KEY") {
		super(message);
		this.name = "BankrAuthError";
	}
};
var BankrAccessError = class extends Error {
	constructor(message = "Agent API not enabled on this key. Enable at bankr.bot/api") {
		super(message);
		this.name = "BankrAccessError";
	}
};
var BankrReadOnlyError = class extends Error {
	constructor(message = "Key is read-only — cannot sign or submit transactions") {
		super(message);
		this.name = "BankrReadOnlyError";
	}
};
var BankrRateLimitError = class extends Error {
	resetAt;
	limit;
	used;
	constructor(resetAt, limit, used) {
		super(`Rate limited. Resets at ${new Date(resetAt).toISOString()}. Used ${used}/${limit}.`);
		this.name = "BankrRateLimitError";
		this.resetAt = resetAt;
		this.limit = limit;
		this.used = used;
	}
};
var BankrServerError = class extends Error {
	statusCode;
	constructor(statusCode, message = "Bankr API server error") {
		super(`${message} (${statusCode}). Try again in a moment.`);
		this.name = "BankrServerError";
		this.statusCode = statusCode;
	}
};
//#endregion
export { BankrServerError as a, BankrReadOnlyError as i, BankrAuthError as n, bankr_types_exports as o, BankrRateLimitError as r, BankrAccessError as t };

//# sourceMappingURL=bankr-types-E81UZ9-c.mjs.map