/** * @packageDocumentation * @module API-RelayVM */ import LuxCore from "../../lux"; import { JRPCAPI } from "../../common/jrpcapi"; import { Channel, OpenChannelResponse, CrossChainMessage, SendMessageResponse, ReceiveMessageResponse, VerifiedMessage, RelayHealthResponse } from "./interfaces"; /** * Class for interacting with a node's RelayVM API (R-Chain). * * @category RPCAPIs * * @remarks This extends the [[JRPCAPI]] class. This class should not be directly called. Instead, use the [[Lux.addAPI]] function to register this interface with Lux. */ export declare class RelayVMAPI extends JRPCAPI { /** * Opens a new cross-chain relay channel. * * @param srcChainId The source chain ID * @param dstChainId The destination chain ID * * @returns Promise for an [[OpenChannelResponse]] containing the new channelId */ openChannel: (srcChainId: string, dstChainId: string) => Promise; /** * Retrieves a channel by its ID. * * @param channelId The channel ID * * @returns Promise for a [[Channel]] */ getChannel: (channelId: string) => Promise; /** * Closes an existing relay channel. * * @param channelId The ID of the channel to close * * @returns Promise for a boolean indicating success */ closeChannel: (channelId: string) => Promise; /** * Lists relay channels, optionally filtered by state. * * @param state Optional channel state filter * * @returns Promise for an array of [[Channel]] */ listChannels: (state?: string) => Promise; /** * Sends a cross-chain message through a relay channel. * * @param channelId The channel to send through * @param recipient The recipient address on the destination chain * @param payload The message payload * * @returns Promise for a [[SendMessageResponse]] */ sendMessage: (channelId: string, recipient: string, payload: string) => Promise; /** * Retrieves a cross-chain message by its ID. * * @param messageId The message ID * * @returns Promise for a [[CrossChainMessage]] */ getMessage: (messageId: string) => Promise; /** * Receives and processes a cross-chain message with its proof. * * @param channelId The channel ID * @param messageId The message ID * @param proof The inclusion proof * * @returns Promise for a [[ReceiveMessageResponse]] */ receiveMessage: (channelId: string, messageId: string, proof: string) => Promise; /** * Retrieves a verified message with its proof. * * @param messageId The message ID * * @returns Promise for a [[VerifiedMessage]] */ getVerifiedMessage: (messageId: string) => Promise; /** * Returns the health status of the RelayVM. * * @returns Promise for a [[RelayHealthResponse]] */ health: () => Promise; /** * This class should not be instantiated directly. Instead use the [[Lux.addAPI]] method. * * @param core A reference to the Lux class * @param baseURL Defaults to the string "/ext/bc/R/rpc" as the path to rpc's baseURL */ constructor(core: LuxCore, baseURL?: string); } //# sourceMappingURL=api.d.ts.map