This Javascript SDK enables browsers and NodeJS clients to interact with the Lum Network.
The library is tested using NodeJS 18.x.
It should also work in all recent browsers.
yarn add @lum-network/sdk-javascript
The SDK code should be documented enough for developers to explore and use it easily. Therefore the documentation might not cover all the capabilities of the SDK. Feel free to contribute if you wish to improve the code documentation and/or the provided samples.
The Documentation contains:
- Installation instructions
- Basic usage
- Code samples
- Code auto-generated documentation
The SDK is based on the @cosmoslogy/telescope implementation and heavily relies on it.
It is intented to be used standalone, without having to import specific CosmJS packages which can get make implementations tricky and messy.
Therefore all types, functions are features from the CosmJS SDK are either re-implemented by this SDK or re-exported for simplicity purposes.
Directly importing the CosmJS SDK or other cryptographic library should be considered bad practice for most use cases.
Do not hesitate to contribute to this repository. This SDK is intended to be a one-stop-shop for all Lum Network javascript implementations and should definitely be improved over time by all its users.
git submodule foreach git pull origin master
If for any reason you do not have the lum
folder at the root of your lumjs
clone you can get it manually:
git clone @github.com:lum-network/chain.git lum
yarn
yarn run codegen
Make sure to run the local chain aside. Do this in a separate terminal window. You can copy the config from config.yml and pass it to the lum folder.
cp config.yml lum/config.yml
cd lum
ignite chain serve --skip-proto
at the root of the project in the initial terminal window run:
yarn test
In order to run the unittest involving Ledger devices you need to do the following:
- Chose which application you want to use for the tests (Cosmos or Lum)
- Remove the
.skip
from all the tests your want to run in./tests/ledger.test.ts
- Connect a Ledger device and open either the Cosmos application or the Lum application
- Run
yarn test tests/ledger.test.ts
- Follow the instructions on your Ledger device to pass each test that require a user input
install act, for instance:
brew install act
simulate the pipeline for a pull request
act pull_request --container-architecture linux/amd64
nb: be patient, this can take up to 15min
🛠 Built with Cosmology
Code built with the help of these related projects:
- @cosmwasm/ts-codegen for generated CosmWasm contract Typescript classes
- @cosmology/telescope a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs.
- chain-registry an npm module for the official Cosmos chain-registry
Contributions are most welcome.
Please test your changes with a local client and add unit tests coverage for your code before submission.