Lumina node for Celestia, running in browser
npm install lumina-nodelumina-node-wasm
*
A compatibility layer for the Lumina node to
work within a browser environment and be operable with javascript.
You can find about the latest changes here.
``javascript
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();
`
spawnNode sets up a DedicatedWorker instance and runs NodeWorker there. If you want to set things up manuallyMessagePort
you need to connect client and worker using objects that have interface.
`javascript
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();
`
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.
*
lumina-node-wasm / AbciMessageLog
ABCIMessageLog defines a structure containing an indexed tx ABCI message log.
#### events
> events: StringEvent[]
Events contains a slice of Event objects that were emitted during some
execution.
##### Defined in
lumina\_node\_wasm.d.ts:157
*
#### log
> log: string
##### Defined in
lumina\_node\_wasm.d.ts:158
*
#### msg\_index
> msg\_index: number
##### Defined in
lumina\_node\_wasm.d.ts:159
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:152
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:151
*
lumina-node-wasm / AbciQueryResponse
Response to a tx query
#### code
> code: ErrorCode
Response code.
##### Defined in
lumina\_node\_wasm.d.ts:179
*
#### codespace
> codespace: string
Namespace for the Code.
##### Defined in
lumina\_node\_wasm.d.ts:183
*
#### height
> readonly height: bigint
The block height from which data was derived.
Note that this is the height of the block containing the application's Merkle root hash,
which represents the state as it was after committing the block at height - 1.
##### Defined in
lumina\_node\_wasm.d.ts:175
*
#### index
> index: bigint
The index of the key in the tree.
##### Defined in
lumina\_node\_wasm.d.ts:187
*
#### info
> info: string
Additional information. May be non-deterministic.
##### Defined in
lumina\_node\_wasm.d.ts:191
*
#### key
> key: Uint8Array\<ArrayBufferLike\>
The key of the matching data.
##### Defined in
lumina\_node\_wasm.d.ts:195
*
#### log
> log: string
The output of the application's logger (raw string). May be
non-deterministic.
##### Defined in
lumina\_node\_wasm.d.ts:200
*
#### value
> value: Uint8Array\<ArrayBufferLike\>
The value of the matching data.
##### Defined in
lumina\_node\_wasm.d.ts:218
#### proof\_ops
##### Get Signature
> get proof\_ops(): ProofOps
Serialized proof for the value data, if requested,
to be verified against the [AppHash] for the given [Height].
[AppHash]: tendermint::hash::AppHash
###### Returns
##### Set Signature
> set proof\_ops(value): void
Serialized proof for the value data, if requested,
to be verified against the [AppHash] for the given [Height].
[AppHash]: tendermint::hash::AppHash
###### Parameters
####### value
###### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:207
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:168
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:167
*
lumina-node-wasm / AccAddress
Address of an account.
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:235
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:234
*
#### toJSON()
> toJSON(): Object
* Return copy of self without private attributes.
##### Returns
Object
##### Defined in
lumina\_node\_wasm.d.ts:229
*
#### toString()
> toString(): string
Return stringified version of self.
##### Returns
string
##### Defined in
lumina\_node\_wasm.d.ts:233
*
lumina-node-wasm / AppVersion
Version of the App
#### V1
> readonly static V1: AppVersion
App v1
##### Defined in
lumina\_node\_wasm.d.ts:252
*
#### V2
> readonly static V2: AppVersion
App v2
##### Defined in
lumina\_node\_wasm.d.ts:256
*
#### V3
> readonly static V3: AppVersion
App v3
##### Defined in
lumina\_node\_wasm.d.ts:260
*
#### V4
> readonly static V4: AppVersion
App v4
##### Defined in
lumina\_node\_wasm.d.ts:264
*
#### V5
> readonly static V5: AppVersion
App v5
##### Defined in
lumina\_node\_wasm.d.ts:268
*
#### V6
> readonly static V6: AppVersion
App v6
##### Defined in
lumina\_node\_wasm.d.ts:272
*
#### V7
> readonly static V7: AppVersion
App v7
##### Defined in
lumina\_node\_wasm.d.ts:276
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:244
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:243
*
#### latest()
Latest App version variant.
##### Returns
##### Defined in
lumina\_node\_wasm.d.ts:248
*
lumina-node-wasm / Attribute
Attribute defines an attribute wrapper where the key and value are
strings instead of raw bytes.
#### key
> key: string
##### Defined in
lumina\_node\_wasm.d.ts:301
*
#### value
> value: string
##### Defined in
lumina\_node\_wasm.d.ts:302
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:300
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:299
*
lumina-node-wasm / AuthInfo
[AuthInfo] describes the fee and signer modes that are used to sign a transaction.
#### fee
> fee: Fee
[Fee] and gas limit for the transaction.
The first signer is the primary signer and the one which pays the fee.
The fee can be calculated based on the cost of evaluating the body and doing signature
verification of the signers. This can be estimated via simulation.
##### Defined in
lumina\_node\_wasm.d.ts:319
*
#### signer\_infos
> signer\_infos: SignerInfo[]
Defines the signing modes for the required signers.
The number and order of elements must match the required signers from transaction
[TxBody]’s messages. The first element is the primary signer and the oneFee
which pays the [].
##### Defined in
lumina\_node\_wasm.d.ts:327
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:311
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:310
*
lumina-node-wasm / Blob
Arbitrary data that can be stored in the network within certain [Namespace].
#### new Blob()
> new Blob(namespace, data, app_version): Blob
Create a new blob with the given data within the [Namespace].
##### Parameters
###### namespace
###### data
Uint8Array\<ArrayBufferLike\>
###### app\_version
##### Returns
##### Defined in
lumina\_node\_wasm.d.ts:351
#### commitment
> commitment: Commitment
A [Commitment] computed from the [Blob]s data.
##### Defined in
lumina\_node\_wasm.d.ts:355
*
#### data
> data: Uint8Array\<ArrayBufferLike\>
Data stored within the [Blob].
##### Defined in
lumina\_node\_wasm.d.ts:359
*
#### namespace
> namespace: Namespace
A [Namespace] the [Blob] belongs to.
##### Defined in
lumina\_node\_wasm.d.ts:371
*
#### share\_version
> share\_version: number
Version indicating the format in which [Share]s should be created from this [Blob].
##### Defined in
lumina\_node\_wasm.d.ts:375
#### 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:363
*
#### 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
##### 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
###### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:381
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:343
*
#### clone()
> clone(): Blob
Clone a blob creating a new deep copy of it.
##### Returns
##### Defined in
lumina\_node\_wasm.d.ts:347
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:342
*
#### toJSON()
> toJSON(): Object
* Return copy of self without private attributes.
##### Returns
Object
##### Defined in
lumina\_node\_wasm.d.ts:337
*
#### toString()
> toString(): string
Return stringified version of self.
##### Returns
string
##### Defined in
lumina\_node\_wasm.d.ts:341
*
lumina-node-wasm / BlobParams
Params defines the parameters for the blob module.
#### gas\_per\_blob\_byte
> gas\_per\_blob\_byte: number
Gas cost per blob byte
##### Defined in
lumina\_node\_wasm.d.ts:408
*
#### gov\_max\_square\_size
> gov\_max\_square\_size: bigint
Max square size
##### Defined in
lumina\_node\_wasm.d.ts:412
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:404
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:403
*
#### toJSON()
> toJSON(): Object
* Return copy of self without private attributes.
##### Returns
Object
##### Defined in
lumina\_node\_wasm.d.ts:398
*
#### toString()
> toString(): string
Return stringified version of self.
##### Returns
string
##### Defined in
lumina\_node\_wasm.d.ts:402
*
lumina-node-wasm / BlobsAtHeight
List of blobs together with height they were published at
#### blobs
> blobs: Blob[]
Published blobs
##### Defined in
lumina\_node\_wasm.d.ts:433
*
#### height
> height: bigint
Height the blobs were published at
##### Defined in
lumina\_node\_wasm.d.ts:437
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:429
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:428
*
#### toJSON()
> toJSON(): Object
* Return copy of self without private attributes.
##### Returns
Object
##### Defined in
lumina\_node\_wasm.d.ts:423
*
#### toString()
> toString(): string
Return stringified version of self.
##### Returns
string
##### Defined in
lumina\_node\_wasm.d.ts:427
*
lumina-node-wasm / Block
Blocks consist of a header, transactions, votes (the commit), and a list of
evidence of malfeasance (i.e. signing conflicting votes).
This is a modified version of [tendermint::block::Block] which contains
modifications that Celestia introduced.
[data-mod]: https://github.com/celestiaorg/celestia-core/blob/a1268f7ae3e688144a613c8a439dd31818aae07d/proto/tendermint/types/types.proto#L84-L104
#### data
> data: Data
Transaction data
##### Defined in
lumina\_node\_wasm.d.ts:468
*
#### evidence
> readonly evidence: Evidence[]
Evidence of malfeasance
##### Defined in
lumina\_node\_wasm.d.ts:456
*
#### header
Block header
##### Defined in
lumina\_node\_wasm.d.ts:460
*
#### lastCommit
Last commit, should be None for the initial block.
##### Defined in
lumina\_node\_wasm.d.ts:464
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:452
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:451
*
lumina-node-wasm / BlockId
Block identifiers which contain two distinct Merkle roots of the block, as well as the number of parts in the block.
#### hash
> hash: string
The block’s main hash is the Merkle root of all the fields in the block header.
##### Defined in
lumina\_node\_wasm.d.ts:481
*
#### part\_set\_header
> part\_set\_header: PartsHeader
Parts header (if available) is used for secure gossipping of the block during
consensus. It is the Merkle root of the complete serialized block cut into parts.
PartSet is used to split a byteslice of data into parts (pieces) for transmission.
By splitting data into smaller parts and computing a Merkle root hash on the list,
you can verify that a part is legitimately part of the complete data, and the part
can be forwarded to other peers before all the parts are known. In short, it’s
a fast way to propagate a large file over a gossip network.
PartSetHeader in protobuf is defined as never nil using the gogoproto annotations.
This does not translate to Rust, but we can indicate this in the domain type.
##### Defined in
lumina\_node\_wasm.d.ts:497
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:477
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:476
*
lumina-node-wasm / BlockRange
A range of blocks between start and end height, inclusive
#### end
> end: bigint
Last block height in range
##### Defined in
lumina\_node\_wasm.d.ts:518
*
#### start
> start: bigint
First block height in range
##### Defined in
lumina\_node\_wasm.d.ts:522
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:514
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:513
*
#### toJSON()
> toJSON(): Object
* Return copy of self without private attributes.
##### Returns
Object
##### Defined in
lumina\_node\_wasm.d.ts:508
*
#### toString()
> toString(): string
Return stringified version of self.
##### Returns
string
##### Defined in
lumina\_node\_wasm.d.ts:512
*
lumina-node-wasm / BroadcastMode
BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method.
#### Async
> readonly static Async: BroadcastMode
BroadcastMode Async defines a tx broadcasting mode where the client returns
immediately.
##### Defined in
lumina\_node\_wasm.d.ts:536
*
#### Block
> readonly static Block: BroadcastMode
DEPRECATED: use BroadcastMode Sync instead,BroadcastMode Block is not supported by the SDK from v0.47.x onwards.
##### Defined in
lumina\_node\_wasm.d.ts:541
*
#### Sync
> readonly static Sync: BroadcastMode
BroadcastMode Sync defines a tx broadcasting mode where the client waits for
a CheckTx execution response only.
##### Defined in
lumina\_node\_wasm.d.ts:546
*
#### Unspecified
> readonly static Unspecified: BroadcastMode
zero-value for mode ordering
##### Defined in
lumina\_node\_wasm.d.ts:550
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:531
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:530
*
lumina-node-wasm / Coin
Coin defines a token with a denomination and an amount.
#### amount
> amount: bigint
##### Defined in
lumina\_node\_wasm.d.ts:33
*
#### denom
> denom: string
##### Defined in
lumina\_node\_wasm.d.ts:32
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:559
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:558
*
lumina-node-wasm / Commit
Commit contains the justification (ie. a set of signatures) that a block was
committed by a set of validators.
#### block\_id
> block\_id: BlockId
Block ID
##### Defined in
lumina\_node\_wasm.d.ts:573
*
#### height
> height: bigint
Block height
##### Defined in
lumina\_node\_wasm.d.ts:577
*
#### round
> round: number
Round
##### Defined in
lumina\_node\_wasm.d.ts:581
*
#### signatures
> signatures: CommitSig[]
Signatures
##### Defined in
lumina\_node\_wasm.d.ts:585
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:569
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:568
*
lumina-node-wasm / CommitSig
CommitSig represents a signature of a validator. It’s a part of the Commit and can
be used to reconstruct the vote set given the validator set.
#### vote\_type
> vote\_type: CommitVoteType
vote type of a validator
##### Defined in
lumina\_node\_wasm.d.ts:599
#### vote
##### Get Signature
> get vote(): CommitVote
vote, if received
###### Returns
##### Set Signature
> set vote(value): void
vote, if received
###### Parameters
####### value
###### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:603
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:595
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:594
*
lumina-node-wasm / CommitVote
Value of the validator vote
#### timestamp
> timestamp: string
Timestamp
##### Defined in
lumina\_node\_wasm.d.ts:628
*
#### validator\_address
> validator\_address: string
Address of the voting validator
##### Defined in
lumina\_node\_wasm.d.ts:632
#### signature
##### Get Signature
> get signature(): Signature
Signature
###### Returns
##### Set Signature
> set signature(value): void
Signature
###### Parameters
####### value
###### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:620
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:616
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:615
*
lumina-node-wasm / Commitment
A merkle hash used to identify the [Blob]s 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 [Share]s isShare
designed in a way to allow easy and cheap proving of the []s inclusion in themerkle hash
block. It is computed as a [] of all the [Nmt] subtree roots created fromExtendedDataSquare
the blob shares included in the [] 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:
`text`
NMT: row root
/ \
o subtree root
/ \ / \
_________________
EDS row: | s | s | s1 | s2 |
Using subtree roots as a base for [Commitment] computation allows for much smallerShare
inclusion proofs than when the []s would be used directly, but it imposes someBlob
constraints on how the []s can be placed in the [ExtendedDataSquare]. You canshare commitment rules
read more about that in the [].
[Blob]: crate::BlobShare
[]: crate::share::ShareMsgPayForBlobs
[]: celestia_proto::celestia::blob::v1::MsgPayForBlobsmerkle hash
[]: tendermint::merkle::simple_hash_from_byte_vectorsNmt
[]: crate::nmt::NmtExtendedDataSquare
[]: crate::ExtendedDataSquareshare commitment rules
[]: https://github.com/celestiaorg/celestia-app/blob/main/specs/src/specs/data_square_layout.md#blob-share-commitment-rules$3
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:699
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:698
*
#### hash()
> hash(): Uint8Array\<ArrayBufferLike\>
Hash of the commitment
##### Returns
Uint8Array\<ArrayBufferLike\>
##### Defined in
lumina\_node\_wasm.d.ts:703
*
#### toJSON()
> toJSON(): Object
* Return copy of self without private attributes.
##### Returns
Object
##### Defined in
lumina\_node\_wasm.d.ts:693
*
#### toString()
> toString(): string
Return stringified version of self.
##### Returns
string
##### Defined in
lumina\_node\_wasm.d.ts:697
*
lumina-node-wasm / ConfigResponse
Response holding consensus node configuration.
#### halt\_height
> halt\_height: bigint
A height at which the node should stop advancing state.
##### Defined in
lumina\_node\_wasm.d.ts:716
*
#### pruning\_interval
> pruning\_interval: bigint
Amount of blocks used as an interval to trigger prunning.
##### Defined in
lumina\_node\_wasm.d.ts:728
*
#### pruning\_keep\_recent
> pruning\_keep\_recent: bigint
How many recent blocks are stored by the node.
##### Defined in
lumina\_node\_wasm.d.ts:732
#### minimum\_gas\_price
##### Get Signature
> get minimum\_gas\_price(): number
Minimum gas price for the node to accept tx. Value is in utia denom.
###### Returns
number
##### Set Signature
> set minimum\_gas\_price(value): void
Minimum gas price for the node to accept tx. Value is in utia denom.
###### Parameters
####### value
number
###### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:720
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:712
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:711
*
lumina-node-wasm / ConflictingBlock
Conflicting block detected in light client attack
#### signed\_header
> signed\_header: SignedHeader
Signed header
##### Defined in
lumina\_node\_wasm.d.ts:745
*
#### validator\_set
> validator\_set: ValidatorSet
Validator set
##### Defined in
lumina\_node\_wasm.d.ts:749
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:741
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:740
*
lumina-node-wasm / ConnectionCountersSnapshot
Network connection information
#### num\_connections
> num\_connections: number
The total number of connections, both pending and established.
##### Defined in
lumina\_node\_wasm.d.ts:770
*
#### num\_established
> num\_established: number
The number of outgoing connections being established.
##### Defined in
lumina\_node\_wasm.d.ts:782
*
#### num\_established\_incoming
> num\_established\_incoming: number
The number of established incoming connections.
##### Defined in
lumina\_node\_wasm.d.ts:774
*
#### num\_established\_outgoing
> num\_established\_outgoing: number
The number of established outgoing connections.
##### Defined in
lumina\_node\_wasm.d.ts:778
*
#### num\_pending
> num\_pending: number
The total number of pending connections, both incoming and outgoing.
##### Defined in
lumina\_node\_wasm.d.ts:794
*
#### num\_pending\_incoming
> num\_pending\_incoming: number
The total number of pending connections, both incoming and outgoing.
##### Defined in
lumina\_node\_wasm.d.ts:786
*
#### num\_pending\_outgoing
> num\_pending\_outgoing: number
The number of outgoing connections being established.
##### Defined in
lumina\_node\_wasm.d.ts:790
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:766
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:765
*
#### toJSON()
> toJSON(): Object
* Return copy of self without private attributes.
##### Returns
Object
##### Defined in
lumina\_node\_wasm.d.ts:760
*
#### toString()
> toString(): string
Return stringified version of self.
##### Returns
string
##### Defined in
lumina\_node\_wasm.d.ts:764
*
lumina-node-wasm / ConsAddress
Address of a consensus node.
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:811
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:810
*
#### toJSON()
> toJSON(): Object
* Return copy of self without private attributes.
##### Returns
Object
##### Defined in
lumina\_node\_wasm.d.ts:805
*
#### toString()
> toString(): string
Return stringified version of self.
##### Returns
string
##### Defined in
lumina\_node\_wasm.d.ts:809
*
lumina-node-wasm / Data
Data contained in a [Block].
[Block]: crate::block::Block
#### hash
> hash: Uint8Array\<ArrayBufferLike\>
Hash is the root of a binary Merkle tree where the leaves of the tree are
the row and column roots of an extended data square. Hash is often referred
to as the "data root".
##### Defined in
lumina\_node\_wasm.d.ts:832
*
#### square\_size
> square\_size: bigint
Square width of original data square.
##### Defined in
lumina\_node\_wasm.d.ts:836
*
#### transactions
> readonly transactions: Uint8Array\<ArrayBufferLike\>[]
Transactions
##### Defined in
lumina\_node\_wasm.d.ts:826
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:822
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:821
*
lumina-node-wasm / 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.
`no_runuse celestia_types::{ExtendedHeader, Height, Share};
use celestia_types::nmt::{Namespace, NamespaceProof};
fn extended_header() -> ExtendedHeader {
unimplemented!();
}
fn shares_with_proof(_: u64, _: &Namespace) -> (Vec
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());
`
[ExtendedDataSquare]: crate::eds::ExtendedDataSquare
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:886
*
#### 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:890
*
#### columnRoots()
> columnRoots(): any[]
Merkle roots of the [ExtendedDataSquare] columns.
##### Returns
any[]
##### Defined in
lumina\_node\_wasm.d.ts:894
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:885
*
#### 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:900
*
#### 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:904
*
#### rowRoots()
> rowRoots(): any[]
Merkle roots of the [ExtendedDataSquare] rows.
##### Returns
any[]
##### Defined in
lumina\_node\_wasm.d.ts:908
*
#### squareWidth()
> squareWidth(): number
Get the size of the [ExtendedDataSquare] for which this header was built.
##### Returns
number
##### Defined in
lumina\_node\_wasm.d.ts:912
*
#### toJSON()
> toJSON(): Object
* Return copy of self without private attributes.
##### Returns
Object
##### Defined in
lumina\_node\_wasm.d.ts:880
*
#### toString()
> toString(): string
Return stringified version of self.
##### Returns
string
##### Defined in
lumina\_node\_wasm.d.ts:884
*
lumina-node-wasm / DuplicateVoteEvidence
Duplicate vote evidence
#### timestamp
> timestamp: string
Timestamp
##### Defined in
lumina\_node\_wasm.d.ts:925
*
#### total\_voting\_power
> total\_voting\_power: bigint
Total voting power
##### Defined in
lumina\_node\_wasm.d.ts:929
*
#### validator\_power
> validator\_power: bigint
Validator power
##### Defined in
lumina\_node\_wasm.d.ts:933
*
#### vote\_a
> vote\_a: Vote
Vote A
##### Defined in
lumina\_node\_wasm.d.ts:937
*
#### vote\_b
> vote\_b: Vote
Vote B
##### Defined in
lumina\_node\_wasm.d.ts:941
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:921
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:920
*
lumina-node-wasm / Endpoint
A URL endpoint paired with its configuration.
Use this with withUrl/withUrls to configure endpoints with different settings.
`js
const primary = new Endpoint(
"http://primary:9090"
);
primary = primary.withMetadata("auth", "token1");
const fallback = new Endpoint(
"http://fallback:9090"
);
fallback = fallback.withTimeout(10000);
const client = await GrpcClient
.withUrls([primary, fallback])
.build();
`
#### new Endpoint()
Create a new endpoint with a URL.
##### Parameters
###### url
string
##### Returns
##### Defined in
lumina\_node\_wasm.d.ts:972
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:968
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:967
*
#### withMetadata()
> withMetadata(key, value): Endpoint
Appends ASCII metadata (HTTP/2 header) to requests made to this endpoint.
Note that this method consumes the endpoint and returns an updated instance.
##### Parameters
###### key
string
###### value
string
##### Returns
##### Defined in
lumina\_node\_wasm.d.ts:978
*
#### withMetadataBin()
> withMetadataBin(key, value): Endpoint
Appends binary metadata to requests made to this endpoint.
Keys must have -bin suffix.
Note that this method consumes the endpoint and returns an updated instance.
##### Parameters
###### key
string
###### value
Uint8Array\<ArrayBufferLike\>
##### Returns
##### Defined in
lumina\_node\_wasm.d.ts:986
*
#### withTimeout()
> withTimeout(timeout_ms): Endpoint
Sets the request timeout in milliseconds for this endpoint.
Note that this method consumes the endpoint and returns an updated instance.
##### Parameters
###### timeout\_ms
bigint
##### Returns
##### Defined in
lumina\_node\_wasm.d.ts:992
*
lumina-node-wasm / Evidence
Evidence of malfeasance by validators (i.e. signing conflicting votes or light client attack).
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1293
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1292
*
lumina-node-wasm / 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.
`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");
`
#### commit
> readonly commit: any
Commit metadata and signatures from validators committing the block.
##### Defined in
lumina\_node\_wasm.d.ts:1418
*
#### dah
> dah: DataAvailabilityHeader
Header of the block data availability.
##### Defined in
lumina\_node\_wasm.d.ts:1430
*
#### header
> readonly header: any
Tendermint block header.
##### Defined in
lumina\_node\_wasm.d.ts:1422
*
#### validatorSet
> readonly validatorSet: any
Information about the set of validators commiting the block.
##### Defined in
lumina\_node\_wasm.d.ts:1426
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1336
*
#### clone()
> clone(): ExtendedHeader
Clone a header producing a deep copy of it.
##### Returns
##### Defined in
lumina\_node\_wasm.d.ts:1340
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1335
*
#### hash()
> hash(): string
Get the block hash.
##### Returns
string
##### Defined in
lumina\_node\_wasm.d.ts:1344
*
#### height()
> height(): bigint
Get the block height.
##### Returns
bigint
##### Defined in
lumina\_node\_wasm.d.ts:1348
*
#### previousHeaderHash()
> previousHeaderHash(): string
Get the hash of the previous header.
##### Returns
string
##### Defined in
lumina\_node\_wasm.d.ts:1352
*
#### time()
> time(): number
Get the block time.
##### Returns
number
##### Defined in
lumina\_node\_wasm.d.ts:1356
*
#### toJSON()
> toJSON(): Object
* Return copy of self without private attributes.
##### Returns
Object
##### Defined in
lumina\_node\_wasm.d.ts:1330
*
#### toString()
> toString(): string
Return stringified version of self.
##### Returns
string
##### Defined in
lumina\_node\_wasm.d.ts:1334
*
#### validate()
> validate(): void
Decode protobuf encoded header and then validate it.
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1360
*
#### verify()
> verify(untrusted): void
Verify a chain of adjacent untrusted headers and make sure
they are adjacent to self.
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
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1370
*
#### verifyAdjacentRange()
> verifyAdjacentRange(untrusted): void
Verify a chain of adjacent untrusted headers and make sure
they are adjacent to self.
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().
`js`
const genesis = hdr0;
const headers = [hrd1, hdr2, hdr3];
genesis.verifyAdjacentRange(headers.map(h => h.clone()));
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
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1392
*
#### verifyRange()
> verifyRange(untrusted): void
Verify a chain of adjacent untrusted headers.
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().
`js`
const genesis = hdr0;
const headers = [hrd1, hdr2, hdr3];
genesis.verifyRange(headers.map(h => h.clone()));
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
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1414
*
lumina-node-wasm / Fee
Fee includes the amount of coins paid in fees and the maximum
gas to be used by the transaction. The ratio yields an effective "gasprice",
which must be above some miminum to be accepted into the mempool.
#### amount
> amount: Coin[]
amount is the amount of coins to be paid as a fee
##### Defined in
lumina\_node\_wasm.d.ts:1457
*
#### gas\_limit
> gas\_limit: bigint
gas_limit is the maximum gas that can be used in transaction processing
before an out of gas error occurs
##### Defined in
lumina\_node\_wasm.d.ts:1462
*
#### granter
> readonly granter: string
if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used
to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does
not support fee grants, this will fail
##### Defined in
lumina\_node\_wasm.d.ts:1447
*
#### payer
> readonly payer: string
if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees.
the payer must be a tx signer (and thus have signed this field in AuthInfo).
setting this field does not change the ordering of required signers for the transaction.
##### Defined in
lumina\_node\_wasm.d.ts:1453
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1441
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1440
*
lumina-node-wasm / GasEstimate
Result of gas price and usage estimation
#### price
> price: number
Gas price estimated based on last 5 blocks
##### Defined in
lumina\_node\_wasm.d.ts:1475
*
#### usage
> usage: bigint
Simulated transaction gas usage
##### Defined in
lumina\_node\_wasm.d.ts:1479
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1471
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1470
*
lumina-node-wasm / GasInfo
GasInfo defines tx execution gas context.
#### gas\_used
> gas\_used: bigint
GasUsed is the amount of gas actually consumed.
##### Defined in
lumina\_node\_wasm.d.ts:1492
*
#### gas\_wanted
> gas\_wanted: bigint
GasWanted is the maximum units of work we allow this tx to perform.
##### Defined in
lumina\_node\_wasm.d.ts:1496
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1488
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1487
*
lumina-node-wasm / GetTxResponse
Response to GetTx
#### tx
> tx: Tx
Response Transaction
##### Defined in
lumina\_node\_wasm.d.ts:1513
*
#### tx\_response
> tx\_response: TxResponse
TxResponse to a Query
##### Defined in
lumina\_node\_wasm.d.ts:1509
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1505
*
#### free()
> free(): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1504
*
lumina-node-wasm / GrpcClient
Celestia gRPC client, for builder see [GrpcClientBuilder]
#### appVersion
> readonly appVersion: Promise\<AppVersion\>
AppVersion of the client
##### Defined in
lumina\_node\_wasm.d.ts:1749
*
#### chainId
> readonly chainId: Promise\<string\>
Chain id of the client
##### Defined in
lumina\_node\_wasm.d.ts:1753
#### \[dispose\]()
> \[dispose\](): void
##### Returns
void
##### Defined in
lumina\_node\_wasm.d.ts:1522
*
#### abciQuery()
> abciQuery(data, path, height, prove): Promise\<AbciQueryResponse\>
Issue a direct ABCI query to the application
##### Parameters
###### data
Uint8Array\<ArrayBufferLike\>
###### path
string
###### height
bigint
###### prove
boolean
##### Returns
##### Defined in
lumina\_node\_wasm.d.ts:1526
*
#### broadcastBlobs()
> broadcastBlobs(blobs, tx_config?): Promise\<BroadcastedTx\>
Broadcast blobs to the celestia network, and return without confirming.
js
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 broadcastedTx = await txClient.broadcastBlobs([blob]);
console.log("Tx hash:", broadcastedTx.hash);
const txInfo = await txClient.confirmTx(broadcastedTx);
`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().`js
const blobs = [blob1, blob2, blob3];
await txClient.broadcastBlobs(blobs.map(b => b.clone()));
`##### Parameters
###### blobs
Blob[]###### tx\_config?
TxConfig##### Returns
Promise\<BroadcastedTx\>##### Defined in
lumina\_node\_wasm.d.ts:1552
*
#### broadcastMessage()
> broadcastMessage(
message, tx_config?): Promise\<BroadcastedTx\>Broadcast message to the celestia network, and return without confirming.
Example
`js
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 broadcastedTx = await txClient.broadcastMessage(sendMsgAny);
console.log("Tx hash:", broadcastedTx.hash);
const txInfo = await txClient.confirmTx(broadcastedTx);
`##### Parameters
###### message
ProtoAny###### tx\_config?
TxConfig##### Returns
Promise\<BroadcastedTx\>##### Defined in
lumina\_node\_wasm.d.ts:1576
*
#### broadcastTx()
> broadcastTx(
tx_bytes, mode): Promise\<TxResponse\>Broadcast prepared and serialised transaction
##### Parameters
###### tx\_bytes
Uint8Array\<ArrayBufferLike\>###### mode
BroadcastMode##### Returns
Promise\<TxResponse\>##### Defined in
lumina\_node\_wasm.d.ts:1580
*
#### confirmTx()
> confirmTx(
broadcasted_tx, tx_config?): Promise\<TxInfo\>Confirm transaction broadcasted with [
broadcast_blobs] or [broadcast_message].Example
`js
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 broadcastedTx = await txClient.broadcastBlobs([blob]);
console.log("Tx hash:", broadcastedTx.hash);
const txInfo = await txClient.confirmTx(broadcastedTx);
console.log("Confirmed at height:", txInfo.height);
`##### Parameters
###### broadcasted\_tx
BroadcastedTx###### tx\_config?
TxConfig##### Returns
Promise\<TxInfo\>##### Defined in
lumina\_node\_wasm.d.ts:1596
*
#### estimateGasPrice()
> estimateGasPrice(
priority): Promise\<number\>Estimate gas price for given transaction priority based
on the gas prices of the transactions in the last five blocks.
If no transaction is found in the last five blocks, return the network
min gas price.
##### Parameters
###### priority
TxPriority##### Returns
Promise\<number\>##### Defined in
lumina\_node\_wasm.d.ts:1604
*
#### free()
> free():
void##### Returns
void##### Defined in
lumina\_node\_wasm.d.ts:1521
*
#### get\_node\_config()
> get\_node\_config():
Promise\<ConfigResponse\>Get node configuration
##### Returns
Promise\<ConfigResponse\>##### Defined in
lumina\_node\_wasm.d.ts:1663
*
#### getAccount()
> getAccount(
account): Promise\<BaseAccount\>Get account
##### Parameters
###### account
string##### Returns
Promise\<BaseAccount\>##### Defined in
lumina\_node\_wasm.d.ts:1608
*
#### getAccounts()
> getAccounts():
Promise\<BaseAccount[]\>Get accounts
##### Returns
Promise\<BaseAccount[]\>##### Defined in
lumina\_node\_wasm.d.ts:1612
*
#### getAllBalances()
> getAllBalances(
address): Promise\<Coin[]\>Get balance of all coins
##### Parameters
###### address
string##### Returns
Promise\<Coin[]\>##### Defined in
lumina\_node\_wasm.d.ts:1616
*
#### getAuthParams()
> getAuthParams():
Promise\<AuthParams\>Get auth params
##### Returns
Promise\<AuthParams\>##### Defined in
lumina\_node\_wasm.d.ts:1620
*
#### getBalance()
> getBalance(
address, denom): Promise\<Coin\>Retrieves the Celestia coin balance for the given address.
##### Parameters
###### address
string###### denom
string##### Returns
Promise\<Coin\>##### Defined in
lumina\_node\_wasm.d.ts:1624
*
#### getBlobParams()
> getBlobParams():
Promise\<BlobParams\>Get blob params
##### Returns
Promise\<BlobParams\>##### Defined in
lumina\_node\_wasm.d.ts:1628
*
#### getBlockByHeight()
> getBlockByHeight(
height): Promise\<Block\>Get block by height
##### Parameters
###### height
bigint##### Returns
Promise\<Block\>##### Defined in
lumina\_node\_wasm.d.ts:1632
*
#### getLatestBlock()
> getLatestBlock():
Promise\<Block\>Get latest block
##### Returns
Promise\<Block\>##### Defined in
lumina\_node\_wasm.d.ts:1636
*
#### getSpendableBalances()
> getSpendableBalances(
address): Promise\<Coin[]\>Get balance of all spendable coins
##### Parameters
###### address
string##### Returns
Promise\<Coin[]\>##### Defined in
lumina\_node\_wasm.d.ts:1640
*
#### getTotalSupply()
> getTotalSupply():
Promise\<Coin[]\>Get total supply
##### Returns
Promise\<Coin[]\>##### Defined in
lumina\_node\_wasm.d.ts:1644
*
#### getTx()
> getTx(
hash): Promise\<GetTxResponse\>Get Tx
##### Parameters
###### hash
string##### Returns
Promise\<GetTxResponse\>##### Defined in
lumina\_node\_wasm.d.ts:1648
*
#### getVerifiedBalance()
> getVerifiedBalance(
address, header): Promise\<Coin\>Retrieves the verified Celestia coin balance for the address.
Notes
This returns the verified balance which is the one that was reported by
the previous network block. In other words, if you transfer some coins,
you need to wait 1 more block in order to see the new balance. If you want
something more immediate then use [
GrpcClient::get_balance].##### Parameters
###### address
string###### header
ExtendedHeader##### Returns
Promise\<Coin\>##### Defined in
lumina\_node\_wasm.d.ts:1659
*
#### simulate()
> simulate(
tx_bytes): Promise\<GasInfo\>Simulate prepared and serialised transaction, returning simulated gas usage
##### Parameters
###### tx\_bytes
Uint8Array\<ArrayBufferLike\>##### Returns
Promise\<GasInfo\>##### Defined in
lumina\_node\_wasm.d.ts:1667
*
#### submitBlobs()
> submitBlobs(
blobs, tx_config?): Promise\<TxInfo\>Submit blobs to the celestia network.
Example
`js
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, memo: "foo" });
`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().`js
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:1692
*
#### submitMessage()
> submitMessage(
message, tx_config?): Promise\<TxInfo\>Submit message to the celestia network.
Example
`js
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:1714
*
#### txStatus()
> txStatus(
hash): Promise\<TxStatusResponse\>Get status of the transaction
##### Parameters
###### hash
string##### Returns
Promise\<TxStatusResponse\>##### Defined in
lumina\_node\_wasm.d.ts:1718
*
#### withUrl()
>
static withUrl(url): GrpcClientBuilderCreate a builder for [
GrpcClient] connected to url.Accepts a string, an
Endpoint, or an array of strings/endpoints.Example
`js
const client = await GrpcClient.withUrl("http://localhost:18080").build();
`##### Parameters
###### url
UrlsOrEndpoints##### Returns
GrpcClientBuilder##### Defined in
lumina\_node\_wasm.d.ts:1730
*
#### withUrls()
>
static withUrls(urls): GrpcClientBuilderCreate a builder for [
GrpcClient] with multiple URL endpoints for fallback support.Accepts a string, an
Endpoint, or an array of strings/endpoints.When multiple endpoints are configured, the client will automatically
fall back to the next endpoint if a network-related error occurs.
Example
`js
const client = await GrpcClient.withUrls(["http://primary:9090", "http://fallback:9090"]).build();
`##### Parameters
###### urls
UrlsOrEndpoints##### Returns
GrpcClientBuilder##### Defined in
lumina\_node\_wasm.d.ts:1745
*
lumina-node-wasm / GrpcClientBuilder
Class: GrpcClientBuilder
Builder for [
GrpcClient] and [TxClient].Url must point to a grpc-web proxy.
Keyless client example
`js
const client = await GrpcClient
.withUrl("http://127.0.0.1:18080")
.build()// With config:
const endpoint = new Endpoint("http://127.0.0.1:18080").withTimeout(BigInt(5000));
const client = await GrpcClient
.withUrl(endpoint)
.build()
`Transaction client examples
$3
`js
import { secp256k1 } from "@noble/curves/secp256k1";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 client = await GrpcClient
.withUrl("http://127.0.0.1:18080")
.withPubkeyAndSigner(pubKey, signer)
.build();
`$3
`js
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 client = await GrpcClient
.withUrl("http://127.0.0.1:18080")
.withPubkeyAndSigner(keys.pubKey, signer)
.build()
`$3
#### \[dispose\]()
> \[dispose\]():
void##### Returns
void##### Defined in
lumina\_node\_wasm.d.ts:1815
*
#### build()
GrpcClientbuild gRPC client
##### Returns
GrpcClient##### Defined in
lumina\_node\_wasm.d.ts:1819
*
#### free()
> free():
void##### Returns
void##### Defined in
lumina\_node\_wasm.d.ts:1814
*
#### withPubkeyAndSigner()
> withPubkeyAndSigner(
account_pubkey, signer_fn): GrpcClientBuilderAdd public key and signer to the client being built
Note that this method consumes builder and returns updated instance of it.
Make sure to re-assign it if you keep builder in a variable.
##### Parameters
###### account\_pubkey
Uint8Array\<ArrayBufferLike\>###### signer\_fn
SignerFn##### Returns
GrpcClientBuilder##### Defined in
lumina\_node\_wasm.d.ts:1826
*
#### withUrl()
> withUrl(
url): GrpcClientBuilderSet the
url of the grpc-web server to connect to.Accepts a string, an
Endpoint, or an array of strings/endpoints.Note that this method consumes builder and returns updated instance of it.
Make sure to re-assign it if you keep builder in a variable.
##### Parameters
###### url
UrlsOrEndpoints##### Returns
GrpcClientBuilder##### Defined in
lumina\_node\_wasm.d.ts:1835
*
#### withUrls()
> withUrls(
urls): GrpcClientBuilderAdd multiple URL endpoints at once for fallback support.
Accepts a string, an
Endpoint, or an array of strings/endpoints.When multiple endpoints are configured, the client will automatically
fall back to the next endpoint if a network-related error occurs.
Note that this method consumes builder and returns updated instance of it.
Make sure to re-assign it if you keep builder in a variable.
##### Parameters
###### urls
UrlsOrEndpoints##### Returns
GrpcClientBuilder`##### Defined in
lumina\_node\_wasm.d.ts:1847
*
[lumina-