[chore] update README.md

@types
neeboo 6 years ago
parent 84a801893f
commit 13559162ea
  1. 37
      README.md
  2. 10
      examples/testContract.js
  3. 6
      examples/testGanache.js
  4. 2
      examples/testNode.js
  5. 2
      examples/testWallet.js

@ -1,20 +1,41 @@
[![npm version](https://img.shields.io/npm/v/@harmony-js/core.svg?style=flat-square)](https://www.npmjs.com/package/@harmony-js/core)
# Harmony-SDK-Core
A Harmony's blockchain javascript library
It's a mono-repo library, not yet published to npm.
# Install from npm/yarn
```bash
# npm
npm install @harmony-js/core@next
# yarn
yarn add @harmony-js/core@next
# tslib may be required, we'd better install it as well
npm install tslib
yarn add tslib
```
# Packages
1. [harmony-core](https://github.com/FireStack-Lab/Harmony-sdk-core/tree/master/packages/harmony-core)
2. [harmony-account](https://github.com/FireStack-Lab/Harmony-sdk-core/tree/master/packages/harmony-account)
3. [harmony-crypto](https://github.com/FireStack-Lab/Harmony-sdk-core/tree/master/packages/harmony-crypto)
4. [harmony-network](https://github.com/FireStack-Lab/Harmony-sdk-core/tree/master/packages/harmony-network)
5. [harmony-utils](https://github.com/FireStack-Lab/Harmony-sdk-core/tree/master/packages/harmony-utils)
6. [harmony-transaction](https://github.com/FireStack-Lab/Harmony-sdk-core/tree/master/packages/harmony-transaction)
1. [@harmony-js/core](https://github.com/FireStack-Lab/Harmony-sdk-core/tree/master/packages/harmony-core)
2. [@harmony-js/account](https://github.com/FireStack-Lab/Harmony-sdk-core/tree/master/packages/harmony-account)
3. [@harmony-js/crypto](https://github.com/FireStack-Lab/Harmony-sdk-core/tree/master/packages/harmony-crypto)
4. [@harmony-js/network](https://github.com/FireStack-Lab/Harmony-sdk-core/tree/master/packages/harmony-network)
5. [@harmony-js/utils](https://github.com/FireStack-Lab/Harmony-sdk-core/tree/master/packages/harmony-utils)
6. [@harmony-js/transaction](https://github.com/FireStack-Lab/Harmony-sdk-core/tree/master/packages/harmony-transaction)
7. [@harmony-js/contract](https://github.com/FireStack-Lab/Harmony-sdk-core/tree/master/packages/harmony-contract)
# Install and Build
# Manually Build
1. make sure you have latest `node.js` and `yarn` installed
2. git clone
@ -27,7 +48,7 @@ It's a mono-repo library, not yet published to npm.
3. cleanup and build
```bash
yarn global add lerna && yarn install && yarn bootstrap && yarn dist
yarn global add lerna && yarn install && lerna bootstrap && lerna link && yarn dist
```

@ -3,13 +3,13 @@
// Then we can use `Contract.methods.call()` to call a method
// Import Main Class
const { Harmony } = require('@harmony/core');
// You can import BN from `@harmony/crypto` or use `Harmony.utils.BN`instead
const { BN } = require('@harmony/crypto');
const { Harmony } = require('@harmony-js/core');
// You can import BN from `@harmony-js/crypto` or use `Harmony.utils.BN`instead
const { BN } = require('@harmony-js/crypto');
// import more utils
const { isArray, ChainType, ChainID } = require('@harmony/utils');
const { isArray, ChainType, ChainID } = require('@harmony-js/utils');
// contract specific utils
const { toUtf8String, toUtf8Bytes } = require('@harmony/contract');
const { toUtf8String, toUtf8Bytes } = require('@harmony-js/contract');
// we import `fs` and `solc` to complile the contract. you can do it in another js file
// but we show it here anyway.

@ -1,6 +1,6 @@
const { Harmony } = require('@harmony/core');
const { ChainID, ChainType } = require('@harmony/utils');
const { SubscribeBlockTracker } = require('@harmony/network');
const { Harmony } = require('@harmony-js/core');
const { ChainID, ChainType } = require('@harmony-js/utils');
const { SubscribeBlockTracker } = require('@harmony-js/network');
const ganache = require('ganache-cli');

@ -1,4 +1,4 @@
const { Harmony } = require('@harmony/core');
const { Harmony } = require('@harmony-js/core');
// const ganache = require('ganache-cli');
var port = 9015;

@ -1,4 +1,4 @@
const { Harmony } = require('@harmony/core');
const { Harmony } = require('@harmony-js/core');
const harmony = new Harmony('https://localhost:9015');

Loading…
Cancel
Save