js-moi-providers
Version:
Module to connect and interact with MOI network
52 lines • 4.01 kB
TypeScript
import { EventEmitter } from "events";
import { LogicManifest } from "js-moi-manifest";
import { Interaction, Tesseract } from "js-moi-utils";
import { AccountMetaInfo, AccountState, AssetInfo, CallorEstimateOptions, Content, ContentFrom, ContextInfo, Encoding, Filter, FilterDeletionResult, Inspect, InteractionCallResponse, InteractionReceipt, InteractionRequest, InteractionResponse, NodeInfo, Options, Registry, Status, SyncStatus, TDU, type Log, type LogFilter } from "../types/jsonrpc";
import { type ProviderEvents } from "../types/websocket";
import { InteractionObject } from "../types/interaction";
/**
* Abstract class representing a provider for interacting with the MOI protocol.
* Provides methods for account operations, execution, and querying.
*/
export declare abstract class AbstractProvider extends EventEmitter {
abstract getBalance(id: string, assetId: string, options?: Options): Promise<number | bigint>;
abstract getContextInfo(id: string, options?: Options): Promise<ContextInfo>;
abstract getTesseract(id: string, with_interactions: boolean, with_commit_info: boolean, options?: Options): Promise<Tesseract>;
abstract getTesseract(with_interactions: boolean, with_commit_info: boolean, options?: Options): Promise<Tesseract>;
abstract getTDU(id: string, options?: Options): Promise<TDU[]>;
abstract getInteractionByHash(ixHash: string): Promise<Interaction>;
abstract getInteractionByTesseract(id: string, options?: Options, ix_index?: number): Promise<Interaction>;
abstract getInteractionByTesseract(options: Options, ix_index?: number): Promise<Interaction>;
abstract getInteractionCount(id: string, key_id: number, options?: Options): Promise<number | bigint>;
abstract getPendingInteractionCount(id: string, key_id: number): Promise<number | bigint>;
abstract getAccountState(id: string, options?: Options): Promise<AccountState>;
abstract getAccountMetaInfo(id: string, options?: Options): Promise<AccountMetaInfo>;
abstract getLogicIds(id: string, options?: Options): Promise<string[]>;
abstract getRegistry(id: string, options?: Options): Promise<Registry>;
abstract getSyncStatus(address?: string): Promise<SyncStatus>;
abstract getContentFrom(id: string): Promise<ContentFrom>;
abstract getWaitTime(id: string): Promise<number | bigint>;
abstract call(ixObject: InteractionObject, options?: CallorEstimateOptions): Promise<InteractionCallResponse>;
abstract estimateFuel(ixObject: InteractionObject, options?: CallorEstimateOptions): Promise<number | bigint>;
abstract sendInteraction(ixObject: InteractionRequest): Promise<InteractionResponse>;
abstract getAssetInfoByAssetID(assetId: string): Promise<AssetInfo>;
abstract getInteractionReceipt(ixHash: string): Promise<InteractionReceipt>;
abstract getStorageAt(logicId: string, storageKey: string, options?: Options): Promise<string>;
abstract getStorageAt(logicId: string, storageKey: string, id: string, options?: Options): Promise<string>;
abstract getLogicManifest(logicId: string, encoding: Encoding, options?: Options): Promise<string | LogicManifest.Manifest>;
abstract getContent(): Promise<Content>;
abstract getStatus(): Promise<Status>;
abstract getInspect(): Promise<Inspect>;
abstract getPeers(): Promise<string[]>;
abstract getVersion(): Promise<string>;
abstract getNodeInfo(): Promise<NodeInfo>;
abstract getNewTesseractFilter(): Promise<Filter>;
abstract getNewTesseractsByAccountFilter(id: string): Promise<Filter>;
abstract getPendingInteractionFilter(): Promise<Filter>;
abstract getFilterChanges<T extends any>(filter: Filter): Promise<T>;
abstract removeFilter(filter: Filter): Promise<FilterDeletionResult>;
abstract getLogsFilter(filter: LogFilter): Promise<Filter>;
abstract getLogs(filter: LogFilter): Promise<Log[]>;
abstract getSubscription(event: ProviderEvents): Promise<string>;
}
//# sourceMappingURL=abstract-provider.d.ts.map