0.0.1 • Published 5 years ago
testkuchainjs v0.0.1
This library supports kuchain address generation and verification. It enables you to create an offline signature functions of different types of transaction messages.
WARNING This library is under ACTIVE DEVELOPMENT and should be treated as alpha version. We will remove this warning when we have a release that is stable, secure, and propoerly tested
Installation
NPM
npm install testkuchainjs
Import
NodeJS
const kuchainjs = require("testkuchainjs");
Usage
- Kuchain: Generate Kuchain address from mnemonic
const kuchainjs = require("testkuchainjs");
const chainId = "testing";
const lcdUrl = "http://127.0.0.1:1317";
const kuchain = kuchainjs.network(lcdUrl, chainId);
const mnemonic = "..."
const address = kuchain.getAddress(mnemonic);
const ecpairPriv = kuchain.getECPairPriv(mnemonic);
- Create an account with a specialized auth.
kuchain.newCreateAccMsg("validator", "acc1", auth).then(Msg => {
console.log(JSON.stringify(Msg))
})
...
})
- Sign transaction by using sign and broadcast which use REST API of Kuchain
const signedTx = kuchain.sign(Msg, ecpairPriv);
kuchain.broadcast(signedTx).then(response => console.log(response));
- See more examples of how this library works, see examples.
Supporting Message Types (Updating...)
- If you need more message types, you can commit issues
Documentation
This library is simple and easy to use. We don't have any formal documentation yet other than examples. Ask for help if our examples aren't enough to guide you
Contribution
- Contributions, suggestions, improvements, and feature requests are always welcome