import { U as TransactionHeaderInput, F as Filter, P as PageRequest, w as ThruClientContext, o as PageResponse, H as Transaction, v as StreamTransactionUpdate, t as SignatureInput, G as TrackTransactionUpdate, j as CompressionOptions, e as BuildAndSignTransactionOptions, A as AccountCompressionStatus, D as DecompressionOptions, k as CompressionResult, K as KeypairCompressionOptions, Z as UploadCleanup, a4 as getTransaction, a3 as getRawTransaction, a5 as getTransactionStatus, a6 as listTransactions, a7 as listTransactionsForAccount, a2 as buildTransaction, a1 as buildAndSignTransaction, a9 as sendTransaction, a0 as batchSendTransactions, $ as batchSendAndTrack, a8 as sendAndTrackTxn, s as Signature, T as ThruClientConfig } from './compression-B2GOyyvH.cjs'; import { a as PubkeyInput, P as Pubkey } from './Pubkey-5aF03Qyx.cjs'; import { A as Account, a as AccountMeta } from './Account-CZyLjJZO.cjs'; import { j as AccountView, V as VersionContext, D as DataSlice, C as ConsensusStatus, R as RawAccount } from './account_pb-nVy1q-D5.cjs'; import { R as ExecutionStatus, t as BlockFooter$1, x as BlockHeader$1, s as Block$1, C as BlockView, by as RawBlock, a9 as GetChainInfoResponse, P as Event, at as GetNodeStatusResponse, al as GetNodePubkeyResponse, ap as GetNodeRecordsResponse, bK as StateProof$1, bQ as StateProofType, aH as GetStateRootsResponse, aD as GetSlotMetricsResponse, b5 as ListSlotMetricsResponse, bn as NodeRecord, aP as GetVersionResponse } from './query_service_pb-Ci7T_0DF.cjs'; import { Timestamp } from '@bufbuild/protobuf/wkt'; import { l as StreamEventsResponse } from './streaming_service_pb-CNGmJEsl.cjs'; import { ConnectError } from '@connectrpc/connect'; interface AccountPageChunk { pageIndex: number; pageSize: number; data: Uint8Array; compressed?: boolean; compressionAlgorithm?: string; } interface AccountSnapshot { account: Account; } interface AccountUpdateDelta { slot: bigint; /** Per-account sequence number of this update. Always present, unlike meta.seq which is stripped under DATA_ONLY/PUBKEY_ONLY views (META_ONLY strips data, not meta). */ seq: bigint; meta?: AccountMeta; page?: AccountPageChunk; deleted?: boolean; } type StreamAccountUpdate = { kind: "snapshot"; snapshot: AccountSnapshot; } | { kind: "update"; update: AccountUpdateDelta; }; interface CreateAccountOptions { /** The new account's public key (fee payer). */ publicKey: PubkeyInput; /** Noop override for an explicitly configured existing network. */ program?: PubkeyInput; /** Optional overrides for the transaction header. */ header?: Partial; } interface AccountQueryOptions { view?: AccountView; versionContext?: VersionContext; dataSlice?: DataSlice; } interface RawAccountQueryOptions { view?: AccountView; versionContext?: VersionContext; } interface ListAccountsOptions { view?: AccountView; versionContext?: VersionContext; filter?: Filter; page?: PageRequest; minConsensus?: ConsensusStatus; } interface AccountList { accounts: Account[]; page?: PageResponse; } declare function getAccount(ctx: ThruClientContext, address: PubkeyInput, options?: AccountQueryOptions): Promise; declare function getRawAccount(ctx: ThruClientContext, address: PubkeyInput, options?: RawAccountQueryOptions): Promise; declare function listAccounts(ctx: ThruClientContext, options: ListAccountsOptions): Promise; declare function createAccount(ctx: ThruClientContext, options: CreateAccountOptions): Promise; type accounts_AccountList = AccountList; type accounts_AccountQueryOptions = AccountQueryOptions; type accounts_CreateAccountOptions = CreateAccountOptions; type accounts_ListAccountsOptions = ListAccountsOptions; type accounts_RawAccountQueryOptions = RawAccountQueryOptions; declare const accounts_createAccount: typeof createAccount; declare const accounts_getAccount: typeof getAccount; declare const accounts_getRawAccount: typeof getRawAccount; declare const accounts_listAccounts: typeof listAccounts; declare namespace accounts { export { type accounts_AccountList as AccountList, type accounts_AccountQueryOptions as AccountQueryOptions, type accounts_CreateAccountOptions as CreateAccountOptions, type accounts_ListAccountsOptions as ListAccountsOptions, type accounts_RawAccountQueryOptions as RawAccountQueryOptions, accounts_createAccount as createAccount, accounts_getAccount as getAccount, accounts_getRawAccount as getRawAccount, accounts_listAccounts as listAccounts }; } interface BlockFooterParams { signature?: Uint8Array; status: ExecutionStatus; consumedComputeUnits: bigint; consumedStateUnits: number; attestorPayment: bigint; } declare class BlockFooter { readonly signature?: Uint8Array; readonly status: ExecutionStatus; readonly consumedComputeUnits: bigint; readonly consumedStateUnits: number; readonly attestorPayment: bigint; constructor(params: BlockFooterParams); static fromProto(proto: BlockFooter$1): BlockFooter; } interface BlockHeaderParams { slot: bigint; version: number; headerSignature?: Uint8Array; producer?: Uint8Array; expiryTimestamp?: Timestamp; startSlot: bigint; expiryAfter?: number; maxBlockSize?: number; maxComputeUnits?: bigint; maxStateUnits?: number; bondAmountLockUp?: bigint; weightSlot?: bigint; blockHash?: Uint8Array; chainId?: number; } declare class BlockHeader { readonly slot: bigint; readonly version: number; readonly headerSignature?: Uint8Array; readonly producer?: Uint8Array; readonly expiryTimestamp?: Timestamp; readonly startSlot: bigint; readonly expiryAfter?: number; readonly maxBlockSize?: number; readonly maxComputeUnits?: bigint; readonly maxStateUnits?: number; readonly bondAmountLockUp?: bigint; readonly weightSlot?: bigint; readonly blockHash?: Uint8Array; readonly chainId?: number; constructor(params: BlockHeaderParams); static fromProto(proto: BlockHeader$1): BlockHeader; withBlockHash(blockHash: Uint8Array): BlockHeader; } declare class Block { readonly header: BlockHeader; readonly footer?: BlockFooter; readonly body?: Uint8Array; readonly consensusStatus?: ConsensusStatus; blockTimeNs?: bigint; attestorPayment?: bigint; constructor(params: { header: BlockHeader; footer?: BlockFooter; body?: Uint8Array; consensusStatus?: ConsensusStatus; }); static fromProto(proto: Block$1): Block; static fromWire(data: Uint8Array): Block; private static tryParseWireWithHeaderSize; toWire(): Uint8Array; getTransactions(): Transaction[]; private static extractTransactionBody; private static extractWithHeaderSize; /** * Checks if the data looks like a valid transaction body. * Uses heuristics to detect if we've correctly offset into the block data. * Wire format: header (112 bytes) + body + signature (64 bytes at end) * This is a lenient heuristic for format detection - version/flag validation * happens in Transaction.parseWire. */ private static looksLikeValidTransactionBody; private serializeHeader; private serializeFooter; private static parseHeader; /** * Parses a block header with a specific expected size. * Handles both current (168 bytes with weight_slot) and legacy (160 bytes without weight_slot) formats. */ private static parseHeaderWithSize; private static parseFooter; private static parseTransactionsFromBody; } type BlockSelector = { slot: number | bigint; } | { blockHash: Uint8Array | string; }; interface DeriveProgramAddressOptions { programAddress: PubkeyInput; seed: Uint8Array | string; ephemeral?: boolean; } interface DeriveProgramAddressResult { bytes: Uint8Array; address: string; } declare function deriveProgramAddress(options: DeriveProgramAddressOptions): DeriveProgramAddressResult; type DeriveAddressInput = PubkeyInput | Uint8Array; interface DeriveAddressResult { bytes: Uint8Array; address: string; } /** * Derive an address by hashing an array of inputs. * Inputs can be pubkeys (as string, Uint8Array, or Pubkey) or raw Uint8Array data. * * @example * // Token account: SHA256(owner || mint || seed) * deriveAddress([ownerPubkey, mintPubkey, seed]) * * // Mint account: SHA256(creator || seed) * deriveAddress([creatorPubkey, seed]) */ declare function deriveAddress(inputs: DeriveAddressInput[]): DeriveAddressResult; interface BlockQueryOptions { view?: BlockView; minConsensus?: ConsensusStatus; } interface RawBlockQueryOptions { minConsensus?: ConsensusStatus; } interface ListBlocksOptions { filter?: Filter; page?: PageRequest; view?: BlockView; minConsensus?: ConsensusStatus; } interface BlockList { blocks: Block[]; page?: PageResponse; } declare function getBlock(ctx: ThruClientContext, selector: BlockSelector, options?: BlockQueryOptions): Promise; declare function getRawBlock(ctx: ThruClientContext, selector: BlockSelector, options?: RawBlockQueryOptions): Promise; declare function listBlocks(ctx: ThruClientContext, options?: ListBlocksOptions): Promise; type blocks_BlockList = BlockList; type blocks_BlockQueryOptions = BlockQueryOptions; type blocks_ListBlocksOptions = ListBlocksOptions; type blocks_RawBlockQueryOptions = RawBlockQueryOptions; declare const blocks_getBlock: typeof getBlock; declare const blocks_getRawBlock: typeof getRawBlock; declare const blocks_listBlocks: typeof listBlocks; declare namespace blocks { export { type blocks_BlockList as BlockList, type blocks_BlockQueryOptions as BlockQueryOptions, type blocks_ListBlocksOptions as ListBlocksOptions, type blocks_RawBlockQueryOptions as RawBlockQueryOptions, blocks_getBlock as getBlock, blocks_getRawBlock as getRawBlock, blocks_listBlocks as listBlocks }; } declare function getChainInfo(ctx: ThruClientContext): Promise; declare function getChainId(ctx: ThruClientContext): Promise; declare const chain_getChainId: typeof getChainId; declare const chain_getChainInfo: typeof getChainInfo; declare namespace chain { export { chain_getChainId as getChainId, chain_getChainInfo as getChainInfo }; } declare function consensusStatusToString(status: ConsensusStatus): string; type VersionContextInput = VersionContext | { current: true; } | { currentOrHistorical: true; } | { slot: number | bigint; } | { timestamp: Date | number | Timestamp; } | { slotSeq: { slot: number | bigint; seq: number | bigint; }; }; declare function currentVersionContext(): VersionContext; declare function currentOrHistoricalVersionContext(): VersionContext; declare function slotVersionContext(slot: number | bigint): VersionContext; declare function timestampVersionContext(value: Date | number | Timestamp): VersionContext; declare function slotSeqVersionContext(slot: number | bigint, seq: number | bigint): VersionContext; declare function versionContext(input?: VersionContextInput): VersionContext; type consensus_VersionContextInput = VersionContextInput; declare const consensus_consensusStatusToString: typeof consensusStatusToString; declare const consensus_currentOrHistoricalVersionContext: typeof currentOrHistoricalVersionContext; declare const consensus_currentVersionContext: typeof currentVersionContext; declare const consensus_slotSeqVersionContext: typeof slotSeqVersionContext; declare const consensus_slotVersionContext: typeof slotVersionContext; declare const consensus_timestampVersionContext: typeof timestampVersionContext; declare const consensus_versionContext: typeof versionContext; declare namespace consensus { export { type consensus_VersionContextInput as VersionContextInput, consensus_consensusStatusToString as consensusStatusToString, consensus_currentOrHistoricalVersionContext as currentOrHistoricalVersionContext, consensus_currentVersionContext as currentVersionContext, consensus_slotSeqVersionContext as slotSeqVersionContext, consensus_slotVersionContext as slotVersionContext, consensus_timestampVersionContext as timestampVersionContext, consensus_versionContext as versionContext }; } interface ChainEventParams { id: string; transactionSignature?: Uint8Array; program?: Uint8Array; payload?: Uint8Array; slot?: bigint; callIndex?: number; programIndex?: number; payloadSize?: number; timestampNs?: bigint; blockTimestampNs?: bigint; feePayer?: Uint8Array; blockOffset?: number; } declare class ChainEvent { readonly id: string; readonly transactionSignature?: Uint8Array; readonly program?: Uint8Array; readonly payload?: Uint8Array; readonly slot?: bigint; readonly callIndex?: number; readonly programIndex?: number; readonly payloadSize?: number; /** Time the node published the live event; set only by fromStream. */ readonly timestampNs?: bigint; /** Header time of the block holding the event. */ readonly blockTimestampNs?: bigint; readonly feePayer?: Uint8Array; readonly blockOffset?: number; constructor(params: ChainEventParams); static fromQuery(proto: Event): ChainEvent; static fromStream(proto: StreamEventsResponse): ChainEvent; } interface GetEventOptions { versionContext?: VersionContext; } interface ListEventsOptions { filter?: Filter; page?: PageRequest; versionContext?: VersionContext; minConsensus?: ConsensusStatus; } interface EventList { events: ChainEvent[]; page?: PageResponse; } declare function getEvent(ctx: ThruClientContext, eventId: string, options?: GetEventOptions): Promise; declare function listEvents(ctx: ThruClientContext, options?: ListEventsOptions): Promise; type events_EventList = EventList; type events_GetEventOptions = GetEventOptions; type events_ListEventsOptions = ListEventsOptions; declare const events_getEvent: typeof getEvent; declare const events_listEvents: typeof listEvents; declare namespace events { export { type events_EventList as EventList, type events_GetEventOptions as GetEventOptions, type events_ListEventsOptions as ListEventsOptions, events_getEvent as getEvent, events_listEvents as listEvents }; } interface HeightSnapshotParams { finalized: bigint; locallyExecuted: bigint; clusterExecuted: bigint; } declare class HeightSnapshot { readonly finalized: bigint; readonly locallyExecuted: bigint; readonly clusterExecuted: bigint; constructor(params: HeightSnapshotParams); static fromProto(proto: { finalized: bigint; locallyExecuted: bigint; clusterExecuted: bigint; }): HeightSnapshot; delta(other: HeightSnapshot): { finalized: bigint; locallyExecuted: bigint; clusterExecuted: bigint; }; } declare function getBlockHeight(ctx: ThruClientContext): Promise; declare const height_getBlockHeight: typeof getBlockHeight; declare namespace height { export { height_getBlockHeight as getBlockHeight }; } interface GeneratedKeyPair { address: string; publicKey: Uint8Array; privateKey: Uint8Array; } /** * Generates a new Ed25519 keypair using the same HD wallet pipeline as the Thru wallet. */ declare function generateKeyPair(): Promise; declare function fromPrivateKey(privateKey: Uint8Array): Promise; type keys_GeneratedKeyPair = GeneratedKeyPair; declare const keys_fromPrivateKey: typeof fromPrivateKey; declare const keys_generateKeyPair: typeof generateKeyPair; declare namespace keys { export { type keys_GeneratedKeyPair as GeneratedKeyPair, keys_fromPrivateKey as fromPrivateKey, keys_generateKeyPair as generateKeyPair }; } declare function getNodeStatus(ctx: ThruClientContext): Promise; declare function getNodePubkey(ctx: ThruClientContext): Promise; declare function getNodeRecords(ctx: ThruClientContext): Promise; declare const node_getNodePubkey: typeof getNodePubkey; declare const node_getNodeRecords: typeof getNodeRecords; declare const node_getNodeStatus: typeof getNodeStatus; declare namespace node { export { node_getNodePubkey as getNodePubkey, node_getNodeRecords as getNodeRecords, node_getNodeStatus as getNodeStatus }; } /** Shape of the execution result fields this module needs. */ interface NonceRejectExecutionResult { vmError: number; feePayerExpectedNonce?: bigint; } /** * Returns the nonce a rejected transaction should have used, or undefined when * the result is not a nonce reject or the node did not report one (an older * node, or a reject for some other reason). */ declare function expectedNonceFromExecutionResult(executionResult: NonceRejectExecutionResult | undefined): bigint | undefined; interface AccountNonceObserverOptions { versionContext?: VersionContext; signal?: AbortSignal; } interface WaitForNonceOptions { timeoutMs?: number; } declare class AccountNonceObserver { private readonly ctx; private readonly account; private readonly versionContext; private readonly abortController; private readonly waiters; private latestNonce; private closed; private streamStarted; constructor(ctx: ThruClientContext, account: PubkeyInput, options?: AccountNonceObserverOptions); getLatestNonce(): bigint | undefined; refresh(): Promise; start(): void; waitForNonceAtLeast(target: bigint, options?: WaitForNonceOptions): Promise; close(): void; private runStream; private observeNonce; private resolveReadyWaiters; private rejectWaiters; } interface FeePayerNonceAllocation { baseNonce: bigint; nonces: bigint[]; barrierNonce: bigint; } interface FeePayerNonceManagerOptions { observer?: AccountNonceObserver; } declare class FeePayerNonceManager { readonly observer: AccountNonceObserver; private allocationQueue; private nextNonce; constructor(ctx: ThruClientContext, feePayer: PubkeyInput, options?: FeePayerNonceManagerOptions); allocate(count: number): Promise; reset(nextNonce?: bigint): void; /** * Applies a nonce correction reported by the node on a rejected * transaction, and returns true when one was applied. * * This MUST assign rather than take a maximum. NONCE_TOO_HIGH means the * allocation cursor ran ahead of the chain -- which is what happens * whenever an optimistically-allocated transaction fails to land -- so the * correction is always SMALLER than `nextNonce`. A monotone update would * discard it and the cursor would stay wrong forever (UNTO-2619). * * The observer is deliberately not updated: `latestNonce` tracks values * actually observed on chain and is monotone by design. */ applyNonceReject(executionResult: NonceRejectExecutionResult | undefined): boolean; sync(): Promise; waitForNonceAtLeast(target: bigint, options?: WaitForNonceOptions): Promise; close(): void; private allocateUnsafe; private withAllocationLock; } type nonce_AccountNonceObserver = AccountNonceObserver; declare const nonce_AccountNonceObserver: typeof AccountNonceObserver; type nonce_AccountNonceObserverOptions = AccountNonceObserverOptions; type nonce_FeePayerNonceAllocation = FeePayerNonceAllocation; type nonce_FeePayerNonceManager = FeePayerNonceManager; declare const nonce_FeePayerNonceManager: typeof FeePayerNonceManager; type nonce_FeePayerNonceManagerOptions = FeePayerNonceManagerOptions; type nonce_NonceRejectExecutionResult = NonceRejectExecutionResult; type nonce_WaitForNonceOptions = WaitForNonceOptions; declare const nonce_expectedNonceFromExecutionResult: typeof expectedNonceFromExecutionResult; declare namespace nonce { export { nonce_AccountNonceObserver as AccountNonceObserver, type nonce_AccountNonceObserverOptions as AccountNonceObserverOptions, type nonce_FeePayerNonceAllocation as FeePayerNonceAllocation, nonce_FeePayerNonceManager as FeePayerNonceManager, type nonce_FeePayerNonceManagerOptions as FeePayerNonceManagerOptions, type nonce_NonceRejectExecutionResult as NonceRejectExecutionResult, type nonce_WaitForNonceOptions as WaitForNonceOptions, nonce_expectedNonceFromExecutionResult as expectedNonceFromExecutionResult }; } declare class StateProof { readonly proof: Uint8Array; readonly slot: bigint; constructor(params: { proof: Uint8Array; slot: bigint; }); static fromProto(proto: StateProof$1): StateProof; } type GenerateStateProofOptions = { address?: PubkeyInput; proofType: StateProofType; targetSlot?: bigint; }; declare function generateStateProof(ctx: ThruClientContext, options: GenerateStateProofOptions): Promise; interface GenerateStateProofsOptions { requests: readonly Omit[]; targetSlot?: bigint; signal?: AbortSignal; } type StateProofOutcome = { proof: StateProof; error?: never; } | { proof?: never; error: ConnectError; }; /** Positional results, including duplicates and per-account errors; chunks at the RPC's 1000-request limit. */ declare function generateStateProofs(ctx: ThruClientContext, options: GenerateStateProofsOptions): Promise; interface GetStateRootsOptions { slot?: bigint; } declare function getStateRoots(ctx: ThruClientContext, options?: GetStateRootsOptions): Promise; type proofs_GenerateStateProofsOptions = GenerateStateProofsOptions; type proofs_GetStateRootsOptions = GetStateRootsOptions; type proofs_StateProofOutcome = StateProofOutcome; declare const proofs_generateStateProof: typeof generateStateProof; declare const proofs_generateStateProofs: typeof generateStateProofs; declare const proofs_getStateRoots: typeof getStateRoots; declare namespace proofs { export { type proofs_GenerateStateProofsOptions as GenerateStateProofsOptions, type proofs_GetStateRootsOptions as GetStateRootsOptions, type proofs_StateProofOutcome as StateProofOutcome, proofs_generateStateProof as generateStateProof, proofs_generateStateProofs as generateStateProofs, proofs_getStateRoots as getStateRoots }; } interface ListSlotMetricsOptions { startSlot: bigint; endSlot?: bigint; limit?: number; } declare function getSlotMetrics(ctx: ThruClientContext, slot: bigint): Promise; declare function listSlotMetrics(ctx: ThruClientContext, options: ListSlotMetricsOptions): Promise; type slots_ListSlotMetricsOptions = ListSlotMetricsOptions; declare const slots_getSlotMetrics: typeof getSlotMetrics; declare const slots_listSlotMetrics: typeof listSlotMetrics; declare namespace slots { export { type slots_ListSlotMetricsOptions as ListSlotMetricsOptions, slots_getSlotMetrics as getSlotMetrics, slots_listSlotMetrics as listSlotMetrics }; } interface TrackTransactionOptions { timeoutMs?: number; signal?: AbortSignal; } interface StreamBlocksOptions { startSlot?: bigint; filter?: Filter; view?: BlockView; minConsensus?: ConsensusStatus; signal?: AbortSignal; } interface StreamBlocksResult { block: Block; } declare function streamBlocks(ctx: ThruClientContext, options?: StreamBlocksOptions): AsyncIterable; interface StreamAccountUpdatesOptions { view?: AccountView; filter?: Filter; signal?: AbortSignal; } interface StreamAccountUpdatesResult { update: StreamAccountUpdate; } declare function streamAccountUpdates(ctx: ThruClientContext, address: PubkeyInput, options?: StreamAccountUpdatesOptions): AsyncIterable; interface StreamTransactionsOptions { filter?: Filter; minConsensus?: ConsensusStatus; signal?: AbortSignal; } type StreamTransactionsResult = StreamTransactionUpdate; declare function streamTransactions(ctx: ThruClientContext, options?: StreamTransactionsOptions): AsyncIterable; interface StreamEventsOptions { filter?: Filter; signal?: AbortSignal; } interface StreamEventsResult { event: ChainEvent; } declare function streamEvents(ctx: ThruClientContext, options?: StreamEventsOptions): AsyncIterable; declare function trackTransaction(ctx: ThruClientContext, signature: SignatureInput, options?: TrackTransactionOptions): AsyncIterable; interface StreamHeightOptions { signal?: AbortSignal; } interface StreamHeightResult { height: HeightSnapshot; } declare function streamHeight(ctx: ThruClientContext, options?: StreamHeightOptions): AsyncIterable; interface StreamSlotMetricsOptions { startSlot?: bigint; signal?: AbortSignal; /** * Ask the server for the slot's compressed-state trie root. * * Off by default: the commitment costs bandwidth on every slot and most * consumers never read it. */ includeCompressedStateRoot?: boolean; /** * Ask the server for the slot's active-state hash. Off by default, same * reasoning as {@link StreamSlotMetricsOptions.includeCompressedStateRoot}. */ includeActiveStateHash?: boolean; } interface StreamSlotMetricsResult { slot: bigint; /** Fees credited to the absent-block-producer fee receiver this block * because the producer account was not live (UNTO-1293). Disjoint from * `claimedFees`. */ absentBlockProducerFees: bigint; /** Fees credited to a live block-producer account this block (UNTO-1293). */ claimedFees: bigint; globalActivatedStateCounter: bigint; globalDeactivatedStateCounter: bigint; blockTimestamp?: Timestamp; /** * Total compute units consumed by this block. * * Zero for an empty block, and also zero when the node could not attribute * this slot's execution results to it. The wire cannot distinguish the two * cases, so do not read zero as "the block did no work". */ consumedComputeUnits: bigint; /** * Total state units consumed by this block. * * Same zero caveat as {@link StreamSlotMetricsResult.consumedComputeUnits}. */ consumedStateUnits: number; /** * The compressed-state trie root as of this slot: the commitment account * state proofs are verified against. * * The server sends exactly 32 bytes. This is a pass-through of whatever * arrived -- unlike the Rust client, the SDK does not reject a * wrong-length value -- so a consumer doing byte comparisons should check * the length rather than assume it. * * Undefined unless requested, and undefined even then when: the node * reported no execution state for the slot; the server predates the field; * the node behind a supporting server predates the wire flag that marks a * terminator as post-execution; or that terminator was truncated. Those * cases are not distinguishable from one another on the wire. * * An all-zero VALUE is legitimate and means something different from * undefined: the trie is empty until compression warms up, and a slot that * compressed nothing repeats the previous root. */ compressedStateRoot?: Uint8Array; /** * The active-state hash as of this slot: 32 bytes over the live account set * and this slot's block context. Same presence rules as * {@link StreamSlotMetricsResult.compressedStateRoot}. * * Because that block context contains the compressed-state root, this hash * transitively commits to it -- the two fields agreeing is not an * independent check of either. */ activeStateHash?: Uint8Array; } declare function streamSlotMetrics(ctx: ThruClientContext, options?: StreamSlotMetricsOptions): AsyncIterable; type StreamNodeRecordsResult = { type: "record"; record: NodeRecord; } | { type: "finished"; }; interface StreamNodeRecordsOptions { signal?: AbortSignal; } declare function streamNodeRecords(ctx: ThruClientContext, options?: StreamNodeRecordsOptions): AsyncIterable; interface CollectStreamOptions { limit?: number; signal?: AbortSignal; } declare function collectStream(iterable: AsyncIterable, options?: CollectStreamOptions): Promise; declare function firstStreamValue(iterable: AsyncIterable, options?: { signal?: AbortSignal; }): Promise; declare function forEachStreamValue(iterable: AsyncIterable, handler: (value: T, index: number) => void | Promise, options?: { signal?: AbortSignal; }): Promise; type streaming_CollectStreamOptions = CollectStreamOptions; type streaming_StreamAccountUpdatesOptions = StreamAccountUpdatesOptions; type streaming_StreamAccountUpdatesResult = StreamAccountUpdatesResult; type streaming_StreamBlocksOptions = StreamBlocksOptions; type streaming_StreamBlocksResult = StreamBlocksResult; type streaming_StreamEventsOptions = StreamEventsOptions; type streaming_StreamEventsResult = StreamEventsResult; type streaming_StreamHeightOptions = StreamHeightOptions; type streaming_StreamHeightResult = StreamHeightResult; type streaming_StreamNodeRecordsOptions = StreamNodeRecordsOptions; type streaming_StreamNodeRecordsResult = StreamNodeRecordsResult; type streaming_StreamSlotMetricsOptions = StreamSlotMetricsOptions; type streaming_StreamSlotMetricsResult = StreamSlotMetricsResult; declare const streaming_StreamTransactionUpdate: typeof StreamTransactionUpdate; type streaming_StreamTransactionsOptions = StreamTransactionsOptions; type streaming_StreamTransactionsResult = StreamTransactionsResult; type streaming_TrackTransactionOptions = TrackTransactionOptions; declare const streaming_TrackTransactionUpdate: typeof TrackTransactionUpdate; declare const streaming_collectStream: typeof collectStream; declare const streaming_firstStreamValue: typeof firstStreamValue; declare const streaming_forEachStreamValue: typeof forEachStreamValue; declare const streaming_streamAccountUpdates: typeof streamAccountUpdates; declare const streaming_streamBlocks: typeof streamBlocks; declare const streaming_streamEvents: typeof streamEvents; declare const streaming_streamHeight: typeof streamHeight; declare const streaming_streamNodeRecords: typeof streamNodeRecords; declare const streaming_streamSlotMetrics: typeof streamSlotMetrics; declare const streaming_streamTransactions: typeof streamTransactions; declare const streaming_trackTransaction: typeof trackTransaction; declare namespace streaming { export { type streaming_CollectStreamOptions as CollectStreamOptions, type streaming_StreamAccountUpdatesOptions as StreamAccountUpdatesOptions, type streaming_StreamAccountUpdatesResult as StreamAccountUpdatesResult, type streaming_StreamBlocksOptions as StreamBlocksOptions, type streaming_StreamBlocksResult as StreamBlocksResult, type streaming_StreamEventsOptions as StreamEventsOptions, type streaming_StreamEventsResult as StreamEventsResult, type streaming_StreamHeightOptions as StreamHeightOptions, type streaming_StreamHeightResult as StreamHeightResult, type streaming_StreamNodeRecordsOptions as StreamNodeRecordsOptions, type streaming_StreamNodeRecordsResult as StreamNodeRecordsResult, type streaming_StreamSlotMetricsOptions as StreamSlotMetricsOptions, type streaming_StreamSlotMetricsResult as StreamSlotMetricsResult, streaming_StreamTransactionUpdate as StreamTransactionUpdate, type streaming_StreamTransactionsOptions as StreamTransactionsOptions, type streaming_StreamTransactionsResult as StreamTransactionsResult, type streaming_TrackTransactionOptions as TrackTransactionOptions, streaming_TrackTransactionUpdate as TrackTransactionUpdate, streaming_collectStream as collectStream, streaming_firstStreamValue as firstStreamValue, streaming_forEachStreamValue as forEachStreamValue, streaming_streamAccountUpdates as streamAccountUpdates, streaming_streamBlocks as streamBlocks, streaming_streamEvents as streamEvents, streaming_streamHeight as streamHeight, streaming_streamNodeRecords as streamNodeRecords, streaming_streamSlotMetrics as streamSlotMetrics, streaming_streamTransactions as streamTransactions, streaming_trackTransaction as trackTransaction }; } declare class VersionInfo { readonly components: Record; constructor(components: Record); static fromProto(proto: GetVersionResponse): VersionInfo; get(component: string): string | undefined; } type ReconcileOptions = Pick & { feePayer: Pick; walletAddress?: never; signTransaction?: never; }; type KeypairFeePayer = BuildAndSignTransactionOptions['feePayer']; declare function createCompressionModule(ctx: ThruClientContext): { getAccountStatuses: (options: { accounts: readonly string[]; signal?: AbortSignal; }) => Promise; decompressAccounts: (options: DecompressionOptions & { accounts: readonly string[]; }) => Promise; compressAccount: (options: KeypairCompressionOptions & { account: string; }) => Promise; cleanupUploads: (options: DecompressionOptions & { uploads: UploadCleanup[]; }) => Promise; reconcilePending: (options: ReconcileOptions) => Promise; }; type CompressionModule = ReturnType; declare function getVersion(ctx: ThruClientContext): Promise; type BoundFunction = F extends (ctx: ThruClientContext, ...args: infer P) => infer R ? (...args: P) => R : never; interface BoundBlocks { get: BoundFunction; getRaw: BoundFunction; list: BoundFunction; stream: BoundFunction; getBlockHeight: BoundFunction; streamHeight: BoundFunction; } interface BoundAccounts { get: BoundFunction; getRaw: BoundFunction; list: BoundFunction; stream: BoundFunction; create: BoundFunction; } interface BoundTransactions { get: BoundFunction; getRaw: BoundFunction; getStatus: BoundFunction; list: BoundFunction; listForAccount: BoundFunction; stream: BoundFunction; build: BoundFunction; buildAndSign: BoundFunction; send: BoundFunction; batchSend: BoundFunction; batchSendAndTrack: BoundFunction; sendAndTrack: BoundFunction; track: BoundFunction; } interface BoundNonce { createObserver(account: PubkeyInput, options?: AccountNonceObserverOptions): AccountNonceObserver; createFeePayerManager(feePayer: PubkeyInput, options?: FeePayerNonceManagerOptions): FeePayerNonceManager; } interface BoundEvents { get: BoundFunction; list: BoundFunction; stream: BoundFunction; } interface BoundProofs { generate: BoundFunction; generateBatch: BoundFunction; getStateRoots: BoundFunction; } interface BoundKeys { generateKeyPair: typeof generateKeyPair; fromPrivateKey: typeof fromPrivateKey; } interface BoundVersion { get: BoundFunction; } interface BoundSlots { getMetrics: BoundFunction; listMetrics: BoundFunction; streamMetrics: BoundFunction; } interface BoundNode { getStatus: BoundFunction; getPubkey: BoundFunction; getRecords: BoundFunction; streamRecords: BoundFunction; } interface BoundChain { getChainInfo: BoundFunction; getChainId: BoundFunction; } interface BoundConsensus { statusToString: typeof consensusStatusToString; versionContext: typeof versionContext; currentVersionContext: typeof currentVersionContext; currentOrHistoricalVersionContext: typeof currentOrHistoricalVersionContext; slotVersionContext: typeof slotVersionContext; timestampVersionContext: typeof timestampVersionContext; slotSeqVersionContext: typeof slotSeqVersionContext; } interface Helpers { createSignature(value: SignatureInput): Signature; createPubkey(value: PubkeyInput): Pubkey; deriveProgramAddress(options: DeriveProgramAddressOptions): DeriveProgramAddressResult; deriveAddress(inputs: DeriveAddressInput[]): DeriveAddressResult; } interface Thru { ctx: ThruClientContext; compression: CompressionModule; blocks: BoundBlocks; accounts: BoundAccounts; transactions: BoundTransactions; events: BoundEvents; slots: BoundSlots; proofs: BoundProofs; keys: BoundKeys; version: BoundVersion; consensus: BoundConsensus; nonce: BoundNonce; node: BoundNode; chain: BoundChain; helpers: Helpers; } declare function createThruClient(config?: ThruClientConfig): Thru; export { collectStream as $, AccountNonceObserver as A, Block as B, ChainEvent as C, type DeriveAddressInput as D, type StreamEventsOptions as E, type FeePayerNonceAllocation as F, type GenerateStateProofOptions as G, HeightSnapshot as H, type StreamEventsResult as I, type StreamNodeRecordsOptions as J, type StreamNodeRecordsResult as K, type ListAccountsOptions as L, type StreamSlotMetricsOptions as M, type NonceRejectExecutionResult as N, type StreamSlotMetricsResult as O, type StreamTransactionsOptions as P, type StreamTransactionsResult as Q, type RawAccountQueryOptions as R, StateProof as S, type Thru as T, type TrackTransactionOptions as U, type VersionContextInput as V, VersionInfo as W, type WaitForNonceOptions as X, accounts as Y, blocks as Z, chain as _, type AccountNonceObserverOptions as a, consensus as a0, createThruClient as a1, deriveAddress as a2, deriveProgramAddress as a3, events as a4, expectedNonceFromExecutionResult as a5, firstStreamValue as a6, forEachStreamValue as a7, height as a8, keys as a9, node as aa, nonce as ab, proofs as ac, slots as ad, streaming as ae, type AccountQueryOptions as b, type BlockList as c, type BlockQueryOptions as d, type BlockSelector as e, type CompressionModule as f, type CreateAccountOptions as g, type DeriveAddressResult as h, type DeriveProgramAddressOptions as i, type DeriveProgramAddressResult as j, FeePayerNonceManager as k, type FeePayerNonceManagerOptions as l, type GenerateStateProofsOptions as m, type GeneratedKeyPair as n, type GetEventOptions as o, type GetStateRootsOptions as p, type HeightSnapshotParams as q, type ListBlocksOptions as r, type ListSlotMetricsOptions as s, type RawBlockQueryOptions as t, type StateProofOutcome as u, type StreamAccountUpdate as v, type StreamAccountUpdatesOptions as w, type StreamAccountUpdatesResult as x, type StreamBlocksOptions as y, type StreamBlocksResult as z };