cosmolava-client
TypeScript icon, indicating that this package has built-in type declarations

0.3.3 • Public • Published

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 ❤️

Package Sidebar

Install

npm i cosmolava-client

Weekly Downloads

2

Version

0.3.3

License

MIT

Unpacked Size

529 kB

Total Files

12

Last publish

Collaborators

  • mellifera