cuprumtezlib
v0.6.5
Published
Cuprumcoin JavaScript API
Downloads
1
Readme
cuprumtezlib - A JS Library for Cuprumcoin
Getting Started
npm install cuprumtezlib
// Import library or individual modules
import Sotez, { utility, forge, crypto, ledger } from 'cuprumtezlib';
// Or using require
const Sotez = require('cuprumtezlib').default;
const { utility, forge, crypto, ledger } = require('cuprumtezlib');
const sotez = new Sotez('RPCURL');
var cli = require("enc.cli.js")
// Imported Address
const importedkey = cli.eztz.crypto.extractKeys("secretKey")
console.log("Imported address:", importedkey);
// Address Generation
var address = cli.eztz.crypto.generateKeysNoSeed()
console.log("Generated Address:", address);
// Checking Balance
sotez.getBalance(address.pkh)
.then(balance => {
console.log(`Account balance : ${balance}`)
});
// Query chain data
sotez.query('/chains/main/blocks/head')
.then(response => console.log(response));
Development
npm install
npm run build
Compiled files will be located in the lib
folder.
Distribution files will be located in the dist/node
and dist/web
folders.
License
MIT