UNPKG

@erc7824/nitrolite

Version:

The Nitrolite SDK empowers developers to build high-performance, scalable web3 applications using state channels. It's designed to provide near-instant transactions and significantly improved user experiences by minimizing direct blockchain interactions.

15 lines (14 loc) 1.22 kB
import { Address, Hex } from 'viem'; import { NitroliteRPCMessage, MessageSigner, SingleMessageVerifier, MultiMessageVerifier, ParsedResponse, ApplicationRPCMessage, RPCResponse, RPCMethod } from './types'; export declare class NitroliteRPC { static createRequest(requestId: number | undefined, method: RPCMethod, params?: any[], timestamp?: number): NitroliteRPCMessage; static createAppRequest(requestId: number | undefined, method: RPCMethod, params: any[] | undefined, timestamp: number | undefined, sid: Hex): ApplicationRPCMessage; static parseResponse(rawMessage: string | object): ParsedResponse; static isResponseType<T extends RPCResponse>(response: ParsedResponse, method: T['method']): response is ParsedResponse & { data: T['params']; }; private static getMessagePayload; static signRequestMessage(message: NitroliteRPCMessage, signer: MessageSigner): Promise<NitroliteRPCMessage>; static verifySingleSignature(message: NitroliteRPCMessage, expectedSigner: Address, verifier: SingleMessageVerifier): Promise<boolean>; static verifyMultipleSignatures(message: NitroliteRPCMessage, expectedSigners: Address[], verifier: MultiMessageVerifier): Promise<boolean>; }