UNPKG

@avalanche-sdk/interchain

Version:
50 lines 2.23 kB
import { pvmSerial } from "@avalabs/avalanchejs"; /** * Parses a Warp unsigned or signed message from a hex string. * * @param unsignedMsgHex - The hex string representing the unsigned or signed message. * @returns The parsed WarpUnsignedMessage instance. {@link WarpUnsignedMessage} */ export declare function parseWarpUnsignedMessage(unsignedMsgHex: string): WarpUnsignedMessage; /** * Creates a new WarpUnsignedMessage from values. * * @param networkId - The Avalanche network ID. * @param sourceChainId - The source blockchain ID. * @param payloadHex - The warp message payload as a hex string. * @returns A new WarpUnsignedMessage instance. {@link WarpUnsignedMessage} */ export declare function newWarpUnsignedMessage(networkId: number, sourceChainId: string, payloadHex: string): WarpUnsignedMessage; /** * WarpUnsignedMessage class provides utility methods to build * and parse unsigned warp message from hex strings or values, and * access its properties. */ export declare class WarpUnsignedMessage extends pvmSerial.warp.WarpUnsignedMessage { /** * Creates a WarpUnsignedMessage instance from a hex string. * @param unsignedMsgHex - The hex string representing the unsigned message. * @returns The parsed WarpUnsignedMessage instance. {@link WarpUnsignedMessage} */ static fromHex(unsignedMsgHex: string): WarpUnsignedMessage; /** * Creates a WarpUnsignedMessage instance from values. * @param networkId - The Avalanche network ID. * @param sourceChainId - The source chain ID (base58check encoded). * @param payloadHex - The payload as a hex string. * @returns A new WarpUnsignedMessage instance. {@link WarpUnsignedMessage} */ static fromValues(networkId: number, sourceChainId: string, payloadHex: string): WarpUnsignedMessage; /** * Serializes the WarpUnsignedMessage to a hex string. * @returns The hex string representation of the message. */ toHex(): string; /** * Do not use this method directly. * Throws an error if called. * @throws Error */ static fromBytes(_bytes: never, _codec: never): [WarpUnsignedMessage, Uint8Array]; } //# sourceMappingURL=warpUnsignedMessage.d.ts.map