npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

lumina-node

v0.8.2

Published

Lumina node for Celestia, running in browser

Downloads

122

Readme

lumina-node-wasm


Lumina node wasm

A compatibility layer for the Lumina node to work within a browser environment and be operable with javascript.

Changelog

You can find about the latest changes here.

Example

Starting lumina inside a dedicated worker

import { spawnNode, Network, NodeConfig } from "lumina-node";

const node = await spawnNode();
const mainnetConfig = NodeConfig.default(Network.Mainnet);

await node.start(mainnetConfig);

await node.waitConnected();
await node.requestHeadHeader();

Manual setup

spawnNode sets up a DedicatedWorker instance and runs NodeWorker there. If you want to set things up manually you need to connect client and worker using objects that have MessagePort interface.

import { Network, NodeClient, NodeConfig, NodeWorker } from "lumina-node";

const config = NodeConfig.default(Network.Mainnet);

// client and worker accept any object with MessagePort like interface e.g. Worker
const channel = new MessageChannel();
const worker = new NodeWorker(channel.port1);

// note that this runs lumina in the current context (and doesn't create a new web-worker). Promise created with `.run()` never completes.
const worker_promise = worker.run();

// client port can be used locally or transferred like any plain MessagePort
const client = await new NodeClient(channel.port2);
await client.waitConnected();
await client.requestHeadHeader();

Rust API

For comprehensive and fully typed interface documentation, see lumina-node and celestia-types documentation on docs.rs. You can see there the exact structure of more complex types, such as ExtendedHeader. JavaScript API's goal is to provide similar interface to Rust when possible, e.g. NodeClient mirrors Node.

Classes

lumina-node-wasm


lumina-node-wasm / AccAddress

Class: AccAddress

Address of an account.

Methods

free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:154


toJSON()

toJSON(): Object

  • Return copy of self without private attributes.
Returns

Object

Defined in

lumina_node_wasm.d.ts:149


toString()

toString(): string

Return stringified version of self.

Returns

string

Defined in

lumina_node_wasm.d.ts:153

lumina-node-wasm


lumina-node-wasm / AppVersion

Class: AppVersion

Version of the App

Properties

V1

readonly static V1: AppVersion

App v1

Defined in

lumina_node_wasm.d.ts:169


V2

readonly static V2: AppVersion

App v2

Defined in

lumina_node_wasm.d.ts:173


V3

readonly static V3: AppVersion

App v3

Defined in

lumina_node_wasm.d.ts:177

Methods

free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:161


latest()

static latest(): AppVersion

Latest App version variant.

Returns

AppVersion

Defined in

lumina_node_wasm.d.ts:165

lumina-node-wasm


lumina-node-wasm / Blob

Class: Blob

Arbitrary data that can be stored in the network within certain [Namespace].

Constructors

new Blob()

new Blob(namespace, data, app_version): Blob

Create a new blob with the given data within the [Namespace].

Parameters
namespace

Namespace

data

Uint8Array<ArrayBuffer>

app_version

AppVersion

Returns

Blob

Defined in

lumina_node_wasm.d.ts:195

Properties

commitment

commitment: Commitment

A [Commitment] computed from the Blobs data.

Defined in

lumina_node_wasm.d.ts:215


data

data: Uint8Array<ArrayBuffer>

Data stored within the Blob.

Defined in

lumina_node_wasm.d.ts:207


namespace

namespace: Namespace

A [Namespace] the Blob belongs to.

Defined in

lumina_node_wasm.d.ts:203


share_version

share_version: number

Version indicating the format in which Shares should be created from this Blob.

Defined in

lumina_node_wasm.d.ts:211

Accessors

index

Get Signature

get index(): bigint

Index of the blob's first share in the EDS. Only set for blobs retrieved from chain.

Returns

bigint

Set Signature

set index(value): void

Index of the blob's first share in the EDS. Only set for blobs retrieved from chain.

Parameters

####### value

bigint

Returns

void

Defined in

lumina_node_wasm.d.ts:219


signer

Get Signature

get signer(): AccAddress

A signer of the blob, i.e. address of the account which submitted the blob.

Must be present in share_version 1 and absent otherwise.

Returns

AccAddress

Set Signature

set signer(value): void

A signer of the blob, i.e. address of the account which submitted the blob.

Must be present in share_version 1 and absent otherwise.

Parameters

####### value

AccAddress

Returns

void

Defined in

lumina_node_wasm.d.ts:229

Methods

clone()

clone(): Blob

Clone a blob creating a new deep copy of it.

Returns

Blob

Defined in

lumina_node_wasm.d.ts:199


free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:191


toJSON()

toJSON(): Object

  • Return copy of self without private attributes.
Returns

Object

Defined in

lumina_node_wasm.d.ts:186


toString()

toString(): string

Return stringified version of self.

Returns

string

Defined in

lumina_node_wasm.d.ts:190

lumina-node-wasm


lumina-node-wasm / BlockRange

Class: BlockRange

A range of blocks between start and end height, inclusive

Properties

end

end: bigint

Last block height in range

Defined in

lumina_node_wasm.d.ts:258


start

start: bigint

First block height in range

Defined in

lumina_node_wasm.d.ts:254

Methods

free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:250


toJSON()

toJSON(): Object

  • Return copy of self without private attributes.
Returns

Object

Defined in

lumina_node_wasm.d.ts:245


toString()

toString(): string

Return stringified version of self.

Returns

string

Defined in

lumina_node_wasm.d.ts:249

lumina-node-wasm


lumina-node-wasm / Commitment

Class: Commitment

A merkle hash used to identify the Blobs data.

