diff --git a/README.md b/README.md index f0940f1..f698804 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/examples/testContract.js b/examples/testContract.js index ace7688..be4efc1 100644 --- a/examples/testContract.js +++ b/examples/testContract.js @@ -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. diff --git a/examples/testGanache.js b/examples/testGanache.js index 82f34cd..1fe71f8 100644 --- a/examples/testGanache.js +++ b/examples/testGanache.js @@ -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'); diff --git a/examples/testNode.js b/examples/testNode.js index 29a0206..2879550 100644 --- a/examples/testNode.js +++ b/examples/testNode.js @@ -1,4 +1,4 @@ -const { Harmony } = require('@harmony/core'); +const { Harmony } = require('@harmony-js/core'); // const ganache = require('ganache-cli'); var port = 9015; diff --git a/examples/testWallet.js b/examples/testWallet.js index b93ff13..8e259dd 100644 --- a/examples/testWallet.js +++ b/examples/testWallet.js @@ -1,4 +1,4 @@ -const { Harmony } = require('@harmony/core'); +const { Harmony } = require('@harmony-js/core'); const harmony = new Harmony('https://localhost:9015');