import { Signer } from '../crypto/index.js'; import { CreateSessionArgs, Session } from '../session/index.js'; import { BitcoinAddress, BitcoinNetowkType, RoochAddress } from '../address/index.js'; import { address, Bytes, u64 } from '../types/index.js'; import { RoochTransport } from './transportInterface.js'; import { CallFunctionArgs, TypeArgs, Transaction } from '../transactions/index.js'; import { AnnotatedFunctionResultView, BalanceInfoView, ExecuteTransactionResponseView, GetBalanceParams, GetStatesParams, ListStatesParams, PaginatedStateKVViews, PaginationArguments, PaginationResult, SessionInfoView, ObjectStateView, QueryUTXOsParams, PaginatedUTXOStateViews, PaginatedInscriptionStateViews, QueryInscriptionsParams, GetBalancesParams, PaginatedBalanceInfoViews, QueryObjectStatesParams, PaginatedIndexerObjectStateViews, QueryTransactionsParams, PaginatedTransactionWithInfoViews, PaginatedEventViews, GetEventsByEventHandleParams, QueryEventsParams, PaginatedIndexerEventViews, ModuleABIView, GetModuleABIParams, BroadcastTXParams, GetObjectStatesParams, GetFieldStatesParams, ListFieldStatesParams, GetTransactionsByHashParams, TransactionWithInfoView, GetTransactionsByOrderParams, RepairIndexerParams, SyncStatesParams, PaginatedStateChangeSetWithTxOrderViews, DryRunRawTransactionParams, DryRunTransactionResponseView, EventFilterView, TransactionFilterView, IndexerEventView } from './types/index.js'; /** * Configuration options for the RoochClient * You must provide either a `url` or a `transport` */ export type RoochClientOptions = NetworkOrTransport; type NetworkOrTransport = { url: string; transport?: never; } | { transport: RoochTransport; url?: never; }; declare const ROOCH_CLIENT_BRAND: unique symbol; export declare function isRoochClient(client: unknown): client is RoochClient; export interface SubscriptionEventParams { filter?: EventFilterView; onError?: (error: Error) => void; signal?: AbortSignal; } export interface SubscriptionTransactionParams { filter?: TransactionFilterView; onError?: (error: Error) => void; signal?: AbortSignal; } export type Unsubscribe = () => Promise; export declare class RoochClient { protected chainID: bigint | undefined; protected transport: RoochTransport; get [ROOCH_CLIENT_BRAND](): boolean; getTransport(): RoochTransport; /** * Establish a connection to a rooch RPC endpoint * * @param options configuration options for the API Client */ constructor(options: RoochClientOptions); getRpcApiVersion(): Promise; getChainId(): Promise; executeViewFunction(input: CallFunctionArgs): Promise; dryrun(input: DryRunRawTransactionParams): Promise; signAndExecuteTransaction({ transaction, signer, option, }: { transaction: Transaction | Bytes; signer: Signer; option?: { withOutput: boolean; }; }): Promise; repairIndexer(input: RepairIndexerParams): Promise; syncStates(input: SyncStatesParams): Promise; getStates(input: GetStatesParams): Promise; listStates(input: ListStatesParams): Promise; getModuleAbi(input: GetModuleABIParams): Promise; getEvents(input: GetEventsByEventHandleParams): Promise; queryEvents(input: QueryEventsParams): Promise; queryInscriptions(input: QueryInscriptionsParams): Promise; queryUTXO(input: QueryUTXOsParams): Promise; broadcastBitcoinTX(input: BroadcastTXParams): Promise; getObjectStates(input: GetObjectStatesParams): Promise; getFieldStates(input: GetFieldStatesParams): Promise; listFieldStates(input: ListFieldStatesParams): Promise; queryObjectStates(input: QueryObjectStatesParams): Promise; getTransactionsByHash(input: GetTransactionsByHashParams): Promise; getTransactionsByOrder(input: GetTransactionsByOrderParams): Promise; queryTransactions(input: QueryTransactionsParams): Promise; getSequenceNumber(address: string): Promise; /** * Get the total coin balance for one coin type, owned by the address owner. */ getBalance(input: GetBalanceParams): Promise; getBalances(input: GetBalancesParams): Promise; transfer(input: { signer: Signer; recipient: address; amount: number | bigint; coinType: TypeArgs; }): Promise; transferObject(input: { signer: Signer; recipient: address; objectId: string; objectType: TypeArgs; }): Promise; resolveBTCAddress(input: { roochAddress: string | RoochAddress; network: BitcoinNetowkType; }): Promise; createSession({ sessionArgs, signer }: { sessionArgs: CreateSessionArgs; signer: Signer; }): Promise; removeSession({ authKey, signer }: { authKey: string; signer: Signer; }): Promise; sessionIsExpired({ address, authKey, }: { address: address; authKey: string; }): Promise; getAllModules({ package_address, limit, cursor, }: { package_address: address; } & PaginationArguments): Promise>; getSessionKeys({ address, limit, cursor, }: { address: address; } & PaginationArguments): Promise>; subscribeEventWithSSE(input: SubscriptionEventParams & { /** function to run when we receive a notification of a new event matching the filter */ onMessage: (event: IndexerEventView) => void; }): Promise<() => Promise>; subscribeTransactionWithSSE(input: SubscriptionEventParams & { /** function to run when we receive a notification of a new event matching the filter */ onMessage: (event: IndexerEventView) => void; }): Promise<() => Promise>; subscribeEvent(input: SubscriptionEventParams & { /** function to run when we receive a notification of a new event matching the filter */ onMessage: (event: IndexerEventView) => void; }): Promise<() => Promise>; subscribeTransaction(input: SubscriptionTransactionParams & { /** function to run when we receive a notification of a new event matching the filter */ onMessage: (message: TransactionWithInfoView) => void; }): Promise<() => Promise>; events(): void; destroy(): void; } export {};