In Celestia network, the transaction which pays for the blob's inclusion is separated from the data itself. The reason for that is to allow verifying the blockchain's state without the need to pull the actual data which got stored. To achieve that, the MsgPayForBlobs transaction only includes the [Commitment]s of the blobs it is paying for, not the data itself.

The algorithm of computing the [Commitment] of the Blob's Shares is designed in a way to allow easy and cheap proving of the Shares inclusion in the block. It is computed as a merkle hash of all the Nmt subtree roots created from the blob shares included in the ExtendedDataSquare rows. Assuming the s1 and s2 are the only shares of some blob posted to the celestia, they'll result in a single subtree root as shown below:

NMT:           row root
               /     \
             o   subtree root
            / \      / \
          _________________
EDS row: | s | s | s1 | s2 |

Using subtree roots as a base for [Commitment] computation allows for much smaller inclusion proofs than when the Shares would be used directly, but it imposes some constraints on how the Blobs can be placed in the ExtendedDataSquare. You can read more about that in the share commitment rules.

Methods

free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:308


hash()

hash(): Uint8Array<ArrayBuffer>

Hash of the commitment

Returns

Uint8Array<ArrayBuffer>

Defined in

lumina_node_wasm.d.ts:312


toJSON()

toJSON(): Object

  • Return copy of self without private attributes.
Returns

Object

Defined in

lumina_node_wasm.d.ts:303


toString()

toString(): string

Return stringified version of self.

Returns

string

Defined in

lumina_node_wasm.d.ts:307

lumina-node-wasm


lumina-node-wasm / ConnectionCountersSnapshot

Class: ConnectionCountersSnapshot

Properties

num_connections

num_connections: number

The total number of connections, both pending and established.

Defined in

lumina_node_wasm.d.ts:328


num_established

num_established: number

The number of outgoing connections being established.

Defined in

lumina_node_wasm.d.ts:344


num_established_incoming

num_established_incoming: number

The number of established incoming connections.

Defined in

lumina_node_wasm.d.ts:348


num_established_outgoing

num_established_outgoing: number

The number of established outgoing connections.

Defined in

lumina_node_wasm.d.ts:352


num_pending

num_pending: number

The total number of pending connections, both incoming and outgoing.

Defined in

lumina_node_wasm.d.ts:332


num_pending_incoming

num_pending_incoming: number

The total number of pending connections, both incoming and outgoing.

Defined in

lumina_node_wasm.d.ts:336


num_pending_outgoing

num_pending_outgoing: number

The number of outgoing connections being established.

Defined in

lumina_node_wasm.d.ts:340

Methods

free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:324


toJSON()

toJSON(): Object

  • Return copy of self without private attributes.
Returns

Object

Defined in

lumina_node_wasm.d.ts:319


toString()

toString(): string

Return stringified version of self.

Returns

string

Defined in

lumina_node_wasm.d.ts:323

lumina-node-wasm


lumina-node-wasm / ConsAddress

Class: ConsAddress

Address of a consensus node.

Methods

free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:367


toJSON()

toJSON(): Object

  • Return copy of self without private attributes.
Returns

Object

Defined in

lumina_node_wasm.d.ts:362


toString()

toString(): string

Return stringified version of self.

Returns

string

Defined in

lumina_node_wasm.d.ts:366

lumina-node-wasm


lumina-node-wasm / DataAvailabilityHeader

Class: DataAvailabilityHeader

Header with commitments of the data availability.

It consists of the root hashes of the merkle trees created from each row and column of the ExtendedDataSquare. Those are used to prove the inclusion of the data in a block.

The hash of this header is a hash of all rows and columns and thus a data commitment of the block.

Example

## use celestia_types::{ExtendedHeader, Height, Share};
## use celestia_types::nmt::{Namespace, NamespaceProof};
## fn extended_header() -> ExtendedHeader {
##     unimplemented!();
## }
## fn shares_with_proof(_: Height, _: &Namespace) -> (Vec<Share>, NamespaceProof) {
##     unimplemented!();
## }
// fetch the block header and data for your namespace
let namespace = Namespace::new_v0(&[1, 2, 3, 4]).unwrap();
let eh = extended_header();
let (shares, proof) = shares_with_proof(eh.height(), &namespace);

// get the data commitment for a given row
let dah = eh.dah;
let root = dah.row_root(0).unwrap();

// verify a proof of the inclusion of the shares
assert!(proof.verify_complete_namespace(&root, &shares, *namespace).is_ok());

Methods

columnRoot()

columnRoot(column): any

Get the a root of the column with the given index.

Parameters
column

number

Returns

any

Defined in

lumina_node_wasm.d.ts:431


columnRoots()

columnRoots(): any[]

Merkle roots of the ExtendedDataSquare columns.

Returns

any[]

Defined in

lumina_node_wasm.d.ts:423


free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:415


hash()

hash(): any

Compute the combined hash of all rows and columns.

This is the data commitment for the block.

Returns

any

Defined in

lumina_node_wasm.d.ts:437


rowRoot()

rowRoot(row): any

Get a root of the row with the given index.

Parameters
row

number

Returns

any

Defined in

lumina_node_wasm.d.ts:427


rowRoots()

rowRoots(): any[]

Merkle roots of the ExtendedDataSquare rows.

Returns

any[]

Defined in

lumina_node_wasm.d.ts:419


squareWidth()

squareWidth(): number

Get the size of the ExtendedDataSquare for which this header was built.

Returns

number

Defined in

lumina_node_wasm.d.ts:441


toJSON()

toJSON(): Object

  • Return copy of self without private attributes.
Returns

Object

Defined in

lumina_node_wasm.d.ts:410


toString()

toString(): string

Return stringified version of self.

Returns

string

Defined in

lumina_node_wasm.d.ts:414

lumina-node-wasm


lumina-node-wasm / ExtendedHeader

Class: ExtendedHeader

