# NibiJS Documentation - v4.1.0
The official TypeScript SDK for the Nibiru blockchain
The NibiJS (@nibiruchain/nibijs
) package makes it possible to interact with Nibiru from a Node.js or browser environment. nibijs
provides simple abstractions for core data structures, serialization, key management, API requests, and the submission of transactions.
The nibijs
source code can be found in the "packages" directory (opens new window). The types and classes generated from Nibiru's .proto
files are inside a separate npm
package called @nibiruchain/protojs
.
# Table of Contents
To learn more about Nibiru, see nibiru.fi/docs (opens new window)
# Installation
@nibiruchain/nibijs (opens new window) is available on the npm registry.
# Usage
The entrypoint for nibijs
is the Sdk
object, which is meant to mimic the root of a command line interface. It can be used for both queries and transactions.
# Example: Creating a wallet
# Example: Querying
# Example: Sending funds
# Example: Transaction with arbitrary messages
# Codebase structure
Directories of @nibiruchain/nibijs | Purpose/Utility |
---|---|
common | home to several commonly needed types, constants and configurations such as Network. |
msg | Implements functions for creating messages (Msg s). These are objects that trigger state-transitions and get wrapped into transactions. |
query | For querying state via the consensus engine of a full-node and the application blockchain interface (ABCI). |
tx | For signing and to submitting transactions given a set of Msg objects. |
wallet | A simple wrapper around the Keplr wallet. This module will grow as support is added for other wallets (like MetaMask). |
@nibiruchain/protojs
provides types generated from the protocol buffers of the Cosmos-SDK, Tendermint Core, and Nibiru Chain. For most use cases, it won't be necessary to interact with this layer.
# Development Quick Start
Install and use
nvm
.Install yarn.
Then, install package dependencies. At the root of the repository, run
Lastly, compile the code in each package.
See HACKING.md (opens new window) for the full development guide. It includes instructions on:
- Running tests
- Generating code for the @nibiruchain/protojs package
- Generating documentation in HTML or Markdown from the comments of @nibiruchain/nibijs
# 🔓 License
This software is licensed under the MIT license. See LICENSE (opens new window) for full disclosure.
© 2023 Nibi, Inc.