MetoNovko / mobix-cosmosjs

Cosmosjs extension and adaptation for the purposes of the Mobix project on Fetch.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mobix-cosmosjs

Cosmosjs extension and adaptation for the purposes of the Mobix project on Fetch.ai

Install

npm install mobix-cosmosjs

Usage

import { Cosmos, Wallet } from 'mobix-cosmosjs';

const chainId = "andromeda-1";
const restEndpoint = "https://rest-andromeda.fetch.ai:443";

const cosmos = new Cosmos(restEndpoint, chainId);
cosmos.setBech32MainPrefix("fetch");
cosmos.setPath("m/44'/118'/0'/0"); //"m/44'/118'/0'/0/0"

const wallet = new Wallet(cosmos);

console.log(wallet)

// Usage:
// wallet.send(denom, toAddress, amount)
// wallet.delegate(denom, validatorAddress, amount)
// ...

Important

You need to add "type": "module" in your package.json file, because of ES modules.

[WARNING] CosmosJS and this extension is under ACTIVE DEVELOPMENT and should be treated as alpha version.

About

Cosmosjs extension and adaptation for the purposes of the Mobix project on Fetch.ai

License:MIT License


Languages

Language:JavaScript 100.0%