Block header together with the relevant Data Availability metadata.

[ExtendedHeader]s are used to announce and describe the blocks in the Celestia network.

Before being used, each header should be validated and verified with a header you trust.

Example

## use celestia_types::ExtendedHeader;
## fn trusted_genesis_header() -> ExtendedHeader {
##     let s = include_str!("../test_data/chain1/extended_header_block_1.json");
##     serde_json::from_str(s).unwrap()
## }
## fn some_untrusted_header() -> ExtendedHeader {
##     let s = include_str!("../test_data/chain1/extended_header_block_27.json");
##     serde_json::from_str(s).unwrap()
## }
let genesis_header = trusted_genesis_header();

// fetch new header
let fetched_header = some_untrusted_header();

fetched_header.validate().expect("Invalid block header");
genesis_header.verify(&fetched_header).expect("Malicious header received");

Properties

commit

readonly commit: any

Commit metadata and signatures from validators committing the block.

Defined in

lumina_node_wasm.d.ts:572


dah

dah: DataAvailabilityHeader

Header of the block data availability.

Defined in

lumina_node_wasm.d.ts:564


header

readonly header: any

Tendermint block header.

Defined in

lumina_node_wasm.d.ts:568


validatorSet

readonly validatorSet: any

Information about the set of validators commiting the block.

Defined in

lumina_node_wasm.d.ts:576

Methods

clone()

clone(): ExtendedHeader

Clone a header producing a deep copy of it.

Returns

ExtendedHeader

Defined in

lumina_node_wasm.d.ts:486


free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:482


hash()

hash(): string

Get the block hash.

Returns

string

Defined in

lumina_node_wasm.d.ts:498


height()

height(): bigint

Get the block height.

Returns

bigint

Defined in

lumina_node_wasm.d.ts:490


previousHeaderHash()

previousHeaderHash(): string

Get the hash of the previous header.

Returns

string

Defined in

lumina_node_wasm.d.ts:502


time()

time(): number

Get the block time.

Returns

number

Defined in

lumina_node_wasm.d.ts:494


toJSON()

toJSON(): Object

  • Return copy of self without private attributes.
Returns

Object

Defined in

lumina_node_wasm.d.ts:477


toString()

toString(): string

Return stringified version of self.

Returns

string

Defined in

lumina_node_wasm.d.ts:481


validate()

validate(): void

Decode protobuf encoded header and then validate it.

Returns

void

Defined in

lumina_node_wasm.d.ts:506


verify()

verify(untrusted): void

Verify a chain of adjacent untrusted headers and make sure they are adjacent to self.

Errors

If verification fails, this function will return an error with a reason of failure. This function will also return an error if untrusted headers and self don't form contiguous range

Parameters
untrusted

ExtendedHeader

Returns

void

Defined in

lumina_node_wasm.d.ts:516


verifyAdjacentRange()

verifyAdjacentRange(untrusted): void

Verify a chain of adjacent untrusted headers and make sure they are adjacent to self.

Note

Provided headers will be consumed by this method, meaning they will no longer be accessible. If this behavior is not desired, consider using ExtendedHeader.clone().

const genesis = hdr0;
const headers = [hrd1, hdr2, hdr3];
genesis.verifyAdjacentRange(headers.map(h => h.clone()));

Errors

If verification fails, this function will return an error with a reason of failure. This function will also return an error if untrusted headers and self don't form contiguous range

Parameters
untrusted

ExtendedHeader[]

Returns

void

Defined in

lumina_node_wasm.d.ts:560


verifyRange()

verifyRange(untrusted): void

Verify a chain of adjacent untrusted headers.

Note

Provided headers will be consumed by this method, meaning they will no longer be accessible. If this behavior is not desired, consider using ExtendedHeader.clone().

const genesis = hdr0;
const headers = [hrd1, hdr2, hdr3];
genesis.verifyRange(headers.map(h => h.clone()));

Errors

If verification fails, this function will return an error with a reason of failure. This function will also return an error if untrusted headers are not adjacent to each other.

Parameters
untrusted

ExtendedHeader[]

Returns

void

Defined in

lumina_node_wasm.d.ts:538

lumina-node-wasm


lumina-node-wasm / IntoUnderlyingByteSource

Class: IntoUnderlyingByteSource

Properties

autoAllocateChunkSize

readonly autoAllocateChunkSize: number

Defined in

lumina_node_wasm.d.ts:585


type

readonly type: "bytes"

Defined in

lumina_node_wasm.d.ts:584

Methods

cancel()

