Javascript SDK of WoopChain protocol
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
neeboo e7ace6f172 [WIP] start adding unit test to repo 6 years ago
examples [WIP] start adding unit test to repo 6 years ago
packages [WIP] start adding unit test to repo 6 years ago
scripts [WIP] start adding unit test to repo 6 years ago
typings [feat] added recover to Transaction 6 years ago
.babelrc [WIP] add dependencies 6 years ago
.eslintignore [feat] update a lot 6 years ago
.gitignore [chore] added more dones in README 6 years ago
.prettierignore [WIP] add dependencies 6 years ago
.prettierrc [WIP] add dependencies 6 years ago
README.md [WIP] update @harmony/core 6 years ago
gulpfile.js [WIP] update @harmony/core 6 years ago
package.json [WIP] start adding unit test to repo 6 years ago
tsconfig.base.json added harmony-network and new bundler 6 years ago
tsconfig.json [WIP] update @harmony/core 6 years ago
tsconfig.test.json [WIP] start adding unit test to repo 6 years ago
tslint.json [WIP] add dependencies 6 years ago
webpack.config.js added harmony-network and new bundler 6 years ago

README.md

Harmony-SDK-Core

A Harmony's blockchain javascript library

It's a mono-repo library, not yet published to npm.

Packages

  1. harmony-core
  2. harmony-account
  3. harmony-crypto
  4. harmony-network
  5. harmony-utils
  6. harmony-transaction

Usage

  1. git clone and make sure you have node.js and yarn installed

  2. cleanup and build

    yarn install && yarn bootstrap && yarn dist
    
  3. open folder examples and node testNode.js

Example

** This package is not published to npm **


const { Account, Wallet } = require('@harmony/account');
const { isAddress, isPrivateKey, numberToHex } = require('@harmony/utils');


async function createAndEncrypt() {
  const wallet = new Wallet();

  const mne = wallet.generateMnemonic();

  console.log('---hint: please write these down');
  console.log(`${mne}`);

  const newAcc = wallet.addByMnemonic(mne);

  const password = '123456';
  console.log('---hint: we use this dump password to encrypt, lol');
  console.log(`${password}`);

  await wallet.encryptAccount(newAcc.address, password);

  console.log('---hint: Encrypting...');
  console.log('---hint: Done!');
  console.log('---hint: Your account address is:');
  const encrypted = wallet.getAccount(newAcc.address);
  console.log(`${encrypted.address}`);
  console.log('---hint: here is your keyStore file:');
  console.log(`${encrypted.privateKey}`);
}

createAndEncrypt();