import { V1Transaction, type V1ResourceConfig, type V1TransactionContext } from "./program/transaction"; import type { Connection, PublicKey, SignatureStatus, SignatureStatusConfig } from "@solana/web3.js"; import type { ClientContext } from "./context"; import type { Exchange, GlobalDepositToken } from "./program/types"; /** * Stores exact live facts for a validated canonical Tokenkeg WSOL account. * * `canonicalWsolAccountInfo` returns all fields from one confirmed account read. * Direct structural construction does not perform that validation. */ export interface CanonicalWsolAccountInfo { /** Full account lamports, including native amount, rent, and direct donations. */ accountLamports: bigint; /** Decoded SPL native-token amount in lamports. */ tokenAmountLamports: bigint; /** Decoded native-account rent reserve in lamports. */ nativeReserveLamports: bigint; } export declare class Rpc { private readonly client; constructor(client: ClientContext); /** * Get the currently-active Connection, or throw if not configured. * * Prefer the typed methods (getExchange, etc.) — they include automatic * failover. Direct use of inner() bypasses the retry/failover wrapper. */ inner(): Connection; getExchangePda(): PublicKey; /** Event-authority PDA appended to every public instruction. */ getEventAuthorityPda(): PublicKey; getGlobalDepositTokenPda(mint: PublicKey): PublicKey; getUserGlobalDepositPda(user: PublicKey, mint: PublicKey): PublicKey; /** * Get the latest blockhash and its expiry height, at `confirmed` * commitment (pinned, not the Connection's default — matching the Rust * and Python SDKs). */ getLatestBlockhash(): Promise<{ blockhash: string; lastValidBlockHeight: number; }>; /** Get the current block height at `confirmed` commitment. */ getBlockHeight(): Promise; /** Distinguish a missing account from an unavailable confirmed RPC read. */ accountExists(address: PublicKey): Promise; /** * Return exact confirmed facts for a wallet's canonical WSOL account. * * `address` must equal the supplied wallet's Tokenkeg native-mint ATA. Missing * accounts return `null`. A present account must have the legacy Token Program * owner, native mint, wallet authority, initialized state, native reserve, and * no foreign close authority. Token amount plus native reserve must fit Solana's * unsigned 64-bit range and cannot exceed the account balance. Unsafe JSON-number * account lamports return an error instead of being rounded. */ canonicalWsolAccountInfo(address: PublicKey, wallet: PublicKey): Promise; /** * Return whether the validated canonical WSOL account is present. * * This compatibility method delegates all address, owner, state, authority, and * lamport checks to `canonicalWsolAccountInfo`. */ canonicalWsolAccountExists(address: PublicKey, wallet: PublicKey): Promise; /** Return the current rent-exempt minimum in lamports for `dataLength` account bytes. */ minimumBalanceForRentExemption(dataLength: number): Promise; /** Return the confirmed Native SOL Balance for `feePayer`, in lamports. */ balanceLamports(feePayer: PublicKey): Promise; /** Fetch a blockhash/expiry pair with explicitly configured transaction resources. */ transactionContext(): Promise; /** Fetch a fresh context with caller-selected limits and total priority fee lamports. */ transactionContextWithResources(resources: V1ResourceConfig): Promise; /** Alias of estimatePreparedTransactionFee; does not prepare or modify the message. */ prepareAndEstimateTransactionFee(transaction: V1Transaction): Promise; /** Return the exact message fee in lamports; a missing estimate fails closed. */ estimatePreparedTransactionFee(transaction: V1Transaction): Promise; /** Require feature activation in the same confirmed bank used for the account read. */ ensureV1Supported(): Promise; /** Simulate exact fully signed bytes with signature checks and no blockhash replacement. */ simulateTransaction(transaction: V1Transaction): Promise; /** Verify, simulate, and send once. An ambiguous result retains signature and expiry. */ submitSignedTransaction(transaction: V1Transaction): Promise; /** Retry and fail over read-only requests while retaining their exact parameters. */ private v1ReadRequest; /** One HTTP attempt without the legacy Connection's rate-limit retries. */ private v1Request; /** * Get the statuses of recently submitted transactions. * * Returns one entry per signature, in order; `null` means the cluster has * not seen the signature (or, unless `config.searchTransactionHistory` is * set, it has aged out of the recent-status cache). */ getSignatureStatuses(signatures: string[], config?: SignatureStatusConfig): Promise<(SignatureStatus | null)[]>; /** * Wait until `signature` reaches `confirmed` commitment, or throw a * terminal `SdkError`. * * Polls `getSignatureStatuses` (with automatic failover) until the cluster * reports the transaction as `confirmed` or `finalized`. * `lastValidBlockHeight` bounds the wait: pass the height returned * alongside the transaction's blockhash, or `null` when the submitted * transaction's original lifetime is unknown (for example a historical * signature imported without its context) — expiry is then never reported and only the poll cap * ends the wait. Terminal outcomes: * * - `"TransactionFailed"` — the transaction landed but errored on-chain; * resubmitting the same transaction would fail again. * - `"TransactionExpired"` — the chain moved past `lastValidBlockHeight` * on consecutive height samples and a history-searching status check * still cannot see the signature; reconcile the signature and authoritative state before rebuilding. * - `"ConfirmationTimeout"` — the outcome could not be determined * (persistent RPC errors or the poll cap); check the signature on-chain * before resubmitting. */ confirmSignature(signature: string, lastValidBlockHeight: number | null): Promise; /** * Same as {@link confirmSignature}, but returns the confirmed status so * callers can use the transaction's processing slot. */ confirmSignatureStatus(signature: string, lastValidBlockHeight: number | null): Promise; getExchange(): Promise; getGlobalDepositToken(mint: PublicKey): Promise; } /** Resource usage reported for the exact signed v1 message. */ export interface TransactionSimulation { slot: number; /** Compute units consumed during simulation. */ unitsConsumed?: number; /** Total loaded account data, in bytes. */ loadedAccountsDataSize?: number; logs: string[]; } //# sourceMappingURL=rpc.d.ts.map