cancel(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:583


free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:580


pull()

pull(controller): Promise<any>

Parameters
controller

ReadableByteStreamController

Returns

Promise<any>

Defined in

lumina_node_wasm.d.ts:582


start()

start(controller): void

Parameters
controller

ReadableByteStreamController

Returns

void

Defined in

lumina_node_wasm.d.ts:581

lumina-node-wasm


lumina-node-wasm / IntoUnderlyingSink

Class: IntoUnderlyingSink

Methods

abort()

abort(reason): Promise<any>

Parameters
reason

any

Returns

Promise<any>

Defined in

lumina_node_wasm.d.ts:592


close()

close(): Promise<any>

Returns

Promise<any>

Defined in

lumina_node_wasm.d.ts:591


free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:589


write()

write(chunk): Promise<any>

Parameters
chunk

any

Returns

Promise<any>

Defined in

lumina_node_wasm.d.ts:590

lumina-node-wasm


lumina-node-wasm / IntoUnderlyingSource

Class: IntoUnderlyingSource

Methods

cancel()

cancel(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:598


free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:596


pull()

pull(controller): Promise<any>

Parameters
controller

ReadableStreamDefaultController<any>

Returns

Promise<any>

Defined in

lumina_node_wasm.d.ts:597

lumina-node-wasm


lumina-node-wasm / Namespace

Class: Namespace

Namespace of the data published to the celestia network.

The [Namespace] is a single byte defining the version followed by 28 bytes specifying concrete ID of the namespace.

Currently there are two versions of namespaces:

  • version 0 - the one allowing for the custom namespace ids. It requires an id to start with 18 0x00 bytes followed by a user specified suffix (except reserved ones, see below).
  • version 255 - for secondary reserved namespaces. It requires an id to start with 27 0xff bytes followed by a single byte indicating the id.

Some namespaces are reserved for the block creation purposes and cannot be used when submitting the blobs to celestia. Those fall into one of the two categories:

  • primary reserved namespaces - those use version 0 and have id lower or equal to 0xff so they are always placed in blocks before user-submitted data.
  • secondary reserved namespaces - those use version 0xff so they are always placed after user-submitted data.

Properties

id

readonly id: Uint8Array<ArrayBuffer>

Returns the trailing 28 bytes indicating the id of the [Namespace].

Defined in

lumina_node_wasm.d.ts:707


version

readonly version: number

Returns the first byte indicating the version of the [Namespace].

Defined in

lumina_node_wasm.d.ts:703


MAX_PRIMARY_RESERVED

readonly static MAX_PRIMARY_RESERVED: Namespace

Maximal primary reserved [Namespace].

Used to indicate the end of the primary reserved group.

Defined in

lumina_node_wasm.d.ts:678


MIN_SECONDARY_RESERVED

readonly static MIN_SECONDARY_RESERVED: Namespace

Minimal secondary reserved [Namespace].

Used to indicate the beginning of the secondary reserved group.

Defined in

lumina_node_wasm.d.ts:684


NS_SIZE

readonly static NS_SIZE: number

Namespace size in bytes.

Defined in

lumina_node_wasm.d.ts:657


PARITY_SHARE

readonly static PARITY_SHARE: Namespace

The [Namespace] for parity shares.

It is the namespace with which all the parity shares from ExtendedDataSquare are inserted to the Nmt when computing merkle roots.

Defined in

lumina_node_wasm.d.ts:699


PAY_FOR_BLOB

readonly static PAY_FOR_BLOB: Namespace

Primary reserved [Namespace] for the compact Shares with MsgPayForBlobs transactions.

Defined in

lumina_node_wasm.d.ts:665


PRIMARY_RESERVED_PADDING

readonly static PRIMARY_RESERVED_PADDING: Namespace

Primary reserved [Namespace] for the Shares used for padding.

Shares with this namespace are inserted after other shares from primary reserved namespace so that user-defined namespaces are correctly aligned in ExtendedDataSquare

Defined in

lumina_node_wasm.d.ts:672


TAIL_PADDING

readonly static TAIL_PADDING: Namespace

Secondary reserved [Namespace] used for padding after the blobs.

It is used to fill up the original data square after all user-submitted blobs before the parity data is generated for the ExtendedDataSquare.

Defined in

lumina_node_wasm.d.ts:691


TRANSACTION

readonly static TRANSACTION: Namespace

Primary reserved [Namespace] for the compact Shares with cosmos SDK transactions.

Defined in

lumina_node_wasm.d.ts:661

Methods

asBytes()

asBytes(): Uint8Array<ArrayBuffer>

Converts the [Namespace] to a byte slice.

Returns

Uint8Array<ArrayBuffer>

Defined in

lumina_node_wasm.d.ts:653


free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:631


toJSON()

toJSON(): Object

  • Return copy of self without private attributes.
Returns

Object

Defined in

lumina_node_wasm.d.ts:626


toString()

toString(): string

Return stringified version of self.

Returns

string

Defined in

lumina_node_wasm.d.ts:630


fromRaw()

static fromRaw(raw): Namespace

Create a new [Namespace] from the raw bytes.

Errors

This function will return an error if the slice length is different than [NS_SIZE] or if the namespace is invalid. If you are constructing the version 0 namespace, check [newV0].

Parameters
raw

Uint8Array<ArrayBuffer>

Returns

Namespace

Defined in

lumina_node_wasm.d.ts:649


newV0()

static newV0(id): Namespace

Create a new [Namespace] version 0 with given id.

Check Namespace::new_v0 for more details.

Parameters
id

Uint8Array<ArrayBuffer>

Returns

Namespace

Defined in

lumina_node_wasm.d.ts:639

lumina-node-wasm


lumina-node-wasm / NetworkInfoSnapshot

Class: NetworkInfoSnapshot

Information about the connections

Properties

connection_counters

connection_counters: ConnectionCountersSnapshot

Gets counters for ongoing network connections.

Defined in

lumina_node_wasm.d.ts:730


num_peers

num_peers: number

The number of connected peers, i.e. peers with whom at least one established connection exists.

Defined in

lumina_node_wasm.d.ts:726

Methods

free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:722


toJSON()

toJSON(): Object

  • Return copy of self without private attributes.
Returns

Object

Defined in

lumina_node_wasm.d.ts:717


toString()

toString(): string

Return stringified version of self.

Returns

string

Defined in

lumina_node_wasm.d.ts:721

lumina-node-wasm


lumina-node-wasm / NodeClient

Class: NodeClient

NodeClient is responsible for steering NodeWorker by sending it commands and receiving responses over the provided port.

Constructors

new NodeClient()

new NodeClient(port): NodeClient

Create a new connection to a Lumina node running in NodeWorker. Provided port is expected to have MessagePort-like interface for sending and receiving messages.

Parameters
port

any

Returns

NodeClient

Defined in

lumina_node_wasm.d.ts:744

Methods

addConnectionToWorker()

addConnectionToWorker(port): Promise<void>

Establish a new connection to the existing worker over provided port

Parameters
port

any

Returns

Promise<void>

Defined in

lumina_node_wasm.d.ts:748


connectedPeers()

connectedPeers(): Promise<any[]>

Get all the peers that node is connected to.

Returns

Promise<any[]>

Defined in

lumina_node_wasm.d.ts:785


eventsChannel()

eventsChannel(): Promise<BroadcastChannel>

Returns a [BroadcastChannel] for events generated by [Node].

Returns

Promise<BroadcastChannel>

Defined in

lumina_node_wasm.d.ts:852


free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:739


getHeaderByHash()

getHeaderByHash(hash): Promise<ExtendedHeader>

Get a synced header for the block with a given hash.

Parameters
hash

string

Returns

Promise<ExtendedHeader>

Defined in

lumina_node_wasm.d.ts:828


getHeaderByHeight()

getHeaderByHeight(height): Promise<ExtendedHeader>

Get a synced header for the block with a given height.

Parameters
height

bigint

Returns

Promise<ExtendedHeader>

Defined in

lumina_node_wasm.d.ts:832


getHeaders()

getHeaders(start_height?, end_height?): Promise<ExtendedHeader[]>

Get synced headers from the given heights range.

If start of the range is undefined (None), the first returned header will be of height 1. If end of the range is undefined (None), the last returned header will be the last header in the store.

Errors

If range contains a height of a header that is not found in the store.

Parameters
start_height?

bigint

end_height?

bigint

Returns

Promise<ExtendedHeader[]>

Defined in

lumina_node_wasm.d.ts:844


getLocalHeadHeader()

getLocalHeadHeader(): Promise<ExtendedHeader>

Get the latest locally synced header.

Returns

Promise<ExtendedHeader>

Defined in

lumina_node_wasm.d.ts:824


getNetworkHeadHeader()

getNetworkHeadHeader(): Promise<ExtendedHeader>

Get the latest header announced in the network.

Returns

Promise<ExtendedHeader>

Defined in

lumina_node_wasm.d.ts:820


getSamplingMetadata()

getSamplingMetadata(height): Promise<SamplingMetadata>

Get data sampling metadata of an already sampled height.

Parameters
height

bigint

Returns

Promise<SamplingMetadata>

Defined in

lumina_node_wasm.d.ts:848


isRunning()

isRunning(): Promise<boolean>

Check whether Lumina is currently running

Returns

Promise<boolean>

Defined in

lumina_node_wasm.d.ts:752


listeners()

listeners(): Promise<any[]>

Get all the multiaddresses on which the node listens.

Returns

Promise<any[]>

Defined in

lumina_node_wasm.d.ts:781


localPeerId()

localPeerId(): Promise<string>

Get node's local peer ID.

Returns

Promise<string>

Defined in

lumina_node_wasm.d.ts:761


networkInfo()

networkInfo(): Promise<NetworkInfoSnapshot>

Get current network info.

Returns

Promise<NetworkInfoSnapshot>

Defined in

lumina_node_wasm.d.ts:777


peerTrackerInfo()

peerTrackerInfo(): Promise<PeerTrackerInfoSnapshot>

Get current [PeerTracker] info.

Returns

Promise<PeerTrackerInfoSnapshot>

Defined in

lumina_node_wasm.d.ts:765


requestAllBlobs()

requestAllBlobs(header, namespace, timeout_secs?): Promise<Blob[]>

Request all blobs with provided namespace in the block corresponding to this header using bitswap protocol.

Parameters
header

ExtendedHeader

namespace

Namespace

timeout_secs?

number

Returns

Promise<Blob[]>

Defined in

lumina_node_wasm.d.ts:812


requestHeaderByHash()

requestHeaderByHash(hash): Promise<ExtendedHeader>

Request a header for the block with a given hash from the network.

Parameters
hash

string

Returns

Promise<ExtendedHeader>

Defined in

lumina_node_wasm.d.ts:797


requestHeaderByHeight()

requestHeaderByHeight(height): Promise<ExtendedHeader>

Request a header for the block with a given height from the network.

Parameters
height

bigint

Returns

Promise<ExtendedHeader>

Defined in

lumina_node_wasm.d.ts:801


requestHeadHeader()

requestHeadHeader(): Promise<ExtendedHeader>

Request the head header from the network.

Returns

Promise<ExtendedHeader>

Defined in

lumina_node_wasm.d.ts:793


requestVerifiedHeaders()

requestVerifiedHeaders(from, amount): Promise<ExtendedHeader[]>

Request headers in range (from, from + amount] from the network.

The headers will be verified with the from header.

Parameters
from

ExtendedHeader

amount

bigint

Returns

Promise<ExtendedHeader[]>

Defined in

lumina_node_wasm.d.ts:807


setPeerTrust()

setPeerTrust(peer_id, is_trusted): Promise<void>

Trust or untrust the peer with a given ID.

Parameters
peer_id

string

is_trusted

boolean

Returns

Promise<void>

Defined in

lumina_node_wasm.d.ts:789


start()

start(config): Promise<void>

Start a node with the provided config, if it's not running

Parameters
config

NodeConfig

Returns

Promise<void>

Defined in

lumina_node_wasm.d.ts:756


stop()

stop(): Promise<void>

Returns

Promise<void>

Defined in

lumina_node_wasm.d.ts:757


syncerInfo()

syncerInfo(): Promise<SyncingInfoSnapshot>

Get current header syncing info.

Returns

Promise<SyncingInfoSnapshot>

Defined in

lumina_node_wasm.d.ts:816


waitConnected()

waitConnected(): Promise<void>

Wait until the node is connected to at least 1 peer.

Returns

Promise<void>

Defined in

lumina_node_wasm.d.ts:769


waitConnectedTrusted()

waitConnectedTrusted(): Promise<void>

Wait until the node is connected to at least 1 trusted peer.

Returns

Promise<void>

Defined in

lumina_node_wasm.d.ts:773

lumina-node-wasm


lumina-node-wasm / NodeConfig

Class: NodeConfig

Config for the lumina wasm node.

Properties

bootnodes

bootnodes: string[]

A list of bootstrap peers to connect to.

Defined in

lumina_node_wasm.d.ts:879


network

network: Network

A network to connect to.

Defined in

lumina_node_wasm.d.ts:875


usePersistentMemory

usePersistentMemory: boolean

Whether to store data in persistent memory or not.

Default value: true

Defined in

lumina_node_wasm.d.ts:885

Accessors

customPruningDelaySecs

Get Signature

get customPruningDelaySecs(): number

Pruning delay defines how much time the pruner should wait after sampling window in order to prune the block.

If this is not set, then default value will apply:

  • If use_persistent_memory == true, default value is 1 hour.
  • If use_persistent_memory == false, default value is 60 seconds.

The minimum value that can be set is 60 seconds.

Returns

number

Set Signature

set customPruningDelaySecs(value): void

Pruning delay defines how much time the pruner should wait after sampling window in order to prune the block.

If this is not set, then default value will apply:

  • If use_persistent_memory == true, default value is 1 hour.
  • If use_persistent_memory == false, default value is 60 seconds.

The minimum value that can be set is 60 seconds.

Parameters

####### value

number

Returns

void

Defined in

lumina_node_wasm.d.ts:919


customSamplingWindowSecs

Get Signature

get customSamplingWindowSecs(): number

Sampling window defines maximum age of a block considered for syncing and sampling.

If this is not set, then default value will apply:

  • If use_persistent_memory == true, default value is 30 days.
  • If use_persistent_memory == false, default value is 60 seconds.

The minimum value that can be set is 60 seconds.

Returns

number

Set Signature

set customSamplingWindowSecs(value): void

Sampling window defines maximum age of a block considered for syncing and sampling.

If this is not set, then default value will apply:

  • If use_persistent_memory == true, default value is 30 days.
  • If use_persistent_memory == false, default value is 60 seconds.

The minimum value that can be set is 60 seconds.

Parameters

####### value

number

Returns

void

Defined in

lumina_node_wasm.d.ts:896

Methods

free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:867


toJSON()

toJSON(): Object

  • Return copy of self without private attributes.
Returns

Object

Defined in

lumina_node_wasm.d.ts:862


toString()

toString(): string

Return stringified version of self.

Returns

string

Defined in

lumina_node_wasm.d.ts:866


default()

static default(network): NodeConfig

Get the configuration with default bootnodes for provided network

Parameters
network

Network

Returns

NodeConfig

Defined in

lumina_node_wasm.d.ts:871

lumina-node-wasm


lumina-node-wasm / NodeWorker

Class: NodeWorker

NodeWorker is responsible for receiving commands from connected NodeClients, executing them and sending a response back, as well as accepting new NodeClient connections.

Constructors

new NodeWorker()

new NodeWorker(port_like_object): NodeWorker

Parameters
port_like_object

any

Returns

NodeWorker

Defined in

lumina_node_wasm.d.ts:941

Methods

free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:940


run()

run(): Promise<void>

Returns

Promise<void>

Defined in

lumina_node_wasm.d.ts:942

lumina-node-wasm


lumina-node-wasm / PeerTrackerInfoSnapshot

Class: PeerTrackerInfoSnapshot

Statistics of the connected peers

Properties

num_connected_peers

num_connected_peers: bigint

Number of the connected peers.

Defined in

lumina_node_wasm.d.ts:961


num_connected_trusted_peers

num_connected_trusted_peers: bigint

Number of the connected trusted peers.

Defined in

lumina_node_wasm.d.ts:965

Methods

free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:957


toJSON()

toJSON(): Object

  • Return copy of self without private attributes.
Returns

Object

Defined in

lumina_node_wasm.d.ts:952


toString()

toString(): string

Return stringified version of self.

Returns

string

Defined in

lumina_node_wasm.d.ts:956

lumina-node-wasm


lumina-node-wasm / SamplingMetadata

Class: SamplingMetadata

Sampling metadata for a block.

This struct persists DAS-ing information in a header store for future reference.

Properties

cids

readonly cids: Uint8Array<ArrayBuffer>[]

Return Array of cids

Defined in

lumina_node_wasm.d.ts:982


status

status: SamplingStatus

Indicates whether this node was able to successfuly sample the block

Defined in

lumina_node_wasm.d.ts:978

Methods

free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:974

lumina-node-wasm


lumina-node-wasm / SyncingInfoSnapshot

Class: SyncingInfoSnapshot

Status of the synchronization.

Properties

stored_headers

stored_headers: BlockRange[]

Ranges of headers that are already synchronised

Defined in

lumina_node_wasm.d.ts:1001


subjective_head

subjective_head: bigint

Syncing target. The latest height seen in the network that was successfully verified.

Defined in

lumina_node_wasm.d.ts:1005

Methods

free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:997


toJSON()

toJSON(): Object

  • Return copy of self without private attributes.
Returns

Object

Defined in

lumina_node_wasm.d.ts:992


toString()

toString(): string

Return stringified version of self.

Returns

string

Defined in

lumina_node_wasm.d.ts:996

lumina-node-wasm


lumina-node-wasm / TxClient

Class: TxClient

Celestia grpc transaction client.

Constructors

new TxClient()

new TxClient(url, bech32_address, pubkey, signer_fn): TxClient

Create a new transaction client with the specified account.

Url must point to a grpc-web proxy.

Example with noble/curves

import { secp256k1 } from "@noble/curves/secp256k1";

const address = "celestia169s50psyj2f4la9a2235329xz7rk6c53zhw9mm";
const privKey = "fdc8ac75dfa1c142dbcba77938a14dd03078052ce0b49a529dcf72a9885a3abb";
const pubKey = secp256k1.getPublicKey(privKey);

const signer = (signDoc) => {
  const bytes = protoEncodeSignDoc(signDoc);
  const sig = secp256k1.sign(bytes, privKey, { prehash: true });
  return sig.toCompactRawBytes();
};

const txClient = await new TxClient("http://127.0.0.1:18080", address, pubKey, signer);

Example with leap wallet

await window.leap.enable("mocha-4")
const keys = await window.leap.getKey("mocha-4")

const signer = (signDoc) => {
  return window.leap.signDirect("mocha-4", keys.bech32Address, signDoc, { preferNoSetFee: true })
    .then(sig => Uint8Array.from(atob(sig.signature.signature), c => c.charCodeAt(0)))
}

const tx_client = await new TxClient("http://127.0.0.1:18080", keys.bech32Address, keys.pubKey, signer)
Parameters
url

string

bech32_address

string

pubkey

Uint8Array<ArrayBuffer>

signer_fn

SignerFn

Returns

TxClient

Defined in

lumina_node_wasm.d.ts:1047

Properties

appVersion

readonly appVersion: AppVersion

AppVersion of the client

Defined in

lumina_node_wasm.d.ts:1142


chainId

readonly chainId: string

Chain id of the client

Defined in

lumina_node_wasm.d.ts:1138

Methods

free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:1011


getAccount()

getAccount(account): Promise<BaseAccount>

Get account

Parameters
account

string

Returns

Promise<BaseAccount>

Defined in

lumina_node_wasm.d.ts:1114


getAccounts()

getAccounts(): Promise<BaseAccount[]>

Get accounts

Returns

Promise<BaseAccount[]>

Defined in

lumina_node_wasm.d.ts:1118


getAllBalances()

getAllBalances(address): Promise<Coin[]>

Get balance of all coins

Parameters
address

string

Returns

Promise<Coin[]>

Defined in

lumina_node_wasm.d.ts:1126


getAuthParams()

getAuthParams(): Promise<AuthParams>

Get auth params

Returns

Promise<AuthParams>

Defined in

lumina_node_wasm.d.ts:1110


getBalance()

getBalance(address, denom): Promise<Coin>

Get balance of coins with given denom

Parameters
address

string

denom

string

Returns

Promise<Coin>

Defined in

lumina_node_wasm.d.ts:1122


getSpendableBalances()

getSpendableBalances(address): Promise<Coin[]>

Get balance of all spendable coins

Parameters
address

string

Returns

Promise<Coin[]>

Defined in

lumina_node_wasm.d.ts:1130


getTotalSupply()

getTotalSupply(): Promise<Coin[]>

Get total supply

Returns

Promise<Coin[]>

Defined in

lumina_node_wasm.d.ts:1134


lastSeenGasPrice()

lastSeenGasPrice(): number

Last gas price fetched by the client

Returns

number

Defined in

lumina_node_wasm.d.ts:1051


submitBlobs()

submitBlobs(blobs, tx_config?): Promise<TxInfo>

Submit blobs to the celestia network.

When no TxConfig is provided, client will automatically calculate needed gas and update the gasPrice, if network agreed on a new minimal value. To enforce specific values use a TxConfig.

Example

const ns = Namespace.newV0(new Uint8Array([97, 98, 99]));
const data = new Uint8Array([100, 97, 116, 97]);
const blob = new Blob(ns, data, AppVersion.latest());

const txInfo = await txClient.submitBlobs([blob]);
await txClient.submitBlobs([blob], { gasLimit: 100000n, gasPrice: 0.02 });

Note

Provided blobs will be consumed by this method, meaning they will no longer be accessible. If this behavior is not desired, consider using Blob.clone().

const blobs = [blob1, blob2, blob3];
await txClient.submitBlobs(blobs.map(b => b.clone()));
Parameters
blobs

Blob[]

tx_config?

TxConfig

Returns

Promise<TxInfo>

Defined in

lumina_node_wasm.d.ts:1080


submitMessage()

submitMessage(message, tx_config?): Promise<TxInfo>

Submit message to the celestia network.

When no TxConfig is provided, client will automatically calculate needed gas and update the gasPrice, if network agreed on a new minimal value. To enforce specific values use a TxConfig.

Example

import { Registry } from "@cosmjs/proto-signing";

const registry = new Registry();
const sendMsg = {
  typeUrl: "/cosmos.bank.v1beta1.MsgSend",
  value: {
    fromAddress: "celestia169s50psyj2f4la9a2235329xz7rk6c53zhw9mm",
    toAddress: "celestia1t52q7uqgnjfzdh3wx5m5phvma3umrq8k6tq2p9",
    amount: [{ denom: "utia", amount: "10000" }],
  },
};
const sendMsgAny = registry.encodeAsAny(sendMsg);

const txInfo = await txClient.submitMessage(sendMsgAny);
Parameters
message

ProtoAny

tx_config?

TxConfig

Returns

Promise<TxInfo>

Defined in

lumina_node_wasm.d.ts:1106

lumina-node-wasm


lumina-node-wasm / ValAddress

Class: ValAddress

Address of a validator.

Methods

free()

free(): void

Returns

void

Defined in

lumina_node_wasm.d.ts:1157


toJSON()

toJSON(): Object

  • Return copy of self without private attributes.
Returns

Object

Defined in

lumina_node_wasm.d.ts:1152


toString()

toString(): string

Return stringified version of self.

Returns

string

Defined in

lumina_node_wasm.d.ts:1156

Enumerations

lumina-node-wasm


lumina-node-wasm / Network

Enumeration: Network

Supported Celestia networks.

Enumeration Members

Arabica

Arabica: 1

Arabica testnet.

Defined in

lumina_node_wasm.d.ts:22


Mainnet

Mainnet: 0

Celestia mainnet.

Defined in

lumina_node_wasm.d.ts:18


Mocha

Mocha: 2

Mocha testnet.

Defined in

lumina_node_wasm.d.ts:26


Private

Private: 3

Private local network.

Defined in

lumina_node_wasm.d.ts:30

lumina-node-wasm


lumina-node-wasm / SamplingStatus

Enumeration: SamplingStatus

Sampling status for a block.

Enumeration Members

Accepted

Accepted: 1

Sampling is done and block is accepted.

Defined in

lumina_node_wasm.d.ts:43


Rejected

Rejected: 2

Sampling is done and block is rejected.

Defined in

lumina_node_wasm.d.ts:47


Unknown

Unknown: 0

Sampling is not done.

Defined in

lumina_node_wasm.d.ts:39

Functions

lumina-node-wasm


lumina-node-wasm / protoEncodeSignDoc

Function: protoEncodeSignDoc()

protoEncodeSignDoc(sign_doc): Uint8Array

A helper to encode the SignDoc with protobuf to get bytes to sign directly.

Parameters

sign_doc

SignDoc

Returns

Uint8Array

Defined in

lumina_node_wasm.d.ts:10

lumina-node-wasm


lumina-node-wasm / setup_logging

Function: setup_logging()

setup_logging(): void

Set up a logging layer that direct logs to the browser's console.

Returns

void

Defined in

lumina_node_wasm.d.ts:6

lumina-node-wasm


lumina-node-wasm

Enumerations

Classes

Interfaces

Type Aliases

Functions

Interfaces

lumina-node-wasm


lumina-node-wasm / AuthParams

Interface: AuthParams

Auth module parameters

Properties

maxMemoCharacters

maxMemoCharacters: bigint

Defined in

lumina_node_wasm.d.ts:88


sigVerifyCostEd25519

sigVerifyCostEd25519: bigint

Defined in

lumina_node_wasm.d.ts:91


sigVerifyCostSecp256k1

sigVerifyCostSecp256k1: bigint

Defined in

lumina_node_wasm.d.ts:92


txSigLimit

txSigLimit: bigint

Defined in

lumina_node_wasm.d.ts:89


txSizeCostPerByte

txSizeCostPerByte: bigint

Defined in

lumina_node_wasm.d.ts:90

lumina-node-wasm


lumina-node-wasm / BaseAccount

Interface: BaseAccount

Common data of all account types

Properties

accountNumber

accountNumber: bigint

Defined in

lumina_node_wasm.d.ts:80


address

address: string

Defined in

lumina_node_wasm.d.ts:78


pubkey?

optional pubkey: PublicKey

Defined in

lumina_node_wasm.d.ts:79


sequence

sequence: bigint

Defined in

lumina_node_wasm.d.ts:81

lumina-node-wasm


lumina-node-wasm / Coin

Interface: Coin

Coin

Properties

amount

amount: bigint

Defined in

lumina_node_wasm.d.ts:61


denom

denom: string

Defined in

lumina_node_wasm.d.ts:60

lumina-node-wasm


lumina-node-wasm / ProtoAny

Interface: ProtoAny

Protobuf Any type

Properties

typeUrl

typeUrl: string

Defined in

lumina_node_wasm.d.ts:118


value

value: Uint8Array<ArrayBuffer>

Defined in

lumina_node_wasm.d.ts:119

lumina-node-wasm


lumina-node-wasm / PublicKey

Interface: PublicKey

Public key

Properties

type

type: "ed25519" | "secp256k1"

Defined in

lumina_node_wasm.d.ts:70


value

value: Uint8Array<ArrayBuffer>

Defined in

lumina_node_wasm.d.ts:71

lumina-node-wasm


lumina-node-wasm / SignDoc

Interface: SignDoc

A payload to be signed

Properties

accountNumber

accountNumber: bigint

Defined in

lumina_node_wasm.d.ts:104


authInfoBytes

authInfoBytes: Uint8Array<ArrayBuffer>

Defined in

lumina_node_wasm.d.ts:102


bodyBytes

bodyBytes: Uint8Array<ArrayBuffer>

Defined in

lumina_node_wasm.d.ts:101


chainId

chainId: string

Defined in

lumina_node_wasm.d.ts:103

lumina-node-wasm


lumina-node-wasm / TxConfig

Interface: TxConfig

Transaction config.

Properties

gasLimit?

optional gasLimit: bigint

Defined in

lumina_node_wasm.d.ts:136


gasPrice?

optional gasPrice: number

Defined in

lumina_node_wasm.d.ts:137

lumina-node-wasm


lumina-node-wasm / TxInfo

Interface: TxInfo

Transaction info

Properties

hash

hash: string

Defined in

lumina_node_wasm.d.ts:128


height

height: bigint

Defined in

lumina_node_wasm.d.ts:129

Type Aliases

lumina-node-wasm


lumina-node-wasm / ReadableStreamType

Type Alias: ReadableStreamType

ReadableStreamType: "bytes"

The ReadableStreamType enum.

This API requires the following crate features to be activated: ReadableStreamType

Defined in

lumina_node_wasm.d.ts:54

lumina-node-wasm


lumina-node-wasm / SignerFn

Type Alias: SignerFn

SignerFn: (arg) => Uint8Array | (arg) => Promise<Uint8Array>

A function that produces a signature of a payload

Defined in

lumina_node_wasm.d.ts:110