Use "/" to Search
# NibiJS
A brief guide on Nibiru's APIs, docs, and resources to broadcast transactions and query the chain.
# Table of Contents
- Nibiru JS (
nibijs
): Installation - Nibiru JS (
nibijs
): Query and Tx Clients - Nibiru JS (
nibijs
): Common Queries - Wallets
- Test Network Tokens (Faucet)
- Running a Full Node
# Nibiru JS (nibijs
): Installation
# Nibiru JS (nibijs
): Query and Tx Clients
# Nibiru JS (nibijs
): Common Queries
Once you have the NibiruQuerier
(called querier
) connected, you can use the following:
Behavior | Description |
---|---|
querier.getAllBalances(address) | Return all token balances for the given address |
querier.getBalance(address, denom) | Return a single token balance for the given address |
querier.tm.block(height) | Return block details by height such as the block has, parent block hash, block height, timestamp, etc. |
querier.getHeight() | Return latest block height |
querier.getBlock() | Return latest block. Passing in the height as an argument is equivalent to querier.tm.block(height) . |
querier.getTxByHash(txHashHex) | Request transaction details using the hexadecimal string for the transaction hash. |
querier.getTxByHashSha(txHashSha) | Request transaction details using its SHA-256 hash, endoed as an array of bytes (Uint8Array in TS, Vec<u8> in Rust). |
# Transaction Hashes
The txHash
returned in block results is a hexadecimal-encoded version of the
SHA-256 cryptographic hash. If you have the tx hash in SHA-256 / bytes form, use
getTxByHashSha
. And if you have the hex string (more common form), use
getTxByHash
.
# BlockResponse.block.header from querier.tm.block(height)
# Wallets
# Test Network Tokens (Faucet)
Web Faucet: app.nibiru.fi/faucet (opens new window)
# Running a Full Node
Please note that for mainnet, you’ll need the latest release from NiibiruChain/nibiru (opens new window) rather than the version used on testnet.