import { V1Transaction, type V1ResourceConfig } from "./program/transaction"; import { type Connection, type PublicKey, type TransactionInstruction } from "@solana/web3.js"; import type { LightconeHttp } from "./http"; import type { AuthCredentials } from "./auth"; import type { DepositSource, OrderbookRules } from "./shared"; import { type SigningStrategy } from "./shared/signing"; import { type RpcFailoverState } from "./rpcFailover"; export interface ClientContext { readonly http: LightconeHttp; readonly programId: PublicKey; readonly primaryConnection?: Connection; readonly backupConnection?: Connection; readonly rpcFailoverState: RpcFailoverState; readonly depositSource: DepositSource; readonly signingStrategy?: SigningStrategy; /** Trusted application assertion that an external sponsor pays fees; omission is false. */ readonly transactionSponsorshipEnabled?: boolean; readonly transactionResources?: V1ResourceConfig; /** Fetch implementation used for canonical v1 JSON-RPC requests, including one-shot sends. */ readonly rpcFetch?: typeof fetch; /** Optional cached identity for auth-bound operations; callers must check expiry. */ readonly authCredentials?: AuthCredentials; orderNonce?(): number | undefined; setOrderNonce?(nonce: number): void; readonly orderbookRulesCache?: Map>; /** @deprecated Use primaryConnection — kept for backward compat in domain sub-clients. */ readonly connection?: Connection; } export declare function requireConnection(ctx: ClientContext): Connection; export declare function connectionWithFailover(ctx: ClientContext, operation: (conn: Connection) => Promise): Promise; export declare function resolveDepositSource(ctx: ClientContext, overrideSource: DepositSource | undefined): DepositSource; export declare function requireSigningStrategy(ctx: ClientContext): SigningStrategy; /** @internal Submit builder-owned instructions after local validation, before fetching context. */ export declare function signAndSubmitInstructions(ctx: ClientContext, instructions: TransactionInstruction[], payer: PublicKey): Promise; /** Confirmed signature and the slot required by authoritative balance refresh. */ export interface ConfirmedTransaction { signature: string; slot: number; } /** Sign and send one immutable v1 transaction with its original resources and expiry. */ export declare function signAndSubmitTx(ctx: ClientContext, tx: V1Transaction): Promise; /** Sign, submit once, and wait for confirmed commitment using the original expiry. */ export declare function signAndSubmitTxConfirmed(ctx: ClientContext, tx: V1Transaction): Promise; /** Sign and confirm the exact prepared message, returning its processing slot. */ export declare function signAndSubmitTxConfirmedWithSlot(ctx: ClientContext, tx: V1Transaction): Promise; /** Prepared and ordinary v1 messages use the same immutable submission contract. */ export declare function signAndSubmitPreparedTxConfirmedWithSlot(ctx: ClientContext, tx: V1Transaction): Promise; /** @internal Submit with an identity-bound strategy captured before planning. */ export declare function signAndSubmitTxConfirmedUsingStrategy(ctx: ClientContext, tx: V1Transaction, strategy: SigningStrategy): Promise; //# sourceMappingURL=context.d.ts.map