import type { DevInspectTransactionBlockParams, QueryTransactionBlocksParams, SuiClient, SuiObjectResponse, SuiTransactionBlockResponse, SuiTransactionBlockResponseOptions } from "@mysten/sui/client"; import type { SignatureWithBytes } from "@mysten/sui/cryptography"; import type { Transaction } from "@mysten/sui/transactions"; import type { SignTx, WaitForTxOptions } from "./txs.js"; /** * Abstract class for building Sui SDK clients. */ export declare abstract class SuiClientBase { readonly suiClient: SuiClient; readonly signTx: SignTx; readonly txRespOptions: SuiTransactionBlockResponseOptions; readonly waitForTxOptions: WaitForTxOptions | false; /** * @param suiClient The client used to communicate with Sui. * @param signTx A function that can sign a `Transaction`. * @param txRespOptions Which fields to include in transaction responses. * @param waitForTxOptions Options for `SuiClient.waitForTransaction()`. */ constructor({ suiClient, signTx, txRespOptions, waitForTxOptions, }: { suiClient: SuiClient; signTx: SignTx; txRespOptions?: SuiTransactionBlockResponseOptions; waitForTxOptions?: WaitForTxOptions | false; }); /** * Fetch and parse objects from the RPC and cache them. * @param objectIds The IDs of the objects to fetch. * @param cache The cache to use (if any). Keys are object IDs and values are the parsed objects. * @param fetchFn A function that fetches objects from the Sui network. * @param parseFn A function that parses a `SuiObjectResponse` into an object. * @returns The parsed objects. */ fetchAndParseObjs({ ids, fetchFn, parseFn, cache, }: { ids: string[]; fetchFn: (ids: string[]) => Promise; parseFn: (resp: SuiObjectResponse) => T | null; cache?: Map; }): Promise; /** * Fetch and parse transactions from the RPC. */ fetchAndParseTxs({ parseFn, query, }: { parseFn: (resp: SuiTransactionBlockResponse) => T | null; query: QueryTransactionBlocksParams; }): Promise<{ hasNextPage: boolean; nextCursor: string | null | undefined; data: (T & ({} | undefined))[]; }>; executeTx({ signedTx, waitForTxOptions, txRespOptions, dryRun, sender, }: { signedTx: SignatureWithBytes; waitForTxOptions?: WaitForTxOptions | false; txRespOptions?: SuiTransactionBlockResponseOptions; dryRun?: boolean; sender?: string; }): Promise; signAndExecuteTx({ tx, waitForTxOptions, txRespOptions, dryRun, sender, }: { tx: Transaction; waitForTxOptions?: WaitForTxOptions | false; txRespOptions?: SuiTransactionBlockResponseOptions; dryRun?: boolean; sender?: string; }): Promise; dryRunTx({ tx, sender, }: { tx: DevInspectTransactionBlockParams["transactionBlock"]; sender?: string | undefined; }): Promise; }