import { Transport, createClient, CallOptions, Interceptor } from '@connectrpc/connect'; import { GrpcWebTransportOptions } from '@connectrpc/connect-web'; import { U as FilterParamValue$1, T as Filter$1, bt as PageResponse$1, br as PageRequest$1, c6 as TransactionVmError, bW as Transaction$1, bZ as TransactionExecutionResult, c2 as TransactionStatus, c4 as TransactionView, bU as SubmissionStatus, bA as RawTransaction, q as BatchSendTransactionsResponse } from './query_service_pb-Ci7T_0DF.cjs'; import { a as PubkeyInput, P as Pubkey } from './Pubkey-5aF03Qyx.cjs'; import { S as Signature$1, x as TsSignature, C as ConsensusStatus, V as VersionContext } from './account_pb-nVy1q-D5.cjs'; /** Outer-transaction signature scheme used by transaction signing helpers. */ declare enum TransactionSigningScheme { Rfc8032 = "rfc8032", Legacy = "legacy" } type PartialTransportOptions = Partial; interface ThruClientConfig { baseUrl?: string; transport?: Transport; transportOptions?: PartialTransportOptions; interceptors?: Interceptor[]; callOptions?: CallOptions; transactionSigningScheme?: TransactionSigningScheme; } type QueryClient = ReturnType>; type CommandClient = ReturnType>; type StreamingClient = ReturnType>; interface ThruClientContext { baseUrl: string; transport: Transport; query: QueryClient; command: CommandClient; streaming: StreamingClient; callOptions?: CallOptions; transactionSigningScheme: TransactionSigningScheme; } type SignatureInput = Uint8Array | string | Signature; declare class Signature { private readonly bytes; private constructor(); static from(value: SignatureInput): Signature; static fromProto(proto?: Signature$1): Signature; static isThruFmt(value: string): boolean; toBytes(): Uint8Array; toBytesUnsafe(): Uint8Array; toThruFmt(): string; toHex(): string; equals(other: SignatureInput): boolean; toProtoSignature(): Signature$1; toProtoTsSignature(): TsSignature; static fromProtoTsSignature(proto?: TsSignature): Signature; static fromProtoSignature(proto?: Signature$1): Signature; private static bytesFromString; } type FilterParamValueCase = "stringValue" | "bytesValue" | "boolValue" | "intValue" | "doubleValue" | "uintValue" | "pubkeyValue" | "signatureValue" | "taPubkeyValue" | "tsSignatureValue"; declare class FilterParamValue { private readonly case?; private readonly value?; private constructor(); static none(): FilterParamValue; static string(value: string): FilterParamValue; static bytes(value: Uint8Array): FilterParamValue; static bool(value: boolean): FilterParamValue; static int(value: bigint): FilterParamValue; static double(value: number): FilterParamValue; static uint(value: number | bigint): FilterParamValue; static pubkey(value: PubkeyInput): FilterParamValue; static signature(value: SignatureInput): FilterParamValue; static taPubkey(value: PubkeyInput | string): FilterParamValue; static tsSignature(value: SignatureInput): FilterParamValue; static fromProto(proto: FilterParamValue$1): FilterParamValue; toProto(): FilterParamValue$1; getCase(): FilterParamValueCase | undefined; getString(): string | undefined; getBytes(): Uint8Array | undefined; getBool(): boolean | undefined; getInt(): bigint | undefined; getUint(): bigint | undefined; getDouble(): number | undefined; getPubkey(): Uint8Array | undefined; getSignature(): Uint8Array | undefined; getTaPubkey(): string | undefined; getTsSignature(): string | undefined; } interface FilterParamsInit { [key: string]: FilterParamValue; } declare class Filter { readonly expression?: string; private readonly params; constructor(init?: { expression?: string; params?: FilterParamsInit | Map | Iterable<[string, FilterParamValue]>; }); static fromProto(proto: Filter$1): Filter; toProto(): Filter$1; hasParam(name: string): boolean; getParam(name: string): FilterParamValue | undefined; listParams(): string[]; entries(): [string, FilterParamValue][]; withExpression(expression?: string): Filter; withParam(name: string, value: FilterParamValue): Filter; withoutParam(name: string): Filter; private setParamInternal; } interface PageRequestParams { pageSize?: number; pageToken?: string; orderBy?: string; } declare class PageRequest { readonly pageSize?: number; readonly pageToken?: string; readonly orderBy?: string; constructor(params?: PageRequestParams); static fromProto(proto?: PageRequest$1): PageRequest | undefined; toProto(): PageRequest$1; withParams(params: PageRequestParams): PageRequest; } interface PageResponseParams { nextPageToken?: string; totalSize?: bigint; } declare class PageResponse { readonly nextPageToken?: string; readonly totalSize?: bigint; constructor(params?: PageResponseParams); static fromProto(proto?: PageResponse$1): PageResponse | undefined; toProto(): PageResponse$1; hasNextPage(): boolean; } interface ResourceLimits { computeUnits?: number; stateUnits?: number; memoryUnits?: number; } interface OptionalProofs { feePayerStateProof?: Uint8Array; feePayerAccountMetaRaw?: Uint8Array; } interface TransactionHeaderInput extends ResourceLimits { fee: bigint; nonce: bigint; startSlot: bigint; expiryAfter?: number; chainId?: number; flags?: number; } interface TransactionAccountsInput { readWriteAccounts?: PubkeyInput[]; readOnlyAccounts?: PubkeyInput[]; } /** * Context provided to instruction data functions. * Contains all transaction accounts in their final sorted order and helper functions * for looking up account indexes. */ interface InstructionContext { /** All accounts in final transaction order: [feePayer, program, ...readWrite, ...readOnly] */ accounts: Pubkey[]; /** Get the index of an account by its public key. Throws if account is not found in transaction. */ getAccountIndex: (pubkey: PubkeyInput) => number; } interface FeePayerInput { publicKey: PubkeyInput; privateKey?: Uint8Array; } /** * Function that builds instruction data with access to the final account ordering. * Use this when your instruction data contains account indices. */ type InstructionDataBuilder = (context: InstructionContext) => Uint8Array | string; interface BuildTransactionParams { feePayer: FeePayerInput; program: PubkeyInput; header: TransactionHeaderInput; accounts?: TransactionAccountsInput; /** * Static instruction data. Use this when your instruction data does not * contain account indices, or when you've pre-computed the indices. */ instructionData?: Uint8Array | string; /** * Builder function that receives the final account ordering. * Use this when your instruction data contains account indices to ensure * they match the post-sort transaction layout. * * @example * ```typescript * buildInstructionData: ({ getAccountIndex }) => { * return buildMyInstruction( * getAccountIndex(configAddress), * getAccountIndex(trancheAddress), * ); * } * ``` */ buildInstructionData?: InstructionDataBuilder; proofs?: OptionalProofs; transactionSigningScheme?: TransactionSigningScheme; } interface BuiltTransactionResult { transaction: TransactionLike; } interface SignedTransactionResult extends BuiltTransactionResult { signature: Signature; rawTransaction: Uint8Array; } interface TransactionLike { toWire(): Uint8Array; } interface TransactionExecutionEvent { eventId: string; callIdx: number; programIdx: number; program?: Pubkey; payload: Uint8Array; } interface TransactionExecutionResultData { consumedComputeUnits: number; consumedMemoryUnits: number; consumedStateUnits: number; userErrorCode: bigint; vmError: TransactionVmError; executionResult: bigint; pagesUsed: number; eventsCount: number; eventsSize: number; readwriteAccounts: Pubkey[]; readonlyAccounts: Pubkey[]; events?: TransactionExecutionEvent[]; errorProgramAccIdx: number; /** * The nonce the runtime requires for the next transaction from this fee * payer. Set only when `vmError` is a nonce reject (NONCE_TOO_LOW / * NONCE_TOO_HIGH); undefined otherwise. A nonce reject does not advance the * nonce, so retrying with this value is correct. * * Canonical at execution time, not necessarily on arrival: another * transaction from the same fee payer may have landed since. Treat it as a * correction to retry against, not a reservation. */ feePayerExpectedNonce?: bigint; } declare class Transaction { readonly version: number; readonly feePayer: Pubkey; readonly program: Pubkey; readonly fee: bigint; readonly nonce: bigint; readonly startSlot: bigint; readonly expiryAfter: number; readonly chainId: number; readonly requestedComputeUnits: number; readonly requestedStateUnits: number; readonly requestedMemoryUnits: number; readonly flags: number; readonly readWriteAccounts: Pubkey[]; readonly readOnlyAccounts: Pubkey[]; readonly instructionData?: Uint8Array; readonly instructionDataSize?: number; readonly feePayerStateProof?: Uint8Array; readonly feePayerAccountMetaRaw?: Uint8Array; executionResult?: TransactionExecutionResultData; slot?: bigint; blockOffset?: number; private signature?; constructor(params: { version?: number; feePayer: PubkeyInput; program: PubkeyInput; header: TransactionHeaderInput; accounts?: TransactionAccountsInput; instructionData?: Uint8Array; instructionDataSize?: number; proofs?: OptionalProofs; }); static fromWire(data: Uint8Array): Transaction; static parseWire(data: Uint8Array, options?: { strict?: boolean; }): { transaction: Transaction; size: number; }; static fromProto(proto: Transaction$1): Transaction; getSignature(): Signature | undefined; setSignature(signature: Signature): void; sign(privateKey: Uint8Array): Promise; /** * Sign using the pre-RFC-8032 Thru transaction scheme. * * This compatibility method is only for networks that have not completed * the coordinated signing cutover. New integrations must use {@link sign}. */ legacySign(privateKey: Uint8Array): Promise; toWireForSigning(): Uint8Array; toWire(): Uint8Array; private createHeader; private buildWirePayload; private static parseBodySections; private static ensureAvailable; private static parseStateProof; static executionResultFromProto(proto: TransactionExecutionResult): TransactionExecutionResultData; } type StreamTransactionUpdate = { kind: "partial"; signature: Uint8Array; slot?: bigint; executionResult?: ReturnType; } | { kind: "full"; transaction: Transaction; }; interface TrackTransactionUpdate { signature?: Uint8Array; status: string; statusCode: ConsensusStatus; slot?: bigint; executionResult?: ReturnType; transaction?: Transaction; } interface TransactionStatusParams { signature: Uint8Array; consensusStatus?: ConsensusStatus; executionResult?: ReturnType; } declare class TransactionStatusSnapshot { readonly signature: Uint8Array; readonly statusCode?: ConsensusStatus; readonly status?: string; readonly executionResult?: ReturnType; constructor(params: TransactionStatusParams); static fromProto(proto: TransactionStatus): TransactionStatusSnapshot; } interface TransactionFeePayerConfig { publicKey: PubkeyInput; privateKey?: Uint8Array; } interface TransactionAccountsConfig { readWrite?: PubkeyInput[]; readOnly?: PubkeyInput[]; } interface TransactionHeaderConfig { fee?: bigint; nonce?: bigint; startSlot?: bigint; expiryAfter?: number; chainId?: number; computeUnits?: number; stateUnits?: number; memoryUnits?: number; flags?: number; } /** * Instruction data can be either: * - A Uint8Array directly * - A function that takes an InstructionContext and returns a Uint8Array */ type InstructionData = Uint8Array | string | ((context: InstructionContext) => Promise); interface BuildTransactionOptions { feePayer: TransactionFeePayerConfig; program: PubkeyInput; header?: TransactionHeaderConfig; accounts?: TransactionAccountsConfig; instructionData?: InstructionData; feePayerStateProof?: Uint8Array; feePayerAccountMetaRaw?: Uint8Array; } interface BuildAndSignTransactionOptions extends BuildTransactionOptions { feePayer: TransactionFeePayerConfig & { privateKey: Uint8Array; }; transactionSigningScheme?: TransactionSigningScheme; } interface TransactionQueryOptions { view?: TransactionView; versionContext?: VersionContext; minConsensus?: ConsensusStatus; } interface RawTransactionQueryOptions { versionContext?: VersionContext; minConsensus?: ConsensusStatus; } interface ListTransactionsForAccountOptions { filter?: Filter; page?: PageRequest; transactionOptions?: TransactionQueryOptions; } interface TransactionList { transactions: Transaction[]; page?: PageResponse; } interface ListTransactionsOptions { filter?: Filter; page?: PageRequest; returnEvents?: boolean; versionContext?: VersionContext; minConsensus?: ConsensusStatus; } declare function getTransaction(ctx: ThruClientContext, signature: SignatureInput, options?: TransactionQueryOptions): Promise; declare function getRawTransaction(ctx: ThruClientContext, signature: SignatureInput, options?: RawTransactionQueryOptions): Promise; declare function getTransactionStatus(ctx: ThruClientContext, signature: SignatureInput): Promise; declare function listTransactionsForAccount(ctx: ThruClientContext, account: PubkeyInput, options?: ListTransactionsForAccountOptions): Promise; declare function listTransactions(ctx: ThruClientContext, options?: ListTransactionsOptions): Promise; declare function buildTransaction(ctx: ThruClientContext, options: BuildTransactionOptions): Promise; declare function buildAndSignTransaction(ctx: ThruClientContext, options: BuildAndSignTransactionOptions): Promise; declare function sendTransaction(ctx: ThruClientContext, transaction: Transaction | Uint8Array): Promise; interface BatchSendTransactionsOptions { numRetries?: number; } type BatchTrackStatus = "executed" | "finalized_without_execution" | "timeout" | "not_accepted" | "cancelled" | "track_error"; interface BatchSendAndTrackOptions extends BatchSendTransactionsOptions { trackTimeoutMs?: number; signal?: AbortSignal; } interface BatchSendAndTrackResult { signature: string; accepted: boolean; trackStatus: BatchTrackStatus; update?: TrackTransactionUpdate; executionResult?: TransactionExecutionResultData; error?: unknown; } declare function batchSendTransactions(ctx: ThruClientContext, transactions: (Transaction | Uint8Array)[], options?: BatchSendTransactionsOptions): Promise; declare function batchSendAndTrack(ctx: ThruClientContext, transactions: (Transaction | Uint8Array)[], options?: BatchSendAndTrackOptions): Promise; interface SendAndTrackTxnOptions { timeoutMs?: number; signal?: AbortSignal; } interface SendAndTrackTxnUpdate { status: SubmissionStatus; signature?: { value: Uint8Array; }; consensusStatus: number; executionResult?: { vmError: number; consumedComputeUnits: number; userErrorCode: bigint; /** * Set only on a nonce reject: the nonce the runtime requires for the * next transaction from this fee payer. Retry against this value. */ feePayerExpectedNonce?: bigint; }; } declare function sendAndTrackTxn(ctx: ThruClientContext, transaction: Transaction | Uint8Array, options?: SendAndTrackTxnOptions): AsyncIterable; type transactions_BatchSendAndTrackOptions = BatchSendAndTrackOptions; type transactions_BatchSendAndTrackResult = BatchSendAndTrackResult; type transactions_BatchSendTransactionsOptions = BatchSendTransactionsOptions; type transactions_BatchTrackStatus = BatchTrackStatus; type transactions_BuildAndSignTransactionOptions = BuildAndSignTransactionOptions; type transactions_BuildTransactionOptions = BuildTransactionOptions; type transactions_InstructionData = InstructionData; type transactions_ListTransactionsForAccountOptions = ListTransactionsForAccountOptions; type transactions_ListTransactionsOptions = ListTransactionsOptions; type transactions_RawTransactionQueryOptions = RawTransactionQueryOptions; type transactions_SendAndTrackTxnOptions = SendAndTrackTxnOptions; type transactions_SendAndTrackTxnUpdate = SendAndTrackTxnUpdate; type transactions_TransactionAccountsConfig = TransactionAccountsConfig; type transactions_TransactionFeePayerConfig = TransactionFeePayerConfig; type transactions_TransactionHeaderConfig = TransactionHeaderConfig; type transactions_TransactionList = TransactionList; type transactions_TransactionQueryOptions = TransactionQueryOptions; declare const transactions_batchSendAndTrack: typeof batchSendAndTrack; declare const transactions_batchSendTransactions: typeof batchSendTransactions; declare const transactions_buildAndSignTransaction: typeof buildAndSignTransaction; declare const transactions_buildTransaction: typeof buildTransaction; declare const transactions_getRawTransaction: typeof getRawTransaction; declare const transactions_getTransaction: typeof getTransaction; declare const transactions_getTransactionStatus: typeof getTransactionStatus; declare const transactions_listTransactions: typeof listTransactions; declare const transactions_listTransactionsForAccount: typeof listTransactionsForAccount; declare const transactions_sendAndTrackTxn: typeof sendAndTrackTxn; declare const transactions_sendTransaction: typeof sendTransaction; declare namespace transactions { export { type transactions_BatchSendAndTrackOptions as BatchSendAndTrackOptions, type transactions_BatchSendAndTrackResult as BatchSendAndTrackResult, type transactions_BatchSendTransactionsOptions as BatchSendTransactionsOptions, type transactions_BatchTrackStatus as BatchTrackStatus, type transactions_BuildAndSignTransactionOptions as BuildAndSignTransactionOptions, type transactions_BuildTransactionOptions as BuildTransactionOptions, type transactions_InstructionData as InstructionData, type transactions_ListTransactionsForAccountOptions as ListTransactionsForAccountOptions, type transactions_ListTransactionsOptions as ListTransactionsOptions, type transactions_RawTransactionQueryOptions as RawTransactionQueryOptions, type transactions_SendAndTrackTxnOptions as SendAndTrackTxnOptions, type transactions_SendAndTrackTxnUpdate as SendAndTrackTxnUpdate, type transactions_TransactionAccountsConfig as TransactionAccountsConfig, type transactions_TransactionFeePayerConfig as TransactionFeePayerConfig, type transactions_TransactionHeaderConfig as TransactionHeaderConfig, type transactions_TransactionList as TransactionList, type transactions_TransactionQueryOptions as TransactionQueryOptions, transactions_batchSendAndTrack as batchSendAndTrack, transactions_batchSendTransactions as batchSendTransactions, transactions_buildAndSignTransaction as buildAndSignTransaction, transactions_buildTransaction as buildTransaction, transactions_getRawTransaction as getRawTransaction, transactions_getTransaction as getTransaction, transactions_getTransactionStatus as getTransactionStatus, transactions_listTransactions as listTransactions, transactions_listTransactionsForAccount as listTransactionsForAccount, transactions_sendAndTrackTxn as sendAndTrackTxn, transactions_sendTransaction as sendTransaction }; } interface ThruTransactionReviewSimulation { before?: string; after?: string; } interface ThruTransactionReviewAbiReflection { label?: string; kind?: string | null; typeName?: string; value?: unknown; rawHex?: string; source?: string; error?: string; } interface ThruTransactionReviewPayload { appName?: string; programAddress?: string; abiName?: string; instruction?: string; simulation?: ThruTransactionReviewSimulation; abiReflection?: ThruTransactionReviewAbiReflection; } interface ThruTransactionIntent { /** * Maximum state growth in 4 KiB units, rounded per account. Defaults to 0: * set it for any transaction that creates or grows an account. */ stateUnits?: number; walletAddress?: string; programAddress: string; instructionData: string; readWriteAddresses?: string[]; readOnlyAddresses?: string[]; review?: ThruTransactionReviewPayload; /** @internal Used by ThruSigningSession handles. */ signingSessionId?: string; } interface PendingCompressionTransaction { signature: string; nonce: bigint; validUntilSlot: bigint; } /** A durable journal belongs to one network and fee payer; never store keys in it. */ interface CompressionJournal { load(): Promise; save(pending: PendingCompressionTransaction | undefined): Promise; /** Persist cleanup handles before an uploader creation transaction may be sent. */ saveUpload?(upload: UploadCleanup): Promise; } interface CompressionOptions { programAddresses?: { compression?: string; multicall?: string; uploader?: string; passkeyManager?: string; }; signal?: AbortSignal; fee?: bigint; timeoutMs?: number; pollIntervalMs?: number; maxTransactionBytes?: number; journal?: CompressionJournal; } type KeypairCompressionOptions = CompressionOptions & { feePayer: TransactionFeePayerConfig & { privateKey: Uint8Array; }; walletAddress?: never; signTransaction?: never; }; /** Uses the wallet's existing intent -> base64 signed transaction contract. */ type WalletCompressionOptions = CompressionOptions & { feePayer: Pick & { privateKey?: never; }; walletAddress: string; signTransaction(intent: ThruTransactionIntent): Promise; }; type DecompressionOptions = KeypairCompressionOptions | WalletCompressionOptions; interface UploadPair { meta: string; buffer: string; } type AccountOutcome = { address: string; status: "active" | "restored" | "compressed" | "deleted" | "skipped"; signatures: string[]; }; interface UploadCleanup extends UploadPair { /** Retain the original uploader for cleanup after configuration changes/restarts. */ uploader?: string; status: "pending" | "cleaned" | "failed"; error?: string; } interface CompressionResult { accounts: AccountOutcome[]; signatures: string[]; uploads: UploadCleanup[]; } type CompressionErrorCode = "MISSING_ACCOUNT" | "NOT_READY" | "INVALID_IMAGE" | "TRANSACTION_TOO_LARGE" | "TRANSACTION_FAILED" | "TRANSACTION_UNCERTAIN" | "RPC_ERROR" | "CANCELLED" | "CLEANUP_FAILED"; declare class CompressionError extends Error { readonly code: CompressionErrorCode; readonly details: { address?: string; retrySlot?: bigint; signature?: string; vmError?: number; userErrorCode?: bigint; result?: CompressionResult; cause?: unknown; }; readonly cause?: unknown; constructor(code: CompressionErrorCode, message: string, details?: { address?: string; retrySlot?: bigint; signature?: string; vmError?: number; userErrorCode?: bigint; result?: CompressionResult; cause?: unknown; }); } type AccountCompressionStatus = { address: string; status: "ACTIVE" | "COMPRESSED" | "DOES_NOT_EXIST"; /** Compression archive slot, when the RPC supplies it. */ compressionSlot?: bigint; retrySlot?: bigint; }; export { batchSendAndTrack as $, type AccountCompressionStatus as A, type BatchSendAndTrackOptions as B, CompressionError as C, type DecompressionOptions as D, type ThruTransactionReviewSimulation as E, Filter as F, type TrackTransactionUpdate as G, Transaction as H, type InstructionContext as I, type TransactionAccountsConfig as J, type KeypairCompressionOptions as K, type ListTransactionsForAccountOptions as L, type TransactionExecutionEvent as M, type TransactionExecutionResultData as N, type TransactionFeePayerConfig as O, PageRequest as P, type TransactionHeaderConfig as Q, type RawTransactionQueryOptions as R, type SendAndTrackTxnOptions as S, type ThruClientConfig as T, type TransactionHeaderInput as U, type TransactionList as V, type TransactionQueryOptions as W, TransactionSigningScheme as X, TransactionStatusSnapshot as Y, type UploadCleanup as Z, type WalletCompressionOptions as _, type AccountOutcome as a, batchSendTransactions as a0, buildAndSignTransaction as a1, buildTransaction as a2, getRawTransaction as a3, getTransaction as a4, getTransactionStatus as a5, listTransactions as a6, listTransactionsForAccount as a7, sendAndTrackTxn as a8, sendTransaction as a9, transactions as aa, type BatchSendAndTrackResult as b, type BatchSendTransactionsOptions as c, type BatchTrackStatus as d, type BuildAndSignTransactionOptions as e, type BuildTransactionOptions as f, type BuildTransactionParams as g, type CompressionErrorCode as h, type CompressionJournal as i, type CompressionOptions as j, type CompressionResult as k, FilterParamValue as l, type InstructionData as m, type PageRequestParams as n, PageResponse as o, type PageResponseParams as p, type PendingCompressionTransaction as q, type SendAndTrackTxnUpdate as r, Signature as s, type SignatureInput as t, type SignedTransactionResult as u, type StreamTransactionUpdate as v, type ThruClientContext as w, type ThruTransactionIntent as x, type ThruTransactionReviewAbiReflection as y, type ThruTransactionReviewPayload as z };