/** * AIFINP-224 — SDK Environment & Protocol Version resolver (Solana). * * The Solana sibling of deploymentResolver.ts (AIFINP-223). Same idea — one * place that answers "which deployment does the SDK use?" given an environment, * a network and a requested version — shaped for Solana, where a deployment is * a base58 program id + IDL rather than an EVM address record. * * Two axes, mirroring the EVM resolver: * environment — "dev" | "prod". Development supports devnet only; production * uses mainnet-beta. Both read their v1.4 artifacts from solana-contract's * dev branch (bundled in solanaV14Deployments.generated.ts). * version — "v1.4" | "auto" (and "v1.2" is accepted at the type level for * parity with EVM). An explicit "v1.4" never silently downgrades. * * FALLBACK DIFFERS FROM EVM — READ THIS. The EVM resolver falls back v1.4 -> v1.2. * Solana has NO v1.2-equivalent splitter: the old program was closed and removed * from mainnet, and the SDK never bundled it (it reads the Solana program id at * runtime from the bridge's pay_solana challenge). So there is nothing to fall * back to. Therefore: * - "auto" resolves v1.4 where deployed, and otherwise throws * NoSolanaDeploymentError (no invented downgrade). * - an explicit "v1.2" always throws SolanaV12UnavailableError, because no * Solana v1.2 deployment exists. * This is an open product question for Paul: whether the EVM v1.2/v1.4 fallback * model should map onto Solana at all. Until a real Solana fallback exists, this * resolver refuses to pretend one does. * * Program ids live in solanaV14Deployments.generated.ts, never inline here — * this module is selection logic only. */ import type { SdkEnvironment } from "./deploymentResolver.js"; import { DeploymentResolverError } from "./deploymentErrors.js"; import { type SolanaV14Deployment } from "./generated/solanaV14Deployments.generated.js"; /** Selectable protocol versions on the request side. "v1.2" exists for parity * with the EVM selector but has no Solana deployment behind it. */ export type SolanaProtocolVersion = "v1.2" | "v1.4"; /** What a caller may ask for. "auto" (the default) resolves v1.4, or throws if * it is not deployed for the environment+network — Solana has no fallback. */ export type SolanaRequestedVersion = SolanaProtocolVersion | "auto"; export interface ResolveSolanaDeploymentOptions { environment: SdkEnvironment; /** Cluster name: "devnet", or "mainnet"/"mainnet-beta". Case-insensitive. */ network: string; /** Defaults to "auto". */ version?: SolanaRequestedVersion; } /** The resolved Solana deployment. Only v1.4 is ever returned; the field is * kept for symmetry with the EVM resolver's discriminated union. */ export interface ResolvedSolanaDeployment { version: "v1.4"; environment: SdkEnvironment; network: "devnet" | "mainnet"; programId: string; deployment: SolanaV14Deployment; } /** The development environment was asked for a cluster other than devnet. */ export declare class UnsupportedSolanaDevNetworkError extends DeploymentResolverError { readonly network: string; constructor(network: string); } /** Explicit "v1.4" requested but not deployed for this environment+network. * Thrown rather than downgrading. */ export declare class SolanaVersionUnavailableError extends DeploymentResolverError { readonly requested: SolanaProtocolVersion; constructor(requested: SolanaProtocolVersion, environment: SdkEnvironment, network: string); } /** Explicit "v1.2" requested — no Solana v1.2 splitter exists at all. Distinct * from SolanaVersionUnavailableError so callers can tell "not on this network" * from "does not exist on Solana". */ export declare class SolanaV12UnavailableError extends DeploymentResolverError { constructor(); } /** The program exists, but settlement is quarantined until verification and * governance gates are complete. */ export declare class SolanaDeploymentDisabledError extends DeploymentResolverError { readonly environment: SdkEnvironment; readonly network: string; readonly reason: string; constructor(environment: SdkEnvironment, network: string, reason: string); } /** No Solana v1.4 deployment exists for this environment+network, and Solana * has no fallback version. */ export declare class NoSolanaDeploymentError extends DeploymentResolverError { constructor(environment: SdkEnvironment, network: string); } /** Is a Solana v1.4 deployment available for this environment+network? */ export declare function isSolanaV14Available(environment: SdkEnvironment, network: string): boolean; /** * Resolve the Solana deployment the SDK should use. The single source of truth * for Solana environment + protocol-version selection. * * @throws UnsupportedSolanaDevNetworkError dev asked for a non-devnet cluster * @throws SolanaV12UnavailableError explicit v1.2 (none exists on Solana) * @throws SolanaVersionUnavailableError explicit v1.4 not deployed here * @throws NoSolanaDeploymentError auto, but no v1.4 for this env+network */ export declare function resolveSolanaDeployment(options: ResolveSolanaDeploymentOptions): ResolvedSolanaDeployment; //# sourceMappingURL=solanaDeploymentResolver.d.ts.map