Options
All
  • Public
  • Public/Protected
  • All
Menu

Package rpc

@ckb-lumos/rpc

RPC module for lumos. Provide type definitions for CKB RPC interface.

Usage

import { RPC } from "@ckb-lumos/rpc"
const rpc = new RPC("http://localhost:8114");
await rpc.get_tip_header();

// Or provide an optional indexer param, if provided, will wait for sync after every RPC call.
const rpc = new RPC("http://localhost:8114", indexer)
await rpc.get_tip_header(); // before it return, will sync indexer to tip.

Index

Type aliases

OutputsValidator

OutputsValidator: "well_known_scripts_only" | "passthrough"

OutputsValidator

OutputsValidator: "well_known_scripts_only" | "passthrough"

SerializedBlock

SerializedBlock: HexString

SerializedBlock

SerializedBlock: HexString

SerializedHeader

SerializedHeader: HexString

SerializedHeader

SerializedHeader: HexString

Functions

asyncSleep

  • asyncSleep(ms?: number): Promise<unknown>
  • Parameters

    • Default value ms: number = 0

    Returns Promise<unknown>

Object literals

Const handler

handler: object

get

  • get(target: any, method: string): (Anonymous function)
  • Parameters

    • target: any
    • method: string

    Returns (Anonymous function)

Generated using TypeDoc