0.3.3 • Published 9 months ago

cosmolava-client v0.3.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

conventional commits node Module type: CJS License: MIT NPM Downloads

npm

JavaScript Style Guide

cosmolava-client

Lava http client to use lava-sdk with cosmjs

This package is currently in the Alpha stage and is not production-ready for all usecases. Because of lava-sdk in Alpha

Installation

npm

npm i cosmolava-client

yarn

yarn add cosmolava-client

Usage

  1. Use build in lava-sdk instance
const cosmoLavaHttpClient = await createCosmoLavaHttpClient({
    privateKey: process.env.PRIVATE_KEY,
    chainID: process.env.CHAIN_ID ?? 'LAV1',
    geolocation: process.env.GEO ?? '1'
})
const tendermintLavaClient = await Tendermint34Client.create(cosmoLavaHttpClient)
// fully functional cosmjs client :)
const client = await SigningStargateClient.createWithSigner(tendermintLavaClient, signer)
  1. Provide your own lava-sdk instance(To use this approach you need to check lava-sdk compatibility with this package by yourself)
const lavaSdk = await new LavaSDK({
    privateKey: process.env.PRIVATE_KEY,
    chainID: process.env.CHAIN_ID ?? 'LAV1',
    geolocation: process.env.GEO ?? '1'
  })

const lavaClient = await CosmoLavaHttpClient.create(lavaSdk)
const tendermintLavaClient = await Tendermint34Client.create(lavaClient)
// fully functional cosmjs client :)
const client = await SigningStargateClient.createWithSigner(tendermintLavaClient, signer)

Check examples folder for more examples

You want to get involved? 😍

Please submit a pull request or open an issue ❤️