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
npm
npm i cosmolava-client
yarn
yarn add cosmolava-client
- 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)
- 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
Please submit a pull request or open an issue ❤️